2022-06-08 14:51:11 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 设备管理 -->
|
|
|
|
|
|
<div class="devManage">
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-form :inline="true" size="medium" class="demo-form-inline whiteBlock" style="padding: 15px 0 15px 18px">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-form-item style="margin: 0">
|
|
|
|
|
|
<!-- 新增设备 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-button type="primary" @click="addDevice">{{ $t('message.devManage.addDev') }}</el-button>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<div style="height: 12px; background: #f3f5fd; width: 100%"></div>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-table ref="multipleTable" :data="devListData" style="width: 100%" class="tables">
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<!-- 设备名称 设备编号 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-table-column align="center" prop="devName" :label="$t('message.devManage.devName')"></el-table-column>
|
|
|
|
|
|
<el-table-column align="center" prop="devSn" label="设备id"></el-table-column>
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<!-- 监控点位数(个) -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-table-column align="center" prop="pointNum" :label="$t('message.devManage.montorLocation')"></el-table-column>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<!-- 操作 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-table-column :label="$t('message.safeMangeCheck.operate')" align="center">
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<template slot-scope="scope">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<div class="flex">
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<div @click="showPlanConfig(scope.row)" class="operationText">
|
|
|
|
|
|
<img src="@/assets/images/icon-edit.png" width="15px" height="15px" />
|
|
|
|
|
|
<!-- 编辑 -->
|
|
|
|
|
|
<span>测点分布</span>
|
|
|
|
|
|
</div>
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<div @click="editDevInfo(scope.row)" class="operationText">
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<img src="@/assets/images/icon-edit.png" width="15px" height="15px" />
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<!-- 编辑 -->
|
|
|
|
|
|
<span>{{ $t('message.safeMangeCheck.edit') }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div @click="deteleDev(scope.row)" class="operationText">
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<img src="@/assets/images/icon-delete.png" width="15px" height="15px" />
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<!-- 删除 -->
|
|
|
|
|
|
<span>{{ $t('message.safeMangeCheck.delete') }}</span>
|
|
|
|
|
|
</div>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
|
class="pagerBox"
|
|
|
|
|
|
style="margin-top: 10px"
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
|
:current-page="page"
|
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
|
layout="total, sizes, prev, pager, next"
|
2022-12-14 18:31:34 +08:00
|
|
|
|
:total="Number(total)"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
background
|
|
|
|
|
|
></el-pagination>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 新增 编辑 弹窗 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-dialog :modal-append-to-body="false" :title="dialogTitle" :close-on-click-modal="false" :visible.sync="devFormDialog" width="860px">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<div class="dialog_content" style="height: 600px">
|
|
|
|
|
|
<vue-scroll style="height: 88%">
|
|
|
|
|
|
<!-- 基本信息 -->
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<div class="title">{{ '·' + $t('message.devManage.baseInfo') }}</div>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-form size="small" ref="devForm" :model="devForm" label-width="130px" :inline="true" class="devFormBox">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<!-- 设备ID -->
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
prop="devSn"
|
|
|
|
|
|
:label="$t('message.devManage.deviceId')"
|
|
|
|
|
|
:rules="[
|
2023-03-14 13:44:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: $t('message.safeManage.placeholder'),
|
2024-02-03 17:55:26 +08:00
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="devForm.devSn"
|
|
|
|
|
|
style="width: 215px"
|
|
|
|
|
|
:placeholder="$t('message.safeManage.placeholder')"
|
|
|
|
|
|
:disabled="dialogType == 2"
|
2023-07-04 21:16:23 +08:00
|
|
|
|
onKeyUp="value=value.replace(/[\W]/g,'')"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<!-- 设备名称 -->
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
prop="devName"
|
|
|
|
|
|
:label="$t('message.devManage.devName')"
|
|
|
|
|
|
:rules="[
|
2023-03-14 13:44:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: $t('message.safeManage.placeholder'),
|
2024-02-03 17:55:26 +08:00
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-input v-model="devForm.devName" style="width: 215px" :placeholder="$t('message.safeManage.placeholder')"></el-input>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<!-- 紧急报警推送人 -->
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
prop="urgentAlarmPushWorkerId"
|
|
|
|
|
|
:label="$t('message.devManage.emergencyAlarmPusher')"
|
|
|
|
|
|
:rules="[
|
2023-03-14 13:44:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: $t('message.safeMangeCheck.pleaseChoose'),
|
2024-02-03 17:55:26 +08:00
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="devForm.urgentAlarmPushWorkerId"
|
|
|
|
|
|
:placeholder="$t('message.laborMange.pleaseChoose')"
|
|
|
|
|
|
@change="changeWorkerType"
|
|
|
|
|
|
multiple
|
|
|
|
|
|
collapse-tags
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-option v-for="item in workerInfoList" :key="item.userId" :label="item.workerName" :value="item.userId"></el-option>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<!-- 重要报警推送人 -->
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
prop="importantAlarmPushWorkerId"
|
|
|
|
|
|
:label="$t('message.devManage.imporentAlarmPusher')"
|
|
|
|
|
|
:rules="[
|
2023-03-14 13:44:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: $t('message.safeMangeCheck.pleaseChoose'),
|
2024-02-03 17:55:26 +08:00
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
multiple
|
|
|
|
|
|
collapse-tags
|
|
|
|
|
|
v-model="devForm.importantAlarmPushWorkerId"
|
|
|
|
|
|
:placeholder="$t('message.laborMange.pleaseChoose')"
|
|
|
|
|
|
@change="changeWorkerType"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-option v-for="item in workerInfoList" :key="item.userId" :label="item.workerName" :value="item.userId"></el-option>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<!-- 次要报警推送人 -->
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
prop="secondaryAlarmPushWorkerId"
|
|
|
|
|
|
:label="$t('message.devManage.minorAlarmPusher')"
|
|
|
|
|
|
:rules="[
|
2023-03-14 13:44:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: $t('message.safeMangeCheck.pleaseChoose'),
|
2024-02-03 17:55:26 +08:00
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
multiple
|
|
|
|
|
|
collapse-tags
|
|
|
|
|
|
v-model="devForm.secondaryAlarmPushWorkerId"
|
|
|
|
|
|
:placeholder="$t('message.laborMange.pleaseChoose')"
|
|
|
|
|
|
@change="changeWorkerType"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-option v-for="item in workerInfoList" :key="item.userId" :label="item.workerName" :value="item.userId"></el-option>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<!-- 提示报警推送人 -->
|
|
|
|
|
|
<el-form-item
|
|
|
|
|
|
prop="promptAlarmPushWorkerId"
|
|
|
|
|
|
:label="$t('message.devManage.tipAlarmPusher')"
|
|
|
|
|
|
:rules="[
|
2023-03-14 13:44:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: $t('message.safeMangeCheck.pleaseChoose'),
|
2024-02-03 17:55:26 +08:00
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
multiple
|
|
|
|
|
|
collapse-tags
|
|
|
|
|
|
v-model="devForm.promptAlarmPushWorkerId"
|
|
|
|
|
|
:placeholder="$t('message.laborMange.pleaseChoose')"
|
|
|
|
|
|
@change="changeWorkerType"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-option v-for="item in workerInfoList" :key="item.userId" :label="item.workerName" :value="item.userId"></el-option>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<!-- ·监测点信息 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-row class="title">{{ '·' + $t('message.devManage.montorInfo') }}</el-row>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
<!-- 监测点位数量 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-form-item :label="$t('message.devManage.montorLocationNum')" prop="teamId">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="devForm.pointNum"
|
|
|
|
|
|
:placeholder="$t('message.laborMange.pleaseChoose')"
|
|
|
|
|
|
@change="changePointsNumber"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
:disabled="dialogType == 2"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option label="8" :value="8"></el-option>
|
|
|
|
|
|
<el-option label="16" :value="16"></el-option>
|
|
|
|
|
|
<el-option label="32" :value="32"></el-option>
|
|
|
|
|
|
<el-option label="64" :value="64"></el-option>
|
|
|
|
|
|
<el-option label="128" :value="128"></el-option>
|
|
|
|
|
|
<el-option label="256" :value="256"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-row :gutter="24" v-for="(item, index) in devForm.pointList" :key="index">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-col :span="3">
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-form-item prop="teamId"> {{ $t('message.devManage.serialNum') + ':' }}{{ item.pointNo }} </el-form-item>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
|
<!-- 监测点名称 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-form-item :label="$t('message.devManage.montorName')" prop="teamId">
|
|
|
|
|
|
<el-input v-model="item.pointName" style="width: 160px" :placeholder="$t('message.safeManage.placeholder')" />
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
|
<!-- 温度报警阈值 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-form-item :label="$t('message.devManage.temperatureAlarm')" prop="teamId">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-input
|
2023-10-13 17:51:24 +08:00
|
|
|
|
type="number"
|
|
|
|
|
|
oninput="if(value.length>5)value=value.slice(0,5)"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
v-model="item.temperatureThreshold"
|
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
|
:placeholder="$t('message.safeManage.placeholder')"
|
|
|
|
|
|
/>℃
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</vue-scroll>
|
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
|
<!-- 确认 取消 -->
|
2024-02-03 17:55:26 +08:00
|
|
|
|
<el-button class="cancleBtn" icon="el-icon-circle-close" size="medium" @click="cancleBtn('devForm')">{{
|
|
|
|
|
|
$t('message.safeMangeCheck.dialog.cancel')
|
|
|
|
|
|
}}</el-button>
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-circle-check" size="medium" @click="submitForm('devForm')">{{
|
|
|
|
|
|
$t('message.safeMangeCheck.dialog.confirm')
|
|
|
|
|
|
}}</el-button>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
2024-02-03 17:55:26 +08:00
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
v-if="showDialog"
|
|
|
|
|
|
:modal-append-to-body="false"
|
|
|
|
|
|
title="测点分布"
|
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
|
:visible.sync="showDialog"
|
|
|
|
|
|
width="1300px"
|
|
|
|
|
|
style="height: 900px"
|
|
|
|
|
|
:destroy-on-close="true"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="formDialog">
|
|
|
|
|
|
<formDialog :pointConfig="pointConfig"> </formDialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
addConcreteMonitorDevApi,
|
|
|
|
|
|
getConcreteMonitorDevListApi,
|
|
|
|
|
|
getDevDetailApi,
|
|
|
|
|
|
editConcreteMonitorDevApi,
|
2023-03-14 13:44:11 +08:00
|
|
|
|
deleteConcreteMonitorDevApi
|
|
|
|
|
|
} from '@/assets/js/api/concreteMonitoring.js'
|
2024-02-03 17:55:26 +08:00
|
|
|
|
import formDialog from '@/views/projectFront/concreteMonitoring/planConfig.vue'
|
|
|
|
|
|
|
2023-03-14 13:44:11 +08:00
|
|
|
|
import { getProjectChilderSystemUserListApi } from '@/assets/js/api/configManage'
|
2022-06-08 14:51:11 +08:00
|
|
|
|
export default {
|
2024-02-03 17:55:26 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
formDialog
|
|
|
|
|
|
},
|
2022-06-08 14:51:11 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2024-02-03 17:55:26 +08:00
|
|
|
|
pointConfig: [],
|
|
|
|
|
|
showDialog: false,
|
2023-03-14 13:44:11 +08:00
|
|
|
|
projectSn: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
page: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
devListData: [],
|
|
|
|
|
|
devFormDialog: false,
|
2023-03-14 13:44:11 +08:00
|
|
|
|
dialogTitle: this.$t('message.devManage.addDev'),
|
2022-06-08 14:51:11 +08:00
|
|
|
|
dialogType: 1,
|
|
|
|
|
|
workerInfoList: [], //推送人员列表
|
|
|
|
|
|
devForm: {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
devName: '',
|
|
|
|
|
|
devSn: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
pointNum: 8,
|
|
|
|
|
|
pointList: [],
|
|
|
|
|
|
importantAlarmPushWorkerId: [],
|
|
|
|
|
|
promptAlarmPushWorkerId: [],
|
|
|
|
|
|
secondaryAlarmPushWorkerId: [],
|
2023-03-14 13:44:11 +08:00
|
|
|
|
urgentAlarmPushWorkerId: []
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
created() {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.projectSn = this.$store.state.projectSn
|
|
|
|
|
|
this.getDevList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
2024-02-03 17:55:26 +08:00
|
|
|
|
// 打开测点分布弹窗
|
|
|
|
|
|
showPlanConfig(item) {
|
|
|
|
|
|
this.showDialog = true
|
|
|
|
|
|
this.pointConfig = item.devSn
|
|
|
|
|
|
},
|
2022-06-08 14:51:11 +08:00
|
|
|
|
//获取设备列表
|
|
|
|
|
|
getDevList() {
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
projectSn: this.projectSn,
|
|
|
|
|
|
pageNo: this.pageNo,
|
2023-03-14 13:44:11 +08:00
|
|
|
|
pageSize: this.pageSize
|
|
|
|
|
|
}
|
2024-02-03 17:55:26 +08:00
|
|
|
|
getConcreteMonitorDevListApi(data).then(res => {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (res.code == 200) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.devListData = res.result.records
|
|
|
|
|
|
this.total = res.result.total
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//新增设备
|
|
|
|
|
|
addDevice() {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.devFormDialog = true
|
|
|
|
|
|
this.dialogTitle = this.$t('message.devManage.addDev')
|
|
|
|
|
|
this.dialogType = 1
|
|
|
|
|
|
this.devForm.pointList = []
|
2022-06-08 14:51:11 +08:00
|
|
|
|
this.devForm = {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
devName: '',
|
|
|
|
|
|
devSn: '',
|
2022-06-08 14:51:11 +08:00
|
|
|
|
pointNum: 8,
|
|
|
|
|
|
pointList: [],
|
|
|
|
|
|
importantAlarmPushWorkerId: [],
|
|
|
|
|
|
promptAlarmPushWorkerId: [],
|
|
|
|
|
|
secondaryAlarmPushWorkerId: [],
|
2023-03-14 13:44:11 +08:00
|
|
|
|
urgentAlarmPushWorkerId: []
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
//渲染点位
|
|
|
|
|
|
for (let i = 0; i < this.devForm.pointNum; i++) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
let obj = { pointName: '', pointNo: i + 1, temperatureThreshold: '' }
|
|
|
|
|
|
this.devForm.pointList.push(obj)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
//获取通知人
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.getNotifierList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//切换监控点数量
|
|
|
|
|
|
changePointsNumber(val) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.devForm.pointNum = val
|
|
|
|
|
|
this.devForm.pointList = []
|
2022-06-08 14:51:11 +08:00
|
|
|
|
for (let i = 0; i < val; i++) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
let obj = { pointName: '', pointNo: i + 1, temperatureThreshold: '' }
|
|
|
|
|
|
this.devForm.pointList.push(obj)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (i == val - 1) {
|
|
|
|
|
|
this.$message.success({
|
|
|
|
|
|
// 切换点位数量成功
|
2023-03-14 13:44:11 +08:00
|
|
|
|
message: this.$t('message.devManage.numChangeSuccess')
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
//获取通知人员列表
|
|
|
|
|
|
getNotifierList() {
|
|
|
|
|
|
let data = {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
projectSn: this.projectSn
|
|
|
|
|
|
}
|
2024-02-03 17:55:26 +08:00
|
|
|
|
getProjectChilderSystemUserListApi(data).then(res => {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.workerInfoList = res.result
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//保存
|
|
|
|
|
|
submitForm(formName) {
|
2024-02-03 17:55:26 +08:00
|
|
|
|
this.$refs[formName].validate(valid => {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (valid) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
let data = JSON.parse(JSON.stringify(this.devForm))
|
2024-02-03 17:55:26 +08:00
|
|
|
|
data.importantAlarmPushWorkerId = data.importantAlarmPushWorkerId.join(',')
|
2023-03-14 13:44:11 +08:00
|
|
|
|
data.promptAlarmPushWorkerId = data.promptAlarmPushWorkerId.join(',')
|
2024-02-03 17:55:26 +08:00
|
|
|
|
data.secondaryAlarmPushWorkerId = data.secondaryAlarmPushWorkerId.join(',')
|
2023-03-14 13:44:11 +08:00
|
|
|
|
data.urgentAlarmPushWorkerId = data.urgentAlarmPushWorkerId.join(',')
|
|
|
|
|
|
data.projectSn = this.projectSn
|
2022-06-08 14:51:11 +08:00
|
|
|
|
//新增
|
|
|
|
|
|
if (this.dialogType == 1) {
|
2024-02-03 17:55:26 +08:00
|
|
|
|
addConcreteMonitorDevApi(data).then(res => {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
// 保存成功
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.$message.success(this.$t('message.devManage.saveSuccess'))
|
|
|
|
|
|
this.devFormDialog = false
|
|
|
|
|
|
this.$refs[formName].resetFields()
|
|
|
|
|
|
this.getDevList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
} else {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.$message.success(res.message)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
//编辑
|
2024-02-03 17:55:26 +08:00
|
|
|
|
editConcreteMonitorDevApi(data).then(res => {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (res.code == 200) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.$message.success(this.$t('message.devManage.editSuccess'))
|
|
|
|
|
|
this.devFormDialog = false
|
|
|
|
|
|
this.$refs[formName].resetFields()
|
|
|
|
|
|
this.getDevList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
} else {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.$message.success(res.message)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
return false
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//取消按钮
|
|
|
|
|
|
cancleBtn(formName) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.$refs[formName].resetFields()
|
|
|
|
|
|
this.devFormDialog = false
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//删除按钮
|
|
|
|
|
|
deteleDev(val) {
|
2024-02-03 17:55:26 +08:00
|
|
|
|
this.$confirm(this.$t('message.devManage.tipText') + '?', this.$t('message.devManage.tip'), {
|
|
|
|
|
|
confirmButtonText: this.$t('message.safeMangeCheck.dialog.confirm'),
|
|
|
|
|
|
cancelButtonText: this.$t('message.safeMangeCheck.dialog.cancel'),
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
.then(() => {
|
|
|
|
|
|
let data = {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
id: val.id
|
|
|
|
|
|
}
|
2024-02-03 17:55:26 +08:00
|
|
|
|
deleteConcreteMonitorDevApi(data).then(res => {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.$message({
|
2023-03-14 13:44:11 +08:00
|
|
|
|
type: 'success',
|
|
|
|
|
|
message: this.$t('message.devManage.deleteSuccess') + '!'
|
|
|
|
|
|
})
|
|
|
|
|
|
this.getDevList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
} else {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.$message.error(res.message)
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
this.$message({
|
2023-03-14 13:44:11 +08:00
|
|
|
|
type: 'info',
|
|
|
|
|
|
message: this.$t('message.devManage.cancelDeleteSuccess') + '!'
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//编辑设备
|
|
|
|
|
|
editDevInfo(val) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.dialogTitle = this.$t('message.devManage.editDev')
|
|
|
|
|
|
this.dialogType = 2
|
|
|
|
|
|
this.getNotifierList()
|
|
|
|
|
|
this.getDevDetail(val.id)
|
|
|
|
|
|
this.devFormDialog = true
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//获取单个设备详情
|
|
|
|
|
|
getDevDetail(id) {
|
|
|
|
|
|
let data = {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
id
|
|
|
|
|
|
}
|
2024-02-03 17:55:26 +08:00
|
|
|
|
getDevDetailApi(data).then(res => {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
let val = res.result
|
2022-06-08 14:51:11 +08:00
|
|
|
|
this.devForm = {
|
|
|
|
|
|
devName: val.devName,
|
|
|
|
|
|
devSn: val.devSn,
|
|
|
|
|
|
pointNum: val.pointNum,
|
|
|
|
|
|
pointList: val.pointList,
|
2023-03-14 13:44:11 +08:00
|
|
|
|
importantAlarmPushWorkerId: val.importantAlarmPushWorkerId.split(','),
|
|
|
|
|
|
promptAlarmPushWorkerId: val.promptAlarmPushWorkerId.split(','),
|
|
|
|
|
|
secondaryAlarmPushWorkerId: val.secondaryAlarmPushWorkerId.split(','),
|
|
|
|
|
|
urgentAlarmPushWorkerId: val.urgentAlarmPushWorkerId.split(','),
|
|
|
|
|
|
id: id
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//切换条数
|
|
|
|
|
|
handleSizeChange(e) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.pageSize = e
|
|
|
|
|
|
this.getDevList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
//切换分页
|
|
|
|
|
|
handleCurrentChange(e) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
this.page = e
|
|
|
|
|
|
this.getDevList()
|
2022-06-08 14:51:11 +08:00
|
|
|
|
},
|
2024-02-03 17:55:26 +08:00
|
|
|
|
changeWorkerType() {}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
2023-03-14 13:44:11 +08:00
|
|
|
|
.flex {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2023-10-13 17:51:24 +08:00
|
|
|
|
margin-left: 155px;
|
2022-06-08 14:51:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
.title {
|
|
|
|
|
|
margin: 14px 0;
|
|
|
|
|
|
font-weight: 900;
|
|
|
|
|
|
}
|
|
|
|
|
|
.devManage {
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
.operationText {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
margin-right: 30px;
|
|
|
|
|
|
}
|
2023-03-14 13:44:11 +08:00
|
|
|
|
.devFormBox {
|
|
|
|
|
|
/deep/.el-select {
|
|
|
|
|
|
.el-input {
|
2022-06-08 14:51:11 +08:00
|
|
|
|
width: 215px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-02-03 17:55:26 +08:00
|
|
|
|
</style>
|