|
@@ -19,7 +19,8 @@
|
|
|
<el-tab-pane label="字段信息" name="cloum">
|
|
|
<el-row type="flex" style="margin-bottom: 20px;" v-if="activeName=='cloum'" :gutter="10" justify="end">
|
|
|
<el-col :span="1.5" style="display: flex; align-items: center;">
|
|
|
- <el-button style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;" type="warning" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
|
|
|
+ <el-button style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;" type="warning" plain
|
|
|
+ icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5" style="display: flex; align-items: center;">
|
|
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
|
@@ -27,10 +28,11 @@
|
|
|
</el-col>
|
|
|
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
|
|
|
</el-row>
|
|
|
- <el-table ref="dragTable" @row-dblclick="dbSelectedZd" align="center" :data="cloumns" row-key="columnId" :max-height="tableHeight" @selection-change="handleSelectionChange">
|
|
|
+ <el-table ref="dragTable" @row-dblclick="dbSelectedZd" align="center" :data="cloumns" row-key="columnId"
|
|
|
+ :max-height="tableHeight" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" align="center"/>
|
|
|
- <el-table-column label="字段列名" prop="columnName" min-width="10%" :show-overflow-tooltip="true" align="center"/>
|
|
|
+ <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" align="center" />
|
|
|
+ <el-table-column label="字段列名" prop="columnName" min-width="10%" :show-overflow-tooltip="true" align="center" />
|
|
|
<el-table-column label="字段描述" min-width="10%" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.columnComment"></el-input>
|
|
@@ -54,21 +56,21 @@
|
|
|
<el-checkbox true-label="1" false-label="0" v-model="scope.row.isQuery"></el-checkbox>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="关联HR字段" min-width="13%" align="center" prop="hrParentId" >
|
|
|
+ <el-table-column label="关联HR字段" min-width="13%" align="center" prop="hrParentId">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.row.hrParentId | zdFn}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <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="foreignKey">
|
|
|
<template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.row.foreignKey | zdFn}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <div>
|
|
|
+ {{scope.row.foreignKey | zdFn}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="必填" min-width="8%" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-checkbox true-label="1" false-label="0" v-model="scope.row.isRequired"></el-checkbox>
|
|
@@ -297,16 +299,16 @@
|
|
|
@pagination="tabList" />
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="数据库SQL" name="genSql">
|
|
|
- <el-row>
|
|
|
- <el-button @click="zxCreaBtn" style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;">执行创建语句</el-button>
|
|
|
- <el-button @click="sxCreaBtn" style="background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;">刷新创建语句</el-button>
|
|
|
+ <el-row type="flex" justify="end">
|
|
|
+ <el-button @click="zxCreaBtn" size="mini" style="background-color: #FFE9ED;color: #E58481;border: 1px solid #E58481;">执行创建语句</el-button>
|
|
|
+ <el-button @click="sxCreaBtn" size="mini" style="background-color: #FFD6B0;color: #EA551A;border: 1px solid #F4AD6B;">刷新创建语句</el-button>
|
|
|
</el-row>
|
|
|
<el-form>
|
|
|
<el-form-item label="创建语句:" style="margin-top: 20px;">
|
|
|
- <el-input class="resizeNone" v-model="tableSqlData.createSql" type="textarea"/>
|
|
|
+ <el-input class="resizeNone" v-model="tableSqlData.createSql" type="textarea" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="修改日志:">
|
|
|
- <el-input class="resizeNone" v-model="tableSqlData.createLog" type="textarea"/>
|
|
|
+ <el-input class="resizeNone" v-model="tableSqlData.createLog" type="textarea" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
@@ -318,7 +320,8 @@
|
|
|
<el-input v-model="form.description" placeholder="请输入描述" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="关联表:" prop="relationParentId">
|
|
|
- <el-select style="width: 100%;" v-model="form.relationParentId" placeholder="请选择关联表" @change="relationFn" v-loadmore="loadMore">
|
|
|
+ <el-select style="width: 100%;" v-model="form.relationParentId" placeholder="请选择关联表" @change="relationFn"
|
|
|
+ v-loadmore="loadMore">
|
|
|
<el-option v-for="item in tableList.rows" :key="item.tableId" :label="item.tableComment" :value="item.tableId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -538,7 +541,7 @@
|
|
|
});
|
|
|
//查询数据库sql
|
|
|
tableSql(tableId).then(res => {
|
|
|
- if(res.data){
|
|
|
+ if (res.data) {
|
|
|
this.tableSqlData = res.data
|
|
|
}
|
|
|
})
|
|
@@ -615,20 +618,27 @@
|
|
|
this.msgSuccess('刷新成功')
|
|
|
//查询数据库sql
|
|
|
tableSql(tableId).then(res => {
|
|
|
- if(res.data){
|
|
|
+ if (res.data) {
|
|
|
this.tableSqlData = res.data
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
zxCreaBtn() {
|
|
|
- zxImplement({
|
|
|
- tableId: this.$route.params && this.$route.params.tableId,
|
|
|
- createSql: this.tableSqlData.createSql,
|
|
|
- createLog: this.tableSqlData.createLog,
|
|
|
- id: this.tableSqlData.id
|
|
|
+ const _this = this
|
|
|
+ this.$confirm('是否确认执行创建语句?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return zxImplement({
|
|
|
+ tableId: _this.$route.params && _this.$route.params.tableId,
|
|
|
+ createSql: _this.tableSqlData.createSql,
|
|
|
+ createLog: _this.tableSqlData.createLog,
|
|
|
+ id: _this.tableSqlData.id
|
|
|
+ })
|
|
|
}).then(res => {
|
|
|
- this.msgSuccess('执行成功')
|
|
|
+ _this.msgSuccess('执行成功')
|
|
|
})
|
|
|
},
|
|
|
dbSelectedZd(row) {
|
|
@@ -636,7 +646,7 @@
|
|
|
const id = row.columnId
|
|
|
getGenTableColumn(id).then(response => {
|
|
|
let data = response.data
|
|
|
- data.foreignKey = data.foreignKey?data.foreignKey-0:''
|
|
|
+ data.foreignKey = data.foreignKey ? data.foreignKey - 0 : ''
|
|
|
this.formZd = data;
|
|
|
this.openZd = true;
|
|
|
this.title = "修改字段信息";
|
|
@@ -747,9 +757,27 @@
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
+ let isInFlag = 0
|
|
|
+ let isOutFlag = 0
|
|
|
+ console.log(this.cloumns,333)
|
|
|
+ for(let item of this.cloumns){
|
|
|
+ if(item.isIn=='Y'){
|
|
|
+ isInFlag++
|
|
|
+ }
|
|
|
+ if(item.isOut=='Y'){
|
|
|
+ isOutFlag++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(isInFlag>1){
|
|
|
+ this.msgError('"输入字段"最多只能选择一个!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(isOutFlag>1){
|
|
|
+ this.msgError('"显示字段"最多只能选择一个!')
|
|
|
+ return
|
|
|
+ }
|
|
|
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
|
|
|
// const genForm = this.$refs.genInfo.$refs.genInfoForm;
|
|
|
- // console.log(basicForm)
|
|
|
Promise.all([basicForm].map(this.getFormPromise)).then(res => {
|
|
|
const validateResult = res.every(item => !!item);
|
|
|
if (validateResult) {
|
|
@@ -846,12 +874,15 @@
|
|
|
.pagination-container {
|
|
|
height: 35px;
|
|
|
}
|
|
|
- .resizeNone{
|
|
|
- width: 60vw;
|
|
|
- border-radius: 3px;
|
|
|
- .el-textarea__inner{ //el_input中的隐藏属性
|
|
|
- resize: none; //主要是这个样式
|
|
|
- height: 200px;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ .resizeNone {
|
|
|
+ width: 60vw;
|
|
|
+ border-radius: 3px;
|
|
|
+
|
|
|
+ .el-textarea__inner {
|
|
|
+ //el_input中的隐藏属性
|
|
|
+ resize: none; //主要是这个样式
|
|
|
+ height: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|