| | |
| | | </el-form> |
| | | |
| | | <el-table |
| | | :key="tableKey" |
| | | ref="elTable" |
| | | style="margin-top: 20px" |
| | | v-loading="loading" |
| | |
| | | v-if="item.visible" |
| | | :prop="item.id" |
| | | :label="item.label" |
| | | v-bind="item" |
| | | :min-width="item.minWidth" |
| | | > |
| | | <template slot-scope="scope"> |
| | |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | tableKey: 0, |
| | | open: false, |
| | | timeRange: [], |
| | | // 查询参数 |
| | |
| | | {required: true, message: "项目名称不能为空", trigger: "blur"} |
| | | ], |
| | | projectStatus: [ |
| | | {required: true, message: "项目状态 (0未开工,1已开工,2已竣工,3暂停)不能为空", trigger: "change"} |
| | | {required: true, message: "项目状态不能为空", trigger: "change"} |
| | | ], |
| | | } |
| | | }; |
| | |
| | | return item; |
| | | }); |
| | | }, |
| | | handleUpdateSort(data) { |
| | | handleUpdateSort(row) { |
| | | console.log( this.columns, '排序前的列'); |
| | | this.columns = this.columns.map(item => { |
| | | if (item.key === data.key) { |
| | | item.serialNumber = data.serialNumber; |
| | | if (item.key === row.key) { |
| | | return row; |
| | | } |
| | | return item; |
| | | }); |
| | | this.defaultColumns = JSON.parse(JSON.stringify(this.columns)).sort((a, b) => a.index - b.index); |
| | | this.columns.sort((a, b) => a.serialNumber - b.serialNumber); |
| | | |
| | | //强制table渲染 |
| | | this.tableKey = this.tableKey +1; |
| | | console.log( this.columns, '排序后的列'); |
| | | }, |
| | | // 关闭文件处理弹框的方法 |