forked from github/dataease
fix: 嵌入式权限
This commit is contained in:
parent
7c1da38a76
commit
0307b1b3e9
@ -114,7 +114,8 @@ htmlStream.pipe(parserStream).on('finish', () => {
|
||||
let element = document.createElement(name)
|
||||
Object.entries(obj).forEach(([key, value]) => {
|
||||
if (['href', 'src'].includes(key)) {
|
||||
element[key] = \`\${preUrl}\${value}\`
|
||||
const relativeVal = value.startsWith('./') ? value.substr(1) : value
|
||||
element[key] = \`\${preUrl}\${relativeVal}\`
|
||||
} else {
|
||||
element.setAttribute(key, value || '')
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ const loadInfoList = () => {
|
||||
}
|
||||
|
||||
const toRouter = item => {
|
||||
console.log(item)
|
||||
push({ name: item.rName })
|
||||
}
|
||||
onMounted(() => {
|
||||
|
@ -1,7 +1,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onBeforeMount, nextTick } from 'vue'
|
||||
import { initCanvasData } from '@/utils/canvasUtils'
|
||||
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
import { check } from '@/utils/CrossPermission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
const { wsCache } = useCache()
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
const dashboardPreview = ref(null)
|
||||
const state = reactive({
|
||||
canvasDataPreview: null,
|
||||
@ -10,8 +14,20 @@ const state = reactive({
|
||||
dvInfo: null,
|
||||
curPreviewGap: 0
|
||||
})
|
||||
|
||||
onBeforeMount(() => {
|
||||
const checkPer = async resourceId => {
|
||||
if (!window.DataEaseBi || !resourceId) {
|
||||
return true
|
||||
}
|
||||
const request = { busiFlag: window.DataEaseBi.busiFlag }
|
||||
await interactiveStore.setInteractive(request)
|
||||
const key = window.DataEaseBi.busiFlag === 'dataV' ? 'screen-weight' : 'panel-weight'
|
||||
return check(wsCache.get(key), resourceId, 1)
|
||||
}
|
||||
onBeforeMount(async () => {
|
||||
const checkResult = await checkPer(window.DataEaseBi.dvId)
|
||||
if (!checkResult) {
|
||||
return
|
||||
}
|
||||
initCanvasData(
|
||||
window.DataEaseBi.dvId,
|
||||
window.DataEaseBi.busiFlag,
|
||||
|
@ -1,6 +1,11 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, onBeforeMount, reactive } from 'vue'
|
||||
import { initCanvasDataPrepare } from '@/utils/canvasUtils'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
import { check } from '@/utils/CrossPermission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
const { wsCache } = useCache()
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
const config = ref()
|
||||
const viewInfo = ref()
|
||||
const userViewEnlargeRef = ref()
|
||||
@ -12,7 +17,21 @@ const state = reactive({
|
||||
dvInfo: null,
|
||||
curPreviewGap: 0
|
||||
})
|
||||
onBeforeMount(() => {
|
||||
|
||||
const checkPer = async resourceId => {
|
||||
if (!window.DataEaseBi || !resourceId) {
|
||||
return true
|
||||
}
|
||||
const request = { busiFlag: window.DataEaseBi.busiFlag }
|
||||
await interactiveStore.setInteractive(request)
|
||||
const key = window.DataEaseBi.busiFlag === 'dataV' ? 'screen-weight' : 'panel-weight'
|
||||
return check(wsCache.get(key), resourceId, 1)
|
||||
}
|
||||
onBeforeMount(async () => {
|
||||
const checkResult = await checkPer(window.DataEaseBi.dvId)
|
||||
if (!checkResult) {
|
||||
return
|
||||
}
|
||||
initCanvasDataPrepare(
|
||||
window.DataEaseBi.dvId,
|
||||
window.DataEaseBi.busiFlag,
|
||||
|
@ -47,7 +47,7 @@ export const interactiveStore = defineStore('interactive', {
|
||||
actions: {
|
||||
async setInteractive(param: BusiTreeRequest) {
|
||||
const flag = busiFlagMap.findIndex(item => item === param.busiFlag)
|
||||
if (!hasMenuAuth(flag)) {
|
||||
if (!hasMenuAuth(flag) && !window.DataEaseBi) {
|
||||
const tempData: InnerInteractive = {
|
||||
rootManage: false,
|
||||
anyManage: false,
|
||||
|
@ -1,12 +1,15 @@
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
|
||||
export const check = (data, id?: string) => {
|
||||
export const check = (data, id?: string, weight?: number) => {
|
||||
if (!weight) {
|
||||
weight = 1
|
||||
}
|
||||
if (!id) {
|
||||
ElMessage.error('资源ID不能为空')
|
||||
return false
|
||||
}
|
||||
const node = getNode(data, id)
|
||||
if (!node) {
|
||||
if (!node || node < weight) {
|
||||
showMsg('无权访问当前资源,是否离开当前页面?系统将不保存您所做的更改', id)
|
||||
return false
|
||||
}
|
||||
|
@ -16,12 +16,14 @@ import DeCanvas from '@/views/canvas/DeCanvas.vue'
|
||||
import { check, compareStorage } from '@/utils/CrossPermission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
const eventCheck = e => {
|
||||
if (e.key === 'panel-weight' && !compareStorage(e.oldValue, e.newValue)) {
|
||||
const { resourceId, opt } = window.DataEaseBi || router.currentRoute.value.query
|
||||
if (!(opt && opt === 'create')) {
|
||||
check(wsCache.get('panel-weight'), resourceId)
|
||||
check(wsCache.get('panel-weight'), resourceId, 4)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,12 +60,23 @@ const viewEditorShow = computed(() => {
|
||||
!batchOptStatus.value
|
||||
)
|
||||
})
|
||||
|
||||
const checkPer = async resourceId => {
|
||||
if (!window.DataEaseBi || !resourceId) {
|
||||
return true
|
||||
}
|
||||
const request = { busiFlag: 'dashboard' }
|
||||
await interactiveStore.setInteractive(request)
|
||||
return check(wsCache.get('panel-weight'), resourceId, 4)
|
||||
}
|
||||
// 全局监听按键事件
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
window.addEventListener('storage', eventCheck)
|
||||
initDataset()
|
||||
const { resourceId, opt, pid, createType } = window.DataEaseBi || router.currentRoute.value.query
|
||||
const checkResult = await checkPer(resourceId)
|
||||
if (!checkResult) {
|
||||
return
|
||||
}
|
||||
initDataset()
|
||||
state.sourcePid = pid
|
||||
if (resourceId) {
|
||||
dataInitState.value = false
|
||||
|
@ -25,12 +25,14 @@ import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { check, compareStorage } from '@/utils/CrossPermission'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import RealTimeListTree from '@/components/data-visualization/RealTimeListTree.vue'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
const { wsCache } = useCache()
|
||||
const eventCheck = e => {
|
||||
if (e.key === 'screen-weight' && !compareStorage(e.oldValue, e.newValue)) {
|
||||
const { dvId, opt } = window.DataEaseBi || router.currentRoute.value.query
|
||||
if (!(opt && opt === 'create')) {
|
||||
check(wsCache.get('screen-weight'), dvId)
|
||||
check(wsCache.get('screen-weight'), dvId, 4)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -180,14 +182,25 @@ watch(
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
const checkPer = async resourceId => {
|
||||
if (!window.DataEaseBi || !resourceId) {
|
||||
return true
|
||||
}
|
||||
const request = { busiFlag: 'dataV' }
|
||||
await interactiveStore.setInteractive(request)
|
||||
return check(wsCache.get('screen-weight'), resourceId, 4)
|
||||
}
|
||||
onMounted(async () => {
|
||||
window.addEventListener('blur', releaseAttachKey)
|
||||
if (editMode.value === 'edit') {
|
||||
window.addEventListener('storage', eventCheck)
|
||||
}
|
||||
initDataset()
|
||||
const { dvId, opt, pid, createType } = window.DataEaseBi || router.currentRoute.value.query
|
||||
const checkResult = await checkPer(dvId)
|
||||
if (!checkResult) {
|
||||
return
|
||||
}
|
||||
initDataset()
|
||||
if (dvId) {
|
||||
state.canvasInitStatus = false
|
||||
initCanvasData(dvId, 'dataV', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user