您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

2 行
4.2KB

  1. import{E as j}from"./index-29b4120c.js";import{t as z,d as F,s as q}from"./tagsManage-b14aec3a.js";import{G as H,E as J,a as G,r as d,o as K,b as n,c as D,d as Q,f as a,h as l,u as C,L as W,j as X,e as m,i as _,F as Y,k as Z,s as ee}from"./index-dd5fae99.js";import{g as w,a as ae}from"./getIsShowRegionTree-21a24141.js";const le={class:"flex justify-between items-center"},te=["onClick"],oe=["onClick"],ne={class:"dialog-footer"},se=Z({name:"tagsManage"}),fe=Object.assign(se,{setup(re){const{proxy:g}=ee(),M=H(J.userStore).userInfo,s=G({name:void 0}),f=d(),N=d(2),P=G([{label:"序号",type:"index",width:"80"},{label:"标签名称",key:"name",prop:"name"},{label:"备注",key:"remark",prop:"remark"},{label:"创建时间",key:"createOn",prop:"createOn",width:"170"},{label:"操作",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(`是否删除${t.name}?`,"提示!",{type:"warning"}).then(async()=>{await F(t.id),g.$message.success("删除成功!"),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("提交成功!"),k()}})},k=()=>{r.value={},b.value.clearValidate(),v.value=!1,u()};return K(()=>{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"),L=n("el-dialog");return D(),Q(Y,null,[a(V,null,{default:l(()=>[C(w)(["SUPER_ADMIN","REGION_MANAGER"])?(D(),W(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})):X("",!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:"标签名称"},{default:l(()=>[a(y,{modelValue:s.name,"onUpdate:modelValue":e[0]||(e[0]=o=>s.name=o),placeholder:"请输入"},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]=[_("查询")])),_:1}),a(p,{onClick:$},{default:l(()=>e[6]||(e[6]=[_("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(I,null,{header:l(()=>[m("div",le,[e[8]||(e[8]=m("span",null,"标签列表",-1)),a(p,{type:"primary",icon:"Plus",size:"small",onClick:e[1]||(e[1]=o=>E(!1))},{default:l(()=>e[7]||(e[7]=[_(" 新增标签 ")])),_: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:h=>E(!0,o.row)},"编辑",8,te),m("a",{class:"text-danger",onClick:h=>S(o.row)},"删除",8,oe)]),_:1},8,["column","data","total"])]),_:1})])]),_:1},8,["span"])]),_:1}),a(L,{title:x.value?"编辑指标":"新增指标","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]=[_("提交")])),_:1}),a(p,{onClick:k},{default:l(()=>e[10]||(e[10]=[_("关闭")])),_:1})])]),default:l(()=>[a(A,{ref_key:"formRef",ref:b,model:r.value,"label-suffix":":","label-width":"100"},{default:l(()=>[a(c,{label:"指标名称",prop:"name",rules:[{required:!0,message:"请填写"}]},{default:l(()=>[a(y,{modelValue:r.value.name,"onUpdate:modelValue":e[2]||(e[2]=o=>r.value.name=o),maxlength:50,placeholder:"请填写"},null,8,["modelValue"])]),_:1}),a(c,{label:"备注"},{default:l(()=>[a(y,{modelValue:r.value.remark,"onUpdate:modelValue":e[3]||(e[3]=o=>r.value.remark=o),maxlength:100,placeholder:"请填写",type:"textarea","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["title","model-value"])],64)}}});export{fe as default};