|
@@ -2,7 +2,7 @@
|
|
|
* @Author: WangJiaCheng
|
|
|
* @Date: 2021-05-12 15:36:33
|
|
|
* @LastEditors: wjc
|
|
|
- * @LastEditTime: 2021-12-02 17:41:33
|
|
|
+ * @LastEditTime: 2021-12-10 10:37:57
|
|
|
* @Description:
|
|
|
-->
|
|
|
<template>
|
|
@@ -114,6 +114,17 @@
|
|
|
/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="order"
|
|
|
+ label="排序号"
|
|
|
+ width="100"
|
|
|
+ >
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-input
|
|
|
+ v-model="row.order"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="edit"
|
|
|
label="操作"
|
|
@@ -170,22 +181,23 @@ export default {
|
|
|
const resBody = JSON.parse(formatApiJson.res_body)
|
|
|
const { properties: { list: { items: { properties: propertyDta = {} } } } } = resBody
|
|
|
if (propertyDta) {
|
|
|
- for (const key of Object.keys(propertyDta)) {
|
|
|
+ for (const [index, key] of Object.keys(propertyDta).entries()) {
|
|
|
this.tableData.push({
|
|
|
type: propertyDta[key].type,
|
|
|
name: propertyDta[key].description.replace(/\((.+)\)/g, ''),
|
|
|
- field: key
|
|
|
+ field: key,
|
|
|
+ order: index
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
next() {
|
|
|
- this.setListConfig({ ...this.formData, list: this.tableData })
|
|
|
+ this.setListConfig({ ...this.formData, list: this.tableData.sort((a, b) => a.order - b.order) })
|
|
|
this.setActiveTab('detail')
|
|
|
},
|
|
|
previewCode() {
|
|
|
- this.$emit('preview', { ...this.formData, list: this.tableData }, 'list')
|
|
|
+ this.$emit('preview', { ...this.formData, list: this.tableData.sort((a, b) => a.order - b.order) }, 'list')
|
|
|
},
|
|
|
addCol() {
|
|
|
this.tableData.push({
|