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

  1. import{b as E,c as G,d as A,e as H,f as J}from"./indicatorTemplate.6a45107e.js";import{d as K,b as Q,r,o as W,c as d,e as X,f as Y,g as c,h as e,i as l,j as i,F as Z,a0 as ee,N as le,x as ae}from"./index.8d65dd27.js";const te={class:"flex justify-between items-center"},oe=c("span",null,"\u6307\u6807\u5217\u8868",-1),ne=["onClick"],de=["onClick"],se=K({name:"appTemp"}),me=Object.assign(se,{setup(ue){const{proxy:x}=ae(),p=Q({indexName:void 0}),v=r(),w=r(0),h=r([]),F=[{label:"\u5E8F\u53F7",type:"index",width:"60"},{label:"\u6307\u6807\u540D\u79F0",key:"indexName",prop:"indexName"},{label:"\u6392\u5E8F",key:"sort",prop:"sort",width:80},{label:"\u6307\u6807\u6240\u5C5E\u6A21\u5757",key:"indexOwningModule",prop:"indexOwningModule"},{label:"\u6307\u6807\u7C7B\u578B",key:"indexType",prop:"indexType",width:80,render:n=>ee("span",n.indexType===1?"\u901A\u7528\u6307\u6807":n.indexType===2?"\u8F85\u52A9\u6307\u6807":"-")},{label:"\u662F\u5426\u663E\u793A",key:"isDisplay",slot:"isDisplay",width:80},{label:"\u64CD\u4F5C",slot:"action",width:"120",fixed:"right"}],m=async(n=v.value.pageParams)=>{var s;const a=await E({...n,...p});h.value=((s=a==null?void 0:a.data)==null?void 0:s.records)||[],w.value=a.data.total},M=()=>{m()},O=()=>{p.indexName=void 0,v.value.pageParams.pageNumber=1,v.value.pageParams.pageSize=10,m()},y=r(!1),D=r(),o=r({}),b=r(),I={indexName:[{required:!0,message:"\u8BF7\u8F93\u5165"}],indexOwningModule:[{required:!0,message:"\u8BF7\u8F93\u5165"}],sort:[{required:!0,message:"\u8BF7\u8F93\u5165"}],displayForm:[{required:!0,message:"\u8BF7\u9009\u62E9"}],indexType:[{required:!0,message:"\u8BF7\u9009\u62E9"}],indexScore:[{required:!0,message:"\u8BF7\u8F93\u5165"}],unit:[{required:!0,message:"\u8BF7\u8F93\u5165"}],indexDef:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},g=r(!1),k=async(n,a)=>{if(n===2){const s=await G(a.id);o.value={...s.data}}D.value=n,y.value=!0,await le(),b.value.clearValidate()},S=async n=>{!n||await n.validate(async a=>{if(a){g.value=!0;const s={...o.value};try{await A(s),x.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),m(),g.value=!1,N(!0)}catch{g.value=!1}}})},N=()=>{o.value={},y.value=!1},z=n=>{x.$messageBox.confirm(`\u662F\u5426\u5220\u9664${n.indexName}?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await H(n.id),x.$message.success("\u5220\u9664\u6210\u529F\uFF01"),await m()})},B=async n=>{try{return await J(n.id,!n.isDisplay),x.$message.success(`${n.isDisplay?"\u7981\u7528":"\u542F\u7528"}\u6210\u529F\uFF01`),m(),!0}catch{return!1}};return W(()=>{m()}),(n,a)=>{const s=d("el-input"),u=d("el-form-item"),T=d("el-col"),f=d("el-button"),P=d("el-row"),C=d("el-form"),U=d("el-card"),R=d("el-switch"),j=d("table-list"),$=d("el-input-number"),_=d("el-radio"),q=d("el-radio-group"),L=d("el-dialog");return X(),Y(Z,null,[c("div",null,[e(U,{shadow:"never",class:"search mb-16"},{default:l(()=>[e(C,{"label-suffix":":",model:p,size:"small"},{default:l(()=>[e(P,{gutter:16},{default:l(()=>[e(T,{span:8},{default:l(()=>[e(u,{label:"\u6307\u6807\u540D\u79F0"},{default:l(()=>[e(s,{modelValue:p.indexName,"onUpdate:modelValue":a[0]||(a[0]=t=>p.indexName=t),maxlength:"10",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(T,{span:8},{default:l(()=>[e(u,{class:"btn"},{default:l(()=>[e(f,{type:"primary",onClick:M},{default:l(()=>[i("\u67E5\u8BE2")]),_:1}),e(f,{onClick:O},{default:l(()=>[i("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(U,{shadow:"never"},{header:l(()=>[c("div",te,[oe,e(f,{type:"primary",size:"small",icon:"Plus",onClick:a[1]||(a[1]=t=>k(1))},{default:l(()=>[i("\u65B0\u589E\u6307\u6807")]),_:1})])]),default:l(()=>[e(j,{ref_key:"tableListRef",ref:v,column:F,data:h.value,total:w.value,onGetTableData:m},{isDisplay:l(({scope:t})=>[e(R,{modelValue:t.row.isDisplay,"onUpdate:modelValue":V=>t.row.isDisplay=V,"before-change":()=>B(t.row)},null,8,["modelValue","onUpdate:modelValue","before-change"])]),action:l(({scope:t})=>[c("a",{onClick:V=>k(2,t.row)},"\u7F16\u8F91",8,ne),c("a",{class:"text-danger",onClick:V=>z(t.row)},"\u5220\u9664",8,de)]),_:1},8,["data","total"])]),_:1})]),e(L,{title:D.value===1?"\u65B0\u589E\u6307\u6807":"\u7F16\u8F91\u6307\u6807","model-value":y.value},{footer:l(()=>[e(f,{type:"primary",size:"small",loading:g.value,onClick:a[10]||(a[10]=t=>S(b.value))},{default:l(()=>[i(" \u4FDD\u5B58 ")]),_:1},8,["loading"]),e(f,{size:"small",onClick:N},{default:l(()=>[i(" \u5173\u95ED ")]),_:1})]),default:l(()=>[e(C,{ref_key:"formRef",ref:b,model:o.value,rules:I,"label-suffix":"\uFF1A","label-width":"130"},{default:l(()=>[e(u,{label:"\u6307\u6807\u540D\u79F0",prop:"indexName"},{default:l(()=>[e(s,{modelValue:o.value.indexName,"onUpdate:modelValue":a[2]||(a[2]=t=>o.value.indexName=t),maxlength:50,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(u,{label:"\u6307\u6807\u6240\u5C5E\u6A21\u677F",prop:"indexOwningModule"},{default:l(()=>[e(s,{modelValue:o.value.indexOwningModule,"onUpdate:modelValue":a[3]||(a[3]=t=>o.value.indexOwningModule=t),maxlength:50,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(u,{label:"\u6392\u5E8F",prop:"sort"},{default:l(()=>[e($,{modelValue:o.value.sort,"onUpdate:modelValue":a[4]||(a[4]=t=>o.value.sort=t),min:1,precision:0,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(u,{label:"\u5C55\u793A\u5F62\u5F0F",prop:"displayForm"},{default:l(()=>[e(q,{modelValue:o.value.displayForm,"onUpdate:modelValue":a[5]||(a[5]=t=>o.value.displayForm=t)},{default:l(()=>[e(_,{label:1},{default:l(()=>[i("\u56FE\u8868")]),_:1}),e(_,{label:2},{default:l(()=>[i("\u6587\u5B57")]),_:1}),e(_,{label:3},{default:l(()=>[i("\u8BC4\u5206")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(u,{label:"\u6307\u6807\u7C7B\u578B",prop:"indexType"},{default:l(()=>[e(q,{modelValue:o.value.indexType,"onUpdate:modelValue":a[6]||(a[6]=t=>o.value.indexType=t)},{default:l(()=>[e(_,{label:1},{default:l(()=>[i("\u901A\u7528\u6307\u6807")]),_:1}),e(_,{label:2},{default:l(()=>[i("\u8F85\u52A9\u6307\u6807")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(u,{label:"\u5355\u4F4D",prop:"unit"},{default:l(()=>[e(s,{modelValue:o.value.unit,"onUpdate:modelValue":a[7]||(a[7]=t=>o.value.unit=t),maxlength:50,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(u,{label:"\u6307\u6807\u5B9A\u4E49",prop:"indexDef"},{default:l(()=>[e(s,{modelValue:o.value.indexDef,"onUpdate:modelValue":a[8]||(a[8]=t=>o.value.indexDef=t),maxlength:500,placeholder:"\u8BF7\u8F93\u5165",type:"textarea","show-word-limit":""},null,8,["modelValue"])]),_:1}),e(u,{label:"\u6307\u6807\u5206\u503C",prop:"indexScore"},{default:l(()=>[e($,{modelValue:o.value.indexScore,"onUpdate:modelValue":a[9]||(a[9]=t=>o.value.indexScore=t),max:100,min:0,precision:2,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["title","model-value"])],64)}}});export{me as default};