forked from github/dataease
Merge pull request #11072 from dataease/pr@dev-v2@refactor_app-import
refactor(仪表板): app导入优化
This commit is contained in:
commit
2262b06ed6
@ -305,12 +305,14 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
|||||||
//表名映射更新
|
//表名映射更新
|
||||||
Map<String,String> appDsTableNamesMap = dsTableNamesMap.get(key);
|
Map<String,String> appDsTableNamesMap = dsTableNamesMap.get(key);
|
||||||
Map<String,String> systemDsTableNamesMap = dsTableNamesMap.get(value);
|
Map<String,String> systemDsTableNamesMap = dsTableNamesMap.get(value);
|
||||||
|
if(!CollectionUtils.isEmpty(appDsTableNamesMap) && !CollectionUtils.isEmpty(systemDsTableNamesMap) ){
|
||||||
|
appDsTableNamesMap.forEach((keyName,valueName) ->{
|
||||||
|
if(StringUtils.isNotEmpty(systemDsTableNamesMap.get(keyName))){
|
||||||
|
dsGroup.setInfo(dsGroup.getInfo().replaceAll(valueName,systemDsTableNamesMap.get(keyName)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
appDsTableNamesMap.forEach((keyName,valueName) ->{
|
|
||||||
if(StringUtils.isNotEmpty(systemDsTableNamesMap.get(keyName))){
|
|
||||||
dsGroup.setInfo(dsGroup.getInfo().replaceAll(valueName,systemDsTableNamesMap.get(keyName)));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,11 +46,13 @@ export const findDvType = async dvId =>
|
|||||||
|
|
||||||
export const save = data => request.post({ url: '/dataVisualization/save', data })
|
export const save = data => request.post({ url: '/dataVisualization/save', data })
|
||||||
|
|
||||||
export const saveCanvas = data => request.post({ url: '/dataVisualization/saveCanvas', data })
|
export const saveCanvas = data =>
|
||||||
|
request.post({ url: '/dataVisualization/saveCanvas', data, loading: true })
|
||||||
|
|
||||||
export const updateBase = data => request.post({ url: '/dataVisualization/updateBase', data })
|
export const updateBase = data => request.post({ url: '/dataVisualization/updateBase', data })
|
||||||
|
|
||||||
export const updateCanvas = data => request.post({ url: '/dataVisualization/updateCanvas', data })
|
export const updateCanvas = data =>
|
||||||
|
request.post({ url: '/dataVisualization/updateCanvas', data, loading: true })
|
||||||
|
|
||||||
export const moveResource = data => request.post({ url: '/dataVisualization/move', data })
|
export const moveResource = data => request.post({ url: '/dataVisualization/move', data })
|
||||||
|
|
||||||
|
@ -179,25 +179,27 @@ const saveCanvasWithCheck = () => {
|
|||||||
const saveResource = () => {
|
const saveResource = () => {
|
||||||
wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id)
|
wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id)
|
||||||
if (styleChangeTimes.value > 0) {
|
if (styleChangeTimes.value > 0) {
|
||||||
snapshotStore.resetStyleChangeTimes()
|
|
||||||
dvMainStore.matrixSizeAdaptor()
|
dvMainStore.matrixSizeAdaptor()
|
||||||
queryList.value.forEach(ele => {
|
queryList.value.forEach(ele => {
|
||||||
useEmitt().emitter.emit(`updateQueryCriteria${ele.id}`)
|
useEmitt().emitter.emit(`updateQueryCriteria${ele.id}`)
|
||||||
})
|
})
|
||||||
|
try {
|
||||||
canvasSave(() => {
|
canvasSave(() => {
|
||||||
snapshotStore.resetStyleChangeTimes()
|
snapshotStore.resetStyleChangeTimes()
|
||||||
ElMessage.success('保存成功')
|
ElMessage.success('保存成功')
|
||||||
window.history.pushState({}, '', `#/dashboard?resourceId=${dvInfo.value.id}`)
|
window.history.pushState({}, '', `#/dashboard?resourceId=${dvInfo.value.id}`)
|
||||||
if (appData.value) {
|
if (appData.value) {
|
||||||
initCanvasData(dvInfo.value.id, 'dashboard', () => {
|
initCanvasData(dvInfo.value.id, 'dashboard', () => {
|
||||||
useEmitt().emitter.emit('refresh-dataset-selector')
|
useEmitt().emitter.emit('refresh-dataset-selector')
|
||||||
resourceAppOpt.value.close()
|
resourceAppOpt.value.close()
|
||||||
dvMainStore.setAppDataInfo(null)
|
dvMainStore.setAppDataInfo(null)
|
||||||
snapshotStore.resetSnapshot()
|
snapshotStore.resetSnapshot()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -663,7 +665,7 @@ const initOpenHandler = newWindow => {
|
|||||||
:dv-info="dvInfo"
|
:dv-info="dvInfo"
|
||||||
:canvas-view-info="canvasViewInfo"
|
:canvas-view-info="canvasViewInfo"
|
||||||
cur-canvas-type="dashboard"
|
cur-canvas-type="dashboard"
|
||||||
@saveApp="saveCanvasWithCheck"
|
@saveAppCanvas="saveCanvasWithCheck"
|
||||||
></de-app-apply>
|
></de-app-apply>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ const fullScreenPreview = () => {
|
|||||||
:dv-info="dvInfo"
|
:dv-info="dvInfo"
|
||||||
:canvas-view-info="canvasViewInfo"
|
:canvas-view-info="canvasViewInfo"
|
||||||
cur-canvas-type="dataV"
|
cur-canvas-type="dataV"
|
||||||
@saveApp="saveCanvasWithCheck"
|
@saveAppCanvas="saveCanvasWithCheck"
|
||||||
></de-app-apply>
|
></de-app-apply>
|
||||||
</div>
|
</div>
|
||||||
<de-fullscreen ref="fullScreeRef" show-position="dvEdit"></de-fullscreen>
|
<de-fullscreen ref="fullScreeRef" show-position="dvEdit"></de-fullscreen>
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
<el-drawer
|
<el-drawer
|
||||||
:title="'保存应用'"
|
:title="'保存应用'"
|
||||||
v-model="state.appApplyDrawer"
|
v-model="state.appApplyDrawer"
|
||||||
custom-class="de-user-drawer"
|
custom-class="de-app-drawer"
|
||||||
size="500px"
|
size="500px"
|
||||||
direction="rtl"
|
direction="rtl"
|
||||||
>
|
>
|
||||||
<div class="app-export">
|
<div class="app-export" v-loading="requestStore.loadingMap[permissionStore.currentPath]">
|
||||||
<el-form
|
<el-form
|
||||||
ref="appSaveForm"
|
ref="appSaveForm"
|
||||||
:model="state.form"
|
:model="state.form"
|
||||||
@ -143,12 +143,18 @@ import DatasetSelect from '@/views/chart/components/editor/dataset-select/Datase
|
|||||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { deepCopy } from '@/utils/utils'
|
import { deepCopy } from '@/utils/utils'
|
||||||
|
import eventBus from '@/utils/eventBus'
|
||||||
|
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||||
|
import { useRequestStoreWithOut } from '@/store/modules/request'
|
||||||
|
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const emits = defineEmits(['closeDraw', 'saveApp'])
|
const emits = defineEmits(['closeDraw', 'saveApp'])
|
||||||
const appSaveForm = ref(null)
|
const appSaveForm = ref(null)
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { dvInfo, appData } = storeToRefs(dvMainStore)
|
const { dvInfo, appData } = storeToRefs(dvMainStore)
|
||||||
|
const snapshotStore = snapshotStoreWithOut()
|
||||||
|
const requestStore = useRequestStoreWithOut()
|
||||||
|
const permissionStore = usePermissionStoreWithOut()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
componentData: {
|
componentData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -309,7 +315,8 @@ const saveApp = () => {
|
|||||||
dvInfo.value['datasetFolderPid'] = state.form.datasetFolderPid
|
dvInfo.value['datasetFolderPid'] = state.form.datasetFolderPid
|
||||||
dvInfo.value['datasetFolderName'] = state.form.datasetFolderName
|
dvInfo.value['datasetFolderName'] = state.form.datasetFolderName
|
||||||
dvInfo.value['dataState'] = 'ready'
|
dvInfo.value['dataState'] = 'ready'
|
||||||
emits('saveApp')
|
eventBus.emit('save')
|
||||||
|
snapshotStore.recordSnapshotCache('renderChart')
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -393,3 +400,9 @@ defineExpose({
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.de-app-drawer {
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -238,13 +238,13 @@ onUnmounted(() => {
|
|||||||
<div
|
<div
|
||||||
class="dv-common-layout dv-teleport-query"
|
class="dv-common-layout dv-teleport-query"
|
||||||
:class="isDataEaseBi && !newWindowFromDiv && 'dataease-w-h'"
|
:class="isDataEaseBi && !newWindowFromDiv && 'dataease-w-h'"
|
||||||
|
v-loading="requestStore.loadingMap[permissionStore.currentPath]"
|
||||||
v-if="loadFinish && !mobileConfig"
|
v-if="loadFinish && !mobileConfig"
|
||||||
>
|
>
|
||||||
<DbToolbar />
|
<DbToolbar />
|
||||||
<el-container
|
<el-container
|
||||||
class="dv-layout-container"
|
class="dv-layout-container"
|
||||||
:class="{ 'preview-content': editMode === 'preview' }"
|
:class="{ 'preview-content': editMode === 'preview' }"
|
||||||
v-loading="requestStore.loadingMap[permissionStore.currentPath]"
|
|
||||||
element-loading-background="rgba(0, 0, 0, 0)"
|
element-loading-background="rgba(0, 0, 0, 0)"
|
||||||
>
|
>
|
||||||
<!-- 中间画布 -->
|
<!-- 中间画布 -->
|
||||||
|
Loading…
Reference in New Issue
Block a user