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 line
7.6KB

  1. import{E as le}from"./index-29b4120c.js";import{j as ae,k as te,l as oe,m as ne,g as de}from"./indicatorTemplate-ca1642c9.js";import{E as ie,a as ue,r as m,b as d,c as f,d as w,f as l,h as a,e as b,F as k,H as E,u as se,L as $,i as s,j as F,k as re,$ as me,C as pe,s as fe}from"./index-dd5fae99.js";import ve from"./tagDialog-28392683.js";const ge={class:"flex justify-between items-center"},xe=["onClick"],be=["onClick"],_e=re({name:"projectTagStore"}),Le=Object.assign(_e,{setup(Ve){const{proxy:C}=fe(),{indexLevelOptions:S}=ie.dictStore.globalDicts||{},r=ue({regionCode:void 0,indexName:void 0,indexLevel:void 0}),_=m(),U=m(0),q=m([]),G=[{label:"序号",type:"index",width:"60"},{label:"指标名称",key:"indexName",prop:"indexName",minWidth:"200",showOverflowTooltip:!0},{label:"指标级别",key:"indexLevel",prop:"indexLevel",width:"100",render:n=>me("span",S[n.indexLevel])},{label:"创建时间",key:"createOn",prop:"createOn",width:"180"},{label:"操作",slot:"action",width:"120",fixed:"right"}],v=async(n=_.value.pageParams)=>{var i;const e=await ae({...n,...r});q.value=((i=e==null?void 0:e.data)==null?void 0:i.records)||[],U.value=e.data.total||0},H=()=>{v()},W=()=>{r.indexName=void 0,r.indexLevel=void 0,_.value.pageParams.pageNumber=1,_.value.pageParams.pageSize=10,v()},A=n=>{r.regionCode=n.regionLevel===3?n.regionCode:void 0,_.value.pageParams.pageNumber=1,v()},L=m(!1),c=m(),o=m({additional:!1}),D=m(),J={indexName:[{required:!0,message:"请输入"}],indexLevel:[{required:!0,message:"请选择"}],additional:[{required:!0,message:"请选择"}],indexScore:[{required:!0,message:"请输入"}],indexDetail:[{required:!0,message:"请输入"}],gradeDetail:[{required:!0,message:"请输入"}],supportMaterial:[{required:!0,message:"请输入"}]},y=m(!1),z=async(n,e)=>{if(Y(),e){const i=await te(e);o.value={...i.data,tagIds:i.data.tags.map(p=>p.id)}}c.value=n,L.value=!0,await pe(),D.value.clearValidate()},K=async n=>{n&&await n.validate(async e=>{if(e){y.value=!0;const i={...o.value,regionCode:r.regionCode,additional:o.value.indexLevel===3?o.value.additional:void 0};try{await oe(i),C.$message.success("提交成功!"),y.value=!1,N(!0)}catch{y.value=!1}}})},N=n=>{n&&v(),o.value={},L.value=!1},Q=n=>{C.$messageBox.confirm(`是否删除${n.indexName}?`,"提示!",{type:"warning"}).then(async()=>{await ne(n.id),C.$message.success("删除成功!"),await v()})},T=m(!1),X=()=>{T.value=!1},j=m([]),Y=async()=>{const n=await de({pageNumber:1,pageSize:1e3});j.value=n.data.records};return(n,e)=>{const i=d("el-col"),p=d("el-input"),u=d("el-form-item"),B=d("el-option"),O=d("el-select"),g=d("el-button"),P=d("el-row"),I=d("el-form"),M=d("el-card"),Z=d("table-list"),V=d("el-radio"),R=d("el-radio-group"),h=d("el-input-number"),ee=d("el-dialog");return f(),w(k,null,[l(P,{gutter:16},{default:a(()=>[l(i,{style:{"padding-right":"16px"},span:4},{default:a(()=>[l(le,{onGetTree:A})]),_:1}),l(i,{span:20},{default:a(()=>[b("div",null,[l(M,{shadow:"never",class:"search mb-16"},{default:a(()=>[l(I,{"label-suffix":":",model:r,size:"small"},{default:a(()=>[l(P,{gutter:16},{default:a(()=>[l(i,{span:8},{default:a(()=>[l(u,{label:"指标名称"},{default:a(()=>[l(p,{modelValue:r.indexName,"onUpdate:modelValue":e[0]||(e[0]=t=>r.indexName=t),maxlength:"10",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),l(i,{span:8},{default:a(()=>[l(u,{label:"指标级别"},{default:a(()=>[l(O,{modelValue:r.indexLevel,"onUpdate:modelValue":e[1]||(e[1]=t=>r.indexLevel=t)},{default:a(()=>[(f(!0),w(k,null,E(se(S),(t,x)=>(f(),$(B,{key:x,value:x*1,label:t},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(i,{span:8},{default:a(()=>[l(u,{class:"btn"},{default:a(()=>[l(g,{type:"primary",onClick:H},{default:a(()=>e[14]||(e[14]=[s("查询")])),_:1}),l(g,{onClick:W},{default:a(()=>e[15]||(e[15]=[s("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),l(M,{shadow:"never"},{header:a(()=>[b("div",ge,[e[18]||(e[18]=b("span",null,"指标列表",-1)),b("div",null,[l(g,{type:"primary",size:"small",onClick:e[2]||(e[2]=t=>T.value=!0)},{default:a(()=>e[16]||(e[16]=[s("指标标签管理")])),_:1}),l(g,{type:"primary",size:"small",icon:"Plus",onClick:e[3]||(e[3]=t=>z(1))},{default:a(()=>e[17]||(e[17]=[s("新增指标")])),_:1})])])]),default:a(()=>[l(Z,{ref_key:"tableListRef",ref:_,column:G,data:q.value,total:U.value,onGetTableData:v},{action:a(({scope:t})=>[b("a",{onClick:x=>z(2,t.row.id)},"编辑",8,xe),b("a",{class:"text-danger",onClick:x=>Q(t.row)},"删除",8,be)]),_:1},8,["data","total"])]),_:1})])]),_:1})]),_:1}),l(ee,{title:c.value===1?"新增指标":"编辑指标","model-value":L.value,"close-on-click-modal":!1,onClose:N},{footer:a(()=>[l(g,{type:"primary",size:"small",loading:y.value,onClick:e[13]||(e[13]=t=>K(D.value))},{default:a(()=>e[24]||(e[24]=[s(" 保存 ")])),_:1},8,["loading"]),l(g,{size:"small",onClick:N},{default:a(()=>e[25]||(e[25]=[s(" 关闭 ")])),_:1})]),default:a(()=>[l(I,{ref_key:"formRef",ref:D,model:o.value,rules:J,"label-suffix":":","label-width":"140"},{default:a(()=>[l(u,{label:"指标名称",prop:"indexName"},{default:a(()=>[l(p,{modelValue:o.value.indexName,"onUpdate:modelValue":e[4]||(e[4]=t=>o.value.indexName=t),maxlength:50,placeholder:"请输入"},null,8,["modelValue"])]),_:1}),l(u,{label:"指标级别",prop:"indexLevel"},{default:a(()=>[l(R,{modelValue:o.value.indexLevel,"onUpdate:modelValue":e[5]||(e[5]=t=>o.value.indexLevel=t),disabled:c.value===2},{default:a(()=>[l(V,{label:1},{default:a(()=>e[19]||(e[19]=[s("一级")])),_:1}),l(V,{label:2},{default:a(()=>e[20]||(e[20]=[s("二级")])),_:1}),l(V,{label:3},{default:a(()=>e[21]||(e[21]=[s("三级")])),_:1})]),_:1},8,["modelValue","disabled"])]),_:1}),o.value.indexLevel===3?(f(),$(u,{key:0,label:"是否为附加指标",prop:"additional"},{default:a(()=>[l(R,{modelValue:o.value.additional,"onUpdate:modelValue":e[6]||(e[6]=t=>o.value.additional=t),onChange:e[7]||(e[7]=t=>o.value.indexScore=void 0)},{default:a(()=>[l(V,{label:!1},{default:a(()=>e[22]||(e[22]=[s("否")])),_:1}),l(V,{label:!0},{default:a(()=>e[23]||(e[23]=[s("是")])),_:1})]),_:1},8,["modelValue"])]),_:1})):F("",!0),l(u,{label:"指标标签"},{default:a(()=>[l(O,{modelValue:o.value.tagIds,"onUpdate:modelValue":e[8]||(e[8]=t=>o.value.tagIds=t),multiple:"",class:"w-full",filterable:""},{default:a(()=>[(f(!0),w(k,null,E(j.value,(t,x)=>(f(),$(B,{key:x,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o.value.indexLevel===3?(f(),w(k,{key:1},[l(u,{label:"指标分值",prop:"indexScore"},{default:a(()=>[l(h,{modelValue:o.value.indexScore,"onUpdate:modelValue":e[9]||(e[9]=t=>o.value.indexScore=t),max:100,min:o.value.additional?void 0:0,precision:2,placeholder:"请输入"},null,8,["modelValue","min"])]),_:1}),l(u,{label:"指标细则",prop:"indexDetail"},{default:a(()=>[l(p,{modelValue:o.value.indexDetail,"onUpdate:modelValue":e[10]||(e[10]=t=>o.value.indexDetail=t),maxlength:1e3,type:"textarea","show-word-limit":"",placeholder:"请输入"},null,8,["modelValue"])]),_:1}),l(u,{label:"评分细则",prop:"gradeDetail"},{default:a(()=>[l(p,{modelValue:o.value.gradeDetail,"onUpdate:modelValue":e[11]||(e[11]=t=>o.value.gradeDetail=t),maxlength:1e3,type:"textarea","show-word-limit":"",placeholder:"请输入"},null,8,["modelValue"])]),_:1}),l(u,{label:"佐证材料",prop:"supportMaterial"},{default:a(()=>[l(p,{modelValue:o.value.supportMaterial,"onUpdate:modelValue":e[12]||(e[12]=t=>o.value.supportMaterial=t),maxlength:1e3,type:"textarea","show-word-limit":"",placeholder:"请输入"},null,8,["modelValue"])]),_:1})],64)):F("",!0)]),_:1},8,["model"])]),_:1},8,["title","model-value"]),l(ve,{visible:T.value,onClose:X},null,8,["visible"])],64)}}});export{Le as default};