parent
b0871b3af9
commit
e5ef89c939
|
@ -10,8 +10,10 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@quasar/extras": "^1.0.0",
|
"@quasar/extras": "^1.0.0",
|
||||||
|
"@types/element-resize-detector": "^1.1.3",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
|
"element-resize-detector": "^1.2.3",
|
||||||
"quasar": "^2.0.0",
|
"quasar": "^2.0.0",
|
||||||
"vue-i18n": "^9.0.0-beta.0",
|
"vue-i18n": "^9.0.0-beta.0",
|
||||||
"vuex": "^4.0.1"
|
"vuex": "^4.0.1"
|
||||||
|
|
|
@ -191,8 +191,8 @@ export default class ClientConnection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async doRpc<_RequestType extends Protocol.PacketEntity, _ResponseType>(
|
public async doRpc<_ResponseType>(
|
||||||
RequestType: new () => _RequestType
|
request: Protocol.PacketEntity
|
||||||
): Promise<_ResponseType | null> {
|
): Promise<_ResponseType | null> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const rpc_id = ++this._rpc_id_counter;
|
const rpc_id = ++this._rpc_id_counter;
|
||||||
|
@ -203,7 +203,6 @@ export default class ClientConnection {
|
||||||
this.rpc_map.delete(rpc_id);
|
this.rpc_map.delete(rpc_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let request: _RequestType = new RequestType();
|
|
||||||
request.rpc_id = rpc_id;
|
request.rpc_id = rpc_id;
|
||||||
this.ws?.send(JSON.stringify(request));
|
this.ws?.send(JSON.stringify(request));
|
||||||
this.rpc_map.set(
|
this.rpc_map.set(
|
||||||
|
@ -230,10 +229,9 @@ export default class ClientConnection {
|
||||||
|
|
||||||
public async getSignalSources() {
|
public async getSignalSources() {
|
||||||
try {
|
try {
|
||||||
return await this.doRpc<
|
return await this.doRpc<Protocol.GetSignalSourcesResponse>(
|
||||||
Protocol.GetSignalSourcesRequest,
|
new Protocol.GetSignalSourcesRequest()
|
||||||
Protocol.GetSignalSourcesResponse
|
);
|
||||||
>(Protocol.GetSignalSourcesRequest);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -241,10 +239,9 @@ export default class ClientConnection {
|
||||||
|
|
||||||
public async getApplicationSettins() {
|
public async getApplicationSettins() {
|
||||||
try {
|
try {
|
||||||
return await this.doRpc<
|
return await this.doRpc<Protocol.GetApplicationConfigResponseEntity>(
|
||||||
Protocol.GetApplicationConfigRequestEntity,
|
new Protocol.GetApplicationConfigRequestEntity()
|
||||||
Protocol.GetApplicationConfigResponseEntity
|
);
|
||||||
>(Protocol.GetApplicationConfigRequestEntity);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -252,10 +249,9 @@ export default class ClientConnection {
|
||||||
|
|
||||||
public async getWindows() {
|
public async getWindows() {
|
||||||
try {
|
try {
|
||||||
return await this.doRpc<
|
return await this.doRpc<Protocol.GetWindowsResponseEntity>(
|
||||||
Protocol.GetWindowsRequestEntity,
|
new Protocol.GetWindowsRequestEntity()
|
||||||
Protocol.GetWindowsResponseEntity
|
);
|
||||||
>(Protocol.GetWindowsRequestEntity);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -296,6 +292,16 @@ export default class ClientConnection {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async addSignalSourceGroup(parent_uuid: string, name: string) {
|
||||||
|
try {
|
||||||
|
return await this.doRpc<Protocol.AddSignalSourcesGroupResponseEntity>(
|
||||||
|
new Protocol.AddSignalSourcesGroupRequestEntity(0, parent_uuid, name)
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private _destoryed = false;
|
private _destoryed = false;
|
||||||
public destory() {
|
public destory() {
|
||||||
this._destoryed = true;
|
this._destoryed = true;
|
||||||
|
|
|
@ -18,6 +18,7 @@ export default class EventBus extends EventEmitter {
|
||||||
|
|
||||||
export namespace EventNamesDefine {
|
export namespace EventNamesDefine {
|
||||||
export const UnSelectAllWindows = "onUnSelectAllWindows";
|
export const UnSelectAllWindows = "onUnSelectAllWindows";
|
||||||
|
export const UnFocusAllWindows = "onUnFocusAllWindows";
|
||||||
export const WindowResize = "onWindowResize";
|
export const WindowResize = "onWindowResize";
|
||||||
export const ResponseMessage = "onResponseData";
|
export const ResponseMessage = "onResponseData";
|
||||||
export const WebSocketClose = "onWebSocketClose";
|
export const WebSocketClose = "onWebSocketClose";
|
||||||
|
|
|
@ -0,0 +1,214 @@
|
||||||
|
<template>
|
||||||
|
<q-dialog v-model="show_dialog" @before-hide="resetData">
|
||||||
|
<q-card class="overflow-hidden" style="overflow-y: scroll">
|
||||||
|
<q-card-section class="q-ma-none q-pa-sm">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-11 text-h6">
|
||||||
|
{{
|
||||||
|
type == 1
|
||||||
|
? $t("add group")
|
||||||
|
: type == 2
|
||||||
|
? $t("edit group")
|
||||||
|
: type == 3
|
||||||
|
? $t("delete group")
|
||||||
|
: "add"
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
<div class="col-1">
|
||||||
|
<q-btn flat round icon="close" color="red" v-close-popup>
|
||||||
|
<q-tooltip>
|
||||||
|
{{ $t("close") }}
|
||||||
|
</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
|
|
||||||
|
<q-separator />
|
||||||
|
|
||||||
|
<q-card-section style="max-height: 50vh; width: 45vw" class="scroll">
|
||||||
|
<q-list>
|
||||||
|
<q-item>
|
||||||
|
<q-item-label>{{ $t("parent group") }}:</q-item-label>
|
||||||
|
</q-item>
|
||||||
|
<q-item class="q-pa-none q-ma-none">
|
||||||
|
<q-item-section style="padding-right: 10px">
|
||||||
|
<q-tree
|
||||||
|
ref="tree"
|
||||||
|
class="scroll"
|
||||||
|
:class="loading ? 'disable_tree' : ''"
|
||||||
|
v-model:selected="selected"
|
||||||
|
:nodes="tree_nodes"
|
||||||
|
default-expand-all
|
||||||
|
node-key="uuid"
|
||||||
|
labelKey="name"
|
||||||
|
>
|
||||||
|
<template v-slot:default-header="prop">
|
||||||
|
<q-item
|
||||||
|
class="full-width"
|
||||||
|
:class="
|
||||||
|
prop.tree.selected == prop.key ? 'item-selected-bg' : ''
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon
|
||||||
|
:name="'img:source_icon/group.png'"
|
||||||
|
color="orange"
|
||||||
|
size="28px"
|
||||||
|
class="q-mr-sm"
|
||||||
|
/>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>
|
||||||
|
<div class="text-weight-bold text-primary">
|
||||||
|
{{ prop.node.name }}
|
||||||
|
</div>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-tree>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-input
|
||||||
|
autofocus
|
||||||
|
:loading="loading"
|
||||||
|
:disable="loading"
|
||||||
|
filled
|
||||||
|
v-model="name"
|
||||||
|
:label="$t('group name')"
|
||||||
|
:hint="$t('please input group name')"
|
||||||
|
lazy-rules
|
||||||
|
:rules="[
|
||||||
|
(val) =>
|
||||||
|
(val && val.length > 0) || $t('Please type something'),
|
||||||
|
]"
|
||||||
|
@keydown="
|
||||||
|
(evt) => {
|
||||||
|
if (evt.keyCode == 13) {
|
||||||
|
$refs?.accept?.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template v-if="name" v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
name="cancel"
|
||||||
|
@click.stop="name = null"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-card-section>
|
||||||
|
|
||||||
|
<q-separator />
|
||||||
|
|
||||||
|
<q-card-actions align="right">
|
||||||
|
<q-btn flat :label="$t('Cancel')" color="primary" v-close-popup />
|
||||||
|
<q-btn
|
||||||
|
ref="accept"
|
||||||
|
flat
|
||||||
|
:label="$t('Accept')"
|
||||||
|
color="primary"
|
||||||
|
@click="onSubmit"
|
||||||
|
/>
|
||||||
|
</q-card-actions>
|
||||||
|
</q-card>
|
||||||
|
</q-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.disable_tree {
|
||||||
|
background: #9e9e9e;
|
||||||
|
cursor: wait;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, ref, watch, onUnmounted, computed } from "vue";
|
||||||
|
import { useStore } from "src/store";
|
||||||
|
import GlobalData from "src/common/GlobalData";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "ComponentGroupDialog",
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
let $store = useStore();
|
||||||
|
let $q = useQuasar();
|
||||||
|
let $t = useI18n();
|
||||||
|
|
||||||
|
let show_dialog = ref(false);
|
||||||
|
let type = ref(1);
|
||||||
|
let name = ref(null);
|
||||||
|
const selected: any = ref(null);
|
||||||
|
let loading = ref(false);
|
||||||
|
|
||||||
|
const tree_nodes = computed({
|
||||||
|
get: () =>
|
||||||
|
$store.state.signal_source_tree.filter((item) => item && item.is_group),
|
||||||
|
set: (val) => $store.commit("setSignalSourceTree", val),
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => selected.value,
|
||||||
|
(newValue, oldValue) => {
|
||||||
|
if (newValue == null) {
|
||||||
|
selected.value = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
show_dialog,
|
||||||
|
type,
|
||||||
|
name,
|
||||||
|
selected,
|
||||||
|
loading,
|
||||||
|
tree_nodes,
|
||||||
|
showDialog(options: any) {
|
||||||
|
if (options) {
|
||||||
|
type.value = options.type ?? 1;
|
||||||
|
name.value = options.name ?? null;
|
||||||
|
selected.value = options.parent ?? null;
|
||||||
|
}
|
||||||
|
show_dialog.value = true;
|
||||||
|
},
|
||||||
|
resetData() {
|
||||||
|
loading.value = false;
|
||||||
|
(selected.value = null), (name.value = null);
|
||||||
|
type.value = 1;
|
||||||
|
console.log("reset dialog data");
|
||||||
|
},
|
||||||
|
|
||||||
|
async onSubmit() {
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
let response = await GlobalData.getInstance()
|
||||||
|
.getCurrentClient()
|
||||||
|
?.addSignalSourceGroup(selected.value, name.value ?? "");
|
||||||
|
if (response) {
|
||||||
|
$q.notify({
|
||||||
|
color: response.success ? "positive" : "negative",
|
||||||
|
icon: response.success ? "done" : "warning",
|
||||||
|
message:
|
||||||
|
$t.t("add group") +
|
||||||
|
(response.success ? $t.t("success") : $t.t("fail")) +
|
||||||
|
"!",
|
||||||
|
position: "top",
|
||||||
|
timeout: 1000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
show_dialog.value = false;
|
||||||
|
} catch {}
|
||||||
|
loading.value = false;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<template>
|
||||||
|
<div>asda</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, ref, watch, onUnmounted } from "vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "ComponentSignalSourceDialog",
|
||||||
|
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
emits: [],
|
||||||
|
setup() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -1,7 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="window_class window_flag"
|
class="window_class window_flag"
|
||||||
:class="selected ? 'window_selected top' : 'window_normal'"
|
:class="
|
||||||
|
(selected ? 'window_selected' : 'window_normal') +
|
||||||
|
' ' +
|
||||||
|
(focused ? 'top' : '')
|
||||||
|
"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
@mousedown="onMouseDown"
|
@mousedown="onMouseDown"
|
||||||
@mousemove="onMouseMove"
|
@mousemove="onMouseMove"
|
||||||
|
@ -275,16 +279,29 @@ export default defineComponent({
|
||||||
);
|
);
|
||||||
|
|
||||||
let selected = ref(false);
|
let selected = ref(false);
|
||||||
|
let focused = ref(false);
|
||||||
let can_move = ref(true);
|
let can_move = ref(true);
|
||||||
let can_resize = ref(true);
|
let can_resize = ref(true);
|
||||||
|
|
||||||
const onUnSelectAllWindows = () => {
|
const onUnSelectAllWindows = () => {
|
||||||
selected.value = false;
|
selected.value = false;
|
||||||
|
focused.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onUnFocusAllWindows = () => {
|
||||||
|
focused.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
EventBus.getInstance().on(
|
EventBus.getInstance().on(
|
||||||
EventNamesDefine.UnSelectAllWindows,
|
EventNamesDefine.UnSelectAllWindows,
|
||||||
onUnSelectAllWindows
|
onUnSelectAllWindows
|
||||||
);
|
);
|
||||||
|
|
||||||
|
EventBus.getInstance().on(
|
||||||
|
EventNamesDefine.UnFocusAllWindows,
|
||||||
|
onUnFocusAllWindows
|
||||||
|
);
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
EventBus.getInstance().removeListener(
|
EventBus.getInstance().removeListener(
|
||||||
EventNamesDefine.UnSelectAllWindows,
|
EventNamesDefine.UnSelectAllWindows,
|
||||||
|
@ -296,14 +313,12 @@ export default defineComponent({
|
||||||
() => props.window.window_state,
|
() => props.window.window_state,
|
||||||
(newValue, oldValue) => {
|
(newValue, oldValue) => {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
console.log(newValue);
|
let old = selected.value;
|
||||||
if (newValue.focus) {
|
if (newValue.focus) {
|
||||||
console.log(newValue.focus);
|
EventBus.getInstance().emit(EventNamesDefine.UnFocusAllWindows);
|
||||||
EventBus.getInstance().emit(EventNamesDefine.UnSelectAllWindows);
|
|
||||||
selected.value = true;
|
|
||||||
} else {
|
|
||||||
selected.value = false;
|
|
||||||
}
|
}
|
||||||
|
focused.value = newValue.focus;
|
||||||
|
selected.value = old;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -323,6 +338,7 @@ export default defineComponent({
|
||||||
return {
|
return {
|
||||||
signal_source,
|
signal_source,
|
||||||
selected,
|
selected,
|
||||||
|
focused,
|
||||||
can_move,
|
can_move,
|
||||||
can_resize,
|
can_resize,
|
||||||
flags,
|
flags,
|
||||||
|
@ -331,6 +347,7 @@ export default defineComponent({
|
||||||
if (selected.value != true) {
|
if (selected.value != true) {
|
||||||
EventBus.getInstance().emit(EventNamesDefine.UnSelectAllWindows);
|
EventBus.getInstance().emit(EventNamesDefine.UnSelectAllWindows);
|
||||||
selected.value = true;
|
selected.value = true;
|
||||||
|
focused.value = true;
|
||||||
emit("window_fouse_in", props.window.window_id);
|
emit("window_fouse_in", props.window.window_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -410,6 +427,10 @@ export default defineComponent({
|
||||||
cleanMouseDownFlag();
|
cleanMouseDownFlag();
|
||||||
emit("commit_geometry", props.window);
|
emit("commit_geometry", props.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!focused) {
|
||||||
|
emit("window_fouse_in", props.window.window_id);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getItemIcon(item_type: string) {
|
getItemIcon(item_type: string) {
|
||||||
|
|
|
@ -23,6 +23,10 @@ body {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-selected-bg {
|
||||||
|
background: #9e9e9e;
|
||||||
|
}
|
||||||
|
|
||||||
.drag-enter {
|
.drag-enter {
|
||||||
outline-style: dashed;
|
outline-style: dashed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,10 @@ export namespace Protocol {
|
||||||
return Commands.PROTOCOL_PREFIX + "FocuseWindow";
|
return Commands.PROTOCOL_PREFIX + "FocuseWindow";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static get kRpcAddSignalSourceGroup() {
|
||||||
|
return Commands.PROTOCOL_PREFIX + "RpcAddSignalSourceGroup";
|
||||||
|
}
|
||||||
|
|
||||||
static _all_commands = new Set([
|
static _all_commands = new Set([
|
||||||
Commands.kUnKnowCommand,
|
Commands.kUnKnowCommand,
|
||||||
Commands.kSearchDevice,
|
Commands.kSearchDevice,
|
||||||
|
@ -81,6 +85,7 @@ export namespace Protocol {
|
||||||
Commands.kOpenWindow,
|
Commands.kOpenWindow,
|
||||||
Commands.kCloseWindow,
|
Commands.kCloseWindow,
|
||||||
Commands.kWindowOtherStateChanged,
|
Commands.kWindowOtherStateChanged,
|
||||||
|
Commands.kRpcAddSignalSourceGroup,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
public static get AllCommands() {
|
public static get AllCommands() {
|
||||||
|
@ -289,4 +294,26 @@ export namespace Protocol {
|
||||||
this.command = Commands.kResizeWindow;
|
this.command = Commands.kResizeWindow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class AddSignalSourcesGroupRequestEntity extends Protocol.PacketEntity {
|
||||||
|
parent_uuid = "";
|
||||||
|
name = "";
|
||||||
|
|
||||||
|
constructor(rcp_id?: number, parent_uuid?: string, name?: string) {
|
||||||
|
super();
|
||||||
|
this.rpc_id = rcp_id ?? 0;
|
||||||
|
this.command = Protocol.Commands.kRpcAddSignalSourceGroup;
|
||||||
|
this.parent_uuid = parent_uuid ?? "";
|
||||||
|
this.name = name ?? "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AddSignalSourcesGroupResponseEntity extends Protocol.PacketEntity {
|
||||||
|
success = false;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.command = Protocol.Commands.kRpcAddSignalSourceGroup;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ export default {
|
||||||
title: "MediaPlayerWebAPP",
|
title: "MediaPlayerWebAPP",
|
||||||
failed: "失败",
|
failed: "失败",
|
||||||
success: "成功",
|
success: "成功",
|
||||||
|
Cancel: "取消",
|
||||||
|
Accept: "确认",
|
||||||
login: "登录",
|
login: "登录",
|
||||||
"user name": "用户名",
|
"user name": "用户名",
|
||||||
password: "密码",
|
password: "密码",
|
||||||
|
@ -30,4 +32,18 @@ export default {
|
||||||
|
|
||||||
"network disconnect!": "网络连接断开!",
|
"network disconnect!": "网络连接断开!",
|
||||||
"wait reconnection": "等待重连中",
|
"wait reconnection": "等待重连中",
|
||||||
|
|
||||||
|
"add item": "添加",
|
||||||
|
"add signal source item": "添加信号源",
|
||||||
|
"add group": "添加组",
|
||||||
|
"delete group": "删除组",
|
||||||
|
"edit group": "修改组",
|
||||||
|
delete: "删除",
|
||||||
|
edit: "修改",
|
||||||
|
|
||||||
|
close: "关闭",
|
||||||
|
"parent group": "父节点",
|
||||||
|
"group name": "组名",
|
||||||
|
|
||||||
|
"please input group name": "请输入组名",
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,11 @@
|
||||||
<q-page-container class="col">
|
<q-page-container class="col">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- left -->
|
<!-- left -->
|
||||||
<div v-if="landspace" class="col-2" style="border: 1px solid #bdbdbd">
|
<div
|
||||||
|
v-if="landspace"
|
||||||
|
class="col-auto overflow-auto"
|
||||||
|
style="border: 1px solid #bdbdbd; max-width: 45vw"
|
||||||
|
>
|
||||||
<left-tool-bar />
|
<left-tool-bar />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -27,60 +27,72 @@
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-popup-proxy context-menu>
|
<q-popup-proxy context-menu>
|
||||||
<q-popup-proxy context-menu />
|
<q-popup-proxy context-menu />
|
||||||
<q-btn
|
<q-list>
|
||||||
flat
|
<q-item clickable v-close-popup v-ripple>
|
||||||
round
|
<q-item-section avatar><q-icon name="add" /></q-item-section>
|
||||||
icon="add"
|
<q-item-section>{{
|
||||||
v-close-popup
|
$t("add signal source item")
|
||||||
v-if="prop.node.is_group"
|
}}</q-item-section>
|
||||||
>
|
</q-item>
|
||||||
<q-tooltip>{{ $t("add item") }}</q-tooltip>
|
<q-item
|
||||||
</q-btn>
|
clickable
|
||||||
<q-btn
|
v-close-popup
|
||||||
flat
|
v-if="prop.node.is_group"
|
||||||
round
|
v-ripple
|
||||||
icon="create_new_folder"
|
@click="
|
||||||
v-close-popup
|
() =>
|
||||||
v-if="prop.node.is_group"
|
$refs.group_dialog.showDialog({
|
||||||
>
|
type: 1,
|
||||||
<q-tooltip>{{ $t("add group") }}</q-tooltip>
|
parent: prop.node.uuid,
|
||||||
</q-btn>
|
})
|
||||||
<q-btn
|
"
|
||||||
flat
|
>
|
||||||
round
|
<q-item-section avatar
|
||||||
icon="edit"
|
><q-icon name="create_new_folder"
|
||||||
v-close-popup
|
/></q-item-section>
|
||||||
v-if="prop.node.uuid != '' && prop.node.name != $t('root')"
|
<q-item-section>{{ $t("add group") }}</q-item-section>
|
||||||
>
|
</q-item>
|
||||||
<q-tooltip>{{ $t("edit") }}</q-tooltip>
|
<q-item
|
||||||
</q-btn>
|
clickable
|
||||||
<q-btn
|
v-ripple
|
||||||
flat
|
v-close-popup
|
||||||
round
|
v-if="prop.node.uuid != '' && prop.node.name != $t('root')"
|
||||||
icon="delete"
|
>
|
||||||
text-color="red"
|
<q-item-section avatar><q-icon name="edit" /></q-item-section>
|
||||||
v-close-popup
|
<q-item-section>{{ $t("edit") }}</q-item-section>
|
||||||
v-if="prop.node.uuid != '' && prop.node.name != $t('root')"
|
</q-item>
|
||||||
>
|
|
||||||
<q-tooltip>{{ $t("delete") }}</q-tooltip>
|
<q-item
|
||||||
</q-btn>
|
clickable
|
||||||
|
v-ripple
|
||||||
|
v-close-popup
|
||||||
|
v-if="prop.node.uuid != '' && prop.node.name != $t('root')"
|
||||||
|
>
|
||||||
|
<q-item-section avatar
|
||||||
|
><q-icon color="red" name="delete"
|
||||||
|
/></q-item-section>
|
||||||
|
<q-item-section>{{ $t("delete") }} </q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
</q-popup-proxy>
|
</q-popup-proxy>
|
||||||
</q-item>
|
</q-item>
|
||||||
</template>
|
</template>
|
||||||
</q-tree>
|
</q-tree>
|
||||||
</div>
|
</div>
|
||||||
|
<group-dialog ref="group_dialog" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, computed } from "vue";
|
import { defineComponent, computed } from "vue";
|
||||||
import { useStore } from "src/store";
|
import { useStore } from "src/store";
|
||||||
import { SignalSourceTreeItemEntity } from "src/entities/SignalSourceEntity";
|
import { SignalSourceTreeItemEntity } from "src/entities/SignalSourceEntity";
|
||||||
|
import GroupDialog from "src/components/GroupDialog.vue";
|
||||||
import { Common } from "src/common/Common";
|
import { Common } from "src/common/Common";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "PageLeftToolBar",
|
name: "PageLeftToolBar",
|
||||||
|
|
||||||
components: {},
|
components: { GroupDialog },
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const $store = useStore();
|
const $store = useStore();
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
@keydown="
|
@keydown="
|
||||||
(evt) => {
|
(evt) => {
|
||||||
if (evt.keyCode == 13) {
|
if (evt.keyCode == 13) {
|
||||||
//
|
|
||||||
$refs?.password_input?.focus();
|
$refs?.password_input?.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,6 @@
|
||||||
width: item_witdh + 'px',
|
width: item_witdh + 'px',
|
||||||
height: item_height + 'px',
|
height: item_height + 'px',
|
||||||
}"
|
}"
|
||||||
@resize="(evt) => loga(evt)"
|
|
||||||
>
|
>
|
||||||
<q-popup-proxy context-menu>
|
<q-popup-proxy context-menu>
|
||||||
<q-popup-proxy context-menu />
|
<q-popup-proxy context-menu />
|
||||||
|
@ -99,6 +98,7 @@ import {
|
||||||
onMounted,
|
onMounted,
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
|
const elementResizeDetectorMaker = require("element-resize-detector");
|
||||||
import { Common } from "src/common/Common";
|
import { Common } from "src/common/Common";
|
||||||
import { Protocol } from "src/entities/WSProtocol";
|
import { Protocol } from "src/entities/WSProtocol";
|
||||||
import Window from "src/components/Window.vue";
|
import Window from "src/components/Window.vue";
|
||||||
|
@ -243,11 +243,6 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
EventBus.getInstance().on(EventNamesDefine.WindowResize, () => {
|
|
||||||
calcWallVWScaler();
|
|
||||||
calcWallItemWH();
|
|
||||||
});
|
|
||||||
|
|
||||||
interface _ResponseMessage {
|
interface _ResponseMessage {
|
||||||
packet: Protocol.PacketEntity;
|
packet: Protocol.PacketEntity;
|
||||||
data: string;
|
data: string;
|
||||||
|
@ -362,9 +357,20 @@ export default defineComponent({
|
||||||
_initialize({
|
_initialize({
|
||||||
$t,
|
$t,
|
||||||
$store,
|
$store,
|
||||||
}).then(() => {
|
});
|
||||||
calcWallItemWH();
|
|
||||||
calcWallVWScaler();
|
onMounted(() => {
|
||||||
|
if (wall.value) {
|
||||||
|
elementResizeDetectorMaker().listenTo(
|
||||||
|
wall.value,
|
||||||
|
(element: HTMLElement) => {
|
||||||
|
if (element) {
|
||||||
|
calcWallItemWH();
|
||||||
|
calcWallVWScaler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -387,6 +393,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
let uuid = e.dataTransfer?.getData("uuid");
|
let uuid = e.dataTransfer?.getData("uuid");
|
||||||
|
console.log(uuid);
|
||||||
if (uuid) {
|
if (uuid) {
|
||||||
let signal_sources = GlobalData.getInstance().signal_source.filter(
|
let signal_sources = GlobalData.getInstance().signal_source.filter(
|
||||||
(item) => (item as any)?.uuid == uuid
|
(item) => (item as any)?.uuid == uuid
|
||||||
|
@ -468,6 +475,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragOver(e: DragEvent) {
|
onDragOver(e: DragEvent) {
|
||||||
|
console.log(e.dataTransfer?.items);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
17
yarn.lock
17
yarn.lock
|
@ -1212,6 +1212,11 @@
|
||||||
electron-notarize "^0.1.1"
|
electron-notarize "^0.1.1"
|
||||||
electron-osx-sign "^0.4.11"
|
electron-osx-sign "^0.4.11"
|
||||||
|
|
||||||
|
"@types/element-resize-detector@^1.1.3":
|
||||||
|
version "1.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/element-resize-detector/-/element-resize-detector-1.1.3.tgz#0154ef4117305d26ab7a5ac16b83ee51f6b9bb8c"
|
||||||
|
integrity sha512-rqmeHxzNMPar/3IbdQRm+mydv8KlEXUtcp5M47rbZUEjslTjg+bT5+OXCknTCIy1AfvNR0Kio44iMY2zUH65CQ==
|
||||||
|
|
||||||
"@types/eslint-scope@^3.7.0":
|
"@types/eslint-scope@^3.7.0":
|
||||||
version "3.7.1"
|
version "3.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.1.tgz#8dc390a7b4f9dd9f1284629efce982e41612116e"
|
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.1.tgz#8dc390a7b4f9dd9f1284629efce982e41612116e"
|
||||||
|
@ -1868,6 +1873,11 @@ base64-js@^1.3.1, base64-js@^1.5.1:
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
||||||
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
|
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
|
||||||
|
|
||||||
|
batch-processor@1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/batch-processor/-/batch-processor-1.0.0.tgz#75c95c32b748e0850d10c2b168f6bdbe9891ace8"
|
||||||
|
integrity sha1-dclcMrdI4IUNEMKxaPa9vpiRrOg=
|
||||||
|
|
||||||
batch@0.6.1:
|
batch@0.6.1:
|
||||||
version "0.6.1"
|
version "0.6.1"
|
||||||
resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16"
|
resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16"
|
||||||
|
@ -2783,6 +2793,13 @@ electron-to-chromium@^1.3.793:
|
||||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.796.tgz#bd74a4367902c9d432d129f265bf4542cddd9f54"
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.796.tgz#bd74a4367902c9d432d129f265bf4542cddd9f54"
|
||||||
integrity sha512-agwJFgM0FUC1UPPbQ4aII3HamaaJ09fqWGAWYHmzxDWqdmTleCHyyA0kt3fJlTd5M440IaeuBfzXzXzCotnZcQ==
|
integrity sha512-agwJFgM0FUC1UPPbQ4aII3HamaaJ09fqWGAWYHmzxDWqdmTleCHyyA0kt3fJlTd5M440IaeuBfzXzXzCotnZcQ==
|
||||||
|
|
||||||
|
element-resize-detector@^1.2.3:
|
||||||
|
version "1.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/element-resize-detector/-/element-resize-detector-1.2.3.tgz#5078d9b99398fe4c589f8c8df94ff99e5d413ff3"
|
||||||
|
integrity sha512-+dhNzUgLpq9ol5tyhoG7YLoXL3ssjfFW+0gpszXPwRU6NjGr1fVHMEAF8fVzIiRJq57Nre0RFeIjJwI8Nh2NmQ==
|
||||||
|
dependencies:
|
||||||
|
batch-processor "1.0.0"
|
||||||
|
|
||||||
elementtree@0.1.7:
|
elementtree@0.1.7:
|
||||||
version "0.1.7"
|
version "0.1.7"
|
||||||
resolved "https://registry.yarnpkg.com/elementtree/-/elementtree-0.1.7.tgz#9ac91be6e52fb6e6244c4e54a4ac3ed8ae8e29c0"
|
resolved "https://registry.yarnpkg.com/elementtree/-/elementtree-0.1.7.tgz#9ac91be6e52fb6e6244c4e54a4ac3ed8ae8e29c0"
|
||||||
|
|
Loading…
Reference in New Issue