forked from github/dataease
fix(数据集): 编辑数据集-关联表-未关联计算字段-确认时提示弹窗-未正确显示计算字段
This commit is contained in:
parent
71a450d44f
commit
2f9bccf65f
@ -31,7 +31,7 @@ interface AppearanceState {
|
|||||||
showDemoTips?: boolean
|
showDemoTips?: boolean
|
||||||
demoTipsContent?: string
|
demoTipsContent?: string
|
||||||
community: boolean
|
community: boolean
|
||||||
fontList: Array<{ name: string; id: string }>
|
fontList: Array<{ name: string; id: string; isDefault: boolean }>
|
||||||
}
|
}
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
export const useAppearanceStore = defineStore('appearanceStore', {
|
export const useAppearanceStore = defineStore('appearanceStore', {
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
} from '@/custom-component/component-list'
|
} from '@/custom-component/component-list'
|
||||||
import { get, set } from 'lodash-es'
|
import { get, set } from 'lodash-es'
|
||||||
import { viewFieldTimeTrans } from '@/utils/viewUtils'
|
import { viewFieldTimeTrans } from '@/utils/viewUtils'
|
||||||
import { isMainCanvas } from '@/utils/canvasUtils'
|
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
||||||
|
|
||||||
export const dvMainStore = defineStore('dataVisualization', {
|
export const dvMainStore = defineStore('dataVisualization', {
|
||||||
state: () => {
|
state: () => {
|
||||||
@ -410,6 +410,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
componentData.push(component)
|
componentData.push(component)
|
||||||
this.setCurComponent({ component: component, index: componentData.length - 1 })
|
this.setCurComponent({ component: component, index: componentData.length - 1 })
|
||||||
}
|
}
|
||||||
|
const currentFont = useAppearanceStoreWithOut().fontList.find(ele => ele.isDefault)
|
||||||
//如果当前的组件是UserView 图表,则想canvasView中增加一项 UserView ID 和componentID保持一致
|
//如果当前的组件是UserView 图表,则想canvasView中增加一项 UserView ID 和componentID保持一致
|
||||||
if (component.component === 'UserView') {
|
if (component.component === 'UserView') {
|
||||||
const defaultConfig = JSON.parse(JSON.stringify(BASE_VIEW_CONFIG))
|
const defaultConfig = JSON.parse(JSON.stringify(BASE_VIEW_CONFIG))
|
||||||
@ -436,6 +437,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
newView = chartViewInstance.setupDefaultOptions(newView)
|
newView = chartViewInstance.setupDefaultOptions(newView)
|
||||||
newView['title'] = component.name
|
newView['title'] = component.name
|
||||||
}
|
}
|
||||||
|
currentFont && (newView.customStyle.text.fontFamily = currentFont.name)
|
||||||
this.canvasViewInfo[component.id] = newView
|
this.canvasViewInfo[component.id] = newView
|
||||||
}
|
}
|
||||||
if (component.component === 'VQuery') {
|
if (component.component === 'VQuery') {
|
||||||
|
@ -147,11 +147,17 @@ const setupSeriesColor = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const flag = ref(1)
|
||||||
|
|
||||||
const switchSeriesColor = (seriesColor, index) => {
|
const switchSeriesColor = (seriesColor, index) => {
|
||||||
seriesColorPickerRef.value?.hide()
|
seriesColorPickerRef.value?.hide()
|
||||||
seriesColorState.curSeriesColor = cloneDeep(seriesColor)
|
seriesColorState.curSeriesColor = cloneDeep(seriesColor)
|
||||||
seriesColorState.curColorIndex = index
|
seriesColorState.curColorIndex = index
|
||||||
seriesColorState.seriesColorPickerId = '#series-color-picker-' + seriesColor.id
|
const id = '#series-color-picker-' + seriesColor.id + `-${flag.value}`
|
||||||
|
if (document.querySelectorAll(id).length > 1) {
|
||||||
|
flag.value = 2
|
||||||
|
}
|
||||||
|
seriesColorState.seriesColorPickerId = '#series-color-picker-' + seriesColor.id + `-${flag.value}`
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
seriesColorPickerRef.value?.show()
|
seriesColorPickerRef.value?.show()
|
||||||
})
|
})
|
||||||
@ -462,7 +468,7 @@ const colorItemBorderColor = (index, state) => {
|
|||||||
class="color-list-item"
|
class="color-list-item"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
:id="`series-color-picker-${item.id}`"
|
:id="`series-color-picker-${item.id}-${flag}`"
|
||||||
:class="{
|
:class="{
|
||||||
active: item.id === seriesColorState.curSeriesColor?.id
|
active: item.id === seriesColorState.curSeriesColor?.id
|
||||||
}"
|
}"
|
||||||
|
@ -434,7 +434,7 @@ export const DEFAULT_TITLE_STYLE: ChartTextStyle = {
|
|||||||
remarkShow: false,
|
remarkShow: false,
|
||||||
remark: '',
|
remark: '',
|
||||||
remarkBackgroundColor: '#ffffff',
|
remarkBackgroundColor: '#ffffff',
|
||||||
fontFamily: 'Microsoft YaHei',
|
fontFamily: '',
|
||||||
letterSpace: '0',
|
letterSpace: '0',
|
||||||
fontShadow: false
|
fontShadow: false
|
||||||
}
|
}
|
||||||
@ -483,7 +483,7 @@ export const DEFAULT_TITLE_STYLE_BASE: ChartTextStyle = {
|
|||||||
isBolder: true,
|
isBolder: true,
|
||||||
remarkShow: false,
|
remarkShow: false,
|
||||||
remark: '',
|
remark: '',
|
||||||
fontFamily: 'Microsoft YaHei',
|
fontFamily: '',
|
||||||
letterSpace: '0',
|
letterSpace: '0',
|
||||||
fontShadow: false,
|
fontShadow: false,
|
||||||
color: '',
|
color: '',
|
||||||
|
@ -277,10 +277,13 @@ const initTitle = () => {
|
|||||||
CHART_FONT_FAMILY_MAP[ele.name] = ele.name
|
CHART_FONT_FAMILY_MAP[ele.name] = ele.name
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
state.title_class.fontFamily = customStyle.text.fontFamily
|
state.title_class.fontFamily = customStyle.text.fontFamily
|
||||||
? CHART_FONT_FAMILY_MAP[customStyle.text.fontFamily]
|
? CHART_FONT_FAMILY_MAP[customStyle.text.fontFamily]
|
||||||
: DEFAULT_TITLE_STYLE.fontFamily
|
: DEFAULT_TITLE_STYLE.fontFamily
|
||||||
|
if (!CHART_FONT_FAMILY_MAP[customStyle.text.fontFamily]) {
|
||||||
|
state.title_class.fontFamily = appearanceStore.fontList.find(ele => ele.isDefault)?.name
|
||||||
|
customStyle.text.fontFamily = state.title_class.fontFamily
|
||||||
|
}
|
||||||
appearanceStore.setCurrentFont(state.title_class.fontFamily)
|
appearanceStore.setCurrentFont(state.title_class.fontFamily)
|
||||||
state.title_class.letterSpacing =
|
state.title_class.letterSpacing =
|
||||||
(customStyle.text.letterSpace
|
(customStyle.text.letterSpace
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, nextTick, onMounted, onUnmounted, reactive, ref } from 'vue'
|
import { computed, nextTick, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
|
||||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import findComponent from '../../utils/components'
|
import findComponent from '../../utils/components'
|
||||||
|
@ -95,6 +95,7 @@ const uploadFail = response => {
|
|||||||
const emits = defineEmits(['finish'])
|
const emits = defineEmits(['finish'])
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
Object.assign(ruleForm, cloneDeep(defaultForm))
|
Object.assign(ruleForm, cloneDeep(defaultForm))
|
||||||
|
ruleFormRef.value.clearValidate()
|
||||||
state.fileList = null
|
state.fileList = null
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, computed } from 'vue'
|
import { onMounted, ref, computed } from 'vue'
|
||||||
import UploadDetail from './UploadDetail.vue'
|
import UploadDetail from './UploadDetail.vue'
|
||||||
import { deleteById, edit, list, defaultFont } from '@/api/font'
|
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
||||||
|
import { deleteById, edit, defaultFont } from '@/api/font'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||||
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
|
const appearanceStore = useAppearanceStoreWithOut()
|
||||||
|
|
||||||
const fontKeyword = ref('')
|
const fontKeyword = ref('')
|
||||||
const fontList = ref([])
|
const fontList = ref([])
|
||||||
const basePath = import.meta.env.VITE_API_BASEPATH
|
const basePath = import.meta.env.VITE_API_BASEPATH
|
||||||
@ -13,15 +18,11 @@ const uploadFont = (title, type, item) => {
|
|||||||
uploadDetail.value.init(title, type, item)
|
uploadDetail.value.init(title, type, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
const listFont = () => {
|
const listFont = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
list({})
|
await appearanceStore.setFontList()
|
||||||
.then(res => {
|
fontList.value = cloneDeep(appearanceStore.fontList)
|
||||||
fontList.value = res
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const fontListComputed = computed(() => {
|
const fontListComputed = computed(() => {
|
||||||
@ -96,16 +97,12 @@ const getDefaultFont = () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const uploadFilish = () => {
|
const uploadFilish = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
list({})
|
await appearanceStore.setFontList()
|
||||||
.then(res => {
|
fontList.value = cloneDeep(appearanceStore.fontList)
|
||||||
fontList.value = res
|
|
||||||
getDefaultFont()
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
getDefaultFont()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -352,7 +352,10 @@ const confirmEditUnion = () => {
|
|||||||
if (!!ids.length) {
|
if (!!ids.length) {
|
||||||
const idArr = allfields.value.reduce((pre, next) => {
|
const idArr = allfields.value.reduce((pre, next) => {
|
||||||
if (next.extField === 2) {
|
if (next.extField === 2) {
|
||||||
const idMap = next.originName.match(/\[(.+?)\]/g)
|
let idMap = next.originName.match(/\[(.+?)\]/g)
|
||||||
|
idMap = idMap.filter(
|
||||||
|
itx => !next.params?.map(element => element.id).includes(itx.slice(1, -1))
|
||||||
|
)
|
||||||
const result = idMap.map(itm => {
|
const result = idMap.map(itm => {
|
||||||
return itm.slice(1, -1)
|
return itm.slice(1, -1)
|
||||||
})
|
})
|
||||||
|
@ -459,7 +459,11 @@ const delFieldByIdFake = (arr, fakeAllfields) => {
|
|||||||
fakeAllfields = fakeAllfields.filter(ele => {
|
fakeAllfields = fakeAllfields.filter(ele => {
|
||||||
if (ele.extField !== 2) return true
|
if (ele.extField !== 2) return true
|
||||||
const idMap = ele.originName.match(/\[(.+?)\]/g)
|
const idMap = ele.originName.match(/\[(.+?)\]/g)
|
||||||
if (!idMap) return true
|
if (
|
||||||
|
!idMap ||
|
||||||
|
idMap.every(itx => ele.params?.map(element => element.id).includes(itx.slice(1, -1)))
|
||||||
|
)
|
||||||
|
return true
|
||||||
const result = idMap.every(itm => {
|
const result = idMap.every(itm => {
|
||||||
const id = itm.slice(1, -1)
|
const id = itm.slice(1, -1)
|
||||||
return allfieldsId.includes(id)
|
return allfieldsId.includes(id)
|
||||||
@ -478,7 +482,8 @@ const deleteField = item => {
|
|||||||
let tip = ''
|
let tip = ''
|
||||||
const idArr = allfields.value.reduce((pre, next) => {
|
const idArr = allfields.value.reduce((pre, next) => {
|
||||||
if (next.extField !== 2) return pre
|
if (next.extField !== 2) return pre
|
||||||
const idMap = next.originName.match(/\[(.+?)\]/g) || []
|
let idMap = next.originName.match(/\[(.+?)\]/g) || []
|
||||||
|
idMap = idMap.filter(itx => !next.params?.map(element => element.id).includes(itx.slice(1, -1)))
|
||||||
const result = idMap.map(itm => {
|
const result = idMap.map(itm => {
|
||||||
return itm.slice(1, -1)
|
return itm.slice(1, -1)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user