From 7c7bb25be48dd72c35ec2db20fe85add87aaacfe Mon Sep 17 00:00:00 2001
From: wally <18603454788@163.com>
Date: Thu, 18 Nov 2021 11:38:15 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=BF=9C=E5=8A=A8=E5=8F=82?=
=?UTF-8?q?=E6=95=B0=E3=80=81=E7=BD=91=E7=BB=9C=E5=8F=82=E6=95=B0=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E8=AE=B0=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/apis/index.js | 29 +++---
src/components/config/config-log-function.vue | 92 ++++++++++++++++++
src/components/config/config-log-network.vue | 93 +++++++++++++++++++
src/components/config/config-log.vue | 92 ------------------
.../config/device-select-and-status.vue | 14 +--
.../config/function-config-applied.vue | 77 +++++++++++++++
.../config/network-config-applied.vue | 65 +++++++++++++
.../config/status-and-last-time.vue | 2 +-
src/components/config/status-tag-pending.vue | 12 +++
src/components/device/device-create.vue | 24 +++--
src/components/overview/device-table.vue | 20 +++-
src/config/config.js | 7 ++
src/views/commands.vue | 23 ++++-
src/views/config.vue | 10 +-
src/views/device-edit.vue | 24 +++--
src/views/device-list.vue | 11 ++-
16 files changed, 444 insertions(+), 151 deletions(-)
create mode 100644 src/components/config/config-log-function.vue
create mode 100644 src/components/config/config-log-network.vue
delete mode 100644 src/components/config/config-log.vue
create mode 100644 src/components/config/function-config-applied.vue
create mode 100644 src/components/config/network-config-applied.vue
create mode 100644 src/components/config/status-tag-pending.vue
diff --git a/src/apis/index.js b/src/apis/index.js
index 753797c..10515ba 100644
--- a/src/apis/index.js
+++ b/src/apis/index.js
@@ -13,21 +13,7 @@ export const getToken = userId => http.get(`${users}/userId`, { params: { userId
export const getDevices = () => http.get(`${corrosion}/devices`);
// 查设备概览 数据统计
-// export const getDevicesCount = () => http.get(`${corrosion}/devices/count`);
-export const getDevicesCount = () => {
- return new Promise(resolve => {
- setTimeout(() => {
- resolve({
- total: 100,
- online: 90,
- offline: 10,
- fault: 10,
- warning: 15,
- normal: 65,
- });
- }, 100);
- });
-};
+export const getDevicesCount = () => http.get(`${corrosion}/devices/count`);
// 添加设备
export const createDevice = data => http.post(`${corrosion}/devices`, data);
@@ -35,11 +21,18 @@ export const createDevice = data => http.post(`${corrosion}/devices`, data);
// 获取设备列表 完整信息
export const getDevicesAll = (
params = {
+ paging: true,
deviceId: '',
page: 1,
size: 50,
+ sort: [
+ {
+ col: 'createdAt',
+ order: 'ASC',
+ },
+ ],
},
-) => http.get(`${corrosion}/devices/all`, { params });
+) => http.post(`${corrosion}/devices/all`, params);
// 更新设备
export const updateDevice = (deviceId, data) => http.put(`${corrosion}/devices/all/${deviceId}`, data);
@@ -50,13 +43,13 @@ export const deleteDevice = deviceId => http.delete(`${corrosion}/devices/all/${
// 获取月累计数据分析
export const getMonthsDate = params => http.get(`${corrosion}/statistics/months`, { params });
-// 获取网络配置参数
+// 获取网络配置参数 列表
export const getConfigNetwork = params => http.get(`${corrosion}/config/network`, { params });
// 获取网络配置参数 设备实时参数
export const getConfigAppliedNetwork = params => http.get(`${corrosion}/config-applied/network`, { params });
-// 获取功能配置参数
+// 获取功能配置参数 列表
export const getConfigFunction = params => http.get(`${corrosion}/config/function`, { params });
// 获取功能配置参数 设备实时参数
diff --git a/src/components/config/config-log-function.vue b/src/components/config/config-log-function.vue
new file mode 100644
index 0000000..c9d555d
--- /dev/null
+++ b/src/components/config/config-log-function.vue
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dayjs(+scope.row.settingTime).format('YYYY-MM-DD HH:mm:ss') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/config/config-log-network.vue b/src/components/config/config-log-network.vue
new file mode 100644
index 0000000..7c099e7
--- /dev/null
+++ b/src/components/config/config-log-network.vue
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dayjs(+scope.row.settingTime).format('YYYY-MM-DD HH:mm:ss') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/config/config-log.vue b/src/components/config/config-log.vue
deleted file mode 100644
index acec61c..0000000
--- a/src/components/config/config-log.vue
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
- 链路地址:{{ props.row.linkAddress }}
- 探头编号:{{ props.row.probNo }}
- 设备朝向:{{ props.row.deviceDirection }}
- 试样:{{ props.row.simple }}
- 安装位置:{{ props.row.installLocation }}
- sim1:{{ props.row.sim1 }}
- 与主站后台联调情况:{{ props.row.joint }}
- 维修记录:{{ props.row.operationRecord }}
- 备注:{{ props.row.remark }}
-
-
-
-
-
-
-
-
-
- {{ STATUS_COLOR[scope.row.status].text }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/config/device-select-and-status.vue b/src/components/config/device-select-and-status.vue
index 797b310..3e2c444 100644
--- a/src/components/config/device-select-and-status.vue
+++ b/src/components/config/device-select-and-status.vue
@@ -1,17 +1,12 @@
diff --git a/src/components/config/network-config-applied.vue b/src/components/config/network-config-applied.vue
new file mode 100644
index 0000000..183c611
--- /dev/null
+++ b/src/components/config/network-config-applied.vue
@@ -0,0 +1,65 @@
+
+
+
+ 上报IP地址1:
+ {{ data.ip1 }}
+
+
+ 上报端口号1:
+ {{ data.port1 }}
+
+
+ 上报IP地址2:
+ {{ data.ip2 }}
+
+
+ 上报端口号2:
+ {{ data.port2 }}
+
+
+ 上报IP地址3:
+ {{ data.ip3 }}
+
+
+ 上报端口号3:
+ {{ data.port3 }}
+
+
+ 上报IP地址4:
+ {{ data.ip4 }}
+
+
+ 上报端口号4:
+ {{ data.port4 }}
+
+
+ 备用ip地址:
+ {{ data.ipBackup }}
+
+
+ 备用端口号:
+ {{ data.portBackup }}
+
+
+ 用户名:
+ {{ data.account }}
+
+
+ 密码:
+ {{ data.password }}
+
+
+ APN:
+ {{ data.apn }}
+
+
+
+
+
+
+
+
diff --git a/src/components/config/status-and-last-time.vue b/src/components/config/status-and-last-time.vue
index 9136cff..47bd200 100644
--- a/src/components/config/status-and-last-time.vue
+++ b/src/components/config/status-and-last-time.vue
@@ -3,7 +3,7 @@
配置状态:{{ PEND_TYPE[settingStatus].text }}
- 最后配置时间:{{ dayjs(data.settingTime).format('YYYY-MM-DD HH:mm:ss') }}
+ 最后配置时间:{{ dayjs(settingTime).format('YYYY-MM-DD HH:mm:ss') }}
diff --git a/src/components/config/status-tag-pending.vue b/src/components/config/status-tag-pending.vue
new file mode 100644
index 0000000..d01c55e
--- /dev/null
+++ b/src/components/config/status-tag-pending.vue
@@ -0,0 +1,12 @@
+
+
+ {{ PEND_TYPE[type].text }}
+
+
+
+
diff --git a/src/components/device/device-create.vue b/src/components/device/device-create.vue
index 874d8d0..a4a5436 100644
--- a/src/components/device/device-create.vue
+++ b/src/components/device/device-create.vue
@@ -13,6 +13,14 @@
+
+
+
+ 大气腐蚀
+ 其他
+
+
+
@@ -101,19 +109,13 @@
-
-
-
-
-
-
-
+
@@ -121,6 +123,14 @@
+
+
+
+
+
+
+
+
提交
diff --git a/src/components/overview/device-table.vue b/src/components/overview/device-table.vue
index 2c02c2c..7d0be79 100644
--- a/src/components/overview/device-table.vue
+++ b/src/components/overview/device-table.vue
@@ -3,16 +3,26 @@
-
-
+
+
+ {{ dayjs(+scope.row.signupTime).format('YYYY-MM-DD HH:mm:ss') }}
+
+
+
+
+ {{ dayjs(+scope.row.lastUploadTime).format('YYYY-MM-DD HH:mm:ss') }}
+
+
- {{ STATUS_COLOR[scope.row.status].text }}
+
+ {{ STATUS_COLOR[scope.row.status].text }}
+
- {{ scope.row.type }}
+ {{ ASDU_TYPE[scope.row.type].text }}
@@ -40,8 +50,10 @@
diff --git a/src/views/config.vue b/src/views/config.vue
index a415904..7be3d00 100644
--- a/src/views/config.vue
+++ b/src/views/config.vue
@@ -9,8 +9,11 @@
-
-
+
+
+
+
+
@@ -20,7 +23,8 @@ import { ref } from 'vue';
import DeviceSelectAndStatus from 'components/config/device-select-and-status.vue';
import FunctionConfigPending from 'components/config/function-config-pending.vue';
import NetworkConfigPending from 'components/config/network-config-pending.vue';
-import ConfigLog from 'components/config/config-log.vue';
+import ConfigLogFunction from 'components/config/config-log-function.vue';
+import ConfigLogNetwork from 'components/config/config-log-network.vue';
const status = ref('');
diff --git a/src/views/device-edit.vue b/src/views/device-edit.vue
index 55692b8..22097f8 100644
--- a/src/views/device-edit.vue
+++ b/src/views/device-edit.vue
@@ -13,6 +13,14 @@
+
+
+
+ 大气腐蚀
+ 其他
+
+
+
@@ -101,19 +109,13 @@
-
-
-
-
-
-
-
+
@@ -121,6 +123,14 @@
+
+
+
+
+
+
+
+
提交
diff --git a/src/views/device-list.vue b/src/views/device-list.vue
index 39c985f..1441fa7 100644
--- a/src/views/device-list.vue
+++ b/src/views/device-list.vue
@@ -19,9 +19,11 @@
试样:{{ props.row.simple }}
安装位置:{{ props.row.installLocation }}
sim1:{{ props.row.sim1 }}
- 与主站后台联调情况:{{ props.row.joint }}
- 维修记录:{{ props.row.operationRecord }}
+ 协议版本:{{ props.row.protocolVersion }}
+ 产品类型:{{ ASDU_TYPE[props.row.type].text }}
+ 与主站后台联调情况:{{ props.row.joint }}
备注:{{ props.row.remark }}
+ 维修记录:{{ props.row.operationRecord }}
@@ -31,7 +33,9 @@
- {{ STATUS_COLOR[scope.row.status].text }}
+
+ {{ STATUS_COLOR[scope.row.status].text }}
+
@@ -101,6 +105,7 @@ import DeviceEdit from 'components/device/device-edit.vue';
import DeviceCreate from 'components/device/device-create.vue';
import useDeviceCreate from '@/hooks/useDeviceCreate';
import { STATUS_COLOR } from '@/config/config';
+import { ASDU_TYPE } from '@/config/log';
let timer = null;
const store = useStore();