forked from github/dataease
refactor(仪表板、数据大屏): 优化新建保存时组件切换检查,如果同新建时组织不一致,则禁止保存
This commit is contained in:
parent
34f707d5e8
commit
fdca998cee
@ -31,6 +31,7 @@ import DbMoreComGroup from '@/custom-component/component-group/DbMoreComGroup.vu
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue'
|
||||
import DeAppApply from '@/views/common/DeAppApply.vue'
|
||||
import {useUserStoreWithOut} from "@/store/modules/user";
|
||||
const { t } = useI18n()
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
@ -62,6 +63,7 @@ const state = reactive({
|
||||
const resourceGroupOpt = ref(null)
|
||||
const outerParamsSetRef = ref(null)
|
||||
const { wsCache } = useCache('localStorage')
|
||||
const userStore = useUserStoreWithOut()
|
||||
|
||||
const props = defineProps({
|
||||
createType: {
|
||||
@ -155,6 +157,19 @@ const resourceOptFinish = param => {
|
||||
}
|
||||
|
||||
const saveCanvasWithCheck = () => {
|
||||
if (userStore.getOid && wsCache.get('user.oid') && userStore.getOid !== wsCache.get('user.oid')) {
|
||||
ElMessageBox.confirm('已切换至新组织,无权保存其他组织的资源', {
|
||||
confirmButtonType: 'primary',
|
||||
type: 'warning',
|
||||
confirmButtonText: '关闭页面',
|
||||
cancelButtonText: '取消',
|
||||
autofocus: false,
|
||||
showClose: false
|
||||
}).then(() => {
|
||||
window.close()
|
||||
})
|
||||
return
|
||||
}
|
||||
if (dvInfo.value.dataState === 'prepare') {
|
||||
if (appData.value) {
|
||||
// 应用保存
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { ref, nextTick, computed, toRefs } from 'vue'
|
||||
import { ref, nextTick, computed, toRefs, onMounted } from 'vue'
|
||||
import { useEmbedded } from '@/store/modules/embedded'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
@ -27,6 +27,7 @@ import ComponentButtonLabel from '@/components/visualization/ComponentButtonLabe
|
||||
import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue'
|
||||
import DeAppApply from '@/views/common/DeAppApply.vue'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
let nameEdit = ref(false)
|
||||
let inputName = ref('')
|
||||
let nameInput = ref(null)
|
||||
@ -43,6 +44,7 @@ const { wsCache } = useCache('localStorage')
|
||||
const dvModel = 'dataV'
|
||||
const outerParamsSetRef = ref(null)
|
||||
const fullScreeRef = ref(null)
|
||||
const userStore = useUserStoreWithOut()
|
||||
|
||||
const props = defineProps({
|
||||
createType: {
|
||||
@ -103,6 +105,19 @@ const resourceOptFinish = param => {
|
||||
}
|
||||
|
||||
const saveCanvasWithCheck = () => {
|
||||
if (userStore.getOid && wsCache.get('user.oid') && userStore.getOid !== wsCache.get('user.oid')) {
|
||||
ElMessageBox.confirm('已切换至新组织,无权保存其他组织的资源', {
|
||||
confirmButtonType: 'primary',
|
||||
type: 'warning',
|
||||
confirmButtonText: '关闭页面',
|
||||
cancelButtonText: '取消',
|
||||
autofocus: false,
|
||||
showClose: false
|
||||
}).then(() => {
|
||||
window.close()
|
||||
})
|
||||
return
|
||||
}
|
||||
if (dvInfo.value.dataState === 'prepare') {
|
||||
if (appData.value) {
|
||||
// 应用保存
|
||||
|
@ -349,6 +349,15 @@ const editCursor = () => {
|
||||
if (myDiv.focus) {
|
||||
myDiv.focus()
|
||||
}
|
||||
tinymce.init({
|
||||
selector: tinymceId,
|
||||
plugins: 'table',
|
||||
setup: function (editor) {
|
||||
editor.on('init', function () {
|
||||
console.log('====init====')
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user