From a32a3fc7f16250ee02791c32a4cd3c3f4e84a5d3 Mon Sep 17 00:00:00 2001 From: wally <18603454788@163.com> Date: Wed, 3 Nov 2021 16:42:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=AE=BE=E5=A4=87=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9B=E7=BB=9F=E8=AE=A1=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E7=AD=89=E4=BF=AE=E6=94=B9):=20=E8=AE=BE=E5=A4=87=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=B7=BB=E5=8A=A0=EF=BC=9B=E7=BB=9F=E8=AE=A1=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E7=AD=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + .vscode/settings.json | 2 +- src/apis/index.js | 2 +- src/components/device-select-and-status.vue | 9 +- src/components/function-config-applied.vue | 150 +++++++++++ src/components/function-config-pending.vue | 239 +++++++++++++++++ src/components/history-data.vue | 34 +-- src/components/network-config-applied.vue | 19 +- src/components/network-config-pending.vue | 19 +- src/components/realtime-data.vue | 42 +-- src/components/search-bar-data.vue | 8 +- src/components/search-bar.vue | 2 +- src/config/config.js | 49 ++++ src/utils/time.js | 16 ++ src/views/data-history.vue | 9 +- src/views/function-config.vue | 270 ++------------------ src/views/network-config.vue | 4 +- src/views/statistical-history.vue | 2 +- src/views/statistical-realtime.vue | 10 +- 19 files changed, 551 insertions(+), 336 deletions(-) create mode 100644 src/components/function-config-applied.vue create mode 100644 src/components/function-config-pending.vue create mode 100644 src/config/config.js create mode 100644 src/utils/time.js 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' }} + 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 @@ + + + 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 @@