@ -0,0 +1,3 @@ |
||||
> 1% |
||||
last 2 versions |
||||
not ie <= 10 |
@ -0,0 +1,39 @@ |
||||
[*] |
||||
charset=utf-8 |
||||
end_of_line=lf |
||||
insert_final_newline=false |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[{*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[*.svg] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[*.js.map] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[*.less] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[*.vue] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
||||
[{.analysis_options,*.yml,*.yaml}] |
||||
indent_style=space |
||||
indent_size=2 |
||||
|
@ -0,0 +1,3 @@ |
||||
NODE_ENV=production |
||||
VUE_APP_PREVIEW=false |
||||
VUE_APP_BASE_API=/api |
@ -0,0 +1,3 @@ |
||||
NODE_ENV=development |
||||
VUE_APP_PREVIEW=true |
||||
VUE_APP_BASE_API=/api |
@ -0,0 +1,3 @@ |
||||
NODE_ENV=production |
||||
VUE_APP_PREVIEW=true |
||||
VUE_APP_BASE_API=/api |
@ -0,0 +1,76 @@ |
||||
module.exports = { |
||||
root: true, |
||||
env: { |
||||
node: true |
||||
}, |
||||
'extends': [ |
||||
'plugin:vue/strongly-recommended', |
||||
'@vue/standard' |
||||
], |
||||
rules: { |
||||
"space-before-function-paren": 0, |
||||
'no-console': 'off', |
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', |
||||
'generator-star-spacing': 'off', |
||||
'no-mixed-operators': 0, |
||||
'vue/max-attributes-per-line': [ |
||||
2, |
||||
{ |
||||
'singleline': 5, |
||||
'multiline': { |
||||
'max': 1, |
||||
'allowFirstLine': false |
||||
} |
||||
} |
||||
], |
||||
'vue/attribute-hyphenation': 0, |
||||
'vue/html-self-closing': 0, |
||||
'vue/component-name-in-template-casing': 0, |
||||
'vue/html-closing-bracket-spacing': 0, |
||||
'vue/singleline-html-element-content-newline': 0, |
||||
'vue/no-unused-components': 0, |
||||
'vue/multiline-html-element-content-newline': 0, |
||||
'vue/no-use-v-if-with-v-for': 0, |
||||
'vue/html-closing-bracket-newline': 0, |
||||
'vue/no-parsing-error': 0, |
||||
'no-tabs': 0, |
||||
'quotes': [ |
||||
2, |
||||
'single', |
||||
{ |
||||
'avoidEscape': true, |
||||
'allowTemplateLiterals': true |
||||
} |
||||
], |
||||
'semi': [ |
||||
2, |
||||
'never', |
||||
{ |
||||
'beforeStatementContinuationChars': 'never' |
||||
} |
||||
], |
||||
'no-delete-var': 2, |
||||
'prefer-const': [ |
||||
2, |
||||
{ |
||||
'ignoreReadBeforeAssign': false |
||||
} |
||||
], |
||||
'template-curly-spacing': 'off', |
||||
'indent': 'off' |
||||
}, |
||||
parserOptions: { |
||||
parser: 'babel-eslint' |
||||
}, |
||||
overrides: [ |
||||
{ |
||||
files: [ |
||||
'**/__tests__/*.{j,t}s?(x)', |
||||
'**/tests/unit/**/*.spec.{j,t}s?(x)' |
||||
], |
||||
env: { |
||||
jest: true |
||||
} |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,5 @@ |
||||
{ |
||||
"rules": { |
||||
"space-before-function-paren": 0 |
||||
} |
||||
} |
@ -0,0 +1 @@ |
||||
public/* linguist-vendored |
@ -0,0 +1,23 @@ |
||||
.DS_Store |
||||
node_modules |
||||
/dist |
||||
|
||||
# local env files |
||||
.env.local |
||||
.env.*.local |
||||
|
||||
# Log files |
||||
npm-debug.log* |
||||
yarn-debug.log* |
||||
yarn-error.log* |
||||
|
||||
# Editor directories and files |
||||
.idea |
||||
.vscode |
||||
*.suo |
||||
*.ntvs* |
||||
*.njsproj |
||||
*.sln |
||||
*.sw* |
||||
package-lock.json |
||||
yarn.lock |
@ -0,0 +1,6 @@ |
||||
{ |
||||
"printWidth": 120, |
||||
"semi": false, |
||||
"singleQuote": true, |
||||
"prettier.spaceBeforeFunctionParen": true |
||||
} |
@ -0,0 +1,7 @@ |
||||
language: node_js |
||||
node_js: |
||||
- 10.15.0 |
||||
cache: yarn |
||||
script: |
||||
- yarn |
||||
- yarn run lint --no-fix && yarn run build |
@ -0,0 +1,21 @@ |
||||
MIT License |
||||
|
||||
Copyright (c) 2021 扶醉 |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -0,0 +1,128 @@ |
||||
<h1 align="center">RuoYi-Antdv</h1> |
||||
|
||||
> RuoYi-Antdv 是RuoYi-Vue和Ant Design Vue Pro的结合。 |
||||
|
||||
<p align="center"> |
||||
<a href="https://gitee.com/fuzui/RuoYi-Antdv" target="_blank"><img src="https://gitee.com/fuzui/RuoYi-Antdv/badge/star.svg?theme=dark" alt="Build Status"></a> |
||||
<a href="https://github.com/fuzui/RuoYi-Antdv" target="_blank"><img src="https://img.shields.io/github/stars/fuzui/RuoYi-Antdv.svg?style=social" alt="Build Status"></a> |
||||
<a href="https://gitee.com/y_project/RuoYi-Vue" target="_blank"><img src="https://img.shields.io/badge/RuoYi Vue-3.3.0-brightgreen" alt="Build Status"></a> |
||||
<a href="https://github.com/vueComponent/ant-design-vue" target="_blank"><img src="https://img.shields.io/badge/Ant Design Vue-1.7.2-brightgreen" alt="Build Status"></a> |
||||
<a href="https://github.com/vueComponent/ant-design-vue-pro" target="_blank"><img src="https://img.shields.io/badge/Ant Design Vue Pro-3.0.0-brightgreen" alt="Build Status"></a> |
||||
</p> |
||||
|
||||
|
||||
------------------------------ |
||||
|
||||
## 简介 |
||||
|
||||
**RuoYi-Antdv**,使用[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)作为后端,改其原有Element Ui为Ant Design Vue。将会持续完全适配RuoYi-Vue。 |
||||
|
||||
> RuoYi-Vue是基于SpringBoot,Spring Security,JWT,Vue 的前后端分离权限管理系统。 |
||||
> |
||||
> 拥有用户管理、部门管理、岗位管理、菜单管理、角色管理、字典管理、参数管理、通知公告、操作日志、登录日志、在线用户、定时任务、代码生成、系统接口、服务监控、在线构建器、连接池监视等功能。 |
||||
|
||||
*当前暂不支持RuoYi中的在线构建器功能。* |
||||
|
||||
* 预览:[https://ruoyi.setworld.net/](https://ruoyi.setworld.net/) |
||||
|
||||
* 文档:[https://docs.geekera.cn/RuoYi-Antdv/](https://docs.geekera.cn/RuoYi-Antdv/) |
||||
|
||||
* RuoYi-Vue文档:[https://doc.ruoyi.vip/ruoyi-vue/](https://doc.ruoyi.vip/ruoyi-vue/) |
||||
|
||||
* Ant Design Vue文档:[https://www.antdv.com/docs/vue/introduce-cn/](https://www.antdv.com/docs/vue/introduce-cn/) |
||||
|
||||
|
||||
|
||||
## 开始使用 |
||||
|
||||
1. 环境准备 |
||||
* 运行启动RuoYi-Vue,参考[RuoYi文档](https://doc.ruoyi.vip/ruoyi-vue/) |
||||
* 安装[node](http://nodejs.org/)和[git](https://git-scm.com/) |
||||
|
||||
1. 安装 |
||||
|
||||
```shell |
||||
git clone git@gitee.com:fuzui/RuoYi-Antdv.git |
||||
``` |
||||
|
||||
或 |
||||
|
||||
```shell |
||||
git clone git@github.com:fuzui/RuoYi-Antdv.git |
||||
``` |
||||
|
||||
2. 本地开发 |
||||
|
||||
进入项目根目录 |
||||
|
||||
```shell |
||||
npm install |
||||
``` |
||||
|
||||
> 若耗时太长可使用`npm install --registry=https://registry.npm.taobao.org` |
||||
|
||||
```shell |
||||
npm run serve |
||||
``` |
||||
|
||||
> 打开浏览器访问 [http://localhost:8000](http://localhost:8080/) |
||||
|
||||
|
||||
|
||||
## 注意事项 |
||||
|
||||
* 若需使用代码生成,请按照文档描述修改: |
||||
[代码生成前端适配](./docs/gen/) |
||||
|
||||
|
||||
|
||||
## 致谢 |
||||
|
||||
* [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue) 基于SpringBoot,Spring Security,JWT,Vue 的前后端分离权限管理系统 |
||||
* [Ant Design Vue](https://github.com/vueComponent/ant-design-vue/) An enterprise-class UI components based on Ant Design and Vue |
||||
* [Ant Design Vue Pro](https://github.com/vueComponent/ant-design-vue-pro) Use Ant Design Vue like a Pro |
||||
* [vditor](https://github.com/Vanessa219/vditor) 一款浏览器端的 Markdown 编辑 |
||||
|
||||
|
||||
|
||||
## 推荐 |
||||
|
||||
* [RuoYi-Cloud-Ant-Design](https://gitee.com/xuezipeng/ruoyi-cloud-ant-design) RuoYi-Cloud的Ant Design(Antdv)版前端 |
||||
|
||||
* [RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud) 基于Spring Boot、Spring Cloud & Alibaba的分布式微服务架构权限管理系统 |
||||
|
||||
## 联系 |
||||
|
||||
如果您发现了什么bug,或者有什么界面建议或意见, |
||||
|
||||
欢迎 [issue](https://github.com/fuzui/RuoYi-Antdv/issues) |
||||
|
||||
`RuoYi-Antdv(SpringBoot/SpringCloud)`群: |
||||
|
||||
[![加入QQ群](https://img.shields.io/badge/Q群-1038609759-blue.svg)](https://jq.qq.com/?_wv=1027&k=Cq8fZnrj) |
||||
|
||||
如果讨论后端,推荐添加若依前后端分离交流群(官方): |
||||
|
||||
[![加入QQ群](https://img.shields.io/badge/Q群-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) |
||||
|
||||
|
||||
|
||||
## 演示图 |
||||
|
||||
<table> |
||||
<tr> |
||||
<td><img src="https://oss.fuzui.net/img/20210102022024.png"/></td> |
||||
<td><img src="https://oss.fuzui.net/img/20210102022136.png"/></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="https://oss.fuzui.net/img/20210102022247.png"/></td> |
||||
<td><img src="https://oss.fuzui.net/img/20210102022534.png"/></td> |
||||
</tr> |
||||
<tr> |
||||
<td><img src="https://oss.fuzui.net/img/20210102022749.png"/></td> |
||||
<td><img src="https://oss.fuzui.net/img/20210102023153.png"/></td> |
||||
</tr> |
||||
</table> |
||||
|
||||
|
||||
|
@ -0,0 +1,28 @@ |
||||
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) |
||||
|
||||
const plugins = [] |
||||
if (IS_PROD) { |
||||
plugins.push('transform-remove-console') |
||||
} |
||||
|
||||
// lazy load ant-design-vue
|
||||
// if your use import on Demand, Use this code
|
||||
plugins.push(['import', { |
||||
'libraryName': 'ant-design-vue', |
||||
'libraryDirectory': 'es', |
||||
'style': true // `style: true` 会加载 less 文件
|
||||
}]) |
||||
|
||||
module.exports = { |
||||
presets: [ |
||||
'@vue/cli-plugin-babel/preset', |
||||
[ |
||||
'@babel/preset-env', |
||||
{ |
||||
'useBuiltIns': 'entry', |
||||
'corejs': 3 |
||||
} |
||||
] |
||||
], |
||||
plugins |
||||
} |
@ -0,0 +1,49 @@ |
||||
const ThemeColorReplacer = require('webpack-theme-color-replacer') |
||||
const generate = require('@ant-design/colors/lib/generate').default |
||||
|
||||
const getAntdSerials = (color) => { |
||||
// 淡化(即less的tint)
|
||||
const lightens = new Array(9).fill().map((t, i) => { |
||||
return ThemeColorReplacer.varyColor.lighten(color, i / 10) |
||||
}) |
||||
const colorPalettes = generate(color) |
||||
const rgb = ThemeColorReplacer.varyColor.toNum3(color.replace('#', '')).join(',') |
||||
return lightens.concat(colorPalettes).concat(rgb) |
||||
} |
||||
|
||||
const themePluginOption = { |
||||
fileName: 'css/theme-colors-[contenthash:8].css', |
||||
matchColors: getAntdSerials('#1890ff'), // 主色系列
|
||||
// 改变样式选择器,解决样式覆盖问题
|
||||
changeSelector (selector) { |
||||
switch (selector) { |
||||
case '.ant-calendar-today .ant-calendar-date': |
||||
return ':not(.ant-calendar-selected-date):not(.ant-calendar-selected-day)' + selector |
||||
case '.ant-btn:focus,.ant-btn:hover': |
||||
return '.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger)' |
||||
case '.ant-btn.active,.ant-btn:active': |
||||
return '.ant-btn.active:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:active:not(.ant-btn-primary):not(.ant-btn-danger)' |
||||
case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon': |
||||
case '.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon': |
||||
return ':not(.ant-steps-item-process)' + selector |
||||
// fixed https://github.com/vueComponent/ant-design-vue-pro/issues/876
|
||||
case '.ant-steps-item-process .ant-steps-item-icon': |
||||
return ':not(.ant-steps-item-custom)' + selector |
||||
case '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover': |
||||
case '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal > .ant-menu-submenu-selected,.ant-menu-horizontal > .ant-menu-submenu:hover': |
||||
return '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu:hover' |
||||
case '.ant-menu-horizontal > .ant-menu-item-selected > a': |
||||
case '.ant-menu-horizontal>.ant-menu-item-selected>a': |
||||
return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item-selected > a' |
||||
case '.ant-menu-horizontal > .ant-menu-item > a:hover': |
||||
case '.ant-menu-horizontal>.ant-menu-item>a:hover': |
||||
return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item > a:hover' |
||||
default : |
||||
return selector |
||||
} |
||||
} |
||||
} |
||||
|
||||
const createThemeColorReplacerPlugin = () => new ThemeColorReplacer(themePluginOption) |
||||
|
||||
module.exports = createThemeColorReplacerPlugin |
@ -0,0 +1,115 @@ |
||||
export default { |
||||
theme: [ |
||||
{ |
||||
key: 'dark', |
||||
fileName: 'dark.css', |
||||
theme: 'dark' |
||||
}, |
||||
{ |
||||
key: '#F5222D', |
||||
fileName: '#F5222D.css', |
||||
modifyVars: { |
||||
'@primary-color': '#F5222D' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#FA541C', |
||||
fileName: '#FA541C.css', |
||||
modifyVars: { |
||||
'@primary-color': '#FA541C' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#FAAD14', |
||||
fileName: '#FAAD14.css', |
||||
modifyVars: { |
||||
'@primary-color': '#FAAD14' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#13C2C2', |
||||
fileName: '#13C2C2.css', |
||||
modifyVars: { |
||||
'@primary-color': '#13C2C2' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#52C41A', |
||||
fileName: '#52C41A.css', |
||||
modifyVars: { |
||||
'@primary-color': '#52C41A' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#2F54EB', |
||||
fileName: '#2F54EB.css', |
||||
modifyVars: { |
||||
'@primary-color': '#2F54EB' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#722ED1', |
||||
fileName: '#722ED1.css', |
||||
modifyVars: { |
||||
'@primary-color': '#722ED1' |
||||
} |
||||
}, |
||||
|
||||
{ |
||||
key: '#F5222D', |
||||
theme: 'dark', |
||||
fileName: 'dark-#F5222D.css', |
||||
modifyVars: { |
||||
'@primary-color': '#F5222D' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#FA541C', |
||||
theme: 'dark', |
||||
fileName: 'dark-#FA541C.css', |
||||
modifyVars: { |
||||
'@primary-color': '#FA541C' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#FAAD14', |
||||
theme: 'dark', |
||||
fileName: 'dark-#FAAD14.css', |
||||
modifyVars: { |
||||
'@primary-color': '#FAAD14' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#13C2C2', |
||||
theme: 'dark', |
||||
fileName: 'dark-#13C2C2.css', |
||||
modifyVars: { |
||||
'@primary-color': '#13C2C2' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#52C41A', |
||||
theme: 'dark', |
||||
fileName: 'dark-#52C41A.css', |
||||
modifyVars: { |
||||
'@primary-color': '#52C41A' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#2F54EB', |
||||
theme: 'dark', |
||||
fileName: 'dark-#2F54EB.css', |
||||
modifyVars: { |
||||
'@primary-color': '#2F54EB' |
||||
} |
||||
}, |
||||
{ |
||||
key: '#722ED1', |
||||
theme: 'dark', |
||||
fileName: 'dark-#722ED1.css', |
||||
modifyVars: { |
||||
'@primary-color': '#722ED1' |
||||
} |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,24 @@ |
||||
代码生成 |
||||
==== |
||||
|
||||
|
||||
|
||||
## 需求 |
||||
|
||||
> 因代码生成由后端实现,所以若需要使用代码生成功能来生成前端代码的话,需要以下修改。 |
||||
|
||||
|
||||
|
||||
## 实现方案 |
||||
|
||||
1. 将本目录下`antdv`文件夹放入`RuoYi-Vue`中代码生成模块(ruoyi-generator)中`resource`的`vm`文件夹下; |
||||
|
||||
2. 将本目录中`VelocityUtils.java`文件替换掉代码生成模块中`com.ruoyi.generator.util`的`VelocityUtils.java`文件; |
||||
|
||||
3. 重启后台项目,代码生成即由`element-ui`成功改为`ant design vue`。 |
||||
|
||||
|
||||
|
||||
![需替换及新增的位置](https://oss.fuzui.net/img/20210202004013.png) |
||||
|
||||
|
@ -0,0 +1,374 @@ |
||||
package com.ruoyi.generator.util; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.HashSet; |
||||
import java.util.List; |
||||
import org.apache.velocity.VelocityContext; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.ruoyi.common.constant.GenConstants; |
||||
import com.ruoyi.common.utils.DateUtils; |
||||
import com.ruoyi.common.utils.StringUtils; |
||||
import com.ruoyi.generator.domain.GenTable; |
||||
import com.ruoyi.generator.domain.GenTableColumn; |
||||
|
||||
/** |
||||
* 模板处理工具类 |
||||
* |
||||
* @author ruoyi |
||||
*/ |
||||
public class VelocityUtils |
||||
{ |
||||
/** 项目空间路径 */ |
||||
private static final String PROJECT_PATH = "main/java"; |
||||
|
||||
/** mybatis空间路径 */ |
||||
private static final String MYBATIS_PATH = "main/resources/mapper"; |
||||
|
||||
/** 默认上级菜单,系统工具 */ |
||||
private static final String DEFAULT_PARENT_MENU_ID = "3"; |
||||
|
||||
/** |
||||
* 设置模板变量信息 |
||||
* |
||||
* @return 模板列表 |
||||
*/ |
||||
public static VelocityContext prepareContext(GenTable genTable) |
||||
{ |
||||
String moduleName = genTable.getModuleName(); |
||||
String businessName = genTable.getBusinessName(); |
||||
String packageName = genTable.getPackageName(); |
||||
String tplCategory = genTable.getTplCategory(); |
||||
String functionName = genTable.getFunctionName(); |
||||
|
||||
VelocityContext velocityContext = new VelocityContext(); |
||||
velocityContext.put("tplCategory", genTable.getTplCategory()); |
||||
velocityContext.put("tableName", genTable.getTableName()); |
||||
velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】"); |
||||
velocityContext.put("ClassName", genTable.getClassName()); |
||||
velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName())); |
||||
velocityContext.put("moduleName", genTable.getModuleName()); |
||||
velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); |
||||
velocityContext.put("businessName", genTable.getBusinessName()); |
||||
velocityContext.put("basePackage", getPackagePrefix(packageName)); |
||||
velocityContext.put("packageName", packageName); |
||||
velocityContext.put("author", genTable.getFunctionAuthor()); |
||||
velocityContext.put("datetime", DateUtils.getDate()); |
||||
velocityContext.put("pkColumn", genTable.getPkColumn()); |
||||
velocityContext.put("importList", getImportList(genTable)); |
||||
velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); |
||||
velocityContext.put("columns", genTable.getColumns()); |
||||
velocityContext.put("table", genTable); |
||||
setMenuVelocityContext(velocityContext, genTable); |
||||
if (GenConstants.TPL_TREE.equals(tplCategory)) |
||||
{ |
||||
setTreeVelocityContext(velocityContext, genTable); |
||||
} |
||||
if (GenConstants.TPL_SUB.equals(tplCategory)) |
||||
{ |
||||
setSubVelocityContext(velocityContext, genTable); |
||||
} |
||||
return velocityContext; |
||||
} |
||||
|
||||
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable) |
||||
{ |
||||
String options = genTable.getOptions(); |
||||
JSONObject paramsObj = JSONObject.parseObject(options); |
||||
String parentMenuId = getParentMenuId(paramsObj); |
||||
context.put("parentMenuId", parentMenuId); |
||||
} |
||||
|
||||
public static void setTreeVelocityContext(VelocityContext context, GenTable genTable) |
||||
{ |
||||
String options = genTable.getOptions(); |
||||
JSONObject paramsObj = JSONObject.parseObject(options); |
||||
String treeCode = getTreecode(paramsObj); |
||||
String treeParentCode = getTreeParentCode(paramsObj); |
||||
String treeName = getTreeName(paramsObj); |
||||
|
||||
context.put("treeCode", treeCode); |
||||
context.put("treeParentCode", treeParentCode); |
||||
context.put("treeName", treeName); |
||||
context.put("expandColumn", getExpandColumn(genTable)); |
||||
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) |
||||
{ |
||||
context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE)); |
||||
} |
||||
if (paramsObj.containsKey(GenConstants.TREE_NAME)) |
||||
{ |
||||
context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME)); |
||||
} |
||||
} |
||||
|
||||
public static void setSubVelocityContext(VelocityContext context, GenTable genTable) |
||||
{ |
||||
GenTable subTable = genTable.getSubTable(); |
||||
String subTableName = genTable.getSubTableName(); |
||||
String subTableFkName = genTable.getSubTableFkName(); |
||||
String subClassName = genTable.getSubTable().getClassName(); |
||||
String subTableFkClassName = StringUtils.convertToCamelCase(subTableFkName); |
||||
|
||||
context.put("subTable", subTable); |
||||
context.put("subTableName", subTableName); |
||||
context.put("subTableFkName", subTableFkName); |
||||
context.put("subTableFkClassName", subTableFkClassName); |
||||
context.put("subTableFkclassName", StringUtils.uncapitalize(subTableFkClassName)); |
||||
context.put("subClassName", subClassName); |
||||
context.put("subclassName", StringUtils.uncapitalize(subClassName)); |
||||
context.put("subImportList", getImportList(genTable.getSubTable())); |
||||
} |
||||
|
||||
/** |
||||
* 获取模板信息 |
||||
* |
||||
* @return 模板列表 |
||||
*/ |
||||
public static List<String> getTemplateList(String tplCategory) |
||||
{ |
||||
List<String> templates = new ArrayList<String>(); |
||||
templates.add("vm/java/domain.java.vm"); |
||||
templates.add("vm/java/mapper.java.vm"); |
||||
templates.add("vm/java/service.java.vm"); |
||||
templates.add("vm/java/serviceImpl.java.vm"); |
||||
templates.add("vm/java/controller.java.vm"); |
||||
templates.add("vm/xml/mapper.xml.vm"); |
||||
templates.add("vm/sql/sql.vm"); |
||||
templates.add("vm/antdv/js/api.js.vm"); |
||||
if (GenConstants.TPL_CRUD.equals(tplCategory) || GenConstants.TPL_TREE.equals(tplCategory)) |
||||
{ |
||||
templates.add("vm/antdv/index.vue.vm"); |
||||
templates.add("vm/antdv/modules/CreateForm.vue.vm"); |
||||
} |
||||
else if (GenConstants.TPL_SUB.equals(tplCategory)) |
||||
{ |
||||
templates.add("vm/antdv/index.vue.vm"); |
||||
templates.add("vm/antdv/modules/CreateForm.vue.vm"); |
||||
templates.add("vm/antdv/modules/SubTable.vue.vm"); |
||||
templates.add("vm/antdv/modules/CreateSubForm.vue.vm"); |
||||
templates.add("vm/java/sub-domain.java.vm"); |
||||
} |
||||
return templates; |
||||
} |
||||
|
||||
/** |
||||
* 获取文件名 |
||||
*/ |
||||
public static String getFileName(String template, GenTable genTable) |
||||
{ |
||||
// 文件名称
|
||||
String fileName = ""; |
||||
// 包路径
|
||||
String packageName = genTable.getPackageName(); |
||||
// 模块名
|
||||
String moduleName = genTable.getModuleName(); |
||||
// 大写类名
|
||||
String className = genTable.getClassName(); |
||||
// 业务名称
|
||||
String businessName = genTable.getBusinessName(); |
||||
|
||||
String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/"); |
||||
String mybatisPath = MYBATIS_PATH + "/" + moduleName; |
||||
String vuePath = "vue"; |
||||
|
||||
if (template.contains("domain.java.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className); |
||||
} |
||||
if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) |
||||
{ |
||||
fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName()); |
||||
} |
||||
else if (template.contains("mapper.java.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className); |
||||
} |
||||
else if (template.contains("service.java.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className); |
||||
} |
||||
else if (template.contains("serviceImpl.java.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className); |
||||
} |
||||
else if (template.contains("controller.java.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className); |
||||
} |
||||
else if (template.contains("mapper.xml.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className); |
||||
} |
||||
else if (template.contains("sql.vm")) |
||||
{ |
||||
fileName = businessName + "Menu.sql"; |
||||
} |
||||
else if (template.contains("api.js.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName); |
||||
} |
||||
else if (template.contains("index.vue.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); |
||||
} |
||||
else if (template.contains("CreateForm.vue.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/views/{}/{}/modules/CreateForm.vue", vuePath, moduleName, businessName); |
||||
} |
||||
else if (template.contains("index-tree.vue.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName); |
||||
} |
||||
else if (template.contains("SubTable.vue.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/views/{}/{}/modules/SubTable.vue", vuePath, moduleName, businessName); |
||||
} |
||||
else if (template.contains("CreateSubForm.vue.vm")) |
||||
{ |
||||
fileName = StringUtils.format("{}/views/{}/{}/modules/CreateSubForm.vue", vuePath, moduleName, businessName); |
||||
} |
||||
System.out.println(fileName); |
||||
return fileName; |
||||
} |
||||
|
||||
/** |
||||
* 获取包前缀 |
||||
* |
||||
* @param packageName 包名称 |
||||
* @return 包前缀名称 |
||||
*/ |
||||
public static String getPackagePrefix(String packageName) |
||||
{ |
||||
int lastIndex = packageName.lastIndexOf("."); |
||||
String basePackage = StringUtils.substring(packageName, 0, lastIndex); |
||||
return basePackage; |
||||
} |
||||
|
||||
/** |
||||
* 根据列类型获取导入包 |
||||
* |
||||
* @param genTable 业务表对象 |
||||
* @return 返回需要导入的包列表 |
||||
*/ |
||||
public static HashSet<String> getImportList(GenTable genTable) |
||||
{ |
||||
List<GenTableColumn> columns = genTable.getColumns(); |
||||
GenTable subGenTable = genTable.getSubTable(); |
||||
HashSet<String> importList = new HashSet<String>(); |
||||
if (StringUtils.isNotNull(subGenTable)) |
||||
{ |
||||
importList.add("java.util.List"); |
||||
} |
||||
for (GenTableColumn column : columns) |
||||
{ |
||||
if (!column.isSuperColumn() && GenConstants.TYPE_DATE.equals(column.getJavaType())) |
||||
{ |
||||
importList.add("java.util.Date"); |
||||
importList.add("com.fasterxml.jackson.annotation.JsonFormat"); |
||||
} |
||||
else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) |
||||
{ |
||||
importList.add("java.math.BigDecimal"); |
||||
} |
||||
} |
||||
return importList; |
||||
} |
||||
|
||||
/** |
||||
* 获取权限前缀 |
||||
* |
||||
* @param moduleName 模块名称 |
||||
* @param businessName 业务名称 |
||||
* @return 返回权限前缀 |
||||
*/ |
||||
public static String getPermissionPrefix(String moduleName, String businessName) |
||||
{ |
||||
return StringUtils.format("{}:{}", moduleName, businessName); |
||||
} |
||||
|
||||
/** |
||||
* 获取上级菜单ID字段 |
||||
* |
||||
* @param paramsObj 生成其他选项 |
||||
* @return 上级菜单ID字段 |
||||
*/ |
||||
public static String getParentMenuId(JSONObject paramsObj) |
||||
{ |
||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)) |
||||
{ |
||||
return paramsObj.getString(GenConstants.PARENT_MENU_ID); |
||||
} |
||||
return DEFAULT_PARENT_MENU_ID; |
||||
} |
||||
|
||||
/** |
||||
* 获取树编码 |
||||
* |
||||
* @param paramsObj 生成其他选项 |
||||
* @return 树编码 |
||||
*/ |
||||
public static String getTreecode(JSONObject paramsObj) |
||||
{ |
||||
if (paramsObj.containsKey(GenConstants.TREE_CODE)) |
||||
{ |
||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_CODE)); |
||||
} |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
/** |
||||
* 获取树父编码 |
||||
* |
||||
* @param paramsObj 生成其他选项 |
||||
* @return 树父编码 |
||||
*/ |
||||
public static String getTreeParentCode(JSONObject paramsObj) |
||||
{ |
||||
if (paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) |
||||
{ |
||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_PARENT_CODE)); |
||||
} |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
/** |
||||
* 获取树名称 |
||||
* |
||||
* @param paramsObj 生成其他选项 |
||||
* @return 树名称 |
||||
*/ |
||||
public static String getTreeName(JSONObject paramsObj) |
||||
{ |
||||
if (paramsObj.containsKey(GenConstants.TREE_NAME)) |
||||
{ |
||||
return StringUtils.toCamelCase(paramsObj.getString(GenConstants.TREE_NAME)); |
||||
} |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
/** |
||||
* 获取需要在哪一列上面显示展开按钮 |
||||
* |
||||
* @param genTable 业务表对象 |
||||
* @return 展开按钮列序号 |
||||
*/ |
||||
public static int getExpandColumn(GenTable genTable) |
||||
{ |
||||
String options = genTable.getOptions(); |
||||
JSONObject paramsObj = JSONObject.parseObject(options); |
||||
String treeName = paramsObj.getString(GenConstants.TREE_NAME); |
||||
int num = 0; |
||||
for (GenTableColumn column : genTable.getColumns()) |
||||
{ |
||||
if (column.isList()) |
||||
{ |
||||
num++; |
||||
String columnName = column.getColumnName(); |
||||
if (columnName.equals(treeName)) |
||||
{ |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
return num; |
||||
} |
||||
} |
@ -0,0 +1,461 @@ |
||||
<template> |
||||
<page-header-wrapper> |
||||
<a-card :bordered="false"> |
||||
<!-- 条件搜索 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline"> |
||||
<a-row :gutter="48"> |
||||
#set($isInsert=0) |
||||
#set($isEdit=0) |
||||
#set($queryCount=0) |
||||
#set($querySpace="") |
||||
#foreach($column in $columns) |
||||
#if($column.insert) |
||||
#set($isInsert=1) |
||||
#end |
||||
#if($column.edit) |
||||
#set($isEdit=1) |
||||
#end |
||||
#if($column.query) |
||||
#set($queryCount=$queryCount+1) |
||||
#set($dictType=$column.dictType) |
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if($queryCount == 3) |
||||
<template v-if="advanced"> |
||||
#set($querySpace=" ") |
||||
#end |
||||
#if($column.htmlType == "input") |
||||
${querySpace}<a-col :md="8" :sm="24"> |
||||
${querySpace}<a-form-item label="${comment}" prop="${column.javaField}"> |
||||
${querySpace}<a-input v-model="queryParam.${column.javaField}" placeholder="请输入${comment}" allow-clear/> |
||||
${querySpace}</a-form-item> |
||||
${querySpace}</a-col> |
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) |
||||
${querySpace}<a-col :md="8" :sm="24"> |
||||
${querySpace}<a-form-item label="${comment}" prop="${column.javaField}"> |
||||
${querySpace}<a-select placeholder="请选择${comment}" v-model="queryParam.${column.javaField}" style="width: 100%" allow-clear> |
||||
${querySpace}<a-select-option v-for="(d, index) in ${column.javaField}Options" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option> |
||||
${querySpace}</a-select> |
||||
${querySpace}</a-form-item> |
||||
${querySpace}</a-col> |
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) |
||||
${querySpace}<a-col :md="8" :sm="24"> |
||||
${querySpace}<a-form-item label="${comment}" prop="${column.javaField}"> |
||||
${querySpace}<a-select placeholder="请选择${comment}" v-model="queryParam.${column.javaField}" style="width: 100%" allow-clear> |
||||
${querySpace}<a-select-option>请选择字典生成</a-select-option> |
||||
${querySpace}</a-select> |
||||
${querySpace}</a-form-item> |
||||
${querySpace}</a-col> |
||||
#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") |
||||
${querySpace}<a-col :md="8" :sm="24"> |
||||
${querySpace}<a-form-item label="${comment}" prop="${column.javaField}"> |
||||
${querySpace}<a-date-picker style="width: 100%" v-model="queryParam.${column.javaField}" format="YYYY-MM-DD HH:mm:ss" allow-clear/> |
||||
${querySpace}</a-form-item> |
||||
${querySpace}</a-col> |
||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
||||
${querySpace}<a-col :md="8" :sm="24"> |
||||
${querySpace}<a-form-item label="${comment}"> |
||||
${querySpace}<a-range-picker style="width: 100%" v-model="daterange${AttrName}" valueFormat="YYYY-MM-DD" format="YYYY-MM-DD" allow-clear/> |
||||
${querySpace}</a-form-item> |
||||
${querySpace}</a-col> |
||||
#end |
||||
#end |
||||
#end |
||||
#if($queryCount > 2) |
||||
</template> |
||||
#end |
||||
<a-col :md="!advanced && 8 || 24" :sm="24"> |
||||
<span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} "> |
||||
<a-button type="primary" @click="handleQuery"><a-icon type="search" />查询</a-button> |
||||
<a-button style="margin-left: 8px" @click="resetQuery"><a-icon type="redo" />重置</a-button> |
||||
#if($queryCount > 2) |
||||
<a @click="toggleAdvanced" style="margin-left: 8px"> |
||||
{{ advanced ? '收起' : '展开' }} |
||||
<a-icon :type="advanced ? 'up' : 'down'"/> |
||||
</a> |
||||
#end |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 操作 --> |
||||
<div class="table-operations"> |
||||
#if($isInsert == 1) |
||||
<a-button type="primary" @click="$refs.createForm.handleAdd()" v-hasPermi="['${moduleName}:${businessName}:add']"> |
||||
<a-icon type="plus" />新增 |
||||
</a-button> |
||||
#end |
||||
#if($isEdit == 1) |
||||
<a-button type="primary" :disabled="single" @click="$refs.createForm.handleUpdate(undefined, ids)" v-hasPermi="['${moduleName}:${businessName}:edit']"> |
||||
<a-icon type="edit" />修改 |
||||
</a-button> |
||||
#end |
||||
<a-button type="danger" :disabled="multiple" @click="handleDelete" v-hasPermi="['${moduleName}:${businessName}:remove']"> |
||||
<a-icon type="delete" />删除 |
||||
</a-button> |
||||
<a-button type="primary" @click="handleExport" v-hasPermi="['${moduleName}:${businessName}:export']"> |
||||
<a-icon type="download" />导出 |
||||
</a-button> |
||||
<a-button |
||||
type="dashed" |
||||
shape="circle" |
||||
:loading="loading" |
||||
:style="{float: 'right'}" |
||||
icon="reload" |
||||
@click="getList" /> |
||||
</div> |
||||
#if($isInsert == 1 || $isEdit == 1) |
||||
<!-- 增加修改 --> |
||||
<create-form |
||||
ref="createForm" |
||||
#foreach ($column in $columns) |
||||
#if(${column.dictType} != '') |
||||
:${column.javaField}Options="${column.javaField}Options" |
||||
#end |
||||
#end |
||||
#if($tplCategory == 'tree') |
||||
:${businessName}Options="${businessName}Options" |
||||
@select-tree="getTreeselect" |
||||
#end |
||||
@ok="getList" |
||||
/> |
||||
#end |
||||
<!-- 数据展示 --> |
||||
<a-table |
||||
:loading="loading" |
||||
:size="tableSize" |
||||
rowKey="${pkColumn.javaField}" |
||||
:columns="columns" |
||||
:data-source="list" |
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
||||
:pagination="false"> |
||||
#foreach($column in $columns) |
||||
#set($javaField=$column.javaField) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if($column.list && $column.htmlType == "datetime") |
||||
<span slot="${javaField}" slot-scope="text, record"> |
||||
{{ parseTime(record.${javaField}) }} |
||||
</span> |
||||
#elseif($column.list && "" != $column.dictType) |
||||
<span slot="${javaField}" slot-scope="text, record"> |
||||
{{ ${javaField}Format(record) }} |
||||
</span> |
||||
#end |
||||
#end |
||||
<span slot="operation" slot-scope="text, record"> |
||||
#if($isEdit == 1) |
||||
<a-divider type="vertical" v-hasPermi="['${moduleName}:${businessName}:edit']" /> |
||||
<a @click="$refs.createForm.handleUpdate(record, undefined)" v-hasPermi="['${moduleName}:${businessName}:edit']"> |
||||
<a-icon type="edit" />修改 |
||||
</a> |
||||
#end |
||||
#if($tplCategory == 'tree' && ($isInsert == 1 || $isEdit == 1)) |
||||
<a-divider type="vertical" v-hasPermi="['${moduleName}:${businessName}:add']" /> |
||||
<a @click="$refs.createForm.handleAdd(record)" v-hasPermi="['${moduleName}:${businessName}:add']"> |
||||
<a-icon type="plus" />新增 |
||||
</a> |
||||
#end |
||||
<a-divider type="vertical" v-hasPermi="['${moduleName}:${businessName}:remove']" /> |
||||
<a @click="handleDelete(record)" v-hasPermi="['${moduleName}:${businessName}:remove']"> |
||||
<a-icon type="delete" />删除 |
||||
</a> |
||||
</span> |
||||
</a-table> |
||||
#if($tplCategory != 'tree') |
||||
<!-- 分页 --> |
||||
<a-pagination |
||||
class="ant-table-pagination" |
||||
show-size-changer |
||||
show-quick-jumper |
||||
:current="queryParam.pageNum" |
||||
:total="total" |
||||
:page-size="queryParam.pageSize" |
||||
:showTotal="total => `共 ${total} 条`" |
||||
@showSizeChange="onShowSizeChange" |
||||
@change="changeSize" |
||||
/> |
||||
#end |
||||
</a-card> |
||||
</page-header-wrapper> |
||||
</template> |
||||
|
||||
<script> |
||||
import { list${BusinessName}, del${BusinessName}, export${BusinessName} } from '@/api/${moduleName}/${businessName}' |
||||
import CreateForm from './modules/CreateForm' |
||||
|
||||
export default { |
||||
name: '${BusinessName}', |
||||
components: { |
||||
#if($isInsert == 1 || $isEdit == 1) |
||||
CreateForm |
||||
#end |
||||
}, |
||||
data () { |
||||
return { |
||||
list: [], |
||||
selectedRowKeys: [], |
||||
selectedRows: [], |
||||
// 高级搜索 展开/关闭 |
||||
advanced: false, |
||||
// 非单个禁用 |
||||
single: true, |
||||
// 非多个禁用 |
||||
multiple: true, |
||||
ids: [], |
||||
loading: false, |
||||
total: 0, |
||||
#if($tplCategory == 'tree' && ($isInsert == 1 || $isEdit == 1)) |
||||
${businessName}Options: [], |
||||
#end |
||||
#foreach ($column in $columns) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if(${column.dictType} != '') |
||||
// $comment字典 |
||||
${column.javaField}Options: [], |
||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
||||
// $comment时间范围 |
||||
daterange${AttrName}: [], |
||||
#end |
||||
#end |
||||
// 查询参数 |
||||
queryParam: { |
||||
#foreach ($column in $columns) |
||||
#if($column.query) |
||||
$column.javaField: null, |
||||
#end |
||||
#end |
||||
pageNum: 1, |
||||
pageSize: 10 |
||||
}, |
||||
columns: [ |
||||
#foreach($column in $columns) |
||||
#set($javaField=$column.javaField) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if($column.pk) |
||||
{ |
||||
title: '${comment}', |
||||
dataIndex: '${javaField}', |
||||
ellipsis: true, |
||||
align: 'center' |
||||
}, |
||||
#elseif($column.list && $column.htmlType == "datetime" || $column.list && "" != $column.dictType || $column.list && "" != $column.dictType) |
||||
{ |
||||
title: '${comment}', |
||||
dataIndex: '${javaField}', |
||||
scopedSlots: { customRender: '${javaField}' }, |
||||
ellipsis: true, |
||||
align: 'center' |
||||
}, |
||||
#elseif($column.list && "" != $javaField) |
||||
{ |
||||
title: '${comment}', |
||||
dataIndex: '${javaField}', |
||||
ellipsis: true, |
||||
align: 'center' |
||||
}, |
||||
#end |
||||
#end |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'operation', |
||||
width: '18%', |
||||
scopedSlots: { customRender: 'operation' }, |
||||
align: 'center' |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
filters: { |
||||
}, |
||||
created () { |
||||
this.getList() |
||||
#foreach ($column in $columns) |
||||
#if(${column.dictType} != '') |
||||
this.getDicts('${column.dictType}').then(response => { |
||||
this.${column.javaField}Options = response.data |
||||
}) |
||||
#end |
||||
#end |
||||
}, |
||||
computed: { |
||||
}, |
||||
watch: { |
||||
}, |
||||
methods: { |
||||
/** 查询${functionName}列表 */ |
||||
getList () { |
||||
this.loading = true |
||||
#foreach ($column in $columns) |
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
||||
this.queryParam.params = {} |
||||
#break |
||||
#end |
||||
#end |
||||
#foreach ($column in $columns) |
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
||||
if (this.daterange${AttrName} !== null && this.daterange${AttrName} !== '' && this.daterange${AttrName}.length !== 0) { |
||||
this.queryParam.params['begin${AttrName}'] = this.daterange${AttrName}[0] |
||||
this.queryParam.params['end${AttrName}'] = this.daterange${AttrName}[1] |
||||
} |
||||
#end |
||||
#end |
||||
list${BusinessName}(this.queryParam).then(response => { |
||||
#if($tplCategory == 'tree' && ($isInsert == 1 || $isEdit == 1)) |
||||
this.list = this.handleTree(response.data, '${treeCode}', '${treeParentCode}') |
||||
#else |
||||
this.list = response.rows |
||||
#end |
||||
this.total = response.total |
||||
this.loading = false |
||||
}) |
||||
}, |
||||
#foreach ($column in $columns) |
||||
#if(${column.dictType} != '') |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
// $comment字典翻译 |
||||
${column.javaField}Format (row, column) { |
||||
#if($column.htmlType == "checkbox") |
||||
if (row.${column.javaField} === null || row.${column.javaField} === undefined) { |
||||
return null |
||||
} |
||||
#end |
||||
return this.selectDictLabel#if($column.htmlType == "checkbox")s#end(this.${column.javaField}Options, row.${column.javaField}) |
||||
}, |
||||
#end |
||||
#end |
||||
/** 搜索按钮操作 */ |
||||
handleQuery () { |
||||
this.queryParam.pageNum = 1 |
||||
this.getList() |
||||
}, |
||||
/** 重置按钮操作 */ |
||||
resetQuery () { |
||||
#foreach ($column in $columns) |
||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
||||
this.daterange${AttrName} = [] |
||||
#end |
||||
#end |
||||
this.queryParam = { |
||||
#foreach($column in $columns) |
||||
#if($column.query) |
||||
#set($dictType=$column.dictType) |
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if(!($column.htmlType == "datetime" && $column.queryType == "BETWEEN")) |
||||
${column.javaField}: undefined, |
||||
#end |
||||
#end |
||||
#end |
||||
pageNum: 1, |
||||
pageSize: 10 |
||||
} |
||||
this.handleQuery() |
||||
}, |
||||
onShowSizeChange (current, pageSize) { |
||||
this.queryParam.pageSize = pageSize |
||||
this.getList() |
||||
}, |
||||
changeSize (current, pageSize) { |
||||
this.queryParam.pageNum = current |
||||
this.queryParam.pageSize = pageSize |
||||
this.getList() |
||||
}, |
||||
onSelectChange (selectedRowKeys, selectedRows) { |
||||
this.selectedRowKeys = selectedRowKeys |
||||
this.selectedRows = selectedRows |
||||
this.ids = this.selectedRows.map(item => item.${pkColumn.javaField}) |
||||
this.single = selectedRowKeys.length !== 1 |
||||
this.multiple = !selectedRowKeys.length |
||||
}, |
||||
toggleAdvanced () { |
||||
this.advanced = !this.advanced |
||||
}, |
||||
#if($tplCategory == 'tree' && ($isInsert == 1 || $isEdit == 1)) |
||||
/** 查询菜单下拉树结构 */ |
||||
getTreeselect () { |
||||
list${BusinessName}().then(response => { |
||||
this.${businessName}Options = [] |
||||
const data = { ${treeCode}: 0, ${treeName}: '主目录', children: [] } |
||||
data.children = this.handleTree(response.data, '${treeCode}', '${treeParentCode}') |
||||
this.${businessName}Options.push(data) |
||||
}) |
||||
}, |
||||
#end |
||||
/** 删除按钮操作 */ |
||||
handleDelete (row) { |
||||
var that = this |
||||
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids |
||||
this.$confirm({ |
||||
title: '确认删除所选中数据?', |
||||
content: '当前选中编号为' + ${pkColumn.javaField}s + '的数据', |
||||
onOk () { |
||||
return del${BusinessName}(${pkColumn.javaField}s) |
||||
.then(() => { |
||||
that.onSelectChange([], []) |
||||
that.getList() |
||||
that.$message.success( |
||||
'删除成功', |
||||
3 |
||||
) |
||||
}) |
||||
}, |
||||
onCancel () {} |
||||
}) |
||||
}, |
||||
/** 导出按钮操作 */ |
||||
handleExport () { |
||||
var that = this |
||||
this.$confirm({ |
||||
title: '是否确认导出?', |
||||
content: '此操作将导出当前条件下所有数据而非选中数据', |
||||
onOk () { |
||||
return export${BusinessName}(that.queryParam) |
||||
.then(response => { |
||||
that.download(response.msg) |
||||
that.$message.success( |
||||
'导出成功', |
||||
3 |
||||
) |
||||
}) |
||||
}, |
||||
onCancel () {} |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,53 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询${functionName}列表 |
||||
export function list${BusinessName} (query) { |
||||
return request({ |
||||
url: '/${moduleName}/${businessName}/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询${functionName}详细 |
||||
export function get${BusinessName} (${pkColumn.javaField}) { |
||||
return request({ |
||||
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增${functionName} |
||||
export function add${BusinessName} (data) { |
||||
return request({ |
||||
url: '/${moduleName}/${businessName}', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改${functionName} |
||||
export function update${BusinessName} (data) { |
||||
return request({ |
||||
url: '/${moduleName}/${businessName}', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除${functionName} |
||||
export function del${BusinessName} (${pkColumn.javaField}) { |
||||
return request({ |
||||
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出${functionName} |
||||
export function export${BusinessName} (query) { |
||||
return request({ |
||||
url: '/${moduleName}/${businessName}/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,428 @@ |
||||
#set($isInsert=0) |
||||
#set($isEdit=0) |
||||
#set($hasRichText=0) |
||||
#foreach($column in $columns) |
||||
#if($column.insert) |
||||
#set($isInsert=1) |
||||
#end |
||||
#if($column.edit) |
||||
#set($isEdit=1) |
||||
#end |
||||
#if($isInsert == 1 && $isEdit == 1) |
||||
#break |
||||
#end |
||||
#end |
||||
#if($isInsert == 0 && $isEdit == 0) |
||||
<template> |
||||
<a-result title="多余文件,请删除"> |
||||
<template #icon> |
||||
<a-icon type="smile" theme="twoTone" /> |
||||
</template> |
||||
<template #extra> |
||||
<a-button type="primary" @click="returnIndex"> |
||||
返回首页 |
||||
</a-button> |
||||
</template> |
||||
</a-result> |
||||
</template> |
||||
|
||||
#stop |
||||
#end |
||||
<template> |
||||
<a-drawer width="35%" :label-col="4" :wrapper-col="14" :visible="open" @close="onClose"> |
||||
<a-divider orientation="left"> |
||||
<b>{{ formTitle }}</b> |
||||
</a-divider> |
||||
<a-form-model ref="form" :model="form" :rules="rules"> |
||||
#set($requiredCount = 0) |
||||
#set($ruleLastIndex = 0) |
||||
#foreach($column in $columns) |
||||
#if(${column.dictType} != '') |
||||
#set($ruleLastIndex = $velocityCount) |
||||
#end |
||||
#set($field=$column.javaField) |
||||
#if(($column.insert || $column.edit) && !$column.pk) |
||||
#if(($column.usableColumn) || (!$column.superColumn)) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if($column.required) |
||||
#set($requiredCount = $requiredCount + 1) |
||||
#end |
||||
#set($dictType=$column.dictType) |
||||
<a-form-model-item label="${comment}" prop="${field}" #if($column.insert && !$column.edit)v-if="formType === 1"#end#if(!$column.insert && $column.edit)v-if="formType === 2"#end> |
||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode) |
||||
<a-tree-select |
||||
v-model="form.${field}" |
||||
style="width: 100%" |
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" |
||||
:tree-data="${businessName}Options" |
||||
placeholder="请选择" |
||||
:replaceFields="{children:'children', title:'${treeName}', key:'${treeCode}', value: '${treeCode}' }" |
||||
tree-default-expand-all |
||||
> |
||||
</a-tree-select> |
||||
#elseif($column.htmlType == "input") |
||||
<a-input v-model="form.${field}" placeholder="请输入${comment}" /> |
||||
#elseif($column.htmlType == "imageUpload") |
||||
<file-upload v-model="form.${field}" type="image"></file-upload> |
||||
#elseif($column.htmlType == "fileUpload") |
||||
<file-upload v-model="form.${field}" type="file"></file-upload> |
||||
#elseif($column.htmlType == "editor") |
||||
#set($hasRichText=1) |
||||
<div id="${field}" name="${field}" ></div> |
||||
#elseif($column.htmlType == "select" && "" != $dictType) |
||||
<a-select placeholder="请选择${comment}" v-model="form.${field}"> |
||||
<a-select-option v-for="(d, index) in ${field}Options" :key="index" :value="d.dictValue" >{{ d.dictLabel }}</a-select-option> |
||||
</a-select> |
||||
#elseif($column.htmlType == "select" && $dictType) |
||||
<a-select placeholder="请选择${comment}" v-model="form.${field}"> |
||||
<a-select-option value="" >请选择字典生成</a-select-option> |
||||
</a-select> |
||||
#elseif($column.htmlType == "checkbox" && "" != $dictType) |
||||
<a-select |
||||
mode="multiple" |
||||
v-model="form.${field}" |
||||
placeholder="请选择${comment}" |
||||
> |
||||
<a-select-option v-for="(d, index) in ${field}Options" :key="index" :value="d.dictValue" >{{ d.dictLabel }}</a-select-option> |
||||
</a-select> |
||||
#elseif($column.htmlType == "checkbox" && $dictType) |
||||
<a-select placeholder="请选择${comment}" v-model="form.${field}"> |
||||
<a-select-option value="" >请选择字典生成</a-select-option> |
||||
</a-select> |
||||
#elseif($column.htmlType == "radio" && "" != $dictType) |
||||
<a-radio-group v-model="form.${field}" button-style="solid"> |
||||
<a-radio-button v-for="(d, index) in ${field}Options" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-radio-button> |
||||
</a-radio-group> |
||||
#elseif($column.htmlType == "radio" && $dictType) |
||||
<a-radio-group v-model="form.${field}" button-style="solid"> |
||||
<a-radio-button value="">请选择字典生成</a-radio-button> |
||||
</a-radio-group> |
||||
#elseif($column.htmlType == "datetime") |
||||
<a-date-picker style="width: 100%" v-model="form.${field}" format="YYYY-MM-DD HH:mm:ss" allow-clear/> |
||||
#elseif($column.htmlType == "textarea") |
||||
<a-input v-model="form.${field}" placeholder="请输入内容" type="textarea" allow-clear /> |
||||
#end |
||||
</a-form-model-item> |
||||
#end |
||||
#end |
||||
#end |
||||
#if($table.sub) |
||||
<a-divider orientation="left"> |
||||
<b>${subTable.functionName}</b> |
||||
</a-divider> |
||||
<sub-table ref="subTable" :list="subList" @add="handleAdd${subclassName}" @delete="handleDelete${subclassName}" /> |
||||
<p>当前存在 {{ subList.length }} 条信息</p> |
||||
<a-button type="dashed" @click="$refs.subTable.show()"> |
||||
详情 |
||||
</a-button> |
||||
<br> |
||||
#end |
||||
<div class="bottom-control"> |
||||
<a-space> |
||||
<a-button type="primary" @click="submitForm"> |
||||
保存 |
||||
</a-button> |
||||
<a-button type="dashed" @click="cancel"> |
||||
取消 |
||||
</a-button> |
||||
</a-space> |
||||
</div> |
||||
</a-form-model> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
import { get${BusinessName}, add${BusinessName}, update${BusinessName} } from '@/api/${moduleName}/${businessName}' |
||||
#if($table.sub) |
||||
import SubTable from './SubTable' |
||||
#end |
||||
#if($hasRichText == 1) |
||||
import Vditor from 'vditor' |
||||
import 'vditor/dist/index.css' |
||||
#end |
||||
|
||||
export default { |
||||
name: 'CreateForm', |
||||
props: { |
||||
#set($propsCount = 0) |
||||
#foreach ($column in $columns) |
||||
#if(${column.dictType} != '') |
||||
#set($propsCount = 1) |
||||
${column.javaField}Options: { |
||||
type: Array, |
||||
required: true |
||||
#if($velocityCount!=$ruleLastIndex || $tplCategory == 'tree') |
||||
}, |
||||
#else |
||||
} |
||||
#end |
||||
#end |
||||
#end |
||||
#if($tplCategory == 'tree') |
||||
${businessName}Options: { |
||||
type: Array, |
||||
required: true |
||||
} |
||||
#end |
||||
}, |
||||
components: { |
||||
#if($table.sub) |
||||
SubTable |
||||
#end |
||||
}, |
||||
data () { |
||||
return { |
||||
loading: false, |
||||
#if($table.sub) |
||||
subList: [], |
||||
#end |
||||
formTitle: '', |
||||
#foreach ($column in $columns) |
||||
#if($column.insert || $column.edit) |
||||
#if($column.htmlType == "editor") |
||||
${column.javaField}Editor: '', |
||||
#end |
||||
#end |
||||
#end |
||||
// 表单参数 |
||||
form: { |
||||
#foreach ($column in $columns) |
||||
#if($column.insert || $column.edit) |
||||
#if($column.htmlType == "radio") |
||||
$column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else'0'#end#if($velocityCount != $columns.size()),#end |
||||
#elseif($column.htmlType == "checkbox") |
||||
$column.javaField: []#if($velocityCount != $columns.size()),#end |
||||
#else |
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end |
||||
#end |
||||
|
||||
#end |
||||
#end |
||||
}, |
||||
// 1增加,2修改 |
||||
formType: 1, |
||||
open: false, |
||||
rules: { |
||||
#set($currentRequiredCount = 1) |
||||
#foreach ($column in $columns) |
||||
#if(($column.insert || $column.edit) && !$column.pk) |
||||
#if(($column.usableColumn) || (!$column.superColumn)) |
||||
#if($column.required) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
$column.javaField: [ |
||||
{ required: true, message: '$comment不能为空', trigger: #if($column.htmlType == "select")'change'#else'blur'#end } |
||||
]#if($currentRequiredCount != $requiredCount),#end |
||||
|
||||
#set($currentRequiredCount = $currentRequiredCount + 1) |
||||
#end |
||||
#end |
||||
#end |
||||
#end |
||||
} |
||||
} |
||||
}, |
||||
filters: { |
||||
}, |
||||
created () { |
||||
}, |
||||
computed: { |
||||
}, |
||||
watch: { |
||||
}, |
||||
mounted () { |
||||
}, |
||||
methods: { |
||||
#if($hasRichText == 1) |
||||
openEditor () { |
||||
#foreach ($column in $columns) |
||||
#if($column.insert || $column.edit) |
||||
#if($column.htmlType == "editor") |
||||
this.$nextTick(() => { |
||||
this.${column.javaField}Editor = new Vditor('${column.javaField}', { |
||||
height: 360, |
||||
toolbarConfig: { |
||||
pin: true |
||||
}, |
||||
cache: { |
||||
enable: false |
||||
}, |
||||
after: () => { |
||||
let content = this.form.${column.javaField} |
||||
if (content === undefined || content === null) { |
||||
content = '' |
||||
} |
||||
this.${column.javaField}Editor.setValue(content) |
||||
} |
||||
}) |
||||
}) |
||||
#end |
||||
#end |
||||
#end |
||||
}, |
||||
closeEditor () { |
||||
this.noticeContentEditor.destroy() |
||||
}, |
||||
#end |
||||
onClose () { |
||||
this.open = false |
||||
#if($table.sub) |
||||
this.subList = [] |
||||
#end |
||||
#if($hasRichText == 1) |
||||
this.closeEditor() |
||||
#end |
||||
}, |
||||
// 取消按钮 |
||||
cancel () { |
||||
this.open = false |
||||
this.reset() |
||||
#if($table.sub) |
||||
this.subList = [] |
||||
#end |
||||
#if($hasRichText == 1) |
||||
this.closeEditor() |
||||
#end |
||||
}, |
||||
// 表单重置 |
||||
reset () { |
||||
this.formType = 1 |
||||
this.form = { |
||||
#foreach ($column in $columns) |
||||
#if($column.insert || $column.edit) |
||||
#if($column.htmlType == "radio") |
||||
$column.javaField: #if($column.javaType == "Integer" || $column.javaType == "Long")0#else'0'#end#if($velocityCount != $columns.size()),#end |
||||
#elseif($column.htmlType == "checkbox") |
||||
$column.javaField: []#if($velocityCount != $columns.size()),#end |
||||
#else |
||||
$column.javaField: null#if($velocityCount != $columns.size()),#end |
||||
#end |
||||
|
||||
#end |
||||
#end |
||||
} |
||||
}, |
||||
/** 新增按钮操作 */ |
||||
handleAdd (row) { |
||||
this.reset() |
||||
#if($tplCategory == 'tree') |
||||
this.$emit('select-tree') |
||||
if (row != null && row.${treeCode}) { |
||||
this.form.${treeParentCode} = row.${treeCode} |
||||
} else { |
||||
this.form.${treeParentCode} = 0 |
||||
} |
||||
#end |
||||
this.formType = 1 |
||||
this.open = true |
||||
#if($hasRichText == 1) |
||||
this.openEditor() |
||||
#end |
||||
this.formTitle = '添加' |
||||
}, |
||||
#if($table.sub) |
||||
/** 新增子项操作 */ |
||||
handleAdd${subclassName} (row) { |
||||
this.subList.push(row) |
||||
}, |
||||
/** 删除子项操作 */ |
||||
handleDelete${subclassName} (index, indexs) { |
||||
if (index !== undefined) { |
||||
this.subList.splice(index, 1) |
||||
return |
||||
} |
||||
indexs.forEach(item => { |
||||
this.subList.splice(item, 1) |
||||
}) |
||||
}, |
||||
#end |
||||
/** 修改按钮操作 */ |
||||
handleUpdate (row, ids) { |
||||
this.reset() |
||||
#if($tplCategory == 'tree') |
||||
this.$emit('select-tree') |
||||
#end |
||||
this.formType = 2 |
||||
const ${pkColumn.javaField} = row ? row.${pkColumn.javaField} : ids |
||||
get${BusinessName}(${pkColumn.javaField}).then(response => { |
||||
this.form = response.data |
||||
#if($table.sub) |
||||
this.subList = response.data.${subclassName}List |
||||
#end |
||||
#foreach ($column in $columns) |
||||
#if($column.htmlType == "checkbox") |
||||
if (this.form.$column.javaField !== null) { |
||||
this.form.$column.javaField = this.form.${column.javaField}.split(',') |
||||
} else { |
||||
this.form.$column.javaField = undefined |
||||
} |
||||
#end |
||||
#end |
||||
this.open = true |
||||
this.formTitle = '修改' |
||||
#if($hasRichText == 1) |
||||
this.openEditor() |
||||
#end |
||||
}) |
||||
}, |
||||
/** 提交按钮 */ |
||||
submitForm: function () { |
||||
#foreach ($column in $columns) |
||||
#if($column.insert || $column.edit) |
||||
#if($column.htmlType == "editor") |
||||
this.form.${column.javaField} = this.${column.javaField}Editor.getValue() |
||||
#end |
||||
#end |
||||
#end |
||||
this.#[[$]]#refs.form.validate(valid => { |
||||
if (valid) { |
||||
#foreach ($column in $columns) |
||||
#if($column.htmlType == "checkbox") |
||||
this.form.$column.javaField = this.form.${column.javaField}.join(',') |
||||
#end |
||||
#end |
||||
#if($table.sub) |
||||
this.form.${subclassName}List = this.subList |
||||
#end |
||||
if (this.form.${pkColumn.javaField} !== undefined && this.form.${pkColumn.javaField} !== null) { |
||||
update${BusinessName}(this.form).then(response => { |
||||
this.$message.success( |
||||
'修改成功', |
||||
3 |
||||
) |
||||
this.open = false |
||||
#if($hasRichText == 1) |
||||
this.closeEditor() |
||||
#end |
||||
this.$emit('ok') |
||||
}) |
||||
} else { |
||||
add${BusinessName}(this.form).then(response => { |
||||
this.$message.success( |
||||
'新增成功', |
||||
3 |
||||
) |
||||
this.open = false |
||||
#if($hasRichText == 1) |
||||
this.closeEditor() |
||||
#end |
||||
this.$emit('ok') |
||||
}) |
||||
} |
||||
} else { |
||||
return false |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,106 @@ |
||||
<template> |
||||
<!-- 增加修改 --> |
||||
<a-drawer width="35%" :label-col="4" :wrapper-col="14" :visible="open" @close="onClose"> |
||||
<a-divider orientation="left"> |
||||
<b>${subTable.functionName}</b> |
||||
</a-divider> |
||||
<a-form-model ref="form" :model="form"> |
||||
#set($columnLastIndex = 0) |
||||
#foreach($column in $subTable.columns) |
||||
#set($javaField=$column.javaField) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if($column.pk || $javaField == ${subTableFkclassName}) |
||||
#elseif($column.list && "" != $javaField) |
||||
#set($columnLastIndex = $velocityCount) |
||||
<a-form-model-item label="${comment}" prop="${javaField}"> |
||||
<a-input v-model="form.${javaField}" placeholder="请输入" /> |
||||
</a-form-model-item> |
||||
#end |
||||
#end |
||||
<div class="bottom-control"> |
||||
<a-space> |
||||
<a-button type="primary" @click="submitForm"> |
||||
保存 |
||||
</a-button> |
||||
<a-button type="dashed" @click="cancel"> |
||||
取消 |
||||
</a-button> |
||||
</a-space> |
||||
</div> |
||||
</a-form-model> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
export default { |
||||
name: 'CreateSubForm', |
||||
props: { |
||||
}, |
||||
components: { |
||||
}, |
||||
data () { |
||||
return { |
||||
formTitle: '增加', |
||||
// 表单参数 |
||||
form: { |
||||
#foreach($column in $subTable.columns) |
||||
#set($javaField=$column.javaField) |
||||
#if($column.pk || $javaField == ${subTableFkclassName}) |
||||
#elseif($column.list && "" != $javaField) |
||||
${$javaField}: undefined#if($columnLastIndex != $velocityCount),#end |
||||
|
||||
#end |
||||
#end |
||||
}, |
||||
open: false |
||||
} |
||||
}, |
||||
filters: { |
||||
}, |
||||
created () { |
||||
}, |
||||
computed: { |
||||
}, |
||||
watch: { |
||||
}, |
||||
methods: { |
||||
onClose () { |
||||
this.open = false |
||||
}, |
||||
// 取消按钮 |
||||
cancel () { |
||||
this.open = false |
||||
this.reset() |
||||
}, |
||||
// 表单重置 |
||||
reset () { |
||||
this.form = { |
||||
#foreach($column in $subTable.columns) |
||||
#set($javaField=$column.javaField) |
||||
#if($column.pk || $javaField == ${subTableFkclassName}) |
||||
#elseif($column.list && "" != $javaField) |
||||
${$javaField}: undefined#if($columnLastIndex != $velocityCount),#end |
||||
|
||||
#end |
||||
#end |
||||
} |
||||
}, |
||||
/** 新增按钮操作 */ |
||||
handleAdd () { |
||||
this.open = true |
||||
this.reset() |
||||
}, |
||||
/** 提交按钮 */ |
||||
submitForm: function () { |
||||
this.$emit('add', this.form) |
||||
this.open = false |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,152 @@ |
||||
<template> |
||||
<a-modal |
||||
ref="subTableModel" |
||||
:title="'${subTable.functionName}'" |
||||
width="80%" |
||||
:visible="visible" |
||||
@cancel="close" |
||||
> |
||||
<template slot="footer"> |
||||
<a-button type="dashed" @click="close"> |
||||
关闭 |
||||
</a-button> |
||||
</template> |
||||
<a-card :bordered="false"> |
||||
<!-- 操作 --> |
||||
<div class="table-operations"> |
||||
<a-button type="primary" @click="$refs.createSubForm.handleAdd()"> |
||||
<a-icon type="plus" />新增 |
||||
</a-button> |
||||
<a-button type="danger" :disabled="multiple" @click="handleDelete"> |
||||
<a-icon type="delete" />删除 |
||||
</a-button> |
||||
</div> |
||||
<!-- 增加修改 --> |
||||
<create-sub-form |
||||
ref="createSubForm" |
||||
@add="handleAdd${subClassName}" |
||||
/> |
||||
<!-- 数据展示 --> |
||||
<a-table |
||||
:loading="loading" |
||||
:size="tableSize" |
||||
rowKey="${subTableFkclassName}" |
||||
:columns="columns" |
||||
:data-source="list" |
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
||||
:pagination="false"> |
||||
<span slot="operation" slot-scope="text, record"> |
||||
<a-divider type="vertical" /> |
||||
<a @click="handleDelete(record)"> |
||||
<a-icon type="delete" />删除 |
||||
</a> |
||||
</span> |
||||
</a-table> |
||||
</a-card> |
||||
</a-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
import CreateSubForm from './CreateSubForm' |
||||
|
||||
export default { |
||||
name: 'SubTable', |
||||
components: { |
||||
CreateSubForm |
||||
}, |
||||
props: { |
||||
list: { |
||||
type: Array, |
||||
required: true |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
visible: false, |
||||
selectedRowKeys: [], |
||||
selectedRows: [], |
||||
// 高级搜索 展开/关闭 |
||||
advanced: false, |
||||
// 非单个禁用 |
||||
single: true, |
||||
// 非多个禁用 |
||||
multiple: true, |
||||
ids: [], |
||||
loading: false, |
||||
columns: [ |
||||
#foreach($column in $subTable.columns) |
||||
#set($javaField=$column.javaField) |
||||
#set($parentheseIndex=$column.columnComment.indexOf("(")) |
||||
#if($parentheseIndex != -1) |
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
||||
#else |
||||
#set($comment=$column.columnComment) |
||||
#end |
||||
#if($column.pk || $javaField == ${subTableFkclassName}) |
||||
#elseif($column.list && "" != $javaField) |
||||
{ |
||||
title: '${comment}', |
||||
dataIndex: '${javaField}', |
||||
ellipsis: true, |
||||
align: 'center' |
||||
}, |
||||
#end |
||||
#end |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'operation', |
||||
width: '18%', |
||||
scopedSlots: { customRender: 'operation' }, |
||||
align: 'center' |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
filters: { |
||||
}, |
||||
created () { |
||||
}, |
||||
computed: { |
||||
}, |
||||
watch: { |
||||
}, |
||||
methods: { |
||||
// 关闭模态框 |
||||
close () { |
||||
this.visible = false |
||||
this.selectedRowKeys = [] |
||||
this.selectedRows = [] |
||||
}, |
||||
// 打开抽屉(由外面的组件调用) |
||||
show () { |
||||
this.visible = true |
||||
}, |
||||
onSelectChange (selectedRowKeys, selectedRows) { |
||||
this.selectedRowKeys = selectedRowKeys |
||||
this.selectedRows = selectedRows |
||||
this.ids = selectedRowKeys.map(item => item - 1) |
||||
this.single = selectedRowKeys.length !== 1 |
||||
this.multiple = !selectedRowKeys.length |
||||
}, |
||||
/** 删除按钮操作 */ |
||||
handleDelete (row) { |
||||
var that = this |
||||
if (row) { |
||||
var index = (this.list || []).findIndex((item) => item === row) |
||||
} |
||||
const ids = index !== undefined ? index : this.ids |
||||
this.$confirm({ |
||||
title: '确认删除所选中数据?', |
||||
content: '当前选中序号为' + ids + '的数据', |
||||
onOk () { |
||||
that.$emit('delete', index, ids) |
||||
}, |
||||
onCancel () {} |
||||
}) |
||||
}, |
||||
handleAdd${subClassName} (row) { |
||||
this.$emit('add', row) |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,40 @@ |
||||
先增加依赖 |
||||
|
||||
```bash |
||||
// npm |
||||
$ npm install --save-dev webpack-bundle-analyzer |
||||
|
||||
// or yarn |
||||
$ yarn add webpack-bundle-analyzer -D |
||||
``` |
||||
|
||||
配置文件 `vue.config.js` 增加 `configureWebpack.plugins` 参数 |
||||
|
||||
``` |
||||
const path = require('path') |
||||
const webpack = require('webpack') |
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin |
||||
|
||||
function resolve (dir) { |
||||
return path.join(__dirname, dir) |
||||
} |
||||
|
||||
// vue.config.js |
||||
module.exports = { |
||||
configureWebpack: { |
||||
plugins: [ |
||||
// Ignore all locale files of moment.js |
||||
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), |
||||
// 依赖大小分析工具 |
||||
new BundleAnalyzerPlugin(), |
||||
] |
||||
}, |
||||
|
||||
|
||||
... |
||||
} |
||||
``` |
||||
|
||||
|
||||
|
||||
启动 `cli` 的 `build` 命令进行项目编译,编译完成时,会自动运行一个 http://localhost:8888 的地址,完整显示了支持库依赖 |
@ -0,0 +1,23 @@ |
||||
module.exports = { |
||||
moduleFileExtensions: [ |
||||
'js', |
||||
'jsx', |
||||
'json', |
||||
'vue' |
||||
], |
||||
transform: { |
||||
'^.+\\.vue$': 'vue-jest', |
||||
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', |
||||
'^.+\\.jsx?$': 'babel-jest' |
||||
}, |
||||
moduleNameMapper: { |
||||
'^@/(.*)$': '<rootDir>/src/$1' |
||||
}, |
||||
snapshotSerializers: [ |
||||
'jest-serializer-vue' |
||||
], |
||||
testMatch: [ |
||||
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' |
||||
], |
||||
testURL: 'http://localhost/' |
||||
} |
@ -0,0 +1,11 @@ |
||||
{ |
||||
"compilerOptions": { |
||||
"target": "es6", |
||||
"baseUrl": ".", |
||||
"paths": { |
||||
"@/*": ["src/*"] |
||||
} |
||||
}, |
||||
"exclude": ["node_modules", "dist"], |
||||
"include": ["src/**/*"] |
||||
} |
@ -0,0 +1,66 @@ |
||||
{ |
||||
"name": "vue-antd-pro", |
||||
"version": "3.0.0", |
||||
"private": true, |
||||
"scripts": { |
||||
"serve": "vue-cli-service serve", |
||||
"build": "vue-cli-service build", |
||||
"test:unit": "vue-cli-service test:unit", |
||||
"lint": "vue-cli-service lint", |
||||
"build:preview": "vue-cli-service build --mode preview", |
||||
"lint:nofix": "vue-cli-service lint --no-fix" |
||||
}, |
||||
"dependencies": { |
||||
"ant-design-vue": "^1.7.2", |
||||
"axios": "^0.19.0", |
||||
"core-js": "^3.1.2", |
||||
"echarts": "^5.0.0", |
||||
"enquire.js": "^2.1.6", |
||||
"highlight.js": "^10.5.0", |
||||
"lodash.clonedeep": "^4.5.0", |
||||
"lodash.get": "^4.4.2", |
||||
"lodash.pick": "^4.4.0", |
||||
"md5": "^2.2.1", |
||||
"mockjs2": "1.0.8", |
||||
"moment": "^2.24.0", |
||||
"nprogress": "^0.2.0", |
||||
"screenfull": "^5.1.0", |
||||
"store": "^2.0.12", |
||||
"vditor": "^3.7.3", |
||||
"vue": "^2.6.12", |
||||
"vue-clipboard2": "^0.2.1", |
||||
"vue-container-query": "^0.1.0", |
||||
"vue-copy-to-clipboard": "^1.0.3", |
||||
"vue-cropper": "0.4.9", |
||||
"vue-i18n": "^8.17.4", |
||||
"vue-router": "^3.1.2", |
||||
"vue-svg-component-runtime": "^1.0.1", |
||||
"vuex": "^3.1.1" |
||||
}, |
||||
"devDependencies": { |
||||
"@ant-design/colors": "^3.2.1", |
||||
"@vue/cli-plugin-babel": "^4.0.4", |
||||
"@vue/cli-plugin-eslint": "^4.0.4", |
||||
"@vue/cli-plugin-router": "^4.0.4", |
||||
"@vue/cli-plugin-unit-jest": "^4.0.4", |
||||
"@vue/cli-plugin-vuex": "^4.0.4", |
||||
"@vue/cli-service": "^4.0.4", |
||||
"@vue/eslint-config-standard": "^4.0.0", |
||||
"@vue/test-utils": "^1.0.0-beta.29", |
||||
"babel-eslint": "^10.0.1", |
||||
"babel-plugin-import": "^1.12.2", |
||||
"babel-plugin-transform-remove-console": "^6.9.4", |
||||
"compression-webpack-plugin": "^5.0.1", |
||||
"eslint": "^5.16.0", |
||||
"eslint-plugin-html": "^5.0.0", |
||||
"eslint-plugin-vue": "^5.2.3", |
||||
"git-revision-webpack-plugin": "^3.0.6", |
||||
"less": "^3.0.4", |
||||
"less-loader": "^5.0.0", |
||||
"opencollective": "^1.0.3", |
||||
"opencollective-postinstall": "^2.0.2", |
||||
"vue-svg-icon-loader": "^2.1.1", |
||||
"vue-template-compiler": "^2.6.12", |
||||
"webpack-theme-color-replacer": "^1.3.12" |
||||
} |
||||
} |
@ -0,0 +1,5 @@ |
||||
module.exports = { |
||||
plugins: { |
||||
autoprefixer: {} |
||||
} |
||||
} |
@ -0,0 +1,33 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="zh-cmn-Hans"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> |
||||
<link rel="icon" href="<%= BASE_URL %>logo.png"> |
||||
<title>算力云后台管理系统</title> |
||||
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style> |
||||
<!-- require cdn assets css --> |
||||
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> |
||||
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" /> |
||||
<% } %> |
||||
</head> |
||||
<body> |
||||
<noscript> |
||||
<strong>请启用JavaScript后再使用算力云后台管理系统</strong> |
||||
</noscript> |
||||
<div id="app"> |
||||
<div class="first-loading-wrp"> |
||||
<h3>算力云</h3> |
||||
<div class="loading-wrp"> |
||||
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<!-- require cdn assets js --> |
||||
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> |
||||
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> |
||||
<% } %> |
||||
<!-- built files will be auto injected --> |
||||
</body> |
||||
</html> |
After Width: | Height: | Size: 4.5 KiB |
@ -0,0 +1,28 @@ |
||||
<template> |
||||
<a-config-provider :locale="locale"> |
||||
<div id="app"> |
||||
<router-view/> |
||||
</div> |
||||
</a-config-provider> |
||||
</template> |
||||
|
||||
<script> |
||||
import { domTitle, setDocumentTitle } from '@/utils/domUtil' |
||||
import { i18nRender } from '@/locales' |
||||
|
||||
export default { |
||||
data () { |
||||
return { |
||||
} |
||||
}, |
||||
computed: { |
||||
locale () { |
||||
// 只是为了切换语言时,更新标题 |
||||
const { title } = this.$route.meta |
||||
title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`)) |
||||
|
||||
return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,39 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
create: '/swipe/create', |
||||
list: '/swipe/list', |
||||
delete: '/swipe/delete' |
||||
} |
||||
export default api |
||||
|
||||
export function createAd (parameter) { |
||||
console.log('createAd') |
||||
return request({ |
||||
url: api.create, |
||||
headers: { |
||||
'Content-Type': 'application/json;charset=UTF-8' |
||||
}, |
||||
method: 'post', |
||||
data: parameter |
||||
}) |
||||
} |
||||
|
||||
export function getAdList (parameters) { |
||||
console.log('getAdList') |
||||
return request({ |
||||
url: api.list, |
||||
method: 'get', |
||||
params: parameters |
||||
}) |
||||
} |
||||
|
||||
export function deleteAd (parameter) { |
||||
console.log('deleteAd') |
||||
return request({ |
||||
url: api.delete, |
||||
method: 'post', |
||||
params: parameter |
||||
|
||||
}) |
||||
} |
@ -0,0 +1,66 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
coinList: '/coin/list', |
||||
coinAddressList: '/address/list', |
||||
coinAddressDelete: '/address/delete', |
||||
coinPackageUnit: '/coin/package/unit/list', |
||||
coinPackageCreate: '/coin/package/create', |
||||
coinPackageList: '/coin/package/list', |
||||
coinPackageDelete: '/coin/package/delete' |
||||
|
||||
} |
||||
export default api |
||||
|
||||
export function getCoinList () { |
||||
console.log('getCoinList') |
||||
return request({ |
||||
url: api.coinList, |
||||
headers: { |
||||
'Content-Type': 'application/json;charset=UTF-8' |
||||
}, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function getCoinAddressList () { |
||||
console.log('getCoinAddressList') |
||||
return request({ |
||||
url: api.coinAddressList, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function getCoinPackageUnit () { |
||||
console.log('loadData.getCoinPackageUnit') |
||||
return request({ |
||||
url: api.coinPackageUnit, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function onCoinPackageCreate (params) { |
||||
console.log('loadData.coinPackageCreate') |
||||
return request({ |
||||
url: api.coinPackageCreate, |
||||
method: 'post', |
||||
data: params |
||||
}) |
||||
} |
||||
|
||||
export function deleteCoinPackage (params) { |
||||
console.log('loadData.coinPackageDelete') |
||||
return request({ |
||||
url: api.coinPackageDelete, |
||||
method: 'post', |
||||
data: params |
||||
}) |
||||
} |
||||
|
||||
export function onCoinPackageList () { |
||||
console.log('loadData.onCoinPackageList') |
||||
return request({ |
||||
url: api.coinPackageList, |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,16 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
upload: '/app/uploadImg' |
||||
} |
||||
export default api |
||||
|
||||
export function Upload () { |
||||
console.log('loadData.getCoinList.parameter') |
||||
return request({ |
||||
url: api.upload, |
||||
method: 'post' |
||||
}) |
||||
} |
||||
|
||||
export const uploadUrl = api.upload |
@ -0,0 +1,14 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
dashboard: '/console/dashboard' |
||||
} |
||||
export default api |
||||
|
||||
export function getDashboard() { |
||||
console.log('loadData.getDashboard') |
||||
return request({ |
||||
url: api.dashboard, |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,35 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
list: '/order/list', |
||||
updateOrderPayPrice: '/order/updatePayPrice', |
||||
confirmPayment: '/order/confirmPayment' |
||||
} |
||||
export default api |
||||
|
||||
export function getOrderList(parameters) { |
||||
console.log('getAdList') |
||||
return request({ |
||||
url: api.list, |
||||
method: 'get', |
||||
params: parameters |
||||
}) |
||||
} |
||||
|
||||
export function onOrderConfirmPayment(parameters) { |
||||
console.log('confirmPayment') |
||||
return request({ |
||||
url: api.confirmPayment, |
||||
method: 'post', |
||||
data: parameters |
||||
}) |
||||
} |
||||
|
||||
export function onUpdateOrderPayPrice(parameters) { |
||||
console.log('updateOrderPayPrice') |
||||
return request({ |
||||
url: api.updateOrderPayPrice, |
||||
method: 'post', |
||||
data: parameters |
||||
}) |
||||
} |
@ -0,0 +1,15 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
list: '/wallet/payment/list' |
||||
} |
||||
export default api |
||||
|
||||
export function getPaymentRecordList(parameters) { |
||||
console.log('getPaymentRecordList') |
||||
return request({ |
||||
url: api.list, |
||||
method: 'get', |
||||
params: parameters |
||||
}) |
||||
} |
@ -0,0 +1,49 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const userApi = { |
||||
Login: '/login', |
||||
Logout: '/logout', |
||||
// get my info
|
||||
UserInfo: '/getInfo' |
||||
} |
||||
|
||||
/** |
||||
* login func |
||||
* @param parameter |
||||
* @returns {*} |
||||
*/ |
||||
export function login (parameter) { |
||||
return request({ |
||||
url: userApi.Login, |
||||
method: 'post', |
||||
data: parameter |
||||
}) |
||||
} |
||||
|
||||
export function getInfo () { |
||||
return request({ |
||||
url: userApi.UserInfo, |
||||
method: 'get', |
||||
headers: { |
||||
'Content-Type': 'application/json;charset=UTF-8' |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export function logout () { |
||||
return request({ |
||||
url: userApi.Logout, |
||||
method: 'delete', |
||||
headers: { |
||||
'Content-Type': 'application/json;charset=UTF-8' |
||||
} |
||||
}) |
||||
} |
||||
|
||||
// 获取验证码
|
||||
export function getCodeImg () { |
||||
return request({ |
||||
url: '/captchaImage', |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,70 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
user: '/user', |
||||
role: '/role', |
||||
service: '/service', |
||||
permission: '/permission', |
||||
permissionNoPager: '/permission/no-pager', |
||||
orgTree: '/org/tree' |
||||
} |
||||
|
||||
export default api |
||||
|
||||
export function getUserList (parameter) { |
||||
return request({ |
||||
url: api.user, |
||||
method: 'get', |
||||
params: parameter |
||||
}) |
||||
} |
||||
|
||||
export function getRoleList (parameter) { |
||||
return request({ |
||||
url: api.role, |
||||
method: 'get', |
||||
params: parameter |
||||
}) |
||||
} |
||||
|
||||
export function getServiceList (parameter) { |
||||
return request({ |
||||
url: api.service, |
||||
method: 'get', |
||||
params: parameter |
||||
}) |
||||
} |
||||
|
||||
export function getPermissions (parameter) { |
||||
return request({ |
||||
url: api.permissionNoPager, |
||||
method: 'get', |
||||
params: parameter |
||||
}) |
||||
} |
||||
|
||||
export function getOrgTree (parameter) { |
||||
return request({ |
||||
url: api.orgTree, |
||||
method: 'get', |
||||
params: parameter |
||||
}) |
||||
} |
||||
|
||||
// id == 0 add post
|
||||
// id != 0 update put
|
||||
export function saveService (parameter) { |
||||
return request({ |
||||
url: api.service, |
||||
method: parameter.id === 0 ? 'post' : 'put', |
||||
data: parameter |
||||
}) |
||||
} |
||||
|
||||
export function saveSub (sub) { |
||||
return request({ |
||||
url: '/sub', |
||||
method: sub.id === 0 ? 'post' : 'put', |
||||
data: sub |
||||
}) |
||||
} |
@ -0,0 +1,58 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
const api = { |
||||
userList: '/member/list', |
||||
register: '/member/register', |
||||
updateStatus: '/member/updateStatus', |
||||
memberDelete: '/member/delete', |
||||
orgTree: '/org/tree' |
||||
} |
||||
export default api |
||||
|
||||
export function getUserList (parameters) { |
||||
console.log('loadData.getUserList.parameter', parameters) |
||||
return request({ |
||||
url: api.userList, |
||||
method: 'get', |
||||
params: parameters |
||||
}) |
||||
} |
||||
|
||||
export function createUser (parameters) { |
||||
console.log('createUser', parameters) |
||||
return request({ |
||||
url: api.register, |
||||
headers: { |
||||
'Content-Type': 'application/json;charset=UTF-8' |
||||
}, |
||||
method: 'post', |
||||
data: parameters, |
||||
params: parameters |
||||
}) |
||||
} |
||||
|
||||
export function updateUser (parameters) { |
||||
console.log('createUser', parameters) |
||||
return request({ |
||||
url: api.updateStatus, |
||||
headers: { |
||||
'Content-Type': 'application/json;charset=UTF-8' |
||||
}, |
||||
method: 'post', |
||||
data: parameters, |
||||
params: parameters |
||||
}) |
||||
} |
||||
|
||||
export function onMemberDelete (parameters) { |
||||
console.log('createUser', parameters) |
||||
return request({ |
||||
url: api.memberDelete, |
||||
headers: { |
||||
'Content-Type': 'application/json;charset=UTF-8' |
||||
}, |
||||
method: 'post', |
||||
data: parameters, |
||||
params: parameters |
||||
}) |
||||
} |
@ -0,0 +1,9 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 获取路由
|
||||
export const getRouters = () => { |
||||
return request({ |
||||
url: '/getRouters', |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,9 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询缓存详细
|
||||
export function getCache () { |
||||
return request({ |
||||
url: '/monitor/cache', |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,35 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询登录日志列表
|
||||
export function list (query) { |
||||
return request({ |
||||
url: '/monitor/logininfor/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 删除登录日志
|
||||
export function delLogininfor (infoId) { |
||||
return request({ |
||||
url: '/monitor/logininfor/' + infoId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 清空登录日志
|
||||
export function cleanLogininfor () { |
||||
return request({ |
||||
url: '/monitor/logininfor/clean', |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出登录日志
|
||||
export function exportLogininfor (query) { |
||||
return request({ |
||||
url: '/monitor/logininfor/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,18 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询在线用户列表
|
||||
export function list (query) { |
||||
return request({ |
||||
url: '/monitor/online/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 强退用户
|
||||
export function forceLogout (tokenId) { |
||||
return request({ |
||||
url: '/monitor/online/' + tokenId, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,35 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询操作日志列表
|
||||
export function list (query) { |
||||
return request({ |
||||
url: '/monitor/operlog/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 删除操作日志
|
||||
export function delOperlog (operId) { |
||||
return request({ |
||||
url: '/monitor/operlog/' + operId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 清空操作日志
|
||||
export function cleanOperlog () { |
||||
return request({ |
||||
url: '/monitor/operlog/clean', |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出操作日志
|
||||
export function exportOperlog (query) { |
||||
return request({ |
||||
url: '/monitor/operlog/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,9 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询服务器详细
|
||||
export function getServer () { |
||||
return request({ |
||||
url: '/monitor/server', |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,69 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询参数列表
|
||||
export function listConfig (query) { |
||||
return request({ |
||||
url: '/system/config/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询参数详细
|
||||
export function getConfig (configId) { |
||||
return request({ |
||||
url: '/system/config/' + configId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 根据参数键名查询参数值
|
||||
export function getConfigKey (configKey) { |
||||
return request({ |
||||
url: '/system/config/configKey/' + configKey, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增参数配置
|
||||
export function addConfig (data) { |
||||
return request({ |
||||
url: '/system/config', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改参数配置
|
||||
export function updateConfig (data) { |
||||
return request({ |
||||
url: '/system/config', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除参数配置
|
||||
export function delConfig (configId) { |
||||
return request({ |
||||
url: '/system/config/' + configId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 清理参数缓存
|
||||
export function clearCache () { |
||||
return request({ |
||||
url: '/system/config/clearCache', |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出参数
|
||||
export function exportConfig (query) { |
||||
return request({ |
||||
url: '/system/config/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,68 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询部门列表
|
||||
export function listDept (query) { |
||||
return request({ |
||||
url: '/system/dept/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询部门列表(排除节点)
|
||||
export function listDeptExcludeChild (deptId) { |
||||
return request({ |
||||
url: '/system/dept/list/exclude/' + deptId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 查询部门详细
|
||||
export function getDept (deptId) { |
||||
return request({ |
||||
url: '/system/dept/' + deptId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 查询部门下拉树结构
|
||||
export function treeselect () { |
||||
return request({ |
||||
url: '/system/dept/treeselect', |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 根据角色ID查询部门树结构
|
||||
export function roleDeptTreeselect (roleId) { |
||||
return request({ |
||||
url: '/system/dept/roleDeptTreeselect/' + roleId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增部门
|
||||
export function addDept (data) { |
||||
return request({ |
||||
url: '/system/dept', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改部门
|
||||
export function updateDept (data) { |
||||
return request({ |
||||
url: '/system/dept', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除部门
|
||||
export function delDept (deptId) { |
||||
return request({ |
||||
url: '/system/dept/' + deptId, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,61 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询字典数据列表
|
||||
export function listData (query) { |
||||
return request({ |
||||
url: '/system/dict/data/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询字典数据详细
|
||||
export function getData (dictCode) { |
||||
return request({ |
||||
url: '/system/dict/data/' + dictCode, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getDicts (dictType) { |
||||
return request({ |
||||
url: '/system/dict/data/type/' + dictType, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增字典数据
|
||||
export function addData (data) { |
||||
return request({ |
||||
url: '/system/dict/data', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改字典数据
|
||||
export function updateData (data) { |
||||
return request({ |
||||
url: '/system/dict/data', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除字典数据
|
||||
export function delData (dictCode) { |
||||
return request({ |
||||
url: '/system/dict/data/' + dictCode, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出字典数据
|
||||
export function exportData (query) { |
||||
return request({ |
||||
url: '/system/dict/data/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,69 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询字典类型列表
|
||||
export function listType (query) { |
||||
return request({ |
||||
url: '/system/dict/type/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询字典类型详细
|
||||
export function getType (dictId) { |
||||
return request({ |
||||
url: '/system/dict/type/' + dictId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增字典类型
|
||||
export function addType (data) { |
||||
return request({ |
||||
url: '/system/dict/type', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改字典类型
|
||||
export function updateType (data) { |
||||
return request({ |
||||
url: '/system/dict/type', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除字典类型
|
||||
export function delType (dictId) { |
||||
return request({ |
||||
url: '/system/dict/type/' + dictId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 清理参数缓存
|
||||
export function clearCache () { |
||||
return request({ |
||||
url: '/system/dict/type/clearCache', |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出字典类型
|
||||
export function exportType (query) { |
||||
return request({ |
||||
url: '/system/dict/type/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 获取字典选择框列表
|
||||
export function optionselect () { |
||||
return request({ |
||||
url: '/system/dict/type/optionselect', |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,60 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询菜单列表
|
||||
export function listMenu (query) { |
||||
return request({ |
||||
url: '/system/menu/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询菜单详细
|
||||
export function getMenu (menuId) { |
||||
return request({ |
||||
url: '/system/menu/' + menuId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 查询菜单下拉树结构
|
||||
export function treeselect () { |
||||
return request({ |
||||
url: '/system/menu/treeselect', |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 根据角色ID查询菜单下拉树结构
|
||||
export function roleMenuTreeselect (roleId) { |
||||
return request({ |
||||
url: '/system/menu/roleMenuTreeselect/' + roleId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增菜单
|
||||
export function addMenu (data) { |
||||
return request({ |
||||
url: '/system/menu', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改菜单
|
||||
export function updateMenu (data) { |
||||
return request({ |
||||
url: '/system/menu', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除菜单
|
||||
export function delMenu (menuId) { |
||||
return request({ |
||||
url: '/system/menu/' + menuId, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,44 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询公告列表
|
||||
export function listNotice (query) { |
||||
return request({ |
||||
url: '/system/notice/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询公告详细
|
||||
export function getNotice (noticeId) { |
||||
return request({ |
||||
url: '/system/notice/' + noticeId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增公告
|
||||
export function addNotice (data) { |
||||
return request({ |
||||
url: '/system/notice', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改公告
|
||||
export function updateNotice (data) { |
||||
return request({ |
||||
url: '/system/notice', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除公告
|
||||
export function delNotice (noticeId) { |
||||
return request({ |
||||
url: '/system/notice/' + noticeId, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,53 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询岗位列表
|
||||
export function listPost (query) { |
||||
return request({ |
||||
url: '/system/post/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询岗位详细
|
||||
export function getPost (postId) { |
||||
return request({ |
||||
url: '/system/post/' + postId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增岗位
|
||||
export function addPost (data) { |
||||
return request({ |
||||
url: '/system/post', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改岗位
|
||||
export function updatePost (data) { |
||||
return request({ |
||||
url: '/system/post', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除岗位
|
||||
export function delPost (postId) { |
||||
return request({ |
||||
url: '/system/post/' + postId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出岗位
|
||||
export function exportPost (query) { |
||||
return request({ |
||||
url: '/system/post/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,75 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询角色列表
|
||||
export function listRole (query) { |
||||
return request({ |
||||
url: '/system/role/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询角色详细
|
||||
export function getRole (roleId) { |
||||
return request({ |
||||
url: '/system/role/' + roleId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增角色
|
||||
export function addRole (data) { |
||||
return request({ |
||||
url: '/system/role', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改角色
|
||||
export function updateRole (data) { |
||||
return request({ |
||||
url: '/system/role', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 角色数据权限
|
||||
export function dataScope (data) { |
||||
return request({ |
||||
url: '/system/role/dataScope', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 角色状态修改
|
||||
export function changeRoleStatus (roleId, status) { |
||||
const data = { |
||||
roleId, |
||||
status |
||||
} |
||||
return request({ |
||||
url: '/system/role/changeStatus', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除角色
|
||||
export function delRole (roleId) { |
||||
return request({ |
||||
url: '/system/role/' + roleId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出角色
|
||||
export function exportRole (query) { |
||||
return request({ |
||||
url: '/system/role/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,127 @@ |
||||
import request from '@/utils/request' |
||||
import { praseStrEmpty } from '@/utils/ruoyi' |
||||
|
||||
// 查询用户列表
|
||||
export function listUser (query) { |
||||
return request({ |
||||
url: '/system/user/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询用户详细
|
||||
export function getUser (userId) { |
||||
return request({ |
||||
url: '/system/user/' + praseStrEmpty(userId), |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 新增用户
|
||||
export function addUser (data) { |
||||
return request({ |
||||
url: '/system/user', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 修改用户
|
||||
export function updateUser (data) { |
||||
return request({ |
||||
url: '/system/user', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 删除用户
|
||||
export function delUser (userId) { |
||||
return request({ |
||||
url: '/system/user/' + userId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 导出用户
|
||||
export function exportUser (query) { |
||||
return request({ |
||||
url: '/system/user/export', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 用户密码重置
|
||||
export function resetUserPwd (userId, password) { |
||||
const data = { |
||||
userId, |
||||
password |
||||
} |
||||
return request({ |
||||
url: '/system/user/resetPwd', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 用户状态修改
|
||||
export function changeUserStatus (userId, status) { |
||||
const data = { |
||||
userId, |
||||
status |
||||
} |
||||
return request({ |
||||
url: '/system/user/changeStatus', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile () { |
||||
return request({ |
||||
url: '/system/user/profile', |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile (data) { |
||||
return request({ |
||||
url: '/system/user/profile', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd (oldPassword, newPassword) { |
||||
const data = { |
||||
oldPassword, |
||||
newPassword |
||||
} |
||||
return request({ |
||||
url: '/system/user/profile/updatePwd', |
||||
method: 'put', |
||||
params: data |
||||
}) |
||||
} |
||||
|
||||
// 用户头像上传
|
||||
export function uploadAvatar (data) { |
||||
return request({ |
||||
url: '/system/user/profile/avatar', |
||||
method: 'post', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 下载用户导入模板
|
||||
export function importTemplate () { |
||||
return request({ |
||||
url: '/system/user/importTemplate', |
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,76 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
// 查询生成表数据
|
||||
export function listTable (query) { |
||||
return request({ |
||||
url: '/tool/gen/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
// 查询db数据库列表
|
||||
export function listDbTable (query) { |
||||
return request({ |
||||
url: '/tool/gen/db/list', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
// 查询表详细信息
|
||||
export function getGenTable (tableId) { |
||||
return request({ |
||||
url: '/tool/gen/' + tableId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 修改代码生成信息
|
||||
export function updateGenTable (data) { |
||||
return request({ |
||||
url: '/tool/gen', |
||||
method: 'put', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 导入表
|
||||
export function importTable (data) { |
||||
return request({ |
||||
url: '/tool/gen/importTable', |
||||
method: 'post', |
||||
params: data |
||||
}) |
||||
} |
||||
|
||||
// 预览生成代码
|
||||
export function previewTable (tableId) { |
||||
return request({ |
||||
url: '/tool/gen/preview/' + tableId, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 删除表数据
|
||||
export function delTable (tableId) { |
||||
return request({ |
||||
url: '/tool/gen/' + tableId, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
// 生成代码(自定义路径)
|
||||
export function genCode (tableName) { |
||||
return request({ |
||||
url: '/tool/gen/genCode/' + tableName, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
// 同步数据库
|
||||
export function synchDb (tableName) { |
||||
return request({ |
||||
url: '/tool/gen/synchDb/' + tableName, |
||||
method: 'get' |
||||
}) |
||||
} |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 954 B |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 719 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 717 B |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 972 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 724 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 806 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 883 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 873 B |
After Width: | Height: | Size: 1.3 KiB |