import{a as s,bN as e,J as t,$ as i,Q as a,q as n,c as o,w as l,i as c,o as r,C as g,D as u,F as f,t as h,a0 as k,v as m,G as v,A as d,E as I}from"./index-DL8B2Mxu.js";import{_ as p}from"./u-icon.CLOPtL2B.js";import{r as _}from"./uni-app.es.BSVEa1f2.js";import{_ as L}from"./u-button.D-oh2uo-.js";import{N as b}from"./noData.DBhgrD9Y.js";import{_ as D}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./resources.DipqUmnN.js";const x=D({components:{NoData:b},data:()=>({show:!1,signListInvoke:[]}),async onLoad(e){this.signListInvoke=await this.getSignData(),this.clearChoose();let t=decodeURIComponent(e.signVal);t&&this.setMainSignInvokeWithValue(t),s("sign-fieldKey",e.fieldKey)},methods:{getSignData(){return new Promise(((s,t)=>{this.signListInvoke.length?s(this.signListInvoke):e().then((e=>{s(e.data||[])}))}))},clearChoose(){for(let s=0;s<this.signListInvoke.length;s++){let e=this.signListInvoke[s];e.isDefault=0,this.$set(this.signListInvoke,s,e)}},setMainSignInvokeWithValue(s){for(let e=0;e<this.signListInvoke.length;e++){let t=this.signListInvoke[e];if(t.signImg===s){this.setMainSignInvoke(t,e);break}}},eventLauncher(s){if("cancel"===s&&t(),"confirm"===s){let s=this.signListInvoke.filter((s=>1===s.isDefault));if(!s||!s.length)return this.$u.toast("请选择签名");this.$nextTick((()=>i("setSignValue",s[0].signImg))),t()}},setMainSignInvoke(s,e){this.clearChoose(),s.isDefault=1,this.$set(this.signListInvoke,e,s)}}},[["render",function(s,e,t,i,b,D){const x=a("NoData"),y=I,C=c,S=_(n("u-icon"),p),j=_(n("u-button"),L);return r(),o(C,{class:""},{default:l((()=>[b.signListInvoke.length?(r(),o(C,{key:1,class:"page_v u-flex-col"},{default:l((()=>[(r(!0),g(f,null,u(b.signListInvoke,((s,e)=>(r(),o(C,{key:e,class:v([s.isDefault?"active":"","lists_box"]),onClick:t=>D.setMainSignInvoke(s,e)},{default:l((()=>[h(C,{class:"signImgBox"},{default:l((()=>[h(y,{src:s.signImg,mode:"scaleToFill",class:"signImg"},null,8,["src"])])),_:2},1024),1==s.isDefault?(r(),o(C,{key:0,class:"icon-checked-box"},{default:l((()=>[h(C,{class:"icon-checked"},{default:l((()=>[h(S,{name:"checkbox-mark",color:"#fff",size:"28"})])),_:1})])),_:1})):d("",!0)])),_:2},1032,["class","onClick"])))),128))])),_:1})):(r(),o(x,{key:0})),h(C,{class:"flowBefore-actions"},{default:l((()=>[h(j,{class:"buttom-btn",onClick:e[0]||(e[0]=k((s=>D.eventLauncher("cancel")),["stop"]))},{default:l((()=>[m("取消")])),_:1}),h(j,{class:"buttom-btn",type:"primary",onClick:e[1]||(e[1]=k((s=>D.eventLauncher("confirm")),["stop"]))},{default:l((()=>[m("确定")])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-afa5a5a9"]]);export{x as default};
