更新d代码注释

pull/1/head
詹力 2023-12-22 15:12:51 +08:00
parent 8da61973d4
commit 06dcf73ffb
3 changed files with 17 additions and 1 deletions

View File

@ -30,7 +30,12 @@
<el-table-column prop="createTime" label="创建日期" /> <el-table-column prop="createTime" label="创建日期" />
<el-table-column label="操作" width="160px" align="center" fixed="right"> <el-table-column label="操作" width="160px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 配置一个vue的按钮控件按下后跳转到指定的连接 -->
<el-button size="mini" style="margin-right: 2px" type="text"> <el-button size="mini" style="margin-right: 2px" type="text">
<!-- 这里其实有点诡异后端的generator实际上是api/generator
vue的动态路由里面把/sys-tools/generator/preview访问路径映射
到了/views/generator/preview.vue
/generator/index.vue访api/generator -->
<router-link :to="'/sys-tools/generator/preview/' + scope.row.tableName"> <router-link :to="'/sys-tools/generator/preview/' + scope.row.tableName">
预览 预览
</router-link> </router-link>

View File

@ -1,25 +1,36 @@
<template> <template>
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<!-- v-for循环遍历data数组中的每个元素
label属性用于设置选项卡的显示名称在选项卡的标题栏上会显示label属性的值作为选项卡的文本内容
name属性用于设置选项卡的名称name属性的值用于标识选项卡可以通过v-model绑定的变量来控制当前选中的选项卡的名称 -->
<el-tab-pane v-for="item in data" :key="item.name" :lazy="true" :label="item.name" :name="item.name"> <el-tab-pane v-for="item in data" :key="item.name" :lazy="true" :label="item.name" :name="item.name">
<!-- 下方的Java是一个自定义的组件实际上是用于渲染java代码用 -->
<Java :value="item.content" :height="height" /> <Java :value="item.content" :height="height" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
<script> <script>
//
import Java from '@/components/JavaEdit/index' import Java from '@/components/JavaEdit/index'
import { generator } from '@/api/generator/generator' import { generator } from '@/api/generator/generator'
// export default使
export default { export default {
name: 'Preview', name: 'Preview',
components: { Java }, components: { Java },
// datadata
data() { data() {
return { return {
data: null, height: '', activeName: 'Entity' data: null, height: '', activeName: 'Entity'
} }
}, },
created() { created() {
//
this.height = document.documentElement.clientHeight - 180 + 'px' this.height = document.documentElement.clientHeight - 180 + 'px'
//
const tableName = this.$route.params.tableName const tableName = this.$route.params.tableName
//
generator(tableName, 1).then(data => { generator(tableName, 1).then(data => {
this.data = data this.data = data
}).catch(() => { }).catch(() => {

View File

@ -39,7 +39,7 @@ import java.util.List;
*/ */
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/generator") @RequestMapping("/api/generator") // 这个地方确定的父路径
@Api(tags = "系统:代码生成管理") @Api(tags = "系统:代码生成管理")
public class GeneratorController { public class GeneratorController {