|
|
@@ -4,10 +4,10 @@
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
title="设置导出字段"
|
|
|
- width="70%"
|
|
|
+ width="90%"
|
|
|
height="100%"
|
|
|
- class="edit-dialog"
|
|
|
- top="5vh"
|
|
|
+ class="export-column-edit-dialog"
|
|
|
+ top="2vh"
|
|
|
append-to-body
|
|
|
@close="closeDialog"
|
|
|
>
|
|
|
@@ -55,8 +55,18 @@
|
|
|
max-height="500px"
|
|
|
:data="exportColumns.fields"
|
|
|
style="width: 100%"
|
|
|
+ row-key="name"
|
|
|
border
|
|
|
>
|
|
|
+ <el-table-column
|
|
|
+ width="100"
|
|
|
+ prop="sn"
|
|
|
+ label="排序"
|
|
|
+ >
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-input v-model="scope.row.sn" type="number" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
width="120"
|
|
|
align="center"
|
|
|
@@ -89,7 +99,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
width="auto"
|
|
|
- min-width="240"
|
|
|
+ min-width="180"
|
|
|
prop="labelDesc"
|
|
|
label="字段描述"
|
|
|
>
|
|
|
@@ -102,14 +112,82 @@
|
|
|
/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- width="100"
|
|
|
- prop="unique"
|
|
|
- label="唯一字段"
|
|
|
- >
|
|
|
+ <el-table-column width="160" prop="labelWidth">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <div>列宽</div>
|
|
|
+ <el-input-number
|
|
|
+ v-model="exportColumns.labelWidth"
|
|
|
+ :precision="0"
|
|
|
+ @change="value => changeGlobal(value, 'labelWidth')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-input-number v-model="scope.row.labelWidth" :precision="0" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 后端无对应属性,不做 -->
|
|
|
+ <!-- <el-table-column width="110" prop="labelAlign">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <div>水平对齐</div>
|
|
|
+ <el-radio-group v-model="exportColumns.labelAlign" @change="value => changeGlobal(value, 'labelAlign')">
|
|
|
+ <el-radio label="left">左对齐</el-radio>
|
|
|
+ <el-radio label="center">水平居中</el-radio>
|
|
|
+ <el-radio label="right">右对齐</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-radio-group v-model="scope.row.labelAlign">
|
|
|
+ <el-radio label="left">左对齐</el-radio>
|
|
|
+ <el-radio label="center">水平居中</el-radio>
|
|
|
+ <el-radio label="right">右对齐</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="110" prop="labelVertical">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <div>垂直对齐</div>
|
|
|
+ <el-radio-group v-model="exportColumns.labelVertical" @change="value => changeGlobal(value, 'labelVertical')">
|
|
|
+ <el-radio label="top">顶部对齐</el-radio>
|
|
|
+ <el-radio label="middle">垂直居中</el-radio>
|
|
|
+ <el-radio label="bottom">底部对齐</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-radio-group v-model="scope.row.labelVertical">
|
|
|
+ <el-radio label="top">顶部对齐</el-radio>
|
|
|
+ <el-radio label="middle">垂直居中</el-radio>
|
|
|
+ <el-radio label="bottom">底部对齐</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column width="110" prop="autoWrap">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <div>自动换行</div>
|
|
|
+ <el-radio-group v-model="exportColumns.autoWrap" @change="value => changeGlobal(value, 'autoWrap')">
|
|
|
+ <el-radio :label="true">是</el-radio>
|
|
|
+ <el-radio :label="false">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-radio-group v-model="scope.row.autoWrap">
|
|
|
+ <el-radio :label="true">是</el-radio>
|
|
|
+ <el-radio :label="false">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="120" prop="labelType" label="字段类型">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-radio-group v-model="scope.row.labelType">
|
|
|
+ <el-radio label="string">文本类型</el-radio>
|
|
|
+ <el-radio label="double">数字类型</el-radio>
|
|
|
+ <el-radio label="date">日期类型</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="120" prop="unique" label="唯一字段">
|
|
|
<template v-slot="scope">
|
|
|
<el-radio-group v-model="exportColumns.unique">
|
|
|
- <el-radio :label="scope.$index" @change="changeUnique(scope.$index)" />
|
|
|
+ <el-radio :label="scope.row.name" @change="changeUnique(scope.$index)" />
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -194,7 +272,11 @@ export default {
|
|
|
select_field: 'N',
|
|
|
export_type: 'db',
|
|
|
fields: [],
|
|
|
- unique: ''
|
|
|
+ unique: '',
|
|
|
+ labelWidth: 10,
|
|
|
+ labelAlign: 'left',
|
|
|
+ labelVertical: 'middle',
|
|
|
+ autoWrap: false
|
|
|
},
|
|
|
toolbars: [
|
|
|
{ key: 'save' },
|
|
|
@@ -243,13 +325,20 @@ export default {
|
|
|
methods: {
|
|
|
initFormData (data) {
|
|
|
const arr = data.filter(d => d.parentId !== '0')
|
|
|
- const params = arr.map(d => {
|
|
|
+ const params = arr.map((d, i) => {
|
|
|
return {
|
|
|
name: d.name,
|
|
|
label: d.label,
|
|
|
fieldType: 'text',
|
|
|
labelDesc: '',
|
|
|
+ labelWidth: undefined,
|
|
|
+ labelAlign: '',
|
|
|
+ labelVertical: '',
|
|
|
+ labelType: 'string',
|
|
|
+ labelOption: '',
|
|
|
unique: 'N',
|
|
|
+ autoWrap: '',
|
|
|
+ sn: i + 1,
|
|
|
rights: [
|
|
|
{
|
|
|
type: 'all',
|
|
|
@@ -310,7 +399,10 @@ export default {
|
|
|
},
|
|
|
changeUnique (index) {
|
|
|
this.exportColumns.fields[index].unique = index
|
|
|
- this.exportColumns.unique = index
|
|
|
+ this.exportColumns.unique = this.exportColumns.fields[index].name
|
|
|
+ },
|
|
|
+ changeGlobal (value, attr) {
|
|
|
+ this.exportColumns[attr] = value
|
|
|
},
|
|
|
handleEdit (index, row) {
|
|
|
this.dialogRightsVisible = true
|
|
|
@@ -343,9 +435,22 @@ export default {
|
|
|
this.$emit('close', false)
|
|
|
},
|
|
|
handleConfirm () {
|
|
|
+ this.exportColumns.fields = this.exportColumns.fields.sort((a, b) => a.sn - b.sn)
|
|
|
+ console.log(this.exportColumns)
|
|
|
this.$emit('callback', this.exportColumns)
|
|
|
this.closeDialog()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .export-column-edit-dialog{
|
|
|
+ ::v-deep {
|
|
|
+ .el-dialog__body{
|
|
|
+ .el-radio {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|