From 7d84ef3cbc5454d76ef91f0f1c79a63854ab2012 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Fri, 13 Aug 2021 16:50:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=95=E5=9B=BE=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=EF=BC=8C=E5=BA=95=E5=9B=BE=E4=B8=8A=E4=BC=A0=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + quasar.conf.js | 2 +- src/boot/axios.ts | 9 +- src/boot/v-viewer.ts | 12 ++ src/common/ClientConnection.ts | 21 +++ src/components/BackgroundImageDialog.vue | 209 +++++++++++++++++++++++ src/components/GridSettingDialog.vue | 133 +++++++++++++++ src/components/GroupDialog.vue | 2 +- src/components/SignalSourceDialog.vue | 2 +- src/entities/ApplicationConfigEntity.ts | 3 + src/entities/HttpProtocol.ts | 13 ++ src/entities/WSProtocol.ts | 22 +++ src/i18n/zh-CN/index.ts | 8 + src/layouts/MainLayout.vue | 102 ++++++----- src/pages/TopToolBar.vue | 57 ++++++- src/pages/WallPage.vue | 4 + src/store/index.ts | 7 +- yarn.lock | 13 ++ 18 files changed, 566 insertions(+), 54 deletions(-) create mode 100644 src/boot/v-viewer.ts create mode 100644 src/components/BackgroundImageDialog.vue create mode 100644 src/components/GridSettingDialog.vue create mode 100644 src/entities/HttpProtocol.ts diff --git a/package.json b/package.json index 8028276..06fcae7 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "core-js": "^3.6.5", "element-resize-detector": "^1.2.3", "quasar": "^2.0.0", + "v-viewer": "^3.0.9", "vue-i18n": "^9.0.0-beta.0", "vuex": "^4.0.1" }, diff --git a/quasar.conf.js b/quasar.conf.js index 05a0120..e6e79b0 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -19,7 +19,7 @@ module.exports = configure(function (ctx) { // app boot file (/src/boot) // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli/boot-files - boot: ["i18n", "axios"], + boot: ["i18n", "axios", "v-viewer"], // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css css: ["app.scss"], diff --git a/src/boot/axios.ts b/src/boot/axios.ts index 408a99d..b350ffe 100644 --- a/src/boot/axios.ts +++ b/src/boot/axios.ts @@ -1,7 +1,7 @@ -import { boot } from 'quasar/wrappers'; -import axios, { AxiosInstance } from 'axios'; +import { boot } from "quasar/wrappers"; +import axios, { AxiosInstance } from "axios"; -declare module '@vue/runtime-core' { +declare module "@vue/runtime-core" { interface ComponentCustomProperties { $axios: AxiosInstance; } @@ -13,7 +13,8 @@ declare module '@vue/runtime-core' { // good idea to move this instance creation inside of the // "export default () => {}" function below (which runs individually // for each client) -const api = axios.create({ baseURL: 'https://api.example.com' }); +const api = axios.create({ baseURL: "https://api.example.com" }); +api.defaults.headers.common["X-Product-Name"] = "RK_3568"; export default boot(({ app }) => { // for use inside Vue files (Options API) through this.$axios and this.$api diff --git a/src/boot/v-viewer.ts b/src/boot/v-viewer.ts new file mode 100644 index 0000000..3aa6626 --- /dev/null +++ b/src/boot/v-viewer.ts @@ -0,0 +1,12 @@ +import { boot } from "quasar/wrappers"; + +import "viewerjs/dist/viewer.css"; +import VueViewer from "v-viewer"; + +export default boot(({ app }) => { + app.use(VueViewer, { + defaultOptions: { + zIndex: 99999, + }, + }); +}); diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 4a1913d..7a22123 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -366,6 +366,27 @@ export default class ClientConnection { } } + public setApplicationConfig(wall_row: number, wall_col: number) { + this.ws?.send( + JSON.stringify( + new Protocol.SetApplicationConfigRequestEntity( + 0, + "wall_row", + wall_row.toString() + ) + ) + ); + this.ws?.send( + JSON.stringify( + new Protocol.SetApplicationConfigRequestEntity( + 0, + "wall_col", + wall_col.toString() + ) + ) + ); + } + private _destoryed = false; public destory() { this._destoryed = true; diff --git a/src/components/BackgroundImageDialog.vue b/src/components/BackgroundImageDialog.vue new file mode 100644 index 0000000..6c31235 --- /dev/null +++ b/src/components/BackgroundImageDialog.vue @@ -0,0 +1,209 @@ + + + + + diff --git a/src/components/GridSettingDialog.vue b/src/components/GridSettingDialog.vue new file mode 100644 index 0000000..d626d32 --- /dev/null +++ b/src/components/GridSettingDialog.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/src/components/GroupDialog.vue b/src/components/GroupDialog.vue index f23d450..6315b87 100644 --- a/src/components/GroupDialog.vue +++ b/src/components/GroupDialog.vue @@ -1,5 +1,5 @@