From 37baa6d67891a1f7ee8f46ee3974e7e5b6fa7923 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Wed, 6 Jul 2022 14:44:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BF=A1=E5=8F=B7=E6=BA=90?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E8=8B=B1=E6=96=87=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=EF=BC=8C=20=E6=B3=A8=E5=86=8C=E5=AF=B9=E8=AF=9D=E6=A1=86?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0=E5=B7=A5=E5=8E=82=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 23 ++++--- src/components/AdvancedIpAddressDialog.vue | 9 ++- src/components/ClockSignalSourceDialog.vue | 2 + src/components/RegisterDialog.vue | 1 + src/components/SignalSourceDialog.vue | 16 +++-- .../SystenSettingAdvancedNetworkDialog.vue | 3 + src/components/TimerSignalSourceDialog.vue | 2 + src/components/TimingTaskDialog.vue | 2 +- src/components/WeatherSignalSourceDialog.vue | 2 + src/i18n/en-US/index.ts | 61 ++++++++++++++++++- src/i18n/zh-CN/index.ts | 1 + src/pad/Login.vue | 1 + src/pad/TopToolbar.vue | 15 ++++- src/pages/Login.vue | 1 + src/pages/TopToolBar.vue | 15 ++++- src/store/index.ts | 9 +++ 16 files changed, 147 insertions(+), 16 deletions(-) diff --git a/src/App.vue b/src/App.vue index 28251f3..b7c4e1a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -58,14 +58,23 @@ export default defineComponent({ console.log(e); } - { - const user_search = (window).user_search || {}; - if (typeof user_search == "object") { - $store.commit( - "setAvancedDebug", - typeof user_search["debug"] != "undefined" - ); + try { + { + const user_search = (window).user_search || {}; + if (typeof user_search == "object") { + $store.commit( + "setAvancedDebug", + typeof user_search["debug"] != "undefined" + ); + + $store.commit( + "setFactoryMode", + typeof user_search["factory"] != "undefined" + ); + } } + } catch (e) { + console.log(e); } window.onresize = (evt: any) => diff --git a/src/components/AdvancedIpAddressDialog.vue b/src/components/AdvancedIpAddressDialog.vue index f18e3c5..cc5a637 100644 --- a/src/components/AdvancedIpAddressDialog.vue +++ b/src/components/AdvancedIpAddressDialog.vue @@ -127,10 +127,17 @@ - + $store.state.signal_source_tree, set: (val) => {}, diff --git a/src/components/SystenSettingAdvancedNetworkDialog.vue b/src/components/SystenSettingAdvancedNetworkDialog.vue index 96171b6..d18add6 100644 --- a/src/components/SystenSettingAdvancedNetworkDialog.vue +++ b/src/components/SystenSettingAdvancedNetworkDialog.vue @@ -97,6 +97,7 @@
{{ type == 1 ? $t("add") : type == 2 ? $t("edit") : $t("view") - }}{{ $t("timing task") }} + }}{{ $t(" ") }}{{ $t("timing task") }}
diff --git a/src/components/WeatherSignalSourceDialog.vue b/src/components/WeatherSignalSourceDialog.vue index abd625f..3145665 100644 --- a/src/components/WeatherSignalSourceDialog.vue +++ b/src/components/WeatherSignalSourceDialog.vue @@ -192,6 +192,7 @@ - + @@ -249,6 +254,7 @@ import SystemSettingDialog from "src/components/SystemSettingDialog.vue"; import GlobalData from "src/common/GlobalData"; import { Protocol } from "src/entities/WSProtocol"; +import { component } from "v-viewer"; export default defineComponent({ name: "PadTopToolbarPage", @@ -278,17 +284,24 @@ export default defineComponent({ 0 ); + const is_custon_isv = ref( + ($store.state.device_attribute & Protocol.EDeviceAttribute.CustomISV) != 0 + ); + watch( () => $store.state.device_attribute, (value) => { function_center_control.value = (value & Protocol.EDeviceAttribute.CenterControl) != 0; + is_custon_isv.value = + (value & Protocol.EDeviceAttribute.CustomISV) != 0; } ); return { plan_running, function_center_control, + is_custon_isv, window_rect_edit_dialog, toogleFullScreen() { diff --git a/src/pages/Login.vue b/src/pages/Login.vue index dc6283d..0361d8c 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -175,6 +175,7 @@ class="full-width text-h6" :loading="data.loading" :label="$t('login')" + no-caps style=" background: #273de4; box-shadow: 0 4px 6px 0px rgb(39 60 228 / 40%); diff --git a/src/pages/TopToolBar.vue b/src/pages/TopToolBar.vue index 3d43573..85c5369 100644 --- a/src/pages/TopToolBar.vue +++ b/src/pages/TopToolBar.vue @@ -300,7 +300,12 @@ {{ $t("upgrade") }} - + @@ -313,6 +318,7 @@ clickable v-close-popup @click="$refs.register_dialog.showDialog()" + v-if="$store.state.factory_mode" > @@ -455,6 +461,10 @@ export default defineComponent({ 0 ); + const is_custon_isv = ref( + ($store.state.device_attribute & Protocol.EDeviceAttribute.CustomISV) != 0 + ); + const window_rect_edit_dialog: Ref = ref(null); const plan_running = computed( @@ -525,6 +535,8 @@ export default defineComponent({ (value) => { function_center_control.value = (value & Protocol.EDeviceAttribute.CenterControl) != 0; + is_custon_isv.value = + (value & Protocol.EDeviceAttribute.CustomISV) != 0; } ); @@ -534,6 +546,7 @@ export default defineComponent({ edge_blending_dialog, register_dialog, function_center_control, + is_custon_isv, window_rect_edit_dialog, async backupDB() { diff --git a/src/store/index.ts b/src/store/index.ts index 32733c3..b95dfb3 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -36,6 +36,7 @@ export interface StateInterface { // Declared as unknown to avoid linting issue. Best to strongly type as per the line above. initialized: boolean; advanced_debug: boolean; + factory_mode: boolean; signal_source_tree: SignalSourceTreeItemEntity[]; polling_tree: PollingTreeItemEntity[]; mode_tree: ModeTreeItemEntity[]; @@ -285,6 +286,7 @@ export default store(function (/* { ssrContext } */) { // state initialized: false, advanced_debug: false, + factory_mode: false, signal_source_tree: [], polling_tree: [], mode_tree: [], @@ -338,6 +340,13 @@ export default store(function (/* { ssrContext } */) { } state.advanced_debug = playload; }, + setFactoryMode(state: StateInterface, playload?: any) { + if (playload || playload == "true") { + console.log("factory", playload); + state.advanced_debug = playload; + } + state.factory_mode = playload; + }, setArrayValue(state: StateInterface, playload?: any) { if (Array.isArray(playload.value)) { const arr: Array = (state)[playload.name];