1 line
9.0 KiB
JavaScript
1 line
9.0 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6a235d39"],{"3b72":function(e,t,a){"use strict";a.d(t,"d",(function(){return r})),a.d(t,"c",(function(){return n})),a.d(t,"a",(function(){return o})),a.d(t,"e",(function(){return i})),a.d(t,"b",(function(){return s}));var l=a("b775");function r(e){return Object(l["a"])({url:"/iot/alertLog/list",method:"get",params:e})}function n(e){return Object(l["a"])({url:"/iot/alertLog/"+e,method:"get"})}function o(e){return Object(l["a"])({url:"/iot/alertLog",method:"post",data:e})}function i(e){return Object(l["a"])({url:"/iot/alertLog",method:"put",data:e})}function s(e){return Object(l["a"])({url:"/iot/alertLog/"+e,method:"delete"})}},e684e:function(e,t,a){"use strict";a("f043")},e8af:function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"iot-alert-log"},[a("el-card",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],staticClass:"search-card"},[a("el-form",{ref:"queryForm",staticClass:"search-form",attrs:{model:e.queryParams,inline:!0},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{prop:"alertName"}},[a("el-input",{attrs:{placeholder:e.$t("alert.log.491272-1"),clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.alertName,callback:function(t){e.$set(e.queryParams,"alertName",t)},expression:"queryParams.alertName"}})],1),a("el-form-item",{attrs:{prop:"alertLevel"}},[a("el-select",{attrs:{placeholder:e.$t("alert.index.236501-3"),clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.alertLevel,callback:function(t){e.$set(e.queryParams,"alertLevel",t)},expression:"queryParams.alertLevel"}},e._l(e.dict.type.iot_alert_level,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{prop:"status"}},[a("el-select",{attrs:{placeholder:e.$t("alert.log.491272-5"),clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.status,callback:function(t){e.$set(e.queryParams,"status",t)},expression:"queryParams.status"}},e._l(e.dict.type.iot_process_status,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("div",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleQuery}},[e._v(e._s(e.$t("search")))]),a("el-button",{attrs:{icon:"el-icon-refresh"},on:{click:e.resetQuery}},[e._v(e._s(e.$t("reset")))])],1)],1)],1),a("el-card",[a("el-row",{staticStyle:{"margin-bottom":"15px"},attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:alert:remove"],expression:"['iot:alert:remove']"}],attrs:{plain:"",icon:"el-icon-delete",size:"small",disabled:e.multiple},on:{click:e.handleDelete}},[e._v(e._s(e.$t("del")))])],1),a("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.alertLogList,border:!1},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{label:e.$t("alert.index.236501-0"),align:"left",prop:"alertName","min-width":"200"}}),a("el-table-column",{attrs:{label:e.$t("alert.log.491272-8"),align:"left",prop:"serialNumber",width:"150"}}),a("el-table-column",{attrs:{label:e.$t("alert.log.491272-9"),align:"left",prop:"deviceName","min-width":"180"}}),a("el-table-column",{attrs:{label:e.$t("alert.index.236501-2"),align:"center",prop:"alertLevel",width:"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.iot_alert_level,value:t.row.alertLevel}})]}}])}),a("el-table-column",{attrs:{label:e.$t("alert.log.491272-10"),align:"center",prop:"createTime",width:"170"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(e.parseTime(t.row.createTime,"{y}-{m}-{d} {h}:{i}:{s}")))])]}}])}),a("el-table-column",{attrs:{label:e.$t("alert.log.491272-24"),align:"left","header-align":"center",prop:"detail",width:"170"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{domProps:{innerHTML:e._s(e.formatDetail(t.row.detail))}})]}}])}),a("el-table-column",{attrs:{label:e.$t("alert.log.491272-4"),align:"center",prop:"status",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.iot_process_status,value:t.row.status}})]}}])}),a("el-table-column",{attrs:{fixed:"right",label:e.$t("opation"),align:"center",width:"90"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:alertLog:edit"],expression:"['iot:alertLog:edit']"}],attrs:{size:"small",type:"text",icon:"el-icon-edit"},on:{click:function(a){return e.handleUpdate(t.row)}}},[e._v(e._s(e.$t("alert.log.491272-25")))])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],staticStyle:{"margin-bottom":"20px"},attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}})],1),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"550px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:e.$t("alert.log.491272-26"),prop:"remark"}},[a("el-input",{staticStyle:{width:"350px"},attrs:{type:"textarea",placeholder:e.$t("notify.log.333543-18"),autosize:{minRows:3,maxRows:5}},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("confirm")))]),a("el-button",{on:{click:e.cancel}},[e._v(e._s(e.$t("cancel")))])],1)],1)],1)},r=[],n=a("5530"),o=(a("d81d"),a("b64b"),a("3b72")),i={name:"AlertLog",dicts:["iot_alert_level","iot_process_status"],data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,alertLogList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,alertName:null,alertLevel:null,status:null,productId:null,productName:null,deviceId:null,deviceName:null},form:{},rules:{remark:[{required:!0,message:this.$t("alert.log.491272-18"),trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,Object(o["d"])(this.queryParams).then((function(t){e.alertLogList=t.rows,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={alertLogId:null,alertName:null,alertLevel:null,status:null,productId:null,productName:null,deviceId:null,deviceName:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.alertLogId})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title=this.$t("alert.log.491272-19")},handleUpdate:function(e){var t=this;this.reset();var a=e.alertLogId||this.ids;Object(o["c"])(a).then((function(e){t.form=e.data,t.open=!0,t.title=t.$t("alert.log.491272-20")}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.alertLogId?Object(o["e"])(e.form).then((function(t){e.$modal.msgSuccess(e.$t("updateSuccess")),e.open=!1,e.getList()})):Object(o["a"])(e.form).then((function(t){e.$modal.msgSuccess(e.$t("addSuccess")),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,a=e.alertLogId||this.ids;this.$modal.confirm(this.$t("alert.log.491272-23",[a])).then((function(){return Object(o["b"])(a)})).then((function(){t.getList(),t.$modal.msgSuccess(t.$t("delSuccess"))})).catch((function(){}))},handleExport:function(){this.download("iot/alertLog/export",Object(n["a"])({},this.queryParams),"alertLog_".concat((new Date).getTime(),".xlsx"))},formatDetail:function(e){if(null!=e&&""!=e){var t=JSON.parse(e),a='id:<span style="color:#F56C6C">'+t.id+"</span><br />";return a=a+'value:<span style="color:#F56C6C">'+t.value+"</span><br />",a=a+'remark:<span style="color:#F56C6C">'+t.remark+"</span>",a}}}},s=i,u=(a("e684e"),a("2877")),c=Object(u["a"])(s,l,r,!1,null,"39232110",null);t["default"]=c.exports},f043:function(e,t,a){}}]); |