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 MOVE = "move";
|
||||||
//重命名
|
//重命名
|
||||||
public static final String RENAME = "rename";
|
public static final String RENAME = "rename";
|
||||||
|
|
||||||
|
public static final String EDIT = "edit";
|
||||||
//复制
|
//复制
|
||||||
public static final String COPY = "copy";
|
public static final String COPY = "copy";
|
||||||
}
|
}
|
||||||
|
@ -396,6 +396,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
|||||||
QueryWrapper<DataVisualizationInfo> wrapper = new QueryWrapper<>();
|
QueryWrapper<DataVisualizationInfo> wrapper = new QueryWrapper<>();
|
||||||
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt())
|
if (DataVisualizationConstants.RESOURCE_OPT_TYPE.MOVE.equals(request.getOpt())
|
||||||
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.RENAME.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())) {
|
|| DataVisualizationConstants.RESOURCE_OPT_TYPE.COPY.equals(request.getOpt())) {
|
||||||
if (request.getPid() == null) {
|
if (request.getPid() == null) {
|
||||||
DataVisualizationInfo result = visualizationInfoMapper.selectById(request.getId());
|
DataVisualizationInfo result = visualizationInfoMapper.selectById(request.getId());
|
||||||
|
@ -98,12 +98,12 @@ const saveCanvasWithCheck = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const saveResource = () => {
|
const saveResource = () => {
|
||||||
wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id)
|
|
||||||
if (styleChangeTimes.value > 0) {
|
if (styleChangeTimes.value > 0) {
|
||||||
eventBus.emit('hideArea-canvas-main')
|
eventBus.emit('hideArea-canvas-main')
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
snapshotStore.resetStyleChangeTimes()
|
|
||||||
canvasSave(() => {
|
canvasSave(() => {
|
||||||
|
snapshotStore.resetStyleChangeTimes()
|
||||||
|
wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id)
|
||||||
ElMessage.success('保存成功')
|
ElMessage.success('保存成功')
|
||||||
window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`)
|
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 { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||||
import {
|
import {
|
||||||
decompression,
|
decompression,
|
||||||
|
dvNameCheck,
|
||||||
findById,
|
findById,
|
||||||
findCopyResource,
|
findCopyResource,
|
||||||
saveCanvas,
|
saveCanvas,
|
||||||
@ -298,7 +299,7 @@ export function checkIsBatchOptView(viewId) {
|
|||||||
return curBatchOptComponents.value.includes(viewId)
|
return curBatchOptComponents.value.includes(viewId)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function canvasSave(callBack) {
|
export async function canvasSave(callBack) {
|
||||||
const componentDataToSave = cloneDeep(componentData.value)
|
const componentDataToSave = cloneDeep(componentData.value)
|
||||||
componentDataToSave.forEach(item => {
|
componentDataToSave.forEach(item => {
|
||||||
if (item.component === 'UserView') {
|
if (item.component === 'UserView') {
|
||||||
@ -324,6 +325,15 @@ export function canvasSave(callBack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const method = dvInfo.value.id && dvInfo.value.optType !== 'copy' ? updateCanvas : saveCanvas
|
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 => {
|
method(canvasInfo).then(res => {
|
||||||
dvMainStore.updateDvInfoId(res.data)
|
dvMainStore.updateDvInfoId(res.data)
|
||||||
snapshotStore.resetStyleChangeTimes()
|
snapshotStore.resetStyleChangeTimes()
|
||||||
|
Loading…
Reference in New Issue
Block a user