|
@@ -4,6 +4,7 @@
|
|
<div class="filter-container mb-20">
|
|
<div class="filter-container mb-20">
|
|
<a class="">【测试站点1】站点的所有监控设备</a>
|
|
<a class="">【测试站点1】站点的所有监控设备</a>
|
|
<!-- <el-button icon="el-icon-plus" type="success" @click="addItem()">新增</el-button > -->
|
|
<!-- <el-button icon="el-icon-plus" type="success" @click="addItem()">新增</el-button > -->
|
|
|
|
+
|
|
<div>
|
|
<div>
|
|
<el-button type="primary">导入</el-button>
|
|
<el-button type="primary">导入</el-button>
|
|
<el-button type="primary">导出</el-button>
|
|
<el-button type="primary">导出</el-button>
|
|
@@ -13,73 +14,121 @@
|
|
|
|
|
|
<!-- 表格start -->
|
|
<!-- 表格start -->
|
|
<el-table :data="tableData" border stripe :header-cell-style="headClass">
|
|
<el-table :data="tableData" border stripe :header-cell-style="headClass">
|
|
- <el-table-column
|
|
|
|
- fixed
|
|
|
|
- prop="watchStatus"
|
|
|
|
- label="状态"
|
|
|
|
- width="50"
|
|
|
|
- align="center"
|
|
|
|
- >
|
|
|
|
- <template #default>
|
|
|
|
- <el-avatar class="status"></el-avatar>
|
|
|
|
|
|
+ <el-table-column prop="status" align="center" label="状态" width="50">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-avatar
|
|
|
|
+ class="status"
|
|
|
|
+ :style="
|
|
|
|
+ scope.row.status == 0
|
|
|
|
+ ? 'background-color:red'
|
|
|
|
+ : 'background-color:#04F21C'
|
|
|
|
+ "
|
|
|
|
+ ></el-avatar>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="watchName" label="名称" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="watchCode" label="编号" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="ratedVoltage" label="额定电压" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="ratedCurrent" label="额定电流" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="fzlMx" label="电流负载率门限" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="powerAnalysis" label="电能质量分析" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="watchAddress" label="表计地址" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column fixed="right" label="操作" width="180">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="monitorDeviceName"
|
|
|
|
+ label="监控设备名称"
|
|
|
|
+ align="center"
|
|
|
|
+ width="200px"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="monitorDeviceCode"
|
|
|
|
+ label="监控设备编号"
|
|
|
|
+ align="center"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="loopMeterAddress"
|
|
|
|
+ label="回路表计地址"
|
|
|
|
+ align="center"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="ratedVoltage"
|
|
|
|
+ label="额定电压"
|
|
|
|
+ align="center"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="ratedCurrent"
|
|
|
|
+ label="额定电流"
|
|
|
|
+ align="center"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="currentLoadRate"
|
|
|
|
+ label="电流负载率门限"
|
|
|
|
+ align="center"
|
|
|
|
+ width="150"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="qualityAnalysis"
|
|
|
|
+ label="电能质量分析"
|
|
|
|
+ align="center"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column fixed="right" label="操作" width="140">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
size="small"
|
|
size="small"
|
|
@click.prevent="editRow(scope.row)"
|
|
@click.prevent="editRow(scope.row)"
|
|
- >编辑</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
|
- type="text"
|
|
|
|
- size="small"
|
|
|
|
- class="delete-text"
|
|
|
|
- >删除</el-button
|
|
|
|
>
|
|
>
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-popconfirm
|
|
|
|
+ confirm-button-text="是"
|
|
|
|
+ cancel-button-text="否"
|
|
|
|
+ icon="el-icon-info"
|
|
|
|
+ icon-color="red"
|
|
|
|
+ title="确定删除?"
|
|
|
|
+ @confirm="handleDelete(scope.row)"
|
|
|
|
+ @cancel="cancelEvent"
|
|
|
|
+ >
|
|
|
|
+ <template #reference>
|
|
|
|
+ <el-button type="text" size="small" class="delete-text">
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-popconfirm>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column fixed="right" label="变量" width="180">
|
|
|
|
- <template #default="scope">
|
|
|
|
|
|
+ <el-table-column fixed="right" label="变量" width="100">
|
|
|
|
+ <template #default>
|
|
<el-button type="text" size="small" @click="goVariableList">
|
|
<el-button type="text" size="small" @click="goVariableList">
|
|
变量列表
|
|
变量列表
|
|
</el-button>
|
|
</el-button>
|
|
- <!--
|
|
|
|
- <router-link style="margin-right:15px;" :to="{ path:'variableList'}">
|
|
|
|
- 变量列表
|
|
|
|
- </router-link> -->
|
|
|
|
- <el-button @click="cloneDialog(scope.row)" type="text" size="small"
|
|
|
|
|
|
+ <!-- <el-button @click="cloneDialog(scope.row)" type="text" size="small"
|
|
>克隆</el-button
|
|
>克隆</el-button
|
|
- >
|
|
|
|
|
|
+ > -->
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<!-- 表格end -->
|
|
<!-- 表格end -->
|
|
|
|
|
|
|
|
+ <!-- 分页start -->
|
|
|
|
+ <div class="paginationBlock">
|
|
|
|
+ <el-pagination
|
|
|
|
+ v-model:currentPage="currentPage"
|
|
|
|
+ :page-sizes="[15, 20, 25, 30]"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="total"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ background
|
|
|
|
+ ></el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 分页end -->
|
|
|
|
+
|
|
<!--弹框组件开始-----------------------start-->
|
|
<!--弹框组件开始-----------------------start-->
|
|
<dialog-component
|
|
<dialog-component
|
|
- v-if="showDialog"
|
|
|
|
- ref="dialogComponent"
|
|
|
|
- :dialog-title="dialogTitle"
|
|
|
|
- :item-info="tableItem"
|
|
|
|
|
|
+ :dialogTitle="dialogTitle"
|
|
|
|
+ :itemInfo="tableItem"
|
|
@closeDialog="closeDialog"
|
|
@closeDialog="closeDialog"
|
|
|
|
+ :flag="showDialog"
|
|
></dialog-component>
|
|
></dialog-component>
|
|
<!--弹框组件开始-----------------------end-->
|
|
<!--弹框组件开始-----------------------end-->
|
|
|
|
|
|
@@ -96,169 +145,162 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import DialogComponent from "./dialogComponent";
|
|
|
|
-import Clone from "./clone";
|
|
|
|
|
|
+import { defineComponent, ref, reactive, onMounted } from 'vue'
|
|
|
|
+import * as api from '@/api/siteManage/watchDog.js'
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
+
|
|
|
|
+import DialogComponent from './dialogComponent'
|
|
|
|
+import Clone from './clone'
|
|
|
|
|
|
-export default {
|
|
|
|
- name: "WatchDog",
|
|
|
|
- props: ['activeName'],
|
|
|
|
|
|
+export default defineComponent({
|
|
components: { DialogComponent, Clone },
|
|
components: { DialogComponent, Clone },
|
|
|
|
+ setup(props, { emit }) {
|
|
|
|
+ const total = ref(0)
|
|
|
|
+ const pageSize = ref(15)
|
|
|
|
+ const currentPage = ref(1)
|
|
|
|
+ const goSiteListParam = ref('')
|
|
|
|
+ const platformAreaName = ref('')
|
|
|
|
+ const pageShow = ref(false)
|
|
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- showDialog: false,
|
|
|
|
|
|
+ const showDialog = ref(false)
|
|
|
|
+ const tableData = ref([])
|
|
|
|
|
|
- input: "请输入状态",
|
|
|
|
- tableData: [
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- ratedVoltage: "10KV",
|
|
|
|
- watchName: "测试设备1",
|
|
|
|
- watchCode: "cssb1",
|
|
|
|
- ratedCurrent: "58A",
|
|
|
|
- fzlMx: "80%",
|
|
|
|
- powerAnalysis: "开启",
|
|
|
|
- watchAddress: "1",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- // 表头样式设置
|
|
|
|
- goVariableList() {
|
|
|
|
- this.$emit('func')
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- headClass() {
|
|
|
|
- return "background:#FAFAFA;";
|
|
|
|
- },
|
|
|
|
|
|
+ function goSiteList(params) {
|
|
|
|
+ goSiteListParam.value = params.id
|
|
|
|
+ pageShow.value = !pageShow.value
|
|
|
|
+ }
|
|
|
|
+ const getMsgFormSon = () => {
|
|
|
|
+ pageShow.value = !pageShow.value
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const tableItem = reactive([])
|
|
|
|
+ const dialogTitle = ref('')
|
|
|
|
|
|
- // 克隆操作
|
|
|
|
- cloneDialog() {
|
|
|
|
- this.tableItem = {
|
|
|
|
- id: "",
|
|
|
|
- stationName: "",
|
|
|
|
- watchName: "",
|
|
|
|
- watchCode: "",
|
|
|
|
- siteList: [],
|
|
|
|
- done: "",
|
|
|
|
- guaZai: "",
|
|
|
|
- checked: true,
|
|
|
|
- resource: "",
|
|
|
|
- };
|
|
|
|
- this.dialogTitle = "变量克隆";
|
|
|
|
- this.showDialog = true;
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs["cloneDialog"].showDialog = true;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ //监控设备列表
|
|
|
|
+ function deviceNewsList() {
|
|
|
|
+ api
|
|
|
|
+ .deviceNewsList({
|
|
|
|
+ siteId: 1,
|
|
|
|
+ size: pageSize.value,
|
|
|
|
+ current: currentPage.value,
|
|
|
|
+ })
|
|
|
|
+ .then((requset) => {
|
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
|
+ tableData.value = requset.data.records
|
|
|
|
+ total.value = requset.data.total
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
// 添加操作
|
|
// 添加操作
|
|
- addItem() {
|
|
|
|
- this.tableItem = {
|
|
|
|
- id: "",
|
|
|
|
- stationName: "",
|
|
|
|
- watchName: "",
|
|
|
|
- watchCode: "",
|
|
|
|
- siteList: [],
|
|
|
|
- done: "",
|
|
|
|
- guaZai: "",
|
|
|
|
- checked: true,
|
|
|
|
- };
|
|
|
|
- this.dialogTitle = "新增";
|
|
|
|
- this.showDialog = true;
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs["dialogComponent"].showDialog = true;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ // const addItem = () => {
|
|
|
|
+ // tableItem.value = {
|
|
|
|
+ // platformAreaName: '',
|
|
|
|
+ // platformAreaCode: '',
|
|
|
|
+ // platformAreaAddress: '',
|
|
|
|
+ // }
|
|
|
|
+ // dialogTitle.value = '新增'
|
|
|
|
+ // showDialog.value = true
|
|
|
|
+ // }
|
|
|
|
+
|
|
// 编辑操作
|
|
// 编辑操作
|
|
- editRow(row) {
|
|
|
|
- console.log(row);
|
|
|
|
- this.tableItem = row;
|
|
|
|
- this.dialogTitle = "编辑";
|
|
|
|
- this.showDialog = true;
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs["dialogComponent"].showDialog = true;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 关闭操作
|
|
|
|
- closeDialog(flag) {
|
|
|
|
- if (flag) {
|
|
|
|
- // 重新刷新表格内容
|
|
|
|
- this.fetchData();
|
|
|
|
|
|
+ const editRow = (row) => {
|
|
|
|
+ tableItem.value = {
|
|
|
|
+ id: row.id,
|
|
|
|
+ monitorDeviceCode: row.monitorDeviceCode,
|
|
|
|
+ monitorDeviceName: row.monitorDeviceName,
|
|
|
|
+ loopMeterAddress: row.loopMeterAddress,
|
|
|
|
+ ratedVoltage: row.ratedVoltage,
|
|
|
|
+ ratedCurrent: row.ratedCurrent,
|
|
|
|
+ currentLoadRate: row.currentLoadRate,
|
|
|
|
+ siteId: row.siteId,
|
|
|
|
+ variableListId: row.variableListId,
|
|
|
|
+ qualityAnalysis: row.qualityAnalysis === '是' ? true : false,
|
|
}
|
|
}
|
|
- this.showDialog = false;
|
|
|
|
- },
|
|
|
|
|
|
+ dialogTitle.value = '编辑'
|
|
|
|
+ showDialog.value = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 关闭操作
|
|
|
|
+ const closeDialog = () => {
|
|
|
|
+ showDialog.value = false
|
|
|
|
+ deviceNewsList()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //删除 是否删除 ---- 是
|
|
|
|
+ const handleDelete = (row) => {
|
|
|
|
+ api.deviceNewsDel({ id: row.id }).then((requset) => {
|
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
|
+ ElMessage.success({
|
|
|
|
+ message: '删除成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ deviceNewsList()
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //是否删除 ---- 否
|
|
|
|
+ const cancelEvent = () => {
|
|
|
|
+ console.log('cancel!')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ deviceNewsList()
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ function goVariableList() {
|
|
|
|
+ emit('func')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 表头样式设置
|
|
|
|
+ const headClass = () => {
|
|
|
|
+ return 'background:#FAFAFA;'
|
|
|
|
+ }
|
|
|
|
+ const handleSizeChange = (val) => {
|
|
|
|
+ pageSize.value = val
|
|
|
|
+ deviceNewsList()
|
|
|
|
+ }
|
|
|
|
+ const handleCurrentChange = (val) => {
|
|
|
|
+ currentPage.value = val
|
|
|
|
+ deviceNewsList()
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ tableData,
|
|
|
|
+ showDialog,
|
|
|
|
+
|
|
|
|
+ platformAreaName,
|
|
|
|
+ pageShow,
|
|
|
|
+ dialogTitle,
|
|
|
|
+
|
|
|
|
+ props,
|
|
|
|
+ tableItem,
|
|
|
|
+ goSiteListParam,
|
|
|
|
+
|
|
|
|
+ total,
|
|
|
|
+ pageSize,
|
|
|
|
+ currentPage,
|
|
|
|
+
|
|
|
|
+ goVariableList,
|
|
|
|
|
|
- //删除操作
|
|
|
|
- handleDelete(index, row) {
|
|
|
|
- console.log(index, row);
|
|
|
|
- alert(index);
|
|
|
|
- },
|
|
|
|
|
|
+ deviceNewsList,
|
|
|
|
+ goSiteList,
|
|
|
|
+ getMsgFormSon,
|
|
|
|
+ headClass,
|
|
|
|
+ // addItem,
|
|
|
|
+ editRow,
|
|
|
|
+ closeDialog,
|
|
|
|
+ handleDelete,
|
|
|
|
+ cancelEvent,
|
|
|
|
+ handleSizeChange,
|
|
|
|
+ handleCurrentChange,
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-};
|
|
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|