2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
import{g as ce,r as N,_ as C,an as $,l as i,W as ue,j as pe,A as fe,k as b,m as x,n as e,B as z,am as ge,p as t,t as n,az as h,E as c,F as u,I as _e,a6 as K,ak as ke,aA as he,aB as ye,aF as ve,V as we,aK as Ce,ay as be,aL as xe,au as Se}from"./vendor/index.CRpmXtWV.js";import{u as A}from"./neinfo.CsfhUo_f.js";import{d as Te,p as ze,R as S,N as Oe,_ as Be}from"../index.D-NvtsOM.js";import{u as Re}from"./dict.DBZ2k0Lk.js";import{l as Ne,u as Ie,d as De,a as Fe}from"./neConfigBackup.isng_T9E.js";import"./neInfo.DNMxf4Rh.js";import"./parse-tree-utils.CVXqlbRx.js";import"./task.DBr8g4rv.js";const Le=ce({__name:"index",setup(Pe){const{t:o}=Te(),{getDict:U}=Re();let W=N([]),V=N([]),r=C({neType:void 0,name:"",pageNum:1,pageSize:20});function j(){r=Object.assign(r,{neType:void 0,name:"",pageNum:1,pageSize:20}),_.current=1,_.pageSize=20,f()}let d=C({loading:!1,size:"middle",seached:!1,data:[],selectedRowKeys:[]}),I=N([{title:o("common.rowId"),dataIndex:"id",align:"left",width:100},{title:o("views.ne.common.neType"),dataIndex:"neType",align:"left",width:100},{title:o("views.ne.common.neId"),dataIndex:"neId",align:"left",width:100},{title:o("common.createTime"),dataIndex:"createTime",align:"center",customRender(a){return a.value?ze(a.value):""},width:150},{title:o("views.ne.neConfigBackup.name"),dataIndex:"name",align:"left",width:200,resizable:!0,minWidth:100,maxWidth:300,ellipsis:!0},{title:o("common.remark"),dataIndex:"remark",key:"remark",align:"left",width:150,resizable:!0,minWidth:100,maxWidth:300,ellipsis:!0},{title:o("common.operate"),key:"id",align:"left"}]),_=C({current:1,pageSize:20,defaultPageSize:20,pageSizeOptions:["10","20","50","100"],hideOnSinglePage:!1,showQuickJumper:!0,showSizeChanger:!0,total:0,showTotal:a=>o("common.tablePaginationTotal",{total:a}),onChange:(a,l)=>{_.current=a,_.pageSize=l,r.pageNum=a,r.pageSize=l,f()}});function q({key:a}){d.size=a}function H(a){d.selectedRowKeys=a}function f(a){d.loading||(d.loading=!0,a&&(r.pageNum=a),Ne($(r)).then(l=>{l.code===S&&Array.isArray(l.rows)&&(_.total=l.total,d.data=l.rows,_.total<=(r.pageNum-1)*_.pageSize&&r.pageNum!==1&&(d.loading=!1,f(r.pageNum-1))),d.loading=!1}))}function Q(a){i.Modal.confirm({title:o("common.tipTitle"),content:o("views.ne.neConfigBackup.downTip",{txt:a.name}),onOk(){const l=i.message.loading(o("common.loading"),0);De(a.id).then(g=>{g.code===S?(i.message.success({content:o("common.operateOk"),duration:2}),Se(g.data,`${a.name}`)):i.message.error({content:`${g.msg}`,duration:2})}).finally(()=>{l()})}})}function D(a){if(!a||s.confirmLoading)return;let l=a;a==="0"&&(l=`...${d.selectedRowKeys.length}`,a=d.selectedRowKeys.join(",")),i.Modal.confirm({title:o("common.tipTitle"),content:o("views.dashboard.ue.delTip",{msg:l}),onOk(){s.confirmLoading=!0;const g=i.message.loading(o("common.loading"),0);Fe(a).then(p=>{p.code===S?(i.message.success({content:o("common.operateOk"),duration:3}),f(1)):i.message.error({content:`${p.msg}`,duration:3})}).finally(()=>{g(),s.confirmLoading=!1})}})}let s=C({visibleByEdit:!1,title:"备份记录",from:{id:void 0,name:"",remark:""},confirmLoading:!1});function G(a){s.confirmLoading||(s.from.id=a.id,s.from.name=a.name,s.from.remark=a.remark,s.title=o("views.ne.neConfigBackup.title",{txt:a.id}),s.visibleByEdit=!0)}const v=i.Form.useForm(s.from,C({name:[{required:!0,message:"请输入名称"}]}));function J(){v.validate().then(a=>{s.confirmLoading=!0;const l=$(s.from),g=i.message.loading(o("common.loading"),0);Ie(l).then(p=>{p.code===S?(i.message.success({content:o("common.msgSuccess",{msg:s.title}),duration:3}),s.visibleByEdit=!1,v.resetFields(),f()):(i.message.error({content:`${p.msg}`,duration:3}),f())}).finally(()=>{g(),s.confirmLoading=!1})}).catch(a=>{i.message.error(o("common.errorFields",{num:a.errorFields.length}),3)})}function Y(){s.visibleByEdit=!1,v.resetFields()}return ue(()=>{U("ne_license_status").then(a=>{W.value=a}),A().fnNelist().then(a=>{a.code===S&&Array.isArray(a.data)?V.value=A().getNeSelectOtions:i.message.warning({content:o("common.noData"),duration:2})}).finally(()=>{f()})}),(a,l)=>{const g=i.AutoComplete,p=i.FormItem,O=i.Col,F=i.Input,X=he,k=i.Button,Z=ye,T=i.Space,ee=i.Row,L=i.Form,P=i.Card,E=ve,te=i.Switch,y=i.Tooltip,ne=we,oe=Ce,B=i.MenuItem,ae=i.Menu,le=i.Dropdown,ie=be,se=xe,de=i.Table,me=i.Textarea,re=pe("ProModal"),R=fe("perms");return b(),x(t(ke),null,{default:e(()=>[z(n(P,{bordered:!1,"body-style":{marginBottom:"24px",paddingBottom:0}},{default:e(()=>[n(L,{model:t(r),name:"queryParams",layout:"horizontal"},{default:e(()=>[n(ee,{gutter:16},{default:e(()=>[n(O,{lg:6,md:12,xs:24},{default:e(()=>[n(p,{label:t(o)("views.ne.common.neType"),name:"neType "},{default:e(()=>[n(g,{value:t(r).neType,"onUpdate:value":l[0]||(l[0]=m=>t(r).neType=m),options:t(Oe).map(m=>({value:m})),"allow-clear":!0,placeholder:t(o)("common.inputPlease")},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1}),n(O,{lg:6,md:12,xs:24},{default:e(()=>[n(p,{label:t(o)("views.ne.neConfigBackup.name"),name:"name"},{default:e(()=>[n(F,{value:t(r).name,"onUpdate:value":l[1]||(l[1]=m=>t(r).name=m),"allow-clear":!0,placeholder:t(o)("common.inputPlease")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1}),n(O,{lg:6,md:12,xs:24},{default:e(()=>[n(p,null,{default:e(()=>[n(T,{size:8},{default:e(()=>[n(k,{type:"primary",onClick:l[2]||(l[2]=h(m=>f(1),["prevent"]))},{icon:e(()=>[n(X)]),default:e(()=>[c(" "+u(t(o)("common.search")),1)]),_:1}),n(k,{type:"default",onClick:h(j,["prevent"])},{icon:e(()=>[n(Z)]),default:e(()=>[c(" "+u(t(o)("common.reset")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},512),[[ge,t(d).seached]]),n(P,{bordered:!1,"body-style":{padding:"0px"}},{title:e(()=>[n(T,{size:8,align:"center"},{default:e(()=>[z((b(),x(k,{type:"default",danger:"",disabled:t(d).selectedRowKeys.length<=0,loading:t(s).confirmLoading,onClick:l[3]||(l[3]=h(m=>D("0"),["prevent"]))},{icon:e(()=>[n(E)]),default:e(()=>[c(" "+u(t(o)("common.deleteText")),1)]),_:1},8,["disabled","loading"])),[[R,["ne:neConfigBackup:remove"],"has"]])]),_:1})]),extra:e(()=>[n(T,{size:8,align:"center"},{default:e(()=>[n(y,null,{title:e(()=>[c(u(t(o)("common.searchBarText")),1)]),default:e(()=>[n(te,{checked:t(d).seached,"onUpdate:checked":l[4]||(l[4]=m=>t(d).seached=m),"checked-children":t(o)("common.switch.show"),"un-checked-children":t(o)("common.switch.hide"),size:"small"},null,8,["checked","checked-children","un-checked-children"])]),_:1}),n(y,null,{title:e(()=>[c(u(t(o)("common.reloadText")),1)]),default:e(()=>[n(k,{type:"text",onClick:l[5]||(l[5]=h(m=>f(),["prevent"]))},{icon:e(()=>[n(ne)]),_:1})]),_:1}),n(y,{placement:"topRight"},{title:e(()=>[c(u(t(o)("common.sizeText")),1)]),default:e(()=>[n(le,{placement:"bottomRight",trigger:"click"},{overlay:e(()=>[n(ae,{"selected-keys":[t(d).size],onClick:q},{default:e(()=>[n(B,{key:"default"},{default:e(()=>[c(u(t(o)("common.size.default")),1)]),_:1}),n(B,{key:"middle"},{default:e(()=>[c(u(t(o)("common.size.middle")),1)]),_:1}),n(B,{key:"small"},{default:e(()=>[c(u(t(o)("common.size.small")),1)]),_:1})]),_:1},8,["selected-keys"])]),default:e(()=>[n(k,{type:"text"},{icon:e(()=>[n(oe)]),_:1})]),_:1})]),_:1})]),_:1})]),default:e(()=>[n(de,{class:"table","row-key":"id",columns:t(I),loading:t(d).loading,"data-source":t(d).data,size:t(d).size,pagination:t(_),scroll:{x:t(I).length*180},onResizeColumn:l[6]||(l[6]=(m,w)=>w.width=m),"row-selection":{type:"checkbox",columnWidth:"48px",selectedRowKeys:t(d).selectedRowKeys,onChange:H}},{bodyCell:e(({column:m,record:w})=>[m.key==="id"?(b(),x(T,{key:0,size:8,align:"center"},{default:e(()=>[n(y,null,{title:e(()=>[c(u(t(o)("common.downloadText")),1)]),default:e(()=>[n(k,{type:"link",onClick:h(M=>Q(w),["prevent"])},{icon:e(()=>[n(ie)]),_:2},1032,["onClick"])]),_:2},1024),n(y,null,{title:e(()=>[c(u(t(o)("common.deleteText")),1)]),default:e(()=>[z((b(),x(k,{type:"link",onClick:h(M=>D(w.id),["prevent"])},{icon:e(()=>[n(E)]),_:2},1032,["onClick"])),[[R,["ne:neConfigBackup:remove"],"has"]])]),_:2},1024),n(y,null,{title:e(()=>[c(u(t(o)("common.editText")),1)]),default:e(()=>[z((b(),x(k,{type:"link",onClick:h(M=>G(w),["prevent"])},{icon:e(()=>[n(se)]),_:2},1032,["onClick"])),[[R,["ne:neConfigBackup:edit"],"has"]])]),_:2},1024)]),_:2},1024)):_e("",!0)]),_:1},8,["columns","loading","data-source","size","pagination","scroll","row-selection"])]),_:1}),n(re,{drag:!0,width:512,destroyOnClose:!0,keyboard:!1,"mask-closable":!1,visible:t(s).visibleByEdit,title:t(s).title,"confirm-loading":t(s).confirmLoading,onOk:J,onCancel:Y},{default:e(()=>[n(L,{name:"modalStateFrom",layout:"horizontal","wrapper-col":{span:18},"label-col":{span:6},labelWrap:!0},{default:e(()=>[n(p,K({label:t(o)("views.ne.neConfigBackup.name"),name:"name"},t(v).validateInfos.name),{default:e(()=>[n(F,{value:t(s).from.name,"onUpdate:value":l[7]||(l[7]=m=>t(s).from.name=m),"allow-clear":!0,placeholder:t(o)("common.inputPlease")},null,8,["value","placeholder"])]),_:1},16,["label"]),n(p,K({label:t(o)("common.remark"),name:"remark"},t(v).validateInfos.remark),{default:e(()=>[n(me,{value:t(s).from.remark,"onUpdate:value":l[8]||(l[8]=m=>t(s).from.remark=m),"auto-size":{minRows:2,maxRows:6},maxlength:400,"show-count":!0},null,8,["value"])]),_:1},16,["label"])]),_:1})]),_:1},8,["visible","title","confirm-loading"])]),_:1})}}}),je=Be(Le,[["__scopeId","data-v-6d062f1a"]]);export{je as default};
|