Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

2 lignes
3.8KB

  1. import{_ as q,r as v,B as T,b as n,c as b,L as F,h as a,f as l,i as V,e as k,d as w,F as N,H as O,k as j,s as L}from"./index-dd5fae99.js";const P={class:"region"},z={class:"mr-16 flex-1"},A=["onClick"],E=j({name:"operatorDialog"}),G=Object.assign(E,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(u,{emit:H}){const{proxy:y}=L(),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:"请输入运营商名称",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?y.$message.success("编辑成功!"):y.$message.success("新增成功!"),f("close",!0))})};return T(()=>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"),B=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?"编辑":"新增"}运营商`,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(" 提交 ")])),_:1}),l(_,{onClick:e[3]||(e[3]=o=>f("close"))},{default:a(()=>e[7]||(e[7]=[V(" 关闭 ")])),_:1})]),default:a(()=>[l(D,{ref_key:"formRef",ref:g,model:t.value,rules:R,"label-suffix":":"},{default:a(()=>[l(s,{label:"运营商名称",prop:"name"},{default:a(()=>[l(i,{modelValue:t.value.name,"onUpdate:modelValue":e[0]||(e[0]=o=>t.value.name=o),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),k("div",P,[(b(!0),w(N,null,O(t.value.operatorRegionHeads,(o,p)=>(b(),w("div",{key:o.key,class:"flex"},[k("div",z,[l(B,{gutter:14},{default:a(()=>[l(c,{span:8},{default:a(()=>[l(s,{label:"区域",prop:`operatorRegionHeads[${p}].regionId`,rules:[{required:!0,message:"请选择区域",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:"区域负责人",prop:`operatorRegionHeads[${p}].regionalHead`,rules:[{required:!0,message:"请输入区域负责人",trigger:"change"}]},{default:a(()=>[l(i,{modelValue:o.regionalHead,"onUpdate:modelValue":d=>o.regionalHead=d,placeholder:"请输入"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),l(c,{span:8},{default:a(()=>[l(s,{label:"联系电话",prop:`operatorRegionHeads[${p}].mobile`,rules:[{required:!0,pattern:/^1[3456789]\d{9}$/,message:"联系电话格式不正确",trigger:"blur"}]},{default:a(()=>[l(i,{modelValue:o.mobile,"onUpdate:modelValue":d=>o.mobile=d,maxlength:"11",placeholder:"请输入"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024)]),_:2},1024)]),k("a",{class:"text-danger",onClick:d=>C(p)},"删除",8,A)]))),128)),l(_,{type:"primary",class:"w-full",plain:"",icon:"Plus",onClick:$},{default:a(()=>e[5]||(e[5]=[V(" 增加区域负责人 ")])),_:1})]),l(s,{label:"备注",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:"请输入"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}}),K=q(G,[["__scopeId","data-v-94cd9c60"]]);export{K as default};