diff --git a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue
index 5da20aa54e..104db7660b 100644
--- a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue
+++ b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue
@@ -188,6 +188,11 @@ const bottomComponent = () => {
menuOpt('bottomComponent')
}
+const customSort = () => {
+ // do customSort
+ eventBus.emit('tabSort')
+}
+
const componentCompose = () => {
composeStore.compose()
snapshotStore.recordSnapshotCache('componentCompose')
@@ -291,6 +296,7 @@ const editQueryCriteria = () => {
下移一层
置于顶层
置于底层
+ 排序
-
+
@@ -227,7 +227,6 @@ import { ElMessage, ElTooltip, ElButton } from 'element-plus-secondary'
import CustomTabsSort from '@/custom-component/de-tabs/CustomTabsSort.vue'
import { exportPivotExcel } from '@/views/chart/components/js/panel/common/common_table'
import { XpackComponent } from '@/components/plugin'
-import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue'
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
const copyStore = copyStoreWithOut()
@@ -356,7 +355,7 @@ const state = reactive({
})
const tabSort = () => {
- customTabsSortRef.value.sortInit()
+ customTabsSortRef.value.sortInit(element.value)
}
const downloadClick = () => {
diff --git a/core/core-frontend/src/custom-component/de-tabs/CustomTabsSort.vue b/core/core-frontend/src/custom-component/de-tabs/CustomTabsSort.vue
index 29b196ec3e..13d5d5214c 100644
--- a/core/core-frontend/src/custom-component/de-tabs/CustomTabsSort.vue
+++ b/core/core-frontend/src/custom-component/de-tabs/CustomTabsSort.vue
@@ -40,35 +40,27 @@ import { ElButton } from 'element-plus-secondary'
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
import eventBus from '@/utils/eventBus'
const snapshotStore = snapshotStoreWithOut()
-const props = defineProps({
- element: {
- type: Object,
- required: true
- }
-})
-onMounted(() => {
- init()
-})
-const { element } = toRefs(props)
+const config = ref(null)
const sortList = ref([])
const dialogShow = ref(false)
-const sortInit = () => {
- init()
+const sortInit = component => {
+ init(component)
dialogShow.value = true
}
-const init = () => {
- sortList.value = deepCopy(element.value.propValue)
+const init = component => {
+ config.value = component
+ sortList.value = deepCopy(config.value.propValue)
}
const closeDialog = () => {
dialogShow.value = false
}
const save = () => {
- element.value.propValue = deepCopy(sortList.value)
+ config.value.propValue = deepCopy(sortList.value)
snapshotStore.recordSnapshotCache()
- eventBus.emit('onTabSortChange-' + element.value.id)
+ eventBus.emit('onTabSortChange-' + config.value.id)
closeDialog()
}
diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue
index 636d39b8fe..237bbd3972 100644
--- a/core/core-frontend/src/views/data-visualization/index.vue
+++ b/core/core-frontend/src/views/data-visualization/index.vue
@@ -45,6 +45,7 @@ import DeRuler from '@/custom-component/common/DeRuler.vue'
import { useRequestStoreWithOut } from '@/store/modules/request'
import { usePermissionStoreWithOut } from '@/store/modules/permission'
import ChartStyleBatchSet from '@/views/chart/components/editor/editor-style/ChartStyleBatchSet.vue'
+import CustomTabsSort from '@/custom-component/de-tabs/CustomTabsSort.vue'
const interactiveStore = interactiveStoreWithOut()
const embeddedStore = useEmbedded()
const { wsCache } = useCache()
@@ -62,6 +63,7 @@ const eventCheck = e => {
}
}
const mainCanvasCoreRef = ref(null)
+const customTabsSortRef = ref(null)
const appStore = useAppStoreWithOut()
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
const dvMainStore = dvMainStoreWithOut()
@@ -107,6 +109,12 @@ const state = reactive({
baseHeight: 10
})
+const tabSort = () => {
+ if (curComponent.value) {
+ customTabsSortRef.value.sortInit(curComponent.value)
+ }
+}
+
// 启用拖动
const enableDragging = e => {
if (isSpaceDown.value) {
@@ -449,6 +457,8 @@ const popComponentData = computed(() =>
)
eventBus.on('handleNew', handleNew)
+
+eventBus.on('tabSort', tabSort)
@@ -604,6 +614,7 @@ eventBus.on('handleNew', handleNew)
:canvas-view-info-preview="canvasViewInfo"
:dv-info="dvInfo"
>
+