2 lines
5.7 KiB
JavaScript
2 lines
5.7 KiB
JavaScript
import{_ as G,G as Q,H as Z,L as J,M as W,a6 as X,N as Y,O as ee,C as te,B as ae,w as oe,D as le}from"./element-plus.2acb577d.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.a280d02d.js";import{f as se,b as ie}from"./index.81df6f20.js";import{u as ue}from"./vue-router.4c04f9b6.js";import{d as P,r as L,s as de,Z as R,am as re,o as s,c as w,U as t,L as a,u as o,T as me,a9 as pe,K as d,aa as ce,R as r,a as D,M as v,i as _e,Q as fe,n as N}from"./@vue.821a47ec.js";import{c as ye,e as ve,f as ge}from"./dict.3d63776b.js";import{u as be}from"./usePaging.23706826.js";import{_ as Ce}from"./edit.vue_vue_type_script_setup_true_lang.adba10e7.js";import"./lodash-es.df44a280.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.81e2759c.js";import"./@element-plus.dabbc398.js";import"./dayjs.d2a77ee0.js";import"./axios.9e996410.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.6bfd3540.js";import"./pinia.fefed778.js";import"./css-color-function.8ff67959.js";import"./color.bfa08e9a.js";import"./clone.660f80c4.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.dcb32030.js";import"./vue-clipboard3.e681583f.js";import"./clipboard.3ad9b20b.js";import"./echarts.42bea269.js";import"./tslib.60310f1a.js";import"./zrender.2cb48b70.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8864a4be.js";import"./index.f292cd50.js";const Ee={class:"dict-type"},ke={class:"mt-4"},we={class:"flex justify-end mt-4"},De=P({name:"dictData"}),ut=P({...De,setup(Fe){const{query:S}=ue(),g=L(!1),_=de(),i=R({type:"",type_id:Number(S.id),name:"",status:""}),E=R({dict_type:[]}),{pager:f,getLists:y,resetPage:F,resetParams:U}=be({fetchFun:ge,params:i}),k=L([]),A=n=>{k.value=n.map(({id:e})=>e)},K=async()=>{var e,m;g.value=!0,await N();const n=E.dict_type.find(p=>p.id==i.type_id);(e=_.value)==null||e.setFormData({type_value:n==null?void 0:n.type,type_id:n.id}),(m=_.value)==null||m.open("add")},I=async n=>{var e,m;g.value=!0,await N(),(e=_.value)==null||e.open("edit"),(m=_.value)==null||m.setFormData(n)},B=async n=>{await se.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ye({id:n}),y()},h=async()=>{const n=await ve({page_type:0});E.dict_type=n.lists};return y(),h(),(n,e)=>{const m=G,p=Q,V=Z,b=te,q=ae,c=oe,H=le,x=J,$=ie,u=W,T=X,M=Y,O=ne,C=re("perms"),j=ee;return s(),w("div",Ee,[t(x,{class:"!border-none",shadow:"never"},{default:a(()=>[t(m,{class:"mb-4",content:"\u6570\u636E\u7BA1\u7406",onBack:e[0]||(e[0]=l=>n.$router.back())}),t(H,{ref:"formRef",class:"mb-[-16px]",model:o(i),inline:""},{default:a(()=>[t(b,{label:"\u5B57\u5178\u540D\u79F0"},{default:a(()=>[t(V,{class:"w-[280px]",modelValue:o(i).type_id,"onUpdate:modelValue":e[1]||(e[1]=l=>o(i).type_id=l),onChange:o(y)},{default:a(()=>[(s(!0),w(me,null,pe(o(E).dict_type,l=>(s(),d(p,{label:l.name,value:l.id,key:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),t(b,{label:"\u6570\u636E\u540D\u79F0"},{default:a(()=>[t(q,{class:"w-[280px]",modelValue:o(i).name,"onUpdate:modelValue":e[2]||(e[2]=l=>o(i).name=l),clearable:"",onKeyup:ce(o(F),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),t(b,{label:"\u6570\u636E\u72B6\u6001"},{default:a(()=>[t(V,{class:"w-[280px]",modelValue:o(i).status,"onUpdate:modelValue":e[3]||(e[3]=l=>o(i).status=l)},{default:a(()=>[t(p,{label:"\u5168\u90E8",value:""}),t(p,{label:"\u6B63\u5E38",value:1}),t(p,{label:"\u505C\u7528",value:0})]),_:1},8,["modelValue"])]),_:1}),t(b,null,{default:a(()=>[t(c,{type:"primary",onClick:o(F)},{default:a(()=>e[7]||(e[7]=[r("\u67E5\u8BE2")])),_:1},8,["onClick"]),t(c,{onClick:o(U)},{default:a(()=>e[8]||(e[8]=[r("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),t(x,{class:"!border-none mt-4",shadow:"never"},{default:a(()=>[D("div",null,[v((s(),d(c,{type:"primary",onClick:K},{icon:a(()=>[t($,{name:"el-icon-Plus"})]),default:a(()=>[e[9]||(e[9]=r(" \u6DFB\u52A0\u6570\u636E "))]),_:1})),[[C,["setting.dict.dict_data/add"]]]),v((s(),d(c,{disabled:!o(k).length,type:"danger",onClick:e[4]||(e[4]=l=>B(o(k)))},{icon:a(()=>[t($,{name:"el-icon-Delete"})]),default:a(()=>[e[10]||(e[10]=r(" \u5220\u9664 "))]),_:1},8,["disabled"])),[[C,["setting.dict.dict_data/delete"]]])]),v((s(),w("div",ke,[D("div",null,[t(M,{data:o(f).lists,size:"large",onSelectionChange:A},{default:a(()=>[t(u,{type:"selection",width:"55"}),t(u,{label:"ID",prop:"id"}),t(u,{label:"\u6570\u636E\u540D\u79F0",prop:"name","min-width":"120"}),t(u,{label:"\u6570\u636E\u503C",prop:"value","min-width":"120"}),t(u,{label:"\u72B6\u6001"},{default:a(({row:l})=>[l.status==1?(s(),d(T,{key:0},{default:a(()=>e[11]||(e[11]=[r("\u6B63\u5E38")])),_:1})):(s(),d(T,{key:1,type:"danger"},{default:a(()=>e[12]||(e[12]=[r("\u505C\u7528")])),_:1}))]),_:1}),t(u,{label:"\u5907\u6CE8",prop:"remark","min-width":"120","show-tooltip-when-overflow":""}),t(u,{label:"\u6392\u5E8F",prop:"sort"}),t(u,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:a(({row:l})=>[v((s(),d(c,{link:"",type:"primary",onClick:z=>I(l)},{default:a(()=>e[13]||(e[13]=[r(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[C,["setting.dict.dict_data/edit"]]]),v((s(),d(c,{link:"",type:"danger",onClick:z=>B(l.id)},{default:a(()=>e[14]||(e[14]=[r(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[C,["setting.dict.dict_data/delete"]]])]),_:1})]),_:1},8,["data"])]),D("div",we,[t(O,{modelValue:o(f),"onUpdate:modelValue":e[5]||(e[5]=l=>_e(f)?f.value=l:null),onChange:o(y)},null,8,["modelValue","onChange"])])])),[[j,o(f).loading]])]),_:1}),o(g)?(s(),d(Ce,{key:0,ref_key:"editRef",ref:_,onSuccess:o(y),onClose:e[6]||(e[6]=l=>g.value=!1)},null,8,["onSuccess"])):fe("",!0)])}}});export{ut as default};
|