EMS2.0-Documents/7.部署文档/Window安装/项目前端文件/IEMS/js/chunk-51df3908.fb32c469.js

2 lines
8.4 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-51df3908"],{"1bf3":function(a,t,e){"use strict";e("9f84")},"1cdd":function(a,t,e){},"53b6":function(a,t,e){"use strict";e("1cdd")},"7c25":function(a,t,e){"use strict";e.r(t);var r=function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("div",{staticClass:"app-container"},[e("div",{staticClass:"decorate"}),e("el-tabs",{staticClass:"tabBox",attrs:{"tab-position":"left"},on:{"tab-click":a.handleClick},model:{value:a.typeCode,callback:function(t){a.typeCode=t},expression:"typeCode"}},a._l(a.tabList,(function(t){return e("el-tab-pane",{key:t.typeId,attrs:{label:t.typeName,name:t.typeCode+""}},[e("span",{staticClass:"cover",attrs:{slot:"label"},on:{click:function(e){return a.getTabList(t.typeCode)}},slot:"label"},[e("i",{staticClass:"iconfont",class:"icon-"+a.getIcon(t.typeCode)}),e("span",[a._v(" "+a._s(t.typeName))])])])})),1),e("div",{staticClass:"contentBox"},[e("div",{staticClass:"menu-top-btn"},[a._v(a._s(a.$t("threshold.parameterName")))]),e("div",{staticClass:"menuBox"},[e("div",{staticClass:"bar"},[a.menuList?e("el-menu",{staticClass:"menu",attrs:{"default-active":a.dictionaryId,"collapse-transition":!1}},a._l(a.menuList,(function(t){return e("el-menu-item",{key:t.dictionaryId,attrs:{index:t.dictionaryId+""},on:{click:function(e){return a.handleSelect(t)}}},[e("span",{attrs:{slot:"title"},slot:"title"},[a._v(a._s(t.signName))])])})),1):a._e()],1)]),e("div",{staticClass:"content"},[e("div",{staticClass:"breadcrumb"},[e("el-breadcrumb",{attrs:{separator:"/"}},[e("el-breadcrumb-item",[a._v(a._s(a.typeName))]),e("el-breadcrumb-item",[a._v(a._s(a.signName))]),e("el-breadcrumb-item",[a._v(a._s(a.$t("threshold.setting")))])],1)],1),e("div",{staticClass:"dataBox"},[e("el-form",{ref:"form",attrs:{model:a.form,rules:a.rules,"label-width":"130px"}},[e("el-form-item",{attrs:{label:a.$t("threshold.paramType")}},[e("el-radio-group",{model:{value:a.form.paramType,callback:function(t){a.$set(a.form,"paramType",t)},expression:"form.paramType"}},[e("el-radio",{attrs:{label:1}},[a._v(a._s(a.$t("threshold.paramType1")))]),e("el-radio",{attrs:{label:2}},[a._v(a._s(a.$t("threshold.paramType2")))])],1)],1),1==a.form.paramType?e("el-form-item",{attrs:{label:a.$t("threshold.maxVal"),prop:"maxVal"}},[e("el-input-number",{attrs:{placeholder:a.$t("pEnter"),"controls-position":"right"},model:{value:a.form.maxVal,callback:function(t){a.$set(a.form,"maxVal",t)},expression:"form.maxVal"}})],1):a._e(),1==a.form.paramType?e("el-form-item",{attrs:{label:a.$t("threshold.minVal"),prop:"minVal"}},[e("el-input-number",{attrs:{placeholder:a.$t("pEnter"),"controls-position":"right"},model:{value:a.form.minVal,callback:function(t){a.$set(a.form,"minVal",t)},expression:"form.minVal"}})],1):a._e(),1!=a.form.paramType?e("el-form-item",{attrs:{label:a.$t("threshold.alarm")}},[e("el-radio-group",{model:{value:a.onOff,callback:function(t){a.onOff=t},expression:"onOff"}},[e("el-radio",{attrs:{label:1}},[a._v(a._s(a.$t("type.open")))]),e("el-radio",{attrs:{label:0}},[a._v(a._s(a.$t("type.close")))])],1)],1):a._e(),e("el-form-item",{attrs:{label:a.$t("threshold.timeGap")}},[e("el-input-number",{attrs:{placeholder:a.$t("pEnter"),"controls-position":"right"},model:{value:a.form.timeGap,callback:function(t){a.$set(a.form,"timeGap",t)},expression:"form.timeGap"}})],1),e("el-form-item",{attrs:{label:a.$t("threshold.alarmLevel")}},[e("el-radio-group",{model:{value:a.form.alarmLevel,callback:function(t){a.$set(a.form,"alarmLevel",t)},expression:"form.alarmLevel"}},[e("el-radio",{attrs:{label:1}},[a._v(a._s(a.$t("threshold.one")))]),e("el-radio",{attrs:{label:2}},[a._v(a._s(a.$t("threshold.two")))]),e("el-radio",{attrs:{label:3}},[a._v(a._s(a.$t("threshold.three")))])],1)],1),e("el-form-item",{attrs:{label:a.$t("threshold.alarmInfo"),prop:"alarmInfo"}},[e("el-input",{attrs:{placeholder:a.$t("pEnter"),type:"textarea"},model:{value:a.form.alarmInfo,callback:function(t){a.$set(a.form,"alarmInfo",t)},expression:"form.alarmInfo"}})],1),e("el-form-item",{staticStyle:{"margin-left":"394px"}},[e("span",{staticClass:"btn-item long",on:{click:a.updateData}},[a._v(a._s(a.$t("btn.save")))])])],1)],1)])])],1)},n=[],l=(e("d3b7"),e("25f0"),e("d81d"),e("e9c4"),e("b775"));function i(a){return Object(l["a"])({url:"alarm-service/threshold/getThresholdByDictionary",method:"get",params:a})}function o(a){return Object(l["a"])({headers:{"Content-Type":"application/json"},url:"alarm-service/threshold/updateThreshold",method:"put",data:a})}function s(a){return Object(l["a"])({url:"device-service/dictionary/getDictionaryByCode",method:"get",params:a})}function m(a){return Object(l["a"])({url:"device-service/dictionary/getDictionaryType",method:"get",params:a})}var d={data:function(){var a=this,t=function(t,e,r){e?a.form.maxVal<a.form.minVal?r(a.$t("validate.limitValueFormat")):r():r(a.$t("validate.limitValue"))};return{typeCode:null,typeName:null,dictionaryId:null,signName:null,tabList:[],menuList:[],onOff:1,paramData:{signId:null,typeCode:null,paramName:null},form:{paramType:1,maxVal:null,minVal:null,timeGap:null,alarmLevel:3,alarmInfo:null},rules:{maxVal:[{required:!0,message:this.$t("pEnter")+this.$t("threshold.maxVal"),trigger:"blur"}],minVal:[{required:!0,trigger:"blur",validator:t}],alarmInfo:[{required:!0,message:this.$t("pEnter")+this.$t("threshold.alarmInfo"),trigger:"blur"}]}}},created:function(){this.getMenuList()},methods:{getIcon:function(a){switch(a){case"TEMP":return"wenshidu";case"SOURCE":return"dianyuan";case"CABINET":return"danguiti";case"GF":return"guangfu";case"AIR":return"kongtiao";case"WATER":return"shuijin";case"BATTERY":return"dianchi";case"UPS":return"UPS";case"PD":return"peidian";case"FAN":return"fengjifengshan";case"SMOKE":return"yangan";case"DOOR":return"menjin";case"video":return"shipin";case"fire":return"xiaofang";case"fanglei":return"fanglei";default:return"wenshidu"}},getList:function(a){var t=this;i(a).then((function(a){null===a.data?(t.onOff=1,t.form={paramType:1,maxVal:null,minVal:null,timeGap:null,alarmLevel:3,alarmInfo:null}):(t.form.threshold=a.data.threshold,2==a.data.paramType&&(t.onOff=1==a.data.maxVal&&1==a.data.minVal?1:0),t.form.tdId=a.data.tdId,t.form.paramType=a.data.paramType,t.form.maxVal=a.data.maxVal,t.form.minVal=a.data.minVal,t.form.timeGap=a.data.timeGap,t.form.alarmLevel=a.data.alarmLevel,t.form.alarmInfo=a.data.alarmInfo)}))},getMenuList:function(){var a=this;m().then((function(t){a.tabList=t.data,a.typeName=t.data[0].typeName,a.getTabList(t.data[0].typeCode),a.typeCode=t.data[0].typeCode.toString()}))},getTabList:function(a){var t=this;this.typeCode!==a&&(this.menuList=[],s({typeCode:a}).then((function(a){console.log(a),t.menuList=a.data.map((function(a){return"en"==t.$i18n.locale&&(a.signName=a.enSignName),a})),t.dictionaryId=a.data[0].dictionaryId.toString(),t.signName=a.data[0].signName.toString(),t.paramData={signId:a.data[0].signId,typeCode:a.data[0].typeCode,paramName:a.data[0].signName},t.getList(t.paramData)})))},handleClick:function(a){this.typeName=a.label,console.log(a)},handleSelect:function(a){console.log(a),this.dictionaryId=a.dictionaryId.toString(),this.signName=a.signName,this.paramData={signId:a.signId,typeCode:a.typeCode,paramName:a.signName},this.getList(this.paramData)},updateData:function(){var a=this;this.$refs.form.validate((function(t){if(t){var e=JSON.parse(JSON.stringify(a.form));2==a.form.paramType&&(1==a.onOff?(e.maxVal=1,e.minVal=1):(e.maxVal=0,e.minVal=0)),e.signId=a.paramData.signId,e.typeCode=a.paramData.typeCode,e.paramName=a.paramData.paramName,o(e).then((function(t){200==t.status&&a.$notify({title:a.$t("title.success"),message:a.$t("title.updateSuccess"),type:"success",duration:3e3})}))}}))}}},c=d,u=(e("1bf3"),e("53b6"),e("2877")),p=Object(u["a"])(c,r,n,!1,null,"f86f1f4a",null);t["default"]=p.exports},"9f84":function(a,t,e){},e9c4:function(a,t,e){var r=e("23e7"),n=e("da84"),l=e("d066"),i=e("2ba4"),o=e("e330"),s=e("d039"),m=n.Array,d=l("JSON","stringify"),c=o(/./.exec),u=o("".charAt),p=o("".charCodeAt),f=o("".replace),h=o(1..toString),g=/[\uD800-\uDFFF]/g,y=/^[\uD800-\uDBFF]$/,b=/^[\uDC00-\uDFFF]$/,v=function(a,t,e){var r=u(e,t-1),n=u(e,t+1);return c(y,a)&&!c(b,n)||c(b,a)&&!c(y,r)?"\\u"+h(p(a,0),16):a},C=s((function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")}));d&&r({target:"JSON",stat:!0,forced:C},{stringify:function(a,t,e){for(var r=0,n=arguments.length,l=m(n);r<n;r++)l[r]=arguments[r];var o=i(d,null,l);return"string"==typeof o?f(o,g,v):o}})}}]);
//# sourceMappingURL=chunk-51df3908.fb32c469.js.map