forked from github/dataease
fix: 修复复制可视化资源出现权限变更的问题
This commit is contained in:
parent
deeea0ae76
commit
9ec95b2b82
@ -89,6 +89,16 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
@Resource
|
||||
private VisualizationWatermarkMapper watermarkMapper;
|
||||
|
||||
@Override
|
||||
public DataVisualizationVO findCopyResource(Long dvId, String busiFlag) {
|
||||
DataVisualizationVO result = findById(dvId, busiFlag);
|
||||
if(result !=null && result.getPid() == -1){
|
||||
return result;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@XpackInteract(value = "dataVisualizationServer", original = true)
|
||||
public DataVisualizationVO findById(Long dvId, String busiFlag) {
|
||||
|
@ -16,6 +16,10 @@ export interface Panel {
|
||||
updateBy: string
|
||||
}
|
||||
|
||||
export const findCopyResource = async (dvId, busiFlag): Promise<IResponse> => {
|
||||
return request.get({ url: '/findCopyResource/findById/' + dvId + '/' + busiFlag })
|
||||
}
|
||||
|
||||
export const findById = async (dvId, busiFlag): Promise<IResponse> => {
|
||||
let busiFlagResult = busiFlag
|
||||
if (!busiFlagResult) {
|
||||
|
@ -5,7 +5,12 @@ import componentList, {
|
||||
} from '@/custom-component/component-list'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { findById, saveCanvas, updateCanvas } from '@/api/visualization/dataVisualization'
|
||||
import {
|
||||
findById,
|
||||
findCopyResource,
|
||||
saveCanvas,
|
||||
updateCanvas
|
||||
} from '@/api/visualization/dataVisualization'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { getPanelAllLinkageInfo } from '@/api/visualization/linkage'
|
||||
import { queryVisualizationJumpInfo } from '@/api/visualization/linkJump'
|
||||
@ -78,7 +83,10 @@ export function commonHandleDragEnd(e, dvModel) {
|
||||
}
|
||||
|
||||
export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
|
||||
findById(dvId, busiFlag).then(res => {
|
||||
const copyFlag = busiFlag != null && busiFlag.includes('-copy')
|
||||
const busiFlagCustom = copyFlag ? busiFlag.split('-')[0] : busiFlag
|
||||
const method = copyFlag ? findCopyResource : findById
|
||||
method(dvId, busiFlagCustom).then(res => {
|
||||
const canvasInfo = res.data
|
||||
const watermarkInfo = {
|
||||
...canvasInfo.watermarkInfo,
|
||||
|
@ -81,7 +81,8 @@ onMounted(async () => {
|
||||
state.sourcePid = pid
|
||||
if (resourceId) {
|
||||
dataInitState.value = false
|
||||
initCanvasData(resourceId, 'dashboard', function () {
|
||||
const busiFlg = opt === 'copy' ? 'dashboard-copy' : 'dashboard'
|
||||
initCanvasData(resourceId, busiFlg, function () {
|
||||
dataInitState.value = true
|
||||
if (dvInfo.value && opt === 'copy') {
|
||||
dvInfo.value.dataState = 'prepare'
|
||||
|
@ -204,7 +204,8 @@ onMounted(async () => {
|
||||
initDataset()
|
||||
if (dvId) {
|
||||
state.canvasInitStatus = false
|
||||
initCanvasData(dvId, 'dataV', function () {
|
||||
const busiFlg = opt === 'copy' ? 'dataV-copy' : 'dataV'
|
||||
initCanvasData(dvId, busiFlg, function () {
|
||||
state.canvasInitStatus = true
|
||||
// afterInit
|
||||
nextTick(() => {
|
||||
|
@ -34,6 +34,11 @@ public interface DataVisualizationApi {
|
||||
@Operation(summary = "查询可视化资源")
|
||||
DataVisualizationVO findById(@PathVariable("dvId") Long dvId,@PathVariable("busiFlag") String busiFlag);
|
||||
|
||||
@GetMapping("/findCopyResource/{dvId}/{busiFlag}")
|
||||
@Operation(summary = "查询临时复制资源")
|
||||
DataVisualizationVO findCopyResource(@PathVariable("dvId") Long dvId,@PathVariable("busiFlag") String busiFlag);
|
||||
|
||||
|
||||
@PostMapping("/saveCanvas")
|
||||
@DePermit(value = {"#p0.pid + ':manage'"}, busiFlag = "#p0.type")
|
||||
@Operation(summary = "画布保存")
|
||||
|
Loading…
Reference in New Issue
Block a user