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
8.0KB

  1. import{E as le}from"./index.9bf9a70f.js";import{j as ae,k as te,l as oe,m as ne,g as de}from"./indicatorTemplate.1fbf6af1.js";import{d as ie,B as ue,b as se,r as m,c as d,e as f,f as w,h as l,i as a,g as b,F as k,H as F,u as re,G as $,j as s,k as G,Z as me,L as pe,q as fe}from"./index.66d3f9b1.js";import ve from"./tagDialog.2548cf50.js";const ge={class:"flex justify-between items-center"},xe=["onClick"],be=["onClick"],_e=ie({name:"projectTagStore"}),Ce=Object.assign(_e,{setup(Ve){const{proxy:L}=fe(),{indexLevelOptions:S}=ue.dictStore.globalDicts||{},r=se({regionCode:void 0,indexName:void 0,indexLevel:void 0}),_=m(),U=m(0),q=m([]),E=[{label:"\u5E8F\u53F7",type:"index",width:"60"},{label:"\u6307\u6807\u540D\u79F0",key:"indexName",prop:"indexName",minWidth:"200",showOverflowTooltip:!0},{label:"\u6307\u6807\u7EA7\u522B",key:"indexLevel",prop:"indexLevel",width:"100",render:n=>me("span",S[n.indexLevel])},{label:"\u521B\u5EFA\u65F6\u95F4",key:"createOn",prop:"createOn",width:"180"},{label:"\u64CD\u4F5C",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()},Z=n=>{r.regionCode=n.regionLevel===3?n.regionCode:void 0,_.value.pageParams.pageNumber=1,v()},C=m(!1),c=m(),o=m({additional:!1}),D=m(),A={indexName:[{required:!0,message:"\u8BF7\u8F93\u5165"}],indexLevel:[{required:!0,message:"\u8BF7\u9009\u62E9"}],additional:[{required:!0,message:"\u8BF7\u9009\u62E9"}],indexScore:[{required:!0,message:"\u8BF7\u8F93\u5165"}],indexDetail:[{required:!0,message:"\u8BF7\u8F93\u5165"}],gradeDetail:[{required:!0,message:"\u8BF7\u8F93\u5165"}],supportMaterial:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},y=m(!1),z=async(n,e)=>{if(X(),e){const i=await te(e);o.value={...i.data,tagIds:i.data.tags.map(p=>p.id)}}c.value=n,C.value=!0,await pe(),D.value.clearValidate()},J=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),L.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),y.value=!1,N(!0)}catch{y.value=!1}}})},N=n=>{n&&v(),o.value={},C.value=!1},K=n=>{L.$messageBox.confirm(`\u662F\u5426\u5220\u9664${n.indexName}?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await ne(n.id),L.$message.success("\u5220\u9664\u6210\u529F\uFF01"),await v()})},T=m(!1),Q=()=>{T.value=!1},B=m([]),X=async()=>{const n=await de({pageNumber:1,pageSize:1e3});B.value=n.data.records};return(n,e)=>{const i=d("el-col"),p=d("el-input"),u=d("el-form-item"),j=d("el-option"),O=d("el-select"),g=d("el-button"),P=d("el-row"),I=d("el-form"),M=d("el-card"),Y=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:Z})]),_: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:"\u6307\u6807\u540D\u79F0"},{default:a(()=>[l(p,{modelValue:r.indexName,"onUpdate:modelValue":e[0]||(e[0]=t=>r.indexName=t),maxlength:"10",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(i,{span:8},{default:a(()=>[l(u,{label:"\u6307\u6807\u7EA7\u522B"},{default:a(()=>[l(O,{modelValue:r.indexLevel,"onUpdate:modelValue":e[1]||(e[1]=t=>r.indexLevel=t)},{default:a(()=>[(f(!0),w(k,null,F(re(S),(t,x)=>(f(),$(j,{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("\u67E5\u8BE2")])),_:1}),l(g,{onClick:W},{default:a(()=>e[15]||(e[15]=[s("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),l(M,{shadow:"never"},{header:a(()=>[b("div",ge,[e[18]||(e[18]=b("span",null,"\u6307\u6807\u5217\u8868",-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("\u6307\u6807\u6807\u7B7E\u7BA1\u7406")])),_:1}),l(g,{type:"primary",size:"small",icon:"Plus",onClick:e[3]||(e[3]=t=>z(1))},{default:a(()=>e[17]||(e[17]=[s("\u65B0\u589E\u6307\u6807")])),_:1})])])]),default:a(()=>[l(Y,{ref_key:"tableListRef",ref:_,column:E,data:q.value,total:U.value,onGetTableData:v},{action:a(({scope:t})=>[b("a",{onClick:x=>z(2,t.row.id)},"\u7F16\u8F91",8,xe),b("a",{class:"text-danger",onClick:x=>K(t.row)},"\u5220\u9664",8,be)]),_:1},8,["data","total"])]),_:1})])]),_:1})]),_:1}),l(ee,{title:c.value===1?"\u65B0\u589E\u6307\u6807":"\u7F16\u8F91\u6307\u6807","model-value":C.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=>J(D.value))},{default:a(()=>e[24]||(e[24]=[s(" \u4FDD\u5B58 ")])),_:1},8,["loading"]),l(g,{size:"small",onClick:N},{default:a(()=>e[25]||(e[25]=[s(" \u5173\u95ED ")])),_:1})]),default:a(()=>[l(I,{ref_key:"formRef",ref:D,model:o.value,rules:A,"label-suffix":"\uFF1A","label-width":"140"},{default:a(()=>[l(u,{label:"\u6307\u6807\u540D\u79F0",prop:"indexName"},{default:a(()=>[l(p,{modelValue:o.value.indexName,"onUpdate:modelValue":e[4]||(e[4]=t=>o.value.indexName=t),maxlength:50,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),l(u,{label:"\u6307\u6807\u7EA7\u522B",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("\u4E00\u7EA7")])),_:1}),l(V,{label:2},{default:a(()=>e[20]||(e[20]=[s("\u4E8C\u7EA7")])),_:1}),l(V,{label:3},{default:a(()=>e[21]||(e[21]=[s("\u4E09\u7EA7")])),_:1})]),_:1},8,["modelValue","disabled"])]),_:1}),o.value.indexLevel===3?(f(),$(u,{key:0,label:"\u662F\u5426\u4E3A\u9644\u52A0\u6307\u6807",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("\u5426")])),_:1}),l(V,{label:!0},{default:a(()=>e[23]||(e[23]=[s("\u662F")])),_:1})]),_:1},8,["modelValue"])]),_:1})):G("",!0),l(u,{label:"\u6307\u6807\u6807\u7B7E"},{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,F(B.value,(t,x)=>(f(),$(j,{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:"\u6307\u6807\u5206\u503C",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:"\u8BF7\u8F93\u5165"},null,8,["modelValue","min"])]),_:1}),l(u,{label:"\u6307\u6807\u7EC6\u5219",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:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),l(u,{label:"\u8BC4\u5206\u7EC6\u5219",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:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),l(u,{label:"\u4F50\u8BC1\u6750\u6599",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:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})],64)):G("",!0)]),_:1},8,["model"])]),_:1},8,["title","model-value"]),l(ve,{visible:T.value,onClose:Q},null,8,["visible"])],64)}}});export{Ce as default};