|
@@ -9,7 +9,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-row type="flex" :gutter="10" justify="end">
|
|
|
|
|
|
+ <el-row type="flex" v-if="activeName=='cloum'" :gutter="10" justify="end">
|
|
<el-col :span="1.5" style="display: flex; align-items: center;">
|
|
<el-col :span="1.5" style="display: flex; align-items: center;">
|
|
<el-button type="warning" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
|
|
<el-button type="warning" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -26,7 +26,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" @selection-change="handleSelectionChange">
|
|
|
|
|
|
+ <el-table ref="dragTable" @row-dblclick="dbSelectedZd" :data="cloumns" row-key="columnId" :max-height="tableHeight" @selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<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" />
|
|
@@ -40,7 +40,7 @@
|
|
<el-table-column label="排序" min-width="8%" align="center" prop="sort" />
|
|
<el-table-column label="排序" min-width="8%" align="center" prop="sort" />
|
|
<el-table-column label="输入字段" min-width="10%">
|
|
<el-table-column label="输入字段" min-width="10%">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-checkbox true-label="1" v-model="scope.row.isIn"></el-checkbox>
|
|
|
|
|
|
+ <el-checkbox true-label="Y" v-model="scope.row.isIn"></el-checkbox>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="显示字段" min-width="10%">
|
|
<el-table-column label="显示字段" min-width="10%">
|
|
@@ -53,9 +53,21 @@
|
|
<el-checkbox true-label="1" v-model="scope.row.isQuery"></el-checkbox>
|
|
<el-checkbox true-label="1" v-model="scope.row.isQuery"></el-checkbox>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="关联HR字段" min-width="10%" align="center" prop="hrParentId" />
|
|
|
|
|
|
+ <el-table-column label="关联HR字段" min-width="10%" align="center" prop="hrParentId" >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>
|
|
|
|
+ {{scope.row.hrParentId | zdFn}}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="缺省值" min-width="10%" align="center" prop="defaultValue" />
|
|
<el-table-column label="缺省值" min-width="10%" align="center" prop="defaultValue" />
|
|
- <el-table-column label="外键" min-width="10%" align="center" prop="foreignKey" />
|
|
|
|
|
|
+ <el-table-column label="外键" min-width="10%" align="center" prop="foreignKey">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>
|
|
|
|
+ {{scope.row.foreignKey | zdFn}}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="必填" min-width="8%">
|
|
<el-table-column label="必填" min-width="8%">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-checkbox true-label="1" v-model="scope.row.isRequired"></el-checkbox>
|
|
<el-checkbox true-label="1" v-model="scope.row.isRequired"></el-checkbox>
|
|
@@ -115,19 +127,19 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<el-form-item label="排序:" prop="sort">
|
|
<el-form-item label="排序:" prop="sort">
|
|
- <el-input v-model="formZd.sort" placeholder="请输入排序" />
|
|
|
|
|
|
+ <el-input-number v-model="formZd.sort" placeholder="请输入排序" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<el-form-item label="查询条件" prop="isQuery">
|
|
<el-form-item label="查询条件" prop="isQuery">
|
|
- <el-checkbox true-label="Y" false-label="N" v-model="formZd.isQuery"></el-checkbox>
|
|
|
|
|
|
+ <el-checkbox true-label="1" false-label="0" v-model="formZd.isQuery"></el-checkbox>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<el-form-item label="显示字段" prop="isOut">
|
|
<el-form-item label="显示字段" prop="isOut">
|
|
- <el-checkbox true-label="Y" false-label="N" v-model="formZd.isOut"></el-checkbox>
|
|
|
|
|
|
+ <el-checkbox true-label="1" false-label="0" v-model="formZd.isOut"></el-checkbox>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
@@ -355,6 +367,9 @@
|
|
zxImplement,
|
|
zxImplement,
|
|
getReload,
|
|
getReload,
|
|
addGenTableColumn,
|
|
addGenTableColumn,
|
|
|
|
+ delGenTableColumn,
|
|
|
|
+ setGenTableColumn,
|
|
|
|
+ getGenTableColumn,
|
|
qurGenTable
|
|
qurGenTable
|
|
} from "@/api/tool/gen";
|
|
} from "@/api/tool/gen";
|
|
import {
|
|
import {
|
|
@@ -381,7 +396,7 @@
|
|
tableSqlData: [],
|
|
tableSqlData: [],
|
|
columList: [],
|
|
columList: [],
|
|
foreignKey: [],
|
|
foreignKey: [],
|
|
- openZd: true,
|
|
|
|
|
|
+ openZd: false,
|
|
formZd: {},
|
|
formZd: {},
|
|
rulesZd: {
|
|
rulesZd: {
|
|
columnName: [{
|
|
columnName: [{
|
|
@@ -450,7 +465,7 @@
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
},
|
|
},
|
|
// 选中选项卡的 name
|
|
// 选中选项卡的 name
|
|
- activeName: "cloum",
|
|
|
|
|
|
+ activeName: "basic",
|
|
// 表格的高度
|
|
// 表格的高度
|
|
tableHeight: document.documentElement.scrollHeight - 245 + "px",
|
|
tableHeight: document.documentElement.scrollHeight - 245 + "px",
|
|
// 表信息
|
|
// 表信息
|
|
@@ -479,6 +494,15 @@
|
|
};
|
|
};
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
|
|
+ zdFn(data) {
|
|
|
|
+ let is = ''
|
|
|
|
+ for (let item of _this.columList) {
|
|
|
|
+ if (item.columnId == data) {
|
|
|
|
+ is = item.columnName
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return is
|
|
|
|
+ },
|
|
relationTypeFn(data) {
|
|
relationTypeFn(data) {
|
|
let is = ''
|
|
let is = ''
|
|
for (let item of _this.relationType) {
|
|
for (let item of _this.relationType) {
|
|
@@ -521,7 +545,7 @@
|
|
listAllColumnsByTableId({
|
|
listAllColumnsByTableId({
|
|
tableId
|
|
tableId
|
|
}).then(response => {
|
|
}).then(response => {
|
|
- this.columList = response;
|
|
|
|
|
|
+ this.columList = response.data;
|
|
});
|
|
});
|
|
// 关联表数据
|
|
// 关联表数据
|
|
listTable(this.glbParams).then(response => {
|
|
listTable(this.glbParams).then(response => {
|
|
@@ -546,6 +570,20 @@
|
|
submitFormZd() {
|
|
submitFormZd() {
|
|
this.$refs["formZd"].validate(valid => {
|
|
this.$refs["formZd"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
+ const tableId = this.$route.params && this.$route.params.tableId;
|
|
|
|
+ this.formZd.tableId = tableId
|
|
|
|
+ if (this.formZd.columnId != undefined) {
|
|
|
|
+ setGenTableColumn(this.formZd).then(response => {
|
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
|
+ this.openZd = false;
|
|
|
|
+ // 获取表详细信息
|
|
|
|
+ getGenTable(tableId).then(res => {
|
|
|
|
+ this.cloumns = res.data.rows;
|
|
|
|
+ this.info = res.data.info;
|
|
|
|
+ this.tables = res.data.tables;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
addGenTableColumn(this.formZd).then(response => {
|
|
addGenTableColumn(this.formZd).then(response => {
|
|
this.msgSuccess("新增成功");
|
|
this.msgSuccess("新增成功");
|
|
this.openZd = false;
|
|
this.openZd = false;
|
|
@@ -556,6 +594,8 @@
|
|
this.tables = res.data.tables;
|
|
this.tables = res.data.tables;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -579,8 +619,18 @@
|
|
this.msgSuccess('执行成功')
|
|
this.msgSuccess('执行成功')
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ dbSelectedZd(row) {
|
|
|
|
+ this.reset();
|
|
|
|
+ const id = row.columnId
|
|
|
|
+ getGenTableColumn(id).then(response => {
|
|
|
|
+ let data = response.data
|
|
|
|
+ data.foreignKey = data.foreignKey-0
|
|
|
|
+ this.formZd = data;
|
|
|
|
+ this.openZd = true;
|
|
|
|
+ this.title = "修改字段信息";
|
|
|
|
+ });
|
|
|
|
+ },
|
|
dbSelected(row) {
|
|
dbSelected(row) {
|
|
- console.log(row, 133)
|
|
|
|
this.reset();
|
|
this.reset();
|
|
const id = row.id
|
|
const id = row.id
|
|
qurGenTable(id).then(response => {
|
|
qurGenTable(id).then(response => {
|
|
@@ -742,14 +792,20 @@
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
const ids = row.id || this.ids;
|
|
- this.$confirm('是否确认删除岗位编号为"' + ids + '"的数据项?', "警告", {
|
|
|
|
|
|
+ const tableId = this.$route.params && this.$route.params.tableId;
|
|
|
|
+ this.$confirm('是否确认删除字段编号为"' + ids + '"的数据项?', "警告", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
type: "warning"
|
|
}).then(function() {
|
|
}).then(function() {
|
|
- return delPost(ids);
|
|
|
|
|
|
+ return delGenTableColumn(ids);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- this.getlist();
|
|
|
|
|
|
+ // 获取表详细信息
|
|
|
|
+ getGenTable(tableId).then(res => {
|
|
|
|
+ this.cloumns = res.data.rows;
|
|
|
|
+ this.info = res.data.info;
|
|
|
|
+ this.tables = res.data.tables;
|
|
|
|
+ });
|
|
this.msgSuccess("删除成功");
|
|
this.msgSuccess("删除成功");
|
|
})
|
|
})
|
|
},
|
|
},
|