diff --git a/.eslintrc.js b/.eslintrc.js
index 6449dea..2b9b596 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -13,6 +13,7 @@ module.exports = {
'import/no-unresolved': 0,
'import/extensions': 0,
'no-plusplus': 0,
+ 'consistent-return': 0,
'vue/html-self-closing': 'off',
'no-unused-expressions': 'off',
'vue/no-mutating-props': 'off',
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 4f31ac9..091fa60 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,4 +1,4 @@
{
- "cSpell.words": ["browserslist", "commitlint", "unplugin", "windi", "windicss"],
+ "cSpell.words": ["browserslist", "commitlint", "datas", "unplugin", "windi", "windicss"],
"vue3snippets.enable-compile-vue-file-on-did-save-code": true
}
diff --git a/src/apis/index.js b/src/apis/index.js
index cdc31ff..10778ea 100644
--- a/src/apis/index.js
+++ b/src/apis/index.js
@@ -44,7 +44,7 @@ export const createConfigNetwork = data => http.post(`${corrosion}/config/networ
export const createConfigFunction = data => http.post(`${corrosion}/config/function`, data);
// 查历史数据
-export const getHistories = params => http.post(`${corrosion}/histories`, params);
+export const getHistories = params => http.post(`${corrosion}/datas`, params);
// 导出历史数据
export const exportHistory = params => http.post(`${corrosion}/export`, params);
diff --git a/src/components/device-select-and-status.vue b/src/components/device-select-and-status.vue
index 657e237..166441b 100644
--- a/src/components/device-select-and-status.vue
+++ b/src/components/device-select-and-status.vue
@@ -2,7 +2,7 @@
import { computed, ref, watch, defineProps } from 'vue';
import { useStore } from 'vuex';
-const props = defineProps({ status: Object });
+const props = defineProps({ status: String });
const store = useStore();
const devices = computed(() => store.state.device.devices); // 设备/站点列表
@@ -57,8 +57,9 @@ function onChange(event) {
-
- 设置状态:
- {{ props.status || 'PENDING' }}
+
+ 设置状态:
+ {{ props.status }}
+
diff --git a/src/components/function-config-applied.vue b/src/components/function-config-applied.vue
new file mode 100644
index 0000000..ac67d66
--- /dev/null
+++ b/src/components/function-config-applied.vue
@@ -0,0 +1,150 @@
+
+
+
+ 设置金属腐蚀采样频率(分钟):
+ {{ data.frequency.metal }}
+
+
+ 设置温湿度采样频率(分钟):
+ {{ data.frequency.th }}
+
+
+ 设置SO2采样频率(分钟):
+ {{ data.frequency.so2 }}
+
+
+ 设置盐雾采样频率(分钟):
+ {{ data.frequency.salt }}
+
+
+ 设置时间:
+ {{ formatMsTime(data.time) }}
+
+
+ 设置金属腐蚀采集个数:
+ {{ data.count }}
+
+
+ 设置电池电压低阈值:
+ {{ data.batteryLow }}
+
+
+ 设置电池电压高阈值:
+ {{ data.batteryHigh }}
+
+
+ 设置太阳能电压高阈值:
+ {{ data.sunHigh }}
+
+
+ 设置湿度高阈值:
+ {{ data.humidityHigh }}
+
+
+ 设置温度低阈值:
+ {{ data.temperatureLow }}
+
+
+ 设置温度高阈值:
+ {{ data.temperatureHigh }}
+
+
+ 选择金属通道1类型:
+ {{ formatCorrosiveType(data.corrosiveType1) }}
+
+
+ 选择金属通道2类型:
+ {{ formatCorrosiveType(data.corrosiveType2) }}
+
+
+ 选择金属通道3类型:
+ {{ formatCorrosiveType(data.corrosiveType3) }}
+
+
+ 选择金属通道4类型:
+ {{ formatCorrosiveType(data.corrosiveType4) }}
+
+
+ 安全模式:
+ {{ formatMode(data.securityMode) }}
+
+
+
+
+
+ 上报类型:
+ {{ formatReportType(data.report.type) }}
+
+ {{ data.report.reportTimePoints }}
+ {{ data.report.cycle }}分钟
+
+
+
+
+
+
+
+
diff --git a/src/components/function-config-pending.vue b/src/components/function-config-pending.vue
new file mode 100644
index 0000000..49f6f8e
--- /dev/null
+++ b/src/components/function-config-pending.vue
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 不加密
+ 加密
+
+
+
+
+
+
+
+
+ 按设定时间点上报
+ 按设定周期上报(分钟)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交
+ 重置
+
+
+
+
+
+
+
+
+
diff --git a/src/components/history-data.vue b/src/components/history-data.vue
index 7bf4e1b..ce4cfba 100644
--- a/src/components/history-data.vue
+++ b/src/components/history-data.vue
@@ -8,6 +8,7 @@
diff --git a/src/views/network-config.vue b/src/views/network-config.vue
index 2e368a4..725081c 100644
--- a/src/views/network-config.vue
+++ b/src/views/network-config.vue
@@ -1,6 +1,6 @@
-
+
@@ -19,7 +19,7 @@ import NetworkConfigPending from 'components/network-config-pending.vue';
import NetworkConfigApplied from 'components/network-config-applied.vue';
const activeName = ref('pending');
-const status = ref('PENDING');
+const status = ref('');
// 设置 设置状态
function setStatus(event) {
diff --git a/src/views/statistical-history.vue b/src/views/statistical-history.vue
index 73aa812..64a5c9b 100644
--- a/src/views/statistical-history.vue
+++ b/src/views/statistical-history.vue
@@ -40,7 +40,7 @@ const getDate = async () => {
await store.dispatch('statistics/getRealtimeData', params);
timer && clearTimeout(timer);
timer = null;
- childRef.value.changeDate(realtimeData.value);
+ childRef.value.changeDate(realtimeData.value.data);
} else {
timer = setTimeout(() => {
getDate();
diff --git a/src/views/statistical-realtime.vue b/src/views/statistical-realtime.vue
index b466fea..854cb8b 100644
--- a/src/views/statistical-realtime.vue
+++ b/src/views/statistical-realtime.vue
@@ -40,12 +40,14 @@ const getDate = async () => {
await store.dispatch('statistics/getRealtimeData', params);
timer && clearTimeout(timer);
timer = null;
- childRef.value.changeDate(realtimeData.value);
+ childRef.value.changeDate(realtimeData.value.data);
// 定时轮询请求新数据
- apiTimer = setInterval(() => {
- getDate();
- }, 5000);
+ if (!apiTimer) {
+ apiTimer = setInterval(() => {
+ getDate();
+ }, 5000);
+ }
} else {
timer = setTimeout(() => {
getDate();