1 |
- import{_ as $,d as J,m as h,cq as K,Q as X,a8 as Y,r as _,ag as Z,o as v,A as P,x as n,B as T,u as V,cr as ee,h as s,b as D,c as y,F as I,y as N,G as O,H as k,a as j,L as ue,M as le}from"./index.62ae038d.js";import{d as oe}from"./index.9d0d4d02.js";function b(o,w,S=!1,E=!1){return{isOpen:!1,title:o,permission_id:w,needCompanyPermission:S,needFieldPermission:E,companyPermission:[],fieldPermission:[]}}function R(){return[b("\u4E1A\u7EE9\u62A5\u8868",1,!0,!1),b("\u5229\u6DA6\u770B\u677F",2,!0,!1),b("\u5E94\u6536\u8D26\u6B3E",3,!1,!1),b("\u8BA2\u5355\u60C5\u51B5",4,!1,!1),b("\u53D1\u8D27\u60C5\u51B5",5,!1,!1),b("\u4E1A\u7EE9\u62A5\u8868(\u65B0)",6,!0,!0),b("\u5E93\u5B58\u60C5\u51B5",7,!1,!1)]}const q=[{value:"GS2302231125079621",label:"\u5317\u4EAC\u767E\u8FB0\u8363\u8FBE\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"},{value:"GS2302231323386950",label:"\u5317\u4EAC\u6CD3\u6E90\u5E7F\u8BDA\u56FD\u9645\u5546\u8D38\u6709\u9650\u516C\u53F8"},{value:"GS2203161855277894",label:"\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"},{value:"GS2304031312553746",label:"\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8"},{value:"GS2302231124114965",label:"\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8"},{value:"GS2401181650538135",label:"\u5317\u4EAC\u77E5\u4E8B\u6587\u5316\u4EA7\u4E1A\u53D1\u5C55\u6709\u9650\u516C\u53F8"},{value:"GS2402020907088731",label:"\u5317\u4EAC\u6CF0\u6587\u521B\u4F9B\u5E94\u94FE\u7BA1\u7406\u6709\u9650\u516C\u53F8"},{value:"GS2404151642335170",label:"\u5317\u4EAC\u5143\u9686\u96C5\u56FE\u6587\u5316\u4F20\u64AD\u80A1\u4EFD\u6709\u9650\u516C\u53F8"},{value:"GS2404151647395616",label:"\u7ED3\u7B97\u5355E\u4F01\u8D2D"}];var C=(o=>(o[o.update=0]="update",o[o.preview=1]="preview",o[o.create=2]="create",o))(C||{});const L=o=>(ue("data-v-2d35d1fe"),o=o(),le(),o),ae={class:"report"},se={class:"left"},te={class:"right"},ne={key:0,class:"company"},ie=L(()=>D("div",{class:"title"},"\u4E1A\u52A1\u516C\u53F8",-1)),re={key:1,class:"company"},de=L(()=>D("div",{class:"title"},"\u5B57\u6BB5\u6743\u9650",-1)),ce={class:"flex w-full justify-end"},me=J({__name:"role-modal",emits:["refresh"],setup(o,{expose:w,emit:S}){const E=h(!1),U=h(C.create),x=h(null),u=h(R()),G={mobile:"",nickname:"",is_show:[]},p=h({...G}),{run:M,loading:z}=K({success:()=>{S("refresh"),E.value=!1},responseCode:0}),H=X(()=>{const t="\u5FAE\u4FE1\u8D26\u53F7\u6743\u9650";switch(C.value){case C.create:return"\u521B\u5EFA"+t;case C.preview:return"\u67E5\u770B"+t;default:return"\u4FEE\u6539"+t}}),Q=Y({nickname:[{required:!0,message:"\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D",trigger:"blur"}],mobile:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",trigger:"blur"}]});function W(){x.value.validate(t=>{if(!t)return;let l=u.value.filter(e=>e.isOpen).map(({permission_id:e})=>e).join(",");const r=u.value.filter(e=>e.needFieldPermission).map(({fieldPermission:e})=>e.join(",")).join(",");r&&(l+=`,${r}`);const f=q.map(e=>({companyNo:e.value,companyName:e.label,info:u.value.reduce((a,g)=>g.companyPermission.includes(e.value)?[...a,g.permission_id]:a,[])})),{id:A,nickname:B,mobile:d}=p.value;M(oe({id:A,mobile:d,is_show:l,nickname:B,companyArr:f}))})}return w({onDisplay:(t,l)=>{p.value={...G},U.value=l,E.value=!0;const r=R(),{mobile:f,nickname:A,id:B}=t;let d=t.is_show.split(",");r.forEach(c=>{if(d.includes("cost_field")){d=d.filter(a=>a!=="cost_field");const e=r.findIndex(({permission_id:a})=>a===6);e!==-1&&(r[e].fieldPermission=["cost_field"])}if(c.isOpen=d.includes(String(c.permission_id)),c.needCompanyPermission)for(const e in t.companyArr){const a=t.companyArr[e];!a.info||(a.info&&a.info.includes(String(c.permission_id))||a.info.includes(Number(c.permission_id)))&&c.companyPermission.push(a.companyNo)}}),u.value=r,p.value={id:B,mobile:f,nickname:A,is_show:t.is_show.split(",")}}}),(t,l)=>{const r=_("ElInput"),f=_("ElFormItem"),A=_("el-switch"),B=_("el-checkbox"),d=_("el-checkbox-group"),c=_("el-scrollbar"),e=_("ElButton"),a=_("ElDialog"),g=Z("loading");return v(),P(a,{center:"",modelValue:E.value,"onUpdate:modelValue":l[4]||(l[4]=F=>E.value=F),title:H.value,"close-on-click-modal":!1,width:"1024px"},{default:n(()=>[T((v(),P(V(ee),{ref_key:"formRef",ref:x,labelWidth:"100px","label-position":"left",model:p.value,rules:Q,disabled:U.value===V(C).preview},{default:n(()=>[s(f,{label:"\u771F\u5B9E\u59D3\u540D",prop:"nickname"},{default:n(()=>[s(r,{placeholder:"\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D",modelValue:p.value.nickname,"onUpdate:modelValue":l[0]||(l[0]=F=>p.value.nickname=F),disabled:""},null,8,["modelValue"])]),_:1}),s(f,{label:"\u624B\u673A\u53F7",prop:"mobile",style:{"margin-bottom":"10px"}},{default:n(()=>[s(r,{placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",modelValue:p.value.mobile,"onUpdate:modelValue":l[1]||(l[1]=F=>p.value.mobile=F),disabled:""},null,8,["modelValue"])]),_:1}),s(f,{label:"\u53EF\u67E5\u770B\u62A5\u8868",required:"",style:{"margin-bottom":"0px","font-weight":"700"}}),s(c,{height:"350px"},{default:n(()=>[D("div",ae,[(v(!0),y(I,null,N(u.value,(F,i)=>(v(),y("div",{class:"report__wrapper",key:u.value[i].permission_id},[D("div",se,[D("p",null,O(F.title),1),s(A,{modelValue:u.value[i].isOpen,"onUpdate:modelValue":m=>u.value[i].isOpen=m},null,8,["modelValue","onUpdate:modelValue"])]),D("div",te,[u.value[i].needCompanyPermission?(v(),y("div",ne,[ie,s(d,{modelValue:u.value[i].companyPermission,"onUpdate:modelValue":m=>u.value[i].companyPermission=m,disabled:!u.value[i].isOpen},{default:n(()=>[(v(!0),y(I,null,N(V(q),m=>(v(),P(B,{key:m.value,label:m.value},{default:n(()=>[k(O(m.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])])):j("v-if",!0),u.value[i].needFieldPermission?(v(),y("div",re,[de,s(d,{modelValue:u.value[i].fieldPermission,"onUpdate:modelValue":m=>u.value[i].fieldPermission=m,disabled:!u.value[i].isOpen},{default:n(()=>[s(B,{label:"cost_field"},{default:n(()=>[k("\u6210\u672C")]),_:1})]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])])):j("v-if",!0)])]))),128))])]),_:1}),s(f,null,{default:n(()=>[D("div",ce,[s(e,{type:"\u53D6\u6D88",onClick:l[2]||(l[2]=()=>E.value=!1)},{default:n(()=>[k("\u53D6\u6D88")]),_:1}),s(e,{type:"primary",onClick:l[3]||(l[3]=()=>W())},{default:n(()=>[k("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","rules","disabled"])),[[g,V(z)]])]),_:1},8,["modelValue","title"])}}});var pe=$(me,[["__scopeId","data-v-2d35d1fe"],["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/system/wechatManager/components/role-modal.vue"]]),ve=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"}));export{C as M,pe as R,ve as r};
|