(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6a813aee"],{bfa6:function(e,t,o){"use strict";var i=o("0fea");t["a"]={getDriveTypeApi:function(){return Object(i["c"])("/mdc/mdcDriveTypeParamConfig/getDriveParamOptions")},getWorkshopListInHomePageApi:function(){return Object(i["c"])("/mdc/mdcWorkshopInfo/getWorkshopList")},getDeviceListByWorkshopIdApi:function(e){return Object(i["c"])("/mdc/mdcWorkshopInfo/workshopEquipmentList",e)},getWorkshopDetailByWorkshopIdApi:function(e){return Object(i["c"])("/mdc/mdcWorkshopInfo/queryById",{id:e})},getDeviceListInWorkshopSignagePageApi:function(e){return Object(i["c"])("/mdc/mdcWorkshopInfo/getBigScreenInfo",{workshopId:e})},saveDevicePositionAndSizeApi:function(e){return Object(i["j"])("/mdc/mdcWorkshopInfo/saveEquipmentCoordinate",e)},getWorkshopListApi:function(e){return Object(i["c"])("/mdc/mdcWorkshopInfo/list",e)},addWorkshopApi:function(e){return Object(i["i"])("/mdc/mdcWorkshopInfo/add",e)},editWorkshopApi:function(e){return Object(i["j"])("/mdc/mdcWorkshopInfo/edit",e)},deleteSingleWorkshopApi:function(e){return Object(i["a"])("/mdc/mdcWorkshopInfo/delete",{id:e})},deleteBatchWorkshopApi:function(e){return Object(i["a"])("/mdc/mdcWorkshopInfo/deleteBatch",{ids:e})},addDeviceInWorkshopApi:function(e){return Object(i["i"])("/mdc/mdcWorkshopInfo/addWorkshopEquipment",e)},deleteSingleDeviceInWorkshopApi:function(e){return Object(i["a"])("/mdc/mdcWorkshopInfo/deleteWorkshopEquipment",e)},deleteBatchDeviceInWorkshopApi:function(e){return Object(i["a"])("/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch",e)},getParamListByDriveTypeApi:function(e){return Object(i["c"])("/mdc/mdcDriveTypeParamConfig/getDriveParamOptionsByType?controlSystemType=".concat(e))},addParamThresholdApi:function(e){return Object(i["i"])("/mdc/mdcEquipmentThreshold/add",e)},editParamThresholdApi:function(e){return Object(i["i"])("/mdc/mdcEquipmentThreshold/edit",e)},deleteParamThresholdApi:function(e){return Object(i["a"])("/mdc/mdcEquipmentThreshold/delete",{id:e})},deleteBatchParamThresholdApi:function(e){return Object(i["a"])("/mdc/mdcEquipmentThreshold/deleteBatch",{ids:e})}}},d739:function(e,t,o){"use strict";o.r(t);var i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("a-modal",{attrs:{title:e.title,maskClosable:!0,width:e.modalWidth,visible:e.visible},on:{cancel:function(t){e.visible=!1}}},[o("a-spin",{attrs:{spinning:e.confirmLoading}},[o("a-form-model",{ref:"form",attrs:{form:e.form,model:e.model,rules:e.validatorRules,labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[o("a-row",{attrs:{gutter:24}},[o("a-col",{attrs:{span:12}},[o("a-form-model-item",{attrs:{prop:"controlSystemType",label:"驱动类型"}},[o("a-select",{attrs:{placeholder:"请选择驱动类型"},on:{change:e.handleDriveTypeChange},model:{value:e.model.controlSystemType,callback:function(t){e.$set(e.model,"controlSystemType",t)},expression:"model.controlSystemType"}},e._l(e.driveTypeList,(function(t,i){return o("a-select-option",{key:i,attrs:{value:t}},[e._v("\n "+e._s(t)+"\n ")])})),1)],1)],1),o("a-col",{attrs:{span:12}},[o("a-form-model-item",{attrs:{prop:"chineseName",label:"参数"}},[o("a-select",{attrs:{placeholder:"请选择参数"},model:{value:e.model.chineseName,callback:function(t){e.$set(e.model,"chineseName",t)},expression:"model.chineseName"}},e._l(e.paramList,(function(t){return o("a-select-option",{key:t.value,attrs:{value:t.value}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1)],1),o("a-row",{attrs:{gutter:24}},[o("a-col",{attrs:{span:12}},[o("a-form-model-item",{attrs:{prop:"maxThreshold",label:"阈值上限"}},[o("a-input-number",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入阈值上限"},model:{value:e.model.maxThreshold,callback:function(t){e.$set(e.model,"maxThreshold",t)},expression:"model.maxThreshold"}})],1)],1),o("a-col",{attrs:{span:12}},[o("a-form-model-item",{attrs:{prop:"minThreshold",label:"阈值下限"}},[o("a-input-number",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入阈值下限"},model:{value:e.model.minThreshold,callback:function(t){e.$set(e.model,"minThreshold",t)},expression:"model.minThreshold"}})],1)],1)],1)],1)],1),o("template",{slot:"footer"},[o("a-popconfirm",{attrs:{title:"确定放弃操作?",okText:"确定",cancelText:"取消"},on:{confirm:function(t){e.visible=!1}}},[o("a-button",{staticStyle:{"margin-right":".8rem"}},[e._v("取消")])],1),o("a-button",{attrs:{type:"primary",loading:e.confirmLoading},on:{click:e.handleSubmit}},[e._v("提交")])],1)],2)},n=[],r=o("88bc"),s=o.n(r),a=o("bfa6"),c={name:"ParamThresholdModal",components:{},props:{driveTypeList:{type:Array}},data:function(){return{modalWidth:700,form:this.$form.createForm(this),validatorRules:{controlSystemType:[{required:!0,message:"请选择驱动类型"}],chineseName:[{required:!0,message:"请选择参数"}],minThreshold:[{required:!0,message:"请输入阈值上限"},{pattern:/^[0-9]+$/,message:"请输入阿拉伯数字"}],maxThreshold:[{required:!0,message:"请输入阈值下限"},{pattern:/^[0-9]+$/,message:"请输入阿拉伯数字"}]},title:"操作",visible:!1,model:{controlSystemType:"",chineseName:"",minThreshold:"",maxThreshold:""},labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:15}},confirmLoading:!1,url:{userId:"/sys/user/generateUserId"},paramList:[]}},created:function(){},methods:{add:function(){var e=this;this.visible=!0,this.model={controlSystemType:this.driveTypeList[0],chineseName:"",minThreshold:"",maxThreshold:""},this.handleDriveTypeChange(this.driveTypeList[0]),this.$nextTick((function(){e.form.setFieldsValue(s()(e.model,"controlSystemType","chineseName","minThreshold","maxThreshold"))}))},edit:function(e){var t=this;this.visible=!0,this.model=Object.assign({},e),a["a"].getParamListByDriveTypeApi(e.controlSystemType).then((function(e){e.success&&(t.paramList=e.result)})),this.model.chineseName="".concat(e.englishName,"(").concat(e.chineseName,")"),this.$nextTick((function(){t.form.setFieldsValue(s()(t.model,"controlSystemType","chineseName","minThreshold","maxThreshold"))}))},handleSubmit:function(){var e=this,t=this;this.$refs.form.validate((function(o){if(!o)return!1;var i;e.model.maxThreshold>e.model.minThreshold?(t.confirmLoading=!0,i="新增"==e.title?a["a"].addParamThresholdApi(e.model):a["a"].editParamThresholdApi(e.model),i.then((function(e){e.success?(t.$notification.success({message:"消息",description:e.message}),t.$emit("ok")):t.$notification.warning({message:"消息",description:e.message})})).finally((function(){t.confirmLoading=!1,e.visible=!1}))):e.$notification.warning({message:"消息",description:"阈值上限不能小于等于阈值下限"})}))},filterOption:function(e,t){return t.componentOptions.children[0].text.toUpperCase().indexOf(e.toUpperCase())>=0},handleDriveTypeChange:function(e){var t=this;a["a"].getParamListByDriveTypeApi(e).then((function(e){e.success&&(t.paramList=e.result,t.model.chineseName=e.result.length?e.result[0].value:void 0,t.model.chineseName&&t.$refs.form.clearValidate("chineseName"))}))},removeValidate:function(){this.$refs.form&&this.$refs.form.clearValidate()}}},l=c,m=o("2877"),d=Object(m["a"])(l,i,n,!1,null,"6899af87",null);t["default"]=d.exports}}]);