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