2 lines
5.9 KiB
JavaScript
2 lines
5.9 KiB
JavaScript
import{Q as H,$ as J,J as Z,K as G,D as W,C as X,w as Y,F as ee,L as te,M as ae,N as oe,O as le}from"./element-plus.91c68cc0.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import{f as se,b as ie}from"./index.27d7bb66.js";import{u as ue}from"./vue-router.10bd5b90.js";import{d as P,r as L,s as de,Z as R,ap 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,j as _e,Q as fe,n as N}from"./@vue.76ce7aa3.js";import{c as ye,e as ve,f as ge}from"./dict.1c1828bc.js";import{u as be}from"./usePaging.f8c888e4.js";import{_ as Ce}from"./edit.vue_vue_type_script_setup_true_lang.6fbd864e.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.4e6d2a38.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./index.e9fb0fda.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";const Ee={class:"dict-type"},ke={class:"mt-4"},we={class:"flex justify-end mt-4"},De=P({name:"dictData"}),pt=P({...De,setup(Fe){const{query:K}=ue(),g=L(!1),_=de(),i=R({type:"",type_id:Number(K.id),name:"",status:""}),E=R({dict_type:[]}),{pager:f,getLists:y,resetPage:F,resetParams:S}=be({fetchFun:ge,params:i}),k=L([]),U=n=>{k.value=n.map(({id:e})=>e)},A=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)},V=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=H,p=Z,B=G,b=W,j=X,c=Y,q=ee,x=te,$=ie,u=ae,T=J,M=oe,O=ne,C=re("perms"),Q=le;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(q,{ref:"formRef",class:"mb-[-16px]",model:o(i),inline:""},{default:a(()=>[t(b,{label:"\u5B57\u5178\u540D\u79F0"},{default:a(()=>[t(B,{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(j,{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(B,{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(S)},{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:A},{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=>V(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:U},{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=>V(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"])])])),[[Q,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{pt as default};
|