index-fc0356ab.js 4.2 KB

1
  1. import{l as T}from"./index-ac322e5b.js";import{x as E,A as F}from"./index-3212ed16.js";import{u as I}from"./base-9bd0269e.js";/* empty css */import{a as d,U as b,V as c,W as _,j as u,X as s,G as k,u as t,a4 as w,a7 as x,p as h,c as A,o as B,a3 as D,a1 as S,F as N,$ as V}from"./vue-b109b72f.js";import"./vue-router-e4a270fb.js";import"./index.vue_vue_type_style_index_0_scoped_3d60c88d_lang-83f98d48.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./fullScreen-c89f3f41.js";const L={__name:"History",props:["tableData"],setup(C){const p=d(!1);d(),d({content:{},id:20230721113801});let r=[{title:"时间",dataIndex:"eventtime"},{title:"告警级别",dataIndex:"level"},{title:"告警内容",dataIndex:"paramvalues"}];const o=()=>{p.value=!0},v=()=>{p.value=!1};return(f,y)=>{const g=b("a-button"),n=b("a-table"),a=b("a-drawer");return c(),_("div",null,[u(g,{type:"link",onClick:o},{default:s(()=>[k("告警日志")]),_:1}),u(a,{visible:p.value,"onUpdate:visible":y[0]||(y[0]=i=>p.value=i),class:"custom-class",title:"告警日志",placement:"right",width:"1000",closable:!1,onClose:v},{default:s(()=>[u(n,{"row-class-name":(i,m)=>m%2===1?"table-striped":null,dataSource:C.tableData,columns:t(r),pagination:!1,bordered:"",scroll:{x:"max-content"}},{bodyCell:s(({column:i,record:m})=>[w("div",null,x(m[i.dataIndex]),1)]),_:1},8,["row-class-name","dataSource","columns"])]),_:1},8,["visible"])])}}},$=w("span",null,"范围:",-1),W={__name:"index",props:{},emits:[],setup(C,{emit:p}){I();let r=d([]),o=d([]),v=d([{label:"搜索",key:"condition",type:"input"},{label:"告警类型",key:"buildtype",type:"select",dataSource:r.value},{label:"告警级别",key:"level",type:"select",dataSource:[{value:0,remarks:"停用"},{value:1,remarks:"启用"}]},{label:"告警时间",key:"dateRange",type:"datepickerRange",objKeys:["begindate","enddate"]}]);h("buildTypeList",r),h("eventlevelList",o);let f=d({id:20230816095802,content:{pageNumber:1,pageSize:20,where:{condition:"",buildtype:"",level:"",begindate:"",enddate:"",isoffical:void 0}}}),y=A(()=>n=>{let a;switch(n){case"紧急":a={background:"#FFE3E6",color:"#EA162D",border:"1px solid #FF8B97"};break;case"重要":a={background:"#FFE4D3",color:"#E55800",border:"1px solid #FFA972"};break;case"一般":a={background:"#E8FFE2",color:"#27AD00",border:"1px solid #87D96F"};break;case"提醒":a={background:"#e6f7ff",color:"#096dd9",border:"1px solid #91d5ff"};break;case"其它":a={background:"#F5F5F5",color:"#777777",border:"1px solid #CCCCCC"};break}return a}),g=async()=>{const n=await F.optionstype("eventbuildtype");r.value=n.data,v.value[1].dataSource=r.value,console.log("触发类型",r.value);const a=await F.optionstype("eventlevel");o.value=a.data,v.value[2].dataSource=o.value,console.log("警告等级",o.value)};return B(async()=>{g()}),(n,a)=>{const i=b("a-select-option"),m=b("a-select");return c(),D(T,{ref:"list",param:t(f),tableName:"warningSetTable",searchType:t(v),detailPage:{}},{operation:s(()=>[w("div",null,[$,u(m,{onChange:a[0]||(a[0]=e=>n.$refs.list.tableData()),allowClear:"",style:{width:"150px"},value:t(f).content.where.isoffical,"onUpdate:value":a[1]||(a[1]=e=>t(f).content.where.isoffical=e),placeholder:"请选择范围"},{default:s(()=>[u(i,{value:1},{default:s(()=>[k("总控设备")]),_:1}),u(i,{value:0},{default:s(()=>[k("业务设备")]),_:1})]),_:1},8,["value"])])]),tb_cell:s(({data:e})=>[e.column.dataIndex==="operation"?(c(),D(L,{key:0,tableData:e.record.lasteventparamvalues},null,8,["tableData"])):e.column.dataIndex==="isused"?(c(),_("span",{key:1,style:S({color:t(E).statusAndColor(e.record.isused?"启用":"停用")})},x(e.record.isused?"启用":"停用"),5)):e.column.dataIndex==="buildtype"?(c(),_(N,{key:2},[k(x(t(r).filter(l=>l.value==e.record.buildtype)[0]?t(r).filter(l=>l.value==e.record.buildtype)[0].remarks:""),1)],64)):e.column.dataIndex==="lasteventlevel"?(c(),_("span",{key:3,style:S([{padding:"2px 5px","border-radius":"3px"},t(y)(t(o).filter(l=>l.value==e.record.lasteventlevel)[0]?t(o).filter(l=>l.value==e.record.lasteventlevel)[0].remarks:"")])},x(t(o).filter(l=>l.value==e.record.lasteventlevel)[0]?t(o).filter(l=>l.value==e.record.lasteventlevel)[0].remarks:""),5)):V("",!0)]),_:1},8,["param","searchType"])}}};export{W as default};