1
0
Files
build.ems/build/usr/local/omc/htdocs/front/js/index.FKmAIomH.js
2024-10-25 14:59:47 +08:00

2 lines
12 KiB
JavaScript

import{g as fe,_ as T,an as $,l as i,r as ge,W as _e,j as ve,k as R,m as B,n as a,B as ye,am as be,p as e,t,az as w,E as f,F as g,I as q,a6 as x,ak as Te,aA as we,aB as ke,aC as he,V as xe,aK as Ce,aL as Me,aF as Se}from"./vendor/index.CRpmXtWV.js";import{_ as Ie}from"./index.vue_vue_type_script_setup_true_lang.m9m5k4_V.js";import{d as ze,R as I,_ as Oe}from"../index.D-NvtsOM.js";import{u as A}from"./neinfo.CsfhUo_f.js";import{l as Pe,u as Ne,a as Fe,d as Re}from"./customTarget.DHeup4Vu.js";import{g as Be}from"./goldTarget.De2IzyrI.js";import{u as De}from"./dict.DBZ2k0Lk.js";import"./neInfo.DNMxf4Rh.js";import"./parse-tree-utils.CVXqlbRx.js";import"./task.DBr8g4rv.js";const Ue=fe({__name:"index",setup(Ee){const{t:l,currentLocale:V}=ze(),{getDict:K}=De();let j=T({sysNormalDisable:[]}),c=T({neType:"",pageNum:1,pageSize:20});function J(){c=Object.assign(c,{neType:"",pageNum:1,pageSize:20}),v.current=1,v.pageSize=20,y()}let m=T({loading:!1,size:"middle",seached:!0,data:[],selectedRowKeys:[]}),H=[{title:l("views.perfManage.taskManage.neType"),dataIndex:"neType",align:"center"},{title:l("views.perfManage.customTarget.kpiId"),dataIndex:"kpiId",align:"center"},{title:l("views.perfManage.customTarget.title"),dataIndex:"title",align:"center"},{title:l("views.perfManage.customTarget.description"),dataIndex:"description",align:"center"},{title:l("views.perfManage.customTarget.status"),dataIndex:"status",key:"status",align:"left",width:100},{title:l("common.operate"),key:"id",align:"center"}],v=T({current:1,pageSize:20,defaultPageSize:20,pageSizeOptions:["10","20","50","100"],hideOnSinglePage:!1,showQuickJumper:!0,showSizeChanger:!0,total:0,showTotal:s=>l("common.tablePaginationTotal",{total:s}),onChange:(s,n)=>{v.current=s,v.pageSize=n,c.pageNum=s,c.pageSize=n,y()}});function Q({key:s}){m.size=s}function W(s){i.Modal.confirm({title:l("common.tipTitle"),content:l("views.perfManage.customTarget.delCustomTip",{num:s.id}),onOk(){const n="delThreshold";i.message.loading({content:l("common.loading"),key:n}),Re(s).then(p=>{p.code===I?(i.message.success({content:l("views.perfManage.customTarget.delCustom",{num:s.id}),key:n,duration:2}),y()):i.message.error({content:`${p.msg}`,key:n,duration:2})})}})}function y(s){m.loading||(m.loading=!0,s&&(c.pageNum=s),Pe($(c)).then(n=>{n.code===I&&Array.isArray(n.data)&&(m.selectedRowKeys.length>0&&(m.selectedRowKeys=[]),v.total=n.total,m.data=n.data,v.total<=(c.pageNum-1)*v.pageSize&&c.pageNum!==1&&(m.loading=!1,y(c.pageNum-1))),m.loading=!1}))}let o=T({visibleByView:!1,visibleByEdit:!1,title:"",neType:[],neTypPerformance:[],selectedPre:[],from:{id:void 0,neType:"UDM",kpiId:"",title:"",expression:"",status:"Active",unit:"",description:""},confirmLoading:!1});const G=T({symbolJson:[{label:"(",value:"("},{label:")",value:")"},{label:"+",value:"+"},{label:"-",value:"-"},{label:"*",value:"*"},{label:"/",value:"/"}]}),_=i.Form.useForm(o.from,T({neType:[{required:!0,message:l("views.ne.common.neTypePlease")}],expression:[{required:!0,message:l("views.perfManage.customTarget.expression")+l("common.unableNull")}],kpiId:[{required:!0,message:l("views.perfManage.customTarget.kpiId")+l("common.unableNull")}],title:[{required:!0,message:l("views.perfManage.customTarget.title")+l("common.unableNull")}],unit:[{required:!0,message:l("views.perfManage.customTarget.unit")+l("common.unableNull")}]}));function z(s){o.from.expression="",o.neTypPerformance=[{value:"granularity",label:l("views.perfManage.customTarget.granularity")}];var n=V.value.split("_")[0];n==="zh"&&(n="cn"),Be(s).then(p=>{if(p.code===I&&Array.isArray(p.data))for(const u of p.data){const d=u[`${n}Title`],O=u.kpiId;o.neTypPerformance.push({value:O,label:d})}else i.message.warning({content:l("common.getInfoFail"),duration:2})})}function D(s,n){n?(z(s.neType),o.from=Object.assign(o.from,s),o.title=l("views.perfManage.customTarget.editCustom"),o.visibleByEdit=!0):(_.resetFields(),o.title=l("views.perfManage.customTarget.addCustom"),o.visibleByEdit=!0,z(o.from.neType))}function X(){_.validate().then(s=>{const n=$(o.from);o.confirmLoading=!0;const p=n.id?Ne(n):Fe(n),u=i.message.loading(l("common.loading"),0);p.then(d=>{d.code===I?(i.message.success({content:l("common.msgSuccess",{msg:o.title}),duration:3}),_.resetFields(),U()):i.message.error({content:`${d.msg}`,duration:3})}).finally(()=>{u(),o.confirmLoading=!1,y()})}).catch(s=>{i.message.error(l("common.errorFields",{num:s.errorFields.length}),3)})}function U(){o.visibleByEdit=!1,o.confirmLoading=!1,_.resetFields(),o.neType=[],o.neTypPerformance=[]}function Y(s,n){o.from.expression+=`'${s}'`}function Z(s){o.from.expression+=s}let C=ge([]);return _e(()=>{Promise.allSettled([K("sys_normal_disable"),A().fnNelist()]).then(s=>{if(s[0].status==="fulfilled"&&(j.sysNormalDisable=s[0].value),s[1].status==="fulfilled"&&Array.isArray(s[1].value.data)&&s[1].value.data.length>0&&(C.value=A().getNeCascaderOptions.filter(n=>!["OMC","NSSF","NEF","NRF","LMF","N3IWF"].includes(n.value)),C.value.length===0)){i.message.warning({content:l("common.noData"),duration:2});return}}).finally(()=>{y()})}),(s,n)=>{const p=i.AutoComplete,u=i.FormItem,d=i.Col,O=we,b=i.Button,ee=ke,P=i.Space,k=i.Row,E=i.Form,L=i.Card,te=he,ae=i.Switch,h=i.Tooltip,le=xe,ne=Ce,N=i.MenuItem,oe=i.Menu,se=i.Dropdown,ie=Me,re=Se,ue=Ie,me=i.Table,M=i.Select,F=i.Input,de=i.Textarea,ce=ve("ProModal");return R(),B(e(Te),null,{default:a(()=>[ye(t(L,{bordered:!1,"body-style":{marginBottom:"24px",paddingBottom:0}},{default:a(()=>[t(E,{model:e(c),name:"queryParams",layout:"horizontal"},{default:a(()=>[t(k,{gutter:16},{default:a(()=>[t(d,{lg:6,md:12,xs:24},{default:a(()=>[t(u,{label:e(l)("views.ne.common.neType"),name:"neType "},{default:a(()=>[t(p,{value:e(c).neType,"onUpdate:value":n[0]||(n[0]=r=>e(c).neType=r),options:e(C),"allow-clear":"",placeholder:e(l)("views.ne.common.neTypePlease")},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1}),t(d,{lg:6,md:12,xs:24},{default:a(()=>[t(u,null,{default:a(()=>[t(P,{size:8},{default:a(()=>[t(b,{type:"primary",onClick:n[1]||(n[1]=w(r=>y(1),["prevent"]))},{icon:a(()=>[t(O)]),default:a(()=>[f(" "+g(e(l)("common.search")),1)]),_:1}),t(b,{type:"default",onClick:w(J,["prevent"])},{icon:a(()=>[t(ee)]),default:a(()=>[f(" "+g(e(l)("common.reset")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},512),[[be,e(m).seached]]),t(L,{bordered:!1,"body-style":{padding:"0px"}},{title:a(()=>[t(b,{type:"primary",onClick:n[2]||(n[2]=w(r=>D(),["prevent"]))},{icon:a(()=>[t(te)]),default:a(()=>[f(" "+g(e(l)("common.addText")),1)]),_:1})]),extra:a(()=>[t(P,{size:8,align:"center"},{default:a(()=>[t(h,{placement:"topRight"},{title:a(()=>[f(g(e(l)("common.searchBarText")),1)]),default:a(()=>[t(ae,{checked:e(m).seached,"onUpdate:checked":n[3]||(n[3]=r=>e(m).seached=r),"checked-children":e(l)("common.switch.show"),"un-checked-children":e(l)("common.switch.hide"),size:"small"},null,8,["checked","checked-children","un-checked-children"])]),_:1}),t(h,{placement:"topRight"},{title:a(()=>[f(g(e(l)("common.reloadText")),1)]),default:a(()=>[t(b,{type:"text",onClick:n[4]||(n[4]=w(r=>y(),["prevent"]))},{icon:a(()=>[t(le)]),_:1})]),_:1}),t(h,{placement:"topRight"},{title:a(()=>[f(g(e(l)("common.sizeText")),1)]),default:a(()=>[t(se,{trigger:"click",placement:"bottomRight"},{overlay:a(()=>[t(oe,{"selected-keys":[e(m).size],onClick:Q},{default:a(()=>[t(N,{key:"default"},{default:a(()=>[f(g(e(l)("common.size.default")),1)]),_:1}),t(N,{key:"middle"},{default:a(()=>[f(g(e(l)("common.size.middle")),1)]),_:1}),t(N,{key:"small"},{default:a(()=>[f(g(e(l)("common.size.small")),1)]),_:1})]),_:1},8,["selected-keys"])]),default:a(()=>[t(b,{type:"text"},{icon:a(()=>[t(ne)]),_:1})]),_:1})]),_:1})]),_:1})]),default:a(()=>[t(me,{class:"table","row-key":"id",columns:e(H),loading:e(m).loading,"data-source":e(m).data,size:e(m).size,pagination:e(v),scroll:{x:!0}},{bodyCell:a(({column:r,record:S})=>[r.key==="id"?(R(),B(P,{key:0,size:8,align:"center"},{default:a(()=>[t(h,null,{title:a(()=>[f(g(e(l)("common.editText")),1)]),default:a(()=>[t(b,{type:"link",onClick:w(pe=>D(S,S.id),["prevent"])},{icon:a(()=>[t(ie)]),_:2},1032,["onClick"])]),_:2},1024),t(h,null,{title:a(()=>[f(g(e(l)("common.deleteText")),1)]),default:a(()=>[t(b,{type:"link",onClick:w(pe=>W(S),["prevent"])},{icon:a(()=>[t(re)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)):q("",!0),r.key==="status"?(R(),B(ue,{key:1,options:[{label:e(l)("views.perfManage.customTarget.active"),value:"Active",tagType:"success"},{label:e(l)("views.perfManage.customTarget.inactive"),value:"Inactive",tagType:"error"}],value:S.status},null,8,["options","value"])):q("",!0)]),_:1},8,["columns","loading","data-source","size","pagination"])]),_:1}),t(ce,{drag:!0,width:800,destroyOnClose:!0,keyboard:!1,"mask-closable":!1,visible:e(o).visibleByEdit,title:e(o).title,"confirm-loading":e(o).confirmLoading,onOk:X,onCancel:U},{default:a(()=>[t(E,{name:"modalStateFrom",layout:"horizontal","label-col":{span:6},"label-wrap":!0},{default:a(()=>[t(k,{gutter:16},{default:a(()=>[t(d,{lg:12,md:12,xs:24},{default:a(()=>[t(u,x({label:e(l)("views.ne.common.neType"),name:"neType"},e(_).validateInfos.neType),{default:a(()=>[t(M,{value:e(o).from.neType,"onUpdate:value":n[5]||(n[5]=r=>e(o).from.neType=r),options:e(C),onChange:z,"allow-clear":!1,placeholder:e(l)("views.ne.common.neTypePlease")},null,8,["value","options","placeholder"])]),_:1},16,["label"])]),_:1})]),_:1}),t(k,{gutter:16},{default:a(()=>[t(d,{lg:12,md:12,xs:24},{default:a(()=>[t(u,x({label:e(l)("views.perfManage.customTarget.title"),name:"title"},e(_).validateInfos.title),{default:a(()=>[t(F,{value:e(o).from.title,"onUpdate:value":n[6]||(n[6]=r=>e(o).from.title=r),maxlength:255,"allow-clear":""},null,8,["value"])]),_:1},16,["label"])]),_:1}),t(d,{lg:12,md:12,xs:24},{default:a(()=>[t(u,x({label:e(l)("views.perfManage.customTarget.kpiId"),name:"kpiId"},e(_).validateInfos.kpiId),{default:a(()=>[t(F,{value:e(o).from.kpiId,"onUpdate:value":n[7]||(n[7]=r=>e(o).from.kpiId=r),maxlength:16,"allow-clear":""},null,8,["value"])]),_:1},16,["label"])]),_:1})]),_:1}),t(u,x({label:e(l)("views.perfManage.customTarget.expression"),name:"expression","label-col":{span:3}},e(_).validateInfos.expression),{default:a(()=>[t(F,{value:e(o).from.expression,"onUpdate:value":n[8]||(n[8]=r=>e(o).from.expression=r),maxlength:1024,"allow-clear":""},null,8,["value"])]),_:1},16,["label"]),t(k,{gutter:16},{default:a(()=>[t(d,{lg:12,md:12,xs:24},{default:a(()=>[t(u,{name:"perSelect",label:e(l)("views.perfManage.customTarget.symbol")},{default:a(()=>[t(M,{placeholder:"Please select",options:G.symbolJson,onSelect:Z},null,8,["options"])]),_:1},8,["label"])]),_:1}),t(d,{lg:12,md:12,xs:24},{default:a(()=>[t(u,{name:"perSelect",label:e(l)("views.perfManage.customTarget.element")},{default:a(()=>[t(M,{placeholder:"Please select",options:e(o).neTypPerformance,onSelect:Y},null,8,["options"])]),_:1},8,["label"])]),_:1})]),_:1}),t(k,{gutter:16},{default:a(()=>[t(d,{lg:12,md:12,xs:24},{default:a(()=>[t(u,x({label:e(l)("views.perfManage.customTarget.unit"),name:"expression"},e(_).validateInfos.unit),{default:a(()=>[t(p,{value:e(o).from.unit,"onUpdate:value":n[9]||(n[9]=r=>e(o).from.unit=r),options:[{label:"Mbps",value:"Mbps"},{label:"%",value:"%"}]},null,8,["value"])]),_:1},16,["label"])]),_:1}),t(d,{lg:12,md:12,xs:24},{default:a(()=>[t(u,{label:e(l)("views.perfManage.customTarget.status"),name:"status"},{default:a(()=>[t(M,{value:e(o).from.status,"onUpdate:value":n[10]||(n[10]=r=>e(o).from.status=r),"default-value":"0",options:[{label:e(l)("views.perfManage.customTarget.active"),value:"Active"},{label:e(l)("views.perfManage.customTarget.inactive"),value:"Inactive"}],placeholder:e(l)("common.selectPlease")},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1})]),_:1}),t(u,{label:e(l)("views.perfManage.customTarget.description"),name:"description","label-col":{span:3}},{default:a(()=>[t(de,{value:e(o).from.description,"onUpdate:value":n[11]||(n[11]=r=>e(o).from.description=r),"auto-size":{minRows:2,maxRows:6},maxlength:250,"show-count":!0},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1},8,["visible","title","confirm-loading"])]),_:1})}}}),We=Oe(Ue,[["__scopeId","data-v-b9bf236f"]]);export{We as default};