update ZR.Vue/src/views/tool/gen/editTable.vue.
This commit is contained in:
parent
a0e1276bdf
commit
314843fca7
@ -5,7 +5,7 @@
|
|||||||
<basic-info-form ref="basicInfo" :info="info" />
|
<basic-info-form ref="basicInfo" :info="info" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="字段信息" name="cloum">
|
<el-tab-pane label="字段信息" name="cloum">
|
||||||
<el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight">
|
<el-table ref="dragTable" :data="columns" row-key="columnId" :max-height="tableHeight">
|
||||||
<el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" />
|
<el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" />
|
||||||
<el-table-column label="字段列名" prop="columnName" min-width="10%" :show-overflow-tooltip="true" />
|
<el-table-column label="字段列名" prop="columnName" min-width="10%" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="字段描述" min-width="10%">
|
<el-table-column label="字段描述" min-width="10%">
|
||||||
@ -101,7 +101,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="生成信息" name="genInfo">
|
<el-tab-pane label="生成信息" name="genInfo">
|
||||||
<gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus" :columns="cloumns" />
|
<gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus" :columns="columns" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-form label-width="100px">
|
<el-form label-width="100px">
|
||||||
@ -114,7 +114,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { updateGenTable, queryColumnInfo } from "@/api/tool/gen";
|
import { updateGenTable, getGenTable } from "@/api/tool/gen";
|
||||||
import { listType } from "@/api/system/dict/type";
|
import { listType } from "@/api/system/dict/type";
|
||||||
import { listMenu as getMenuTreeselect } from "@/api/system/menu";
|
import { listMenu as getMenuTreeselect } from "@/api/system/menu";
|
||||||
import basicInfoForm from "./basicInfoForm";
|
import basicInfoForm from "./basicInfoForm";
|
||||||
@ -136,7 +136,7 @@ export default {
|
|||||||
// 表信息
|
// 表信息
|
||||||
tables: [],
|
tables: [],
|
||||||
// 表列信息
|
// 表列信息
|
||||||
cloumns: [],
|
columns: [],
|
||||||
// 字典信息
|
// 字典信息
|
||||||
dictOptions: [],
|
dictOptions: [],
|
||||||
// 菜单信息
|
// 菜单信息
|
||||||
@ -154,13 +154,13 @@ export default {
|
|||||||
|
|
||||||
if (tableId) {
|
if (tableId) {
|
||||||
// 获取表详细信息
|
// 获取表详细信息
|
||||||
queryColumnInfo(tableId).then((res) => {
|
getGenTable(tableId).then((res) => {
|
||||||
this.cloumns = res.data.cloumns;
|
this.columns = res.data.columns;
|
||||||
this.info = res.data.info;
|
this.info = res.data.info;
|
||||||
// this.tables = res.data.tables;/子表
|
this.tables = res.data.tables; //子表
|
||||||
});
|
});
|
||||||
/** 查询字典下拉列表 */
|
/** 查询字典下拉列表 */
|
||||||
listType().then((response) => {
|
listType({ pageSize: 100 }).then((response) => {
|
||||||
this.dictOptions = response.data.result;
|
this.dictOptions = response.data.result;
|
||||||
});
|
});
|
||||||
/** 查询菜单下拉列表 */
|
/** 查询菜单下拉列表 */
|
||||||
@ -177,7 +177,7 @@ export default {
|
|||||||
const validateResult = res.every((item) => !!item);
|
const validateResult = res.every((item) => !!item);
|
||||||
if (validateResult) {
|
if (validateResult) {
|
||||||
const genTable = Object.assign({}, basicForm.model, genForm.model);
|
const genTable = Object.assign({}, basicForm.model, genForm.model);
|
||||||
genTable.columns = this.cloumns;
|
genTable.columns = this.columns;
|
||||||
genTable.params = {
|
genTable.params = {
|
||||||
// treeCode: genTable.treeCode,
|
// treeCode: genTable.treeCode,
|
||||||
// treeName: genTable.treeName,
|
// treeName: genTable.treeName,
|
||||||
@ -217,7 +217,7 @@ export default {
|
|||||||
const sortable = Sortable.create(el, {
|
const sortable = Sortable.create(el, {
|
||||||
handle: ".allowDrag",
|
handle: ".allowDrag",
|
||||||
onEnd: (evt) => {
|
onEnd: (evt) => {
|
||||||
const targetRow = that.cloumns.splice(evt.oldIndex, 1)[0];
|
const targetRow = that.columns.splice(evt.oldIndex, 1)[0];
|
||||||
columns.splice(evt.newIndex, 0, targetRow);
|
columns.splice(evt.newIndex, 0, targetRow);
|
||||||
for (let index in columns) {
|
for (let index in columns) {
|
||||||
columns[index].sort = parseInt(index) + 1;
|
columns[index].sort = parseInt(index) + 1;
|
||||||
@ -230,7 +230,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
cloumns: {
|
columns: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
this.sortTable(val);
|
this.sortTable(val);
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user