smart-power-ui/node_modules/.cache/vue-loader/c96bc79880a3d497b1aa0562f7a...

1 line
36 KiB
JSON

{"remainingRequest":"G:\\project\\smart-power-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!G:\\project\\smart-power-ui\\src\\views\\iot\\trigger\\profile\\insertTriggerDialog.vue?vue&type=style&index=1&lang=scss&","dependencies":[{"path":"G:\\project\\smart-power-ui\\src\\views\\iot\\trigger\\profile\\insertTriggerDialog.vue","mtime":1618560609014},{"path":"G:\\project\\smart-power-ui\\node_modules\\css-loader\\dist\\cjs.js","mtime":1592876569350},{"path":"G:\\project\\smart-power-ui\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1610504274351},{"path":"G:\\project\\smart-power-ui\\node_modules\\postcss-loader\\src\\index.js","mtime":1591751774425},{"path":"G:\\project\\smart-power-ui\\node_modules\\sass-loader\\dist\\cjs.js","mtime":1612140853844},{"path":"G:\\project\\smart-power-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1591751767036},{"path":"G:\\project\\smart-power-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1610504274351}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKC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ACA;AACA","file":"insertTriggerDialog.vue","sourceRoot":"src/views/iot/trigger/profile","sourcesContent":["<template>\n <div class=\"trigger-insert-dialog\">\n <el-form :rules=\"rules\" :model=\"temp\" label-width=\"150px\" ref=\"dataForm\" class=\"trigger-form\">\n <el-row>\n <el-col :span=\"24\">\n <el-form-item label=\"名称:\" prop=\"triggerName\">\n <el-input v-model=\"temp.triggerName\" class=\"input-style\"></el-input>\n </el-form-item>\n </el-col>\n </el-row>\n\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"是否生成报警:\">\n <el-switch\n style=\"margin-right: 5px;\"\n v-model=\"temp.hasAlarm\"\n :active-value=\"true\"\n :inactive-value=\"false\"\n active-color=\"#13ce66\"\n inactive-color=\"#ff4949\"\n ></el-switch>\n </el-form-item>\n </el-col>\n <el-col :span=\"12\" v-if=\"temp.hasAlarm === true\" >\n <el-form-item label=\"报警类型:\" prop=\"alarmTypeCode\">\n <el-select\n v-model=\"temp.alarmTypeCode\"\n size=\"small\"\n style=\"width: 100%;\"\n clearable\n placeholder=\"请选择\"\n >\n <el-option\n v-for=\"dict in alarmTypeList\"\n :key=\"dict.typeCode\"\n :label=\"dict.typeName\"\n :value=\"dict.typeCode\"\n ></el-option>\n </el-select>\n </el-form-item>\n </el-col>\n <el-col :span=\"12\" v-else >\n <el-form-item label=\"报警类型:\">\n <el-select\n v-model=\"temp.alarmTypeCode\"\n size=\"small\"\n style=\"width: 100%;\"\n clearable\n placeholder=\"请选择\"\n >\n <el-option\n v-for=\"dict in alarmTypeList\"\n :key=\"dict.typeCode\"\n :label=\"dict.typeName\"\n :value=\"dict.typeCode\"\n ></el-option>\n </el-select>\n </el-form-item>\n </el-col>\n </el-row>\n\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"间隔时间:\" prop=\"intervalVal\">\n <div style=\"width: 100%; display: flex;\">\n <el-input\n v-model=\"temp.intervalVal\"\n size=\"small\"\n width=\"calc(100% - 160px);\"\n placeholder=\"请输入间隔时间\"\n />\n <el-select\n v-model=\"temp.intervalUnit\"\n size=\"small\"\n style=\"width: 150px;margin-left: 10px;\"\n placeholder=\"请选择单位\"\n >\n <el-option\n v-for=\"(keys, value) in intervalValOption\"\n :key=\"keys\"\n :label=\"keys\"\n :value=\"value\"\n ></el-option>\n </el-select>\n </div>\n </el-form-item>\n </el-col>\n\n </el-row>\n\n <el-form-item label=\"所属型号:\" prop=\"modelName\">\n <el-input\n :disabled=\"tempType === 'update'\"\n suffix-icon=\"el-icon-caret-bottom\"\n v-model=\"temp.modelName\"\n placeholder=\"点击选择型号\"\n @focus=\"openModelTableSelectDialog()\"\n :validate-event=\"false\"\n />\n </el-form-item>\n\n <el-form-item label=\"选择设备:\" v-show=\"this.temp.modelId && this.temp.modelId !== 0\">\n <div style=\"width: 100%;\">\n <el-button size=\"mini\" type=\"primary\" plain @click=\"openDeviceTableSelectDialog\">选择设备</el-button>\n <div class=\"device-select-tag\">\n <el-tag\n style=\"margin: 5px;\"\n :key=\"item.deviceId\"\n v-for=\"item in selectionDeviceList\"\n closable\n :disable-transitions=\"false\"\n @close=\"handleDeviceClose(item)\"\n >{{item.deviceName}}</el-tag>\n </div>\n </div>\n </el-form-item>\n\n <el-form-item label=\"触发条件:\" prop=\"conditionList\">\n <div style=\"height: auto; width: 100%;\" class=\"property-card\">\n <el-button size=\"mini\" type=\"primary\" plain @click=\"insertItemlist()\">添加条件</el-button>\n <condition-temp\n @EventDel=\"eventDel\"\n :tempIndex=\"index\"\n :info=\"item\"\n v-for=\"(item, index) in temp.conditionList\"\n :key=\"index\"\n :propertyList=\"propertyList\"\n />\n </div>\n </el-form-item>\n\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"报警方式:\">\n <el-checkbox-group v-model=\"alarmMode\" @change=\"alarm_mode_change\">\n <el-checkbox\n v-for=\"(proVal, proName) in alarmModeOptions\"\n :label=\"proName\"\n :key=\"proName\"\n >{{ proVal }}</el-checkbox>\n </el-checkbox-group>\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"触发器状态:\">\n <el-radio label=\"0\" v-model=\"temp.status\">启用</el-radio>\n <el-radio label=\"1\" v-model=\"temp.status\">禁用</el-radio>\n </el-form-item>\n </el-col>\n </el-row>\n\n <el-form-item label=\"报警联系人/组:\" prop=\"contactsList\">\n <div class=\"transfer\">\n <el-transfer\n :titles=\"['待选', '已选']\"\n filterable\n filter-placeholder=\"请输入名称\"\n v-model=\"contactsList\"\n :data=\"alarmxContactList\"\n ></el-transfer>\n </div>\n </el-form-item>\n <el-form-item label=\"推送内容:\">\n <el-input v-model=\"temp.templateContent\" class=\"input-style\"></el-input>\n </el-form-item>\n\n <el-form-item label=\"报警联控:\">\n <div class=\"alarm-execut\">\n <el-switch\n style=\"margin-right: 5px;\"\n v-model=\"temp.hasCtl\"\n :active-value=\"true\"\n :inactive-value=\"false\"\n active-color=\"#13ce66\"\n inactive-color=\"#ff4949\"\n ></el-switch>\n <el-button size=\"mini\" v-show=\"temp.hasCtl\" type=\"primary\" @click=\"addDeviceInfo\">添加设备</el-button>\n <device-param-wrap\n v-show=\"temp.hasCtl\"\n ref=\"paramsWrap\"\n :disabled=\"false\"\n v-for=\"(item,index) in relationList\"\n :tempIndex=\"item.guid\"\n :deleteButtonD=\"false\"\n :key=\"item.guid\"\n :paramsDevcie=\"item\"\n @delInfo=\"delInfo\"\n @resultEvent=\"resultEvent\"\n ></device-param-wrap>\n </div>\n </el-form-item>\n </el-form>\n\n <div class=\"form-submit\">\n <el-button\n type=\"primary\"\n size=\"mini\"\n @click=\"createSubmitClickFu\"\n v-if=\"tempType === 'create' || tempType === 'copperIn'\"\n >确定</el-button>\n <el-button size=\"mini\" type=\"primary\" @click=\"updateSubmitClickFu\" v-if=\"tempType === 'update'\">确定</el-button>\n <el-button size=\"mini\" title=\"返回<触发器列表>\" @click=\"recoverFu\" class=\"recover-style\">取消</el-button>\n </div>\n <el-dialog\n title=\"选择\"\n :visible.sync=\"selectTableShow\"\n width=\"75%\"\n top=\"10vh\"\n class=\"select-table-dialog\"\n :close-on-click-modal=\"false\"\n append-to-body\n >\n <select-table-wrap\n v-if=\"selectTableShow\"\n :tableOption=\"tableSelectOption.tableOpt\"\n :queryOption=\"tableSelectOption.queryOpt\"\n :tableList=\"tableSelectOption.tableList\"\n @parentGetList=\"childGetList($event)\"\n :otherOption=\"tableSelectOption.otherOption\"\n @returnEvent=\"returnEvent($event)\"\n />\n\n <div slot=\"footer\" class=\"dialog-footer\">\n <el-button size=\"mini\" type=\"primary\" @click=\"resuleClick\">确 定</el-button>\n <el-button size=\"mini\" @click=\"() =>{selectTableShow = false}\">取 消</el-button>\n </div>\n </el-dialog>\n </div>\n</template>\n<script>\nimport { getDeviceList } from \"@/api/app\";\nimport { getDeviceFunList } from \"@/api/iot/device\";\nimport { listModel, getModel } from \"@/api/iot/model\";\nimport { addTrigger, updateTrigger, getTrigger } from \"@/api/iot/trigger\";\nimport { listAlarmType } from \"@/api/alarm/alarmType\";\nimport { listContacts } from \"@/api/iot/contacts\";\nimport ConditionTemp from \"@/views/profile/DeviceTrigger/profile/conditionTemp\";\nimport SelectTableWrap from \"@/components/SelectTable/indexbox\";\nimport DeviceParamWrap from \"@/views/profile/DeviceTrigger/profile/deviceParam\";\n\nconst relationOptions = {\n AND: \"并且\",\n OR: \"或者\"\n};\nconst trigCondEnumOptions = {\n LTA: \"数值低于A\",\n GTB: \"数值高于B\",\n GTA_AND_LTB: \"数值介于AB之间\",\n LTA_OR_GTB: \"数值高于B低于A\",\n EQA: \"数值等于A\"\n};\nconst alarmModeOptions = {\n sms: \"短信\",\n weixin: \"微信\"\n // email: \"邮件\"\n};\n\nconst intervalValOption = {\n SECONDS: \"秒\",\n MINUTES: \"分钟\",\n HOURS: \"小时\",\n DAYS: \"天\"\n};\nexport default {\n name: \"InsertTrigger\",\n components: {\n ConditionTemp,\n SelectTableWrap,\n DeviceParamWrap\n },\n props: {\n type: {\n type: String,\n default: \"create\"\n },\n triggerId: {\n type: [Number, String],\n default: 0\n }\n },\n data() {\n const alarmMode = (rule, value, callback) => {\n if (this.alarmMode.length <= 0) {\n callback(new Error(\"请选择报警方式!\"));\n } else {\n callback();\n }\n };\n const contactsList = (rule, value, callback) => {\n if (this.contactsList.length <= 0) {\n callback(new Error(\"请选择报警联系人!\"));\n } else {\n callback();\n }\n };\n const conditionList = (rule, value, callback) => {\n if (this.temp.conditionList.length <= 0) {\n callback(new Error(\"触发条件不能为空,至少需要拥有一条触发条件!\"));\n } else {\n callback();\n }\n };\n const modelNameValidator = (rule, value, callback) => {\n if (this.temp.modelId === \"\") {\n callback(new Error(\"请选择型号!\"));\n } else {\n callback();\n }\n };\n return {\n selectTableShow: false,\n tableSelectOption: {},\n selectResult: {},\n /////////////\n tempType: \"\",\n intervalValOption,\n titleStr: {\n create: \"添加触发器\",\n update: \"修改触发器\",\n copperIn: \"复制并新增触发器\"\n },\n conditionList: [\n {\n relationType: \"\",\n funKey: \"\",\n funName: \"\",\n conditionType: \"\",\n value1: \"\",\n value2: \"\",\n funDataType: \"\",\n funId: \"\"\n }\n ],\n dataTempldateList: [],\n pointList: [],\n alarmMode: [],\n alarmxContactList: [],\n contactsList: [],\n propertyList: [],\n triggerMaxInput: [],\n triggerMinInput: [],\n relationOptions,\n trigCondEnumOptions,\n alarmModeOptions,\n alarmTypeList: [],\n temp: {},\n queryAlarmxContctList: {\n name: \"\"\n },\n rules: {\n conditionList: [\n { required: true, validator: conditionList, trigger: \"blur\" }\n ],\n triggerName: [\n { required: true, message: \"请填写触发器名称\", trigger: \"blur\" }\n ],\n triggerCond: [\n { required: true, message: \"请选择触发条件\", trigger: \"blur\" }\n ],\n saveRule: [\n { required: true, message: \"选择报警方式\", trigger: \"blur\" }\n ],\n alarmMode: [{ required: true, validator: alarmMode, trigger: \"blur\" }],\n // contactsList: [\n // { required: false, validator: contactsList, trigger: \"blur\" }\n // ],\n intervalVal: [\n { required: true, message: \"选输入间隔时间数值\", trigger: \"blur\" },\n { pattern: /^[0-9]*$/, message: \"请输入正整数值\", trigger: \"blur\" }\n ],\n modelName: [\n { required: true, validator: modelNameValidator }\n ],\n alarmTypeCode: [\n { required: true, message: \"请选择报警类型\", trigger: \"blur\" }\n ]\n },\n selectionDeviceList: [],\n relationList: []\n };\n },\n methods: {\n /** 查询告警类型列表 */\n getAlaramTypeList() {\n this.loading = true;\n listAlarmType({pageNum: 1, pageSize: 9999}).then(response => {\n this.alarmTypeList = response.rows;\n });\n },\n getGuid() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(\n c\n ) {\n var r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n },\n addDeviceInfo() {\n this.relationList.push({\n cmdKey: \"\",\n deviceId: \"\",\n deviceKey: '',\n ctlJson: \"\",\n guid: this.getGuid()\n });\n },\n delInfo(index) {\n var arr = [];\n this.relationList.forEach(v => {\n if (v.guid !== index) {\n arr.push(v);\n }\n });\n this.relationList = [];\n this.relationList = arr;\n this.$forceUpdate();\n },\n resultEvent(data) {\n for (var i = 0; i < this.relationList.length; i++) {\n if (this.relationList[i].guid === data.index) {\n this.relationList[i] = data.result;\n break;\n }\n }\n },\n // 打开厂商选择窗口 ——表格\n openModelTableSelectDialog() {\n this.selectResult = {};\n this.tableSelectOption = {\n otherOption: {\n tableType: \"model\"\n },\n queryOpt: {\n disable: false,\n labelWidth: \"68px\",\n params: {\n modelName: \"\",\n modelCode: \"\"\n },\n page: {\n pageSize: 10,\n pageNum: 1,\n total: 0\n },\n inline: true,\n queryChilds: [\n {\n style: \"\",\n placeholder: \"型号名称\",\n clearable: true,\n label: \"型号名称\",\n type: \"input\",\n key: \"modelName\",\n size: \"small\",\n value: \"\"\n }\n ]\n },\n tableOpt: {\n loading: false,\n rowKey: \"deviceId\",\n selection: false,\n maxHeight: \"45vh\",\n childs: [\n {\n style: \"\",\n label: \"厂商名称\",\n type: \"\",\n prop: \"vendorName\",\n align: \"left\",\n width: \"200\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n },\n {\n style: \"\",\n label: \"型号名称\",\n type: \"\",\n prop: \"modelName\",\n align: \"left\",\n width: \"200\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n },\n {\n style: \"\",\n label: \"设备类型\",\n type: \"\",\n prop: \"deviceTypeName\",\n align: \"left\",\n width: \"120\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n },\n {\n style: \"\",\n label: \"产品PK\",\n type: \"\",\n prop: \"prodKey\",\n align: \"left\",\n width: \"\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n },\n {\n style: \"\",\n label: \"产品密钥\",\n type: \"\",\n prop: \"prodSecret\",\n align: \"left\",\n width: \"\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n }\n ],\n tableList: {\n type: Array\n }\n },\n tableList: []\n };\n this.selectTableShow = true;\n },\n handleDeviceClose(row) {\n this.selectionDeviceList.splice(this.selectionDeviceList.indexOf(row), 1);\n this.$forceUpdate();\n },\n // 打开厂商选择窗口 ——表格\n openDeviceTableSelectDialog() {\n if (!this.temp.modelId && this.temp.modelId !== 0) {\n return;\n }\n this.selectResult = {};\n this.tableSelectOption = {\n otherOption: {\n tableType: \"device\"\n },\n queryOpt: {\n disable: false,\n labelWidth: \"68px\",\n params: {\n deviceName: \"\",\n modelId: this.temp.modelId,\n modelName: this.temp.modelName\n },\n page: {\n pageSize: 10,\n pageNum: 1,\n total: 0\n },\n inline: true,\n queryChilds: [\n {\n style: \"\",\n placeholder: \"设备名称\",\n clearable: true,\n label: \"设备名称\",\n type: \"input\",\n key: \"deviceName\",\n size: \"small\",\n value: \"\"\n }\n ]\n },\n tableOpt: {\n loading: false,\n rowKey: \"deviceId\",\n selection: false,\n maxHeight: \"45vh\",\n childs: [\n {\n style: \"\",\n label: \"所属型号\",\n type: \"\",\n prop: \"modelName\",\n align: \"left\",\n width: \"\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n },\n {\n style: \"\",\n label: \"设备名称\",\n type: \"\",\n prop: \"deviceName\",\n align: \"left\",\n width: \"\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n },\n {\n style: \"\",\n label: \"设备Key\",\n type: \"\",\n prop: \"deviceKey\",\n align: \"left\",\n width: \"\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n },\n {\n style: \"\",\n label: \"创建时间\",\n type: \"time\",\n prop: \"createTime\",\n align: \"center\",\n width: \"160\",\n \"show-overflow-tooltip\": false,\n tempType: \"span\"\n }\n ],\n tableList: {\n type: Array\n }\n },\n tableList: []\n };\n this.selectTableShow = true;\n },\n // 查询回调\n childGetList(data) {\n if (data.otherOption.tableType === \"device\") {\n this.deviceChildList(data);\n } else if (data.otherOption.tableType === \"model\") {\n this.modelChildList(data);\n }\n },\n modelChildList(data) {\n listModel(Object.assign(data.page, data.param, { selected: 1 })).then(\n response => {\n this.tableSelectOption.tableList = response.rows;\n this.tableSelectOption.queryOpt.page.total = Number(response.total);\n this.selectionDeviceList = [];\n }\n );\n },\n deviceChildList(data) {\n getDeviceList(Object.assign(data.page, data.param)).then(response => {\n this.tableSelectOption.tableList = response.rows;\n this.tableSelectOption.queryOpt.page.total = Number(response.total);\n });\n },\n // 点击或者双击数据回调\n returnEvent(data) {\n if (data.type === \"click\") {\n this.selectResult.tableType = data.otherOption.tableType;\n if (data.otherOption.tableType === \"device\") {\n this.selectResult = data.value;\n this.selectResult.tableType = 'device'\n } else if (data.otherOption.tableType === \"model\") {\n this.selectResult.modelId = data.value.modelId;\n this.selectResult.modelName = data.value.modelName;\n this.selectResult.prodKey = data.value.prodKey;\n }\n } else if (data.type === \"dblclick\") {\n if (data.otherOption.tableType === \"device\") {\n this.eventSet(data.value);\n } else if (data.otherOption.tableType === \"model\") {\n this.temp.modelId = data.value.modelId;\n this.temp.modelName = data.value.modelName;\n this.getcomdlist(data.value.modelId);\n this.selectTableShow = false;\n }\n }\n },\n eventSet(row) {\n if (this.selectionDeviceList.length <= 0) {\n this.selectionDeviceList.push({\n deviceId: row[\"deviceId\"],\n deviceName: row[\"deviceName\"]\n });\n }\n for (var i = 0; i < this.selectionDeviceList.length; i++) {\n if (this.selectionDeviceList[i][\"deviceId\"] === row[\"deviceId\"]) {\n break;\n }\n if (i === this.selectionDeviceList.length - 1) {\n this.selectionDeviceList.push({\n deviceId: row[\"deviceId\"],\n deviceName: row[\"deviceName\"]\n });\n }\n }\n this.selectTableShow = false;\n },\n resuleClick() {\n if (this.selectResult.tableType === \"device\") {\n this.eventSet(this.selectResult);\n } else if (this.selectResult.tableType === \"model\") {\n this.temp.modelId = this.selectResult.modelId;\n this.temp.modelName = this.selectResult.modelName;\n this.getcomdlist(this.selectResult.modelId);\n }\n this.selectTableShow = false;\n },\n // 查询产品参数列表\n getcomdlist(id) {\n if (!id && id !== 0) {\n return;\n }\n this.propertyList = [];\n getDeviceFunList({\n modelId: id\n }).then(res => {\n this.propertyList = res.data;\n });\n },\n\n eventDel(data) {\n this.temp.conditionList.splice(data, 1);\n },\n delItem(data) {\n this.temp.triggerCtlList.splice(data, 1);\n },\n addExecut() {\n this.temp.triggerCtlList.push({\n ctlJson: \"\",\n deviceId: \"\",\n deviceKey: \"\",\n prodId: \"\",\n prodKey: \"\",\n scopeType: \"PRODUCT\"\n });\n },\n insertItemlist() {\n this.temp.conditionList.push({\n relationType: \"\",\n funKey: \"\",\n conditionType: \"\",\n value1: \"\",\n value2: \"\",\n funDataType: \"\",\n funId: \"\"\n });\n },\n // 获取报警联系人列表\n getAlarmxContAct() {\n listContacts(this.queryAlarmxContctList).then(response => {\n this.alarmxContactList = [];\n response.rows.forEach(value => {\n this.alarmxContactList.push({\n key: value.id,\n label: value.name,\n disabled: value.status === \"0\" ? false : true\n });\n });\n });\n },\n changeTriggerCondFu(val, index) {\n this.triggerCondFu(val, index);\n },\n triggerCondFu(val, index) {\n this.triggerMaxInput[index] = false;\n this.triggerMinInput[index] = false;\n if (val === \"LTA\") {\n this.triggerMinInput[index] = true;\n }\n if (val === \"GTB\") {\n this.triggerMaxInput[index] = true;\n }\n if (val === \"GTA_AND_LTB\" || val === \"LTA_OR_GTB\") {\n this.triggerMaxInput[index] = true;\n this.triggerMinInput[index] = true;\n }\n if (val === \"EQA\") {\n this.triggerMinInput[index] = true;\n }\n },\n createSubmitClickFu() {\n this.temp.deviceList = this.selectionDeviceList;\n this.temp.triggerCtlList = this.relationList;\n this.$refs[\"dataForm\"].validate(valid => {\n if (valid) {\n this.temp.contactsList = [];\n this.contactsList.forEach((v, index) => {\n this.temp.contactsList.push({\n contactsId: v\n });\n });\n if (!this.temp.hasCtl) {\n this.temp.triggerCtlList = [];\n }\n addTrigger(this.temp).then(response => {\n if (response.code === 200) {\n this.msgSuccess(\"添加成功\");\n this.recoverFu();\n }\n });\n }\n });\n },\n updateSubmitClickFu() {\n this.$refs[\"dataForm\"].validate(valid => {\n if (valid) {\n this.temp.contactsList = [];\n this.contactsList.forEach((v, index) => {\n this.temp.contactsList.push({\n contactsId: v\n });\n });\n updateTrigger(this.temp).then(response => {\n if (response.code === 200) {\n this.msgSuccess(\"修改成功\");\n this.recoverFu();\n }\n });\n }\n });\n },\n newTemp() {\n this.temp = {\n templateContent: \"\",\n // alarmTypeEmail: true,\n hasSendSms: true,\n hasSendWeixin: false,\n triggerName: \"\",\n conditionList: [],\n contactsList: [],\n normalContent: \"\",\n status: '0',\n triggerScope: \"PRODUCT\",\n triggerCtlList: [],\n hasCtl: true,\n intervalVal: 0,\n intervalUnit: \"SECONDS\",\n alarmTypeCode: \"\",\n hasAlarm: true,\n modelId: ''\n };\n },\n getTriggerDetails(id, type) {\n getTrigger(id)\n .then(response => {\n this.temp = Object.assign({}, response.data);;\n if (type === \"copper\") {\n this.temp.triggerName = \"\";\n this.tempType = \"copperIn\";\n } else {\n this.tempType = \"update\";\n }\n if (this.temp.hasSendWeixin === true) this.alarmMode.push(\"weixin\");\n\n if (this.temp.hasSendSms === true) this.alarmMode.push(\"sms\");\n\n // if (this.temp.alarmTypeEmail === true) this.alarmMode.push(\"email\");\n this.contactsList = [];\n this.temp.contactsList.forEach((v, index) => {\n this.contactsList.push(v.contactsId);\n });\n this.temp.conditionList.forEach((v, index) => {\n this.triggerCondFu(v.conditionType, index);\n });\n if (this.temp.triggerCtlList) {\n this.temp.triggerCtlList.forEach(v => {\n this.relationList.push(Object.assign(v, { guid: this.getGuid() }))\n })\n }\n this.temp.status = this.temp.status.toString()\n this.selectionDeviceList = this.temp.deviceList\n if (this.temp.model) {\n this.temp.modelName = this.temp.model.modelName\n this.getcomdlist(this.temp.model.modelId);\n } else {\n console.log('型号参数错误!')\n }\n })\n .catch(err => {\n console.log(err);\n });\n },\n // 列表数据初始化方法\n initialize() {\n if (this.type === \"create\") {\n this.newTemp();\n this.alarmMode = [\"sms\"];\n this.tempType = \"create\";\n } else {\n this.getTriggerDetails(this.triggerId, this.type);\n }\n },\n recoverFu() {\n this.$emit(\"recover\");\n },\n alarm_mode_change() {\n if (this.alarmMode.indexOf(\"sms\") > -1) {\n this.temp.hasSendSms = true;\n } else {\n this.temp.hasSendSms = false;\n }\n if (this.alarmMode.indexOf(\"weixin\") > -1) {\n this.temp.hasSendWeixin = true;\n } else {\n this.temp.hasSendWeixin = false;\n }\n if (this.alarmMode.indexOf(\"email\") > -1) {\n this.temp.alarmTypeEmail = true;\n } else {\n this.temp.alarmTypeEmail = false;\n }\n },\n // 组件初始化方法\n init() {\n this.getAlarmxContAct();\n this.getAlaramTypeList();\n this.initialize();\n }\n },\n created() {\n this.init();\n }\n};\n</script>\n<style lang=\"scss\">\n.trigger-insert-dialog {\n display: flex;\n width: 100%;\n flex-wrap: wrap;\n .trigger-form {\n width: calc(100%);\n height: calc(75vh);\n overflow: auto;\n padding: 20px;\n padding-right: 20px;\n border-bottom: 1px solid #929191;\n }\n .title {\n box-sizing: inherit;\n background: #fff;\n padding: 20px 40px;\n font-size: 20px;\n font-weight: 700;\n color: #373d41;\n height: 68px;\n }\n .bottom-submit-div {\n height: 70px;\n text-align: center;\n position: fixed;\n width: calc(100% - 350px);\n background: #fff;\n bottom: 0px;\n padding-top: 10px;\n z-index: 2000;\n margin-left: 10px;\n }\n .switch .el-switch__label {\n position: absolute;\n color: #fff !important;\n z-index: 1;\n display: none;\n }\n .switch .is-active {\n display: block;\n }\n .switch .el-switch__label--left span {\n margin-left: 20px;\n }\n .form-submit {\n height: 50px;\n width: 100%;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding-right: 20px;\n }\n}\n\n.insertTrigger-genert-div {\n padding: 80px 10% 20px 10%;\n border: 0px;\n border-radius: 5px;\n box-shadow: 0px 1px 3px 1px;\n background-color: white;\n font: 14px/16px \"Roboto\", sans-serif;\n float: left;\n color: #666666;\n width: calc(100% - 300px);\n}\n\n.input-style {\n width: 100%;\n}\n.from-button-style {\n width: 65px;\n height: 35px;\n}\n/* .from-button-style:hover {\n width: 75px;\n height: 41px;\n font-size: 18px;\n} */\n.tips-div {\n margin-left: 20px;\n float: left;\n margin-right: 0px;\n margin-top: 0;\n}\n\n.recover-style {\n margin-left: 10px;\n}\n.property-card {\n height: 300px;\n width: 100%;\n .el-card__body {\n padding: 10px;\n }\n .el-card {\n width: 300px;\n height: 306px;\n float: left;\n margin-right: 10px;\n margin-bottom: 10px;\n }\n .card-select {\n width: 220px !important;\n }\n .card-div {\n display: inline-block;\n width: 100%;\n margin-bottom: 10px;\n }\n .delete-buttom {\n font-size: 20px;\n padding: 5px;\n width: 280px;\n }\n .insert-card {\n height: 306px;\n display: flex;\n align-items: center;\n text-align: right;\n text-align: center;\n .el-button--text {\n color: #9e9e9e;\n font-size: 60px;\n margin-left: 120px;\n }\n }\n}\n.device-select-tag {\n width: calc(100% + 80px);\n min-height: 80px;\n border: 1px solid #cacaca;\n padding: 5px;\n border-radius: 5px;\n max-height: 150px;\n overflow: auto;\n position: relative;\n left: -80px;\n margin-top: 10px;\n}\n.alarm-execut {\n}\n</style>\n<style lang=\"scss\">\n.transfer .el-transfer-panel {\n min-width: 250px;\n}\n.transfer .el-transfer__buttons {\n width: 70px;\n text-align: center;\n padding: 0;\n .el-button--primary {\n margin-left: 0px;\n }\n}\n.trigger-insert-dialog .el-form::-webkit-scrollbar {\n /*滚动条整体样式*/\n width: 8px; /*高宽分别对应横竖滚动条的尺寸*/\n height: 3px;\n}\n.trigger-insert-dialog .el-form::-webkit-scrollbar-thumb {\n /*滚动条里面小方块*/\n border-radius: 10px;\n box-shadow: inset 0 0 5px #9e9d9d;\n background: #ffffff;\n}\n.trigger-insert-dialog .el-form::-webkit-scrollbar-track {\n /*滚动条里面轨道*/\n box-shadow: inset 0 0 5px #f6f6f6;\n border-radius: 10px;\n background: #ffffff;\n}\n</style>\n"]}]}