2 lines
5.7 KiB
JavaScript
2 lines
5.7 KiB
JavaScript
import{C as G,D as H,K as J,L as W,w as X,F as Y,T as ee,O as oe,Q as te,R as ae}from"./element-plus.619595c4.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang.02c63712.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.2914ee54.js";import{f as se,b as ue}from"./index.adbcc6f1.js";import{u as ie}from"./usePaging.6a6670f9.js";import{u as re}from"./useDictOptions.2130484f.js";import{_ as pe,a as de,b as me,c as ce}from"./edit.vue_vue_type_script_setup_true_name_codeEdit_lang.a7f11437.js";import{_ as _e}from"./detail.vue_vue_type_script_setup_true_name_brandEdit_lang.7c6c58f1.js";import{d as T,s as x,r as h,Z as fe,ap as ve,o as u,c as R,U as e,L as a,u as o,T as Ce,a9 as be,K as i,R as d,M as v,a as L,j as ye,Q as S,n as D}from"./@vue.18505fe0.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.6ad9ae30.js";import"./axios.fbe06b45.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.0987e768.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.29b71fa4.js";import"./color.87d313dc.js";import"./clone.a63396d9.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.316b9a3d.js";import"./vue-clipboard3.f9a42727.js";import"./clipboard.bf37ca4b.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.122ff80d.js";const we={class:"mt-4"},Fe={class:"flex mt-4 justify-end"},ke=T({name:"codeLists"}),io=T({...ke,setup(Ee){const C=x(),k=x(),b=h(!1),E=h(!1),m=fe({name:"",py:"",code:"",type:"",data:"",more:"",sort:""}),g=h([]),P=n=>{g.value=n.map(({id:t})=>t)},{dictData:y}=re("code_type"),{pager:_,getLists:f,resetParams:N,resetPage:U}=ie({fetchFun:ce,params:m}),I=async()=>{var n;b.value=!0,await D(),(n=C.value)==null||n.open("add")},j=async n=>{var t,r;b.value=!0,await D(),(t=C.value)==null||t.open("edit"),(r=C.value)==null||r.setFormData(n)},A=async n=>{var r,c;let t=await de({id:n});E.value=!0,await D(),(r=k.value)==null||r.open("edit"),(c=k.value)==null||c.setFormData(t)},B=async n=>{await se.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await me({id:n}),f()};return f(),(n,t)=>{const r=G,c=H,V=J,K=W,p=X,O=Y,$=ee,Q=ue,s=oe,q=ne,M=te,Z=le,w=ve("perms"),z=ae;return u(),R("div",null,[e($,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(O,{class:"mb-[-16px]",model:o(m),inline:""},{default:a(()=>[e(c,{label:"\u6761\u7801\u540D\u79F0",prop:"name"},{default:a(()=>[e(r,{class:"w-[280px]",modelValue:o(m).name,"onUpdate:modelValue":t[0]||(t[0]=l=>o(m).name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6761\u7801\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(c,{label:"\u6761\u7801\u7C7B\u578B",prop:"type"},{default:a(()=>[e(K,{class:"w-[280px]",modelValue:o(m).type,"onUpdate:modelValue":t[1]||(t[1]=l=>o(m).type=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u6761\u7801\u7C7B\u578B"},{default:a(()=>[e(V,{label:"\u5168\u90E8",value:""}),(u(!0),R(Ce,null,be(o(y).code_type,(l,F)=>(u(),i(V,{key:F,label:l.name,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:a(()=>[e(p,{type:"primary",onClick:o(U)},{default:a(()=>[d("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(p,{onClick:o(N)},{default:a(()=>[d("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),v((u(),i($,{class:"!border-none",shadow:"never"},{default:a(()=>[v((u(),i(p,{type:"primary",onClick:I},{icon:a(()=>[e(Q,{name:"el-icon-Plus"})]),default:a(()=>[d(" \u65B0\u589E ")]),_:1})),[[w,["goods.code/add"]]]),v((u(),i(p,{disabled:!o(g).length,onClick:t[2]||(t[2]=l=>B(o(g)))},{default:a(()=>[d(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[w,["goods.code/delete"]]]),L("div",we,[e(M,{data:o(_).lists,onSelectionChange:P},{default:a(()=>[e(s,{type:"selection",width:"55"}),e(s,{label:"ID",prop:"id",width:"55"}),e(s,{label:"\u6761\u7801\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(s,{label:"\u62FC\u97F3\u4FE1\u606F",prop:"py","show-overflow-tooltip":""}),e(s,{label:"\u6761\u7801\u5185\u5BB9",prop:"code","show-overflow-tooltip":""}),e(s,{label:"\u6761\u7801\u7C7B\u578B",prop:"type"},{default:a(({row:l})=>[e(q,{options:o(y).code_type,value:l.type},null,8,["options","value"])]),_:1}),e(s,{label:"\u5907\u6CE8\u4FE1\u606F",prop:"data","show-overflow-tooltip":""}),e(s,{label:"\u6269\u5C55\u4FE1\u606F",prop:"more","show-overflow-tooltip":""}),e(s,{label:"\u6392\u5E8F",prop:"sort","show-overflow-tooltip":""}),e(s,{label:"\u64CD\u4F5C",width:"170",fixed:"right"},{default:a(({row:l})=>[v((u(),i(p,{type:"primary",link:"",onClick:F=>j(l)},{default:a(()=>[d(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[w,["goods.code/edit"]]]),v((u(),i(p,{type:"danger",link:"",onClick:F=>B(l.id)},{default:a(()=>[d(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[w,["goods.code/delete"]]]),e(p,{link:"",onClick:F=>A(l.id)},{default:a(()=>[d(" \u8BE6\u60C5 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),L("div",Fe,[e(Z,{modelValue:o(_),"onUpdate:modelValue":t[3]||(t[3]=l=>ye(_)?_.value=l:null),onChange:o(f)},null,8,["modelValue","onChange"])])]),_:1})),[[z,o(_).loading]]),o(b)?(u(),i(pe,{key:0,ref_key:"editRef",ref:C,"dict-data":o(y),onSuccess:o(f),onClose:t[4]||(t[4]=l=>b.value=!1)},null,8,["dict-data","onSuccess"])):S("",!0),o(E)?(u(),i(_e,{key:1,ref_key:"detailRef",ref:k,"dict-data":o(y),onSuccess:o(f),onClose:t[5]||(t[5]=l=>E.value=!1)},null,8,["dict-data","onSuccess"])):S("",!0)])}}});export{io as default};
|