diff --git a/core/core-backend/pom.xml b/core/core-backend/pom.xml
index 0c2596d5a1..1511dd600b 100644
--- a/core/core-backend/pom.xml
+++ b/core/core-backend/pom.xml
@@ -131,6 +131,21 @@
flexmark-all
${flexmark.version}
+
+ io.dataease
+ xpack-permissions
+ ${project.version}
+
+
+ io.dataease
+ xpack-sync
+ ${project.version}
+
+
+ io.dataease
+ xpack-base
+ ${project.version}
+
diff --git a/core/core-frontend/src/custom-component/de-tabs/Component.vue b/core/core-frontend/src/custom-component/de-tabs/Component.vue
index 78e3b8b8d9..d5d2603979 100644
--- a/core/core-frontend/src/custom-component/de-tabs/Component.vue
+++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue
@@ -40,16 +40,15 @@
编辑标题
-
+
+ 复制
+
删除
-
- 复制
-
@@ -265,8 +264,12 @@ function deleteCur(param) {
}
}
function copyCur(param) {
- state.curItem = param
- element.value.propValue.push(deepCopyTabItemHelper(element.value.id, param))
+ addTab()
+ const newTabItem = element.value.propValue[element.value.propValue.length - 1]
+ const idMap = {}
+ const newCanvasId = element.value.id + '--' + newTabItem.name
+ newTabItem.componentData = deepCopyTabItemHelper(newCanvasId, param.componentData, idMap)
+ dvMainStore.updateCopyCanvasView(idMap)
}
function editCurTitle(param) {
@@ -284,6 +287,9 @@ function handleCommand(command) {
case 'deleteCur':
deleteCur(command.param)
break
+ case 'copyCur':
+ copyCur(command.param)
+ break
}
}
diff --git a/core/core-frontend/src/store/modules/data-visualization/copy.ts b/core/core-frontend/src/store/modules/data-visualization/copy.ts
index 4cb9cdaf73..48bfcb8825 100644
--- a/core/core-frontend/src/store/modules/data-visualization/copy.ts
+++ b/core/core-frontend/src/store/modules/data-visualization/copy.ts
@@ -184,17 +184,14 @@ export const copyStore = defineStore('copy', {
}
})
-export function deepCopyTabItemHelper(tabId, tabItem, idMap) {
- const result = deepCopy(tabItem)
- const newComponentId = generateID()
- result.id = newComponentId
- result.componentData = []
- tabItem.componentData.forEach(item => {
+export function deepCopyTabItemHelper(newCanvasId, tabComponentData, idMap) {
+ const resultComponentData = []
+ tabComponentData.forEach(item => {
const newItem = deepCopyHelper(item, idMap)
- newItem.canvasId = tabId + '--' + newComponentId
- result.componentData.push(deepCopyHelper(item, idMap))
+ newItem.canvasId = newCanvasId
+ resultComponentData.push(newItem)
})
- return result
+ return resultComponentData
}
function deepCopyHelper(data, idMap) {
diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
index d1ef18a1b9..5a2f9c766d 100644
--- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
+++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts
@@ -380,6 +380,10 @@ export const dvMainStore = defineStore('dataVisualization', {
}
})
}
+ //组件组内部可能还有多个图表
+ this.updateCopyCanvasView(idMap, canvasViewInfoPre)
+ },
+ updateCopyCanvasView(idMap, canvasViewInfoPre = this.canvasViewInfo) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const _this = this
//组件组内部可能还有多个图表