|
@@ -1,13 +1,16 @@
|
|
<template>
|
|
<template>
|
|
<mx-table ref="table" :prop-defines="resolvedTable.columns" :rows="resolvedTable.rows" border>
|
|
<mx-table ref="table" :prop-defines="resolvedTable.columns" :rows="resolvedTable.rows" border>
|
|
- <template #elective-cell="{value, label, prop}">
|
|
|
|
|
|
+ <template #elective-cell="{value, label, prop, key}">
|
|
<el-tooltip :disabled="(value&&value.disabled)||!!!prop.queryCode" effect="light">
|
|
<el-tooltip :disabled="(value&&value.disabled)||!!!prop.queryCode" effect="light">
|
|
<div slot="content">
|
|
<div slot="content">
|
|
查看名单
|
|
查看名单
|
|
</div>
|
|
</div>
|
|
<div v-if="value" class="pointer" :style="getCellStyles(value)" @click="goDetails(value, label, $event)">
|
|
<div v-if="value" class="pointer" :style="getCellStyles(value)" @click="goDetails(value, label, $event)">
|
|
- <span v-if="value.star">*</span>
|
|
|
|
- <span>{{ value && value.value }}</span>
|
|
|
|
|
|
+ <template v-if="!useUnderOverBadge(key)">
|
|
|
|
+ <span v-if="value.star">*</span>
|
|
|
|
+ <span>{{ value && value.value }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <over-under-badge v-else :value="value.value" exchange></over-under-badge>
|
|
</div>
|
|
</div>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
</template>
|
|
</template>
|
|
@@ -15,11 +18,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import config from '@/common/mx-config'
|
|
|
|
import MxTransferMixin from '@/components/mx-transfer-mixin'
|
|
import MxTransferMixin from '@/components/mx-transfer-mixin'
|
|
|
|
+import ElectiveColorMap from './elective-color-map-mixins'
|
|
|
|
+import OverUnderBadge from '@/views/elective/publish/components/steps/fauclty/over-under-badge'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- mixins: [MxTransferMixin],
|
|
|
|
|
|
+ components: { OverUnderBadge },
|
|
|
|
+ mixins: [MxTransferMixin, ElectiveColorMap],
|
|
name: 'elective-generation-table',
|
|
name: 'elective-generation-table',
|
|
props: ['chartBinding'],
|
|
props: ['chartBinding'],
|
|
computed: {
|
|
computed: {
|
|
@@ -71,7 +76,8 @@ export default {
|
|
roundId: this.chartBinding.generation.status.roundId,
|
|
roundId: this.chartBinding.generation.status.roundId,
|
|
generation: -1, // for detail page special display,
|
|
generation: -1, // for detail page special display,
|
|
queryableCategories: [], // 本代支持查询的列
|
|
queryableCategories: [], // 本代支持查询的列
|
|
- ignoreGroupCategories: [] // 本代支持查询,且与组合无关的列
|
|
|
|
|
|
+ ignoreGroupCategories: [], // 本代支持查询,且与组合无关的列
|
|
|
|
+ isAccumulate: true
|
|
}
|
|
}
|
|
this.chartBinding.chartData.accumulates.forEach(acc => this.resolveTableGeneration(ext, acc, columns, rows, mergedColumns, prefix, true))
|
|
this.chartBinding.chartData.accumulates.forEach(acc => this.resolveTableGeneration(ext, acc, columns, rows, mergedColumns, prefix, true))
|
|
}
|
|
}
|
|
@@ -93,6 +99,9 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ useUnderOverBadge(label) {
|
|
|
|
+ return ['indicateCount'].some(prop => label.includes(prop))
|
|
|
|
+ },
|
|
resolveTableGeneration(ext, data, columnsRef, rowsRef, mergedColumnsRef, prefix = '', fixed = false, overrideQueryName = '') {
|
|
resolveTableGeneration(ext, data, columnsRef, rowsRef, mergedColumnsRef, prefix = '', fixed = false, overrideQueryName = '') {
|
|
// resolve core
|
|
// resolve core
|
|
const prop = prefix + ext.generation + '_' + data.category
|
|
const prop = prefix + ext.generation + '_' + data.category
|
|
@@ -131,36 +140,11 @@ export default {
|
|
getCellStyles(option) {
|
|
getCellStyles(option) {
|
|
const styles = {}
|
|
const styles = {}
|
|
if (option.color) {
|
|
if (option.color) {
|
|
- const map = {
|
|
|
|
- R: config.color.error,
|
|
|
|
- r: config.color.error,
|
|
|
|
- G: config.color.success,
|
|
|
|
- g: config.color.success,
|
|
|
|
- B: config.color.blue_up,
|
|
|
|
- b: config.color.blue_up,
|
|
|
|
- p: config.color.primary,
|
|
|
|
- P: config.color.primary,
|
|
|
|
- y: config.color.yellow_report,
|
|
|
|
- Y: config.color.yellow_report
|
|
|
|
- }
|
|
|
|
- styles.color = map[option.color] || option.color
|
|
|
|
|
|
+ styles.color = this.matchElectiveColor(option.color)
|
|
}
|
|
}
|
|
return styles
|
|
return styles
|
|
},
|
|
},
|
|
goDetails(option, label, e) {
|
|
goDetails(option, label, e) {
|
|
- // try close accessor el-popover
|
|
|
|
- // const $btn = e?.currentTarget?.__vue__
|
|
|
|
- // if ($btn) {
|
|
|
|
- // let parent = $btn.$parent
|
|
|
|
- // while (parent) {
|
|
|
|
- // if (parent.$options.name === 'ElPopover') {
|
|
|
|
- // parent.doClose()
|
|
|
|
- // break
|
|
|
|
- // }
|
|
|
|
- // parent = parent.$parent
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
// jump logic
|
|
// jump logic
|
|
const path = '/elective/generation/detail'
|
|
const path = '/elective/generation/detail'
|
|
const nextData = {
|
|
const nextData = {
|
|
@@ -168,6 +152,7 @@ export default {
|
|
roundId: this.chartBinding.generation.status.roundId,
|
|
roundId: this.chartBinding.generation.status.roundId,
|
|
roundName: this.chartBinding.generation.status.roundName,
|
|
roundName: this.chartBinding.generation.status.roundName,
|
|
activeGeneration: this.chartBinding.generation.active,
|
|
activeGeneration: this.chartBinding.generation.active,
|
|
|
|
+ isAccumulate: option.isAccumulate || false,
|
|
queryGeneration: option.generation,
|
|
queryGeneration: option.generation,
|
|
queryGroupId: option.groupId,
|
|
queryGroupId: option.groupId,
|
|
queryCode: option.queryCode,
|
|
queryCode: option.queryCode,
|