forked from github/dataease
fix(仪表板、数据大屏): 修复重命名重复导致license导入后同步失败问题
This commit is contained in:
parent
55bdd799e7
commit
83c261968b
@ -57,6 +57,8 @@ public class DataVisualizationConstants {
|
||||
public static final String MOVE = "move";
|
||||
//重命名
|
||||
public static final String RENAME = "rename";
|
||||
|
||||
public static final String EDIT = "edit";
|
||||
//复制
|
||||
public static final String COPY = "copy";
|
||||
}
|
||||
|
@ -396,6 +396,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
QueryWrapper<DataVisualizationInfo> wrapper = new QueryWrapper<>();
|
||||
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt())
|
||||
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.equals(request.getOpt())
|
||||
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.EDIT.equals(request.getOpt())
|
||||
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.COPY.equals(request.getOpt())) {
|
||||
if (request.getPid() == null) {
|
||||
DataVisualizationInfo result = visualizationInfoMapper.selectById(request.getId());
|
||||
|
@ -98,12 +98,12 @@ const saveCanvasWithCheck = () => {
|
||||
}
|
||||
|
||||
const saveResource = () => {
|
||||
wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id)
|
||||
if (styleChangeTimes.value > 0) {
|
||||
eventBus.emit('hideArea-canvas-main')
|
||||
nextTick(() => {
|
||||
snapshotStore.resetStyleChangeTimes()
|
||||
canvasSave(() => {
|
||||
snapshotStore.resetStyleChangeTimes()
|
||||
wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id)
|
||||
ElMessage.success('保存成功')
|
||||
window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`)
|
||||
})
|
||||
|
@ -8,6 +8,7 @@ import eventBus from '@/utils/eventBus'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import {
|
||||
decompression,
|
||||
dvNameCheck,
|
||||
findById,
|
||||
findCopyResource,
|
||||
saveCanvas,
|
||||
@ -298,7 +299,7 @@ export function checkIsBatchOptView(viewId) {
|
||||
return curBatchOptComponents.value.includes(viewId)
|
||||
}
|
||||
|
||||
export function canvasSave(callBack) {
|
||||
export async function canvasSave(callBack) {
|
||||
const componentDataToSave = cloneDeep(componentData.value)
|
||||
componentDataToSave.forEach(item => {
|
||||
if (item.component === 'UserView') {
|
||||
@ -324,6 +325,15 @@ export function canvasSave(callBack) {
|
||||
}
|
||||
|
||||
const method = dvInfo.value.id && dvInfo.value.optType !== 'copy' ? updateCanvas : saveCanvas
|
||||
if (method === updateCanvas) {
|
||||
await dvNameCheck({
|
||||
opt: 'edit',
|
||||
nodeType: 'leaf',
|
||||
name: dvInfo.value.name,
|
||||
type: dvInfo.value.type,
|
||||
id: dvInfo.value.id
|
||||
})
|
||||
}
|
||||
method(canvasInfo).then(res => {
|
||||
dvMainStore.updateDvInfoId(res.data)
|
||||
snapshotStore.resetStyleChangeTimes()
|
||||
|
Loading…
Reference in New Issue
Block a user