2022-06-08 14:51:11 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 设备管理 -->
|
|
|
|
|
|
<div class="devManage">
|
|
|
|
|
|
<el-form
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
class="demo-form-inline whiteBlock"
|
|
|
|
|
|
style="padding: 15px 0 15px 18px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-form-item style="margin: 0">
|
|
|
|
|
|
<!-- 新增设备 -->
|
2023-03-14 13:44:11 +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>
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
ref="multipleTable"
|
|
|
|
|
|
:data="devListData"
|
2023-03-14 13:44:11 +08:00
|
|
|
|
style="width: 100%"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
class="tables"
|
|
|
|
|
|
>
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<!-- 设备名称 设备编号 -->
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
prop="devName"
|
|
|
|
|
|
:label="$t('message.devManage.devName')"
|
|
|
|
|
|
></el-table-column>
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
prop="devSn"
|
2023-08-08 10:21:04 +08:00
|
|
|
|
label="设备id"
|
2023-03-14 13:44:11 +08:00
|
|
|
|
></el-table-column>
|
|
|
|
|
|
<!-- 监控点位数(个) -->
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-table-column
|
|
|
|
|
|
prop="pointNum"
|
|
|
|
|
|
:label="$t('message.devManage.montorLocation')"
|
|
|
|
|
|
></el-table-column>
|
|
|
|
|
|
<!-- 操作 -->
|
|
|
|
|
|
<el-table-column :label="$t('message.safeMangeCheck.operate')">
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<template slot-scope="scope">
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<div class="flex">
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<div @click="editDevInfo(scope.row)" class="operationText">
|
|
|
|
|
|
<img
|
|
|
|
|
|
src="@/assets/images/icon-edit.png"
|
|
|
|
|
|
width="15px"
|
|
|
|
|
|
height="15px"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 编辑 -->
|
|
|
|
|
|
<span>{{ $t('message.safeMangeCheck.edit') }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div @click="deteleDev(scope.row)" class="operationText">
|
|
|
|
|
|
<img
|
|
|
|
|
|
src="@/assets/images/icon-delete.png"
|
|
|
|
|
|
width="15px"
|
|
|
|
|
|
height="15px"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 删除 -->
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 新增 编辑 弹窗 -->
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
|
:modal-append-to-body="false"
|
|
|
|
|
|
:title="dialogTitle"
|
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
|
:visible.sync="devFormDialog"
|
|
|
|
|
|
width="860px"
|
|
|
|
|
|
>
|
|
|
|
|
|
<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>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-form
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
ref="devForm"
|
|
|
|
|
|
:model="devForm"
|
|
|
|
|
|
label-width="130px"
|
2023-03-14 13:44:11 +08:00
|
|
|
|
: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'),
|
|
|
|
|
|
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'),
|
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
]"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="devForm.devName"
|
|
|
|
|
|
style="width: 215px"
|
|
|
|
|
|
:placeholder="$t('message.safeManage.placeholder')"
|
|
|
|
|
|
></el-input>
|
|
|
|
|
|
</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'),
|
|
|
|
|
|
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%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in workerInfoList"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:key="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
:label="item.workerName"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:value="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
></el-option>
|
|
|
|
|
|
</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'),
|
|
|
|
|
|
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%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in workerInfoList"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:key="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
:label="item.workerName"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:value="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
></el-option>
|
|
|
|
|
|
</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'),
|
|
|
|
|
|
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%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in workerInfoList"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:key="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
:label="item.workerName"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:value="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
></el-option>
|
|
|
|
|
|
</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'),
|
|
|
|
|
|
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%"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in workerInfoList"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:key="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
:label="item.workerName"
|
2023-08-18 18:46:24 +08:00
|
|
|
|
:value="item.userId"
|
2022-06-08 14:51:11 +08:00
|
|
|
|
></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<!-- ·监测点信息 -->
|
2023-03-14 13:44:11 +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">
|
|
|
|
|
|
<!-- 监测点位数量 -->
|
2023-03-14 13:44:11 +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>
|
|
|
|
|
|
<el-row
|
|
|
|
|
|
:gutter="24"
|
|
|
|
|
|
v-for="(item, index) in devForm.pointList"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-col :span="3">
|
|
|
|
|
|
<el-form-item prop="teamId">
|
2023-03-14 13:44:11 +08:00
|
|
|
|
{{ $t('message.devManage.serialNum') + ':'
|
|
|
|
|
|
}}{{ item.pointNo }}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="11">
|
|
|
|
|
|
<!-- 监测点名称 -->
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="$t('message.devManage.montorName')"
|
|
|
|
|
|
prop="teamId"
|
|
|
|
|
|
>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="item.pointName"
|
|
|
|
|
|
style="width: 160px"
|
|
|
|
|
|
:placeholder="$t('message.safeManage.placeholder')"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
|
<!-- 温度报警阈值 -->
|
2023-03-14 13:44:11 +08:00
|
|
|
|
<el-form-item
|
|
|
|
|
|
:label="$t('message.devManage.temperatureAlarm')"
|
|
|
|
|
|
prop="teamId"
|
|
|
|
|
|
>
|
2022-06-08 14:51:11 +08:00
|
|
|
|
<el-input
|
2023-07-19 09:02:56 +08:00
|
|
|
|
type="number"
|
2023-07-26 11:07:33 +08:00
|
|
|
|
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">
|
|
|
|
|
|
<!-- 确认 取消 -->
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
class="cancleBtn"
|
|
|
|
|
|
icon="el-icon-circle-close"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
@click="cancleBtn('devForm')"
|
2023-03-14 13:44:11 +08:00
|
|
|
|
>{{ $t('message.safeMangeCheck.dialog.cancel') }}</el-button
|
2022-06-08 14:51:11 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
icon="el-icon-circle-check"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
@click="submitForm('devForm')"
|
2023-03-14 13:44:11 +08:00
|
|
|
|
>{{ $t('message.safeMangeCheck.dialog.confirm') }}</el-button
|
2022-06-08 14:51:11 +08:00
|
|
|
|
>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
addConcreteMonitorDevApi,
|
|
|
|
|
|
getConcreteMonitorDevListApi,
|
|
|
|
|
|
getDevDetailApi,
|
|
|
|
|
|
editConcreteMonitorDevApi,
|
2023-03-14 13:44:11 +08:00
|
|
|
|
deleteConcreteMonitorDevApi
|
|
|
|
|
|
} from '@/assets/js/api/concreteMonitoring.js'
|
|
|
|
|
|
import { getProjectChilderSystemUserListApi } from '@/assets/js/api/configManage'
|
2022-06-08 14:51:11 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
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: {
|
|
|
|
|
|
//获取设备列表
|
|
|
|
|
|
getDevList() {
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
projectSn: this.projectSn,
|
|
|
|
|
|
pageNo: this.pageNo,
|
2023-03-14 13:44:11 +08:00
|
|
|
|
pageSize: this.pageSize
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
getConcreteMonitorDevListApi(data).then((res) => {
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +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) {
|
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2023-03-14 13:44:11 +08:00
|
|
|
|
let data = JSON.parse(JSON.stringify(this.devForm))
|
|
|
|
|
|
data.importantAlarmPushWorkerId =
|
|
|
|
|
|
data.importantAlarmPushWorkerId.join(',')
|
|
|
|
|
|
data.promptAlarmPushWorkerId = data.promptAlarmPushWorkerId.join(',')
|
|
|
|
|
|
data.secondaryAlarmPushWorkerId =
|
|
|
|
|
|
data.secondaryAlarmPushWorkerId.join(',')
|
|
|
|
|
|
data.urgentAlarmPushWorkerId = data.urgentAlarmPushWorkerId.join(',')
|
|
|
|
|
|
data.projectSn = this.projectSn
|
2022-06-08 14:51:11 +08:00
|
|
|
|
//新增
|
|
|
|
|
|
if (this.dialogType == 1) {
|
|
|
|
|
|
addConcreteMonitorDevApi(data).then((res) => {
|
|
|
|
|
|
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 {
|
|
|
|
|
|
//编辑
|
|
|
|
|
|
editConcreteMonitorDevApi(data).then((res) => {
|
|
|
|
|
|
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) {
|
2023-03-14 13:44:11 +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
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +08:00
|
|
|
|
deleteConcreteMonitorDevApi(data).then((res) => {
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
2022-06-08 14:51:11 +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
|
|
|
|
},
|
2023-03-14 13:44:11 +08:00
|
|
|
|
changeWorkerType() {}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
.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;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|