WokerTask/public/admin/assets/edit.2bae9b1a.js

2 lines
6.6 KiB
JavaScript

import{a5 as j,K as G,D as H,C as K,c as O,H as Q,I as W,F as $}from"./element-plus.ff90c99c.js";import{P as z}from"./index.928157d8.js";import{a as J,b as X,c as Y}from"./user_menu.fc942b7c.js";import"./lodash.3e731b89.js";import{a as Z,M as ee,d as ue}from"./index.69a22209.js";import{d as v,E as oe,s as D,r as _,b as le,$ as V,ag as ae,o as F,c as B,W as l,Q as a,u,P as te,U as n}from"./@vue.f8dfc830.js";import"./lodash-es.a73406b7.js";import"./@vueuse.a2e59ee9.js";import"./@element-plus.0374639c.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.7f1be2bc.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.34a21088.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.af59f801.js";import"./axios.c2babb35.js";import"./vue-router.6d4cf914.js";import"./pinia.4b196199.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.3a7f085f.js";import"./color.5ae3e2dd.js";import"./clone.7bcb5228.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.37836f15.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.79024f1a.js";const re={class:"edit-popup"},se=["src"],de=v({name:"userMenuEdit"}),ie=v({...de,props:{dictData:{type:Object,default:()=>({})},menuList:{type:Array,default:()=>[]}},emits:["success","close"],setup(y,{expose:h,emit:f}){const U=y,w=Z(),x=oe("base_url"),E=D(),m=D(),c=_("add");_(!1);const A=r=>{o.icon=r.data.uri},b=_([{id:0,name:"\u9876\u7EA7",children:[]}]);(()=>{U.menuList.forEach(r=>{b.value[0].children.push(r)})})();const k=le(()=>c.value=="edit"?"\u7F16\u8F91\u7CFB\u7EDF\u83DC\u5355\u8868":"\u65B0\u589E\u7CFB\u7EDF\u83DC\u5355\u8868"),o=V({id:"",pid:"",type:ee.MENU,name:"",icon:"",sort:0,notes:"",paths:"",params:"",is_show:1,is_disable:0}),M=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])},q=async r=>{const e=await J({id:r.id});C(e)},R=async()=>{var e,i;await((e=E.value)==null?void 0:e.validate());const r={...o};c.value=="edit"?await X(r):await Y(r),(i=m.value)==null||i.close(),f("success")},I=(r="add")=>{var e;c.value=r,(e=m.value)==null||e.open()},P=()=>{f("close")};return h({open:I,setFormData:C,getDetail:q}),(r,e)=>{const i=j,s=H,d=K,S=ae("Plus"),T=O,L=G,p=Q,g=W,N=$;return F(),B("div",re,[l(z,{ref_key:"popupRef",ref:m,title:u(k),async:!0,width:"550px",onConfirm:R,onClose:P},{default:a(()=>[l(N,{ref_key:"formRef",ref:E,model:u(o),"label-width":"90px",rules:u(M)},{default:a(()=>[l(s,{label:"\u4E0A\u7EA7\u83DC\u5355",prop:"pid"},{default:a(()=>[l(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}),l(s,{label:"\u83DC\u5355\u540D\u79F0",prop:"name"},{default:a(()=>[l(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}),l(s,{label:"\u83DC\u5355\u56FE\u6807",prop:"icon"},{default:a(()=>[l(L,{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/image","show-file-list":!1,data:{cid:1},"on-success":A},{default:a(()=>[u(o).icon?(F(),B("img",{key:0,src:u(o).icon,class:"avatar"},null,8,se)):(F(),te(T,{key:1,class:"avatar-uploader-icon"},{default:a(()=>[l(S)]),_:1}))]),_:1},8,["modelValue","headers","action"])]),_:1}),l(s,{label:"\u83DC\u5355\u5907\u6CE8",prop:"notes"},{default:a(()=>[l(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}),l(s,{label:"\u83DC\u5355\u6392\u5E8F",prop:"sort"},{default:a(()=>[l(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}),l(s,{label:"\u8DEF\u7531\u5730\u5740",prop:"paths"},{default:a(()=>[l(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}),l(s,{label:"\u8DEF\u7531\u53C2\u6570",prop:"params"},{default:a(()=>[l(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}),l(s,{label:"\u662F\u5426\u663E\u793A:",prop:"is_show"},{default:a(()=>[l(g,{modelValue:u(o).is_show,"onUpdate:modelValue":e[7]||(e[7]=t=>u(o).is_show=t)},{default:a(()=>[l(p,{label:1},{default:a(()=>[n("\u663E\u793A")]),_:1}),l(p,{label:0},{default:a(()=>[n("\u9690\u85CF")]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"\u662F\u5426\u7981\u7528:",prop:"is_disable"},{default:a(()=>[l(g,{modelValue:u(o).is_disable,"onUpdate:modelValue":e[8]||(e[8]=t=>u(o).is_disable=t)},{default:a(()=>[l(p,{label:0},{default:a(()=>[n("\u6B63\u5E38")]),_:1}),l(p,{label:1},{default:a(()=>[n("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});const Xe=ue(ie,[["__scopeId","data-v-7dcd1473"]]);export{Xe as default};