From b2978d5acc4e3dc50103a30fcd29006606d81ebc Mon Sep 17 00:00:00 2001
From: YuanFeng <770153798@qq.com>
Date: Wed, 11 Sep 2024 21:11:38 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BC=98=E5=8C=96=20?=
=?UTF-8?q?=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hangtag-ui/hangtag-ui-admin/build/vite/index.ts | 2 +-
.../DraftDesign/components/DesignPropEdit.vue | 11 +++++------
.../DraftDesign/components/node/ShapeImageNode.vue | 7 +++++--
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/hangtag-ui/hangtag-ui-admin/build/vite/index.ts b/hangtag-ui/hangtag-ui-admin/build/vite/index.ts
index 04d5c0b..a7decbf 100644
--- a/hangtag-ui/hangtag-ui-admin/build/vite/index.ts
+++ b/hangtag-ui/hangtag-ui-admin/build/vite/index.ts
@@ -84,7 +84,7 @@ export function createVitePlugins() {
viteCompression({
verbose: true, // 是否在控制台输出压缩结果
disable: false, // 是否禁用
- threshold: 10240, // 体积大于 threshold 才会被压缩,单位 b
+ threshold: 5120, // 体积大于 threshold 才会被压缩,单位 b
algorithm: 'gzip', // 压缩算法,可选 [ 'gzip' , 'brotliCompress' ,'deflate' , 'deflateRaw']
ext: '.gz', // 生成的压缩包后缀
deleteOriginFile: false //压缩后是否删除源文件
diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue
index 9968de7..c2458f1 100644
--- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue
+++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue
@@ -198,7 +198,7 @@
+ :class="{ 'hidden-div': false }">
@@ -241,7 +241,7 @@ const that = reactive({
draftDesignList: [],
draftDesignId: '',
reView: false,
- currentZoom: 1,
+ currentZoom: 6,
changeCount: 0,
previewUrl: "",
ingredientInfoList: [],
@@ -434,11 +434,10 @@ const loadConfig = (config: object, propData = {}) => {
// true, conf.pageConfig, conf.data, test
draftDesignEditRef.value.init(false, that.pageConfig, that.data, that.propInfo)
queryUseLabel();
- // 延时加载图片
+
setTimeout(()=>{
- that.currentZoom = 6;
- loading.value = false
- },800)
+ showPng();
+ },200)
}
const queryUseLabel = (label) => {
diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue
index 4f52231..e17e939 100644
--- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue
+++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue
@@ -14,7 +14,7 @@
:style="svgStyle"
>
{
// @ts-ignore
- this.hrefBase64 = res
+ // this.hrefBase64 = res
+ this.cellInfo.style.shape.href = res
})
}
setTimeout(() => {
From f4c0e96bcbbd98bb34103670a716c090384c266d Mon Sep 17 00:00:00 2001
From: YuanFeng <770153798@qq.com>
Date: Wed, 11 Sep 2024 22:23:28 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E5=8A=A0=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../infra/framework/file/core/utils/FileTypeUtils.java | 5 +++++
.../DraftDesign/components/DesignPropEdit.vue | 10 ++++------
.../DraftDesign/components/node/ShapeImageNode.vue | 7 ++++---
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java b/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java
index 71fdc7d..1a9cef2 100644
--- a/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java
+++ b/hangtag-module-infra/hangtag-module-infra-biz/src/main/java/cn/hangtag/module/infra/framework/file/core/utils/FileTypeUtils.java
@@ -69,6 +69,11 @@ public class FileTypeUtils {
response.setHeader("Content-Range", String.valueOf(content.length - 1));
response.setHeader("Accept-Ranges", "bytes");
}
+ if (contentType.startsWith("image/")) {
+ // 设置缓存
+ response.setHeader("Cache-Control", "max-age=604800");
+ response.setHeader("Pragma", "public");
+ }
// 输出附件
IoUtil.write(response.getOutputStream(), false, content);
}
diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue
index c2458f1..56f8a44 100644
--- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue
+++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue
@@ -198,7 +198,7 @@
+ :class="{ 'hidden-div': true }">
@@ -437,7 +437,7 @@ const loadConfig = (config: object, propData = {}) => {
setTimeout(()=>{
showPng();
- },200)
+ },100)
}
const queryUseLabel = (label) => {
@@ -498,17 +498,15 @@ const showPng = () => {
loading.value = true
setTimeout(() => {
draftDesignEditRef.value.toPngUrl((url) => {
+ console.log("url",url)
that.previewUrl = url
const info = draftDesignEditRef.value.getPropInfo();
-
that.propInfo = {
...info.propDefault,
...that.propInfo || {}
};
that.propOrderByList = info.propOrderByList;
- setTimeout(() => {
- submit();
- }, 100)
+ submit();
loading.value = false;
}, {
widthScale: that.currentZoom,
diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue
index e17e939..2463fbc 100644
--- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue
+++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/node/ShapeImageNode.vue
@@ -14,7 +14,7 @@
:style="svgStyle"
>
{
+ console.log("convertImageToBase64",this.cellInfo.style.shape.href,res)
// @ts-ignore
- // this.hrefBase64 = res
- this.cellInfo.style.shape.href = res
+ this.hrefBase64 = res
+ // this.cellInfo.style.shape.hrefBase64 = res
})
}
setTimeout(() => {
From 01819f18113668fc6622f9b207647d41d0ae980f Mon Sep 17 00:00:00 2001
From: YuanFeng <770153798@qq.com>
Date: Wed, 11 Sep 2024 22:47:58 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E6=97=A0=E6=95=88?=
=?UTF-8?q?=E7=9A=84=E5=B1=9E=E6=80=A7=E7=BB=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../hangtag-ui-admin/src/components/DraftDesign/index.vue | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue
index 4d917f3..6646a35 100644
--- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue
+++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue
@@ -1487,6 +1487,7 @@ const submitProp = (data) => {
newNode.attr('body/scaling', 'none')
data.cellIds.push(newNode.id)
graph.addNode(newNode)
+
}
removeGroup(data.groupId);
data.maxSize = Math.min(data.pointList.length, data.maxSize)
@@ -1513,6 +1514,7 @@ const removeEmptyGroup = () => {
delIndex.push(i)
}
}
+ console.debug("delIndex", delIndex)
for (let i = 0; i < delIndex.length; i++) {
that.pageConfig.propList.splice(delIndex[i], 1)
}
From 2ffe759adb2881af7d9d489a1927403c1e7db381 Mon Sep 17 00:00:00 2001
From: YuanFeng <770153798@qq.com>
Date: Wed, 11 Sep 2024 23:10:05 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=AE=BE=E8=AE=A1?=
=?UTF-8?q?=E7=A8=BF=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DraftDesign/components/DynamicPropConfig.vue | 2 +-
.../src/components/DraftDesign/index.vue | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue
index c1aeef9..4dbbb56 100644
--- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue
+++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DynamicPropConfig.vue
@@ -18,7 +18,7 @@
"位置信息配置为节点的位置信息。如:添加了3个配置数据这时会依次添加到对应位置上。从而实现动态属性配置。"
-
+
diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue
index 6646a35..c0f5594 100644
--- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue
+++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue
@@ -1509,15 +1509,24 @@ const removeEmptyGroup = () => {
}
let delIndex = []
+ let allKey = []
for (let i = 0; i < that.pageConfig.propList.length; i++) {
if(!propGroupIdList.includes(that.pageConfig.propList[i].groupId)){
delIndex.push(i)
+ continue;
}
+ allKey.push(that.pageConfig.propList[i].groupId)
}
- console.debug("delIndex", delIndex)
for (let i = 0; i < delIndex.length; i++) {
that.pageConfig.propList.splice(delIndex[i], 1)
}
+ let newArr = []
+ for (let i = 0; i < that.pageConfig.propOrderByList.length; i++) {
+ if(allKey.includes(that.pageConfig.propOrderByList[i].key)){
+ newArr.push(that.pageConfig.propOrderByList[i])
+ }
+ }
+ that.pageConfig.propOrderByList = newArr
}
const orderByPropList = () => {