Browse Source

feat: 自定义显示列支持设置固定列尾

old
PBK-B 4 years ago
parent
commit
954ccf07b4
  1. 40
      src/views/form/statistics/list.vue

40
src/views/form/statistics/list.vue

@ -47,6 +47,7 @@
{{ scope.row[col] }}
</template>
</el-table-column>
<el-table-column
v-for="col in otherCustomColumns"
:key="col" :label="projectItemColumns[col]"
@ -56,6 +57,16 @@
{{ scope.row['processData'][col] }}
</template>
</el-table-column>
<el-table-column
v-for="col in fixedFormTailColumns" :key="`t${col}`"
:label="fixedDefaultLabelFormTailColumn[col]"
>
<template slot-scope="scope">
{{ scope.row[col] }}
</template>
</el-table-column>
<el-table-column
:render-header="renderHeader"
fixed="right"
@ -123,6 +134,14 @@
</el-col>
</el-row>
</el-checkbox-group>
<el-divider />
<el-checkbox-group v-model="checkedFixedTailCustomColumns">
<el-row>
<el-col v-for="(val, key) in fixedDefaultLabelFormTailColumn" :key="key" :span="4">
<el-checkbox :label="key">{{ val }}</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
<span slot="footer" class="dialog-footer">
<el-button @click="customColumnDialogVisible = false"> </el-button>
<el-button type="primary" @click="saveStatisticsCheckedColumns"> </el-button>
@ -139,8 +158,12 @@ import ResultItem from './item'
import DataFilter from './filter'
import {getCheckedColumn, saveCheckedColumn} from '@/utils/db'
const fixedDefaultFormColumn = ['serialNumber', 'submitAddress', 'createTime']
const fixedDefaultLabelFormColumn = {serialNumber: '提交序号', submitAddress: '提交地址', createTime: '提交时间'}
//
const fixedDefaultFormColumn = ['serialNumber']
const fixedDefaultLabelFormColumn = {serialNumber: '提交序号'}
//
const fixedDefaultFormTailColumn = ['submitAddress', 'createTime']
const fixedDefaultLabelFormTailColumn = { submitAddress: '提交地址', createTime: '提交时间'}
export default {
name: 'ProjectStatisticsList',
@ -156,9 +179,12 @@ export default {
checkedFilterColumns: [],
//
fixedCustomColumns: fixedDefaultFormColumn,
fixedFormTailColumns: fixedDefaultFormTailColumn,
//
checkedFixedCustomColumns: fixedDefaultFormColumn,
fixedDefaultLabelFormColumn: fixedDefaultLabelFormColumn,
checkedFixedTailCustomColumns: fixedDefaultFormTailColumn,
fixedDefaultLabelFormTailColumn: fixedDefaultLabelFormTailColumn,
//
checkOtherCustomColumns: [],
otherCustomColumns: [],
@ -223,9 +249,11 @@ export default {
this.customColumnDialogVisible = false
this.fixedCustomColumns = this.checkedFixedCustomColumns
this.otherCustomColumns = this.checkOtherCustomColumns
this.fixedFormTailColumns = this.checkedFixedTailCustomColumns
saveCheckedColumn(this.projectKey, {
fixedCustomColumns: this.fixedCustomColumns,
otherCustomColumns: this.otherCustomColumns
otherCustomColumns: this.otherCustomColumns,
fixedCustomTailColumns: this.fixedFormTailColumns
})
},
getDbCheckedColumns() {
@ -233,7 +261,7 @@ export default {
if (!checkedColumn) {
return
}
let {fixedCustomColumns, otherCustomColumns} = checkedColumn
let {fixedCustomColumns, otherCustomColumns, fixedCustomTailColumns} = checkedColumn
if (fixedCustomColumns) {
this.fixedCustomColumns = fixedCustomColumns
this.checkedFixedCustomColumns = fixedCustomColumns
@ -242,6 +270,10 @@ export default {
this.otherCustomColumns = otherCustomColumns
this.checkOtherCustomColumns = otherCustomColumns
}
if (fixedCustomTailColumns) {
this.fixedCustomTailColumns = fixedCustomTailColumns
this.checkedFixedTailCustomColumns = fixedCustomTailColumns
}
},
downloadProjectResultFile() {
if (!this.total) {

Loading…
Cancel
Save