From d22275bffbbaf4603a0151c9d65849bf9fb52f94 Mon Sep 17 00:00:00 2001 From: donghao Date: Thu, 22 Aug 2024 17:47:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=A3=E5=86=B3=E5=B8=83=E7=82=B9?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Action/src/isAction.tsx | 25 +- src/components/Action/src/isDelete.tsx | 6 +- src/core/ServersPlugin.ts | 6 +- src/core/plugin/WorkspacePlugin.ts | 6 +- src/views/deviceSetting/components/add.scss | 8 + src/views/deviceSetting/components/add.vue | 5 +- .../deviceSetting/components/deviceAttr.vue | 184 ++--------- .../deviceSetting/components/deviceSelect.vue | 301 ++++++++---------- src/views/deviceSetting/components/edit.vue | 11 +- .../deviceSetting/hooks/useDeviceObject.ts | 109 ++++++- .../deviceSetting/hooks/useDeviceObject1.ts | 17 - .../deviceSetting/hooks/usePointObject.ts | 14 +- src/views/deviceSetting/index.vue | 126 +++++--- 13 files changed, 405 insertions(+), 413 deletions(-) diff --git a/src/components/Action/src/isAction.tsx b/src/components/Action/src/isAction.tsx index 48f5b2f..b15a01d 100644 --- a/src/components/Action/src/isAction.tsx +++ b/src/components/Action/src/isAction.tsx @@ -2,7 +2,7 @@ * @Author: donghao donghao@supervision.ltd * @Date: 2024-08-20 15:31:30 * @LastEditors: donghao donghao@supervision.ltd - * @LastEditTime: 2024-08-20 16:00:47 + * @LastEditTime: 2024-08-22 17:42:58 * @FilePath: \General-AI-Platform-Web-Client\src\components\TableActionCard\isAction.tsx * @Description: 是否操作行为 */ @@ -23,14 +23,14 @@ export default defineComponent({ default: "确定要操作吗?" }, visible: { - type: Boolean as PropType, - required: true + type: Boolean as PropType + // required: true } }, emits: ["update:visible", "confirm"], setup(props, { emit }) { - // const visible = ref(props.visible); - + const { visible } = toRefs(props); + const localVisible = ref(visible.value); const handleConfirm = () => { emit("confirm"); // visible.value = false; @@ -38,27 +38,24 @@ export default defineComponent({ }; const handleCancel = () => { - // visible.value = false; + // localVisible.value = false; emit("update:visible", false); }; const handleClose = () => { - // visible.value = false; + // localVisible.value = false; emit("update:visible", false); // done(); }; - watch( - () => props.visible, - val => { - visible.value = val; - } - ); + watch(visible, newVal => { + localVisible.value = newVal; + }); return () => ( void) => { + const handleClose = () => { // visible.value = false; emit("update:visible", false); // done(); diff --git a/src/core/ServersPlugin.ts b/src/core/ServersPlugin.ts index d7a7272..6443c45 100644 --- a/src/core/ServersPlugin.ts +++ b/src/core/ServersPlugin.ts @@ -2,7 +2,7 @@ * @Author: zhoux zhouxia@supervision.ltd * @Date: 2023-11-29 09:31:35 * @LastEditors: donghao donghao@supervision.ltd - * @LastEditTime: 2024-08-06 17:12:48 + * @LastEditTime: 2024-08-22 09:46:30 * @FilePath: \vue-fabric-editor\src\core\ServersPlugin.ts * @Description: 内部插件 */ @@ -71,7 +71,7 @@ class ServersPlugin { }); } - insertSvgFile(jsonFile) { + insertSvgFile(jsonFile, callback) { console.log(jsonFile, "insertSvgFile"); // 加载前钩子 this.editor.hooksEntity.hookImportBefore.callAsync(jsonFile, () => { @@ -80,6 +80,8 @@ class ServersPlugin { // 加载后钩子 this.editor.hooksEntity.hookImportAfter.callAsync(jsonFile, () => { this.canvas.renderAll(); + callback && callback(); + console.log(this.canvas, "afterInsertSvgFile"); }); }); }); diff --git a/src/core/plugin/WorkspacePlugin.ts b/src/core/plugin/WorkspacePlugin.ts index c1182b5..48c882d 100644 --- a/src/core/plugin/WorkspacePlugin.ts +++ b/src/core/plugin/WorkspacePlugin.ts @@ -2,7 +2,7 @@ * @Author: 秦少卫 * @Date: 2023-06-27 12:26:41 * @LastEditors: donghao donghao@supervision.ltd - * @LastEditTime: 2024-08-06 17:30:13 + * @LastEditTime: 2024-08-21 15:59:11 * @Description: 画布区域插件 */ @@ -201,12 +201,12 @@ class WorkspacePlugin { // 自动缩放 auto() { const scale = this._getScale(); - this.setZoomAuto(scale - 0.08); + this.setZoomAuto(scale); } // 1:1 放大 one() { - this.setZoomAuto(0.8 - 0.08); + this.setZoomAuto(0.8); this.canvas.requestRenderAll(); } diff --git a/src/views/deviceSetting/components/add.scss b/src/views/deviceSetting/components/add.scss index b12134d..738665b 100644 --- a/src/views/deviceSetting/components/add.scss +++ b/src/views/deviceSetting/components/add.scss @@ -12,3 +12,11 @@ text-transform: none; } } +.point_dialog_wrap { + .el-dialog__header { + padding: 16px 24px 0; + } + .el-dialog__body { + padding: 24px; + } +} diff --git a/src/views/deviceSetting/components/add.vue b/src/views/deviceSetting/components/add.vue index 90b6d51..c32fb3b 100644 --- a/src/views/deviceSetting/components/add.vue +++ b/src/views/deviceSetting/components/add.vue @@ -2,7 +2,7 @@ * @Author: donghao donghao@supervision.ltd * @Date: 2024-08-07 14:47:44 * @LastEditors: donghao donghao@supervision.ltd - * @LastEditTime: 2024-08-16 14:09:05 + * @LastEditTime: 2024-08-21 13:44:44 * @FilePath: \General-AI-Platform-Web-Client\src\views\deviceSetting\components\add.vue * @Description: 新建位置 --> @@ -105,11 +105,12 @@ defineExpose({