import{C as W,D as I,w as j,F as A,I as q,L as O,M as z,N as G}from"./element-plus.ae09c4a0.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang.8003a1e1.js";import{f as J,b as K}from"./index.80696382.js";import{u as Q}from"./usePaging.3230a0a8.js";import{a as X}from"./useDictOptions.b75da5b0.js";import{_ as Y,a as Z,b as ee}from"./edit.vue_vue_type_script_setup_true_name_masterWorkerRuleEdit_lang.a81fa0e8.js";import"./lodash.fc1b942f.js";import{d as y,s as te,r as h,a0 as oe,ah as ae,o as s,c as le,W as e,O as a,u as t,T as m,P as _,M as p,a as g,j as re,S as ne,n as V}from"./@vue.a7a54728.js";import"./@vueuse.0a77614e.js";import"./@element-plus.a03b0c46.js";import"./lodash-es.bb7dceda.js";import"./dayjs.7f1be2bc.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.b082b0c1.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./axios.108bc101.js";import"./vue-router.c1c4566f.js";import"./pinia.b401a84e.js";import"./css-color-function.91b6e704.js";import"./color.d62296c5.js";import"./clone.f2407509.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.f4ae74de.js";import"./index.e64ff1d1.js";const se={class:"mt-4"},ue={class:"flex mt-4 justify-end"},ie=y({name:"masterWorkerRuleLists"}),Ke=y({...ie,setup(me){const f=te(),C=h(!1),n=oe({rule_name:"",description:"",sort:""}),b=h([]),D=r=>{b.value=r.map(({id:o})=>o)},{dictData:x}=X(""),{pager:d,getLists:v,resetParams:B,resetPage:R}=Q({fetchFun:ee,params:n}),$=async()=>{var r;C.value=!0,await V(),(r=f.value)==null||r.open("add")},P=async r=>{var o,u;C.value=!0,await V(),(o=f.value)==null||o.open("edit"),(u=f.value)==null||u.setFormData(r)},F=async r=>{await J.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await Z({id:r}),v()};return v(),(r,o)=>{const u=W,k=I,i=j,L=A,E=q,N=K,c=O,S=z,T=H,w=ae("perms"),M=G;return s(),le("div",null,[e(E,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(L,{class:"mb-[-16px]",model:t(n),inline:""},{default:a(()=>[e(k,{label:"\u89C4\u5219\u540D\u79F0",prop:"rule_name"},{default:a(()=>[e(u,{class:"w-[280px]",modelValue:t(n).rule_name,"onUpdate:modelValue":o[0]||(o[0]=l=>t(n).rule_name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(k,{label:"\u89C4\u5219\u503C",prop:"description"},{default:a(()=>[e(u,{class:"w-[280px]",modelValue:t(n).description,"onUpdate:modelValue":o[1]||(o[1]=l=>t(n).description=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u503C"},null,8,["modelValue"])]),_:1}),e(k,{label:"\u6392\u5E8F",prop:"sort"},{default:a(()=>[e(u,{class:"w-[280px]",modelValue:t(n).sort,"onUpdate:modelValue":o[2]||(o[2]=l=>t(n).sort=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"},null,8,["modelValue"])]),_:1}),e(k,null,{default:a(()=>[e(i,{type:"primary",onClick:t(R)},{default:a(()=>[m("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(i,{onClick:t(B)},{default:a(()=>[m("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),_((s(),p(E,{class:"!border-none",shadow:"never"},{default:a(()=>[_((s(),p(i,{type:"primary",onClick:$},{icon:a(()=>[e(N,{name:"el-icon-Plus"})]),default:a(()=>[m(" \u65B0\u589E ")]),_:1})),[[w,["master_worker_rule/add"]]]),_((s(),p(i,{disabled:!t(b).length,onClick:o[3]||(o[3]=l=>F(t(b)))},{default:a(()=>[m(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[w,["master_worker_rule/delete"]]]),g("div",se,[e(S,{data:t(d).lists,onSelectionChange:D},{default:a(()=>[e(c,{type:"selection",width:"55"}),e(c,{label:"\u89C4\u5219\u540D\u79F0",prop:"rule_name","show-overflow-tooltip":""}),e(c,{label:"\u89C4\u5219\u503C",prop:"description","show-overflow-tooltip":""}),e(c,{label:"\u6392\u5E8F",prop:"sort","show-overflow-tooltip":""}),e(c,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:a(({row:l})=>[_((s(),p(i,{type:"primary",link:"",onClick:U=>P(l)},{default:a(()=>[m(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[w,["master_worker_rule/edit"]]]),_((s(),p(i,{type:"danger",link:"",onClick:U=>F(l.id)},{default:a(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[w,["master_worker_rule/delete"]]])]),_:1})]),_:1},8,["data"])]),g("div",ue,[e(T,{modelValue:t(d),"onUpdate:modelValue":o[4]||(o[4]=l=>re(d)?d.value=l:null),onChange:t(v)},null,8,["modelValue","onChange"])])]),_:1})),[[M,t(d).loading]]),t(C)?(s(),p(Y,{key:0,ref_key:"editRef",ref:f,"dict-data":t(x),onSuccess:t(v),onClose:o[5]||(o[5]=l=>C.value=!1)},null,8,["dict-data","onSuccess"])):ne("",!0)])}}});export{Ke as default};
