|
1 |
- import{E as le}from"./index.af6ebbed.js";import{j as ae,k as te,l as oe,m as ne,g as de}from"./indicatorTemplate.b913f726.js";import{d as ie,D as ue,b as se,r as m,c as d,e as f,f as y,h as e,i as l,g as c,F as w,J as R,u as re,I as T,j as s,k as F,a0 as me,N as pe,x as fe}from"./index.d340e473.js";import ve from"./tagDialog.f90221b9.js";const _e={class:"flex justify-between items-center"},ge=c("span",null,"\u6307\u6807\u5217\u8868",-1),ce=["onClick"],xe=["onClick"],be=ie({name:"projectTagStore"}),Le=Object.assign(be,{setup(Ve){const{proxy:k}=fe(),{indexLevelOptions:$}=ue.dictStore.globalDicts||{},r=se({regionCode:void 0,indexName:void 0,indexLevel:void 0}),x=m(),S=m(0),U=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",$[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=x.value.pageParams)=>{var i;const a=await ae({...n,...r});U.value=((i=a==null?void 0:a.data)==null?void 0:i.records)||[],S.value=a.data.total||0},G=()=>{v()},J=()=>{r.indexName=void 0,r.indexLevel=void 0,x.value.pageParams.pageNumber=1,x.value.pageParams.pageSize=10,v()},W=n=>{r.regionCode=n.regionLevel===3?n.regionCode:void 0,x.value.pageParams.pageNumber=1,v()},C=m(!1),L=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"}]},V=m(!1),q=async(n,a)=>{if(X(),a){const i=await te(a);o.value={...i.data,tagIds:i.data.tags.map(p=>p.id)}}L.value=n,C.value=!0,await pe(),D.value.clearValidate()},H=async n=>{!n||await n.validate(async a=>{if(a){V.value=!0;const i={...o.value,regionCode:r.regionCode,additional:o.value.indexLevel===3?o.value.additional:void 0};try{await oe(i),k.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),V.value=!1,N(!0)}catch{V.value=!1}}})},N=n=>{n&&v(),o.value={},C.value=!1},K=n=>{k.$messageBox.confirm(`\u662F\u5426\u5220\u9664${n.indexName}?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await ne(n.id),k.$message.success("\u5220\u9664\u6210\u529F\uFF01"),await v()})},h=m(!1),Q=()=>{h.value=!1},z=m([]),X=async()=>{const n=await de({pageNumber:1,pageSize:1e3});z.value=n.data.records};return(n,a)=>{const i=d("el-col"),p=d("el-input"),u=d("el-form-item"),j=d("el-option"),B=d("el-select"),_=d("el-button"),I=d("el-row"),O=d("el-form"),P=d("el-card"),Y=d("table-list"),b=d("el-radio"),M=d("el-radio-group"),Z=d("el-input-number"),ee=d("el-dialog");return f(),y(w,null,[e(I,{gutter:16},{default:l(()=>[e(i,{style:{"padding-right":"16px"},span:4},{default:l(()=>[e(le,{onGetTree:W})]),_:1}),e(i,{span:20},{default:l(()=>[c("div",null,[e(P,{shadow:"never",class:"search mb-16"},{default:l(()=>[e(O,{"label-suffix":":",model:r,size:"small"},{default:l(()=>[e(I,{gutter:16},{default:l(()=>[e(i,{span:8},{default:l(()=>[e(u,{label:"\u6307\u6807\u540D\u79F0"},{default:l(()=>[e(p,{modelValue:r.indexName,"onUpdate:modelValue":a[0]||(a[0]=t=>r.indexName=t),maxlength:"10",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:8},{default:l(()=>[e(u,{label:"\u6307\u6807\u7EA7\u522B"},{default:l(()=>[e(B,{modelValue:r.indexLevel,"onUpdate:modelValue":a[1]||(a[1]=t=>r.indexLevel=t)},{default:l(()=>[(f(!0),y(w,null,R(re($),(t,g)=>(f(),T(j,{key:g,value:g*1,label:t},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(i,{span:8},{default:l(()=>[e(u,{class:"btn"},{default:l(()=>[e(_,{type:"primary",onClick:G},{default:l(()=>[s("\u67E5\u8BE2")]),_:1}),e(_,{onClick:J},{default:l(()=>[s("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(P,{shadow:"never"},{header:l(()=>[c("div",_e,[ge,c("div",null,[e(_,{type:"primary",size:"small",onClick:a[2]||(a[2]=t=>h.value=!0)},{default:l(()=>[s("\u6307\u6807\u6807\u7B7E\u7BA1\u7406")]),_:1}),e(_,{type:"primary",size:"small",icon:"Plus",onClick:a[3]||(a[3]=t=>q(1))},{default:l(()=>[s("\u65B0\u589E\u6307\u6807")]),_:1})])])]),default:l(()=>[e(Y,{ref_key:"tableListRef",ref:x,column:E,data:U.value,total:S.value,onGetTableData:v},{action:l(({scope:t})=>[c("a",{onClick:g=>q(2,t.row.id)},"\u7F16\u8F91",8,ce),c("a",{class:"text-danger",onClick:g=>K(t.row)},"\u5220\u9664",8,xe)]),_:1},8,["data","total"])]),_:1})])]),_:1})]),_:1}),e(ee,{title:L.value===1?"\u65B0\u589E\u6307\u6807":"\u7F16\u8F91\u6307\u6807","model-value":C.value,"close-on-click-modal":!1,onClose:N},{footer:l(()=>[e(_,{type:"primary",size:"small",loading:V.value,onClick:a[13]||(a[13]=t=>H(D.value))},{default:l(()=>[s(" \u4FDD\u5B58 ")]),_:1},8,["loading"]),e(_,{size:"small",onClick:N},{default:l(()=>[s(" \u5173\u95ED ")]),_:1})]),default:l(()=>[e(O,{ref_key:"formRef",ref:D,model:o.value,rules:A,"label-suffix":"\uFF1A","label-width":"140"},{default:l(()=>[e(u,{label:"\u6307\u6807\u540D\u79F0",prop:"indexName"},{default:l(()=>[e(p,{modelValue:o.value.indexName,"onUpdate:modelValue":a[4]||(a[4]=t=>o.value.indexName=t),maxlength:50,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(u,{label:"\u6307\u6807\u7EA7\u522B",prop:"indexLevel"},{default:l(()=>[e(M,{modelValue:o.value.indexLevel,"onUpdate:modelValue":a[5]||(a[5]=t=>o.value.indexLevel=t),disabled:L.value===2},{default:l(()=>[e(b,{label:1},{default:l(()=>[s("\u4E00\u7EA7")]),_:1}),e(b,{label:2},{default:l(()=>[s("\u4E8C\u7EA7")]),_:1}),e(b,{label:3},{default:l(()=>[s("\u4E09\u7EA7")]),_:1})]),_:1},8,["modelValue","disabled"])]),_:1}),o.value.indexLevel===3?(f(),T(u,{key:0,label:"\u662F\u5426\u4E3A\u9644\u52A0\u6307\u6807",prop:"additional"},{default:l(()=>[e(M,{modelValue:o.value.additional,"onUpdate:modelValue":a[6]||(a[6]=t=>o.value.additional=t),onChange:a[7]||(a[7]=t=>o.value.indexScore=void 0)},{default:l(()=>[e(b,{label:!1},{default:l(()=>[s("\u5426")]),_:1}),e(b,{label:!0},{default:l(()=>[s("\u662F")]),_:1})]),_:1},8,["modelValue"])]),_:1})):F("",!0),e(u,{label:"\u6307\u6807\u6807\u7B7E"},{default:l(()=>[e(B,{modelValue:o.value.tagIds,"onUpdate:modelValue":a[8]||(a[8]=t=>o.value.tagIds=t),multiple:"",class:"w-full",filterable:""},{default:l(()=>[(f(!0),y(w,null,R(z.value,(t,g)=>(f(),T(j,{key:g,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o.value.indexLevel===3?(f(),y(w,{key:1},[e(u,{label:"\u6307\u6807\u5206\u503C",prop:"indexScore"},{default:l(()=>[e(Z,{modelValue:o.value.indexScore,"onUpdate:modelValue":a[9]||(a[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}),e(u,{label:"\u6307\u6807\u7EC6\u5219",prop:"indexDetail"},{default:l(()=>[e(p,{modelValue:o.value.indexDetail,"onUpdate:modelValue":a[10]||(a[10]=t=>o.value.indexDetail=t),maxlength:1e3,type:"textarea","show-word-limit":"",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(u,{label:"\u8BC4\u5206\u7EC6\u5219",prop:"gradeDetail"},{default:l(()=>[e(p,{modelValue:o.value.gradeDetail,"onUpdate:modelValue":a[11]||(a[11]=t=>o.value.gradeDetail=t),maxlength:1e3,type:"textarea","show-word-limit":"",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(u,{label:"\u4F50\u8BC1\u6750\u6599",prop:"supportMaterial"},{default:l(()=>[e(p,{modelValue:o.value.supportMaterial,"onUpdate:modelValue":a[12]||(a[12]=t=>o.value.supportMaterial=t),maxlength:1e3,type:"textarea","show-word-limit":"",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})],64)):F("",!0)]),_:1},8,["model"])]),_:1},8,["title","model-value"]),e(ve,{visible:h.value,onClose:Q},null,8,["visible"])],64)}}});export{Le as default};
|