1 |
- webpackJsonp([89],{"IN/q":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={props:["belongTo"],data:function(){return{visible:!1,dataForm:{id:"",belongTo:"",thresholdType:"",thresholdValue:""},dataRule:{belongTo:[{required:!0,message:"参数范围不能为空",trigger:"blur"}],thresholdType:[{required:!0,message:"参数名称不能为空",trigger:"blur"}],thresholdValue:[{required:!0,message:"参数阈值不能为空",trigger:"blur"}]}}},methods:{init:function(e){var t=this;this.visible=!0,this.$nextTick(function(){t.$refs.dataForm.resetFields()}),this.dataForm.id=e||void 0,this.dataForm.id&&this.$http({url:this.$http.adornUrl("/management/thresholdManagement/info/"+this.dataForm.id),method:"get",params:this.$http.adornParams()}).then(function(e){var a=e.data;a&&0===a.code&&(t.dataForm.belongTo=a.thresholdManagement.belongTo,t.dataForm.thresholdType=a.thresholdManagement.thresholdType,t.dataForm.thresholdValue=a.thresholdManagement.thresholdValue)})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){t&&e.$http({url:e.$http.adornUrl("/management/thresholdManagement/"+(e.dataForm.id?"update":"save")),method:"post",data:e.$http.adornData({id:e.dataForm.id||void 0,thresholdType:e.dataForm.thresholdType,thresholdValue:e.dataForm.thresholdValue,farmId:parseInt(e.$cookie.get("formFarmId")),belongTo:e.dataForm.belongTo})}).then(function(t){var a=t.data;a&&0===a.code?(e.visible=!1,e.$emit("refreshDataList"),e.$message({message:"操作成功",type:"success",duration:1500})):e.$message.error(a.msg)})})}}},r={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:e.visible,width:"600px"},on:{"update:visible":function(t){e.visible=t}}},[a("el-form",{ref:"dataForm",staticStyle:{"margin-left":"20px",width:"500px"},attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"80px",size:"mini"},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"所属范围",prop:"belongTo"}},[a("el-select",{staticStyle:{width:"100%"},model:{value:e.dataForm.belongTo,callback:function(t){e.$set(e.dataForm,"belongTo",t)},expression:"dataForm.belongTo"}},e._l(e.belongTo,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"参数名称",prop:"thresholdType"}},[a("el-input",{model:{value:e.dataForm.thresholdType,callback:function(t){e.$set(e.dataForm,"thresholdType",t)},expression:"dataForm.thresholdType"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"参数阈值",prop:"thresholdValue"}},[a("el-input",{model:{value:e.dataForm.thresholdValue,callback:function(t){e.$set(e.dataForm,"thresholdValue",t)},expression:"dataForm.thresholdValue"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"mini"},on:{click:function(t){e.visible=!1}}},[e._v("关闭")]),e._v(" "),a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){e.dataFormSubmit()}}},[e._v("确定")])],1)],1)},staticRenderFns:[]},l=a("VU/8")(o,r,!1,null,null,null);t.default=l.exports}});
|