|
|
@@ -4,8 +4,8 @@
|
|
4
|
4
|
<el-tab-pane label="基本信息" name="basic">
|
|
5
|
5
|
<basic-info-form ref="basicInfo" :info="info" />
|
|
6
|
6
|
</el-tab-pane>
|
|
7
|
|
- <el-tab-pane label="字段信息" name="cloum">
|
|
8
|
|
- <el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight">
|
|
|
7
|
+ <el-tab-pane label="字段信息" name="columnInfo">
|
|
|
8
|
+ <el-table ref="dragTable" :data="columns" row-key="columnId" :max-height="tableHeight">
|
|
9
|
9
|
<el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" />
|
|
10
|
10
|
<el-table-column
|
|
11
|
11
|
label="字段列名"
|
|
|
@@ -141,13 +141,13 @@ export default {
|
|
141
|
141
|
data() {
|
|
142
|
142
|
return {
|
|
143
|
143
|
// 选中选项卡的 name
|
|
144
|
|
- activeName: "cloum",
|
|
|
144
|
+ activeName: "columnInfo",
|
|
145
|
145
|
// 表格的高度
|
|
146
|
146
|
tableHeight: document.documentElement.scrollHeight - 245 + "px",
|
|
147
|
147
|
// 表信息
|
|
148
|
148
|
tables: [],
|
|
149
|
149
|
// 表列信息
|
|
150
|
|
- cloumns: [],
|
|
|
150
|
+ columns: [],
|
|
151
|
151
|
// 字典信息
|
|
152
|
152
|
dictOptions: [],
|
|
153
|
153
|
// 菜单信息
|
|
|
@@ -161,7 +161,7 @@ export default {
|
|
161
|
161
|
if (tableId) {
|
|
162
|
162
|
// 获取表详细信息
|
|
163
|
163
|
getGenTable(tableId).then(res => {
|
|
164
|
|
- this.cloumns = res.data.rows;
|
|
|
164
|
+ this.columns = res.data.rows;
|
|
165
|
165
|
this.info = res.data.info;
|
|
166
|
166
|
this.tables = res.data.tables;
|
|
167
|
167
|
});
|
|
|
@@ -184,7 +184,7 @@ export default {
|
|
184
|
184
|
const validateResult = res.every(item => !!item);
|
|
185
|
185
|
if (validateResult) {
|
|
186
|
186
|
const genTable = Object.assign({}, basicForm.model, genForm.model);
|
|
187
|
|
- genTable.columns = this.cloumns;
|
|
|
187
|
+ genTable.columns = this.columns;
|
|
188
|
188
|
genTable.params = {
|
|
189
|
189
|
treeCode: genTable.treeCode,
|
|
190
|
190
|
treeName: genTable.treeName,
|
|
|
@@ -220,10 +220,10 @@ export default {
|
|
220
|
220
|
const sortable = Sortable.create(el, {
|
|
221
|
221
|
handle: ".allowDrag",
|
|
222
|
222
|
onEnd: evt => {
|
|
223
|
|
- const targetRow = this.cloumns.splice(evt.oldIndex, 1)[0];
|
|
224
|
|
- this.cloumns.splice(evt.newIndex, 0, targetRow);
|
|
225
|
|
- for (let index in this.cloumns) {
|
|
226
|
|
- this.cloumns[index].sort = parseInt(index) + 1;
|
|
|
223
|
+ const targetRow = this.columns.splice(evt.oldIndex, 1)[0];
|
|
|
224
|
+ this.columns.splice(evt.newIndex, 0, targetRow);
|
|
|
225
|
+ for (let index in this.columns) {
|
|
|
226
|
+ this.columns[index].sort = parseInt(index) + 1;
|
|
227
|
227
|
}
|
|
228
|
228
|
}
|
|
229
|
229
|
});
|