refactor: 前端驼峰转下划线
This commit is contained in:
@@ -23,29 +23,29 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="tableName" label="表名" />
|
||||
<el-table-column show-overflow-tooltip prop="table_name" label="表名" />
|
||||
<el-table-column show-overflow-tooltip prop="engine" label="数据库引擎" />
|
||||
<el-table-column show-overflow-tooltip prop="coding" label="字符编码集" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注" />
|
||||
<el-table-column prop="createTime" label="创建日期">
|
||||
<el-table-column prop="create_time" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ parseTime(scope.row.create_time) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" style="margin-right: 2px" type="text">
|
||||
<router-link :to="'/sys-tools/generator/preview/' + scope.row.tableName">
|
||||
<router-link :to="'/sys-tools/generator/preview/' + scope.row.table_name">
|
||||
预览
|
||||
</router-link>
|
||||
</el-button>
|
||||
<el-button size="mini" style="margin-left: -1px;margin-right: 2px" type="text" @click="toDownload(scope.row.tableName)">下载</el-button>
|
||||
<el-button size="mini" style="margin-left: -1px;margin-right: 2px" type="text" @click="toDownload(scope.row.table_name)">下载</el-button>
|
||||
<el-button size="mini" style="margin-left: -1px;margin-right: 2px" type="text">
|
||||
<router-link :to="'/sys-tools/generator/config/' + scope.row.tableName">
|
||||
<router-link :to="'/sys-tools/generator/config/' + scope.row.table_name">
|
||||
配置
|
||||
</router-link>
|
||||
</el-button>
|
||||
<el-button type="text" style="margin-left: -1px" size="mini" @click="toGen(scope.row.tableName)">生成</el-button>
|
||||
<el-button type="text" style="margin-left: -1px" size="mini" @click="toGen(scope.row.table_name)">生成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -79,9 +79,9 @@ export default {
|
||||
this.crud.optShow = { add: false, edit: false, del: false, download: false }
|
||||
},
|
||||
methods: {
|
||||
toGen(tableName) {
|
||||
toGen(table_name) {
|
||||
// 生成代码
|
||||
generator(tableName, 0).then(data => {
|
||||
generator(table_name, 0).then(data => {
|
||||
this.$notify({
|
||||
title: '生成成功',
|
||||
type: 'success',
|
||||
@@ -89,16 +89,16 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
toDownload(tableName) {
|
||||
toDownload(table_name) {
|
||||
// 打包下载
|
||||
generator(tableName, 2).then(data => {
|
||||
downloadFile(data, tableName, 'zip')
|
||||
generator(table_name, 2).then(data => {
|
||||
downloadFile(data, table_name, 'zip')
|
||||
})
|
||||
},
|
||||
sync() {
|
||||
const tables = []
|
||||
this.crud.selections.forEach(val => {
|
||||
tables.push(val.tableName)
|
||||
tables.push(val.table_name)
|
||||
})
|
||||
this.syncLoading = true
|
||||
sync(tables).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user