Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

operatorDialog.7874c4db.js 4.1KB

před 3 měsíci
1
  1. import{_ as B,d as T,r as v,J as j,c as n,e as b,G as F,i as a,h as l,j as V,g as y,f as w,F as N,H as O,q as G}from"./index.a2494fc2.js";const J={class:"region"},L={class:"mr-16 flex-1"},P=["onClick"],z=T({name:"operatorDialog"}),A=Object.assign(z,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(u,{emit:H}){const{proxy:k}=G(),m=u,f=H,x=v([]),g=v(),t=v({name:void 0,operatorRegionHeads:[{key:new Date().getTime(),regionalHead:void 0,regionId:void 0,mobile:void 0}],remark:void 0}),R={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u8FD0\u8425\u5546\u540D\u79F0",trigger:"blur"}]},$=()=>{t.value.operatorRegionHeads.push({key:new Date().getTime(),regionalHead:void 0,regionId:void 0,mobile:void 0})},C=r=>{t.value.operatorRegionHeads.length>1&&t.value.operatorRegionHeads.splice(r,1)},I=async r=>{!r||await r.validate(async e=>{e&&(m.data&&m.data.id?k.$message.success("\u7F16\u8F91\u6210\u529F\uFF01"):k.$message.success("\u65B0\u589E\u6210\u529F\uFF01"),f("close",!0))})};return j(()=>m.visible,async r=>{r||(g.value.resetFields(),t.value.operatorRegionHeads=[{key:new Date().getTime(),regionalHead:void 0,regionId:void 0,mobile:void 0}])}),(r,e)=>{const i=n("el-input"),s=n("el-form-item"),U=n("el-tree-select"),c=n("el-col"),q=n("el-row"),_=n("el-button"),D=n("el-form"),h=n("el-dialog");return b(),F(h,{"model-value":u.visible,title:`${u.data&&u.data.id?"\u7F16\u8F91":"\u65B0\u589E"}\u8FD0\u8425\u5546`,width:"840px","destroy-on-close":"",onClose:e[4]||(e[4]=o=>f("close"))},{footer:a(()=>[l(_,{type:"primary",onClick:e[2]||(e[2]=o=>I(g.value))},{default:a(()=>e[6]||(e[6]=[V(" \u63D0\u4EA4 ")])),_:1}),l(_,{onClick:e[3]||(e[3]=o=>f("close"))},{default:a(()=>e[7]||(e[7]=[V(" \u5173\u95ED ")])),_:1})]),default:a(()=>[l(D,{ref_key:"formRef",ref:g,model:t.value,rules:R,"label-suffix":":"},{default:a(()=>[l(s,{label:"\u8FD0\u8425\u5546\u540D\u79F0",prop:"name"},{default:a(()=>[l(i,{modelValue:t.value.name,"onUpdate:modelValue":e[0]||(e[0]=o=>t.value.name=o),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),y("div",J,[(b(!0),w(N,null,O(t.value.operatorRegionHeads,(o,p)=>(b(),w("div",{key:o.key,class:"flex"},[y("div",L,[l(q,{gutter:14},{default:a(()=>[l(c,{span:8},{default:a(()=>[l(s,{label:"\u533A\u57DF",prop:`operatorRegionHeads[${p}].regionId`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u533A\u57DF",trigger:"change"}]},{default:a(()=>[l(U,{modelValue:o.regionId,"onUpdate:modelValue":d=>o.regionId=d,data:x.value,filterable:"",props:{label:"name",value:"id"},"check-strictly":"","render-after-expand":!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","data"])]),_:2},1032,["prop"])]),_:2},1024),l(c,{span:8},{default:a(()=>[l(s,{label:"\u533A\u57DF\u8D1F\u8D23\u4EBA",prop:`operatorRegionHeads[${p}].regionalHead`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u533A\u57DF\u8D1F\u8D23\u4EBA",trigger:"change"}]},{default:a(()=>[l(i,{modelValue:o.regionalHead,"onUpdate:modelValue":d=>o.regionalHead=d,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),l(c,{span:8},{default:a(()=>[l(s,{label:"\u8054\u7CFB\u7535\u8BDD",prop:`operatorRegionHeads[${p}].mobile`,rules:[{required:!0,pattern:/^1[3456789]\d{9}$/,message:"\u8054\u7CFB\u7535\u8BDD\u683C\u5F0F\u4E0D\u6B63\u786E",trigger:"blur"}]},{default:a(()=>[l(i,{modelValue:o.mobile,"onUpdate:modelValue":d=>o.mobile=d,maxlength:"11",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024)]),_:2},1024)]),y("a",{class:"text-danger",onClick:d=>C(p)},"\u5220\u9664",8,P)]))),128)),l(_,{type:"primary",class:"w-full",plain:"",icon:"Plus",onClick:$},{default:a(()=>e[5]||(e[5]=[V(" \u589E\u52A0\u533A\u57DF\u8D1F\u8D23\u4EBA ")])),_:1})]),l(s,{label:"\u5907\u6CE8",prop:"remark","label-width":"97px"},{default:a(()=>[l(i,{modelValue:t.value.remark,"onUpdate:modelValue":e[1]||(e[1]=o=>t.value.remark=o),maxlength:"200","show-word-limit":"",type:"textarea",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}}),K=B(A,[["__scopeId","data-v-94cd9c60"]]);export{K as default};