Merge pull request #11624 from dataease/pr@dev-v2@refactor_chart

Pr@dev v2@refactor chart
This commit is contained in:
wisonic-s 2024-08-18 17:29:53 +08:00 committed by GitHub
commit a804535753
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 3 deletions

View File

@ -74,6 +74,7 @@ const sort = (type?) => {
</template>
<style scoped>
.sort-btn {
font-size: 14px;
cursor: pointer;
}
</style>

View File

@ -219,7 +219,7 @@ onMounted(() => {
<template #header>
<div class="assist-line-cfg-header">
<span class="ed-dialog__title">{{ t('chart.assist_line') }}</span>
<el-tooltip class="item" effect="dark" placement="top">
<el-tooltip class="item" effect="ndark" placement="top">
<template #content>
<span> {{ t('chart.assist_line_tip') }}</span>
</template>
@ -379,4 +379,13 @@ span {
font-size: 14px;
}
}
.hint-icon {
cursor: pointer;
font-size: 14px;
color: #646a73;
&.hint-icon--dark {
color: #a6a6a6;
}
}
</style>

View File

@ -11,6 +11,8 @@ import { cloneDeep, defaultsDeep } from 'lodash-es'
import { SERIES_NUMBER_FIELD } from '@antv/s2'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { storeToRefs } from 'pinia'
import { isNumber } from 'mathjs'
import { ElMessage } from 'element-plus-secondary'
const dvMainStore = dvMainStoreWithOut()
const { batchOptStatus } = storeToRefs(dvMainStore)
@ -167,9 +169,25 @@ const changeFieldColumn = () => {
}
const changeFieldColumnWidth = () => {
const { basicStyleForm, fieldColumnWidth } = state
let { width } = fieldColumnWidth
let validate = true
width = parseFloat(width)
if (isNaN(width) || !isNumber(width)) {
validate = false
}
if (width < 0 || width > 200) {
validate = false
}
const fieldWidth = basicStyleForm.tableFieldWidth?.find(
i => i.fieldId === fieldColumnWidth.fieldId
)
if (!validate) {
ElMessage.warning('宽度需要在 0-200 之间')
if (fieldWidth) {
fieldColumnWidth.width = fieldWidth.width
}
return
}
if (fieldWidth) {
fieldWidth.width = fieldColumnWidth.width
changeBasicStyle('tableFieldWidth')
@ -745,8 +763,6 @@ onMounted(() => {
v-model.number="state.fieldColumnWidth.width"
type="number"
class="basic-input-number"
:min="0"
:max="100"
:effect="themes"
:disabled="batchOptStatus"
@change="changeFieldColumnWidth()"