Newer
Older
smartwell_front_dz / smartwell / static / js / 9096.927c3568.js
wangxitong on 11 Sep 2023 13 KB first commit
"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[9096],{78067:(e,t,a)=>{a.r(t),a.d(t,{default:()=>V});var l=function(){var e=this,t=e._self._c;return t("div",{staticClass:"container"},[t("list-rule",{ref:"listrule"})],1)},i=[],o=(a(68309),a(74916),a(64765),a(73210),function(){var e=this,t=e._self._c;return t("app-container",[t("search-area",{attrs:{size:"small"},on:{search:e.search}},[t("search-item",[t("el-input",{attrs:{size:"small",placeholder:"点位编号/设备编号",clearable:""},model:{value:e.listQuery.keywords,callback:function(t){e.$set(e.listQuery,"keywords","string"===typeof t?t.trim():t)},expression:"listQuery.keywords"}})],1),e.showDeviceType?t("search-item",[t("el-select",{attrs:{size:"small",placeholder:"设备类型",clearable:""},model:{value:e.listQuery.deviceType,callback:function(t){e.$set(e.listQuery,"deviceType",t)},expression:"listQuery.deviceType"}},e._l(e.deviceTypeList,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1):e._e()],1),t("div",[t("el-row",{staticClass:"table-title"},[t("el-col",{attrs:{span:6}},[t("div",{staticClass:"title-header"},[t("i",{staticClass:"el-icon-menu"}),e._v("数据列表 ")])]),t("el-col",{staticClass:"edit_btns",attrs:{span:12,offset:6}},[e.hasPerm("/alarmRule/add")?t("el-button",{staticClass:"edit_btn",attrs:{size:"small"},on:{click:e.add}},[e._v(" 新增 ")]):e._e()],1)],1),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticClass:"table",attrs:{data:e.list,border:"",size:"small"},on:{"selection-change":e.handleSelectionChange}},[t("el-table-column",{attrs:{index:e.indexMethod,align:"center",type:"index"}}),e._l(e.columns,(function(a){return t("el-table-column",{key:a.value,attrs:{label:a.text,width:a.width,align:a.align,"show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(l){return["Button"!=a.type?t("span",{class:a["class"]},[e._v(e._s(l.row[a.value]))]):e._e(),"Button"==a.type?t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.showWellDetail(l.row)}}},[e._v(" "+e._s(l.row.wellCode)+" ")]):e._e()]}}],null,!0)})})),t("el-table-column",{attrs:{label:"操作",align:"center",width:"90"},scopedSlots:e._u([{key:"default",fn:function(a){return[e.hasPerm("/alarmRule/update")?t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.edit(a.row)}}},[e._v(" 编辑 ")]):e._e(),e.hasPerm("/alarmRule/delete")?t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.del(a.row)}}},[e._v(" 删除 ")]):e._e()]}}])})],2)],1),t("div",{staticClass:"pagination-container"},[t("el-pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>e.listQuery.limit,expression:"total>listQuery.limit"}],attrs:{"current-page":e.listQuery.offset,"page-sizes":[20,30,50],"page-size":e.listQuery.limit,total:e.total,align:"center",layout:"total, sizes, prev, pager, next"},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),t("edit-rule",{directives:[{name:"show",rawName:"v-show",value:e.editShow,expression:"editShow"}],ref:"editrule",on:{watchChild:e.fetchData}}),t("info-well",{directives:[{name:"show",rawName:"v-show",value:e.wellShow,expression:"wellShow"}],ref:"wellInfo",attrs:{mapid:"rule-map"}})],1)}),r=[],n=a(66347),s=(a(91058),a(82772),a(87756)),u=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible,"append-to-body":""},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[t("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.alarmRuleForm,"label-position":"right","label-width":"120px"}},["update"==e.dialogStatus?t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"点位编号"}},[t("el-input",{attrs:{type:"text",placeholder:"未知",disabled:""},model:{value:e.baseInfo.wellCode,callback:function(t){e.$set(e.baseInfo,"wellCode",t)},expression:"baseInfo.wellCode"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"井深"}},[t("el-input",{attrs:{type:"text",placeholder:"未知",disabled:""},model:{value:e.baseInfo.deep,callback:function(t){e.$set(e.baseInfo,"deep",t)},expression:"baseInfo.deep"}})],1)],1)],1):e._e(),"create"==e.dialogStatus?t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"设备编号",prop:"devcode"}},[t("el-select",{attrs:{loading:e.loading,disabled:"update"==e.dialogStatus,filterable:"",placeholder:"请输入设备编号"},model:{value:e.alarmRuleForm.devcode,callback:function(t){e.$set(e.alarmRuleForm,"devcode",t)},expression:"alarmRuleForm.devcode"}},e._l(e.devices,(function(e){return t("el-option",{key:e.id,attrs:{label:e.devcode,value:e.devcode}})})),1)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"设备类型"}},[t("el-input",{attrs:{type:"text",placeholder:"未知",disabled:""},model:{value:e.baseInfo.deviceTypeName,callback:function(t){e.$set(e.baseInfo,"deviceTypeName",t)},expression:"baseInfo.deviceTypeName"}})],1)],1)],1):t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"设备编号"}},[t("el-input",{attrs:{type:"text",placeholder:"未知",disabled:""},model:{value:e.baseInfo.devcode,callback:function(t){e.$set(e.baseInfo,"devcode",t)},expression:"baseInfo.devcode"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"设备类型"}},[t("el-input",{attrs:{type:"text",placeholder:"未知",disabled:""},model:{value:e.baseInfo.deviceTypeName,callback:function(t){e.$set(e.baseInfo,"deviceTypeName",t)},expression:"baseInfo.deviceTypeName"}})],1)],1)],1),t("el-row",{attrs:{gutter:20}},[e.showHighValue?t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"告警上限",prop:"highValue"}},[t("el-input",{attrs:{type:"text",placeholder:"必填"},model:{value:e.alarmRuleForm.highValue,callback:function(t){e.$set(e.alarmRuleForm,"highValue","string"===typeof t?t.trim():t)},expression:"alarmRuleForm.highValue"}})],1)],1):e._e(),t("el-col",{attrs:{span:12}},[e.showLowValue?t("el-form-item",{attrs:{label:"告警下限",prop:"lowValue"}},[t("el-input",{attrs:{type:"text",placeholder:"非必填"},model:{value:e.alarmRuleForm.lowValue,callback:function(t){e.$set(e.alarmRuleForm,"lowValue","string"===typeof t?t.trim():t)},expression:"alarmRuleForm.lowValue"}})],1):e._e()],1)],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.saveData}},[e._v(" 保存 ")]),t("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v(" 取消 ")])],1)],1)},d=[],c=(a(77601),a(21703),a(96647),a(65074));const m={name:"EditRule",data:function(){var e=function(e,t,a){""!==t?!1===/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(t)?a(new Error("请填写大于0的数字")):a():a(new Error("告警上限不能为空"))},t=function(e,t,a){""!==t&&(!1===/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(t)?a(new Error("请填写大于0的数字")):a())};return{dialogFormVisible:!1,dialogStatus:"",baseInfo:{wellCode:"",wellName:"",deep:"",deviceType:"",deviceTypeName:"",devcode:""},alarmRuleForm:{id:"",devcode:"",deviceType:"",highValue:"",lowValue:"0"},textMap:{update:"编辑",create:"新增"},devices:[],loading:!0,rules:{devcode:[{required:!0,message:"请选择设备",trigger:["blur","change"]}],highValue:[{required:!0,trigger:["blur","change"],validator:e}],lowValue:[{required:!0,trigger:["blur","change"],validator:t}]}}},computed:{showHighValue:function(){return!0},showLowValue:function(){return!1},unit:function(){return"2"===this.alarmRuleForm.deviceType?"m":"6"===this.alarmRuleForm.deviceType?"mg":""}},watch:{"alarmRuleForm.devcode":function(e,t){var a,l=(0,n.Z)(this.devices);try{for(l.s();!(a=l.n()).done;){var i=a.value;if(i.devcode===e)return this.baseInfo.deviceTypeName=i.deviceTypeName,this.baseInfo.deviceType=i.deviceType,void(this.alarmRuleForm.deviceType=i.deviceType)}}catch(o){l.e(o)}finally{l.f()}},"baseInfo.devcode":function(e,t){this.alarmRuleForm.devcode=e}},methods:{initDialog:function(e,t){var a=this,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.dialogStatus=e,this.dialogFormVisible=t,"update"===e?(this.alarmRuleForm={id:l.id,highValue:l.highValue,lowValue:l.lowValue},this.baseInfo={wellCode:l.wellCode,wellName:l.wellName,deep:l.deep,deviceType:l.deviceType,deviceTypeName:l.deviceTypeName,devcode:l.devcode}):(this.resetForm(),this.fetchDevice()),this.$nextTick((function(){a.$refs["dataForm"].clearValidate()}))},fetchDevice:function(){var e=this;this.loading=!0,(0,c.qO)().then((function(t){200===t.code&&(e.loading=!1,e.devices=t.data)}))},resetForm:function(){this.baseInfo={wellCode:"",wellName:"",deep:"",deviceType:"",deviceTypeName:"",devcode:""},this.alarmRuleForm={id:"",devcode:"",deviceType:"",highValue:"",lowValue:"0"}},saveData:function(){"create"===this.dialogStatus?this.addData():this.updateData()},addData:function(){var e=this;this.$refs["dataForm"].validate((function(t){if(t){var a={devcode:e.alarmRuleForm.devcode,deviceType:e.alarmRuleForm.deviceType,highValue:e.alarmRuleForm.highValue,lowValue:e.alarmRuleForm.lowValue};(0,c.nv)(a).then((function(t){200===t.code&&(e.$message.success("新增成功"),e.$emit("watchChild"),e.dialogFormVisible=!1)}))}}))},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&(0,c.Ps)(e.alarmRuleForm).then((function(t){200===t.code&&(e.$message.success("修改成功"),e.$emit("watchChild"),e.dialogFormVisible=!1)}))}))}}},h=m;var p=a(1001),f=(0,p.Z)(h,u,d,!1,null,"59638bfc",null);const v=f.exports;var g=a(64171);const y={name:"ListRule",components:{editRule:v,infoWell:s.Z},data:function(){return{listQuery:{keywords:"",status:"",offset:1,limit:20,sort:"",order:""},columns:[{text:"点位编号",value:"wellCode",align:"center",type:"Button"},{text:"点位名称",value:"wellName",align:"center"},{text:"井深",value:"deep",align:"center"},{text:"设备类型",value:"deviceTypeName",align:"center"},{text:"设备编号",value:"devcode",align:"center"},{text:"告警上限",value:"highValue",align:"center"},{text:"操作人",value:"user",width:100,align:"center"}],multipleSelection:[],list:[],total:0,deviceTypeList:[],showDeviceType:!0,listLoading:!0,editShow:!1,wellShow:!1}},created:function(){this.fetchDeviceType(),this.fetchData()},methods:{showWellDetail:function(e){this.wellShow=!0,this.$refs.wellInfo.initDialog(e.wellId)},checkSelection:function(){return 0!==this.multipleSelection.length},add:function(){this.editShow=!0,this.$refs.editrule.initDialog("create",!0)},edit:function(e){this.editShow=!0,this.$refs.editrule.initDialog("update",!0,e)},del:function(e){var t=this;this.$confirm("确定要删除该告警规则吗?","确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){(0,c.N)(e.id).then((function(e){200===e.code&&(t.$message.success("删除成功"),t.fetchData())}))}))},search:function(){this.fetchData(!1)},fetchData:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.listLoading=!0,t||(this.listQuery.offset=1),(0,c.f$)(this.listQuery).then((function(t){e.list=t.data.rows,e.total=parseInt(t.data.total),e.listLoading=!1}))},fetchDeviceType:function(){var e=this;(0,g.l7)(this.listQuery).then((function(t){e.deviceTypeList=[];var a,l=e.$store.getters.deviceTypes,i=(0,n.Z)(t.data);try{for(i.s();!(a=i.n()).done;){var o=a.value;-1===l.indexOf(o.value)||"2"!==o.value&&"6"!==o.value||e.deviceTypeList.push(o)}}catch(r){i.e(r)}finally{i.f()}e.deviceTypeList.length<=1&&(e.showDeviceType=!1)}))},indexMethod:function(e){return this.listQuery.limit*(this.listQuery.offset-1)+e+1},handleSizeChange:function(e){this.listQuery.limit=e,this.fetchData()},handleCurrentChange:function(e){this.listQuery.offset=e,this.fetchData()},handleSelectionChange:function(e){this.multipleSelection=e}}},w=y;var b=(0,p.Z)(w,o,r,!1,null,"9f5c42b6",null);const x=b.exports,T={name:"AlarmRule",components:{ListRule:x},data:function(){return{activeName:"alarmrule"}},methods:{handleClick:function(e,t){"alarmrule"===e.name&&this.$refs.listrule.fetchData()}}},F=T;var R=(0,p.Z)(F,l,i,!1,null,"f6e888f2",null);const V=R.exports},65074:(e,t,a)=>{a.d(t,{AQ:()=>r,N:()=>u,Ps:()=>o,Zv:()=>n,f$:()=>i,nv:()=>s,qO:()=>d});var l=a(84471);function i(e){return(0,l.Z)({url:"alarmRule/list",method:"get",params:e})}function o(e){return(0,l.Z)({url:"alarmRule/update",method:"post",params:e})}function r(e){return(0,l.Z)({url:"alarm/levelByType",method:"get",params:e})}function n(e){return(0,l.Z)({url:"alarm/configLevel",method:"post",data:e})}function s(e){return(0,l.Z)({url:"alarmRule/add",method:"post",params:e})}function u(e){return(0,l.Z)({url:"alarmRule/delete",method:"post",params:{id:e}})}function d(e,t){return(0,l.Z)({url:"alarmRule/getNoAlarmDevice",method:"get"})}},64171:(e,t,a)=>{a.d(t,{FR:()=>p,FU:()=>c,Ix:()=>r,S6:()=>u,e5:()=>m,fj:()=>s,l7:()=>n,nY:()=>h,xl:()=>d});var l=a(84471),i=a(80129),o=a.n(i);function r(e){return(0,l.Z)({url:"device/list-page",method:"get",params:e})}function n(e){return(0,l.Z)({url:"device/type",method:"get",params:e})}function s(e){return(0,l.Z)({url:"device/model",method:"get",params:{deviceType:e}})}function u(e){return(0,l.Z)({url:"device/add",method:"post",params:e})}function d(e){return(0,l.Z)({url:"device/update",method:"post",params:e})}function c(e){return(0,l.Z)({url:"device/delete",method:"post",params:{ids:e},paramsSerializer:function(e){return o().stringify(e,{indices:!1})}})}function m(e){var t=new FormData;return t.append("file",e),(0,l.Z)({url:"device/batchImport",method:"post",timeout:24e4,headers:{"Content-Type":"multipart/form-data"},data:t})}function h(e){return(0,l.Z)({url:"device/batchExport",method:"get",timeout:12e4,params:e,responseType:"blob"})}function p(e){return(0,l.Z)({url:"/device/offline-list-page",method:"get",params:e})}}}]);