Merge branch 'dev-v2' into pr@dev-v2@refactor_ai

This commit is contained in:
王嘉豪 2024-04-01 18:13:31 +08:00 committed by GitHub
commit 424a7933f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 82 additions and 12 deletions

View File

@ -25,6 +25,7 @@ import { copyStoreWithOut } from '@/store/modules/data-visualization/copy'
import TabsGroup from '@/custom-component/component-group/TabsGroup.vue'
import DeResourceGroupOpt from '@/views/common/DeResourceGroupOpt.vue'
import OuterParamsSet from '@/components/visualization/OuterParamsSet.vue'
import { XpackComponent } from '@/components/plugin'
const { t } = useI18n()
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
@ -102,7 +103,8 @@ const previewOuter = () => {
}
canvasSave(() => {
const url = '#/preview?dvId=' + dvInfo.value.id
window.open(url, '_blank')
const newWindow = window.open(url, '_blank')
initOpenHandler(newWindow)
})
}
@ -323,6 +325,17 @@ const onDvNameChange = () => {
}
const appStore = useAppStoreWithOut()
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
const openHandler = ref(null)
const initOpenHandler = newWindow => {
if (openHandler?.value) {
const pm = {
methodName: 'initOpenHandler',
args: newWindow
}
openHandler.value.invokeMethod(pm)
}
}
</script>
<template>
@ -574,6 +587,7 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
/>
<outer-params-set ref="outerParamsSetRef"> </outer-params-set>
</div>
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
</template>
<style lang="less" scoped>

View File

@ -498,6 +498,7 @@ const handleBeforeClose = () => {
inputCom.value?.mult?.handleClickOutside?.()
handleDialogClick()
dialogVisible.value = false
visiblePopover.value = false
}
const confirmClick = () => {
@ -1408,12 +1409,34 @@ defineExpose({
</div>
<div class="list-item" v-if="+curComponent.displayType === 0">
<div class="label">
<el-checkbox v-model="curComponent.showEmpty" label="选项值包含空数据" />
<el-tooltip
effect="dark"
content="绑定参数后,不支持传空数据"
:disabled="!curComponent.parametersCheck"
placement="top"
>
<el-checkbox
:disabled="curComponent.parametersCheck"
v-model="curComponent.showEmpty"
label="选项值包含空数据"
/>
</el-tooltip>
</div>
</div>
<div class="list-item">
<div class="label">
<el-checkbox v-model="curComponent.parametersCheck" label="绑定参数" />
<el-tooltip
effect="dark"
content="空数据不支持传参数"
:disabled="!curComponent.showEmpty"
placement="top"
>
<el-checkbox
:disabled="curComponent.showEmpty"
v-model="curComponent.parametersCheck"
label="绑定参数"
/>
</el-tooltip>
</div>
<template v-if="curComponent.parametersCheck">
<div v-if="curComponent.displayType !== '7'" class="parameters">
@ -1701,8 +1724,10 @@ defineExpose({
border-radius: 4px;
border: 1px solid #dee0e3;
display: flex;
.ed-checkbox__label:hover {
color: #1f2329;
.ed-checkbox:not(.is-disabled) {
.ed-checkbox__label:hover {
color: #1f2329;
}
}
.query-condition-list {
height: 100%;

View File

@ -96,7 +96,7 @@ onMounted(() => {
</el-menu>
<div class="operate-setting" v-if="!desktop">
<XpackComponent jsname="c3dpdGNoZXI=" />
<el-icon class="ai-icon" v-if="aiBaseUrl">
<el-icon style="margin: 0 10px" class="ai-icon" v-if="aiBaseUrl">
<Icon name="dv-ai" @click="handleAiClick" />
</el-icon>
<ToolboxCfg v-if="showToolbox" />

View File

@ -23,7 +23,7 @@ const { start, done } = useNProgress()
const { loadStart, loadDone } = usePageLoading()
const whiteList = ['/login', '/de-link', '/chart-view'] // 不重定向白名单
const embeddedWindowWhiteList = ['/dvCanvas', '/dashboard']
const embeddedWindowWhiteList = ['/dvCanvas', '/dashboard', '/preview']
const embeddedRouteWhiteList = ['/dataset-embedded', '/dataset-form', '/dataset-embedded-form']
router.beforeEach(async (to, from, next) => {
start()

View File

@ -9,6 +9,7 @@ import { Base64 } from 'js-base64'
import { getOuterParamsInfo } from '@/api/visualization/outerParams'
import { ElMessage } from 'element-plus-secondary'
import { useI18n } from '@/hooks/web/useI18n'
import { XpackComponent } from '@/components/plugin'
const dvMainStore = dvMainStoreWithOut()
const { t } = useI18n()
const state = reactive({
@ -92,8 +93,10 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
}
)
}
onMounted(() => {
let p = null
const XpackLoaded = () => p(true)
onMounted(async () => {
await new Promise(r => (p = r))
const { dvId, dvType } = router.currentRoute.value.query
if (dvId) {
loadCanvasDataAsync(dvId, dvType)
@ -118,6 +121,11 @@ defineExpose({
:cur-gap="state.curPreviewGap"
></de-preview>
</div>
<XpackComponent
jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvTmV3V2luZG93SGFuZGxlcg=="
@loaded="XpackLoaded"
@load-fail="XpackLoaded"
/>
</template>
<style lang="less">

View File

@ -7,6 +7,7 @@ import DvDetailInfo from '@/views/common/DvDetailInfo.vue'
import { storeApi, storeStatusApi } from '@/api/visualization/dataVisualization'
import { ref, watch, computed } from 'vue'
import ShareVisualHead from '@/views/share/share/ShareVisualHead.vue'
import { XpackComponent } from '@/components/plugin'
const dvMainStore = dvMainStoreWithOut()
const appStore = useAppStoreWithOut()
const { dvInfo } = storeToRefs(dvMainStore)
@ -16,7 +17,8 @@ const { t } = useI18n()
const favorited = ref(false)
const preview = () => {
const url = '#/preview?dvId=' + dvInfo.value.id
window.open(url, '_blank')
const newWindow = window.open(url, '_blank')
initOpenHandler(newWindow)
}
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
@ -33,7 +35,8 @@ const downloadAsAppTemplate = downloadType => {
const dvEdit = () => {
const baseUrl = dvInfo.value.type === 'dataV' ? '#/dvCanvas?dvId=' : '#/dashboard?resourceId='
window.open(baseUrl + dvInfo.value.id, '_blank')
const newWindow = window.open(baseUrl + dvInfo.value.id, '_blank')
initOpenHandler(newWindow)
}
const executeStore = () => {
@ -58,6 +61,17 @@ watch(
storeQuery()
}
)
const openHandler = ref(null)
const initOpenHandler = newWindow => {
if (openHandler?.value) {
const pm = {
methodName: 'initOpenHandler',
args: newWindow
}
openHandler.value.invokeMethod(pm)
}
}
</script>
<template>
@ -147,6 +161,7 @@ watch(
</el-dropdown>
</div>
</div>
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
</template>
<style lang="less">

View File

@ -225,6 +225,10 @@ watch(
margin-top: 16px;
height: calc(100% - 110px);
:deep(.ed-table__row):hover {
cursor: pointer;
}
.name-content {
display: flex;
align-items: center;

View File

@ -432,6 +432,10 @@ const getEmptyDesc = (): string => {
margin-top: 16px;
height: calc(100% - 110px);
:deep(.ed-table__row):hover {
cursor: pointer;
}
.name-content {
display: flex;
align-items: center;

@ -1 +1 @@
Subproject commit 299cd6287249a793abd799f39c40b45d01eb2336
Subproject commit fac43165280525519002d8aed6882ce691169280