-
-
-
- 暂未开放
-
-
+
+
+
+
+
+
+
+ 本页面为数据可视化大屏中设备点位界面的配置页,通过上传设备所处区域的实拍图或平面图后,根据设备的实际位置,简单的使用拖拽等操作将设备列表中的设备与位置进行匹配,使之能够在数据可视化大屏中更加精细化而直观的了解设备的具体位置与状态。
+
+
+ 新建位置
+
+
+
- 抱歉,你访问的页面暂未开放
-
-
- 返回首页
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/deviceSetting/testData/bg01.json b/src/views/deviceSetting/testData/bg01.json
new file mode 100644
index 0000000..51eeb38
--- /dev/null
+++ b/src/views/deviceSetting/testData/bg01.json
@@ -0,0 +1,85 @@
+{
+ "version": "5.3.0",
+ "objects": [
+ {
+ "type": "rect",
+ "version": "5.3.0",
+ "originX": "left",
+ "originY": "top",
+ "left": 0,
+ "top": 0,
+ "width": 1200,
+ "height": 900,
+ "fill": "rgba(255,255,255,1)",
+ "stroke": null,
+ "strokeWidth": 0,
+ "strokeDashArray": null,
+ "strokeLineCap": "butt",
+ "strokeDashOffset": 0,
+ "strokeLineJoin": "miter",
+ "strokeUniform": false,
+ "strokeMiterLimit": 4,
+ "scaleX": 1,
+ "scaleY": 1,
+ "angle": 0,
+ "flipX": false,
+ "flipY": false,
+ "opacity": 1,
+ "shadow": null,
+ "visible": true,
+ "backgroundColor": "",
+ "fillRule": "nonzero",
+ "paintFirst": "fill",
+ "globalCompositeOperation": "source-over",
+ "skewX": 0,
+ "skewY": 0,
+ "rx": 0,
+ "ry": 0,
+ "id": "workspace",
+ "selectable": false,
+ "hasControls": false
+ },
+ {
+ "type": "image",
+ "version": "5.3.0",
+ "originX": "left",
+ "originY": "top",
+ "left": 23.2346,
+ "top": 23.0507,
+ "width": 1600,
+ "height": 1200,
+ "fill": "rgb(0,0,0)",
+ "stroke": null,
+ "strokeWidth": 0,
+ "strokeDashArray": null,
+ "strokeLineCap": "butt",
+ "strokeDashOffset": 0,
+ "strokeLineJoin": "miter",
+ "strokeUniform": false,
+ "strokeMiterLimit": 4,
+ "scaleX": 0.721,
+ "scaleY": 0.721,
+ "angle": 0,
+ "flipX": false,
+ "flipY": false,
+ "opacity": 1,
+ "shadow": null,
+ "visible": true,
+ "backgroundColor": "",
+ "fillRule": "nonzero",
+ "paintFirst": "fill",
+ "globalCompositeOperation": "source-over",
+ "skewX": 0,
+ "skewY": 0,
+ "cropX": 0,
+ "cropY": 0,
+ "id": "a3ab29c6-7008-49fe-abf3-edc9a47cd460",
+ "selectable": false,
+ "hasControls": false,
+ "evented": false,
+ "crossOrigin": null,
+ "src": "https://img.cgmodel.com/image/2020/1010/big/1537169-1390622992.jpg",
+ "filters": []
+ }
+ ]
+}
diff --git a/src/views/deviceSetting/testData/room2.png b/src/views/deviceSetting/testData/room2.png
new file mode 100644
index 0000000..4c23916
Binary files /dev/null and b/src/views/deviceSetting/testData/room2.png differ
diff --git a/src/views/deviceSetting/testData/房间平面图 (4).png b/src/views/deviceSetting/testData/房间平面图 (4).png
new file mode 100644
index 0000000..1928c87
Binary files /dev/null and b/src/views/deviceSetting/testData/房间平面图 (4).png differ
diff --git a/src/views/deviceSetting/testData/房间平面图.png b/src/views/deviceSetting/testData/房间平面图.png
new file mode 100644
index 0000000..0a90aa9
Binary files /dev/null and b/src/views/deviceSetting/testData/房间平面图.png differ
diff --git a/types/auto-imports.d.ts b/types/auto-imports.d.ts
new file mode 100644
index 0000000..d5e7dcf
--- /dev/null
+++ b/types/auto-imports.d.ts
@@ -0,0 +1,78 @@
+/* eslint-disable */
+/* prettier-ignore */
+// @ts-nocheck
+// noinspection JSUnusedGlobalSymbols
+// Generated by unplugin-auto-import
+export {}
+declare global {
+ const EffectScope: typeof import("vue")["EffectScope"];
+ const computed: typeof import("vue")["computed"];
+ const createApp: typeof import("vue")["createApp"];
+ const customRef: typeof import("vue")["customRef"];
+ const defineAsyncComponent: typeof import("vue")["defineAsyncComponent"];
+ const defineComponent: typeof import("vue")["defineComponent"];
+ const effectScope: typeof import("vue")["effectScope"];
+ const getCurrentInstance: typeof import("vue")["getCurrentInstance"];
+ const getCurrentScope: typeof import("vue")["getCurrentScope"];
+ const h: typeof import("vue")["h"];
+ const inject: typeof import("vue")["inject"];
+ const isProxy: typeof import("vue")["isProxy"];
+ const isReactive: typeof import("vue")["isReactive"];
+ const isReadonly: typeof import("vue")["isReadonly"];
+ const isRef: typeof import("vue")["isRef"];
+ const markRaw: typeof import("vue")["markRaw"];
+ const nextTick: typeof import("vue")["nextTick"];
+ const onActivated: typeof import("vue")["onActivated"];
+ const onBeforeMount: typeof import("vue")["onBeforeMount"];
+ const onBeforeUnmount: typeof import("vue")["onBeforeUnmount"];
+ const onBeforeUpdate: typeof import("vue")["onBeforeUpdate"];
+ const onDeactivated: typeof import("vue")["onDeactivated"];
+ const onErrorCaptured: typeof import("vue")["onErrorCaptured"];
+ const onMounted: typeof import("vue")["onMounted"];
+ const onRenderTracked: typeof import("vue")["onRenderTracked"];
+ const onRenderTriggered: typeof import("vue")["onRenderTriggered"];
+ const onScopeDispose: typeof import("vue")["onScopeDispose"];
+ const onServerPrefetch: typeof import("vue")["onServerPrefetch"];
+ const onUnmounted: typeof import("vue")["onUnmounted"];
+ const onUpdated: typeof import("vue")["onUpdated"];
+ const provide: typeof import("vue")["provide"];
+ const reactive: typeof import("vue")["reactive"];
+ const readonly: typeof import("vue")["readonly"];
+ const ref: typeof import("vue")["ref"];
+ const resolveComponent: typeof import("vue")["resolveComponent"];
+ const shallowReactive: typeof import("vue")["shallowReactive"];
+ const shallowReadonly: typeof import("vue")["shallowReadonly"];
+ const shallowRef: typeof import("vue")["shallowRef"];
+ const toRaw: typeof import("vue")["toRaw"];
+ const toRef: typeof import("vue")["toRef"];
+ const toRefs: typeof import("vue")["toRefs"];
+ const toValue: typeof import("vue")["toValue"];
+ const triggerRef: typeof import("vue")["triggerRef"];
+ const unref: typeof import("vue")["unref"];
+ const useAttrs: typeof import("vue")["useAttrs"];
+ const useCssModule: typeof import("vue")["useCssModule"];
+ const useCssVars: typeof import("vue")["useCssVars"];
+ const useSlots: typeof import("vue")["useSlots"];
+ const watch: typeof import("vue")["watch"];
+ const watchEffect: typeof import("vue")["watchEffect"];
+ const watchPostEffect: typeof import("vue")["watchPostEffect"];
+ const watchSyncEffect: typeof import("vue")["watchSyncEffect"];
+}
+// for type re-export
+declare global {
+ // @ts-ignore
+ export type {
+ Component,
+ ComponentPublicInstance,
+ ComputedRef,
+ ExtractDefaultPropTypes,
+ ExtractPropTypes,
+ ExtractPublicPropTypes,
+ InjectionKey,
+ PropType,
+ Ref,
+ VNode,
+ WritableComputedRef
+ } from "vue";
+ import("vue");
+}
diff --git a/types/editor.d.ts b/types/editor.d.ts
new file mode 100644
index 0000000..7d3a7ef
--- /dev/null
+++ b/types/editor.d.ts
@@ -0,0 +1,45 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-05-13 18:53:44
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2023-06-27 22:44:31
+ * @Description: file content
+ */
+
+declare interface IPluginOption {
+ [propName: string]: unknown;
+}
+
+// 生命周期事件类型
+declare type IEditorHooksType =
+ | "hookImportBefore"
+ | "hookImportAfter"
+ | "hookSaveBefore"
+ | "hookSaveAfter";
+
+// 插件class
+declare interface IPluginClass extends IPluginTempl {
+ new (
+ canvas: fabric.Canvas,
+ editor: any,
+ options: IPluginOption
+ ): IPluginTempl;
+}
+
+declare interface IPluginMenu {
+ text: string;
+ command?: () => void;
+ child?: IPluginMenu[];
+}
+
+// 插件实例
+declare interface IPluginTempl {
+ pluginName: string;
+ events: string[];
+ apis: string[];
+ canvas: fabric.Canvas;
+ hotkeyEvent: (name: string, e: Event) => viode;
+ [propName: IEditorHooksType]: () => void;
+ [propName: string]: any;
+}
diff --git a/types/env.d.ts b/types/env.d.ts
new file mode 100644
index 0000000..74b8d34
--- /dev/null
+++ b/types/env.d.ts
@@ -0,0 +1,30 @@
+///
+
+// import { Object } from 'fabric/fabric-impl';
+
+declare module "*.vue" {
+ import type { DefineComponent } from "vue";
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
+ const component: DefineComponent<{}, {}, any>;
+ export default component;
+}
+
+declare global {
+ declare module "fabric/fabric-impl" {
+ interface IObjectOptions {
+ /**
+ * 标识
+ */
+ id?: string | undefined;
+ }
+ }
+}
+
+export as namespace vfe;
+declare module "vfe" {
+ export as namespace vfe;
+ export interface ICanvas extends fabric.Canvas {
+ c: fabric.Canvas;
+ editor: Editor;
+ }
+}
diff --git a/types/extends.d.ts b/types/extends.d.ts
new file mode 100644
index 0000000..db6c37e
--- /dev/null
+++ b/types/extends.d.ts
@@ -0,0 +1,35 @@
+declare namespace fabric {
+ export interface Canvas {
+ contextTop: CanvasRenderingContext2D;
+ lowerCanvasEl: HTMLElement;
+ _currentTransform: unknown;
+ _centerObject: (obj: fabric.Object, center: fabric.Point) => fabric.Canvas;
+ }
+
+ export interface Control {
+ rotate: number;
+ }
+
+ function ControlMouseEventHandler(
+ eventData: MouseEvent,
+ transformData: Transform,
+ x: number,
+ y: number
+ ): boolean;
+ function ControlStringHandler(
+ eventData: MouseEvent,
+ control: fabric.Control,
+ fabricObject: fabric.Object
+ ): string;
+ export const controlsUtils: {
+ rotationWithSnapping: ControlMouseEventHandler;
+ scalingEqually: ControlMouseEventHandler;
+ scalingYOrSkewingX: ControlMouseEventHandler;
+ scalingXOrSkewingY: ControlMouseEventHandler;
+
+ scaleCursorStyleHandler: ControlStringHandler;
+ scaleSkewCursorStyleHandler: ControlStringHandler;
+ scaleOrSkewActionName: ControlStringHandler;
+ rotationStyleHandler: ControlStringHandler;
+ };
+}
diff --git a/vite.config.ts b/vite.config.ts
index aac4625..053c024 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-22 13:38:05
* @LastEditors: donghao donghao@supervision.ltd
- * @LastEditTime: 2024-02-22 14:18:31
+ * @LastEditTime: 2024-08-07 17:09:15
* @FilePath: \General-AI-Platform-Web-Client\vite.config.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -13,7 +13,7 @@ import { warpperEnv } from "./build";
import { getPluginsList } from "./build/plugins";
import { include, exclude } from "./build/optimize";
import { UserConfigExport, ConfigEnv, loadEnv } from "vite";
-
+import autoImports from "unplugin-auto-import/vite";
/** 当前执行node命令时文件夹的地址(工作目录) */
const root: string = process.cwd();
@@ -23,10 +23,10 @@ const pathResolve = (dir: string): string => {
};
/** 设置别名 */
-const alias: Record
= {
- "@": pathResolve("src"),
- "@build": pathResolve("build")
-};
+// const alias: Record = {
+// "@": pathResolve("src"),
+// "@build": pathResolve("build")
+// };
const { dependencies, devDependencies, name, version } = pkg;
const __APP_INFO__ = {
@@ -41,7 +41,11 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
base: VITE_PUBLIC_PATH,
root,
resolve: {
- alias
+ alias: [
+ { find: /^@\//, replacement: resolve(__dirname, "src") + "/" },
+ { find: /^~/, replacement: "" },
+ { find: /^@build\//, replacement: pathResolve("build") }
+ ]
},
// 服务端渲染
server: {
@@ -60,7 +64,16 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
}
}
},
- plugins: getPluginsList(command, VITE_CDN, VITE_COMPRESSION),
+ plugins: [
+ getPluginsList(command, VITE_CDN, VITE_COMPRESSION),
+ autoImports({
+ imports: ["vue"],
+ eslintrc: {
+ enabled: true
+ }
+ })
+ ],
+
// https://cn.vitejs.dev/config/dep-optimization-options.html#dep-optimization-options
optimizeDeps: {
include,