更新前端src/views/viewsnew/common目录文件
This commit is contained in:
parent
bcc3064e6d
commit
bc4d842a9b
@ -2,7 +2,7 @@
|
|||||||
<el-drawer
|
<el-drawer
|
||||||
:title="t('visualization.save_app')"
|
:title="t('visualization.save_app')"
|
||||||
v-model="state.appApplyDrawer"
|
v-model="state.appApplyDrawer"
|
||||||
custom-class="de-app-drawer"
|
modal-class="de-app-drawer"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
size="500px"
|
size="500px"
|
||||||
direction="rtl"
|
direction="rtl"
|
||||||
@ -158,7 +158,6 @@ import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapsho
|
|||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import { isDesktop } from '@/utils/ModelUtil'
|
import { isDesktop } from '@/utils/ModelUtil'
|
||||||
import { filterFreeFolder } from '@/utils/utils'
|
import { filterFreeFolder } from '@/utils/utils'
|
||||||
const desktop = isDesktop()
|
|
||||||
|
|
||||||
const { wsCache } = useCache('localStorage')
|
const { wsCache } = useCache('localStorage')
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
@ -186,7 +185,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const { componentData, canvasViewInfo, curCanvasType, themes } = toRefs(props)
|
const { curCanvasType } = toRefs(props)
|
||||||
const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank'
|
const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank'
|
||||||
|
|
||||||
const dvPreName = computed(() =>
|
const dvPreName = computed(() =>
|
||||||
@ -259,7 +258,7 @@ const goBack = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const initData = () => {
|
const initData = () => {
|
||||||
const request = { busiFlag: curCanvasType.value, leaf: false, weight: 7 }
|
const request = { busiFlag: curCanvasType.value, resourceTable: 'core', leaf: false, weight: 7 }
|
||||||
queryTreeApi(request).then(res => {
|
queryTreeApi(request).then(res => {
|
||||||
filterFreeFolder(res, curCanvasType.value)
|
filterFreeFolder(res, curCanvasType.value)
|
||||||
const resultTree = res || []
|
const resultTree = res || []
|
||||||
|
@ -30,7 +30,9 @@ const { t } = useI18n()
|
|||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
tData: [],
|
tData: [],
|
||||||
nameList: []
|
nameList: [],
|
||||||
|
targetInfo: null,
|
||||||
|
attachParams: null
|
||||||
})
|
})
|
||||||
|
|
||||||
const showParentSelected = ref(false)
|
const showParentSelected = ref(false)
|
||||||
@ -134,8 +136,10 @@ const getDialogTitle = exec => {
|
|||||||
}
|
}
|
||||||
const placeholder = ref('')
|
const placeholder = ref('')
|
||||||
|
|
||||||
const optInit = (type, data: BusiTreeNode, exec, parentSelect = false) => {
|
const optInit = (type, data: BusiTreeNode, exec, parentSelect = false, attachParams?) => {
|
||||||
showParentSelected.value = parentSelect
|
showParentSelected.value = parentSelect
|
||||||
|
state.targetInfo = data
|
||||||
|
state.attachParams = attachParams
|
||||||
nodeType.value = type
|
nodeType.value = type
|
||||||
const optSource = data.leaf || type === 'leaf' ? sourceLabel.value : t('visualization.folder')
|
const optSource = data.leaf || type === 'leaf' ? sourceLabel.value : t('visualization.folder')
|
||||||
const placeholderLabel =
|
const placeholderLabel =
|
||||||
@ -148,7 +152,7 @@ const optInit = (type, data: BusiTreeNode, exec, parentSelect = false) => {
|
|||||||
filterText.value = ''
|
filterText.value = ''
|
||||||
dialogTitle.value = getDialogTitle(exec) + ('rename' === exec ? optSource : '')
|
dialogTitle.value = getDialogTitle(exec) + ('rename' === exec ? optSource : '')
|
||||||
resourceFormNameLabel.value = (exec === 'move' ? '' : optSource) + t('visualization.name')
|
resourceFormNameLabel.value = (exec === 'move' ? '' : optSource) + t('visualization.name')
|
||||||
const request = { busiFlag: curCanvasType.value, leaf: false, weight: 7 }
|
const request = { busiFlag: curCanvasType.value, leaf: false, resourceTable: 'core', weight: 7 }
|
||||||
if (['newFolder'].includes(exec)) {
|
if (['newFolder'].includes(exec)) {
|
||||||
resourceForm.name = ''
|
resourceForm.name = ''
|
||||||
} else if ('copy' === exec) {
|
} else if ('copy' === exec) {
|
||||||
@ -253,7 +257,9 @@ const saveResource = () => {
|
|||||||
const params: ResourceOrFolder = {
|
const params: ResourceOrFolder = {
|
||||||
nodeType: nodeType.value as 'folder' | 'leaf',
|
nodeType: nodeType.value as 'folder' | 'leaf',
|
||||||
name: resourceForm.name,
|
name: resourceForm.name,
|
||||||
type: curCanvasType.value
|
type: curCanvasType.value,
|
||||||
|
mobileLayout: state.targetInfo?.extraFlag,
|
||||||
|
status: state.targetInfo?.extraFlag1
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd.value) {
|
switch (cmd.value) {
|
||||||
@ -282,7 +288,7 @@ const saveResource = () => {
|
|||||||
}
|
}
|
||||||
if (cmd.value === 'newLeaf') {
|
if (cmd.value === 'newLeaf') {
|
||||||
resourceDialogShow.value = false
|
resourceDialogShow.value = false
|
||||||
emits('finish', { opt: 'newLeaf', ...params })
|
emits('finish', { opt: 'newLeaf', ...params, ...state.attachParams })
|
||||||
} else {
|
} else {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const method = methodMap[cmd.value] ? methodMap[cmd.value] : updateBase
|
const method = methodMap[cmd.value] ? methodMap[cmd.value] : updateBase
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import dvDashboardSpineMobile from '@/assets/svg/dv-dashboard-spine-mobile.svg'
|
import dvDashboardSpineMobile from '@/assets/svg/dv-dashboard-spine-mobile.svg'
|
||||||
|
import dvDashboardSpineMobileDisabled from '@/assets/svg/dv-dashboard-spine-mobile-disabled.svg'
|
||||||
import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg'
|
import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg'
|
||||||
import dvCopyDark from '@/assets/svg/dv-copy-dark.svg'
|
import dvCopyDark from '@/assets/svg/dv-copy-dark.svg'
|
||||||
import dvDelete from '@/assets/svg/dv-delete.svg'
|
import dvDelete from '@/assets/svg/dv-delete.svg'
|
||||||
import dvMove from '@/assets/svg/dv-move.svg'
|
import dvMove from '@/assets/svg/dv-move.svg'
|
||||||
|
import dvCancelPublish from '@/assets/svg/icon_undo_outlined.svg'
|
||||||
import { treeDraggbleChart } from '@/utils/treeDraggbleChart'
|
import { treeDraggbleChart } from '@/utils/treeDraggbleChart'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
import dvRename from '@/assets/svg/dv-rename.svg'
|
import dvRename from '@/assets/svg/dv-rename.svg'
|
||||||
import dvDashboardSpine from '@/assets/svg/dv-dashboard-spine.svg'
|
import dvDashboardSpine from '@/assets/svg/dv-dashboard-spine.svg'
|
||||||
|
import dvDashboardSpineDisabled from '@/assets/svg/dv-dashboard-spine-disabled.svg'
|
||||||
import dvScreenSpine from '@/assets/svg/dv-screen-spine.svg'
|
import dvScreenSpine from '@/assets/svg/dv-screen-spine.svg'
|
||||||
import dvNewFolder from '@/assets/svg/dv-new-folder.svg'
|
import dvNewFolder from '@/assets/svg/dv-new-folder.svg'
|
||||||
import icon_fileAdd_outlined from '@/assets/svg/icon_file-add_outlined.svg'
|
import icon_fileAdd_outlined from '@/assets/svg/icon_file-add_outlined.svg'
|
||||||
@ -23,7 +26,8 @@ import {
|
|||||||
copyResource,
|
copyResource,
|
||||||
deleteLogic,
|
deleteLogic,
|
||||||
ResourceOrFolder,
|
ResourceOrFolder,
|
||||||
queryShareBaseApi
|
queryShareBaseApi,
|
||||||
|
updateBase
|
||||||
} from '@/api/visualization/dataVisualization'
|
} from '@/api/visualization/dataVisualization'
|
||||||
import { ElIcon, ElMessage, ElMessageBox, ElScrollbar } from 'element-plus-secondary'
|
import { ElIcon, ElMessage, ElMessageBox, ElScrollbar } from 'element-plus-secondary'
|
||||||
import { Icon } from '@/components/icon-custom'
|
import { Icon } from '@/components/icon-custom'
|
||||||
@ -44,7 +48,7 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import DeResourceCreateOptV2 from '@/views/common/DeResourceCreateOptV2.vue'
|
import DeResourceCreateOptV2 from '@/views/common/DeResourceCreateOptV2.vue'
|
||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
import { findParentIdByChildIdRecursive } from '@/utils/canvasUtils'
|
import { findParentIdByChildIdRecursive, onInitReady } from '@/utils/canvasUtils'
|
||||||
import { XpackComponent } from '@/components/plugin'
|
import { XpackComponent } from '@/components/plugin'
|
||||||
import treeSort, { treeParentWeight } from '@/utils/treeSortUtils'
|
import treeSort, { treeParentWeight } from '@/utils/treeSortUtils'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
@ -67,11 +71,17 @@ const props = defineProps({
|
|||||||
required: false,
|
required: false,
|
||||||
type: String,
|
type: String,
|
||||||
default: 'preview'
|
default: 'preview'
|
||||||
|
},
|
||||||
|
resourceTable: {
|
||||||
|
required: false,
|
||||||
|
type: String,
|
||||||
|
default: 'core'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name'
|
label: 'name',
|
||||||
|
disabled: (data: any) => data.extraFlag1 === 0
|
||||||
}
|
}
|
||||||
const mounted = ref(false)
|
const mounted = ref(false)
|
||||||
const rootManage = ref(false)
|
const rootManage = ref(false)
|
||||||
@ -170,10 +180,16 @@ const menuListWeight = id => {
|
|||||||
return pWeight < 7 ? menuList : menuListWithCopy
|
return pWeight < 7 ? menuList : menuListWithCopy
|
||||||
}
|
}
|
||||||
const menuListWithCopy = [
|
const menuListWithCopy = [
|
||||||
|
{
|
||||||
|
label: t('visualization.cancel_publish'), //取消发布
|
||||||
|
command: 'cancelPublish',
|
||||||
|
svgName: dvCancelPublish
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('visualization.copy'), //'复制',
|
label: t('visualization.copy'), //'复制',
|
||||||
command: 'copy',
|
command: 'copy',
|
||||||
svgName: dvCopyDark
|
svgName: dvCopyDark,
|
||||||
|
divided: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('visualization.move_to'), //'移动到',
|
label: t('visualization.move_to'), //'移动到',
|
||||||
@ -193,10 +209,16 @@ const menuListWithCopy = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
const menuList = [
|
const menuList = [
|
||||||
|
{
|
||||||
|
label: t('visualization.cancel_publish'), //取消发布
|
||||||
|
command: 'cancelPublish',
|
||||||
|
svgName: dvCancelPublish
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('visualization.move_to'), //'移动到',
|
label: t('visualization.move_to'), //'移动到',
|
||||||
command: 'move',
|
command: 'move',
|
||||||
svgName: dvMove
|
svgName: dvMove,
|
||||||
|
divided: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('visualization.rename'), //'重命名',
|
label: t('visualization.rename'), //'重命名',
|
||||||
@ -232,6 +254,9 @@ const nodeCollapse = data => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const filterNode = (value: string, data: BusiTreeNode) => {
|
const filterNode = (value: string, data: BusiTreeNode) => {
|
||||||
|
if (showPosition.value === 'multiplexing' && data.id === dvInfo.value?.id) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (!value) return true
|
if (!value) return true
|
||||||
return data.name?.toLocaleLowerCase().includes(value.toLocaleLowerCase())
|
return data.name?.toLocaleLowerCase().includes(value.toLocaleLowerCase())
|
||||||
}
|
}
|
||||||
@ -243,18 +268,59 @@ const cancelPreRequest = () => {
|
|||||||
cancelRequestBatch('/linkJump/queryVisualizationJumpInfo/**')
|
cancelRequestBatch('/linkJump/queryVisualizationJumpInfo/**')
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodeClick = (data: BusiTreeNode) => {
|
const nodeClick = (data: BusiTreeNode, node) => {
|
||||||
cancelPreRequest()
|
dvMainStore.setCurComponent({ component: null, index: null })
|
||||||
selectedNodeKey.value = data.id
|
if (showPosition.value !== 'multiplexing') {
|
||||||
if (data.leaf) {
|
dvMainStore.setEditMode('preview')
|
||||||
emit('nodeClick', data)
|
}
|
||||||
|
if (node.disabled) {
|
||||||
|
nextTick(() => {
|
||||||
|
// 找到当前高亮的节点,移除高亮样式
|
||||||
|
const currentNode = resourceListTree.value.$el.querySelector('.is-current')
|
||||||
|
if (currentNode) {
|
||||||
|
currentNode.classList.remove('is-current')
|
||||||
|
}
|
||||||
|
return // 阻止后续逻辑
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
resourceListTree.value.setCurrentKey(null)
|
cancelPreRequest()
|
||||||
|
selectedNodeKey.value = data.id
|
||||||
|
if (data.leaf) {
|
||||||
|
if (!embeddedStore.baseUrl) {
|
||||||
|
let url = window.location.href
|
||||||
|
const paramName = 'dvId'
|
||||||
|
const paramValue = data.id
|
||||||
|
// 检查是否已经有查询参数(在哈希部分)
|
||||||
|
if (url.includes('?')) {
|
||||||
|
const regex = new RegExp(`([?&])${paramName}=[^&]*`)
|
||||||
|
if (regex.test(url)) {
|
||||||
|
url = url.replace(regex, `$1${paramName}=${paramValue}`)
|
||||||
|
} else {
|
||||||
|
url += `&${paramName}=${paramValue}`
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
url += `?${paramName}=${paramValue}`
|
||||||
|
}
|
||||||
|
window.history.replaceState(
|
||||||
|
{
|
||||||
|
path: url
|
||||||
|
},
|
||||||
|
'',
|
||||||
|
url
|
||||||
|
)
|
||||||
|
}
|
||||||
|
emit('nodeClick', data)
|
||||||
|
} else {
|
||||||
|
resourceListTree.value.setCurrentKey(null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTree = async () => {
|
const getTree = async () => {
|
||||||
const request = { busiFlag: curCanvasType.value } as BusiTreeRequest
|
const request = {
|
||||||
|
busiFlag: curCanvasType.value,
|
||||||
|
resourceTable: props.resourceTable
|
||||||
|
} as BusiTreeRequest
|
||||||
const isDashboard = curCanvasType.value == 'dashboard'
|
const isDashboard = curCanvasType.value == 'dashboard'
|
||||||
await interactiveStore.setInteractive(request)
|
await interactiveStore.setInteractive(request)
|
||||||
const interactiveData = isDashboard ? interactiveStore.getPanel : interactiveStore.getScreen
|
const interactiveData = isDashboard ? interactiveStore.getPanel : interactiveStore.getScreen
|
||||||
@ -305,15 +371,13 @@ const afterTreeInit = () => {
|
|||||||
expandedArray.value = getDefaultExpandedKeys()
|
expandedArray.value = getDefaultExpandedKeys()
|
||||||
returnMounted.value = false
|
returnMounted.value = false
|
||||||
}
|
}
|
||||||
|
onInitReady({ type: curCanvasType.value }, 'resource_tree_init_ready')
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resourceListTree.value.setCurrentKey(selectedNodeKey.value)
|
resourceListTree.value.setCurrentKey(selectedNodeKey.value)
|
||||||
nextTick(() => {
|
|
||||||
if (selectedNodeKey.value) {
|
|
||||||
const nodeDom = document.querySelector('.is-current')
|
|
||||||
nodeDom && nodeDom.click()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
resourceListTree.value.filter(filterText.value)
|
resourceListTree.value.filter(filterText.value)
|
||||||
|
nextTick(() => {
|
||||||
|
document.querySelector('.is-current')?.firstChild?.click()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,6 +401,22 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
|
|||||||
getTree()
|
getTree()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
} else if (cmd === 'cancelPublish') {
|
||||||
|
const params = {
|
||||||
|
id: data.id,
|
||||||
|
nodeType: 'leaf',
|
||||||
|
name: data.name,
|
||||||
|
type: curCanvasType.value,
|
||||||
|
mobileLayout: data?.extraFlag,
|
||||||
|
status: 0
|
||||||
|
}
|
||||||
|
updateBase(params).then(() => {
|
||||||
|
data['extraFlag1'] = 0
|
||||||
|
if (dvInfo.value.id === data.id) {
|
||||||
|
dvMainStore.updateDvInfoCall(0)
|
||||||
|
}
|
||||||
|
ElMessage.warning(t('visualization.cancel_publish_tips'))
|
||||||
|
})
|
||||||
} else if (cmd === 'edit') {
|
} else if (cmd === 'edit') {
|
||||||
resourceEdit(data.id)
|
resourceEdit(data.id)
|
||||||
} else if (cmd === 'copy') {
|
} else if (cmd === 'copy') {
|
||||||
@ -703,23 +783,43 @@ defineExpose({
|
|||||||
draggable
|
draggable
|
||||||
>
|
>
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
<span class="custom-tree-node">
|
<span class="custom-tree-node" :class="{ 'node-disabled-custom': data.extraFlag1 === 0 }">
|
||||||
<el-icon style="font-size: 18px" v-if="!data.leaf">
|
<el-icon style="font-size: 18px" v-if="!data.leaf">
|
||||||
<Icon name="dv-folder"><dvFolder class="svg-icon" /></Icon>
|
<Icon name="dv-folder"><dvFolder class="svg-icon" /></Icon>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon style="font-size: 18px" v-else-if="curCanvasType === 'dashboard'">
|
<el-icon style="font-size: 18px" v-else-if="curCanvasType === 'dashboard'">
|
||||||
<Icon
|
<Icon v-if="data.extraFlag1"
|
||||||
><component
|
><component
|
||||||
:is="data.extraFlag ? dvDashboardSpineMobile : dvDashboardSpine"
|
:is="data.extraFlag ? dvDashboardSpineMobile : dvDashboardSpine"
|
||||||
></component
|
></component
|
||||||
></Icon>
|
></Icon>
|
||||||
|
<Icon v-if="!data.extraFlag1"
|
||||||
|
><component
|
||||||
|
:is="data.extraFlag ? dvDashboardSpineMobileDisabled : dvDashboardSpineDisabled"
|
||||||
|
></component
|
||||||
|
></Icon>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon class="icon-screen-new color-dataV" style="font-size: 18px" v-else>
|
<el-icon
|
||||||
|
class="icon-screen-new color-dataV"
|
||||||
|
:class="{ 'color-dataV': data.extraFlag1, 'color-dataV-disabled': !data.extraFlag1 }"
|
||||||
|
style="font-size: 18px"
|
||||||
|
v-else
|
||||||
|
>
|
||||||
<Icon name="icon_operation-analysis_outlined"
|
<Icon name="icon_operation-analysis_outlined"
|
||||||
><icon_operationAnalysis_outlined class="svg-icon"
|
><icon_operationAnalysis_outlined class="svg-icon"
|
||||||
/></Icon>
|
/></Icon>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span :title="node.label" class="label-tooltip">{{ node.label }}</span>
|
<span :title="node.label" class="label-tooltip">
|
||||||
|
<el-tooltip
|
||||||
|
class="box-item"
|
||||||
|
effect="dark"
|
||||||
|
:content="t('visualization.publish_tips1')"
|
||||||
|
:disabled="data.extraFlag1"
|
||||||
|
placement="top-start"
|
||||||
|
>
|
||||||
|
{{ node.label }}
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
<div class="icon-more" v-if="data.weight >= 7 && showPosition === 'preview'">
|
<div class="icon-more" v-if="data.weight >= 7 && showPosition === 'preview'">
|
||||||
<el-icon
|
<el-icon
|
||||||
v-on:click.stop
|
v-on:click.stop
|
||||||
@ -902,7 +1002,7 @@ defineExpose({
|
|||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.menu-outer-dv_popper {
|
.menu-outer-dv_popper {
|
||||||
width: 140px;
|
min-width: 140px;
|
||||||
margin-top: -2px !important;
|
margin-top: -2px !important;
|
||||||
|
|
||||||
.ed-icon {
|
.ed-icon {
|
||||||
@ -921,5 +1021,14 @@ defineExpose({
|
|||||||
i {
|
i {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.node-disabled-custom {
|
||||||
|
color: rgba(187, 191, 196, 1);
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-dataV-disabled {
|
||||||
|
background: #bbbfc4 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -5,14 +5,18 @@
|
|||||||
v-model="dialogShow"
|
v-model="dialogShow"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
:title="t('visualization.multiplexing')"
|
:title="t('visualization.multiplexing')"
|
||||||
custom-class="custom-drawer"
|
modal-class="custom-drawer"
|
||||||
|
@closed="handleClose()"
|
||||||
>
|
>
|
||||||
|
<!-- 标识当前在复用页,用于作为轮播提示前缀 -->
|
||||||
|
<div v-if="dialogShow" id="multiplexingDrawer" />
|
||||||
<dashboard-preview-show
|
<dashboard-preview-show
|
||||||
v-if="dialogShow && curDvType === 'dashboard'"
|
v-if="dialogShow && curDvType === 'dashboard'"
|
||||||
ref="multiplexingPreviewShowRef"
|
ref="multiplexingPreviewShowRef"
|
||||||
class="multiplexing-area"
|
class="multiplexing-area"
|
||||||
no-close
|
no-close
|
||||||
show-position="multiplexing"
|
show-position="multiplexing"
|
||||||
|
resource-table="snapshot"
|
||||||
></dashboard-preview-show>
|
></dashboard-preview-show>
|
||||||
<preview-show
|
<preview-show
|
||||||
v-if="dialogShow && curDvType === 'dataV'"
|
v-if="dialogShow && curDvType === 'dataV'"
|
||||||
@ -20,6 +24,7 @@
|
|||||||
class="multiplexing-area"
|
class="multiplexing-area"
|
||||||
no-close
|
no-close
|
||||||
show-position="multiplexing"
|
show-position="multiplexing"
|
||||||
|
resource-table="snapshot"
|
||||||
></preview-show>
|
></preview-show>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-row class="multiplexing-footer">
|
<el-row class="multiplexing-footer">
|
||||||
@ -66,6 +71,7 @@ import { storeToRefs } from 'pinia'
|
|||||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||||
import PreviewShow from '@/views/data-visualization/PreviewShow.vue'
|
import PreviewShow from '@/views/data-visualization/PreviewShow.vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
|
import ChartCarouselTooltip from '@/views/chart/components/js/g2plot_tooltip_carousel'
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const snapshotStore = snapshotStoreWithOut()
|
const snapshotStore = snapshotStoreWithOut()
|
||||||
const dialogShow = ref(false)
|
const dialogShow = ref(false)
|
||||||
@ -82,6 +88,7 @@ const state = reactive({
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
const dialogInit = (dvType = 'dashboard') => {
|
const dialogInit = (dvType = 'dashboard') => {
|
||||||
|
ChartCarouselTooltip.paused()
|
||||||
curDvType.value = dvType
|
curDvType.value = dvType
|
||||||
dialogShow.value = true
|
dialogShow.value = true
|
||||||
dvMainStore.initCurMultiplexingComponents()
|
dvMainStore.initCurMultiplexingComponents()
|
||||||
@ -92,11 +99,19 @@ const saveMultiplexing = () => {
|
|||||||
const previewStateInfo = multiplexingPreviewShowRef.value.getPreviewStateInfo()
|
const previewStateInfo = multiplexingPreviewShowRef.value.getPreviewStateInfo()
|
||||||
const canvasViewInfoPreview = previewStateInfo.canvasViewInfoPreview
|
const canvasViewInfoPreview = previewStateInfo.canvasViewInfoPreview
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
copyStore.copyMultiplexingComponents(canvasViewInfoPreview)
|
copyStore.copyMultiplexingComponents(
|
||||||
|
canvasViewInfoPreview,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
previewStateInfo.canvasStylePreview.scale
|
||||||
|
)
|
||||||
snapshotStore.recordSnapshotCache('saveMultiplexing')
|
snapshotStore.recordSnapshotCache('saveMultiplexing')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const handleClose = () => {
|
||||||
|
ChartCarouselTooltip.closeEnlargeDialogDestroy()
|
||||||
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
dialogInit
|
dialogInit
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user