"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),h=e.createBaseVNode("i",{class:"iconfont icon-form-cache-icon"},null,-1),g=e.createBaseVNode("div",{class:"txt"},"已填数据",-1),v=[h,g],p=e.defineComponent({__name:"CacheIcon",setup(C){e.ref();const n=e.ref([]),c=e.inject("formBounding"),i=e.inject("isMobileSize"),l=e.inject("formMode"),r=e.inject("editable"),t=e.ref(!1),s=e.inject("formStore"),u=e.computed(()=>i.value?{left:`${c.left.value+c.width.value}px`,bottom:"40%",transform:"translateX(-100%)"}:{left:`${c.right.value+20}px`,top:"42%"});function f(){if(n.value.length>0){const{showConfirm:o}=e.useConfirm();o({type:"warn",title:"提示",content:"您已填写过该表单",cancelText:"再次填写",confirmText:"查看已填数据",onConfirm:async()=>{t.value=!0},onCancel:()=>{}})}}e.watchEffect(async()=>{const o=e.getSceneType();if(r||e.FormSetting.value.details.checkData===1)return[];if([4,5,6].includes(o)){const a=await e.getAnswerListByD({deviceid:e.getDeviceId(e.globalInject.getFormId()),form_id:e.globalInject.getFormId()});n.value=a}});const m=()=>{t.value=!0};return e.onMounted(()=>{f()}),(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.value?(e.openBlock(),e.createBlock(e.CacheDialog,{key:0,showCacheDialog:t.value,"onUpdate:showCacheDialog":a[0]||(a[0]=d=>t.value=d),cacheDateList:n.value,formStore:e.unref(s)},null,8,["showCacheDialog","cacheDateList","formStore"])):e.createCommentVNode("",!0),n.value.length>0&&e.unref(l)=="input"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"submited-button",style:e.normalizeStyle(u.value),onClick:m},[e.createBaseVNode("div",{class:e.normalizeClass(["main",[e.unref(i)?"mobile":"pc",{active:o.isActive}]])},v,2)],4)):e.createCommentVNode("",!0)],64))}});exports.default=p;
