You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.4KB

  1. import{E as j}from"./index.0221fd55.js";import{t as z,d as F,s as q}from"./tagsManage.70c898e3.js";import{d as H,C as J,B as K,b as G,r as d,o as Q,c as n,e as D,f as W,h as a,i as l,u as C,G as X,k as Y,g as m,j as _,F as Z,q as ee}from"./index.149277cd.js";import{g as w,a as ae}from"./getIsShowRegionTree.4caa5c48.js";const le={class:"flex justify-between items-center"},te=["onClick"],oe=["onClick"],ne={class:"dialog-footer"},se=H({name:"tagsManage"}),fe=Object.assign(se,{setup(re){const{proxy:g}=ee(),M=J(K.userStore).userInfo,s=G({name:void 0}),f=d(),N=d(2),P=G([{label:"\u5E8F\u53F7",type:"index",width:"80"},{label:"\u6807\u7B7E\u540D\u79F0",key:"name",prop:"name"},{label:"\u5907\u6CE8",key:"remark",prop:"remark"},{label:"\u521B\u5EFA\u65F6\u95F4",key:"createOn",prop:"createOn",width:"170"},{label:"\u64CD\u4F5C",slot:"action",width:"140",fixed:"right"}]),R=d([]),u=async(t=f.value.pageParams)=>{const e=await z(s.regionCode,{...t,...s});R.value=e.data.records,N.value=e.data.total},T=()=>{u()},$=()=>{s.name=void 0,f.value.pageParams.pageNumber=1,f.value.pageParams.pageSize=10,u()},O=t=>{s.regionCode=t.regionLevel===3?t.regionCode:void 0,f.value.pageParams.pageNumber=1,u()},S=t=>{g.$messageBox.confirm(`\u662F\u5426\u5220\u9664${t.name}?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await F(t.id),g.$message.success("\u5220\u9664\u6210\u529F\uFF01"),u()})},v=d(!1),r=d(),b=d(),x=d(!1),E=(t,e)=>{x.value=t,v.value=!0,r.value=e||{}},U=async t=>{!t||await t.validate(async e=>{if(e){const i={...r.value,areaCode:s.regionCode||M.regionCode};await q(i),g.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),k()}})},k=()=>{r.value={},b.value.clearValidate(),v.value=!1,u()};return Q(()=>{w(["SUPER_ADMIN","REGION_MANAGER"])||u()}),(t,e)=>{const i=n("el-col"),y=n("el-input"),c=n("el-form-item"),p=n("el-button"),V=n("el-row"),A=n("el-form"),I=n("el-card"),B=n("table-list"),h=n("el-dialog");return D(),W(Z,null,[a(V,null,{default:l(()=>[C(w)(["SUPER_ADMIN","REGION_MANAGER"])?(D(),X(i,{key:0,style:{"padding-right":"16px"},span:4},{default:l(()=>[a(j,{params:C(ae)({SUPER_ADMIN:!1,REGION_MANAGER:!1}),onGetTree:O},null,8,["params"])]),_:1})):Y("",!0),a(i,{span:C(w)(["SUPER_ADMIN","REGION_MANAGER"])?20:24},{default:l(()=>[m("div",null,[a(I,{class:"search mb-16"},{default:l(()=>[a(A,{"label-suffix":":",model:s,size:"small"},{default:l(()=>[a(V,{gutter:16},{default:l(()=>[a(i,{span:8},{default:l(()=>[a(c,{label:"\u6807\u7B7E\u540D\u79F0"},{default:l(()=>[a(y,{modelValue:s.name,"onUpdate:modelValue":e[0]||(e[0]=o=>s.name=o),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),a(i,{span:16},{default:l(()=>[a(c,{class:"btn"},{default:l(()=>[a(p,{type:"primary",onClick:T},{default:l(()=>e[5]||(e[5]=[_("\u67E5\u8BE2")])),_:1}),a(p,{onClick:$},{default:l(()=>e[6]||(e[6]=[_("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(I,null,{header:l(()=>[m("div",le,[e[8]||(e[8]=m("span",null,"\u6807\u7B7E\u5217\u8868",-1)),a(p,{type:"primary",icon:"Plus",size:"small",onClick:e[1]||(e[1]=o=>E(!1))},{default:l(()=>e[7]||(e[7]=[_(" \u65B0\u589E\u6807\u7B7E ")])),_:1})])]),default:l(()=>[a(B,{ref_key:"tableListRef",ref:f,column:P,data:R.value,total:N.value,onGetTableData:u},{action:l(({scope:o})=>[m("a",{onClick:L=>E(!0,o.row)},"\u7F16\u8F91",8,te),m("a",{class:"text-danger",onClick:L=>S(o.row)},"\u5220\u9664",8,oe)]),_:1},8,["column","data","total"])]),_:1})])]),_:1},8,["span"])]),_:1}),a(h,{title:x.value?"\u7F16\u8F91\u6307\u6807":"\u65B0\u589E\u6307\u6807","model-value":v.value,onClose:k},{footer:l(()=>[m("span",ne,[a(p,{type:"primary",onClick:e[4]||(e[4]=o=>U(b.value))},{default:l(()=>e[9]||(e[9]=[_("\u63D0\u4EA4")])),_:1}),a(p,{onClick:k},{default:l(()=>e[10]||(e[10]=[_("\u5173\u95ED")])),_:1})])]),default:l(()=>[a(A,{ref_key:"formRef",ref:b,model:r.value,"label-suffix":"\uFF1A","label-width":"100"},{default:l(()=>[a(c,{label:"\u6307\u6807\u540D\u79F0",prop:"name",rules:[{required:!0,message:"\u8BF7\u586B\u5199"}]},{default:l(()=>[a(y,{modelValue:r.value.name,"onUpdate:modelValue":e[2]||(e[2]=o=>r.value.name=o),maxlength:50,placeholder:"\u8BF7\u586B\u5199"},null,8,["modelValue"])]),_:1}),a(c,{label:"\u5907\u6CE8"},{default:l(()=>[a(y,{modelValue:r.value.remark,"onUpdate:modelValue":e[3]||(e[3]=o=>r.value.remark=o),maxlength:100,placeholder:"\u8BF7\u586B\u5199",type:"textarea","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["title","model-value"])],64)}}});export{fe as default};