diff --git a/core/core-frontend/src/components/data-visualization/DvToolbar.vue b/core/core-frontend/src/components/data-visualization/DvToolbar.vue index 40dceb75cb..ee8b0a78f0 100644 --- a/core/core-frontend/src/components/data-visualization/DvToolbar.vue +++ b/core/core-frontend/src/components/data-visualization/DvToolbar.vue @@ -93,10 +93,13 @@ const saveCanvasWithCheck = () => { const saveResource = () => { wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id) if (styleChangeTimes.value > 0) { - snapshotStore.resetStyleChangeTimes() - canvasSave(() => { - ElMessage.success('保存成功') - window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`) + eventBus.emit('hideArea-canvas-main') + nextTick(() => { + snapshotStore.resetStyleChangeTimes() + canvasSave(() => { + ElMessage.success('保存成功') + window.history.pushState({}, '', `#/dvCanvas?dvId=${dvInfo.value.id}`) + }) }) } } diff --git a/core/core-frontend/src/custom-component/scroll-text/Component.vue b/core/core-frontend/src/custom-component/scroll-text/Component.vue index 3e7dd1b6ee..c15a17f90c 100644 --- a/core/core-frontend/src/custom-component/scroll-text/Component.vue +++ b/core/core-frontend/src/custom-component/scroll-text/Component.vue @@ -81,14 +81,14 @@ const clearStyle = e => { } const handleBlur = e => { - element.value.propValue = e.target.innerHTML || ' ' + element.value.propValue = e.target.innerHTML || '' const html = e.target.innerHTML if (html !== '') { element.value.propValue = e.target.innerHTML } else { element.value.propValue = '' nextTick(function () { - element.value.propValue = ' ' + element.value.propValue = '' }) } canEdit.value = false diff --git a/core/core-frontend/src/utils/canvasStyle.ts b/core/core-frontend/src/utils/canvasStyle.ts index 7b5b7b0896..92942dbf59 100644 --- a/core/core-frontend/src/utils/canvasStyle.ts +++ b/core/core-frontend/src/utils/canvasStyle.ts @@ -125,8 +125,14 @@ export const customAttrTrans = { 'wordSizeRange', 'wordSpacing' ], - label: ['fontSize'], - tooltip: ['fontSize'], + label: { + fontSize: '', + seriesLabelFormatter: ['fontSize'] + }, + tooltip: { + fontSize: '', + seriesTooltipFormatter: ['fontSize'] + }, indicator: ['fontSize', 'suffixFontSize'], indicatorName: ['fontSize', 'nameValueSpacing'] } @@ -296,15 +302,25 @@ export function recursionTransObj(template, infoObj, scale, terminal) { // 如果是数组 进行赋值计算 if (template[templateKey] instanceof Array) { template[templateKey].forEach(templateProp => { - if (infoObj[templateKey] && infoObj[templateKey][templateProp]) { + if ( + infoObj[templateKey] && + (infoObj[templateKey][templateProp] || infoObj[templateKey].length) + ) { // 移动端特殊属性值设置 if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined) { infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp] } else { - infoObj[templateKey][templateProp] = getScaleValue( - infoObj[templateKey][templateProp], - scale - ) + // 数组依次设置 + if (infoObj[templateKey] instanceof Array) { + infoObj[templateKey].forEach(v => { + v[templateProp] = getScaleValue(v[templateProp], scale) + }) + } else { + infoObj[templateKey][templateProp] = getScaleValue( + infoObj[templateKey][templateProp], + scale + ) + } } } }) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue index 91157a90b7..2047acb07b 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/Threshold.vue @@ -64,10 +64,15 @@ const changeThreshold = () => { const changeSplitThreshold = (threshold: string) => { // check input if (threshold) { + const regex = /^(\d+)(,\d+)*$/ + if (!regex.test(threshold)) { + ElMessage.error(t('chart.gauge_threshold_format_error')) + return + } const arr = threshold.split(',') for (let i = 0; i < arr.length; i++) { const ele = arr[i] - if (parseFloat(ele).toString() === 'NaN' || parseFloat(ele) <= 0 || parseFloat(ele) >= 100) { + if (parseFloat(ele) <= 0 || parseFloat(ele) >= 100) { ElMessage.error(t('chart.gauge_threshold_format_error')) return } diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue index 392a5e099c..a331eb2a7d 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue @@ -560,7 +560,7 @@ onMounted(() => { :effect="themes" v-model="state.basicStyleForm.showZoom" :predefine="predefineColors" - @change="changeBasicStyle('zoomShow')" + @change="changeBasicStyle('showZoom')" > {{ t('chart.show_zoom') }} diff --git a/core/core-frontend/src/views/visualized/data/dataset/index.vue b/core/core-frontend/src/views/visualized/data/dataset/index.vue index 08d42c6066..eb7842987c 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/index.vue +++ b/core/core-frontend/src/views/visualized/data/dataset/index.vue @@ -35,7 +35,9 @@ import type { TabPaneName } from 'element-plus-secondary' import { timestampFormatDate } from './form/util' import { interactiveStoreWithOut } from '@/store/modules/interactive' import { XpackComponent } from '@/components/plugin' +import { useCache } from '@/hooks/web/useCache' const interactiveStore = interactiveStoreWithOut() +const { wsCache } = useCache() interface Field { fieldShortName: string name: string @@ -86,6 +88,7 @@ let originResourceTree = [] const sortTypeChange = sortType => { state.datasetTree = treeSort(originResourceTree, sortType) state.curSortType = sortType + wsCache.set('TreeSort-dataset', state.curSortType) } const resourceCreate = (pid, name) => { @@ -211,10 +214,12 @@ const getData = () => { rootManage.value = nodeData[0]['weight'] >= 7 state.datasetTree = nodeData[0]['children'] || [] originResourceTree = cloneDeep(unref(state.datasetTree)) + sortTypeChange(state.curSortType) return } state.datasetTree = nodeData originResourceTree = cloneDeep(unref(state.datasetTree)) + sortTypeChange(state.curSortType) }) .finally(() => { dtLoading.value = false @@ -252,6 +257,7 @@ const dfsDatasetTree = (ds, id) => { onBeforeMount(() => { nodeInfo.id = (route.params.id as string) || '' + loadInit() getData() }) @@ -471,6 +477,13 @@ const sortList = [ } ] +const loadInit = () => { + const historyTreeSort = wsCache.get('TreeSort-dataset') + if (historyTreeSort) { + state.curSortType = historyTreeSort + } +} + const sortTypeTip = computed(() => { return sortList.find(ele => ele.value === state.curSortType).name }) diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue index 0b73b41847..9330f2efcb 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -42,6 +42,7 @@ import { useMoveLine } from '@/hooks/web/useMoveLine' import { cloneDeep } from 'lodash-es' import { interactiveStoreWithOut } from '@/store/modules/interactive' import treeSort from '@/utils/treeSortUtils' +import { useCache } from '@/hooks/web/useCache' const route = useRoute() const interactiveStore = interactiveStoreWithOut() interface Field { @@ -51,7 +52,7 @@ interface Field { originName: string deType: number } - +const { wsCache } = useCache() const { t } = useI18n() const router = useRouter() const appStore = useAppStoreWithOut() @@ -165,6 +166,7 @@ let originResourceTree = [] const sortTypeChange = sortType => { state.datasourceTree = treeSort(originResourceTree, sortType) state.curSortType = sortType + wsCache.set('TreeSort-datasource', state.curSortType) } const handleSizeChange = pageSize => { state.paginationConfig.currentPage = 1 @@ -391,10 +393,12 @@ const listDs = () => { rootManage.value = nodeData[0]['weight'] >= 7 state.datasourceTree = nodeData[0]['children'] || [] originResourceTree = cloneDeep(unref(state.datasourceTree)) + sortTypeChange(state.curSortType) return } originResourceTree = cloneDeep(unref(state.datasourceTree)) state.datasourceTree = nodeData + sortTypeChange(state.curSortType) }) .finally(() => { mounted.value = true @@ -693,8 +697,17 @@ const defaultProps = { children: 'children', label: 'name' } + +const loadInit = () => { + const historyTreeSort = wsCache.get('TreeSort-datasource') + if (historyTreeSort) { + state.curSortType = historyTreeSort + } +} + onMounted(() => { nodeInfo.id = (route.params.id as string) || '' + loadInit() listDs() const { opt } = router.currentRoute.value.query if (opt && opt === 'create') {