fix(系统设置): 选择数据集折叠后再展开,不能一次性弹出

This commit is contained in:
dataeaseShu 2024-07-15 17:08:29 +08:00
parent fd980a98c6
commit 681b646968
6 changed files with 56 additions and 7 deletions

View File

@ -138,7 +138,7 @@ onUnmounted(() => {
<el-icon @click="scaleIncrease(1)" class="hover-icon-custom">
<Icon name="dv-max"></Icon
></el-icon>
<el-divider direction="vertical" class="custom-divider" />
<el-divider direction="vertical" class="custom-divider_scale" />
<el-tooltip effect="ndark" content="定位到中心点" placement="top">
<el-icon @click="reposition" class="hover-icon-custom" style="margin-right: 12px">
<Icon name="dv-reposition"></Icon
@ -164,6 +164,16 @@ onUnmounted(() => {
align-items: center;
}
}
:deep(.ed-input--dark .ed-input__wrapper),
:deep(.ed-input-number--dark:not(.is-disabled) .ed-input-number__decrease:not(.is-disabled)),
:deep(.ed-input-number--dark:not(.is-disabled) .ed-input-number__increase:not(.is-disabled)) {
background-color: #1a1a1a;
}
.custom-divider_scale {
height: 18px;
border-color: #ffffff26;
}
.scale-input-number {
height: 24px;

View File

@ -328,6 +328,7 @@ if (!chart.value.customStyle.component.hasOwnProperty('labelShow')) {
v-model="chart.customStyle.component.nameboxSpacing"
:min="0"
:max="50"
:effect="themes"
controls-position="right"
/>
</el-form-item>

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { PropType, computed, onMounted, shallowRef, ref, nextTick } from 'vue'
import { PropType, computed, onMounted, shallowRef, ref, nextTick, watch } from 'vue'
import { Column, Line, Pie } from '@antv/g2plot'
import { useElementSize } from '@vueuse/core'
import { downloadCanvas } from '@/utils/imgUtils'
@ -8,6 +8,7 @@ interface Copilot {
msgType: string
question: string
chart: object
loading: boolean
chartData: object
msgStatus: number
id: string
@ -19,6 +20,7 @@ const props = defineProps({
msgType: 'api',
chart: {},
id: '',
loading: false,
question: '',
chartData: {
data: {},
@ -192,6 +194,14 @@ const downloadChart = () => {
}
downloadCanvas('img', chartTypeRef.value, '图表')
}
watch(
() => props.copilotInfo.loading,
val => {
if (!val) {
switchChartType(renderTableLocal.value ? 'table' : activeCommand.value)
}
}
)
const renderTable = computed(() => {
const { chart, msgType, msgStatus, chartData } = props.copilotInfo
@ -265,7 +275,12 @@ const tips = computed(() => {
class="chart-type"
ref="chartTypeRef"
>
<div ref="chartRef" class="column-plot_de" :id="`de-${copilotInfo.id}-ed`">
<div
v-if="!copilotInfo.loading"
ref="chartRef"
class="column-plot_de"
:id="`de-${copilotInfo.id}-ed`"
>
<el-table-v2
v-if="renderTable || renderTableLocal"
:columns="columns"

View File

@ -99,7 +99,7 @@ initDataset()
let historyBack = []
getListCopilot().then(res => {
historyBack = (res as unknown as string[]) || []
historyArr.value = cloneDeep(historyBack)
historyArr.value = cloneDeep(historyBack).map(ele => ({ ...ele, loading: false }))
if (!!historyBack.length) {
datasetId.value = historyBack[0].datasetGroupId
datasetId.value && getOptions(datasetId.value)
@ -114,6 +114,19 @@ watch(
overHeight.value = val > 48
}
)
const handleShowLeft = val => {
showLeft.value = val
historyArr.value.forEach(ele => {
ele.loading = true
})
setTimeout(() => {
historyArr.value.forEach(ele => {
ele.loading = false
})
}, 300)
}
const copilotChatLoading = ref(false)
const inputRef = ref()
let time = null
@ -143,7 +156,7 @@ const queryAnswer = () => {
history: historyBack
})
.then(res => {
historyArr.value.push(res)
historyArr.value.push({ ...(res || {}), loading: false })
historyBack = res.history || []
})
.finally(() => {
@ -191,7 +204,7 @@ onBeforeUnmount(() => {
</div>
<div class="dataset-select" :style="{ width: showLeft ? 0 : '280px' }">
<el-tooltip effect="dark" content="收起" placement="left">
<p v-show="!showLeft" class="arrow-right" @click="showLeft = true">
<p v-show="!showLeft" class="arrow-right" @click="handleShowLeft(true)">
<el-icon>
<Icon name="icon_right_outlined"></Icon>
</el-icon>
@ -199,7 +212,7 @@ onBeforeUnmount(() => {
</el-tooltip>
<el-tooltip effect="dark" content="展开" placement="left">
<p v-show="showLeft" class="left-outlined" @click="showLeft = false">
<p v-show="showLeft" class="left-outlined" @click="handleShowLeft(false)">
<el-icon>
<Icon name="icon_left_outlined"></Icon>
</el-icon>

View File

@ -943,6 +943,11 @@ const mousedownDrag = () => {
background: #fff;
box-shadow: 0px 5px 10px 0px #1f23291a;
z-index: 10;
&:hover {
.ed-icon {
color: var(--ed-color-primary, #3370ff) !important;
}
}
}
}

View File

@ -2126,6 +2126,11 @@ const getDsIconName = data => {
background: #fff;
box-shadow: 0px 5px 10px 0px #1f23291a;
z-index: 10;
&:hover {
.ed-icon {
color: var(--ed-color-primary, #3370ff) !important;
}
}
}
}