feat: 视图支持计算字段

This commit is contained in:
junjun 2022-06-16 15:08:32 +08:00
parent d3c3198035
commit c648196f1f
3 changed files with 14 additions and 9 deletions

View File

@ -17,7 +17,7 @@
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<field-error-tips v-if="tagType === 'danger'" />
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">
<span v-if="chart.type !== 'table-info' && item.summary && !item.chartId" class="summary-span">
{{ $t('chart.' + item.summary) }}<span v-if="false && item.compareCalc && item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'">-{{ $t('chart.' + item.compareCalc.type) }}</span>
</span>
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
@ -39,7 +39,7 @@
</el-dropdown-menu>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item v-show="chart.type !== 'table-info'" :divided="chart.type === 'chart-mix'">
<el-dropdown-item v-show="!item.chartId && chart.type !== 'table-info'" :divided="chart.type === 'chart-mix'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="summary">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
@ -63,7 +63,7 @@
</el-dropdown-item>
<!--同比/环比-->
<el-dropdown-item v-show="chart.type !== 'table-info'">
<el-dropdown-item v-show="!item.chartId && chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="quickCalc">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
@ -80,7 +80,7 @@
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item :divided="chart.type !== 'table-info'">
<el-dropdown-item :divided="!item.chartId && chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="sort">
<span class="el-dropdown-link inner-dropdown-menu">
<span>

View File

@ -17,7 +17,7 @@
</span>
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
<field-error-tips v-if="tagType === 'danger'" />
<span v-if="chart.type !== 'table-info' && item.summary" class="summary-span">
<span v-if="chart.type !== 'table-info' && item.summary && !item.chartId" class="summary-span">
{{ $t('chart.' + item.summary) }}<span v-if="false && item.compareCalc && item.compareCalc.type && item.compareCalc.type !== '' && item.compareCalc.type !== 'none'">-{{ $t('chart.' + item.compareCalc.type) }}</span>
</span>
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
@ -39,7 +39,7 @@
</el-dropdown-menu>
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item v-show="chart.type !== 'table-info'" :divided="chart.type === 'chart-mix'">
<el-dropdown-item v-show="!item.chartId && chart.type !== 'table-info'" :divided="chart.type === 'chart-mix'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="summary">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
@ -63,7 +63,7 @@
</el-dropdown-item>
<!--同比/环比-->
<el-dropdown-item v-show="chart.type !== 'table-info'">
<el-dropdown-item v-show="!item.chartId && chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="quickCalc">
<span class="el-dropdown-link inner-dropdown-menu">
<span>
@ -80,7 +80,7 @@
</el-dropdown>
</el-dropdown-item>
<el-dropdown-item :divided="chart.type !== 'table-info'">
<el-dropdown-item :divided="!item.chartId && chart.type !== 'table-info'">
<el-dropdown placement="right-start" size="mini" style="width: 100%" @command="sort">
<span class="el-dropdown-link inner-dropdown-menu">
<span>

View File

@ -17,7 +17,12 @@
<div style="max-height: 50vh;overflow-y: auto;">
<el-row v-for="(f,index) in item.filter" :key="index" class="filter-item">
<el-col :span="4">
<span>{{ item.name }} ({{ $t('chart.'+item.summary) }})</span>
<span>
{{ item.name }}
<span v-show="item.summary && item.summary !== ''">
({{ $t('chart.'+item.summary) }})
</span>
</span>
</el-col>
<el-col :span="8">
<el-select v-model="f.term" size="mini">