正在显示
3 个修改的文件
包含
735 行增加
和
732 行删除
| 1 | -import Vue from 'vue' | ||
| 2 | -import Router from 'vue-router' | ||
| 3 | - | ||
| 4 | -Vue.use(Router) | ||
| 5 | - | ||
| 6 | -/* Layout */ | ||
| 7 | -import Layout from '@/layout' | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * Note: 路由配置项 | ||
| 11 | - * | ||
| 12 | - * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 | ||
| 13 | - * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 | ||
| 14 | - * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 | ||
| 15 | - * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 | ||
| 16 | - * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 | ||
| 17 | - * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 | ||
| 18 | - * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题 | ||
| 19 | - * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 | ||
| 20 | - * meta : { | ||
| 21 | - noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false) | ||
| 22 | - title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 | ||
| 23 | - icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg | ||
| 24 | - breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 | ||
| 25 | - activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 | ||
| 26 | - } | ||
| 27 | - */ | ||
| 28 | - | ||
| 29 | -// 公共路由 | ||
| 30 | -export const constantRoutes = [ | ||
| 31 | - { | ||
| 32 | - path: '/redirect', | ||
| 33 | - component: Layout, | ||
| 34 | - hidden: true, | ||
| 35 | - children: [ | ||
| 36 | - { | ||
| 37 | - path: '/redirect/:path(.*)', | ||
| 38 | - component: (resolve) => require(['@/views/redirect'], resolve) | ||
| 39 | - } | ||
| 40 | - ] | ||
| 41 | - }, | ||
| 42 | - { | ||
| 43 | - path: '/login', | ||
| 44 | - component: (resolve) => require(['@/views/login'], resolve), | ||
| 45 | - hidden: true | ||
| 46 | - }, | ||
| 47 | - { | ||
| 48 | - path: '/register', | ||
| 49 | - component: (resolve) => require(['@/views/register'], resolve), | ||
| 50 | - hidden: true | ||
| 51 | - }, | ||
| 52 | - { | ||
| 53 | - path: '/404', | ||
| 54 | - component: (resolve) => require(['@/views/error/404'], resolve), | ||
| 55 | - hidden: true | ||
| 56 | - }, | ||
| 57 | - { | ||
| 58 | - path: '/401', | ||
| 59 | - component: (resolve) => require(['@/views/error/401'], resolve), | ||
| 60 | - hidden: true | ||
| 61 | - }, | ||
| 62 | - { | ||
| 63 | - path: '', | ||
| 64 | - component: Layout, | ||
| 65 | - redirect: 'index', | ||
| 66 | - children: [ | ||
| 67 | - { | ||
| 68 | - path: 'index', | ||
| 69 | - component: (resolve) => require(['@/views/index'], resolve), | ||
| 70 | - name: 'Index', | ||
| 71 | - meta: { title: '首页', icon: 'dashboard', affix: true } | ||
| 72 | - } | ||
| 73 | - ] | ||
| 74 | - }, | ||
| 75 | - { | ||
| 76 | - path: '/user', | ||
| 77 | - component: Layout, | ||
| 78 | - hidden: true, | ||
| 79 | - redirect: 'noredirect', | ||
| 80 | - children: [ | ||
| 81 | - { | ||
| 82 | - path: 'profile', | ||
| 83 | - component: (resolve) => require(['@/views/system/user/profile/index'], resolve), | ||
| 84 | - name: 'Profile', | ||
| 85 | - meta: { title: '个人中心', icon: 'user' } | ||
| 86 | - } | ||
| 87 | - ] | ||
| 88 | - }, | ||
| 89 | - { | ||
| 90 | - path: '/system/user-auth', | ||
| 91 | - component: Layout, | ||
| 92 | - hidden: true, | ||
| 93 | - children: [ | ||
| 94 | - { | ||
| 95 | - path: 'role/:userId(\\d+)', | ||
| 96 | - component: (resolve) => require(['@/views/system/user/authRole'], resolve), | ||
| 97 | - name: 'AuthRole', | ||
| 98 | - meta: { title: '分配角色', activeMenu: '/system/user'} | ||
| 99 | - } | ||
| 100 | - ] | ||
| 101 | - }, | ||
| 102 | - { | ||
| 103 | - path: '/system/role-auth', | ||
| 104 | - component: Layout, | ||
| 105 | - hidden: true, | ||
| 106 | - children: [ | ||
| 107 | - { | ||
| 108 | - path: 'user/:roleId(\\d+)', | ||
| 109 | - component: (resolve) => require(['@/views/system/role/authUser'], resolve), | ||
| 110 | - name: 'AuthUser', | ||
| 111 | - meta: { title: '分配用户', activeMenu: '/system/role'} | ||
| 112 | - } | ||
| 113 | - ] | ||
| 114 | - }, | ||
| 115 | - { | ||
| 116 | - path: '/system/dict-data', | ||
| 117 | - component: Layout, | ||
| 118 | - hidden: true, | ||
| 119 | - children: [ | ||
| 120 | - { | ||
| 121 | - path: 'index/:dictId(\\d+)', | ||
| 122 | - component: (resolve) => require(['@/views/system/dict/data'], resolve), | ||
| 123 | - name: 'Data', | ||
| 124 | - meta: { title: '字典数据', activeMenu: '/system/dict'} | ||
| 125 | - } | ||
| 126 | - ] | ||
| 127 | - }, | ||
| 128 | - { | ||
| 129 | - path: '/monitor/job-log', | ||
| 130 | - component: Layout, | ||
| 131 | - hidden: true, | ||
| 132 | - children: [ | ||
| 133 | - { | ||
| 134 | - path: 'index', | ||
| 135 | - component: (resolve) => require(['@/views/monitor/job/log'], resolve), | ||
| 136 | - name: 'JobLog', | ||
| 137 | - meta: { title: '调度日志', activeMenu: '/monitor/job'} | ||
| 138 | - } | ||
| 139 | - ] | ||
| 140 | - }, | ||
| 141 | - { | ||
| 142 | - path: '/tool/gen-edit', | ||
| 143 | - component: Layout, | ||
| 144 | - hidden: true, | ||
| 145 | - children: [ | ||
| 146 | - { | ||
| 147 | - path: 'index/:tableId(\\d+)', | ||
| 148 | - component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), | ||
| 149 | - name: 'GenEdit', | ||
| 150 | - meta: { title: '修改生成配置', activeMenu: '/tool/gen'} | ||
| 151 | - } | ||
| 152 | - ] | ||
| 153 | - } | ||
| 154 | -] | ||
| 155 | - | ||
| 156 | -export default new Router({ | ||
| 157 | - mode: 'history', // 去掉url中的# | ||
| 158 | - scrollBehavior: () => ({ y: 0 }), | ||
| 159 | - routes: constantRoutes | ||
| 160 | -}) | 1 | +import Vue from 'vue' |
| 2 | +import Router from 'vue-router' | ||
| 3 | + | ||
| 4 | +Vue.use(Router) | ||
| 5 | + | ||
| 6 | +/* Layout */ | ||
| 7 | +import Layout from '@/layout' | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * Note: 路由配置项 | ||
| 11 | + * | ||
| 12 | + * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 | ||
| 13 | + * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 | ||
| 14 | + * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 | ||
| 15 | + * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 | ||
| 16 | + * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 | ||
| 17 | + * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 | ||
| 18 | + * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题 | ||
| 19 | + * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 | ||
| 20 | + * meta : { | ||
| 21 | + noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false) | ||
| 22 | + title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 | ||
| 23 | + icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg | ||
| 24 | + breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 | ||
| 25 | + activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 | ||
| 26 | + } | ||
| 27 | + */ | ||
| 28 | + | ||
| 29 | +// 公共路由 | ||
| 30 | +export const constantRoutes = [ | ||
| 31 | + { | ||
| 32 | + path: '/redirect', | ||
| 33 | + component: Layout, | ||
| 34 | + hidden: true, | ||
| 35 | + children: [ | ||
| 36 | + { | ||
| 37 | + path: '/redirect/:path(.*)', | ||
| 38 | + component: (resolve) => require(['@/views/redirect'], resolve) | ||
| 39 | + } | ||
| 40 | + ] | ||
| 41 | + }, | ||
| 42 | + { | ||
| 43 | + path: '/login', | ||
| 44 | + component: (resolve) => require(['@/views/login'], resolve), | ||
| 45 | + hidden: true | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + path: '/register', | ||
| 49 | + component: (resolve) => require(['@/views/register'], resolve), | ||
| 50 | + hidden: true | ||
| 51 | + }, | ||
| 52 | + { | ||
| 53 | + path: '/404', | ||
| 54 | + component: (resolve) => require(['@/views/error/404'], resolve), | ||
| 55 | + hidden: true | ||
| 56 | + }, | ||
| 57 | + { | ||
| 58 | + path: '/401', | ||
| 59 | + component: (resolve) => require(['@/views/error/401'], resolve), | ||
| 60 | + hidden: true | ||
| 61 | + }, | ||
| 62 | + { | ||
| 63 | + path: '', | ||
| 64 | + component: Layout, | ||
| 65 | + redirect: 'index', | ||
| 66 | + children: [ | ||
| 67 | + { | ||
| 68 | + path: 'index', | ||
| 69 | + component: (resolve) => require(['@/views/index'], resolve), | ||
| 70 | + name: 'Index', | ||
| 71 | + meta: { title: '首页', icon: 'dashboard', affix: true } | ||
| 72 | + } | ||
| 73 | + ] | ||
| 74 | + }, | ||
| 75 | + { | ||
| 76 | + path: '/user', | ||
| 77 | + component: Layout, | ||
| 78 | + hidden: true, | ||
| 79 | + redirect: 'noredirect', | ||
| 80 | + children: [ | ||
| 81 | + { | ||
| 82 | + path: 'profile', | ||
| 83 | + component: (resolve) => require(['@/views/system/user/profile/index'], resolve), | ||
| 84 | + name: 'Profile', | ||
| 85 | + meta: { title: '个人中心', icon: 'user' } | ||
| 86 | + } | ||
| 87 | + ] | ||
| 88 | + }, | ||
| 89 | + { | ||
| 90 | + path: '/system/user-auth', | ||
| 91 | + component: Layout, | ||
| 92 | + hidden: true, | ||
| 93 | + children: [ | ||
| 94 | + { | ||
| 95 | + path: 'role/:userId(\\d+)', | ||
| 96 | + component: (resolve) => require(['@/views/system/user/authRole'], resolve), | ||
| 97 | + name: 'AuthRole', | ||
| 98 | + meta: { title: '分配角色', activeMenu: '/system/user'} | ||
| 99 | + } | ||
| 100 | + ] | ||
| 101 | + }, | ||
| 102 | + { | ||
| 103 | + path: '/system/role-auth', | ||
| 104 | + component: Layout, | ||
| 105 | + hidden: true, | ||
| 106 | + children: [ | ||
| 107 | + { | ||
| 108 | + path: 'user/:roleId(\\d+)', | ||
| 109 | + component: (resolve) => require(['@/views/system/role/authUser'], resolve), | ||
| 110 | + name: 'AuthUser', | ||
| 111 | + meta: { title: '分配用户', activeMenu: '/system/role'} | ||
| 112 | + } | ||
| 113 | + ] | ||
| 114 | + }, | ||
| 115 | + { | ||
| 116 | + path: '/system/dict-data', | ||
| 117 | + component: Layout, | ||
| 118 | + hidden: true, | ||
| 119 | + children: [ | ||
| 120 | + { | ||
| 121 | + path: 'index/:dictId(\\d+)', | ||
| 122 | + component: (resolve) => require(['@/views/system/dict/data'], resolve), | ||
| 123 | + name: 'Data', | ||
| 124 | + meta: { title: '字典数据', activeMenu: '/system/dict'} | ||
| 125 | + } | ||
| 126 | + ] | ||
| 127 | + }, | ||
| 128 | + { | ||
| 129 | + path: '/monitor/job-log', | ||
| 130 | + component: Layout, | ||
| 131 | + hidden: true, | ||
| 132 | + children: [ | ||
| 133 | + { | ||
| 134 | + path: 'index', | ||
| 135 | + component: (resolve) => require(['@/views/monitor/job/log'], resolve), | ||
| 136 | + name: 'JobLog', | ||
| 137 | + meta: { title: '调度日志', activeMenu: '/monitor/job'} | ||
| 138 | + } | ||
| 139 | + ] | ||
| 140 | + }, | ||
| 141 | + { | ||
| 142 | + path: '/tool/gen-edit', | ||
| 143 | + component: Layout, | ||
| 144 | + hidden: true, | ||
| 145 | + children: [ | ||
| 146 | + { | ||
| 147 | + path: 'index', | ||
| 148 | + component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), | ||
| 149 | + name: 'GenEdit', | ||
| 150 | + meta: { title: '修改生成配置', activeMenu: '/tool/gen'} | ||
| 151 | + } | ||
| 152 | + ] | ||
| 153 | + } | ||
| 154 | +] | ||
| 155 | + | ||
| 156 | +export default new Router({ | ||
| 157 | + mode: 'history', // 去掉url中的# | ||
| 158 | + scrollBehavior: () => ({ y: 0 }), | ||
| 159 | + routes: constantRoutes | ||
| 160 | +}) |
| 1 | -<template> | ||
| 2 | - <el-card> | ||
| 3 | - <el-tabs v-model="activeName"> | ||
| 4 | - <el-tab-pane label="基本信息" name="basic"> | ||
| 5 | - <basic-info-form ref="basicInfo" :info="info" /> | ||
| 6 | - </el-tab-pane> | ||
| 7 | - <el-tab-pane label="字段信息" name="cloum"> | ||
| 8 | - <el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight"> | ||
| 9 | - <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" /> | ||
| 10 | - <el-table-column | ||
| 11 | - label="字段列名" | ||
| 12 | - prop="columnName" | ||
| 13 | - min-width="10%" | ||
| 14 | - :show-overflow-tooltip="true" | ||
| 15 | - /> | ||
| 16 | - <el-table-column label="字段描述" min-width="10%"> | ||
| 17 | - <template slot-scope="scope"> | ||
| 18 | - <el-input v-model="scope.row.columnComment"></el-input> | ||
| 19 | - </template> | ||
| 20 | - </el-table-column> | ||
| 21 | - <el-table-column | ||
| 22 | - label="物理类型" | ||
| 23 | - prop="columnType" | ||
| 24 | - min-width="10%" | ||
| 25 | - :show-overflow-tooltip="true" | ||
| 26 | - /> | ||
| 27 | - <el-table-column label="Java类型" min-width="11%"> | ||
| 28 | - <template slot-scope="scope"> | ||
| 29 | - <el-select v-model="scope.row.javaType"> | ||
| 30 | - <el-option label="Long" value="Long" /> | ||
| 31 | - <el-option label="String" value="String" /> | ||
| 32 | - <el-option label="Integer" value="Integer" /> | ||
| 33 | - <el-option label="Double" value="Double" /> | ||
| 34 | - <el-option label="BigDecimal" value="BigDecimal" /> | ||
| 35 | - <el-option label="Date" value="Date" /> | ||
| 36 | - </el-select> | ||
| 37 | - </template> | ||
| 38 | - </el-table-column> | ||
| 39 | - <el-table-column label="java属性" min-width="10%"> | ||
| 40 | - <template slot-scope="scope"> | ||
| 41 | - <el-input v-model="scope.row.javaField"></el-input> | ||
| 42 | - </template> | ||
| 43 | - </el-table-column> | ||
| 44 | - | ||
| 45 | - <el-table-column label="插入" min-width="5%"> | ||
| 46 | - <template slot-scope="scope"> | ||
| 47 | - <el-checkbox true-label="1" v-model="scope.row.isInsert"></el-checkbox> | ||
| 48 | - </template> | ||
| 49 | - </el-table-column> | ||
| 50 | - <el-table-column label="编辑" min-width="5%"> | ||
| 51 | - <template slot-scope="scope"> | ||
| 52 | - <el-checkbox true-label="1" v-model="scope.row.isEdit"></el-checkbox> | ||
| 53 | - </template> | ||
| 54 | - </el-table-column> | ||
| 55 | - <el-table-column label="列表" min-width="5%"> | ||
| 56 | - <template slot-scope="scope"> | ||
| 57 | - <el-checkbox true-label="1" v-model="scope.row.isList"></el-checkbox> | ||
| 58 | - </template> | ||
| 59 | - </el-table-column> | ||
| 60 | - <el-table-column label="查询" min-width="5%"> | ||
| 61 | - <template slot-scope="scope"> | ||
| 62 | - <el-checkbox true-label="1" v-model="scope.row.isQuery"></el-checkbox> | ||
| 63 | - </template> | ||
| 64 | - </el-table-column> | ||
| 65 | - <el-table-column label="查询方式" min-width="10%"> | ||
| 66 | - <template slot-scope="scope"> | ||
| 67 | - <el-select v-model="scope.row.queryType"> | ||
| 68 | - <el-option label="=" value="EQ" /> | ||
| 69 | - <el-option label="!=" value="NE" /> | ||
| 70 | - <el-option label=">" value="GT" /> | ||
| 71 | - <el-option label=">=" value="GTE" /> | ||
| 72 | - <el-option label="<" value="LT" /> | ||
| 73 | - <el-option label="<=" value="LTE" /> | ||
| 74 | - <el-option label="LIKE" value="LIKE" /> | ||
| 75 | - <el-option label="BETWEEN" value="BETWEEN" /> | ||
| 76 | - </el-select> | ||
| 77 | - </template> | ||
| 78 | - </el-table-column> | ||
| 79 | - <el-table-column label="必填" min-width="5%"> | ||
| 80 | - <template slot-scope="scope"> | ||
| 81 | - <el-checkbox true-label="1" v-model="scope.row.isRequired"></el-checkbox> | ||
| 82 | - </template> | ||
| 83 | - </el-table-column> | ||
| 84 | - <el-table-column label="显示类型" min-width="12%"> | ||
| 85 | - <template slot-scope="scope"> | ||
| 86 | - <el-select v-model="scope.row.htmlType"> | ||
| 87 | - <el-option label="文本框" value="input" /> | ||
| 88 | - <el-option label="文本域" value="textarea" /> | ||
| 89 | - <el-option label="下拉框" value="select" /> | ||
| 90 | - <el-option label="单选框" value="radio" /> | ||
| 91 | - <el-option label="复选框" value="checkbox" /> | ||
| 92 | - <el-option label="日期控件" value="datetime" /> | ||
| 93 | - <el-option label="图片上传" value="imageUpload" /> | ||
| 94 | - <el-option label="文件上传" value="fileUpload" /> | ||
| 95 | - <el-option label="富文本控件" value="editor" /> | ||
| 96 | - </el-select> | ||
| 97 | - </template> | ||
| 98 | - </el-table-column> | ||
| 99 | - <el-table-column label="字典类型" min-width="12%"> | ||
| 100 | - <template slot-scope="scope"> | ||
| 101 | - <el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"> | ||
| 102 | - <el-option | ||
| 103 | - v-for="dict in dictOptions" | ||
| 104 | - :key="dict.dictType" | ||
| 105 | - :label="dict.dictName" | ||
| 106 | - :value="dict.dictType"> | ||
| 107 | - <span style="float: left">{{ dict.dictName }}</span> | ||
| 108 | - <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span> | ||
| 109 | - </el-option> | ||
| 110 | - </el-select> | ||
| 111 | - </template> | ||
| 112 | - </el-table-column> | ||
| 113 | - </el-table> | ||
| 114 | - </el-tab-pane> | ||
| 115 | - <el-tab-pane label="生成信息" name="genInfo"> | ||
| 116 | - <gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus"/> | ||
| 117 | - </el-tab-pane> | ||
| 118 | - </el-tabs> | ||
| 119 | - <el-form label-width="100px"> | ||
| 120 | - <el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;"> | ||
| 121 | - <el-button type="primary" @click="submitForm()">提交</el-button> | ||
| 122 | - <el-button @click="close()">返回</el-button> | ||
| 123 | - </el-form-item> | ||
| 124 | - </el-form> | ||
| 125 | - </el-card> | ||
| 126 | -</template> | ||
| 127 | -<script> | ||
| 128 | -import { getGenTable, updateGenTable } from "@/api/tool/gen"; | ||
| 129 | -import { optionselect as getDictOptionselect } from "@/api/system/dict/type"; | ||
| 130 | -import { listMenu as getMenuTreeselect } from "@/api/system/menu"; | ||
| 131 | -import basicInfoForm from "./basicInfoForm"; | ||
| 132 | -import genInfoForm from "./genInfoForm"; | ||
| 133 | -import Sortable from 'sortablejs' | ||
| 134 | - | ||
| 135 | -export default { | ||
| 136 | - name: "GenEdit", | ||
| 137 | - components: { | ||
| 138 | - basicInfoForm, | ||
| 139 | - genInfoForm | ||
| 140 | - }, | ||
| 141 | - data() { | ||
| 142 | - return { | ||
| 143 | - // 选中选项卡的 name | ||
| 144 | - activeName: "cloum", | ||
| 145 | - // 表格的高度 | ||
| 146 | - tableHeight: document.documentElement.scrollHeight - 245 + "px", | ||
| 147 | - // 表信息 | ||
| 148 | - tables: [], | ||
| 149 | - // 表列信息 | ||
| 150 | - cloumns: [], | ||
| 151 | - // 字典信息 | ||
| 152 | - dictOptions: [], | ||
| 153 | - // 菜单信息 | ||
| 154 | - menus: [], | ||
| 155 | - // 表详细信息 | ||
| 156 | - info: {} | ||
| 157 | - }; | ||
| 158 | - }, | ||
| 159 | - created() { | ||
| 160 | - const tableId = this.$route.params && this.$route.params.tableId; | ||
| 161 | - if (tableId) { | ||
| 162 | - // 获取表详细信息 | ||
| 163 | - getGenTable(tableId).then(res => { | ||
| 164 | - this.cloumns = res.data.rows; | ||
| 165 | - this.info = res.data.info; | ||
| 166 | - this.tables = res.data.tables; | ||
| 167 | - }); | ||
| 168 | - /** 查询字典下拉列表 */ | ||
| 169 | - getDictOptionselect().then(response => { | ||
| 170 | - this.dictOptions = response.data; | ||
| 171 | - }); | ||
| 172 | - /** 查询菜单下拉列表 */ | ||
| 173 | - getMenuTreeselect().then(response => { | ||
| 174 | - this.menus = this.handleTree(response.data, "menuId"); | ||
| 175 | - }); | ||
| 176 | - } | ||
| 177 | - }, | ||
| 178 | - methods: { | ||
| 179 | - /** 提交按钮 */ | ||
| 180 | - submitForm() { | ||
| 181 | - const basicForm = this.$refs.basicInfo.$refs.basicInfoForm; | ||
| 182 | - const genForm = this.$refs.genInfo.$refs.genInfoForm; | ||
| 183 | - Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => { | ||
| 184 | - const validateResult = res.every(item => !!item); | ||
| 185 | - if (validateResult) { | ||
| 186 | - const genTable = Object.assign({}, basicForm.model, genForm.model); | ||
| 187 | - genTable.columns = this.cloumns; | ||
| 188 | - genTable.params = { | ||
| 189 | - treeCode: genTable.treeCode, | ||
| 190 | - treeName: genTable.treeName, | ||
| 191 | - treeParentCode: genTable.treeParentCode, | ||
| 192 | - parentMenuId: genTable.parentMenuId | ||
| 193 | - }; | ||
| 194 | - updateGenTable(genTable).then(res => { | ||
| 195 | - this.msgSuccess(res.msg); | ||
| 196 | - if (res.code === 200) { | ||
| 197 | - this.close(); | ||
| 198 | - } | ||
| 199 | - }); | ||
| 200 | - } else { | ||
| 201 | - this.msgError("表单校验未通过,请重新检查提交内容"); | ||
| 202 | - } | ||
| 203 | - }); | ||
| 204 | - }, | ||
| 205 | - getFormPromise(form) { | ||
| 206 | - return new Promise(resolve => { | ||
| 207 | - form.validate(res => { | ||
| 208 | - resolve(res); | ||
| 209 | - }); | ||
| 210 | - }); | ||
| 211 | - }, | ||
| 212 | - /** 关闭按钮 */ | ||
| 213 | - close() { | ||
| 214 | - this.$store.dispatch("tagsView/delView", this.$route); | ||
| 215 | - this.$router.push({ path: "/tool/gen", query: { t: Date.now()}}) | ||
| 216 | - } | ||
| 217 | - }, | ||
| 218 | - mounted() { | ||
| 219 | - const el = this.$refs.dragTable.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0]; | ||
| 220 | - const sortable = Sortable.create(el, { | ||
| 221 | - handle: ".allowDrag", | ||
| 222 | - onEnd: evt => { | ||
| 223 | - const targetRow = this.cloumns.splice(evt.oldIndex, 1)[0]; | ||
| 224 | - this.cloumns.splice(evt.newIndex, 0, targetRow); | ||
| 225 | - for (let index in this.cloumns) { | ||
| 226 | - this.cloumns[index].sort = parseInt(index) + 1; | ||
| 227 | - } | ||
| 228 | - } | ||
| 229 | - }); | ||
| 230 | - } | ||
| 231 | -}; | ||
| 232 | -</script> | 1 | +<template> |
| 2 | + <el-card> | ||
| 3 | + <el-tabs v-model="activeName"> | ||
| 4 | + <el-tab-pane label="基本信息" name="basic"> | ||
| 5 | + <basic-info-form ref="basicInfo" :info="info" /> | ||
| 6 | + </el-tab-pane> | ||
| 7 | + <el-tab-pane label="字段信息" name="cloum"> | ||
| 8 | + <el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight"> | ||
| 9 | + <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" /> | ||
| 10 | + <el-table-column | ||
| 11 | + label="字段列名" | ||
| 12 | + prop="columnName" | ||
| 13 | + min-width="10%" | ||
| 14 | + :show-overflow-tooltip="true" | ||
| 15 | + /> | ||
| 16 | + <el-table-column label="字段描述" min-width="10%"> | ||
| 17 | + <template slot-scope="scope"> | ||
| 18 | + <el-input v-model="scope.row.columnComment"></el-input> | ||
| 19 | + </template> | ||
| 20 | + </el-table-column> | ||
| 21 | + <el-table-column | ||
| 22 | + label="物理类型" | ||
| 23 | + prop="columnType" | ||
| 24 | + min-width="10%" | ||
| 25 | + :show-overflow-tooltip="true" | ||
| 26 | + /> | ||
| 27 | + <el-table-column label="Java类型" min-width="11%"> | ||
| 28 | + <template slot-scope="scope"> | ||
| 29 | + <el-select v-model="scope.row.javaType"> | ||
| 30 | + <el-option label="Long" value="Long" /> | ||
| 31 | + <el-option label="String" value="String" /> | ||
| 32 | + <el-option label="Integer" value="Integer" /> | ||
| 33 | + <el-option label="Double" value="Double" /> | ||
| 34 | + <el-option label="BigDecimal" value="BigDecimal" /> | ||
| 35 | + <el-option label="Date" value="Date" /> | ||
| 36 | + </el-select> | ||
| 37 | + </template> | ||
| 38 | + </el-table-column> | ||
| 39 | + <el-table-column label="java属性" min-width="10%"> | ||
| 40 | + <template slot-scope="scope"> | ||
| 41 | + <el-input v-model="scope.row.javaField"></el-input> | ||
| 42 | + </template> | ||
| 43 | + </el-table-column> | ||
| 44 | + | ||
| 45 | + <el-table-column label="插入" min-width="5%"> | ||
| 46 | + <template slot-scope="scope"> | ||
| 47 | + <el-checkbox true-label="1" v-model="scope.row.isInsert"></el-checkbox> | ||
| 48 | + </template> | ||
| 49 | + </el-table-column> | ||
| 50 | + <el-table-column label="编辑" min-width="5%"> | ||
| 51 | + <template slot-scope="scope"> | ||
| 52 | + <el-checkbox true-label="1" v-model="scope.row.isEdit"></el-checkbox> | ||
| 53 | + </template> | ||
| 54 | + </el-table-column> | ||
| 55 | + <el-table-column label="列表" min-width="5%"> | ||
| 56 | + <template slot-scope="scope"> | ||
| 57 | + <el-checkbox true-label="1" v-model="scope.row.isList"></el-checkbox> | ||
| 58 | + </template> | ||
| 59 | + </el-table-column> | ||
| 60 | + <el-table-column label="查询" min-width="5%"> | ||
| 61 | + <template slot-scope="scope"> | ||
| 62 | + <el-checkbox true-label="1" v-model="scope.row.isQuery"></el-checkbox> | ||
| 63 | + </template> | ||
| 64 | + </el-table-column> | ||
| 65 | + <el-table-column label="查询方式" min-width="10%"> | ||
| 66 | + <template slot-scope="scope"> | ||
| 67 | + <el-select v-model="scope.row.queryType"> | ||
| 68 | + <el-option label="=" value="EQ" /> | ||
| 69 | + <el-option label="!=" value="NE" /> | ||
| 70 | + <el-option label=">" value="GT" /> | ||
| 71 | + <el-option label=">=" value="GTE" /> | ||
| 72 | + <el-option label="<" value="LT" /> | ||
| 73 | + <el-option label="<=" value="LTE" /> | ||
| 74 | + <el-option label="LIKE" value="LIKE" /> | ||
| 75 | + <el-option label="BETWEEN" value="BETWEEN" /> | ||
| 76 | + </el-select> | ||
| 77 | + </template> | ||
| 78 | + </el-table-column> | ||
| 79 | + <el-table-column label="必填" min-width="5%"> | ||
| 80 | + <template slot-scope="scope"> | ||
| 81 | + <el-checkbox true-label="1" v-model="scope.row.isRequired"></el-checkbox> | ||
| 82 | + </template> | ||
| 83 | + </el-table-column> | ||
| 84 | + <el-table-column label="显示类型" min-width="12%"> | ||
| 85 | + <template slot-scope="scope"> | ||
| 86 | + <el-select v-model="scope.row.htmlType"> | ||
| 87 | + <el-option label="文本框" value="input" /> | ||
| 88 | + <el-option label="文本域" value="textarea" /> | ||
| 89 | + <el-option label="下拉框" value="select" /> | ||
| 90 | + <el-option label="单选框" value="radio" /> | ||
| 91 | + <el-option label="复选框" value="checkbox" /> | ||
| 92 | + <el-option label="日期控件" value="datetime" /> | ||
| 93 | + <el-option label="图片上传" value="imageUpload" /> | ||
| 94 | + <el-option label="文件上传" value="fileUpload" /> | ||
| 95 | + <el-option label="富文本控件" value="editor" /> | ||
| 96 | + </el-select> | ||
| 97 | + </template> | ||
| 98 | + </el-table-column> | ||
| 99 | + <el-table-column label="字典类型" min-width="12%"> | ||
| 100 | + <template slot-scope="scope"> | ||
| 101 | + <el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"> | ||
| 102 | + <el-option | ||
| 103 | + v-for="dict in dictOptions" | ||
| 104 | + :key="dict.dictType" | ||
| 105 | + :label="dict.dictName" | ||
| 106 | + :value="dict.dictType"> | ||
| 107 | + <span style="float: left">{{ dict.dictName }}</span> | ||
| 108 | + <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span> | ||
| 109 | + </el-option> | ||
| 110 | + </el-select> | ||
| 111 | + </template> | ||
| 112 | + </el-table-column> | ||
| 113 | + </el-table> | ||
| 114 | + </el-tab-pane> | ||
| 115 | + <el-tab-pane label="生成信息" name="genInfo"> | ||
| 116 | + <gen-info-form ref="genInfo" :info="info" :tables="tables" :menus="menus"/> | ||
| 117 | + </el-tab-pane> | ||
| 118 | + </el-tabs> | ||
| 119 | + <el-form label-width="100px"> | ||
| 120 | + <el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;"> | ||
| 121 | + <el-button type="primary" @click="submitForm()">提交</el-button> | ||
| 122 | + <el-button @click="close()">返回</el-button> | ||
| 123 | + </el-form-item> | ||
| 124 | + </el-form> | ||
| 125 | + </el-card> | ||
| 126 | +</template> | ||
| 127 | +<script> | ||
| 128 | +import { getGenTable, updateGenTable } from "@/api/tool/gen"; | ||
| 129 | +import { optionselect as getDictOptionselect } from "@/api/system/dict/type"; | ||
| 130 | +import { listMenu as getMenuTreeselect } from "@/api/system/menu"; | ||
| 131 | +import basicInfoForm from "./basicInfoForm"; | ||
| 132 | +import genInfoForm from "./genInfoForm"; | ||
| 133 | +import Sortable from 'sortablejs' | ||
| 134 | + | ||
| 135 | +export default { | ||
| 136 | + name: "GenEdit", | ||
| 137 | + components: { | ||
| 138 | + basicInfoForm, | ||
| 139 | + genInfoForm | ||
| 140 | + }, | ||
| 141 | + data() { | ||
| 142 | + return { | ||
| 143 | + // 选中选项卡的 name | ||
| 144 | + activeName: "cloum", | ||
| 145 | + // 表格的高度 | ||
| 146 | + tableHeight: document.documentElement.scrollHeight - 245 + "px", | ||
| 147 | + // 表信息 | ||
| 148 | + tables: [], | ||
| 149 | + // 表列信息 | ||
| 150 | + cloumns: [], | ||
| 151 | + // 字典信息 | ||
| 152 | + dictOptions: [], | ||
| 153 | + // 菜单信息 | ||
| 154 | + menus: [], | ||
| 155 | + // 表详细信息 | ||
| 156 | + info: {} | ||
| 157 | + }; | ||
| 158 | + }, | ||
| 159 | + created() { | ||
| 160 | + const tableId = this.$route.query && this.$route.query.tableId; | ||
| 161 | + if (tableId) { | ||
| 162 | + // 获取表详细信息 | ||
| 163 | + getGenTable(tableId).then(res => { | ||
| 164 | + this.cloumns = res.data.rows; | ||
| 165 | + this.info = res.data.info; | ||
| 166 | + this.tables = res.data.tables; | ||
| 167 | + }); | ||
| 168 | + /** 查询字典下拉列表 */ | ||
| 169 | + getDictOptionselect().then(response => { | ||
| 170 | + this.dictOptions = response.data; | ||
| 171 | + }); | ||
| 172 | + /** 查询菜单下拉列表 */ | ||
| 173 | + getMenuTreeselect().then(response => { | ||
| 174 | + this.menus = this.handleTree(response.data, "menuId"); | ||
| 175 | + }); | ||
| 176 | + } | ||
| 177 | + }, | ||
| 178 | + methods: { | ||
| 179 | + /** 提交按钮 */ | ||
| 180 | + submitForm() { | ||
| 181 | + const basicForm = this.$refs.basicInfo.$refs.basicInfoForm; | ||
| 182 | + const genForm = this.$refs.genInfo.$refs.genInfoForm; | ||
| 183 | + Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => { | ||
| 184 | + const validateResult = res.every(item => !!item); | ||
| 185 | + if (validateResult) { | ||
| 186 | + const genTable = Object.assign({}, basicForm.model, genForm.model); | ||
| 187 | + genTable.columns = this.cloumns; | ||
| 188 | + genTable.params = { | ||
| 189 | + treeCode: genTable.treeCode, | ||
| 190 | + treeName: genTable.treeName, | ||
| 191 | + treeParentCode: genTable.treeParentCode, | ||
| 192 | + parentMenuId: genTable.parentMenuId | ||
| 193 | + }; | ||
| 194 | + updateGenTable(genTable).then(res => { | ||
| 195 | + this.msgSuccess(res.msg); | ||
| 196 | + if (res.code === 200) { | ||
| 197 | + this.close(); | ||
| 198 | + } | ||
| 199 | + }); | ||
| 200 | + } else { | ||
| 201 | + this.msgError("表单校验未通过,请重新检查提交内容"); | ||
| 202 | + } | ||
| 203 | + }); | ||
| 204 | + }, | ||
| 205 | + getFormPromise(form) { | ||
| 206 | + return new Promise(resolve => { | ||
| 207 | + form.validate(res => { | ||
| 208 | + resolve(res); | ||
| 209 | + }); | ||
| 210 | + }); | ||
| 211 | + }, | ||
| 212 | + /** 关闭按钮 */ | ||
| 213 | + close() { | ||
| 214 | + this.$store.dispatch("tagsView/delView", this.$route); | ||
| 215 | + this.$router.push({ path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } }) | ||
| 216 | + } | ||
| 217 | + }, | ||
| 218 | + mounted() { | ||
| 219 | + const el = this.$refs.dragTable.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0]; | ||
| 220 | + const sortable = Sortable.create(el, { | ||
| 221 | + handle: ".allowDrag", | ||
| 222 | + onEnd: evt => { | ||
| 223 | + const targetRow = this.cloumns.splice(evt.oldIndex, 1)[0]; | ||
| 224 | + this.cloumns.splice(evt.newIndex, 0, targetRow); | ||
| 225 | + for (let index in this.cloumns) { | ||
| 226 | + this.cloumns[index].sort = parseInt(index) + 1; | ||
| 227 | + } | ||
| 228 | + } | ||
| 229 | + }); | ||
| 230 | + } | ||
| 231 | +}; | ||
| 232 | +</script> |
| 1 | -<template> | ||
| 2 | - <div class="app-container"> | ||
| 3 | - <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> | ||
| 4 | - <el-form-item label="表名称" prop="tableName"> | ||
| 5 | - <el-input | ||
| 6 | - v-model="queryParams.tableName" | ||
| 7 | - placeholder="请输入表名称" | ||
| 8 | - clearable | ||
| 9 | - size="small" | ||
| 10 | - @keyup.enter.native="handleQuery" | ||
| 11 | - /> | ||
| 12 | - </el-form-item> | ||
| 13 | - <el-form-item label="表描述" prop="tableComment"> | ||
| 14 | - <el-input | ||
| 15 | - v-model="queryParams.tableComment" | ||
| 16 | - placeholder="请输入表描述" | ||
| 17 | - clearable | ||
| 18 | - size="small" | ||
| 19 | - @keyup.enter.native="handleQuery" | ||
| 20 | - /> | ||
| 21 | - </el-form-item> | ||
| 22 | - <el-form-item label="创建时间"> | ||
| 23 | - <el-date-picker | ||
| 24 | - v-model="dateRange" | ||
| 25 | - size="small" | ||
| 26 | - style="width: 240px" | ||
| 27 | - value-format="yyyy-MM-dd" | ||
| 28 | - type="daterange" | ||
| 29 | - range-separator="-" | ||
| 30 | - start-placeholder="开始日期" | ||
| 31 | - end-placeholder="结束日期" | ||
| 32 | - ></el-date-picker> | ||
| 33 | - </el-form-item> | ||
| 34 | - <el-form-item> | ||
| 35 | - <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | ||
| 36 | - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | ||
| 37 | - </el-form-item> | ||
| 38 | - </el-form> | ||
| 39 | - | ||
| 40 | - <el-row :gutter="10" class="mb8"> | ||
| 41 | - <el-col :span="1.5"> | ||
| 42 | - <el-button | ||
| 43 | - type="primary" | ||
| 44 | - plain | ||
| 45 | - icon="el-icon-download" | ||
| 46 | - size="mini" | ||
| 47 | - @click="handleGenTable" | ||
| 48 | - v-hasPermi="['tool:gen:code']" | ||
| 49 | - >生成</el-button> | ||
| 50 | - </el-col> | ||
| 51 | - <el-col :span="1.5"> | ||
| 52 | - <el-button | ||
| 53 | - type="info" | ||
| 54 | - plain | ||
| 55 | - icon="el-icon-upload" | ||
| 56 | - size="mini" | ||
| 57 | - @click="openImportTable" | ||
| 58 | - v-hasPermi="['tool:gen:import']" | ||
| 59 | - >导入</el-button> | ||
| 60 | - </el-col> | ||
| 61 | - <el-col :span="1.5"> | ||
| 62 | - <el-button | ||
| 63 | - type="success" | ||
| 64 | - plain | ||
| 65 | - icon="el-icon-edit" | ||
| 66 | - size="mini" | ||
| 67 | - :disabled="single" | ||
| 68 | - @click="handleEditTable" | ||
| 69 | - v-hasPermi="['tool:gen:edit']" | ||
| 70 | - >修改</el-button> | ||
| 71 | - </el-col> | ||
| 72 | - <el-col :span="1.5"> | ||
| 73 | - <el-button | ||
| 74 | - type="danger" | ||
| 75 | - plain | ||
| 76 | - icon="el-icon-delete" | ||
| 77 | - size="mini" | ||
| 78 | - :disabled="multiple" | ||
| 79 | - @click="handleDelete" | ||
| 80 | - v-hasPermi="['tool:gen:remove']" | ||
| 81 | - >删除</el-button> | ||
| 82 | - </el-col> | ||
| 83 | - <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | ||
| 84 | - </el-row> | ||
| 85 | - | ||
| 86 | - <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> | ||
| 87 | - <el-table-column type="selection" align="center" width="55"></el-table-column> | ||
| 88 | - <el-table-column label="序号" type="index" width="50" align="center"> | ||
| 89 | - <template slot-scope="scope"> | ||
| 90 | - <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> | ||
| 91 | - </template> | ||
| 92 | - </el-table-column> | ||
| 93 | - <el-table-column | ||
| 94 | - label="表名称" | ||
| 95 | - align="center" | ||
| 96 | - prop="tableName" | ||
| 97 | - :show-overflow-tooltip="true" | ||
| 98 | - width="120" | ||
| 99 | - /> | ||
| 100 | - <el-table-column | ||
| 101 | - label="表描述" | ||
| 102 | - align="center" | ||
| 103 | - prop="tableComment" | ||
| 104 | - :show-overflow-tooltip="true" | ||
| 105 | - width="120" | ||
| 106 | - /> | ||
| 107 | - <el-table-column | ||
| 108 | - label="实体" | ||
| 109 | - align="center" | ||
| 110 | - prop="className" | ||
| 111 | - :show-overflow-tooltip="true" | ||
| 112 | - width="120" | ||
| 113 | - /> | ||
| 114 | - <el-table-column label="创建时间" align="center" prop="createTime" width="160" /> | ||
| 115 | - <el-table-column label="更新时间" align="center" prop="updateTime" width="160" /> | ||
| 116 | - <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||
| 117 | - <template slot-scope="scope"> | ||
| 118 | - <el-button | ||
| 119 | - type="text" | ||
| 120 | - size="small" | ||
| 121 | - icon="el-icon-view" | ||
| 122 | - @click="handlePreview(scope.row)" | ||
| 123 | - v-hasPermi="['tool:gen:preview']" | ||
| 124 | - >预览</el-button> | ||
| 125 | - <el-button | ||
| 126 | - type="text" | ||
| 127 | - size="small" | ||
| 128 | - icon="el-icon-edit" | ||
| 129 | - @click="handleEditTable(scope.row)" | ||
| 130 | - v-hasPermi="['tool:gen:edit']" | ||
| 131 | - >编辑</el-button> | ||
| 132 | - <el-button | ||
| 133 | - type="text" | ||
| 134 | - size="small" | ||
| 135 | - icon="el-icon-delete" | ||
| 136 | - @click="handleDelete(scope.row)" | ||
| 137 | - v-hasPermi="['tool:gen:remove']" | ||
| 138 | - >删除</el-button> | ||
| 139 | - <el-button | ||
| 140 | - type="text" | ||
| 141 | - size="small" | ||
| 142 | - icon="el-icon-refresh" | ||
| 143 | - @click="handleSynchDb(scope.row)" | ||
| 144 | - v-hasPermi="['tool:gen:edit']" | ||
| 145 | - >同步</el-button> | ||
| 146 | - <el-button | ||
| 147 | - type="text" | ||
| 148 | - size="small" | ||
| 149 | - icon="el-icon-download" | ||
| 150 | - @click="handleGenTable(scope.row)" | ||
| 151 | - v-hasPermi="['tool:gen:code']" | ||
| 152 | - >生成代码</el-button> | ||
| 153 | - </template> | ||
| 154 | - </el-table-column> | ||
| 155 | - </el-table> | ||
| 156 | - <pagination | ||
| 157 | - v-show="total>0" | ||
| 158 | - :total="total" | ||
| 159 | - :page.sync="queryParams.pageNum" | ||
| 160 | - :limit.sync="queryParams.pageSize" | ||
| 161 | - @pagination="getList" | ||
| 162 | - /> | ||
| 163 | - <!-- 预览界面 --> | ||
| 164 | - <el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body class="scrollbar"> | ||
| 165 | - <el-tabs v-model="preview.activeName"> | ||
| 166 | - <el-tab-pane | ||
| 167 | - v-for="(value, key) in preview.data" | ||
| 168 | - :label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" | ||
| 169 | - :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" | ||
| 170 | - :key="key" | ||
| 171 | - > | ||
| 172 | - <pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre> | ||
| 173 | - </el-tab-pane> | ||
| 174 | - </el-tabs> | ||
| 175 | - </el-dialog> | ||
| 176 | - <import-table ref="import" @ok="handleQuery" /> | ||
| 177 | - </div> | ||
| 178 | -</template> | ||
| 179 | - | ||
| 180 | -<script> | ||
| 181 | -import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"; | ||
| 182 | -import importTable from "./importTable"; | ||
| 183 | -import { downLoadZip } from "@/utils/zipdownload"; | ||
| 184 | -import hljs from "highlight.js/lib/highlight"; | ||
| 185 | -import "highlight.js/styles/github-gist.css"; | ||
| 186 | -hljs.registerLanguage("java", require("highlight.js/lib/languages/java")); | ||
| 187 | -hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml")); | ||
| 188 | -hljs.registerLanguage("html", require("highlight.js/lib/languages/xml")); | ||
| 189 | -hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml")); | ||
| 190 | -hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript")); | ||
| 191 | -hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql")); | ||
| 192 | - | ||
| 193 | -export default { | ||
| 194 | - name: "Gen", | ||
| 195 | - components: { importTable }, | ||
| 196 | - data() { | ||
| 197 | - return { | ||
| 198 | - // 遮罩层 | ||
| 199 | - loading: true, | ||
| 200 | - // 唯一标识符 | ||
| 201 | - uniqueId: "", | ||
| 202 | - // 选中数组 | ||
| 203 | - ids: [], | ||
| 204 | - // 选中表数组 | ||
| 205 | - tableNames: [], | ||
| 206 | - // 非单个禁用 | ||
| 207 | - single: true, | ||
| 208 | - // 非多个禁用 | ||
| 209 | - multiple: true, | ||
| 210 | - // 显示搜索条件 | ||
| 211 | - showSearch: true, | ||
| 212 | - // 总条数 | ||
| 213 | - total: 0, | ||
| 214 | - // 表数据 | ||
| 215 | - tableList: [], | ||
| 216 | - // 日期范围 | ||
| 217 | - dateRange: "", | ||
| 218 | - // 查询参数 | ||
| 219 | - queryParams: { | ||
| 220 | - pageNum: 1, | ||
| 221 | - pageSize: 10, | ||
| 222 | - tableName: undefined, | ||
| 223 | - tableComment: undefined | ||
| 224 | - }, | ||
| 225 | - // 预览参数 | ||
| 226 | - preview: { | ||
| 227 | - open: false, | ||
| 228 | - title: "代码预览", | ||
| 229 | - data: {}, | ||
| 230 | - activeName: "domain.java" | ||
| 231 | - } | ||
| 232 | - }; | ||
| 233 | - }, | ||
| 234 | - created() { | ||
| 235 | - this.getList(); | ||
| 236 | - }, | ||
| 237 | - activated() { | ||
| 238 | - const time = this.$route.query.t; | ||
| 239 | - if (time != null && time != this.uniqueId) { | ||
| 240 | - this.uniqueId = time; | ||
| 241 | - this.resetQuery(); | ||
| 242 | - } | ||
| 243 | - }, | ||
| 244 | - methods: { | ||
| 245 | - /** 查询表集合 */ | ||
| 246 | - getList() { | ||
| 247 | - this.loading = true; | ||
| 248 | - listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => { | ||
| 249 | - this.tableList = response.rows; | ||
| 250 | - this.total = response.total; | ||
| 251 | - this.loading = false; | ||
| 252 | - } | ||
| 253 | - ); | ||
| 254 | - }, | ||
| 255 | - /** 搜索按钮操作 */ | ||
| 256 | - handleQuery() { | ||
| 257 | - this.queryParams.pageNum = 1; | ||
| 258 | - this.getList(); | ||
| 259 | - }, | ||
| 260 | - /** 生成代码操作 */ | ||
| 261 | - handleGenTable(row) { | ||
| 262 | - const tableNames = row.tableName || this.tableNames; | ||
| 263 | - if (tableNames == "") { | ||
| 264 | - this.msgError("请选择要生成的数据"); | ||
| 265 | - return; | ||
| 266 | - } | ||
| 267 | - if(row.genType === "1") { | ||
| 268 | - genCode(row.tableName).then(response => { | ||
| 269 | - this.msgSuccess("成功生成到自定义路径:" + row.genPath); | ||
| 270 | - }); | ||
| 271 | - } else { | ||
| 272 | - downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); | ||
| 273 | - } | ||
| 274 | - }, | ||
| 275 | - /** 同步数据库操作 */ | ||
| 276 | - handleSynchDb(row) { | ||
| 277 | - const tableName = row.tableName; | ||
| 278 | - this.$confirm('确认要强制同步"' + tableName + '"表结构吗?', "警告", { | ||
| 279 | - confirmButtonText: "确定", | ||
| 280 | - cancelButtonText: "取消", | ||
| 281 | - type: "warning" | ||
| 282 | - }).then(function() { | ||
| 283 | - return synchDb(tableName); | ||
| 284 | - }).then(() => { | ||
| 285 | - this.msgSuccess("同步成功"); | ||
| 286 | - }).catch(() => {}); | ||
| 287 | - }, | ||
| 288 | - /** 打开导入表弹窗 */ | ||
| 289 | - openImportTable() { | ||
| 290 | - this.$refs.import.show(); | ||
| 291 | - }, | ||
| 292 | - /** 重置按钮操作 */ | ||
| 293 | - resetQuery() { | ||
| 294 | - this.dateRange = []; | ||
| 295 | - this.resetForm("queryForm"); | ||
| 296 | - this.handleQuery(); | ||
| 297 | - }, | ||
| 298 | - /** 预览按钮 */ | ||
| 299 | - handlePreview(row) { | ||
| 300 | - previewTable(row.tableId).then(response => { | ||
| 301 | - this.preview.data = response.data; | ||
| 302 | - this.preview.open = true; | ||
| 303 | - }); | ||
| 304 | - }, | ||
| 305 | - /** 高亮显示 */ | ||
| 306 | - highlightedCode(code, key) { | ||
| 307 | - const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm")); | ||
| 308 | - var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length); | ||
| 309 | - const result = hljs.highlight(language, code || "", true); | ||
| 310 | - return result.value || ' '; | ||
| 311 | - }, | ||
| 312 | - // 多选框选中数据 | ||
| 313 | - handleSelectionChange(selection) { | ||
| 314 | - this.ids = selection.map(item => item.tableId); | ||
| 315 | - this.tableNames = selection.map(item => item.tableName); | ||
| 316 | - this.single = selection.length != 1; | ||
| 317 | - this.multiple = !selection.length; | ||
| 318 | - }, | ||
| 319 | - /** 修改按钮操作 */ | ||
| 320 | - handleEditTable(row) { | ||
| 321 | - const tableId = row.tableId || this.ids[0]; | ||
| 322 | - this.$router.push("/tool/gen-edit/index/" + tableId); | ||
| 323 | - }, | ||
| 324 | - /** 删除按钮操作 */ | ||
| 325 | - handleDelete(row) { | ||
| 326 | - const tableIds = row.tableId || this.ids; | ||
| 327 | - this.$confirm('是否确认删除表编号为"' + tableIds + '"的数据项?', "警告", { | ||
| 328 | - confirmButtonText: "确定", | ||
| 329 | - cancelButtonText: "取消", | ||
| 330 | - type: "warning" | ||
| 331 | - }).then(function() { | ||
| 332 | - return delTable(tableIds); | ||
| 333 | - }).then(() => { | ||
| 334 | - this.getList(); | ||
| 335 | - this.msgSuccess("删除成功"); | ||
| 336 | - }).catch(() => {}); | ||
| 337 | - } | ||
| 338 | - } | ||
| 339 | -}; | ||
| 340 | -</script> | ||
| 1 | +<template> | ||
| 2 | + <div class="app-container"> | ||
| 3 | + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> | ||
| 4 | + <el-form-item label="表名称" prop="tableName"> | ||
| 5 | + <el-input | ||
| 6 | + v-model="queryParams.tableName" | ||
| 7 | + placeholder="请输入表名称" | ||
| 8 | + clearable | ||
| 9 | + size="small" | ||
| 10 | + @keyup.enter.native="handleQuery" | ||
| 11 | + /> | ||
| 12 | + </el-form-item> | ||
| 13 | + <el-form-item label="表描述" prop="tableComment"> | ||
| 14 | + <el-input | ||
| 15 | + v-model="queryParams.tableComment" | ||
| 16 | + placeholder="请输入表描述" | ||
| 17 | + clearable | ||
| 18 | + size="small" | ||
| 19 | + @keyup.enter.native="handleQuery" | ||
| 20 | + /> | ||
| 21 | + </el-form-item> | ||
| 22 | + <el-form-item label="创建时间"> | ||
| 23 | + <el-date-picker | ||
| 24 | + v-model="dateRange" | ||
| 25 | + size="small" | ||
| 26 | + style="width: 240px" | ||
| 27 | + value-format="yyyy-MM-dd" | ||
| 28 | + type="daterange" | ||
| 29 | + range-separator="-" | ||
| 30 | + start-placeholder="开始日期" | ||
| 31 | + end-placeholder="结束日期" | ||
| 32 | + ></el-date-picker> | ||
| 33 | + </el-form-item> | ||
| 34 | + <el-form-item> | ||
| 35 | + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | ||
| 36 | + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | ||
| 37 | + </el-form-item> | ||
| 38 | + </el-form> | ||
| 39 | + | ||
| 40 | + <el-row :gutter="10" class="mb8"> | ||
| 41 | + <el-col :span="1.5"> | ||
| 42 | + <el-button | ||
| 43 | + type="primary" | ||
| 44 | + plain | ||
| 45 | + icon="el-icon-download" | ||
| 46 | + size="mini" | ||
| 47 | + @click="handleGenTable" | ||
| 48 | + v-hasPermi="['tool:gen:code']" | ||
| 49 | + >生成</el-button> | ||
| 50 | + </el-col> | ||
| 51 | + <el-col :span="1.5"> | ||
| 52 | + <el-button | ||
| 53 | + type="info" | ||
| 54 | + plain | ||
| 55 | + icon="el-icon-upload" | ||
| 56 | + size="mini" | ||
| 57 | + @click="openImportTable" | ||
| 58 | + v-hasPermi="['tool:gen:import']" | ||
| 59 | + >导入</el-button> | ||
| 60 | + </el-col> | ||
| 61 | + <el-col :span="1.5"> | ||
| 62 | + <el-button | ||
| 63 | + type="success" | ||
| 64 | + plain | ||
| 65 | + icon="el-icon-edit" | ||
| 66 | + size="mini" | ||
| 67 | + :disabled="single" | ||
| 68 | + @click="handleEditTable" | ||
| 69 | + v-hasPermi="['tool:gen:edit']" | ||
| 70 | + >修改</el-button> | ||
| 71 | + </el-col> | ||
| 72 | + <el-col :span="1.5"> | ||
| 73 | + <el-button | ||
| 74 | + type="danger" | ||
| 75 | + plain | ||
| 76 | + icon="el-icon-delete" | ||
| 77 | + size="mini" | ||
| 78 | + :disabled="multiple" | ||
| 79 | + @click="handleDelete" | ||
| 80 | + v-hasPermi="['tool:gen:remove']" | ||
| 81 | + >删除</el-button> | ||
| 82 | + </el-col> | ||
| 83 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | ||
| 84 | + </el-row> | ||
| 85 | + | ||
| 86 | + <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange"> | ||
| 87 | + <el-table-column type="selection" align="center" width="55"></el-table-column> | ||
| 88 | + <el-table-column label="序号" type="index" width="50" align="center"> | ||
| 89 | + <template slot-scope="scope"> | ||
| 90 | + <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span> | ||
| 91 | + </template> | ||
| 92 | + </el-table-column> | ||
| 93 | + <el-table-column | ||
| 94 | + label="表名称" | ||
| 95 | + align="center" | ||
| 96 | + prop="tableName" | ||
| 97 | + :show-overflow-tooltip="true" | ||
| 98 | + width="120" | ||
| 99 | + /> | ||
| 100 | + <el-table-column | ||
| 101 | + label="表描述" | ||
| 102 | + align="center" | ||
| 103 | + prop="tableComment" | ||
| 104 | + :show-overflow-tooltip="true" | ||
| 105 | + width="120" | ||
| 106 | + /> | ||
| 107 | + <el-table-column | ||
| 108 | + label="实体" | ||
| 109 | + align="center" | ||
| 110 | + prop="className" | ||
| 111 | + :show-overflow-tooltip="true" | ||
| 112 | + width="120" | ||
| 113 | + /> | ||
| 114 | + <el-table-column label="创建时间" align="center" prop="createTime" width="160" /> | ||
| 115 | + <el-table-column label="更新时间" align="center" prop="updateTime" width="160" /> | ||
| 116 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||
| 117 | + <template slot-scope="scope"> | ||
| 118 | + <el-button | ||
| 119 | + type="text" | ||
| 120 | + size="small" | ||
| 121 | + icon="el-icon-view" | ||
| 122 | + @click="handlePreview(scope.row)" | ||
| 123 | + v-hasPermi="['tool:gen:preview']" | ||
| 124 | + >预览</el-button> | ||
| 125 | + <el-button | ||
| 126 | + type="text" | ||
| 127 | + size="small" | ||
| 128 | + icon="el-icon-edit" | ||
| 129 | + @click="handleEditTable(scope.row)" | ||
| 130 | + v-hasPermi="['tool:gen:edit']" | ||
| 131 | + >编辑</el-button> | ||
| 132 | + <el-button | ||
| 133 | + type="text" | ||
| 134 | + size="small" | ||
| 135 | + icon="el-icon-delete" | ||
| 136 | + @click="handleDelete(scope.row)" | ||
| 137 | + v-hasPermi="['tool:gen:remove']" | ||
| 138 | + >删除</el-button> | ||
| 139 | + <el-button | ||
| 140 | + type="text" | ||
| 141 | + size="small" | ||
| 142 | + icon="el-icon-refresh" | ||
| 143 | + @click="handleSynchDb(scope.row)" | ||
| 144 | + v-hasPermi="['tool:gen:edit']" | ||
| 145 | + >同步</el-button> | ||
| 146 | + <el-button | ||
| 147 | + type="text" | ||
| 148 | + size="small" | ||
| 149 | + icon="el-icon-download" | ||
| 150 | + @click="handleGenTable(scope.row)" | ||
| 151 | + v-hasPermi="['tool:gen:code']" | ||
| 152 | + >生成代码</el-button> | ||
| 153 | + </template> | ||
| 154 | + </el-table-column> | ||
| 155 | + </el-table> | ||
| 156 | + <pagination | ||
| 157 | + v-show="total>0" | ||
| 158 | + :total="total" | ||
| 159 | + :page.sync="queryParams.pageNum" | ||
| 160 | + :limit.sync="queryParams.pageSize" | ||
| 161 | + @pagination="getList" | ||
| 162 | + /> | ||
| 163 | + <!-- 预览界面 --> | ||
| 164 | + <el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body class="scrollbar"> | ||
| 165 | + <el-tabs v-model="preview.activeName"> | ||
| 166 | + <el-tab-pane | ||
| 167 | + v-for="(value, key) in preview.data" | ||
| 168 | + :label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" | ||
| 169 | + :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" | ||
| 170 | + :key="key" | ||
| 171 | + > | ||
| 172 | + <pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre> | ||
| 173 | + </el-tab-pane> | ||
| 174 | + </el-tabs> | ||
| 175 | + </el-dialog> | ||
| 176 | + <import-table ref="import" @ok="handleQuery" /> | ||
| 177 | + </div> | ||
| 178 | +</template> | ||
| 179 | + | ||
| 180 | +<script> | ||
| 181 | +import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"; | ||
| 182 | +import importTable from "./importTable"; | ||
| 183 | +import { downLoadZip } from "@/utils/zipdownload"; | ||
| 184 | +import hljs from "highlight.js/lib/highlight"; | ||
| 185 | +import "highlight.js/styles/github-gist.css"; | ||
| 186 | +hljs.registerLanguage("java", require("highlight.js/lib/languages/java")); | ||
| 187 | +hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml")); | ||
| 188 | +hljs.registerLanguage("html", require("highlight.js/lib/languages/xml")); | ||
| 189 | +hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml")); | ||
| 190 | +hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript")); | ||
| 191 | +hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql")); | ||
| 192 | + | ||
| 193 | +export default { | ||
| 194 | + name: "Gen", | ||
| 195 | + components: { importTable }, | ||
| 196 | + data() { | ||
| 197 | + return { | ||
| 198 | + // 遮罩层 | ||
| 199 | + loading: true, | ||
| 200 | + // 唯一标识符 | ||
| 201 | + uniqueId: "", | ||
| 202 | + // 选中数组 | ||
| 203 | + ids: [], | ||
| 204 | + // 选中表数组 | ||
| 205 | + tableNames: [], | ||
| 206 | + // 非单个禁用 | ||
| 207 | + single: true, | ||
| 208 | + // 非多个禁用 | ||
| 209 | + multiple: true, | ||
| 210 | + // 显示搜索条件 | ||
| 211 | + showSearch: true, | ||
| 212 | + // 总条数 | ||
| 213 | + total: 0, | ||
| 214 | + // 表数据 | ||
| 215 | + tableList: [], | ||
| 216 | + // 日期范围 | ||
| 217 | + dateRange: "", | ||
| 218 | + // 查询参数 | ||
| 219 | + queryParams: { | ||
| 220 | + pageNum: 1, | ||
| 221 | + pageSize: 10, | ||
| 222 | + tableName: undefined, | ||
| 223 | + tableComment: undefined | ||
| 224 | + }, | ||
| 225 | + // 预览参数 | ||
| 226 | + preview: { | ||
| 227 | + open: false, | ||
| 228 | + title: "代码预览", | ||
| 229 | + data: {}, | ||
| 230 | + activeName: "domain.java" | ||
| 231 | + } | ||
| 232 | + }; | ||
| 233 | + }, | ||
| 234 | + created() { | ||
| 235 | + this.getList(); | ||
| 236 | + }, | ||
| 237 | + activated() { | ||
| 238 | + const time = this.$route.query.t; | ||
| 239 | + if (time != null && time != this.uniqueId) { | ||
| 240 | + this.uniqueId = time; | ||
| 241 | + this.queryParams.pageNum = Number(this.$route.query.pageNum); | ||
| 242 | + this.dateRange = []; | ||
| 243 | + this.resetForm("queryForm"); | ||
| 244 | + this.getList(); | ||
| 245 | + } | ||
| 246 | + }, | ||
| 247 | + methods: { | ||
| 248 | + /** 查询表集合 */ | ||
| 249 | + getList() { | ||
| 250 | + this.loading = true; | ||
| 251 | + listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => { | ||
| 252 | + this.tableList = response.rows; | ||
| 253 | + this.total = response.total; | ||
| 254 | + this.loading = false; | ||
| 255 | + } | ||
| 256 | + ); | ||
| 257 | + }, | ||
| 258 | + /** 搜索按钮操作 */ | ||
| 259 | + handleQuery() { | ||
| 260 | + this.queryParams.pageNum = 1; | ||
| 261 | + this.getList(); | ||
| 262 | + }, | ||
| 263 | + /** 生成代码操作 */ | ||
| 264 | + handleGenTable(row) { | ||
| 265 | + const tableNames = row.tableName || this.tableNames; | ||
| 266 | + if (tableNames == "") { | ||
| 267 | + this.msgError("请选择要生成的数据"); | ||
| 268 | + return; | ||
| 269 | + } | ||
| 270 | + if(row.genType === "1") { | ||
| 271 | + genCode(row.tableName).then(response => { | ||
| 272 | + this.msgSuccess("成功生成到自定义路径:" + row.genPath); | ||
| 273 | + }); | ||
| 274 | + } else { | ||
| 275 | + downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); | ||
| 276 | + } | ||
| 277 | + }, | ||
| 278 | + /** 同步数据库操作 */ | ||
| 279 | + handleSynchDb(row) { | ||
| 280 | + const tableName = row.tableName; | ||
| 281 | + this.$confirm('确认要强制同步"' + tableName + '"表结构吗?', "警告", { | ||
| 282 | + confirmButtonText: "确定", | ||
| 283 | + cancelButtonText: "取消", | ||
| 284 | + type: "warning" | ||
| 285 | + }).then(function() { | ||
| 286 | + return synchDb(tableName); | ||
| 287 | + }).then(() => { | ||
| 288 | + this.msgSuccess("同步成功"); | ||
| 289 | + }).catch(() => {}); | ||
| 290 | + }, | ||
| 291 | + /** 打开导入表弹窗 */ | ||
| 292 | + openImportTable() { | ||
| 293 | + this.$refs.import.show(); | ||
| 294 | + }, | ||
| 295 | + /** 重置按钮操作 */ | ||
| 296 | + resetQuery() { | ||
| 297 | + this.dateRange = []; | ||
| 298 | + this.resetForm("queryForm"); | ||
| 299 | + this.handleQuery(); | ||
| 300 | + }, | ||
| 301 | + /** 预览按钮 */ | ||
| 302 | + handlePreview(row) { | ||
| 303 | + previewTable(row.tableId).then(response => { | ||
| 304 | + this.preview.data = response.data; | ||
| 305 | + this.preview.open = true; | ||
| 306 | + }); | ||
| 307 | + }, | ||
| 308 | + /** 高亮显示 */ | ||
| 309 | + highlightedCode(code, key) { | ||
| 310 | + const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm")); | ||
| 311 | + var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length); | ||
| 312 | + const result = hljs.highlight(language, code || "", true); | ||
| 313 | + return result.value || ' '; | ||
| 314 | + }, | ||
| 315 | + // 多选框选中数据 | ||
| 316 | + handleSelectionChange(selection) { | ||
| 317 | + this.ids = selection.map(item => item.tableId); | ||
| 318 | + this.tableNames = selection.map(item => item.tableName); | ||
| 319 | + this.single = selection.length != 1; | ||
| 320 | + this.multiple = !selection.length; | ||
| 321 | + }, | ||
| 322 | + /** 修改按钮操作 */ | ||
| 323 | + handleEditTable(row) { | ||
| 324 | + const tableId = row.tableId || this.ids[0]; | ||
| 325 | + this.$router.push({ path: '/tool/gen-edit/index', query: { tableId: tableId, pageNum: this.queryParams.pageNum } }); | ||
| 326 | + }, | ||
| 327 | + /** 删除按钮操作 */ | ||
| 328 | + handleDelete(row) { | ||
| 329 | + const tableIds = row.tableId || this.ids; | ||
| 330 | + this.$confirm('是否确认删除表编号为"' + tableIds + '"的数据项?', "警告", { | ||
| 331 | + confirmButtonText: "确定", | ||
| 332 | + cancelButtonText: "取消", | ||
| 333 | + type: "warning" | ||
| 334 | + }).then(function() { | ||
| 335 | + return delTable(tableIds); | ||
| 336 | + }).then(() => { | ||
| 337 | + this.getList(); | ||
| 338 | + this.msgSuccess("删除成功"); | ||
| 339 | + }).catch(() => {}); | ||
| 340 | + } | ||
| 341 | + } | ||
| 342 | +}; | ||
| 343 | +</script> |
-
请 注册 或 登录 后发表评论