From fe76f29989ace77a5efcae5d4c7f6920e3ecef6d Mon Sep 17 00:00:00 2001 From: fangxiang Date: Tue, 19 Jul 2022 16:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=BA=90=E3=80=81=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E3=80=81=E9=A2=84=E6=A1=88=E5=A2=9E=E5=8A=A0=E6=8B=96?= =?UTF-8?q?=E5=8A=A8=E4=BA=8B=E4=BB=B6(=E4=BB=85=E6=94=AF=E6=8C=81PC?= =?UTF-8?q?=E7=AB=AF=E7=9A=84chrome=E5=86=85=E6=A0=B8,firefox=E7=AD=89?= =?UTF-8?q?=E5=85=B6=E5=AE=83=E5=86=85=E6=A0=B8=E5=8F=AF=E8=83=BD=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- public/source_icon/clock.png | Bin 832 -> 1109 bytes src/components/ModeTree.vue | 81 ++++++++++++++++++++++++- src/components/PlanTree.vue | 88 +++++++++++++++++++++++++-- src/components/PollingTree.vue | 1 + src/components/SignalSourceTree.vue | 89 ++++++++++++++++++++++++++-- src/i18n/en-US/index.ts | 5 ++ src/layouts/MainLayout.vue | 72 +--------------------- src/store/index.ts | 10 +++- 9 files changed, 265 insertions(+), 83 deletions(-) diff --git a/package.json b/package.json index 69b9506..9eb12cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "media_player_client", - "version": "1.4.18", + "version": "1.4.19", "description": "A Quasar Framework app", "productName": "MediaPlayerClient", "author": "fangxiang ", diff --git a/public/source_icon/clock.png b/public/source_icon/clock.png index 22ba914903ef5ddbf2d4ca3067046bbc9f6559b8..78366fdadddd1b1e373925a2befad3034836e936 100644 GIT binary patch literal 1109 zcmV-b1giUqP)Px(4@pEpR9HvNS6ysWMHK$d+=lK?5d$re(tw~q1EK;}q5P$!{K!wh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PD!9m@kTc{L-9S9=$P>1bgVPQ9|6%!#7m1j&-(y*)bpPx%`bk7VR7gv`Rm)COQ50SK7AP$=K?P%YDHsM0h!_L$QBg#mi31~u8hrc!#zbSH z0|f_8)Wql?)JG(s4piFG5|orgK_kY20}uo&F&do|3b&*<~LMTH4_hp;%&_Ly3P=A8iahK zB*5@9a3j68{`zupe-O;M-9?JRodC+^3q17^{NsD<10qm%4ruinP}V9?!FnBcSO{vd z)YVNaCR#!;=XSO$3SH6yLMkG!UV=Z28Wupg`7mv_1J(>JP6+O>)HSs0FU1G~Jv}*T zsmfO^>o3!Yc$|j7zi*m$R)UI4e&rSxYi*5<-{fW3^%^Y_uHgdwu(5MF*fW?ZGrXzAlKa=WlO#&!PL;&#q z3`h5q;E6*AnYr7r)EEJ#B*9$(M~#k%fOA$y*VRC4(;kKBF$kGP1hFFm?or6&Ze#FG zgC-AVIJ)dJC!0%2;3;uBoqBqNY)! z8JBqN;z15Yd$yxh+#!wD8*_UBD*~hFNvR^9cCx9*RR?D0000< KMNUMnLSTYhAb4#6 diff --git a/src/components/ModeTree.vue b/src/components/ModeTree.vue index e4f030b..57beadf 100644 --- a/src/components/ModeTree.vue +++ b/src/components/ModeTree.vue @@ -10,6 +10,10 @@ class="full-width" clickable :disable="!$store.state.power_state" + :draggable="prop.node.uuid != '' && $store.state.power_state" + @dragstart="(evt) => onDragStart(evt, prop.node)" + @dragover="(evt) => onDragOver(evt, prop.node)" + @drop="(evt) => onDrop(evt, prop.node)" @dblclick=" (evt) => { if (!$store.state.power_state) { @@ -36,6 +40,7 @@ > 0 && + group && + group.length > 0 + ) { + if (group == "true") { + const mode_group = GlobalData.getInstance().mode_groups.find( + (item) => item && (item as any).uuid == uuid + ); + if (mode_group) { + if (mode_group.parent_uuid == node.item_data.uuid) { + return; + } + + GlobalData.getInstance() + .getCurrentClient() + ?.editModeGroup( + mode_group.uuid, + mode_group.name, + node.item_data.uuid + ); + } else { + console.log("can't find mode group, uuid:" + uuid); + } + } else if (group == "false") { + const mode = GlobalData.getInstance().modes.find( + (item) => item && (item as any).uuid == uuid + ); + if (mode) { + if (mode.group_uuid == node.item_data.uuid) { + return; + } + GlobalData.getInstance() + .getCurrentClient() + ?.editMode( + mode.uuid, + mode.name, + mode.number, + node.item_data.uuid + ); + } else { + console.log("can't find mode, uuid:" + uuid); + } + } + } + } else { + console.log("type error"); + } + } + } + }, }; }, }); diff --git a/src/components/PlanTree.vue b/src/components/PlanTree.vue index 558fbaa..7da42a6 100644 --- a/src/components/PlanTree.vue +++ b/src/components/PlanTree.vue @@ -10,12 +10,17 @@ class="full-width" clickable :disable="!$store.state.power_state" + :draggable="prop.node.uuid != '' && $store.state.power_state" + @dragstart="(evt) => onDragStart(evt, prop.node)" + @dragover="(evt) => onDragOver(evt, prop.node)" + @drop="(evt) => onDrop(evt, prop.node)" @dblclick=" (evt) => !prop.node.is_group && runPlan(prop.node.item_data) " > 0 && + group && + group.length > 0 + ) { + if (group == "true") { + const plan_group = GlobalData.getInstance().plan_groups.find( + (item) => item && (item as any).uuid == uuid + ); + if (plan_group) { + if (plan_group.parent_uuid == node.item_data.uuid) { + return; + } + GlobalData.getInstance() + .getCurrentClient() + ?.editPlanGroup( + plan_group.uuid, + plan_group.name, + node.item_data.uuid + ); + } else { + console.log("can't find plan group, uuid:" + uuid); + } + } else if (group == "false") { + const plan = GlobalData.getInstance().plans.find( + (item) => item && (item as any).uuid == uuid + ); + if (plan) { + if (plan.group_uuid == node.item_data.uuid) { + return; + } + const entity = extend(false, plan) as PlanEntity; + entity.group_uuid = node.item_data.uuid; + GlobalData.getInstance() + .getCurrentClient() + ?.editPlan(entity); + } else { + console.log("can't find plan, uuid:" + uuid); + } + } + } + } else { + console.log("type error"); + } + } + } + }, }; }, }); diff --git a/src/components/PollingTree.vue b/src/components/PollingTree.vue index 6cee365..5ba92cc 100644 --- a/src/components/PollingTree.vue +++ b/src/components/PollingTree.vue @@ -19,6 +19,7 @@ > + -import { defineComponent, computed, onMounted, ref, nextTick } from "vue"; +import { defineComponent, computed, onMounted, ref } from "vue"; import { useStore } from "src/store"; -import { SignalSourceTreeItemEntity } from "src/entities/SignalSourceEntity"; +import { + SignalSourceEntity, + SignalSourceTreeItemEntity, +} from "src/entities/SignalSourceEntity"; import SignalSourceGroupDialog from "src/components/SignalSourceGroupDialog.vue"; import SignalSourceDialog from "src/components/SignalSourceDialog.vue"; import { Common } from "src/common/Common"; import GlobalData from "src/common/GlobalData"; -import { useQuasar } from "quasar"; +import { useQuasar, extend } from "quasar"; import { useI18n } from "vue-i18n"; import EventBus, { EventNamesDefine } from "src/common/EventBus"; import { Protocol } from "src/entities/WSProtocol"; @@ -229,11 +236,85 @@ export default defineComponent({ onDragStart(e: DragEvent, node: SignalSourceTreeItemEntity) { e.dataTransfer?.setData("uuid", node.uuid); e.dataTransfer?.setData("type", "signal_source"); + e.dataTransfer?.setData("group", node.is_group ? "true" : "false"); e.dataTransfer?.setData("node_object", JSON.stringify(node)); if (e.dataTransfer) { e.dataTransfer.dropEffect = "move"; } }, + onDragOver(e: DragEvent, node: SignalSourceTreeItemEntity) { + if (node && node.is_group && !node.item_data?.system_default) { + e.preventDefault(); + } + }, + onDrop(e: DragEvent, node: SignalSourceTreeItemEntity) { + if ( + node && + node.is_group && + node.item_data && + !node.item_data.system_default + ) { + if (e.dataTransfer) { + const type = e.dataTransfer.getData("type"); + if (type == "signal_source") { + const uuid = e.dataTransfer.getData("uuid"); + const group = e.dataTransfer.getData("group"); + if ( + typeof uuid == "string" && + type && + type.length > 0 && + group && + group.length > 0 + ) { + if (group == "true") { + const signal_source_group = + GlobalData.getInstance().signal_source_groups.find( + (item) => item && (item as any).uuid == uuid + ); + if (signal_source_group) { + if ( + signal_source_group.parent_uuid == node.item_data.uuid + ) { + return; + } + GlobalData.getInstance() + .getCurrentClient() + ?.editSignalSourceGroup( + signal_source_group.uuid, + signal_source_group.name, + node.item_data.uuid + ); + } else { + console.log("can't find signal source group, uuid:" + uuid); + } + } else if (group == "false") { + const signal_source = + GlobalData.getInstance().signal_source.find( + (item) => item && (item as any).uuid == uuid + ); + if (signal_source) { + if (signal_source.group_uuid == node.item_data.uuid) { + return; + } + const entity = extend( + false, + signal_source + ) as SignalSourceEntity; + entity.group_uuid = node.item_data.uuid; + GlobalData.getInstance() + .getCurrentClient() + ?.editSignalSource(entity); + } else { + console.log("can't find signal source, uuid:" + uuid); + } + } + } + } else { + console.log("type error"); + } + } + } + }, getItemIcon(item_type: string) { return Common.getSignalSourceIcon(item_type); }, diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index d61d535..cc4b549 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -295,4 +295,9 @@ export default { "open window": "Open Window", "close all windows": "Close All Windows", "select data(DBP) file": "Select Data(DBP) File", + "please check server state, or check server ip address!": + "Please Check Server State, Or Check Server Ip Address!", + "connect time out!": "Connect Time Out!", + "login fail!": "Login Fail!", + "unset power on start": "UnSet Power On Start", }; diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 4615811..208449e 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -1,5 +1,5 @@