优化代码生成
This commit is contained in:
parent
5ec34bade9
commit
813224d2f5
@ -237,7 +237,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
|
||||
genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId);
|
||||
|
||||
dto.DbType = AppSettings.GetAppConfig(OptionsSetting.ConnBusDbType, 0);
|
||||
dto.DbType = AppSettings.GetAppConfig("gen:dbType", 0);
|
||||
dto.GenTable = genTableInfo;
|
||||
dto.IsPreview = true;
|
||||
//生成代码
|
||||
@ -263,7 +263,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
|
||||
genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId);
|
||||
|
||||
dto.DbType = AppSettings.GetAppConfig(OptionsSetting.ConnBusDbType, 0);
|
||||
dto.DbType = AppSettings.GetAppConfig("gen:dbType", 0);
|
||||
dto.GenTable = genTableInfo;
|
||||
//自定义路径
|
||||
if (genTableInfo.GenType == "1")
|
||||
|
||||
@ -8,17 +8,17 @@
|
||||
<gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus" :columns="columns" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="字段信息" name="cloum">
|
||||
<el-table ref="dragTable" v-loading="loading" :data="columns" row-key="columnId" :max-height="tableHeight">
|
||||
<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="字段描述" min-width="10%">
|
||||
<el-table ref="dragTable" v-loading="loading" :data="columns" row-key="columnId" min-height="150px" :max-height="tableHeight">
|
||||
<el-table-column label="序号" type="index" class-name="allowDrag" />
|
||||
<el-table-column label="字段列名" prop="columnName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="字段描述">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.columnComment" :ref='scope.row.columnId' @keydown.native="nextFocus(scope.row,scope.$index, $event)">
|
||||
<el-input v-model="scope.row.columnComment" :ref="scope.row.columnId" @keydown.native="nextFocus(scope.row, scope.$index, $event)">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物理类型" prop="columnType" min-width="10%" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="C#类型" min-width="11%">
|
||||
<el-table-column label="物理类型" prop="columnType" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="C#类型">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.csharpType">
|
||||
<el-option label="int" value="int" />
|
||||
@ -31,33 +31,33 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="C#属性" min-width="10%">
|
||||
<el-table-column label="C#属性">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.csharpField"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="插入" min-width="5%" v-if="info.tplCategory != 'select'">
|
||||
<el-table-column label="插入" width="50" align="center" v-if="info.tplCategory != 'select'">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isInsert" :disabled="scope.row.isIncrement"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编辑" min-width="5%" v-if="info.tplCategory != 'select'">
|
||||
<el-table-column label="编辑" width="50" align="center" v-if="info.tplCategory != 'select'">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isEdit" :disabled="scope.row.isPk || scope.row.isIncrement"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="列表" min-width="5%">
|
||||
<el-table-column label="列表" width="50" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isList"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询" min-width="5%">
|
||||
<el-table-column label="查询" width="50" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isQuery" :disabled="scope.row.htmlType == 'imageUpload' || scope.row.htmlType == 'fileUpload'">
|
||||
</el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询方式" min-width="10%">
|
||||
<el-table-column label="查询方式">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.queryType" :disabled="scope.row.htmlType == 'datetime'" v-if="scope.row.isQuery">
|
||||
<el-option label="=" value="EQ" />
|
||||
@ -71,12 +71,12 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="必填" min-width="5%">
|
||||
<el-table-column label="必填" width="50" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.isRequired"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="表单显示类型" min-width="12%">
|
||||
<el-table-column label="表单显示类型">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.htmlType">
|
||||
<el-option label="文本框" value="input" />
|
||||
@ -93,10 +93,15 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典类型" min-width="12%">
|
||||
<el-table-column label="字典类型">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"
|
||||
v-if="scope.row.htmlType == 'select' || scope.row.htmlType == 'radio' || scope.row.htmlType =='checkbox'">
|
||||
<el-select
|
||||
v-model="scope.row.dictType"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
v-if="scope.row.htmlType == 'select' || scope.row.htmlType == 'radio' || scope.row.htmlType == 'checkbox'"
|
||||
>
|
||||
<el-option v-for="dict in dictOptions" :key="dict.dictType" :label="dict.dictName" :value="dict.dictType">
|
||||
<span style="float: left">{{ dict.dictName }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span>
|
||||
@ -108,7 +113,7 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
|
||||
<el-form-item style="text-align: center; margin-left: -100px; margin-top: 10px">
|
||||
<el-button type="primary" icon="el-icon-check" @click="submitForm()">提交</el-button>
|
||||
<el-button type="success" icon="el-icon-refresh" @click="handleQuery()">刷新</el-button>
|
||||
<el-button icon="el-icon-back" @click="close()">返回</el-button>
|
||||
@ -128,7 +133,7 @@ export default {
|
||||
name: 'genedit',
|
||||
components: {
|
||||
basicInfoForm,
|
||||
genInfoForm
|
||||
genInfoForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -146,7 +151,7 @@ export default {
|
||||
menus: [],
|
||||
// 表详细信息
|
||||
info: {},
|
||||
loading: true
|
||||
loading: true,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -192,7 +197,7 @@ export default {
|
||||
sortField: genTable.sortField,
|
||||
sortType: genTable.sortType,
|
||||
checkedBtn: genTable.checkedBtn.toString(),
|
||||
permissionPrefix: genTable.permissionPrefix
|
||||
permissionPrefix: genTable.permissionPrefix,
|
||||
}
|
||||
console.log('genForm', genTable)
|
||||
|
||||
@ -218,7 +223,7 @@ export default {
|
||||
close() {
|
||||
const obj = {
|
||||
path: '/tool/gen',
|
||||
query: { t: Date.now(), pageNum: this.$route.query.pageNum }
|
||||
query: { t: Date.now(), pageNum: this.$route.query.pageNum },
|
||||
}
|
||||
this.$tab.closeOpenPage(obj)
|
||||
},
|
||||
@ -226,9 +231,7 @@ export default {
|
||||
* 排序保存
|
||||
*/
|
||||
sortTable(columns) {
|
||||
const el = this.$refs.dragTable.$el.querySelectorAll(
|
||||
'.el-table__body-wrapper > table > tbody'
|
||||
)[0]
|
||||
const el = this.$refs.dragTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
|
||||
var that = this
|
||||
const sortable = Sortable.create(el, {
|
||||
handle: '.allowDrag',
|
||||
@ -241,7 +244,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.columns = columns
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
/**
|
||||
@ -262,14 +265,14 @@ export default {
|
||||
console.warn('最后一行了')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
columns: {
|
||||
handler(val) {
|
||||
this.sortTable(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
<el-option label="单表(增删改查)" value="crud" />
|
||||
<el-option label="单表查询" value="select" />
|
||||
<el-option label="树表(增删改查)" value="tree" />
|
||||
<!-- <el-option label="导航查询" value="subNav"></el-option> -->
|
||||
<el-option label="导航查询(1对1)" value="subNav"></el-option>
|
||||
<el-option label="导航查询(1对多)" value="subNavMore"></el-option>
|
||||
<!-- <el-option label="主子表(增删改查)" value="sub" /> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -70,15 +71,20 @@
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<treeselect :append-to-body="true" v-model="info.parentMenuId" :options="menus" :normalizer="normalizer" :show-count="true"
|
||||
placeholder="请选择系统菜单" />
|
||||
<treeselect
|
||||
:append-to-body="true"
|
||||
v-model="info.parentMenuId"
|
||||
:options="menus"
|
||||
:normalizer="normalizer"
|
||||
:show-count="true"
|
||||
placeholder="请选择系统菜单"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="查询排序字段">
|
||||
<el-select v-model="info.sortField" placeholder="请选择字段" class="mr10" clearable="">
|
||||
<el-option v-for="item in columns" :key="item.columnId" :label="item.csharpField" :value="item.csharpField">
|
||||
</el-option>
|
||||
<el-option v-for="item in columns" :key="item.columnId" :label="item.csharpField" :value="item.csharpField"> </el-option>
|
||||
</el-select>
|
||||
|
||||
<el-radio v-model="info.sortType" label="asc">正序</el-radio>
|
||||
@ -162,8 +168,12 @@
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<el-select v-model="info.treeCode" placeholder="请选择">
|
||||
<el-option v-for="(column, index) in columns" :key="index" :label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"></el-option>
|
||||
<el-option
|
||||
v-for="(column, index) in columns"
|
||||
:key="index"
|
||||
:label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -176,8 +186,12 @@
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<el-select v-model="info.treeParentCode" placeholder="请选择">
|
||||
<el-option v-for="(column, index) in columns" :key="index" :label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"></el-option>
|
||||
<el-option
|
||||
v-for="(column, index) in columns"
|
||||
:key="index"
|
||||
:label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -190,13 +204,17 @@
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<el-select v-model="info.treeName" placeholder="请选择">
|
||||
<el-option v-for="(column, index) in columns" :key="index" :label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"></el-option>
|
||||
<el-option
|
||||
v-for="(column, index) in columns"
|
||||
:key="index"
|
||||
:label="column.csharpField + ':' + column.columnComment"
|
||||
:value="column.csharpField"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-show="info.tplCategory == 'sub'">
|
||||
<el-row v-show="info.tplCategory == 'sub' || info.tplCategory == 'subNav' || info.tplCategory == 'subNavMore'">
|
||||
<h4 class="form-header">关联信息</h4>
|
||||
<el-col :lg="12">
|
||||
<el-form-item>
|
||||
@ -221,8 +239,10 @@
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<el-select v-model="info.subTableFkName" placeholder="请选择">
|
||||
<el-option v-for="(column, index) in subColumns" :key="index" :label="column.columnName + ':' + column.columnComment"
|
||||
:value="column.columnName"></el-option>
|
||||
<el-option v-for="(column, index) in subColumns" :key="index" :label="column.csharpField" :value="column.csharpField">
|
||||
<span style="float: left">{{ column.csharpField }}</span>
|
||||
<span style="float: right">{{ column.columnComment }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -240,66 +260,61 @@ export default {
|
||||
props: {
|
||||
info: {
|
||||
type: Object,
|
||||
default: null
|
||||
default: null,
|
||||
},
|
||||
// 子表
|
||||
tables: {
|
||||
type: Array,
|
||||
default: null
|
||||
default: null,
|
||||
},
|
||||
menus: {
|
||||
type: Array,
|
||||
default: []
|
||||
default: [],
|
||||
},
|
||||
// 列
|
||||
columns: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
default: [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkedBtn: [],
|
||||
subColumns: [],
|
||||
rules: {
|
||||
tplCategory: [
|
||||
{ required: true, message: '请选择生成模板', trigger: 'blur' }
|
||||
],
|
||||
tplCategory: [{ required: true, message: '请选择生成模板', trigger: 'blur' }],
|
||||
moduleName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入生成模块名',
|
||||
trigger: 'blur',
|
||||
pattern: /^[A-Za-z]+$/
|
||||
}
|
||||
pattern: /^[A-Za-z]+$/,
|
||||
},
|
||||
],
|
||||
businessName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入生成业务名',
|
||||
trigger: 'blur',
|
||||
pattern: /^[A-Za-z]+$/
|
||||
}
|
||||
],
|
||||
functionName: [
|
||||
{ required: true, message: '请输入生成功能名', trigger: 'blur' }
|
||||
pattern: /^[A-Za-z]+$/,
|
||||
},
|
||||
],
|
||||
functionName: [{ required: true, message: '请输入生成功能名', trigger: 'blur' }],
|
||||
permissionPrefix: {
|
||||
required: true,
|
||||
message: '请输入权限前缀',
|
||||
trigger: 'blur'
|
||||
}
|
||||
}
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'info.subTableName': function(val) {
|
||||
'info.subTableName': function (val) {
|
||||
this.setSubTableColumns(val)
|
||||
},
|
||||
'info.checkedBtn': function(val) {
|
||||
console.log(val + ',checkedBtn')
|
||||
'info.checkedBtn': function (val) {
|
||||
this.checkedBtn = val
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/** 转换菜单数据结构 */
|
||||
@ -310,7 +325,7 @@ export default {
|
||||
return {
|
||||
id: node.menuId,
|
||||
label: node.menuName,
|
||||
children: node.children
|
||||
children: node.children,
|
||||
}
|
||||
},
|
||||
/** 选择子表名触发 */
|
||||
@ -343,7 +358,7 @@ export default {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-form ref="codeform" :inline="true" :rules="rules" :model="queryParams" size="small">
|
||||
<el-form-item label="表名" prop="tableName">
|
||||
<el-input v-model="queryParams.tableName" clearable placeholder="输入要查询的表名" />
|
||||
@ -16,33 +15,48 @@
|
||||
<el-button type="info" plain icon="el-icon-upload" size="mini" @click="openImportTable" v-hasPermi="['tool:gen:import']">导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :disabled="multiple" plain icon="el-icon-delete" @click="handleDelete" size="mini" v-hasPermi="['tool:gen:remove']">
|
||||
删除</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="multiple"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete"
|
||||
size="mini"
|
||||
v-hasPermi="['tool:gen:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table ref="gridtable" v-loading="tableloading" :data="tableData" border @selection-change="handleSelectionChange" highlight-current-row
|
||||
height="480px">
|
||||
<el-table
|
||||
ref="gridtable"
|
||||
v-loading="tableloading"
|
||||
:data="tableData"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
highlight-current-row
|
||||
height="480px"
|
||||
>
|
||||
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
||||
<el-table-column label="序号" type="index" width="50" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbName" label="数据库名" width="90" />
|
||||
<el-table-column prop="dbName" label="数据库名" width="90" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="tableId" label="表id" width="70" sortable="" />
|
||||
<el-table-column prop="tableName" label="表名" width="110" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="tableComment" label="表描述" :show-overflow-tooltip="true" width="120" />
|
||||
<el-table-column prop="className" label="实体" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="createTime" label="创建时间" />
|
||||
<el-table-column prop="updateTime" label="更新时间" />
|
||||
<el-table-column prop="updateTime" label="更新时间" sortable />
|
||||
<el-table-column label="操作" align="center" width="320">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-view" @click="handlePreview(scope.row)" v-hasPermi="['tool:gen:preview']">预览</el-button>
|
||||
<el-button type="text" icon="el-icon-edit" @click="handleEditTable(scope.row)" v-hasPermi="['tool:gen:edit']">编辑</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['tool:gen:remove']">删除</el-button>
|
||||
<el-button type="text" icon="el-icon-refresh" @click="handleSynchDb(scope.row)" v-hasPermi="['tool:gen:edit']">同步</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="handleGenTable(scope.row)" v-hasPermi="['tool:gen:code']">生成代码
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="handleGenTable(scope.row)" v-hasPermi="['tool:gen:code']">生成代码 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -52,8 +66,15 @@
|
||||
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body>
|
||||
<el-tabs v-model="preview.activeName">
|
||||
<el-tab-pane v-for="(item, key) in preview.data" :label="item.title" :name="key.toString()" :key="key">
|
||||
<el-link :underline="false" icon="el-icon-document-copy" v-clipboard:copy="item.content" v-clipboard:success="clipboardSuccess"
|
||||
style="float:right">复制</el-link>
|
||||
<el-link
|
||||
:underline="false"
|
||||
icon="el-icon-document-copy"
|
||||
v-clipboard:copy="item.content"
|
||||
v-clipboard:success="clipboardSuccess"
|
||||
style="float: right"
|
||||
>
|
||||
复制
|
||||
</el-link>
|
||||
<pre><code class="hljs" v-html="highlightedCode(item.content, item.title)"></code></pre>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -63,13 +84,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
codeGenerator,
|
||||
listTable,
|
||||
delTable,
|
||||
previewTable,
|
||||
synchDb
|
||||
} from '@/api/tool/gen'
|
||||
import { codeGenerator, listTable, delTable, previewTable, synchDb } from '@/api/tool/gen'
|
||||
import importTable from './importTable'
|
||||
import { Loading } from 'element-ui'
|
||||
import hljs from 'highlight.js'
|
||||
@ -83,14 +98,14 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
tableName: ''
|
||||
tableName: '',
|
||||
},
|
||||
// 预览参数
|
||||
preview: {
|
||||
open: false,
|
||||
title: '代码预览',
|
||||
data: {},
|
||||
activeName: '0'
|
||||
activeName: '0',
|
||||
},
|
||||
showGenerate: false,
|
||||
rules: {},
|
||||
@ -108,7 +123,7 @@ export default {
|
||||
// 选中的表
|
||||
tableIds: [],
|
||||
// 非多个禁用
|
||||
multiple: true
|
||||
multiple: true,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -136,7 +151,7 @@ export default {
|
||||
|
||||
this.$router.push({
|
||||
path: '/gen/editTable',
|
||||
query: { tableId: row.tableId }
|
||||
query: { tableId: row.tableId },
|
||||
})
|
||||
},
|
||||
// 代码预览
|
||||
@ -172,13 +187,13 @@ export default {
|
||||
lock: true,
|
||||
text: '正在生成代码...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
}
|
||||
const pageLoading = Loading.service(loadop)
|
||||
|
||||
var seachdata = {
|
||||
tableId: this.currentSelected.tableId,
|
||||
tableName: this.currentSelected.name
|
||||
tableName: this.currentSelected.name,
|
||||
// queryColumn: this.checkedQueryColumn,
|
||||
}
|
||||
|
||||
@ -220,7 +235,7 @@ export default {
|
||||
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
delTable(tableIds.toString()).then((res) => {
|
||||
@ -234,7 +249,7 @@ export default {
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
message: '已取消删除',
|
||||
})
|
||||
})
|
||||
},
|
||||
@ -258,14 +273,14 @@ export default {
|
||||
handleSynchDb(row) {
|
||||
const tableName = row.tableName
|
||||
this.$confirm('确认要强制同步"' + tableName + '"表结构吗?')
|
||||
.then(function() {
|
||||
.then(function () {
|
||||
return synchDb(row.tableId, { tableName, dbName: row.dbName })
|
||||
})
|
||||
.then(() => {
|
||||
this.msgSuccess('同步成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user