5 lines
6.6 KiB
JavaScript
5 lines
6.6 KiB
JavaScript
|
|
/*!
|
||
|
|
Build based on gin-vue-admin
|
||
|
|
Time : 1776662816000 */
|
||
|
|
import{g as e,f as l,d as a,c as t,u}from"./087AC4D233B64EB0sysDictionaryDetail.CaMj87ch.js";import{O as s,a as i,a1 as r,g as o,a8 as n,c as d,o as c,b as p,f as v,a2 as y,i as m,w as f,h as b,x as D,b7 as w,t as h,a5 as g,b9 as I,E as V,k as _}from"./087AC4D233B64EB0index.D-00lXMX.js";const k={class:"gva-table-box"},x={class:"gva-btn-list justify-between flex items-center"},C={class:"flex items-center gap-2"},U={class:"flex justify-between items-center"},B={class:"text-lg"},j=Object.assign({name:"SysDictionaryDetail"},{__name:"sysDictionaryDetail",props:{sysDictionaryID:{type:Number,default:0}},setup(j){const q=s(),E=i(""),S=j,z=i({label:null,value:null,status:!0,sort:null,parentID:null}),A=i({label:[{required:!0,message:"请输入展示值",trigger:"blur"}],value:[{required:!0,message:"请输入字典值",trigger:"blur"}],sort:[{required:!0,message:"排序标记",trigger:"blur"}]}),M=i([]),O={value:"ID",label:"label",children:"children",checkStrictly:!0,emitPath:!1},T=async()=>{if(S.sysDictionaryID)try{const l=await e({sysDictionaryID:S.sysDictionaryID});0===l.code&&(M.value=l.data.list||[])}catch(l){V.error("获取层级数据失败")}},F={ID:null,label:"无父级(根级)"};T();const K=i(""),N=i(!1),P=e=>{z.value.parentID=e},W=()=>{N.value=!1,z.value={label:null,value:null,status:!0,sort:null,parentID:null,sysDictionaryID:S.sysDictionaryID}},G=i(null),H=async()=>{G.value.validate(async e=>{if(z.value.sysDictionaryID=S.sysDictionaryID,!e)return;let l;switch(K.value){case"create":default:l=await t(z.value);break;case"update":l=await u(z.value)}0===l.code&&(V({type:"success",message:"创建/更改成功"}),W(),await T())})},J=()=>{K.value="create",z.value.parentID=null,G.value&&G.value.clearValidate(),N.value=!0},L=()=>{E.value="",T()},Q=()=>{},R=e=>{"Enter"===e.key&&""!==E.value.trim()&&T()};return r(()=>S.sysDictionaryID,()=>{T()}),(e,t)=>{const u=o("el-button"),s=o("el-input"),i=o("el-table-column"),r=o("el-table"),j=o("el-cascader"),X=o("el-form-item"),Y=o("el-switch"),Z=o("el-input-number"),$=o("el-form"),ee=o("el-drawer"),le=n("click-outside");return c(),d("div",null,[p("div",k,[p("div",x,[t[10]||(t[10]=p("span",{class:"text font-bold"},"字典详细内容",-1)),p("div",C,[y((c(),m(s,{placeholder:"搜索展示值",modelValue:E.value,"onUpdate:modelValue":t[0]||(t[0]=e=>E.value=e),clearable:"",class:"!w-64",onClear:L,"prefix-icon":D(w),onKeydown:R},{append:f(()=>[v(u,{type:E.value?"primary":"info",onClick:T},{default:f(()=>[...t[8]||(t[8]=[b("搜索",-1)])]),_:1},8,["type"])]),_:1},8,["modelValue","prefix-icon"])),[[le,Q]]),v(u,{type:"primary",icon:"plus",onClick:J},{default:f(()=>[...t[9]||(t[9]=[b(" 新增字典项 ",-1)])]),_:1})])]),v(r,{data:M.value,style:{width:"100%"},"tooltip-effect":"dark","tree-props":{children:"children"},"row-key":"ID","default-expand-all":""},{default:f(()=>[v(i,{type:"selection",width:"55"}),v(i,{align:"left",label:"展示值",prop:"label","min-width":"240"}),v(i,{align:"left",label:"字典值",prop:"value"}),v(i,{align:"left",label:"扩展值",prop:"extend"}),v(i,{align:"left",label:"日期",width:"180"},{default:f(e=>[b(h(D(g)(e.row.CreatedAt)),1)]),_:1}),v(i,{align:"left",label:"层级",prop:"level",width:"80"}),v(i,{align:"left",label:"启用状态",prop:"status",width:"120"},{default:f(e=>[b(h(D(I)(e.row.status)),1)]),_:1}),v(i,{align:"left",label:"排序标记",prop:"sort",width:"120"}),v(i,{align:"left",label:"操作","min-width":D(q).operateMinWith},{default:f(e=>[v(u,{type:"success",link:"",icon:"plus",onClick:l=>{return a=e.row,K.value="create",z.value={label:null,value:null,status:!0,sort:null,parentID:a.ID,sysDictionaryID:S.sysDictionaryID},G.value&&G.value.clearValidate(),void(N.value=!0);var a}},{default:f(()=>[...t[11]||(t[11]=[b(" 添加子项 ",-1)])]),_:1},8,["onClick"]),v(u,{type:"primary",link:"",icon:"edit",onClick:a=>(async e=>{G.value&&G.value.clearValidate();const a=await l({ID:e.ID});K.value="update",0===a.code&&(z.value=a.data.reSysDictionaryDetail,N.value=!0)})(e.row)},{default:f(()=>[...t[12]||(t[12]=[b(" 变更 ",-1)])]),_:1},8,["onClick"]),v(u,{type:
|