Merge pull request #12280 from dataease/pr@dev-v2@refactor_picture-group

refactor(图表): 图片组默认展示优化
This commit is contained in:
王嘉豪 2024-09-19 11:32:06 +08:00 committed by GitHub
commit 9b34e429bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 14 deletions

View File

@ -177,11 +177,10 @@ onBeforeUnmount(() => {
<el-row class="pic-adaptor">
<el-form-item
v-if="curComponent.style.adaptation"
class="form-item"
class="form-item form-item-custom"
label="图片适应方式"
size="small"
:effect="themes"
:class="'form-item-' + themes"
>
<el-radio-group
size="small"
@ -309,7 +308,7 @@ onBeforeUnmount(() => {
}
}
.form-item-dark {
.form-item-custom {
.ed-radio {
margin-right: 4px !important;
}

View File

@ -107,6 +107,7 @@ const initCurFields = chartDetails => {
}
const conditionAdaptor = (chart: Chart) => {
state.showUrl = null
if (!chart || !chart.senior) {
return
}
@ -118,7 +119,7 @@ const conditionAdaptor = (chart: Chart) => {
if (conditions?.length > 0) {
for (let i = 0; i < conditions.length; i++) {
const field = conditions[i]
let defaultValueColor = 'none'
let defaultValueColor = null
const checkResult = mappingColor(
dataRowNameSelect.value[field.field.name],
defaultValueColor,
@ -139,8 +140,13 @@ const withInit = () => {
}
const calcData = (view: Chart, callback) => {
console.log('===calcData1')
isError.value = false
const { threshold } = parseJson(view.senior)
if (!threshold.enable) {
withInit()
callback?.()
return
}
if (view.tableId || view['dataFrom'] === 'template') {
const v = JSON.parse(JSON.stringify(view))
getData(v)

View File

@ -575,11 +575,13 @@ init()
<span v-else-if="item.term === 'not_empty'" :title="t('chart.filter_not_empty')">
{{ t('chart.filter_not_empty') }}
</span>
<span v-else-if="item.term === 'default'" title="默认"> 默认 </span>
</div>
<div style="flex: 1; margin: 0 8px">
<span
v-if="
!item.term.includes('null') &&
!item.term.includes('default') &&
!item.term.includes('empty') &&
item.term !== 'between'
"

View File

@ -366,7 +366,8 @@ init()
v-if="
!item.term.includes('null') &&
!item.term.includes('empty') &&
item.term !== 'between'
item.term !== 'between' &&
!item.term.includes('default')
"
:span="10"
style="text-align: center"

View File

@ -6,17 +6,11 @@ const { t } = useI18n()
* 图片组图表
*/
export class PictureGroupView extends AbstractChartView {
properties: EditorProperty[] = [
'background-overall-component',
'border-style',
'threshold',
'function-cfg'
]
properties: EditorProperty[] = ['background-overall-component', 'border-style', 'threshold']
propertyInner: EditorPropertyInner = {
'background-overall-component': ['all'],
'border-style': ['all'],
threshold: ['tableThreshold'],
'function-cfg': ['emptyDataStrategy']
threshold: ['tableThreshold']
}
axis: AxisType[] = ['xAxis', 'yAxis', 'filter']
axisConfig: AxisConfig = {