|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<el-card>
|
|
|
- <el-row type="flex" v-if="activeName=='cloum'" justify="space-between" style="margin: 10px 0;">
|
|
|
+ <el-row type="flex" v-if="activeName=='basic' || activeName=='cloum'" justify="space-between" style="margin: 10px 0;">
|
|
|
<el-col :span="1.5" style="display: flex; align-items: center;">
|
|
|
<el-form label-width="100px" style="display: flex; align-items: center;">
|
|
|
<el-form-item style="text-align: center;margin-left:-100px;margin-top:0; margin-bottom: 0;">
|
|
@@ -89,7 +89,7 @@
|
|
|
</el-table>
|
|
|
<!-- 添加或修改岗位对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="openZd" width="70vw" append-to-body>
|
|
|
- <el-form ref="formZd" :model="formZd" :rules="rules" label-width="120px">
|
|
|
+ <el-form ref="formZd" :model="formZd" :rules="rulesZd" label-width="120px">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="字段名:" prop="columnName">
|
|
@@ -382,6 +382,33 @@
|
|
|
foreignKey: [],
|
|
|
openZd: false,
|
|
|
formZd: {},
|
|
|
+ rulesZd: {
|
|
|
+ columnName: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入字段名",
|
|
|
+ trigger: "blur"
|
|
|
+ }],
|
|
|
+ columnComment: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入字段描述",
|
|
|
+ trigger: "blur"
|
|
|
+ }],
|
|
|
+ columnType: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入物理类型",
|
|
|
+ trigger: "blur"
|
|
|
+ }],
|
|
|
+ mask: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入字段显示规则",
|
|
|
+ trigger: "blur"
|
|
|
+ }],
|
|
|
+ sort: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入序号",
|
|
|
+ trigger: "blur"
|
|
|
+ }],
|
|
|
+ },
|
|
|
loadingZd: '',
|
|
|
// 关联表
|
|
|
title: "",
|
|
@@ -422,7 +449,7 @@
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
// 选中选项卡的 name
|
|
|
- activeName: "cloum",
|
|
|
+ activeName: "basic",
|
|
|
// 表格的高度
|
|
|
tableHeight: document.documentElement.scrollHeight - 245 + "px",
|
|
|
// 表信息
|
|
@@ -516,7 +543,23 @@
|
|
|
},
|
|
|
methods: {
|
|
|
submitFormZd() {
|
|
|
-
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != undefined) {
|
|
|
+ setGenTable(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.tabList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addGenTable(this.form).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.tabList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
sxCreaBtn() {
|
|
|
getReload({
|