feat: 设备告警配置 开放表格编辑 操作
This commit is contained in:
parent
53b6f32614
commit
e5a9c08749
|
@ -14,11 +14,11 @@ port= 9988
|
||||||
// 陈志荣 本地
|
// 陈志荣 本地
|
||||||
//target = http://192.168.18.140:8899
|
//target = http://192.168.18.140:8899
|
||||||
// 黄明 本地
|
// 黄明 本地
|
||||||
target = http://192.168.18.134:8899
|
// target = http://192.168.18.134:8899
|
||||||
//target = http://192.168.18.139:8899
|
//target = http://192.168.18.139:8899
|
||||||
// target = http://192.168.18.136:8899
|
// target = http://192.168.18.136:8899
|
||||||
|
|
||||||
// 测试端
|
// 测试端
|
||||||
// target = http://192.168.10.241:32024
|
// target = http://192.168.10.241:32024
|
||||||
// 开发端
|
// 开发端
|
||||||
// target = http://192.168.10.241:30646
|
target = http://192.168.10.241:30646
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
<template>
|
||||||
|
<div class="e-fail-message">
|
||||||
|
<span v-if="message" class="form-item__error">* {{ message }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "EFailMessage",
|
||||||
|
props: {
|
||||||
|
form: {
|
||||||
|
type: Object,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
val: {
|
||||||
|
type: [String, Number],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
message: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
val() {
|
||||||
|
//this.handleVerification();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleVerification() {
|
||||||
|
this.$emit("verification", this.form, (msg) => {
|
||||||
|
this.message = msg;
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.e-fail-message {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
.form-item__error {
|
||||||
|
color: #ff4949;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1;
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,54 @@
|
||||||
|
<template>
|
||||||
|
<div class="e-table-input">
|
||||||
|
<el-input v-model="form[pops]" @input="handleInput" :disabled="disabled"/>
|
||||||
|
<e-fail-message
|
||||||
|
:val="form[pops]"
|
||||||
|
:form="form"
|
||||||
|
ref="eFailMessage"
|
||||||
|
@verification="handleVerification"
|
||||||
|
></e-fail-message>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import EFailMessage from './EFailMessage'
|
||||||
|
export default {
|
||||||
|
name: "ETableInput",
|
||||||
|
components: {EFailMessage},
|
||||||
|
props: {
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
type: Object,
|
||||||
|
require: true
|
||||||
|
},
|
||||||
|
pops: {
|
||||||
|
type: String,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
form: {
|
||||||
|
deep: true,
|
||||||
|
handler: function () {
|
||||||
|
this.verificationEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
verificationEvent() {
|
||||||
|
this.$refs.eFailMessage?.handleVerification()
|
||||||
|
},
|
||||||
|
handleInput(e) {
|
||||||
|
this.$forceUpdate()
|
||||||
|
},
|
||||||
|
handleVerification(e, callback) {
|
||||||
|
this.$emit('handleVerification', e, callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="device-alarm-config">
|
<div class="device-alarm-config">
|
||||||
<!-- <el-row style="margin-bottom: 10px">
|
<el-row style="margin-bottom: 10px">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
|
@ -8,16 +8,31 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="disabledAck"
|
:disabled="disabledAck"
|
||||||
@click="handleSendAck"
|
@click="handleSendAck"
|
||||||
>同步</el-button
|
>同步下发</el-button
|
||||||
>
|
>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
title="同步下发"
|
||||||
|
width="350"
|
||||||
|
trigger="hover">
|
||||||
|
<div>
|
||||||
|
<p>设备配置需要先下发到指定设备,设备配置完成后同步到云端平台</p>
|
||||||
|
<span style="display: block; width: 100%; color: red;">注意*:</span>
|
||||||
|
<span style="color: red;">
|
||||||
|
欠压:报警值 < 最小预警值 < 最大预警值 < 正常值 </br>
|
||||||
|
过压:正常值 < 最小预警值 < 最大预警值 < 报警值
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<i class="el-icon-question" slot="reference" style="margin-left: 10px; font-size: 20px;"></i>
|
||||||
|
</el-popover>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row> -->
|
</el-row>
|
||||||
<el-table
|
<el-table
|
||||||
border
|
border
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
class="alarm-table"
|
class="alarm-table"
|
||||||
:height="list.length >= 3 ? '202' : ''"
|
:height="monthTradingTableHeight"
|
||||||
:highlight-pageNum-row="true"
|
:highlight-pageNum-row="true"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -51,6 +66,7 @@
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#dcdfe6"
|
inactive-color="#dcdfe6"
|
||||||
class="switch-wrap"
|
class="switch-wrap"
|
||||||
|
@change="handleAlarmSta(scope.row.alarmSta)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -75,18 +91,31 @@
|
||||||
prop="alarmValue"
|
prop="alarmValue"
|
||||||
label="告警值"
|
label="告警值"
|
||||||
align="center"
|
align="center"
|
||||||
></el-table-column>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<e-table-input @handleVerification="alarmValueTableCallback" :disabled="!scope.row.alarmSta" :form="scope.row" pops="alarmValue" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="warnValueMin"
|
prop="warnValueMin"
|
||||||
label="最小告警值"
|
label="最小预警值"
|
||||||
align="center"
|
align="center"
|
||||||
></el-table-column>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<e-table-input @handleVerification="warnValueMinTableCallback" :disabled="!scope.row.warnSta" :form="scope.row" pops="warnValueMin" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="warnValueMax"
|
prop="warnValueMax"
|
||||||
label="最大告警值"
|
label="最大预警值"
|
||||||
align="center"
|
align="center"
|
||||||
></el-table-column>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<e-table-input @handleVerification="warnValueMaxTableCallback" :disabled="!scope.row.warnSta" :form="scope.row" pops="warnValueMax" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
align="center"
|
align="center"
|
||||||
|
@ -198,6 +227,7 @@ import {
|
||||||
deviceSendAlarmConfig,
|
deviceSendAlarmConfig,
|
||||||
} from "@/api/iot/device";
|
} from "@/api/iot/device";
|
||||||
import DialogTemplate from "@/components/DialogTemplate";
|
import DialogTemplate from "@/components/DialogTemplate";
|
||||||
|
import ETableInput from '@/components/EUpdateTable/ETableInput'
|
||||||
export default {
|
export default {
|
||||||
name: "DeviceAlarmConfig",
|
name: "DeviceAlarmConfig",
|
||||||
props: {
|
props: {
|
||||||
|
@ -212,13 +242,14 @@ export default {
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
DialogTemplate,
|
DialogTemplate,
|
||||||
|
ETableInput
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
alarmParamOption: [],
|
alarmParamOption: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
updateGenTable: false,
|
updateGenTable: true,
|
||||||
title: "修改",
|
title: "修改",
|
||||||
open: false,
|
open: false,
|
||||||
form: {},
|
form: {},
|
||||||
|
@ -226,6 +257,7 @@ export default {
|
||||||
isAck: false,
|
isAck: false,
|
||||||
disabledAck: false,
|
disabledAck: false,
|
||||||
uvpList: ["ul_cfg"],
|
uvpList: ["ul_cfg"],
|
||||||
|
monthTradingTableHeight: 'auto',
|
||||||
rules: {
|
rules: {
|
||||||
warnValueMin: [
|
warnValueMin: [
|
||||||
{
|
{
|
||||||
|
@ -263,6 +295,113 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleAlarmSta(v) {
|
||||||
|
console.log(v)
|
||||||
|
},
|
||||||
|
|
||||||
|
alarmValueTableCallback(row, callback) {
|
||||||
|
console.log(row)
|
||||||
|
if (!row.alarmSta) {
|
||||||
|
callback();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!row.alarmValue && row.alarmValue !== 0) {
|
||||||
|
callback('告警值不能为空!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const isExp =
|
||||||
|
/^((\-)*([1-9][0-9]*)|(\-)*(([0]\.\d{1,}|[1-9][0-9]*\.\d{1,})))$/;
|
||||||
|
|
||||||
|
if (row.alarmValue && !isExp.test(row.alarmValue)) {
|
||||||
|
callback("只可以输入数字类型!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!row.warnSta) {
|
||||||
|
callback();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.uvpList.indexOf(row.type) >= 0) {
|
||||||
|
if (
|
||||||
|
(row.warnValueMin || row.warnValueMin === 0) &&
|
||||||
|
+row.warnValueMin < +row.alarmValue
|
||||||
|
) {
|
||||||
|
callback("需要小于最小预警值!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (
|
||||||
|
(row.warnValueMax || row.warnValueMax === 0) &&
|
||||||
|
+row.warnValueMax > +row.alarmValue
|
||||||
|
) {
|
||||||
|
callback("需要大于最大预警值!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
|
||||||
|
warnValueMaxTableCallback(row, callback) {
|
||||||
|
if (!row.warnSta) {
|
||||||
|
callback();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!row.warnValueMax && row.warnValueMax !== 0) {
|
||||||
|
callback();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const isExp =
|
||||||
|
/^((\-)*([1-9][0-9]*)|(\-)*(([0]\.\d{1,}|[1-9][0-9]*\.\d{1,})))$/;
|
||||||
|
|
||||||
|
if (row.warnValueMax && !isExp.test(row.warnValueMax)) {
|
||||||
|
callback("只可以输入数字类型!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(row.warnValueMin || row.warnValueMin === 0) &&
|
||||||
|
+row.warnValueMax < +row.warnValueMin
|
||||||
|
) {
|
||||||
|
callback("需要大于最小预警值!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
|
||||||
|
warnValueMinTableCallback(row, callback) {
|
||||||
|
if (!row.warnSta) {
|
||||||
|
callback();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!row.warnValueMin && row.warnValueMin !== 0) {
|
||||||
|
callback();
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const isExp =
|
||||||
|
/^((\-)*([1-9][0-9]*)|(\-)*(([0]\.\d{1,}|[1-9][0-9]*\.\d{1,})))$/;
|
||||||
|
if (row.warnValueMin && !isExp.test(row.warnValueMin)) {
|
||||||
|
callback("只可以输入数字类型!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(row.warnValueMax || row.warnValueMax === 0) &&
|
||||||
|
+row.warnValueMin > +row.warnValueMax
|
||||||
|
) {
|
||||||
|
callback("需要小于最大预警值!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
|
||||||
alarmValue(rule, value, callback) {
|
alarmValue(rule, value, callback) {
|
||||||
if (!this.form.alarmSta) {
|
if (!this.form.alarmSta) {
|
||||||
callback();
|
callback();
|
||||||
|
@ -341,6 +480,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleSendAck() {
|
handleSendAck() {
|
||||||
var deviceId = this.deviceId;
|
var deviceId = this.deviceId;
|
||||||
|
var list = [...this.list];
|
||||||
this.$prompt("请输入登录密码", "提示", {
|
this.$prompt("请输入登录密码", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
|
@ -349,7 +489,9 @@ export default {
|
||||||
inputErrorMessage: "登录密码不能为空",
|
inputErrorMessage: "登录密码不能为空",
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
let params = {
|
let params = {
|
||||||
data: {},
|
data: {
|
||||||
|
params: list,
|
||||||
|
},
|
||||||
deviceId: deviceId,
|
deviceId: deviceId,
|
||||||
verifyKey: value,
|
verifyKey: value,
|
||||||
};
|
};
|
||||||
|
@ -374,15 +516,17 @@ export default {
|
||||||
const list = this.list.map((v) => {
|
const list = this.list.map((v) => {
|
||||||
return v.type === this.form.type ? Object.assign(v, this.form) : v;
|
return v.type === this.form.type ? Object.assign(v, this.form) : v;
|
||||||
});
|
});
|
||||||
updateDeviceAlarmConfig({
|
|
||||||
devKey: this.deviceKey,
|
|
||||||
params: [...list],
|
|
||||||
}).then((res) => {
|
|
||||||
this.getList();
|
|
||||||
// this.disabledAck = true;
|
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
});
|
// 暂时不保存-- 使用统一保存下发方式
|
||||||
|
// updateDeviceAlarmConfig({
|
||||||
|
// devKey: this.deviceKey,
|
||||||
|
// params: [...list],
|
||||||
|
// }).then((res) => {
|
||||||
|
// this.getList();
|
||||||
|
// this.open = false;
|
||||||
|
// this.$forceUpdate();
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -397,7 +541,6 @@ export default {
|
||||||
return this.selectDictLabel(this.alarmParamOption, row.type);
|
return this.selectDictLabel(this.alarmParamOption, row.type);
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
console.log(this.deviceKey);
|
|
||||||
if (!this.deviceKey && this.deviceKey !== "0") {
|
if (!this.deviceKey && this.deviceKey !== "0") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -405,6 +548,7 @@ export default {
|
||||||
getDeviceAlarmConfig(this.deviceKey)
|
getDeviceAlarmConfig(this.deviceKey)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.list = response.data.alarmCfg;
|
this.list = response.data.alarmCfg;
|
||||||
|
this.monthTradingTableHeight = this.list.length >= 6 ? '387' : 'auto'
|
||||||
this.isAck = response.data.isAck === 1 ? true : false;
|
this.isAck = response.data.isAck === 1 ? true : false;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
|
|
|
@ -63,7 +63,11 @@
|
||||||
<span class="centent secret" :title="infoData.devicePassword">{{
|
<span class="centent secret" :title="infoData.devicePassword">{{
|
||||||
infoData.devicePassword
|
infoData.devicePassword
|
||||||
}}</span>
|
}}</span>
|
||||||
<el-button type="text" size="small" v-if="isTenant === false" @click.stop="upldatePassword"
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
v-if="isTenant === false"
|
||||||
|
@click.stop="upldatePassword"
|
||||||
>修改密码</el-button
|
>修改密码</el-button
|
||||||
>
|
>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
@ -195,6 +199,61 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="group-list-info"
|
||||||
|
style="margin-top: 15px"
|
||||||
|
v-if="infoData.deviceType === 'MINIATURE_BREAKER'"
|
||||||
|
>
|
||||||
|
<div class="top">
|
||||||
|
<div class="top-label">
|
||||||
|
<svg-icon
|
||||||
|
icon-class="A_product1"
|
||||||
|
style="margin-right: 2px; height: 20px; width: 20px"
|
||||||
|
/>告警配置
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="group-list-table"
|
||||||
|
style="border: 0"
|
||||||
|
v-if="infoData.deviceType === 'MINIATURE_BREAKER'"
|
||||||
|
>
|
||||||
|
<device-alarm-config
|
||||||
|
v-if="infoData.deviceType === 'MINIATURE_BREAKER'"
|
||||||
|
:deviceId="infoData.deviceId"
|
||||||
|
:deviceKey="infoData.deviceKey"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="group-list-info"
|
||||||
|
style="margin-top: 15px"
|
||||||
|
v-if="infoData.deviceType === 'MINIATURE_BREAKER'"
|
||||||
|
>
|
||||||
|
<div class="top">
|
||||||
|
<div class="top-label">
|
||||||
|
<svg-icon
|
||||||
|
icon-class="A_product1"
|
||||||
|
style="margin-right: 2px; height: 20px; width: 20px"
|
||||||
|
/>定时器
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="group-list-table"
|
||||||
|
style="border: 0"
|
||||||
|
v-if="infoData.deviceType === 'MINIATURE_BREAKER'"
|
||||||
|
>
|
||||||
|
<device-timing-config
|
||||||
|
v-if="infoData.deviceType === 'MINIATURE_BREAKER'"
|
||||||
|
:deviceId="infoData.deviceId"
|
||||||
|
:deviceKey="infoData.deviceKey"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 添加或修改设备对话框 -->
|
<!-- 添加或修改设备对话框 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
class="eldialog-wrap"
|
class="eldialog-wrap"
|
||||||
|
@ -224,9 +283,12 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { updateDevice, resetPssword } from "@/api/iot/device";
|
import { updateDevice, resetPssword } from "@/api/iot/device";
|
||||||
|
import DeviceTimingConfig from "@/views/profile/DeviceTimingConfig/DeviceTimingConfig";
|
||||||
|
import DeviceAlarmConfig from "@/views/profile/DeviceAlarmConfig/DeviceAlarmConfig";
|
||||||
export default {
|
export default {
|
||||||
name: "DeviceInfo",
|
name: "DeviceInfo",
|
||||||
props: ["infoData", "isTenant"],
|
props: ["infoData", "isTenant"],
|
||||||
|
components: { DeviceTimingConfig, DeviceAlarmConfig },
|
||||||
data() {
|
data() {
|
||||||
const validatorNull = (rule, value, callback) => {
|
const validatorNull = (rule, value, callback) => {
|
||||||
callback();
|
callback();
|
||||||
|
|
|
@ -9,13 +9,23 @@
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
>新增</el-button
|
>新增</el-button
|
||||||
>
|
>
|
||||||
<!-- <el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-refresh"
|
icon="el-icon-refresh"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleSendAck"
|
@click="handleSendAck"
|
||||||
>同步</el-button
|
>同步下发</el-button
|
||||||
> -->
|
>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
title="同步下发"
|
||||||
|
width="350"
|
||||||
|
trigger="hover">
|
||||||
|
<div>
|
||||||
|
<p>设备定时需要先下发到指定设备,设备配置完成后同步到云端平台</p>
|
||||||
|
</div>
|
||||||
|
<i class="el-icon-question" slot="reference" style="margin-left: 10px; font-size: 20px;"></i>
|
||||||
|
</el-popover>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table
|
<el-table
|
||||||
|
@ -23,7 +33,7 @@
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
class="alarm-table"
|
class="alarm-table"
|
||||||
:height="list.length >= 3 ? '202' : ''"
|
:height="monthTradingTableHeight"
|
||||||
:highlight-pageNum-row="true"
|
:highlight-pageNum-row="true"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -54,8 +64,8 @@
|
||||||
<el-switch
|
<el-switch
|
||||||
size="mini"
|
size="mini"
|
||||||
v-model="scope.row.sw"
|
v-model="scope.row.sw"
|
||||||
active-text="开启"
|
active-text="开闸"
|
||||||
inactive-text="关闭"
|
inactive-text="合闸"
|
||||||
:disabled="!updateGenTable"
|
:disabled="!updateGenTable"
|
||||||
:active-value="1"
|
:active-value="1"
|
||||||
:inactive-value="0"
|
:inactive-value="0"
|
||||||
|
@ -153,6 +163,8 @@
|
||||||
type="datetime"
|
type="datetime"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
default-time="12:00:00"
|
default-time="12:00:00"
|
||||||
|
:clearable="false"
|
||||||
|
size="small"
|
||||||
>
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -161,7 +173,7 @@
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.mode"
|
v-model="form.mode"
|
||||||
placeholder="请选择周期"
|
placeholder="请选择周期"
|
||||||
clearable
|
:clearable="false"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -210,37 +222,24 @@ export default {
|
||||||
list: [],
|
list: [],
|
||||||
alarmParamOption: [],
|
alarmParamOption: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
updateGenTable: false,
|
updateGenTable: true,
|
||||||
title: "修改",
|
title: "修改",
|
||||||
open: false,
|
open: false,
|
||||||
form: {},
|
form: {},
|
||||||
pointTime: "",
|
pointTime: "",
|
||||||
updateIndex: null,
|
updateIndex: null,
|
||||||
|
monthTradingTableHeight: 'auto',
|
||||||
isAck: false,
|
isAck: false,
|
||||||
disabledAck: false,
|
disabledAck: false,
|
||||||
uvpList: ["ul_cfg"],
|
uvpList: ["ul_cfg"],
|
||||||
rules: {
|
rules: {
|
||||||
warnValueMin: [
|
point: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
validator: this.warnValueMin,
|
validator: this.warnValueMin,
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
alarmValue: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
validator: this.alarmValue,
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
warnValueMax: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
validator: this.warnValueMax,
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -256,6 +255,12 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
warnValueMin(rule, value, callback) {
|
||||||
|
if (!this.pointTime) {
|
||||||
|
callback(new Error("开始时间不能为空!"));
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row, index) {
|
handleDelete(row, index) {
|
||||||
this.$confirm("是否删除该数据", "警告", {
|
this.$confirm("是否删除该数据", "警告", {
|
||||||
|
@ -267,12 +272,14 @@ export default {
|
||||||
list = list.map((v, idx) => {
|
list = list.map((v, idx) => {
|
||||||
return Object.assign(v, {num: ++idx})
|
return Object.assign(v, {num: ++idx})
|
||||||
})
|
})
|
||||||
this.sendSumbit(list);
|
// this.sendSumbit(list);
|
||||||
|
this.list = list;
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSendAck() {
|
handleSendAck() {
|
||||||
var deviceId = this.deviceId;
|
var deviceId = this.deviceId;
|
||||||
|
var list = [...this.list];
|
||||||
this.$prompt("请输入登录密码", "提示", {
|
this.$prompt("请输入登录密码", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
|
@ -281,7 +288,9 @@ export default {
|
||||||
inputErrorMessage: "登录密码不能为空",
|
inputErrorMessage: "登录密码不能为空",
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
let params = {
|
let params = {
|
||||||
data: {},
|
data: {
|
||||||
|
params: list
|
||||||
|
},
|
||||||
deviceId: deviceId,
|
deviceId: deviceId,
|
||||||
verifyKey: value,
|
verifyKey: value,
|
||||||
};
|
};
|
||||||
|
@ -328,7 +337,8 @@ export default {
|
||||||
list = list.concat([this.form]);
|
list = list.concat([this.form]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendSumbit(list);
|
this.open = false;
|
||||||
|
this.$forceUpdate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -368,6 +378,7 @@ export default {
|
||||||
getDeviceTimingConfig(this.deviceKey)
|
getDeviceTimingConfig(this.deviceKey)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.list = response.data;
|
this.list = response.data;
|
||||||
|
this.monthTradingTableHeight = this.list.length >= 5 ? '290px' : 'auto'
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
Loading…
Reference in New Issue