diff --git a/core/core-frontend/src/components/visualization/ComponentEditBar.vue b/core/core-frontend/src/components/visualization/ComponentEditBar.vue
index 7c4c7c2517..2cb869d337 100644
--- a/core/core-frontend/src/components/visualization/ComponentEditBar.vue
+++ b/core/core-frontend/src/components/visualization/ComponentEditBar.vue
@@ -124,7 +124,8 @@
v-if="
!['picture-group', 'rich-text'].includes(element.innerType) &&
barShowCheck('download') &&
- showDownload
+ showDownload &&
+ (exportPermissions[0] || exportPermissions[1])
"
@click.prevent
>
@@ -138,14 +139,18 @@
- Excel
+ Excel
Excel(带格式)
- 图片
+ 图片
@@ -169,7 +174,8 @@
!['picture-group', 'rich-text'].includes(element.innerType) &&
barShowCheck('previewDownload') &&
authShow &&
- showDownload
+ showDownload &&
+ (exportPermissions[0] || exportPermissions[1])
"
>
@@ -179,14 +185,18 @@
- Excel
+ Excel
Excel(带格式)
- 图片
+ 图片
@@ -227,11 +237,15 @@ 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 { exportPermission } from '@/utils/utils'
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
const copyStore = copyStoreWithOut()
const customTabsSortRef = ref(null)
const authShow = computed(() => !dvInfo.value.weight || dvInfo.value.weight > 3)
+const exportPermissions = computed(() =>
+ exportPermission(dvInfo.value['weight'], dvInfo.value['ext'])
+)
const emits = defineEmits([
'userViewEnlargeOpen',
'datasetParamsInit',
diff --git a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue
index e25f2884f0..ac58e45f0e 100644
--- a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue
+++ b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue
@@ -9,7 +9,7 @@
>
= {
render: 'antv',
type: 'table-info',
@@ -214,6 +214,10 @@ const DETAIL_TABLE_ATTR: DeepPartial = {
const authShow = computed(() => editMode.value === 'edit' || dvInfo.value.weight > 3)
+const exportPermissions = computed(() =>
+ exportPermission(dvInfo.value['weight'], dvInfo.value['ext'])
+)
+
const customExport = computed(() => {
const style =
canvasStyleData.value &&
diff --git a/core/core-frontend/src/utils/utils.ts b/core/core-frontend/src/utils/utils.ts
index cc1d599659..bbbd14f51b 100644
--- a/core/core-frontend/src/utils/utils.ts
+++ b/core/core-frontend/src/utils/utils.ts
@@ -188,3 +188,29 @@ export const isLink = () => {
export const isNull = arg => {
return typeof arg === 'undefined' || arg === null || arg === 'null'
}
+
+export const exportPermission = (weight, ext) => {
+ const result = [0, 0, 0]
+ if (!weight || weight === 1) {
+ return result
+ } else if (weight === 9) {
+ return [1, 1, 1]
+ }
+ if (!ext) {
+ return result
+ }
+ const extArray = formatExt(ext) || []
+ for (let index = 0; index < extArray.length; index++) {
+ result[index] = extArray[index]
+ }
+ return result
+}
+
+export const formatExt = (num: number): number[] | null => {
+ if (!num) {
+ return null
+ }
+ const reversedStr = num.toString().split('').reverse().join('')
+ const reversedNumArray = reversedStr?.split('')?.map(Number) ?? []
+ return reversedNumArray
+}
diff --git a/core/core-frontend/src/views/data-visualization/PreviewHead.vue b/core/core-frontend/src/views/data-visualization/PreviewHead.vue
index 39b1c76c3e..fbb32fb38e 100644
--- a/core/core-frontend/src/views/data-visualization/PreviewHead.vue
+++ b/core/core-frontend/src/views/data-visualization/PreviewHead.vue
@@ -18,6 +18,7 @@ import ShareVisualHead from '@/views/share/share/ShareVisualHead.vue'
import { XpackComponent } from '@/components/plugin'
import { useEmitt } from '@/hooks/web/useEmitt'
import { useShareStoreWithOut } from '@/store/modules/share'
+import { exportPermission } from '@/utils/utils'
const shareStore = useShareStoreWithOut()
const dvMainStore = dvMainStoreWithOut()
@@ -37,7 +38,9 @@ const preview = () => {
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
const isIframe = computed(() => appStore.getIsIframe)
const shareDisable = computed(() => shareStore.getShareDisable)
-
+const exportPermissions = computed(() =>
+ exportPermission(dvInfo.value['weight'], dvInfo.value['ext'])
+)
const reload = () => {
emit('reload', dvInfo.value.id)
}
@@ -197,7 +200,7 @@ const initOpenHandler = newWindow => {
{{
t('visualization.apply_template')
}}
- {{
+ {{
t('chart.image')
}}
diff --git a/core/core-frontend/src/views/data-visualization/PreviewShow.vue b/core/core-frontend/src/views/data-visualization/PreviewShow.vue
index bb6de66ba2..c515a87e66 100644
--- a/core/core-frontend/src/views/data-visualization/PreviewShow.vue
+++ b/core/core-frontend/src/views/data-visualization/PreviewShow.vue
@@ -70,7 +70,7 @@ function createNew() {
resourceTreeRef.value?.createNewObject()
}
-const loadCanvasData = (dvId, weight?) => {
+const loadCanvasData = (dvId, weight?, ext?) => {
const initMethod = props.showPosition === 'multiplexing' ? initCanvasDataPrepare : initCanvasData
dataInitState.value = false
initMethod(
@@ -84,6 +84,7 @@ const loadCanvasData = (dvId, weight?) => {
curPreviewGap
}) {
dvInfo['weight'] = weight
+ dvInfo['ext'] = ext || 0
state.canvasDataPreview = canvasDataResult
state.canvasStylePreview = canvasStyleResult
state.canvasViewInfoPreview = canvasViewInfoPreview
@@ -162,11 +163,11 @@ const slideOpenChange = () => {
}
const reload = id => {
- loadCanvasData(id, state.dvInfo.weight)
+ loadCanvasData(id, state.dvInfo.weight, state.dvInfo.ext)
}
const resourceNodeClick = data => {
- loadCanvasData(data.id, data.weight)
+ loadCanvasData(data.id, data.weight, data.ext)
}
const state = reactive({
diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/vo/DataVisualizationVO.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/vo/DataVisualizationVO.java
index a3df1ab27f..5c048cb767 100644
--- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/vo/DataVisualizationVO.java
+++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/vo/DataVisualizationVO.java
@@ -171,6 +171,8 @@ public class DataVisualizationVO implements Serializable {
*/
private Integer weight;
+ private int ext;
+
/**
* 应用信息
*/