2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
|
import{m as E,s as q,r as k,aT as I,b2 as j,p as u,q as W,t as a,v as l,u as o,a2 as r,L as f,y as m,x as B,i as X,A as Y,n as V,aW as z,aX as G,ae as H,aY as J,b5 as K,b6 as M,b7 as O,b8 as Q}from"./.pnpm.1b0299fb.js";import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang.b077f234.js";import{f as ee,b as ae}from"./index.689cfa31.js";import{u as oe}from"./usePaging.00aa976d.js";import{u as le}from"./useDictOptions.e9843f63.js";import{d as te,e as ne}from"./config.f91970d4.js";import"./lodash.c3b66c05.js";import{_ as se}from"./edit.vue_vue_type_script_setup_true_name_configEdit_lang.c31dfff4.js";import"./@vueuse.72d44d91.js";import"./@vue.9d708d7c.js";import"./index.6c48d0ba.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.abac7546.js";const ue={class:"mt-4"},ie={class:"flex mt-4 justify-end"},de=E({name:"configLists"}),ke=E({...de,setup(re){const _=q(),v=k(!1),s=I({type:"",name:"",value:""}),y=k([]),D=n=>{y.value=n.map(({id:e})=>e)},{dictData:x}=le(""),{pager:p,getLists:C,resetParams:$,resetPage:L}=oe({fetchFun:ne,params:s}),P=async()=>{var n;v.value=!0,await V(),(n=_.value)==null||n.open("add")},T=async n=>{var e,i;v.value=!0,await V(),(e=_.value)==null||e.open("edit"),(i=_.value)==null||i.setFormData(n)},w=async n=>{await ee.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await te({id:n}),C()};return C(),(n,e)=>{const i=z,b=G,d=H,h=J,F=K,N=ae,c=M,R=O,S=Z,g=j("perms"),U=Q;return u(),W("div",null,[a(F,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[a(h,{class:"mb-[-16px]",model:o(s),inline:""},{default:l(()=>[a(b,{label:"\u7C7B\u578B",prop:"type"},{default:l(()=>[a(i,{class:"w-[280px]",modelValue:o(s).type,"onUpdate:modelValue":e[0]||(e[0]=t=>o(s).type=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7C7B\u578B"},null,8,["modelValue"])]),_:1}),a(b,{label:"\u540D\u79F0",prop:"name"},{default:l(()=>[a(i,{class:"w-[280px]",modelValue:o(s).name,"onUpdate:modelValue":e[1]||(e[1]=t=>o(s).name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(b,{label:"\u503C",prop:"value"},{default:l(()=>[a(i,{class:"w-[280px]",modelValue:o(s).value,"onUpdate:modelValue":e[2]||(e[2]=t=>o(s).value=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u503C"},null,8,["modelValue"])]),_:1}),a(b,null,{default:l(()=>[a(d,{type:"primary",onClick:o(L)},{default:l(()=>e[6]||(e[6]=[r("\u67E5\u8BE2")])),_:1},8,["onClick"]),a(d,{onClick:o($)},{default:l(()=>e[7]||(e[7]=[r("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),f((u(),m(F,{class:"!border-none",shadow:"never"},{default:l(()=>[f((u(),m(d,{type:"primary",onClick:P},{icon:l(()=>[a(N,{name:"el-icon-Plus"})]),default:l(()=>[e[8]||(e[8]=r(" \u65B0\u589E "))]),_:1})),[[g,["config.config/add"]]]),f((u(),m(d,{disabled:!o(y).length,onClick:e[3]||(e[3]=t=>w(o(y)))},{default:l(()=>e[9]||(e[9]=[r(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[g,["config.config/delete"]]]),B("div",ue,[a(R,{data:o(p).lists,onSelectionChange:D},{default:l(()=>[a(c,{type:"selection",width:"55"}),a(c,{label:"\u7C7B\u578B",prop:"type","show-overflow-tooltip":""}),a(c,{label:"\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),a(c,{label:"\u503C",prop:"value","show-overflow-tooltip":""}),a(c,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:t})=>[f((u(),m(d,{type:"primary",link:"",onClick:A=>T(t)},{default:l(()=>e[10]||(e[10]=[r(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[g,["config.config/edit"]]]),f((u(),m(d,{type:"danger",link:"",onClick:A=>w(t.id)},{default:l(()=>e[11]||(e[11]=[r(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[g,["config.config/delete"]]])]),_:1})]),_:1},8,["data"])]),B("div",ie,[a(S,{modelValue:o(p),"onUpdate:modelValue":e[4]||(e[4]=t=>X(p)?p.value=t:null),onChange:o(C)},null,8,["modelValue","onChange"])])]),_:1})),[[U,o(p).loading]]),o(v)?(u(),m(se,{key:0,ref_key:"editRef",ref:_,"dict-data":o(x),onSuccess:o(C),onClose:e[5]||(e[5]=t=>v.value=!1)},null,8,["dict-data","onSuccess"])):Y("",!0)])}}});export{ke as default};
|