No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

2 líneas
6.9KB

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