代码生成器优化完成,剩余:预览,打包下载,关联实体未完成

This commit is contained in:
dqjdda
2019-11-19 13:08:04 +08:00
parent a4d74a3a6f
commit 91c444379d
3 changed files with 51 additions and 41 deletions

View File

@@ -29,7 +29,7 @@
编辑
</router-link>
</el-button>
<el-button type="text" style="margin-left: -1px" size="mini">生成</el-button>
<el-button type="text" style="margin-left: -1px" size="mini" @click="toGen(scope.row.tableName)">生成</el-button>
</template>
</el-table-column>
</el-table>
@@ -47,6 +47,7 @@
<script>
import initData from '@/mixins/initData'
import { parseTime } from '@/utils/index'
import { generator } from '@/api/generator'
export default {
name: 'GeneratorIndex',
mixins: [initData],
@@ -91,17 +92,14 @@ export default {
if (name) { this.params['name'] = name }
return true
},
cancel() {
this.resetForm()
},
doSubmit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true
this.doUpdate()
} else {
return false
}
toGen(tableName) {
// 生成代码
generator(tableName, 0).then(data => {
this.$notify({
title: '生成成功',
type: 'success',
duration: 2500
})
})
}
}