data_center/public/admin/assets/edit.93b42f8c.js

2 lines
6.5 KiB
JavaScript

import{a3 as G,C as H,B as J,c as K,J as O,G as $,H as z,D as Q}from"./element-plus.9c2fdfa8.js";import{P as W}from"./index.3fc23cf2.js";import{a as X,b as Y,c as Z}from"./user_menu.a01ad7da.js";import"./lodash.5512e984.js";import{a as ee,M as ue,d as oe}from"./index.b57b84f0.js";import{d as v,C as ae,s as D,r as _,e as le,$ as V,a4 as te,o as F,c as B,U as a,L as l,u,K as re,R as n}from"./@vue.53f8d7c3.js";import"./@vueuse.038954e7.js";import"./@element-plus.37f92579.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.vue_vue_type_style_index_0_scoped_187b1ead_lang.33043b78.js";import"./axios.92474d72.js";import"./vue-router.e2f4a118.js";import"./pinia.bd103f5d.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.ee641d3d.js";import"./color.cbc2f3a9.js";import"./clone.7fddbad2.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.a7d78d4d.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.9cf3e967.js";const se={class:"edit-popup"},de=["src"],ie=v({name:"userMenuEdit"}),pe=v({...ie,props:{dictData:{type:Object,default:()=>({})},menuList:{type:Array,default:()=>[]}},emits:["success","close"],setup(y,{expose:h,emit:U}){const w=ee(),x=ae("base_url"),k=y,f=U,E=D(),m=D(),c=_("add");_(!1);const A=r=>{o.icon=r.data.uri},b=_([{id:0,name:"\u9876\u7EA7",children:[]}]);(()=>{k.menuList.forEach(r=>{b.value[0].children.push(r)})})();const M=le(()=>c.value=="edit"?"\u7F16\u8F91\u7CFB\u7EDF\u83DC\u5355\u8868":"\u65B0\u589E\u7CFB\u7EDF\u83DC\u5355\u8868"),o=V({id:"",pid:"",type:ue.MENU,name:"",icon:"",sort:0,notes:"",paths:"",params:"",is_show:1,is_disable:0}),q=V({pid:[{required:!0,message:"\u8BF7\u8F93\u5165\u4E0A\u7EA7\u83DC\u5355",trigger:["blur"]}],type:[{required:!0,message:"\u8BF7\u8F93\u5165\u6743\u9650\u7C7B\u578B: M=\u76EE\u5F55\uFF0CC=\u83DC\u5355\uFF0CA=\u6309\u94AE",trigger:["blur"]}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0",trigger:["blur"]}],icon:[{required:!0,message:"\u8BF7\u8F93\u5165\u83DC\u5355\u56FE\u6807",trigger:["blur"]}],sort:[{required:!0,message:"\u8BF7\u8F93\u5165\u83DC\u5355\u6392\u5E8F",trigger:["blur"]}],paths:[{required:!0,message:"\u8BF7\u8F93\u5165\u8DEF\u7531\u5730\u5740",trigger:["blur"]}],params:[{required:!1,message:"\u8BF7\u8F93\u5165\u8DEF\u7531\u53C2\u6570",trigger:["blur"]}],is_show:[{required:!0,message:"\u8BF7\u8F93\u5165\u662F\u5426\u663E\u793A",trigger:["blur"]}],is_disable:[{required:!0,message:"\u8BF7\u8F93\u5165\u662F\u5426\u7981\u7528",trigger:["blur"]}]}),C=async r=>{for(const e in o)r[e]!=null&&r[e]!=null&&(o[e]=r[e])},R=async r=>{const e=await X({id:r.id});C(e)},I=async()=>{var e,i;await((e=E.value)==null?void 0:e.validate());const r={...o};c.value=="edit"?await Y(r):await Z(r),(i=m.value)==null||i.close(),f("success")},P=(r="add")=>{var e;c.value=r,(e=m.value)==null||e.open()},L=()=>{f("close")};return h({open:P,setFormData:C,getDetail:R}),(r,e)=>{const i=G,s=H,d=J,S=te("Plus"),T=K,N=O,p=$,g=z,j=Q;return F(),B("div",se,[a(W,{ref_key:"popupRef",ref:m,title:u(M),async:!0,width:"550px",onConfirm:I,onClose:L},{default:l(()=>[a(j,{ref_key:"formRef",ref:E,model:u(o),"label-width":"90px",rules:u(q)},{default:l(()=>[a(s,{label:"\u4E0A\u7EA7\u83DC\u5355",prop:"pid"},{default:l(()=>[a(i,{class:"flex-1",modelValue:u(o).pid,"onUpdate:modelValue":e[0]||(e[0]=t=>u(o).pid=t),data:u(b),clearable:"","node-key":"id",props:{label:"name"},"default-expand-all":!0,placeholder:"\u8BF7\u9009\u62E9\u7236\u7EA7\u83DC\u5355","check-strictly":""},null,8,["modelValue","data"])]),_:1}),a(s,{label:"\u83DC\u5355\u540D\u79F0",prop:"name"},{default:l(()=>[a(d,{modelValue:u(o).name,"onUpdate:modelValue":e[1]||(e[1]=t=>u(o).name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(s,{label:"\u83DC\u5355\u56FE\u6807",prop:"icon"},{default:l(()=>[a(N,{class:"avatar-uploader",style:{border:"1px dashed var(--el-border-color)","border-radius":"6px",overflow:"hidden"},modelValue:u(o).icon,"onUpdate:modelValue":e[2]||(e[2]=t=>u(o).icon=t),headers:{Token:u(w).token},action:u(x)+"/upload/taskImage","show-file-list":!1,data:{cid:1},"on-success":A},{default:l(()=>[u(o).icon?(F(),B("img",{key:0,src:u(o).icon,class:"avatar"},null,8,de)):(F(),re(T,{key:1,class:"avatar-uploader-icon"},{default:l(()=>[a(S)]),_:1}))]),_:1},8,["modelValue","headers","action"])]),_:1}),a(s,{label:"\u83DC\u5355\u5907\u6CE8",prop:"notes"},{default:l(()=>[a(d,{modelValue:u(o).notes,"onUpdate:modelValue":e[3]||(e[3]=t=>u(o).notes=t),clearable:"",maxlength:"20",placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u5907\u6CE8(20\u5B57\u4EE5\u5185)"},null,8,["modelValue"])]),_:1}),a(s,{label:"\u83DC\u5355\u6392\u5E8F",prop:"sort"},{default:l(()=>[a(d,{modelValue:u(o).sort,"onUpdate:modelValue":e[4]||(e[4]=t=>u(o).sort=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u6392\u5E8F",type:"number"},null,8,["modelValue"])]),_:1}),a(s,{label:"\u8DEF\u7531\u5730\u5740",prop:"paths"},{default:l(()=>[a(d,{modelValue:u(o).paths,"onUpdate:modelValue":e[5]||(e[5]=t=>u(o).paths=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8DEF\u7531\u5730\u5740"},null,8,["modelValue"])]),_:1}),a(s,{label:"\u8DEF\u7531\u53C2\u6570",prop:"params"},{default:l(()=>[a(d,{modelValue:u(o).params,"onUpdate:modelValue":e[6]||(e[6]=t=>u(o).params=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8DEF\u7531\u53C2\u6570"},null,8,["modelValue"])]),_:1}),a(s,{label:"\u662F\u5426\u663E\u793A:",prop:"is_show"},{default:l(()=>[a(g,{modelValue:u(o).is_show,"onUpdate:modelValue":e[7]||(e[7]=t=>u(o).is_show=t)},{default:l(()=>[a(p,{label:1},{default:l(()=>[n("\u663E\u793A")]),_:1}),a(p,{label:0},{default:l(()=>[n("\u9690\u85CF")]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(s,{label:"\u662F\u5426\u7981\u7528:",prop:"is_disable"},{default:l(()=>[a(g,{modelValue:u(o).is_disable,"onUpdate:modelValue":e[8]||(e[8]=t=>u(o).is_disable=t)},{default:l(()=>[a(p,{label:0},{default:l(()=>[n("\u6B63\u5E38")]),_:1}),a(p,{label:1},{default:l(()=>[n("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});const We=oe(pe,[["__scopeId","data-v-003da096"]]);export{We as default};