diff --git a/README.md b/README.md
index 0d89a8a3..715fbfeb 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
Jeecg-Boot 快速开发平台(前后端分离版本)
===============
-当前最新版本: 2.1.3(发布日期:20191226)
+当前最新版本: 2.1.4(发布日期:2020-02-24)
[](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
@@ -43,7 +43,7 @@ Jeecg-Boot快速开发平台,可以应用在任何J2EE项目的开发中,尤
- 技术官网: [http://www.jeecg.com](http://www.jeecg.com)
-- 开发文档: [http://doc.jeecg.com/1273753](http://doc.jeecg.com/1273753)
+- 开发文档: [http://doc.jeecg.com](http://doc.jeecg.com/1273753)
- 视频教程 :[JeecgBoot入门系列视频](https://space.bilibili.com/454617261/channel/detail?cid=84186)
@@ -67,7 +67,7 @@ Jeecg-Boot快速开发平台,可以应用在任何J2EE项目的开发中,尤
为什么选择JEECG-BOOT?
-----------------------------------
-* 1.采用最新主流前后分离框架(Springboot2+Mybatis+antd),容易上手; 代码生成器依赖性低,灵活的扩展能力,可灵活实现二次开发;
+* 1.采用最新主流前后分离框架(Springboot+Mybatis+antd),容易上手; 代码生成器依赖性低,灵活的扩展能力,可灵活实现二次开发;
* 2.开发效率很高,采用代码生成器,单表数据模型和一对多(父子表)数据模型,增删改查功能自动生成,菜单配置直接使用;
* 3.代码生成器提供强大模板机制,支持自定义模板风格。目前提供四套风格模板(单表两套、一对多两套)
* 4.封装完善的用户、角色、菜单、组织机构、数据字典、在线定时任务等基础功能,支持访问授权、按钮权限、数据权限等功能
diff --git a/ant-design-vue-jeecg/README.md b/ant-design-vue-jeecg/README.md
index 64a1c066..82fa55ed 100644
--- a/ant-design-vue-jeecg/README.md
+++ b/ant-design-vue-jeecg/README.md
@@ -1,7 +1,7 @@
Ant Design Jeecg Vue
====
-当前最新版本: 2.1.3(发布日期:20191226)
+当前最新版本: 2.1.4(发布日期:2020-02-24)
Overview
----
diff --git a/ant-design-vue-jeecg/package.json b/ant-design-vue-jeecg/package.json
index 26e2d650..92a4afe3 100644
--- a/ant-design-vue-jeecg/package.json
+++ b/ant-design-vue-jeecg/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-antd-jeecg",
- "version": "2.1.3",
+ "version": "2.1.4",
"private": true,
"scripts": {
"pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ",
@@ -10,7 +10,7 @@
},
"dependencies": {
"@antv/data-set": "^0.10.2",
- "@jeecg/antd-online-re": "2.1.3",
+ "@jeecg/antd-online-214": "^2.1.4",
"@tinymce/tinymce-vue": "^2.0.0",
"ant-design-vue": "^1.4.0",
"apexcharts": "^3.6.5",
@@ -24,7 +24,7 @@
"lodash.pick": "^4.4.0",
"md5": "^2.2.1",
"nprogress": "^0.2.0",
- "tinymce": "^5.0.2",
+ "tinymce": "^5.1.4",
"viser-vue": "^2.4.4",
"vue": "^2.6.10",
"vue-apexcharts": "^1.3.2",
@@ -51,12 +51,12 @@
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.1.0",
+ "html-webpack-plugin": "^4.0.0-beta.11",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"node-sass": "^4.11.0",
"sass-loader": "^7.0.1",
- "vue-template-compiler": "^2.6.10",
- "html-webpack-plugin": "^4.0.0-beta.11"
+ "vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
diff --git a/ant-design-vue-jeecg/public/index.html b/ant-design-vue-jeecg/public/index.html
index 532145fd..8982a460 100644
--- a/ant-design-vue-jeecg/public/index.html
+++ b/ant-design-vue-jeecg/public/index.html
@@ -5,9 +5,9 @@
-
Jeecg-Boot 快速开发平台
+ Jeecg-Boot 企业级快速开发平台
-
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/components/jeecg/JImportModal.vue b/ant-design-vue-jeecg/src/components/jeecg/JImportModal.vue
index 50df1c4d..d69f5964 100644
--- a/ant-design-vue-jeecg/src/components/jeecg/JImportModal.vue
+++ b/ant-design-vue-jeecg/src/components/jeecg/JImportModal.vue
@@ -42,6 +42,11 @@
type: String,
default: '',
required: false
+ },
+ biz:{
+ type: String,
+ default: '',
+ required: false
}
},
data(){
@@ -49,7 +54,8 @@
visible:false,
uploading:false,
fileList:[],
- uploadAction:''
+ uploadAction:'',
+ foreignKeys:''
}
},
watch: {
@@ -67,10 +73,11 @@
handleClose(){
this.visible=false
},
- show(){
+ show(arg){
this.fileList = []
this.uploading = false
this.visible = true
+ this.foreignKeys = arg;
},
handleRemove(file) {
const index = this.fileList.indexOf(file);
@@ -85,6 +92,12 @@
handleImport() {
const { fileList } = this;
const formData = new FormData();
+ if(this.biz){
+ formData.append('isSingleTableImport',this.biz);
+ }
+ if(this.foreignKeys && this.foreignKeys.length>0){
+ formData.append('foreignKeys',this.foreignKeys);
+ }
fileList.forEach((file) => {
formData.append('files[]', file);
});
diff --git a/ant-design-vue-jeecg/src/components/jeecg/JModal/index.vue b/ant-design-vue-jeecg/src/components/jeecg/JModal/index.vue
new file mode 100644
index 00000000..b982131d
--- /dev/null
+++ b/ant-design-vue-jeecg/src/components/jeecg/JModal/index.vue
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/components/jeecg/JSuperQuery.vue b/ant-design-vue-jeecg/src/components/jeecg/JSuperQuery.vue
index 71610c1d..31066fec 100644
--- a/ant-design-vue-jeecg/src/components/jeecg/JSuperQuery.vue
+++ b/ant-design-vue-jeecg/src/components/jeecg/JSuperQuery.vue
@@ -1,15 +1,22 @@
-
-
-
-
- 高级查询
-
-
- 高级查询
-
+
+
+
+
+ 已有高级查询条件生效
+
+ 清空
+
+
+
+ 高级查询
+
+
+ 高级查询
+
+
+ :disabled="disabled"
+ :returnUrl="returnUrl">
{{ text }}
@@ -19,6 +20,7 @@
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
+ import { getFileAccessHttpUrl } from '@/api/manage';
const FILE_TYPE_ALL = "all"
const FILE_TYPE_IMG = "image"
@@ -38,9 +40,10 @@
data(){
return {
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
- urlDownload:window._CONFIG['domianURL'] + "/sys/common/download/",
+ urlDownload:window._CONFIG['staticDomainURL'],
headers:{},
- fileList: []
+ fileList: [],
+ newFileList: [],
}
},
props:{
@@ -77,11 +80,25 @@
required: false,
default: false
},
+ /**
+ * update -- author:lvdandan -- date:20190219 -- for:Jupload组件增加是否返回url,
+ * true:仅返回url
+ * false:返回fileName filePath fileSize
+ */
+ returnUrl:{
+ type:Boolean,
+ required:false,
+ default: true
+ },
},
watch:{
value(val){
if (val instanceof Array) {
- this.initFileList(val.join(','))
+ if(this.returnUrl){
+ this.initFileList(val.join(','))
+ }else{
+ this.initFileListArr(val);
+ }
} else {
this.initFileList(val)
}
@@ -93,6 +110,26 @@
},
methods:{
+ initFileListArr(val){
+ if(!val || val.length==0){
+ this.fileList = [];
+ return;
+ }
+ let fileList = [];
+ for(var a=0;a {
if (file.response) {
- file.url = this.urlDownload+file.response.message;
+ let reUrl = file.response.message;
+ file.url = getFileAccessHttpUrl(reUrl,this.urlDownload,"http");
}
return file;
});
}
- this.$message.success(`${info.file.name} 上传成功!`);
+ //this.$message.success(`${info.file.name} 上传成功!`);
}else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`);
}else if(info.file.status === 'removed'){
@@ -169,7 +208,26 @@
}
this.fileList = fileList
if(info.file.status==='done' || info.file.status === 'removed'){
- this.handlePathChange()
+ //returnUrl为true时仅返回文件路径
+ if(this.returnUrl){
+ this.handlePathChange()
+ }else{
+ //returnUrl为false时返回文件名称、文件路径及文件大小
+ fileList = fileList.filter((file) => {
+ if (file.response) {
+ return file.response.success === true;
+ }
+ return false;
+ }).map((file) => {
+ var fileJson = {
+ fileName:file.name,
+ filePath:file.url,
+ fileSize:file.size
+ };
+ this.newFileList.push(fileJson);
+ this.$emit('change', this.newFileList);
+ });
+ }
}
},
handleDelete(file){
diff --git a/ant-design-vue-jeecg/src/components/jeecg/index.js b/ant-design-vue-jeecg/src/components/jeecg/index.js
index 6d09e6ba..0dbce862 100644
--- a/ant-design-vue-jeecg/src/components/jeecg/index.js
+++ b/ant-design-vue-jeecg/src/components/jeecg/index.js
@@ -1,5 +1,9 @@
-import T from './JFormContainer.vue'
-let install = function (Vue) {
- Vue.component('JFormContainer',T);
-}
-export default { install };
\ No newline at end of file
+import JModal from './JModal'
+import JFormContainer from './JFormContainer.vue'
+
+export default {
+ install(Vue) {
+ Vue.component('JFormContainer', JFormContainer)
+ Vue.component(JModal.name, JModal)
+ }
+}
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue b/ant-design-vue-jeecg/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue
index 7a8348fb..0ff78f9b 100644
--- a/ant-design-vue-jeecg/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue
+++ b/ant-design-vue-jeecg/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue
@@ -17,9 +17,11 @@
selectable
:selectedKeys="selectedDepIds"
:checkStrictly="true"
- @select="onDepSelect"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree"
+ :expandAction="false"
+ :expandedKeys.sync="expandedKeys"
+ @select="onDepSelect"
/>
@@ -28,7 +30,7 @@
用户账号:
@@ -43,6 +45,7 @@
:dataSource="dataSource"
:pagination="ipagination"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
+ :loading="loading"
@change="handleTableChange">
@@ -71,7 +74,7 @@
dataIndex: 'username'
},
{
- title: '真实姓名',
+ title: '用户姓名',
align: 'center',
dataIndex: 'realname'
},
@@ -90,14 +93,14 @@
}
},
{
- title: '手机号码',
+ title: '手机',
align: 'center',
dataIndex: 'phone'
},
{
- title: '邮箱',
+ title: '部门',
align: 'center',
- dataIndex: 'email'
+ dataIndex: 'orgCode'
}
],
scrollTrigger: {},
@@ -124,60 +127,74 @@
selectedDepIds: [],
departTree: [],
visible: false,
- form: this.$form.createForm(this)
+ form: this.$form.createForm(this),
+ loading: false,
+ expandedKeys: [],
}
},
computed: {
// 计算属性的 getter
getType: function () {
- console.log("multi: ", this.multi);
return this.multi == true ? 'checkbox' : 'radio';
}
},
watch: {
- userIds() {
- this.initUserNames()
- }
+ userIds: {
+ immediate: true,
+ handler() {
+ this.initUserNames()
+ }
+ },
},
created() {
// 该方法触发屏幕自适应
this.resetScreenSize();
- this.loadData().then((res) => {
- this.initUserNames();
- })
+ this.loadData()
},
methods: {
initUserNames() {
- let names = ''
- console.log("props userIds: ", this.userIds)
if (this.userIds) {
- let currUserIds = this.userIds
- let userIdsArr = currUserIds.split(',');
- for (let item of this.dataSource) {
- if (userIdsArr.includes(item.username)) {
- names += "," + item.realname
+ // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
+ let values = this.userIds.split(',') + ','
+ getUserList({
+ username: values,
+ pageNo: 1,
+ pageSize: values.length
+ }).then((res) => {
+ if (res.success) {
+ let selectedRowKeys = []
+ let realNames = []
+ res.result.records.forEach(user => {
+ realNames.push(user['realname'])
+ selectedRowKeys.push(user['id'])
+ })
+ this.selectedRowKeys = selectedRowKeys
+ this.$emit('initComp', realNames.join(','))
}
- }
- if (names) {
- names = names.substring(1)
- }
- this.$emit("initComp", names)
- }else{
+ })
+ } else {
// JSelectUserByDep组件bug issues/I16634
- this.$emit("initComp", "")
+ this.$emit('initComp', '')
}
},
async loadData(arg) {
if (arg === 1) {
this.ipagination.current = 1;
}
- let params = this.getQueryParams();//查询条件
- await getUserList(params).then((res) => {
- if (res.success) {
- this.dataSource = res.result.records;
- this.ipagination.total = res.result.total;
- }
- })
+ if (this.selectedDepIds && this.selectedDepIds.length > 0) {
+ await this.initQueryUserByDepId(this.selectedDepIds)
+ } else {
+ this.loading = true
+ let params = this.getQueryParams()//查询条件
+ await getUserList(params).then((res) => {
+ if (res.success) {
+ this.dataSource = res.result.records
+ this.ipagination.total = res.result.total
+ }
+ }).finally(() => {
+ this.loading = false
+ })
+ }
},
// 触发屏幕自适应
resetScreenSize() {
@@ -191,6 +208,7 @@
showModal() {
this.visible = true;
this.queryDepartTree();
+ this.initUserNames()
this.loadData();
this.form.resetFields();
},
@@ -234,7 +252,6 @@
handleSubmit() {
let that = this;
this.getSelectUserRows();
- console.log(that.selectUserRows)
that.$emit('ok', that.selectUserRows, that.selectUserIds);
that.searchReset(0)
that.close();
@@ -270,17 +287,22 @@
},
// 根据选择的id来查询用户信息
initQueryUserByDepId(selectedDepIds) {
- queryUserByDepId({id: selectedDepIds.toString()}).then((res) => {
+ this.loading = true
+ return queryUserByDepId({id: selectedDepIds.toString()}).then((res) => {
if (res.success) {
this.dataSource = res.result;
this.ipagination.total = res.result.length;
}
+ }).finally(() => {
+ this.loading = false
})
},
queryDepartTree() {
queryDepartTreeList().then((res) => {
if (res.success) {
this.departTree = res.result;
+ // 默认展开父节点
+ this.expandedKeys = this.departTree.map(item => item.id)
}
})
},
diff --git a/ant-design-vue-jeecg/src/components/jeecgbiz/modal/SelectUserListModal.vue b/ant-design-vue-jeecg/src/components/jeecgbiz/modal/SelectUserListModal.vue
index 60bca0ec..1da01481 100644
--- a/ant-design-vue-jeecg/src/components/jeecgbiz/modal/SelectUserListModal.vue
+++ b/ant-design-vue-jeecg/src/components/jeecgbiz/modal/SelectUserListModal.vue
@@ -46,7 +46,7 @@
width: 200
},
{
- title: '用户真实姓名',
+ title: '用户姓名',
align: "center",
dataIndex: 'realname',
},
diff --git a/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue b/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue
index aeea7960..50434423 100644
--- a/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue
+++ b/ant-design-vue-jeecg/src/components/layouts/IframePageView.vue
@@ -5,6 +5,8 @@
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/components/tools/HeaderNotice.vue b/ant-design-vue-jeecg/src/components/tools/HeaderNotice.vue
index b703d52e..b298d4bb 100644
--- a/ant-design-vue-jeecg/src/components/tools/HeaderNotice.vue
+++ b/ant-design-vue-jeecg/src/components/tools/HeaderNotice.vue
@@ -72,6 +72,7 @@
+
@@ -79,11 +80,13 @@
import { getAction,putAction } from '@/api/manage'
import ShowAnnouncement from './ShowAnnouncement'
import store from '@/store/'
+ import DynamicNotice from './DynamicNotice'
export default {
name: "HeaderNotice",
components: {
+ DynamicNotice,
ShowAnnouncement,
},
data () {
@@ -105,6 +108,8 @@
websock: null,
lockReconnect:false,
heartCheck:null,
+ formData:{},
+ openPath:''
}
},
computed:{
@@ -172,7 +177,13 @@
}
});
this.hovered = false;
- this.$refs.ShowAnnouncement.detail(record);
+ if(record.openType==='component'){
+ this.openPath = record.openPage;
+ this.formData = {id:record.busId};
+ this.$refs.showDynamNotice.detail(record.openPage);
+ }else{
+ this.$refs.ShowAnnouncement.detail(record);
+ }
},
toMyAnnouncement(){
diff --git a/ant-design-vue-jeecg/src/components/tools/ShowAnnouncement.vue b/ant-design-vue-jeecg/src/components/tools/ShowAnnouncement.vue
index ee7f8fbd..0e7b6a67 100644
--- a/ant-design-vue-jeecg/src/components/tools/ShowAnnouncement.vue
+++ b/ant-design-vue-jeecg/src/components/tools/ShowAnnouncement.vue
@@ -5,11 +5,14 @@
:visible="visible"
:bodyStyle ="bodyStyle"
@cancel="handleCancel"
- destroyOnClose
- :footer="null">
+ destroyOnClose>
+
+ 关闭
+ 去处理
+
diff --git a/ant-design-vue-jeecg/src/components/tools/UserMenu.vue b/ant-design-vue-jeecg/src/components/tools/UserMenu.vue
index ec846efb..6acc105a 100644
--- a/ant-design-vue-jeecg/src/components/tools/UserMenu.vue
+++ b/ant-design-vue-jeecg/src/components/tools/UserMenu.vue
@@ -5,7 +5,8 @@
-
+
+
- {{site.meta.title}}
+ {{site.meta.title}}
-
-
+
+
+
-
+
@@ -95,9 +100,11 @@
mixins: [mixinDevice],
data(){
return{
- //菜单搜索
- search:[],
- shows:false
+ // update-begin author:sunjianlei date:20200219 for: 头部菜单搜索规范命名 --------------
+ searchMenuOptions:[],
+ searchMenuComp: 'span',
+ searchMenuVisible: false,
+ // update-begin author:sunjianlei date:20200219 for: 头部菜单搜索规范命名 --------------
}
},
components: {
@@ -116,10 +123,8 @@
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
created() {
let lists = []
- console.log("permissionMenuList: ",this.permissionMenuList)
this.searchMenus(lists,this.permissionMenuList)
- this.search=[...lists]
- console.log(this.search)
+ this.searchMenuOptions=[...lists]
},
computed: {
...mapState({
@@ -129,10 +134,21 @@
})
},
/* update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
+ watch: {
+ // update-begin author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框
+ device: {
+ immediate: true,
+ handler() {
+ this.searchMenuVisible = false
+ this.searchMenuComp = this.isMobile() ? 'a-modal' : 'span'
+ },
+ },
+ // update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框
+ },
methods: {
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
- showClick(){
- this.shows = !this.shows
+ showClick() {
+ this.searchMenuVisible = true
},
hiddenClick(){
this.shows = false
@@ -141,8 +157,8 @@
...mapActions(["Logout"]),
...mapGetters(["nickname", "avatar","userInfo"]),
getAvatar(){
- console.log('url = '+ window._CONFIG['imgDomainURL']+"/"+this.avatar())
- return window._CONFIG['imgDomainURL']+"/"+this.avatar()
+ console.log('url = '+ window._CONFIG['staticDomainURL']+"/"+this.avatar())
+ return window._CONFIG['staticDomainURL']+"/"+this.avatar()
},
handleLogout() {
const that = this
@@ -189,10 +205,17 @@
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
- searchMethods(value){
- let jump = this.search.filter(item=>item.id==value)
- this.$router.push({ path:jump[0].path})
+ // update_begin author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
+ searchMethods(value) {
+ let route = this.searchMenuOptions.filter(item => item.id === value)[0]
+ if (route.meta.internalOrExternal === true || route.component.includes('layouts/IframePageView')) {
+ window.open(route.meta.url, '_blank')
+ } else {
+ this.$router.push({ path: route.path })
+ }
+ this.searchMenuVisible = false
}
+ // update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
/*update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
}
}
@@ -203,7 +226,7 @@
/* update-begin author:sunjianlei date:20191220 for: 解决全局样式冲突问题 */
.user-wrapper .search-input {
width: 180px;
- color: white;
+ color: inherit;
/deep/ {
.ant-select-selection {
diff --git a/ant-design-vue-jeecg/src/main.js b/ant-design-vue-jeecg/src/main.js
index 2ea3f917..186beec5 100644
--- a/ant-design-vue-jeecg/src/main.js
+++ b/ant-design-vue-jeecg/src/main.js
@@ -18,8 +18,8 @@ import VueApexCharts from 'vue-apexcharts'
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
-import "@jeecg/antd-online-re"
-import '@jeecg/antd-online-re/dist/OnlineForm.css'
+import "@jeecg/antd-online-214"
+import '@jeecg/antd-online-214/dist/OnlineForm.css'
import {
ACCESS_TOKEN,
diff --git a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
index 4333b22a..855babaf 100644
--- a/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
+++ b/ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
@@ -236,9 +236,9 @@ export const JeecgListMixin = {
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data]), fileName+'.xls')
+ window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
}else{
- let url = window.URL.createObjectURL(new Blob([data]))
+ let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
@@ -286,7 +286,7 @@ export const JeecgListMixin = {
if(text && text.indexOf(",")>0){
text = text.substring(0,text.indexOf(","))
}
- return window._CONFIG['imgDomainURL']+"/"+text
+ return window._CONFIG['staticDomainURL']+"/"+text
},
/* 文件下载 */
uploadFile(text){
@@ -297,7 +297,7 @@ export const JeecgListMixin = {
if(text.indexOf(",")>0){
text = text.substring(0,text.indexOf(","))
}
- window.open(window._CONFIG['domianURL'] + "/sys/common/download/"+text);
+ window.open(window._CONFIG['staticDomainURL']+ "/"+text);
},
}
diff --git a/ant-design-vue-jeecg/src/mixins/OnlAutoListMixin.js b/ant-design-vue-jeecg/src/mixins/OnlAutoListMixin.js
new file mode 100644
index 00000000..7c94140e
--- /dev/null
+++ b/ant-design-vue-jeecg/src/mixins/OnlAutoListMixin.js
@@ -0,0 +1,78 @@
+export const HrefJump = {
+ data() {
+ return {
+ fieldHrefSlots: [],
+ hrefComponent: {
+ model: {
+ title: '',
+ width: '100%',
+ visible: false,
+ destroyOnClose: true,
+ style: {
+ top: 0,
+ left: 0,
+ height: '100%',
+ margin: 0,
+ padding: 0
+ },
+ bodyStyle: { padding: '8px', height: 'calc(100vh - 108px)', overflow: 'auto', overflowX: 'hidden' },
+ // 隐藏掉取消按钮
+ cancelButtonProps: { style: { display: 'none' } },
+ afterClose: () => {
+ // 恢复body的滚动
+ document.body.style.overflow = null
+ }
+ },
+ on: {
+ ok: () => this.hrefComponent.model.visible = false,
+ cancel: () => this.hrefComponent.model.visible = false
+ },
+ is: null,
+ params: {},
+ }
+ }
+ },
+ methods: {
+ //支持链接href跳转
+ handleClickFieldHref(field, record) {
+ let href = field.href
+ let urlPattern = /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?/
+ let compPattern = /\.vue(\?.*)?$/
+ if (typeof href === 'string') {
+ href = href.trim().replace(/\${([^}]+)?}/g, (s1, s2) => record[s2])
+ if (urlPattern.test(href)) {
+ window.open(href, '_blank')
+ } else if (compPattern.test(href)) {
+ this.openHrefCompModal(href)
+ } else {
+ this.$router.push(href)
+ }
+ }
+ },
+ openHrefCompModal(href) {
+ // 解析 href 参数
+ let index = href.indexOf('?')
+ let path = href
+ if (index !== -1) {
+ path = href.substring(0, index)
+ let paramString = href.substring(index + 1, href.length)
+ let paramArray = paramString.split('&')
+ let params = {}
+ paramArray.forEach(paramObject => {
+ let paramItem = paramObject.split('=')
+ params[paramItem[0]] = paramItem[1]
+ })
+ this.hrefComponent.params = params
+ } else {
+ this.hrefComponent.params = {}
+ }
+ this.hrefComponent.model.visible = true
+ this.hrefComponent.model.title = '@/views/' + path
+ this.hrefComponent.is = () => import('@/views/' + (path.startsWith('/')?path.slice(1):path))
+ // 禁止body滚动,防止滚动穿透
+ setTimeout(() => {
+ document.body.style.overflow = 'hidden'
+ }, 300)
+ },
+ }
+}
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/store/modules/user.js b/ant-design-vue-jeecg/src/store/modules/user.js
index c8140350..8e6617f7 100644
--- a/ant-design-vue-jeecg/src/store/modules/user.js
+++ b/ant-design-vue-jeecg/src/store/modules/user.js
@@ -120,6 +120,19 @@ const user = {
sessionStorage.setItem(USER_AUTH,JSON.stringify(authData));
sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData));
if (menuData && menuData.length > 0) {
+ //update--begin--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
+ menuData.forEach((item, index) => {
+ if (item["children"]) {
+ let hasChildrenMenu = item["children"].filter((i) => {
+ return !i.hidden || i.hidden == false
+ })
+ if (hasChildrenMenu == null || hasChildrenMenu.length == 0) {
+ item["hidden"] = true
+ }
+ }
+ })
+ console.log(" menu show json ", menuData)
+ //update--end--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
commit('SET_PERMISSIONLIST', menuData)
} else {
reject('getPermissionList: permissions must be a non-null array !')
diff --git a/ant-design-vue-jeecg/src/utils/authFilter.js b/ant-design-vue-jeecg/src/utils/authFilter.js
index c4c4183a..ed5aa350 100644
--- a/ant-design-vue-jeecg/src/utils/authFilter.js
+++ b/ant-design-vue-jeecg/src/utils/authFilter.js
@@ -1,4 +1,3 @@
-
import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"
export function disabledAuthFilter(code,formData) {
@@ -10,27 +9,30 @@ export function disabledAuthFilter(code,formData) {
}
function nodeDisabledAuth(code,formData){
- console.log("页面权限禁用--NODE--开始");
- var permissionList = [];
+ let permissionList = [];
try {
- var obj = formData;
//console.log("页面权限禁用--NODE--开始",obj);
- if (obj) {
- let bpmList = obj.permissionList;
- for (var bpm of bpmList) {
- if(bpm.type == '2') {
- permissionList.push(bpm);
- }
- }
+ if (formData) {
+ let bpmList = formData.permissionList;
+ permissionList = bpmList.filter(item=>item.type=='2')
+ // for (let bpm of bpmList) {
+ // if(bpm.type == '2') {
+ // permissionList.push(bpm);
+ // }
+ // }
+ }else{
+ return false;
}
} catch (e) {
//console.log("页面权限异常----", e);
}
- if (permissionList === null || permissionList === "" || permissionList === undefined||permissionList.length<=0) {
+ if (permissionList.length == 0) {
return false;
}
+
+ console.log("流程节点页面权限禁用--NODE--开始");
let permissions = [];
- for (var item of permissionList) {
+ for (let item of permissionList) {
if(item.type == '2') {
permissions.push(item.action);
}
@@ -39,9 +41,9 @@ function nodeDisabledAuth(code,formData){
if (!permissions.includes(code)) {
return false;
}else{
- for (var item2 of permissionList) {
+ for (let item2 of permissionList) {
if(code === item2.action){
- console.log("页面权限禁用--NODE--生效");
+ console.log("流程节点页面权限禁用--NODE--生效");
return true;
}
}
@@ -50,21 +52,21 @@ function nodeDisabledAuth(code,formData){
}
function globalDisabledAuth(code){
- console.log("页面禁用权限--Global--开始");
+ //console.log("全局页面禁用权限--Global--开始");
var permissionList = [];
var allPermissionList = [];
//let authList = Vue.ls.get(USER_AUTH);
let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
- for (var auth of authList) {
+ for (let auth of authList) {
if(auth.type == '2') {
permissionList.push(auth);
}
}
//console.log("页面禁用权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]");
- for (var gauth of allAuthList) {
+ for (let gauth of allAuthList) {
if(gauth.type == '2') {
allPermissionList.push(gauth);
}
@@ -73,7 +75,7 @@ function globalDisabledAuth(code){
var gFlag = false;//禁用命中
var invalidFlag = false;//无效命中
if(allPermissionList != null && allPermissionList != "" && allPermissionList != undefined && allPermissionList.length > 0){
- for (var itemG of allPermissionList) {
+ for (let itemG of allPermissionList) {
if(code === itemG.action){
if(itemG.status == '0'){
invalidFlag = true;
@@ -92,7 +94,7 @@ function globalDisabledAuth(code){
return gFlag;
}
let permissions = [];
- for (var item of permissionList) {
+ for (let item of permissionList) {
if(item.type == '2') {
permissions.push(item.action);
}
@@ -101,9 +103,9 @@ function globalDisabledAuth(code){
if (!permissions.includes(code)) {
return gFlag;
}else{
- for (var item2 of permissionList) {
+ for (let item2 of permissionList) {
if(code === item2.action){
- console.log("页面权限解除禁用--Global--生效");
+ console.log("全局页面权限解除禁用--Global--生效");
gFlag = false;
}
}
@@ -134,12 +136,12 @@ function hasColoum(item,authList){
//权限无效时不做控制,有效时控制,只能控制 显示不显示
//根据授权码前缀获取未授权的列信息
function getNoAuthCols(pre){
- var permissionList = [];
- var allPermissionList = [];
+ let permissionList = [];
+ let allPermissionList = [];
//let authList = Vue.ls.get(USER_AUTH);
let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
- for (var auth of authList) {
+ for (let auth of authList) {
//显示策略,有效状态
if(auth.type == '1'&&startWith(auth.action,pre)) {
permissionList.push(substrPre(auth.action,pre));
@@ -147,7 +149,7 @@ function getNoAuthCols(pre){
}
//console.log("页面禁用权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]");
- for (var gauth of allAuthList) {
+ for (let gauth of allAuthList) {
//显示策略,有效状态
if(gauth.type == '1'&&gauth.status == '1'&&startWith(gauth.action,pre)) {
allPermissionList.push(substrPre(gauth.action,pre));
diff --git a/ant-design-vue-jeecg/src/utils/commonUploadFile.js b/ant-design-vue-jeecg/src/utils/commonUploadFile.js
index 4c5ab5b6..d4632e2d 100644
--- a/ant-design-vue-jeecg/src/utils/commonUploadFile.js
+++ b/ant-design-vue-jeecg/src/utils/commonUploadFile.js
@@ -38,7 +38,7 @@ const getUploadFileList=(paths)=>{
uid:uidGenerator(),
name:getFileName(arr[a]),
status: 'done',
- url: window._CONFIG['domianURL']+"/sys/common/view/"+arr[a],
+ url: window._CONFIG['staticDomainURL']+"/"+arr[a],
response:{
status:"history",
message:arr[a]
diff --git a/ant-design-vue-jeecg/src/utils/hasPermission.js b/ant-design-vue-jeecg/src/utils/hasPermission.js
index e8cb5cfc..860a0a8a 100644
--- a/ant-design-vue-jeecg/src/utils/hasPermission.js
+++ b/ant-design-vue-jeecg/src/utils/hasPermission.js
@@ -2,35 +2,37 @@ import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"
const hasPermission = {
install (Vue, options) {
- console.log(options);
+ //console.log(options);
Vue.directive('has', {
inserted: (el, binding, vnode)=>{
- console.log("页面权限控制----");
+ //console.log("页面权限控制----");
+ console.time()
//节点权限处理,如果命中则不进行全局权限处理
if(!filterNodePermission(el, binding, vnode)){
filterGlobalPermission(el, binding, vnode);
}
+ console.timeEnd() //计时结束并输出时长
}
});
}
};
/**
- * 全局权限控制
+ * 流程节点权限控制
*/
export function filterNodePermission(el, binding, vnode) {
- console.log("页面权限--NODE--");
-
- var permissionList = [];
+ let permissionList = [];
try {
- var obj = vnode.context.$props.formData;
+ let obj = vnode.context.$props.formData;
if (obj) {
let bpmList = obj.permissionList;
- for (var bpm of bpmList) {
+ for (let bpm of bpmList) {
if(bpm.type != '2') {
permissionList.push(bpm);
}
}
+ }else{
+ return false;
}
} catch (e) {
//console.log("页面权限异常----", e);
@@ -39,8 +41,10 @@ export function filterNodePermission(el, binding, vnode) {
//el.parentNode.removeChild(el)
return false;
}
+
+ console.log("流程节点页面权限--NODE--");
let permissions = [];
- for (var item of permissionList) {
+ for (let item of permissionList) {
if(item.type != '2') {
permissions.push(item.action);
}
@@ -51,7 +55,7 @@ export function filterNodePermission(el, binding, vnode) {
//el.parentNode.removeChild(el)
return false;
}else{
- for (var item2 of permissionList) {
+ for (let item2 of permissionList) {
if(binding.value === item2.action){
return true;
}
@@ -64,29 +68,29 @@ export function filterNodePermission(el, binding, vnode) {
* 全局权限控制
*/
export function filterGlobalPermission(el, binding, vnode) {
- console.log("页面权限--Global--");
+ console.log("全局页面权限--Global--");
- var permissionList = [];
- var allPermissionList = [];
+ let permissionList = [];
+ let allPermissionList = [];
//let authList = Vue.ls.get(USER_AUTH);
let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
- for (var auth of authList) {
+ for (let auth of authList) {
if(auth.type != '2') {
permissionList.push(auth);
}
}
//console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]");
- for (var gauth of allAuthList) {
+ for (let gauth of allAuthList) {
if(gauth.type != '2') {
allPermissionList.push(gauth);
}
}
//设置全局配置是否有命中
- var invalidFlag = false;//无效命中
+ let invalidFlag = false;//无效命中
if(allPermissionList != null && allPermissionList != "" && allPermissionList != undefined && allPermissionList.length > 0){
- for (var itemG of allPermissionList) {
+ for (let itemG of allPermissionList) {
if(binding.value === itemG.action){
if(itemG.status == '0'){
invalidFlag = true;
@@ -103,7 +107,7 @@ export function filterGlobalPermission(el, binding, vnode) {
return;
}
let permissions = [];
- for (var item of permissionList) {
+ for (let item of permissionList) {
if(item.type != '2'){
permissions.push(item.action);
}
diff --git a/ant-design-vue-jeecg/src/utils/request.js b/ant-design-vue-jeecg/src/utils/request.js
index 5fd05c51..56fa5784 100644
--- a/ant-design-vue-jeecg/src/utils/request.js
+++ b/ant-design-vue-jeecg/src/utils/request.js
@@ -5,9 +5,16 @@ import { VueAxios } from './axios'
import {Modal, notification} from 'ant-design-vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
+//自动设置后台服务 baseURL (也可以手工指定写死项目名字)
+let baseDomain = window._CONFIG['domianURL'];
+let baseProject = baseDomain.substring(baseDomain.lastIndexOf("/"));
+console.log("baseDomain= ",baseDomain)
+console.log("baseProject= ",baseProject)
+
// 创建 axios 实例
const service = axios.create({
- baseURL: '/jeecg-boot', // api base_url
+ //baseURL: '/jeecg-boot',
+ baseURL: baseProject, // api base_url
timeout: 9000 // 请求超时时间
})
diff --git a/ant-design-vue-jeecg/src/utils/util.js b/ant-design-vue-jeecg/src/utils/util.js
index 73445faa..20418f0d 100644
--- a/ant-design-vue-jeecg/src/utils/util.js
+++ b/ant-design-vue-jeecg/src/utils/util.js
@@ -257,6 +257,62 @@ export function cssExpand(css, id) {
document.head.appendChild(style)
}
+
+/** 用于js增强事件,运行JS代码,可以传参 */
+// options 所需参数:
+// 参数名 类型 说明
+// vm VueComponent vue实例
+// event Object event对象
+// jsCode String 待执行的js代码
+// errorMessage String 执行出错后的提示(控制台)
+export function jsExpand(options = {}) {
+
+ // 绑定到window上的keyName
+ let windowKeyName = 'J_CLICK_EVENT_OPTIONS'
+ if (typeof window[windowKeyName] != 'object') {
+ window[windowKeyName] = {}
+ }
+
+ // 随机生成JS增强的执行id,防止冲突
+ let id = randomString(16, 'qwertyuioplkjhgfdsazxcvbnm'.toUpperCase())
+ // 封装按钮点击事件
+ let code = `
+ (function (o_${id}) {
+ try {
+ (function (globalEvent, vm) {
+ ${options.jsCode}
+ })(o_${id}.event, o_${id}.vm)
+ } catch (e) {
+ o_${id}.error(e)
+ }
+ o_${id}.done()
+ })(window['${windowKeyName}']['EVENT_${id}'])
+ `
+ // 创建script标签
+ const script = document.createElement('script')
+ // 将需要传递的参数挂载到window对象上
+ window[windowKeyName]['EVENT_' + id] = {
+ vm: options.vm,
+ event: options.event,
+ // 当执行完成时,无论如何都会调用的回调事件
+ done() {
+ // 执行完后删除新增的 script 标签不会撤销执行结果(已产生的结果不会被撤销)
+ script.outerHTML = ''
+ delete window[windowKeyName]['EVENT_' + id]
+ },
+ // 当js运行出错的时候调用的事件
+ error(e) {
+ console.group(`${options.errorMessage || '用户自定义JS增强代码运行出错'}(${new Date()})`)
+ console.error(e)
+ console.groupEnd()
+ }
+ }
+ // 将事件挂载到document中
+ script.innerHTML = code
+ document.body.appendChild(script)
+}
+
+
/**
* 重复值验证工具方法
*
@@ -270,12 +326,39 @@ export function cssExpand(css, id) {
* @param callback
*/
export function validateDuplicateValue(tableName, fieldName, fieldVal, dataId, callback) {
- let params = { tableName, fieldName, fieldVal, dataId }
- api.duplicateCheck(params).then(res => {
- res['success'] ? callback() : callback(res['message'])
- }).catch(err => {
- callback(err.message || err)
- })
+ if (fieldVal) {
+ let params = { tableName, fieldName, fieldVal, dataId }
+ api.duplicateCheck(params).then(res => {
+ res['success'] ? callback() : callback(res['message'])
+ }).catch(err => {
+ callback(err.message || err)
+ })
+ } else {
+ callback()
+ }
+}
+
+/**
+ * 根据编码校验规则code,校验传入的值是否合法
+ *
+ * 使用示例:
+ * { validator: (rule, value, callback) => validateCheckRule('common', value, callback) }
+ *
+ * @param ruleCode 编码校验规则 code
+ * @param value 被验证的值
+ * @param callback
+ */
+export function validateCheckRule(ruleCode, value, callback) {
+ if (ruleCode && value) {
+ value = encodeURIComponent(value)
+ api.checkRuleByCode({ ruleCode, value }).then(res => {
+ res['success'] ? callback() : callback(res['message'])
+ }).catch(err => {
+ callback(err.message || err)
+ })
+ } else {
+ callback()
+ }
}
/**
@@ -295,4 +378,40 @@ export function pushIfNotExist(array, value, key) {
}
array.push(value)
return true
+}
+
+/**
+ * 可用于判断是否成功
+ * @type {symbol}
+ */
+export const succeedSymbol = Symbol()
+/**
+ * 可用于判断是否失败
+ * @type {symbol}
+ */
+export const failedSymbol = Symbol()
+
+/**
+ * 使 promise 无论如何都会 resolve,除非传入的参数不是一个Promise对象或返回Promise对象的方法
+ * 一般用在 Promise.all 中
+ *
+ * @param promise 可传Promise对象或返回Promise对象的方法
+ * @returns {Promise}
+ */
+export function alwaysResolve(promise) {
+ return new Promise((resolve, reject) => {
+ let p = promise
+ if (typeof promise === 'function') {
+ p = promise()
+ }
+ if (p instanceof Promise) {
+ p.then(data => {
+ resolve({ type: succeedSymbol, data })
+ }).catch(error => {
+ resolve({ type: failedSymbol, error })
+ })
+ } else {
+ reject('alwaysResolve: 传入的参数不是一个Promise对象或返回Promise对象的方法')
+ }
+ })
}
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/account/center/Index.vue b/ant-design-vue-jeecg/src/views/account/center/Index.vue
index 3658dc6e..09edddad 100644
--- a/ant-design-vue-jeecg/src/views/account/center/Index.vue
+++ b/ant-design-vue-jeecg/src/views/account/center/Index.vue
@@ -133,7 +133,7 @@
methods: {
...mapGetters(["nickname", "avatar"]),
getAvatar(){
- return window._CONFIG['imgDomainURL']+"/"+this.avatar();
+ return window._CONFIG['staticDomainURL']+"/"+this.avatar();
},
getTeams() {
this.$http.get('/api/workplace/teams')
diff --git a/ant-design-vue-jeecg/src/views/dashboard/IndexChart.vue b/ant-design-vue-jeecg/src/views/dashboard/IndexChart.vue
index ca3f6c7f..1621e6e3 100644
--- a/ant-design-vue-jeecg/src/views/dashboard/IndexChart.vue
+++ b/ant-design-vue-jeecg/src/views/dashboard/IndexChart.vue
@@ -20,14 +20,14 @@
-
+
- 日访问量 {{ '1234' | NumberFormat }}
+ 日订单量 {{ '1234' | NumberFormat }}
@@ -85,7 +85,7 @@
-
+
@@ -101,10 +101,10 @@
-
+
-
+
@@ -112,7 +112,7 @@
-
+
@@ -120,7 +120,7 @@
-
+
diff --git a/ant-design-vue-jeecg/src/views/dashboard/Workplace.vue b/ant-design-vue-jeecg/src/views/dashboard/Workplace.vue
index 96c764b9..10040f76 100644
--- a/ant-design-vue-jeecg/src/views/dashboard/Workplace.vue
+++ b/ant-design-vue-jeecg/src/views/dashboard/Workplace.vue
@@ -185,7 +185,7 @@
},
created() {
this.user = this.userInfo
- this.avatar = window._CONFIG['imgDomainURL'] +"/"+ this.userInfo.avatar
+ this.avatar = window._CONFIG['staticDomainURL'] +"/"+ this.userInfo.avatar
console.log('this.avatar :'+ this.avatar)
getRoleList().then(res => {
diff --git a/ant-design-vue-jeecg/src/views/jeecg/SelectDemo.vue b/ant-design-vue-jeecg/src/views/jeecg/SelectDemo.vue
index 21030fd2..cfc787d3 100644
--- a/ant-design-vue-jeecg/src/views/jeecg/SelectDemo.vue
+++ b/ant-design-vue-jeecg/src/views/jeecg/SelectDemo.vue
@@ -9,7 +9,7 @@
-
+
@@ -176,34 +176,28 @@
-
- modal.visible=true">最大化弹窗
+
+ modal.visible=true">点击弹出JModal
+ 全屏化:
+ 允许切换全屏:
+ 锁定Body滚动:
+
- modal.visible=false"
- @cancel="()=>modal.visible=false">
-
-
-
-
+
这是主体内容,高度是自适应的
-
+
@@ -217,10 +211,10 @@
-
+
-
+ 选中的值(v-model):{{ formData.treeDict }}
@@ -262,6 +256,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 高级查询
+
+
+
+
+
+
+
+
+
+
+ 选中的值(v-model):{{ imgList }}
+
+
+
+
+
+
+
+
+ 选中的值(v-model):
+
+
+
+
@@ -286,10 +319,15 @@
import JTreeDict from "../../components/jeecg/JTreeDict.vue";
import JCron from "@/components/jeecg/JCron.vue";
import JTreeSelect from '@/components/jeecg/JTreeSelect'
+ import JSuperQuery from '@/components/jeecg/JSuperQuery'
+ import JUpload from '@/components/jeecg/JUpload'
+ import JImageUpload from '@/components/jeecg/JImageUpload'
export default {
name: 'SelectDemo',
components: {
+ JImageUpload,
+ JUpload,
JTreeDict,
JDictSelectTag,
JSelectDepart,
@@ -299,7 +337,7 @@
JCheckbox,
JCodeEditor,
JDate, JEditor, JEllipsis, JGraphicCode, JSlider, JSelectMultiple,
- JCron, JTreeSelect
+ JCron, JTreeSelect, JSuperQuery
},
data() {
return {
@@ -352,11 +390,20 @@ sayHi('hello, world!')`
modal: {
title: '这里是标题',
visible: false,
- width: '100%',
- style: { top: '20px' },
- fullScreen: true
+ lockScroll: true,
+ fullscreen: true,
+ switchFullscreen: true,
},
cron: '',
+ superQuery: {
+ fieldList: [
+ { type: 'input', value: 'name', text: '姓名', },
+ { type: 'select', value: 'sex', text: '性别', dictCode: 'sex' },
+ { type: 'number', value: 'age', text: '年龄', }
+ ]
+ },
+ fileList:[],
+ imgList:[],
}
},
computed: {
@@ -399,18 +446,6 @@ sayHi('hello, world!')`
handleJSliderSuccess(value) {
this.jslider.value = value
},
- /** 切换全屏显示 */
- handleClickToggleFullScreen() {
- let mode = !this.modal.fullScreen
- if (mode) {
- this.modal.width = '100%'
- this.modal.style.top = '20px'
- } else {
- this.modal.width = '1200px'
- this.modal.style.top = '50px'
- }
- this.modal.fullScreen = mode
- },
setCorn(data){
this.$nextTick(() => {
this.form.cronExpression = data;
diff --git a/ant-design-vue-jeecg/src/views/jeecg/helloworld.vue b/ant-design-vue-jeecg/src/views/jeecg/helloworld.vue
index c0a8b342..1a3ec195 100644
--- a/ant-design-vue-jeecg/src/views/jeecg/helloworld.vue
+++ b/ant-design-vue-jeecg/src/views/jeecg/helloworld.vue
@@ -21,7 +21,9 @@
- Submit
+
+ Submit
+
diff --git a/ant-design-vue-jeecg/src/views/jeecg/modules/JeecgDemoModal.vue b/ant-design-vue-jeecg/src/views/jeecg/modules/JeecgDemoModal.vue
index f4c7ef44..7d4658d1 100644
--- a/ant-design-vue-jeecg/src/views/jeecg/modules/JeecgDemoModal.vue
+++ b/ant-design-vue-jeecg/src/views/jeecg/modules/JeecgDemoModal.vue
@@ -35,12 +35,13 @@
-
- 请选择性别
- 男性
- 女性
-
+ label="性别">
+
+
-
+
按年统计
diff --git a/ant-design-vue-jeecg/src/views/jeecg/tablist/form/JeecgOrderCustomerModal.vue b/ant-design-vue-jeecg/src/views/jeecg/tablist/form/JeecgOrderCustomerModal.vue
index 1b9cdb82..cce54ea6 100644
--- a/ant-design-vue-jeecg/src/views/jeecg/tablist/form/JeecgOrderCustomerModal.vue
+++ b/ant-design-vue-jeecg/src/views/jeecg/tablist/form/JeecgOrderCustomerModal.vue
@@ -43,24 +43,7 @@
:wrapperCol="wrapperCol"
label="身份证扫描件"
hasFeedback>
-
-
-
- upload
-
-
-
-
-
-
-
+
{
this.form.setFieldsValue(pick(this.model, 'id', 'name', 'sex', 'idcard','telphone', 'orderId', 'createBy', 'createTime', 'updateBy', 'updateTime'))
});
+ setTimeout(() => {
+ this.fileList = record.idcardPic
+ }, 5)
} else {
this.addStatus = false;
this.editStatus = true;
@@ -262,7 +246,7 @@
let formData = Object.assign(this.model, values);
console.log(formData);
formData.orderId = this.orderId;
- formData.idcardPic = getFilePaths(this.fileList)
+ formData.idcardPic = this.fileList;
httpAction(httpurl, formData, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
diff --git a/ant-design-vue-jeecg/src/views/modules/online/cgform/OnlCgformCopyList.vue b/ant-design-vue-jeecg/src/views/modules/online/cgform/OnlCgformCopyList.vue
index bfe9249f..44d776a4 100644
--- a/ant-design-vue-jeecg/src/views/modules/online/cgform/OnlCgformCopyList.vue
+++ b/ant-design-vue-jeecg/src/views/modules/online/cgform/OnlCgformCopyList.vue
@@ -6,13 +6,13 @@
-
+
-
+
查询
重置
@@ -25,10 +25,10 @@
-
自定义按钮
-
JS增强
-
SQL增强
-
Java增强
+
自定义按钮
+
JS增强
+
SQL增强
+
Java增强
@@ -37,7 +37,7 @@
删除
- 批量操作
+ 批量操作
@@ -348,6 +348,9 @@
}
}
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/modules/online/cgform/util/TableUtils.js b/ant-design-vue-jeecg/src/views/modules/online/cgform/util/TableUtils.js
index 782ad840..5d6cfc1b 100644
--- a/ant-design-vue-jeecg/src/views/modules/online/cgform/util/TableUtils.js
+++ b/ant-design-vue-jeecg/src/views/modules/online/cgform/util/TableUtils.js
@@ -109,6 +109,7 @@ export function getMasterTableInitialData() {
// table2
isShowForm: '0',
isShowList: '0',
+ isReadOnly: '1',
fieldShowType: 'text',
fieldLength: '120',
queryMode: 'single',
diff --git a/ant-design-vue-jeecg/src/views/modules/oss/OSSFileList.vue b/ant-design-vue-jeecg/src/views/modules/oss/OSSFileList.vue
index 58d21607..7a5729f3 100644
--- a/ant-design-vue-jeecg/src/views/modules/oss/OSSFileList.vue
+++ b/ant-design-vue-jeecg/src/views/modules/oss/OSSFileList.vue
@@ -31,7 +31,21 @@
@change="handleChange">
- 文件上传
+ OSS文件上传
+
+
+
+
+
+
+ MINIO文件上传
@@ -58,7 +72,9 @@
@change="handleTableChange">
- 删除
+ 预览
+
+ 删除
@@ -108,14 +124,18 @@
url: {
upload: "/oss/file/upload",
list: "/oss/file/list",
- delete: "/oss/file/delete"
+ delete: "/oss/file/delete",
+ minioUpload: "/sys/upload/uploadMinio"
}
}
},
computed: {
uploadAction() {
return window._CONFIG['domianURL'] + this.url.upload;
- }
+ },
+ minioUploadAction() {
+ return window._CONFIG['domianURL'] + this.url.minioUpload;
+ },
},
methods: {
beforeUpload(file) {
@@ -139,10 +159,10 @@
this.loadData()
this.$message.success(`${info.file.name} 上传成功!`);
} else {
- this.$message.error(`${info.file.name} 上传失败.`);
+ this.$message.error(`${info.file.response.message}`);
}
} else if (info.file.status === 'error') {
- this.$message.error(`${info.file.name} 上传失败.`);
+ this.$message.error(`${info.file.response.message}`);
}
},
ossDelete(id) {
@@ -154,11 +174,17 @@
that.handleDelete(id)
}
});
+ },
+ handlePreview(record) {
+ if (record && record.url) {
+ let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(record.url)
+ window.open(url, '_blank')
+ }
}
}
}
diff --git a/ant-design-vue-jeecg/src/views/system/DepartList.vue b/ant-design-vue-jeecg/src/views/system/DepartList.vue
index 44ccb75c..cd4dd547 100644
--- a/ant-design-vue-jeecg/src/views/system/DepartList.vue
+++ b/ant-design-vue-jeecg/src/views/system/DepartList.vue
@@ -17,8 +17,7 @@
@@ -72,82 +71,90 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 公司
-
-
-
-
-
-
- 部门
-
-
- 岗位
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 公司
+
+
+
+
+
+
+ 部门
+
+
+ 岗位
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -158,6 +165,7 @@
import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api'
import {httpAction, deleteAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
+ import DepartAuthModal from './modules/DepartAuthModal'
// 表头
const columns = [
{
@@ -201,6 +209,7 @@
name: 'DepartList',
mixins: [JeecgListMixin],
components: {
+ DepartAuthModal,
DepartModal
},
data() {
@@ -403,7 +412,7 @@
this.selectedKeys = [record.key]
this.model.parentId = record.parentId
this.setValuesToForm(record)
-
+ this.$refs.departAuth.show(record.id);
},
// 触发onSelect事件时,为部门树右侧的form表单赋值
@@ -425,6 +434,7 @@
this.currSelected = {}
this.form.resetFields()
this.selectedKeys = []
+ this.$refs.departAuth.departId = ''
},
handleNodeTypeChange(val) {
this.currSelected.nodeType = val
diff --git a/ant-design-vue-jeecg/src/views/system/DepartUserList.vue b/ant-design-vue-jeecg/src/views/system/DepartUserList.vue
index 6166366b..9bb72b2c 100644
--- a/ant-design-vue-jeecg/src/views/system/DepartUserList.vue
+++ b/ant-design-vue-jeecg/src/views/system/DepartUserList.vue
@@ -6,7 +6,7 @@
-
+
-
+
+
您的部门下暂无有效部门信息
+
+ 普通员工暂此权限
@@ -30,7 +34,10 @@
-
+
+
+
+
@@ -40,13 +47,15 @@
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/PermissionList.vue b/ant-design-vue-jeecg/src/views/system/PermissionList.vue
index 7d0d7acc..998970f4 100644
--- a/ant-design-vue-jeecg/src/views/system/PermissionList.vue
+++ b/ant-design-vue-jeecg/src/views/system/PermissionList.vue
@@ -28,7 +28,9 @@
:pagination="false"
:dataSource="dataSource"
:loading="loading"
- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
+ :expandedRowKeys="expandedRowKeys"
+ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+ @expandedRowsChange="handleExpandedRowsChange">
编辑
@@ -152,6 +154,8 @@
// 表头
columns: columns,
loading: false,
+ // 展开的行,受控属性
+ expandedRowKeys: [],
url: {
list: '/sys/permission/list',
delete: '/sys/permission/delete',
@@ -178,10 +182,13 @@
this.$refs.modalForm.localMenuType = 1;
this.$refs.modalForm.disableSubmit = false;
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
- }
+ },
+ handleExpandedRowsChange(expandedRows) {
+ this.expandedRowKeys = expandedRows
+ },
}
}
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/RoleList.vue b/ant-design-vue-jeecg/src/views/system/RoleList.vue
index d5ee38c2..f0117c8c 100644
--- a/ant-design-vue-jeecg/src/views/system/RoleList.vue
+++ b/ant-design-vue-jeecg/src/views/system/RoleList.vue
@@ -67,8 +67,8 @@
编辑
-
+
更多
diff --git a/ant-design-vue-jeecg/src/views/system/RoleUserList.vue b/ant-design-vue-jeecg/src/views/system/RoleUserList.vue
index bb5c1738..63f582bd 100644
--- a/ant-design-vue-jeecg/src/views/system/RoleUserList.vue
+++ b/ant-design-vue-jeecg/src/views/system/RoleUserList.vue
@@ -60,26 +60,27 @@
:rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
@change="handleTableChange">
- 用户
-
-
-
- 更多
-
-
-
- 授权
-
-
- 编辑
-
-
- handleDelete1(record.id)">
- 删除
-
-
-
-
+ 用户
+
+
+
+
+ 更多
+
+
+
+ 授权
+
+
+ 编辑
+
+
+ handleDelete1(record.id)">
+ 删除
+
+
+
+
@@ -530,7 +531,7 @@
},
handlePerssion(roleId){
this.$refs.modalUserRole.show(roleId);
- }
+ },
}
}
diff --git a/ant-design-vue-jeecg/src/views/system/SysCheckRuleList.vue b/ant-design-vue-jeecg/src/views/system/SysCheckRuleList.vue
new file mode 100644
index 00000000..783eb7d2
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/SysCheckRuleList.vue
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+ {{ toggleSearchStatus ? '收起' : '展开' }}
+
+
+
+
+
+
+
+
+
+
+
+
新增
+
导出
+
+ 导入
+
+
+
+
+
+ 删除
+
+
+ 批量操作
+
+
+
+
+
+
+
+
+ 已选择
+ {{ selectedRowKeys.length }}
+ 项
+
+
+ 清空
+
+
+
+
+
+
+
+ 编辑
+
+ 功能测试
+
+
+
+ 更多
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/SysDataSourceList.vue b/ant-design-vue-jeecg/src/views/system/SysDataSourceList.vue
new file mode 100644
index 00000000..f27c0cdc
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/SysDataSourceList.vue
@@ -0,0 +1,194 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+
新增
+
导出
+
+ 导入
+
+
+
+
+
+ 删除
+
+
+ 批量操作
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/UserAnnouncementList.vue b/ant-design-vue-jeecg/src/views/system/UserAnnouncementList.vue
index 17931f52..6d27aa43 100644
--- a/ant-design-vue-jeecg/src/views/system/UserAnnouncementList.vue
+++ b/ant-design-vue-jeecg/src/views/system/UserAnnouncementList.vue
@@ -46,6 +46,7 @@
+
@@ -54,11 +55,13 @@
import { getAction,putAction } from '@/api/manage'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
+ import DynamicNotice from '../../components/tools/DynamicNotice'
export default {
name: "UserAnnouncementList",
mixins: [JeecgListMixin],
components: {
+ DynamicNotice,
ShowAnnouncement
},
data () {
@@ -130,6 +133,7 @@
readAllMsg:"sys/sysAnnouncementSend/readAll",
},
loading:false,
+ openPath:''
}
},
methods: {
@@ -143,7 +147,13 @@
this.loadData();
}
});
- this.$refs.ShowAnnouncement.detail(record);
+ if(record.openType==='component'){
+ this.openPath = record.openPage;
+ this.formData = {id:record.busId};
+ this.$refs.showDynamNotice.detail();
+ }else{
+ this.$refs.ShowAnnouncement.detail(record);
+ }
},
readAll(){
var that = this;
diff --git a/ant-design-vue-jeecg/src/views/system/UserList.vue b/ant-design-vue-jeecg/src/views/system/UserList.vue
index 8b452e2c..847dd2aa 100644
--- a/ant-design-vue-jeecg/src/views/system/UserList.vue
+++ b/ant-design-vue-jeecg/src/views/system/UserList.vue
@@ -66,10 +66,12 @@
添加用户
+
同步流程
导出
导入
+
回收站
@@ -171,17 +173,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/AddressListLeft.vue b/ant-design-vue-jeecg/src/views/system/modules/AddressListLeft.vue
index 0043c4a2..29cde840 100644
--- a/ant-design-vue-jeecg/src/views/system/modules/AddressListLeft.vue
+++ b/ant-design-vue-jeecg/src/views/system/modules/AddressListLeft.vue
@@ -1,7 +1,7 @@
-
+
{
if (res.success) {
this.treeDataSource = res.result
-
+ // update-begin- --- author:wangshuai ------ date:20200102 ---- for:去除默认选中第一条数据、默认展开所有第一级
// 默认选中第一条数据、默认展开所有第一级
- if (res.result.length > 0) {
- this.expandedKeys = []
- res.result.forEach((item, index) => {
- if (index === 0) {
- this.selectedKeys = [item.id]
- this.emitInput(item.orgCode)
- }
- this.expandedKeys.push(item.id)
- })
- }
+ // if (res.result.length > 0) {
+ // this.expandedKeys = []
+ // res.result.forEach((item, index) => {
+ // if (index === 0) {
+ // this.selectedKeys = [item.id]
+ // this.emitInput(item.orgCode)
+ // }
+ // this.expandedKeys.push(item.id)
+ // })
+ // }
+ // update-end- --- author:wangshuai ------ date:20200102 ---- for:去除默认选中第一条数据、默认展开所有第一级
} else {
- this.$message.warn('组织机构查询失败:' + res.message)
+ this.$message.warn(res.message)
console.error('组织机构查询失败:', res)
}
}).finally(() => {
diff --git a/ant-design-vue-jeecg/src/views/system/modules/AddressListRight.vue b/ant-design-vue-jeecg/src/views/system/modules/AddressListRight.vue
index 2fe085f1..cad98eba 100644
--- a/ant-design-vue-jeecg/src/views/system/modules/AddressListRight.vue
+++ b/ant-design-vue-jeecg/src/views/system/modules/AddressListRight.vue
@@ -65,12 +65,6 @@
align: 'center',
customRender: (t, r, i) => parseInt(i) + 1
},
- {
- title: '部门',
- width: '20%',
- align: 'center',
- dataIndex: 'departName'
- },
{
title: '姓名',
width: '15%',
@@ -83,6 +77,12 @@
align: 'center',
dataIndex: 'workNo'
},
+ {
+ title: '部门',
+ width: '20%',
+ align: 'center',
+ dataIndex: 'departName'
+ },
{
title: '职务',
width: '15%',
@@ -91,7 +91,7 @@
customRender: (text) => (text || '').split(',').map(t => this.positionInfo[t] ? this.positionInfo[t] : t).join(',')
},
{
- title: '座机',
+ title: '手机',
width: '15%',
align: 'center',
dataIndex: 'telephone'
@@ -130,14 +130,26 @@
methods: {
loadData(pageNum, orgCode) {
- if (!orgCode) {
- return
- }
- //加载数据 若传入参数1则加载第一页的内容
- if (pageNum === 1) {
- this.ipagination.current = 1
- }
this.loading = true
+ if (pageNum === 1) {
+ this.ipagination.current = 1
+ }
+ // update-begin- --- author:wangshuai ------ date:20200102 ---- for:传过来的部门编码为空全查
+ if (!orgCode) {
+ getAction(this.url.list, {
+ ...this.getQueryParams()
+ }).then((res) => {
+ if (res.success) {
+ this.dataSource = res.result.records
+ this.ipagination.total = res.result.total
+ }
+ }).finally(() => {
+ this.loading = false
+ this.cardLoading = false
+ })
+ // update-end- --- author:wangshuai ------ date:20200102 ---- for:传过来的部门编码为空全查
+ }else{
+ //加载数据 若传入参数1则加载第一页的内容
getAction(this.url.list, {
orgCode,
...this.getQueryParams()
@@ -150,6 +162,7 @@
this.loading = false
this.cardLoading = false
})
+ }
},
searchQuery() {
diff --git a/ant-design-vue-jeecg/src/views/system/modules/DepartAuthModal.vue b/ant-design-vue-jeecg/src/views/system/modules/DepartAuthModal.vue
new file mode 100644
index 00000000..8470dc86
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/DepartAuthModal.vue
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+ {{ slotTitle }}
+
+
+
+
+
+
+
+ 请先选择一个部门!
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/DepartDataruleModal.vue b/ant-design-vue-jeecg/src/views/system/modules/DepartDataruleModal.vue
new file mode 100644
index 00000000..77298acd
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/DepartDataruleModal.vue
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+ {{ item.ruleName }}
+
+
+
+
+
+
+
+ 无配置信息!
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/DeptRoleAuthModal.vue b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleAuthModal.vue
new file mode 100644
index 00000000..40232e87
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleAuthModal.vue
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+
+
+ {{ slotTitle }}
+
+
+ 无可配置部门权限!
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/DeptRoleDataruleModal.vue b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleDataruleModal.vue
new file mode 100644
index 00000000..f3a12115
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleDataruleModal.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+ {{ item.ruleName }}
+
+
+
+
+
+
+
+ 无配置信息!
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/DeptRoleInfo.vue b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleInfo.vue
new file mode 100644
index 00000000..67831128
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleInfo.vue
@@ -0,0 +1,196 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
部门角色录入
+
+
+ 删除
+
+ 批量操作
+
+
+
+
+
+
+
+ 编辑
+
+
+
+ 更多
+
+
+
+ handleDelete(record.id)">
+ 删除
+
+
+
+ 详情
+
+
+ 授权
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/DeptRoleUserModal.vue b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleUserModal.vue
new file mode 100644
index 00000000..67219d67
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/DeptRoleUserModal.vue
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ des.text }}
+
+
+
+
+
+
+
+
+ 无可配置角色!
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/DeptUserInfo.vue b/ant-design-vue-jeecg/src/views/system/modules/DeptUserInfo.vue
index c88268ff..332ae340 100644
--- a/ant-design-vue-jeecg/src/views/system/modules/DeptUserInfo.vue
+++ b/ant-design-vue-jeecg/src/views/system/modules/DeptUserInfo.vue
@@ -7,7 +7,7 @@
-
+
@@ -25,7 +25,7 @@
-
+
用户录入
添加已有用户
@@ -34,7 +34,7 @@
- 删除关系
+ 取消关联
批量操作
@@ -80,10 +80,13 @@
- handleDelete(record.id)">
- 删除关系
+ handleDelete(record.id)">
+ 取消关联
+
+ 分配部门角色
+
@@ -96,6 +99,7 @@
+
@@ -104,11 +108,13 @@
import {getAction, postAction, deleteAction} from '@/api/manage'
import SelectUserModal from './SelectUserModal'
import UserModal from './UserModal'
+ import DeptRoleUserModal from './DeptRoleUserModal'
export default {
name: "DeptUserInfo",
mixins: [JeecgListMixin],
components: {
+ DeptRoleUserModal,
SelectUserModal,
UserModal
},
@@ -127,6 +133,21 @@
align: "center",
dataIndex: 'realname'
},
+ {
+ title: '性别',
+ align: "center",
+ dataIndex: 'sex_dictText'
+ },
+ {
+ title: '电话',
+ align: "center",
+ dataIndex: 'phone'
+ },
+ {
+ title: '部门',
+ align: "center",
+ dataIndex: 'orgCode'
+ },
{
title: '操作',
dataIndex: 'action',
@@ -146,7 +167,12 @@
},
methods: {
-
+ searchReset() {
+ this.queryParam = {}
+ this.currentDeptId = '';
+ this.loadData(1);
+ this.$emit('clearSelectedDepartKeys')
+ },
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
@@ -156,11 +182,11 @@
if (arg === 1) {
this.ipagination.current = 1;
}
- if (this.currentDeptId === '') return;
- var params = this.getQueryParams();//查询条件
+ //if (this.currentDeptId === '') return;
+ let params = this.getQueryParams();//查询条件
params.depId = this.currentDeptId;
getAction(this.url.list, params).then((res) => {
- if (res.success) {
+ if (res.success && res.result) {
this.dataSource = res.result.records;
this.ipagination.total = res.result.total;
}
@@ -172,6 +198,11 @@
this.$message.error("请设置url.deleteBatch属性!")
return
}
+ if (!this.currentDeptId) {
+ this.$message.error("未选中任何部门,无法取消部门与用户的关联!")
+ return
+ }
+
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
return;
@@ -183,12 +214,12 @@
var that = this;
console.log(this.currentDeptId);
this.$confirm({
- title: "确认删除",
- content: "是否删除选中数据?",
+ title: "确认取消",
+ content: "是否取消用户与选中部门的关联?",
onOk: function () {
deleteAction(that.url.deleteBatch, {depId: that.currentDeptId, userIds: ids}).then((res) => {
if (res.success) {
- that.$message.success(res.message);
+ that.$message.success("删除用户与选中部门关系成功!");
that.loadData();
that.onClearSelected();
} else {
@@ -204,10 +235,15 @@
this.$message.error("请设置url.delete属性!")
return
}
+ if (!this.currentDeptId) {
+ this.$message.error("未选中任何部门,无法取消部门与用户的关联!")
+ return
+ }
+
var that = this;
deleteAction(that.url.delete, {depId: this.currentDeptId, userId: id}).then((res) => {
if (res.success) {
- that.$message.success(res.message);
+ that.$message.success("删除用户与选中部门关系成功!");
if (this.selectedRowKeys.length>0){
for(let i =0; i
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/SysCheckRuleTestModal.vue b/ant-design-vue-jeecg/src/views/system/modules/SysCheckRuleTestModal.vue
new file mode 100644
index 00000000..d9ede26d
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/SysCheckRuleTestModal.vue
@@ -0,0 +1,58 @@
+
+
+
+
+ testValue=e.target.value"/>
+
+
+
+
+
+
+
+
+ {{index+1}}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/SysDataSourceModal.vue b/ant-design-vue-jeecg/src/views/system/modules/SysDataSourceModal.vue
new file mode 100644
index 00000000..8ae463ba
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/SysDataSourceModal.vue
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 测试
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/SysDepartRoleModal.vue b/ant-design-vue-jeecg/src/views/system/modules/SysDepartRoleModal.vue
new file mode 100644
index 00000000..ac982f83
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/SysDepartRoleModal.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/UserModal.vue b/ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
index 070caf1b..994f3bfe 100644
--- a/ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
+++ b/ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
@@ -36,8 +36,8 @@
-
-
+
+
@@ -71,23 +71,33 @@
选择
-
-
+
+
+ 普通用户
+ 上级
+
+
+
+
-
-
-
+ {{item.title}}
+
+
+
+
+
@@ -145,10 +155,12 @@
import {addUser,editUser,queryUserRole,queryall } from '@/api/api'
import { disabledAuthFilter } from "@/utils/authFilter"
import {duplicateCheck } from '@/api/api'
+ import JImageUpload from '../../../components/jeecg/JImageUpload'
export default {
name: "UserModal",
components: {
+ JImageUpload,
departWindow,
JSelectPosition
},
@@ -164,6 +176,7 @@
checkedDepartKeys:[],
checkedDepartNames:[], // 保存部门的名称 =>title
checkedDepartNameString:"", // 保存部门的名称 =>title
+ resultDepartOptions:[],
userId:"", //保存用户id
disableSubmit:false,
userDepartModel:{userId:'',departIdList:[]}, // 保存SysUserDepart的用户部门中间表数据需要的对象
@@ -213,6 +226,8 @@
]
}
},
+ departIdShow:false,
+ departIds:[], //负责部门id
title:"操作",
visible: false,
model: {},
@@ -233,11 +248,13 @@
picUrl: "",
url: {
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
- imgerver: window._CONFIG['domianURL']+"/sys/common/view",
+ imgerver: window._CONFIG['staticDomainURL'],
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
},
+ identity:"1",
+ fileList:[],
}
},
created () {
@@ -287,6 +304,9 @@
this.checkedDepartNames=[];
this.checkedDepartNameString = "";
this.userId=""
+ this.resultDepartOptions=[];
+ this.departId=[];
+ this.departIdShow=false;
},
add () {
this.picUrl = "";
@@ -301,7 +321,9 @@
that.form.resetFields();
if(record.hasOwnProperty("id")){
that.loadUserRoles(record.id);
- this.picUrl = "Has no pic url yet";
+ setTimeout(() => {
+ this.fileList = record.avatar;
+ }, 5)
}
that.userId = record.id;
that.visible = true;
@@ -309,6 +331,14 @@
that.$nextTick(() => {
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync','workNo','telephone','post'))
});
+ //身份为上级显示负责部门,否则不显示
+ if(this.model.identity=="2"){
+ this.identity="2";
+ this.departIdShow=true;
+ }else{
+ this.identity="1";
+ this.departIdShow=false;
+ }
// 调用查询用户对应的部门信息的方法
that.checkedDepartKeys = [];
that.loadCheckedDeparts();
@@ -320,10 +350,25 @@
getAction(that.url.userWithDepart,{userId:that.userId}).then((res)=>{
that.checkedDepartNames = [];
if(res.success){
+ var depart=[];
+ var departId=[];
for (let i = 0; i < res.result.length; i++) {
that.checkedDepartNames.push(res.result[i].title);
this.checkedDepartNameString = this.checkedDepartNames.join(",");
that.checkedDepartKeys.push(res.result[i].key);
+ //新增负责部门选择下拉框
+ depart.push({
+ key:res.result[i].key,
+ title:res.result[i].title
+ })
+ departId.push(res.result[i].key)
+ }
+ that.resultDepartOptions=depart;
+ //判断部门id是否存在,不存在择直接默认当前所在部门
+ if(this.model.departIds){
+ this.departIds=this.model.departIds.split(",");
+ }else{
+ this.departIds=departId;
}
that.userDepartModel.departIdList = that.checkedDepartKeys
}else{
@@ -341,6 +386,11 @@
this.checkedDepartNameString='';
this.checkedDepartKeys = [];
this.selectedDepartKeys = [];
+ this.resultDepartOptions=[];
+ this.departIds=[];
+ this.departIdShow=false;
+ this.identity="1";
+ this.fileList=[];
},
moment,
handleSubmit () {
@@ -350,17 +400,22 @@
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
- let avatar = that.model.avatar;
if(!values.birthday){
values.birthday = '';
}else{
values.birthday = values.birthday.format(this.dateFormat);
}
let formData = Object.assign(this.model, values);
- formData.avatar = avatar;
+ formData.avatar = that.fileList;
formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
formData.selecteddeparts = this.userDepartModel.departIdList.length>0?this.userDepartModel.departIdList.join(","):'';
-
+ formData.identity=this.identity;
+ //如果是上级择传入departIds,否则为空
+ if(this.identity==="2"){
+ formData.departIds=this.departIds.join(",");
+ }else{
+ formData.departIds="";
+ }
// that.addDepartsToUser(that,formData); // 调用根据当前用户添加部门信息的方法
let obj;
if(!this.model.id){
@@ -380,7 +435,6 @@
that.confirmLoading = false;
that.checkedDepartNames = [];
that.userDepartModel.departIdList = {userId:'',departIdList:[]};
-
that.close();
})
@@ -528,9 +582,6 @@
}
}
},
- getAvatarView(){
- return this.url.imgerver +"/"+ this.model.avatar;
- },
// 搜索用户对应的部门API
onSearch(){
this.$refs.departWindow.add(this.checkedDepartKeys,this.userId);
@@ -543,11 +594,21 @@
this.checkedDepartNameString = '';
this.userId = formData.userId;
this.userDepartModel.userId = formData.userId;
+ this.departIds=[];
+ this.resultDepartOptions=[];
+ var depart=[];
for (let i = 0; i < formData.departIdList.length; i++) {
this.selectedDepartKeys.push(formData.departIdList[i].key);
this.checkedDepartNames.push(formData.departIdList[i].title);
this.checkedDepartNameString = this.checkedDepartNames.join(",");
+ //新增部门选择,如果上面部门选择后不为空直接付给负责部门
+ depart.push({
+ key:formData.departIdList[i].key,
+ title:formData.departIdList[i].title
+ })
+ this.departIds.push(formData.departIdList[i].key)
}
+ this.resultDepartOptions=depart;
this.userDepartModel.departIdList = this.selectedDepartKeys;
this.checkedDepartKeys = this.selectedDepartKeys //更新当前的选择keys
},
@@ -560,6 +621,13 @@
this.drawerWidth = 700;
}
},
+ identityChange(e){
+ if(e.target.value==="1"){
+ this.departIdShow=false;
+ }else{
+ this.departIdShow=true;
+ }
+ }
}
}
diff --git a/ant-design-vue-jeecg/src/views/system/modules/UserRecycleBinModal.vue b/ant-design-vue-jeecg/src/views/system/modules/UserRecycleBinModal.vue
new file mode 100644
index 00000000..0bbc79f4
--- /dev/null
+++ b/ant-design-vue-jeecg/src/views/system/modules/UserRecycleBinModal.vue
@@ -0,0 +1,191 @@
+
+
+
+
+ 已选择
+ {{ selectedRowKeys.length }}
+ 项
+
+
+ 清空选择
+
+ 批量还原
+
+ 批量删除
+
+
+
+
+
+
+
+
+
+
+
+
+ 还原用户
+
+ 彻底删除
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue b/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue
index 29c4d38d..523f92b2 100644
--- a/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue
+++ b/ant-design-vue-jeecg/src/views/system/modules/UserRoleModal.vue
@@ -45,7 +45,8 @@
取消
- 提交
+ 仅保存
+ 保存并关闭
@@ -134,7 +135,7 @@
handleCancel () {
this.close()
},
- handleSubmit(){
+ handleSubmit(exit) {
let that = this;
let params = {
roleId:that.roleId,
@@ -147,18 +148,20 @@
if(res.success){
that.$message.success(res.message);
that.loading = false;
- that.close();
+ if (exit) {
+ that.close()
+ }
}else {
that.$message.error(res.message);
that.loading = false;
- that.close();
+ if (exit) {
+ that.close()
+ }
}
+ this.loadData();
})
},
- },
- watch: {
- visible () {
- if (this.visible) {
+ loadData(){
queryTreeListForRole().then((res) => {
this.treeData = res.result.treeList
this.allTreeKeys = res.result.ids
@@ -170,6 +173,12 @@
})
})
}
+ },
+ watch: {
+ visible () {
+ if (this.visible) {
+ this.loadData();
+ }
}
}
}
diff --git a/ant-design-vue-jeecg/src/views/user/Alteration.vue b/ant-design-vue-jeecg/src/views/user/Alteration.vue
index c032d74e..26f746f6 100644
--- a/ant-design-vue-jeecg/src/views/user/Alteration.vue
+++ b/ant-design-vue-jeecg/src/views/user/Alteration.vue
@@ -1,13 +1,13 @@
-
+
-
-
-
-
+
+
+
+
-
+
@@ -20,6 +20,7 @@
import Step2 from './Step2'
import Step3 from './Step3'
import Step4 from './Step4'
+
export default {
name: "Alteration",
components: {
@@ -28,11 +29,11 @@
Step3,
Step4
},
- data () {
+ data() {
return {
description: '将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。',
currentTab: 0,
- userList:{},
+ userList: {},
// form
form: null,
}
@@ -40,19 +41,19 @@
methods: {
// handler
- nextStep (data) {
- this.userList=data;
+ nextStep(data) {
+ this.userList = data;
if (this.currentTab < 4) {
this.currentTab += 1
}
},
- prevStep (data) {
- this.userList=data;
+ prevStep(data) {
+ this.userList = data;
if (this.currentTab > 0) {
this.currentTab -= 1
}
},
- finish () {
+ finish() {
this.currentTab = 0
}
}
diff --git a/ant-design-vue-jeecg/src/views/user/Login.vue b/ant-design-vue-jeecg/src/views/user/Login.vue
index 42ae3774..2f70744a 100644
--- a/ant-design-vue-jeecg/src/views/user/Login.vue
+++ b/ant-design-vue-jeecg/src/views/user/Login.vue
@@ -9,7 +9,7 @@
@@ -18,7 +18,7 @@
-
+
-
-
+
-
-
+
+
+
@@ -88,7 +88,7 @@
忘记密码
-
+
注册账户
@@ -173,8 +173,7 @@
import Vue from 'vue'
import { ACCESS_TOKEN ,ENCRYPTED_STRING} from "@/store/mutation-types"
import JGraphicCode from '@/components/jeecg/JGraphicCode'
- import { putAction } from '@/api/manage'
- import { postAction } from '@/api/manage'
+ import { putAction,postAction,getAction } from '@/api/manage'
import { encryption , getEncryptedString } from '@/utils/encryption/aesEncrypt'
import store from '@/store/'
import { USER_INFO } from "@/store/mutation-types"
@@ -202,11 +201,11 @@
smsSendBtn: false,
},
validatorRules:{
- username:{rules: [{ required: true, message: '请输入用户名!',validator: 'click'}]},
+ username:{rules: [{ required: true, message: '请输入用户名!'},{validator: this.handleUsernameOrEmail}]},
password:{rules: [{ required: true, message: '请输入密码!',validator: 'click'}]},
mobile:{rules: [{validator:this.validateMobile}]},
captcha:{rule: [{ required: true, message: '请输入验证码!'}]},
- inputCode:{rules: [{ required: true, message: '请输入验证码!'},{validator: this.validateInputCode}]}
+ inputCode:{rules: [{ required: true, message: '请输入验证码!'}]}
},
verifiedCode:"",
inputCodeContent:"",
@@ -216,12 +215,16 @@
departVisible:false,
departSelected:"",
currentUsername:"",
- validate_status:""
+ validate_status:"",
+ currdatetime:'',
+ randCodeImage:''
}
},
created () {
+ this.currdatetime = new Date().getTime();
Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData();
+ this.handleChangeCheckCode();
// update-begin- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
//this.getEncrypte();
// update-end- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
@@ -257,10 +260,9 @@
loginParams.password = values.password
loginParams.remember_me = values.rememberMe
// update-begin- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
- let checkParams = this.$refs.jgraphicCodeRef.getLoginParam()
- loginParams.captcha = checkParams.checkCode
- loginParams.checkKey = checkParams.checkKey
-
+ loginParams.captcha = that.inputCodeContent
+ loginParams.checkKey = that.currdatetime
+ console.log("登录参数",loginParams)
that.Login(loginParams).then((res) => {
this.departConfirm(res)
}).catch((err) => {
@@ -339,6 +341,16 @@
this.stepCaptchaVisible = false
})
},
+ handleChangeCheckCode(){
+ this.currdatetime = new Date().getTime();
+ getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{
+ if(res.success){
+ this.randCodeImage = res.result
+ }else{
+ this.$message.error(res.message)
+ }
+ })
+ },
loginSuccess () {
// update-begin- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
// this.loginBtn = false
@@ -384,12 +396,6 @@
},
inputCodeChange(e){
this.inputCodeContent = e.target.value
- if(!e.target.value||0==e.target.value){
- this.inputCodeNull=true
- }else{
- this.inputCodeContent = this.inputCodeContent.toLowerCase()
- this.inputCodeNull=false
- }
},
departConfirm(res){
if(res.success){
@@ -452,10 +458,12 @@
},
getRouterData(){
this.$nextTick(() => {
- this.form.setFieldsValue({
- 'username': this.$route.params.username
- });
- })
+ if (this.$route.params.username) {
+ this.form.setFieldsValue({
+ 'username': this.$route.params.username
+ });
+ }
+ })
},
//获取密码加密规则
getEncrypte(){
diff --git a/ant-design-vue-jeecg/src/views/user/RegisterResult.vue b/ant-design-vue-jeecg/src/views/user/RegisterResult.vue
index 97d826c9..389e140c 100644
--- a/ant-design-vue-jeecg/src/views/user/RegisterResult.vue
+++ b/ant-design-vue-jeecg/src/views/user/RegisterResult.vue
@@ -26,7 +26,7 @@
},
computed: {
email () {
- let v = this.form && this.form.username || 'xxx'
+ let v = this.form ? this.form.username || this.form.mobile : ' XXX '
let title = `你的账户:${v} 注册成功`
this.username = v;
return title
diff --git a/ant-design-vue-jeecg/src/views/user/Step1.vue b/ant-design-vue-jeecg/src/views/user/Step1.vue
index e15e5909..46b09705 100644
--- a/ant-design-vue-jeecg/src/views/user/Step1.vue
+++ b/ant-design-vue-jeecg/src/views/user/Step1.vue
@@ -1,14 +1,14 @@
-
+
+ placeholder="请输入用户账号或手机号">
@@ -32,6 +32,7 @@
+ 使用已有账户登录
下一步
@@ -40,95 +41,99 @@
\ No newline at end of file
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal__Style#Drawer.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal__Style#Drawer.vuei
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal__Style#Drawer.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal__Style#Drawer.vuei
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
similarity index 87%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
index d4b38dc2..d3150da9 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
@@ -42,6 +42,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: ${tableVo.ftlDescription}
@@ -49,6 +52,7 @@ import com.alibaba.fastjson.JSON;
* @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0
*/
+@Api(tags="${tableVo.ftlDescription}")
@RestController
@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
@Slf4j
@@ -69,6 +73,8 @@ public class ${entityName}Controller {
* @param req
* @return
*/
+ @AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
+ @ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
@GetMapping(value = "/list")
public Result> queryPageList(${entityName} ${entityName?uncap_first},
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@@ -86,6 +92,8 @@ public class ${entityName}Controller {
* @param ${entityName?uncap_first}Page
* @return
*/
+ @AutoLog(value = "${tableVo.ftlDescription}-添加")
+ @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
@PostMapping(value = "/add")
public Result> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
${entityName} ${entityName?uncap_first} = new ${entityName}();
@@ -100,6 +108,8 @@ public class ${entityName}Controller {
* @param ${entityName?uncap_first}Page
* @return
*/
+ @AutoLog(value = "${tableVo.ftlDescription}-编辑")
+ @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
@PutMapping(value = "/edit")
public Result> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
${entityName} ${entityName?uncap_first} = new ${entityName}();
@@ -118,6 +128,8 @@ public class ${entityName}Controller {
* @param id
* @return
*/
+ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
+ @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
@DeleteMapping(value = "/delete")
public Result> delete(@RequestParam(name="id",required=true) String id) {
${entityName?uncap_first}Service.delMain(id);
@@ -130,6 +142,8 @@ public class ${entityName}Controller {
* @param ids
* @return
*/
+ @AutoLog(value = "${tableVo.ftlDescription}-批量删除")
+ @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(",")));
@@ -142,6 +156,8 @@ public class ${entityName}Controller {
* @param id
* @return
*/
+ @AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
+ @ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
@GetMapping(value = "/queryById")
public Result> queryById(@RequestParam(name="id",required=true) String id) {
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
@@ -159,6 +175,8 @@ public class ${entityName}Controller {
* @param id
* @return
*/
+ @AutoLog(value = "${sub.ftlDescription}集合-通过id查询")
+ @ApiOperation(value="${sub.ftlDescription}集合-通过id查询", notes="${sub.ftlDescription}-通过id查询")
@GetMapping(value = "/query${sub.entityName}ByMainId")
public Result> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
similarity index 56%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
index 1f112ff4..5553a250 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
@@ -8,6 +8,10 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
/**
* @Description: ${tableVo.ftlDescription}
@@ -15,26 +19,46 @@ import org.springframework.format.annotation.DateTimeFormat;
* @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0
*/
+@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}")
@Data
@TableName("${tableName}")
public class ${entityName} implements Serializable {
private static final long serialVersionUID = 1L;
-
+
<#list originalColumns as po>
+ <#-- 生成字典Code -->
+ <#assign list_field_dictCode="">
+ <#if po.classType='sel_user'>
+ <#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'>
+ <#elseif po.classType='sel_depart'>
+ <#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'>
+ <#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'>
+ <#if po.dictTable?default("")?trim?length gt 1>
+ <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'>
+ <#elseif po.dictField?default("")?trim?length gt 1>
+ <#assign list_field_dictCode=', dicCode = "${po.dictField}"'>
+ #if>
+ #if>
/**${po.filedComment}*/
<#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR)
<#else>
<#if po.fieldDbType =='Date'>
<#if po.classType=='date'>
+ @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode})
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
<#else>
+ @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode})
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
#if>
<#else>
+ @Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
#if>
+ <#if list_field_dictCode?length gt 1>
+ @Dict(${list_field_dictCode?substring(2)})
+ #if>
#if>
<#if po.fieldDbType=='Blob'>
private transient java.lang.String ${po.fieldName}String;
@@ -65,6 +89,7 @@ public class ${entityName} implements Serializable {
return "";
}
<#else>
+ @ApiModelProperty(value = "${po.filedComment}")
private ${po.fieldType} ${po.fieldName};
#if>
#list>
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
similarity index 57%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
index 730916c7..fa410574 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
@@ -11,6 +11,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.Date;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
/**
* @Description: ${subTab.ftlDescription}
@@ -18,30 +20,45 @@ import java.util.Date;
* @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0
*/
+@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}")
@Data
@TableName("${subTab.tableName}")
public class ${subTab.entityName} implements Serializable {
private static final long serialVersionUID = 1L;
-
+
<#list subTab.originalColumns as po>
+ <#-- 生成字典Code -->
+ <#assign list_field_dictCode="">
+ <#if po.classType='sel_user'>
+ <#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'>
+ <#elseif po.classType='sel_depart'>
+ <#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'>
+ <#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'>
+ <#if po.dictTable?default("")?trim?length gt 1>
+ <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'>
+ <#elseif po.dictField?default("")?trim?length gt 1>
+ <#assign list_field_dictCode=', dicCode = "${po.dictField}"'>
+ #if>
+ #if>
/**${po.filedComment}*/
<#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR)
<#else>
<#if po.fieldDbType =='Date'>
<#if po.classType=='date'>
- @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd")
+ @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode})
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
<#else>
- @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+ @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode})
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
#if>
<#elseif !subTab.foreignKeys?seq_contains(po.fieldName?cap_first)>
- @Excel(name = "${po.filedComment}", width = 15)
+ @Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
#if>
#if>
+ @ApiModelProperty(value = "${po.filedComment}")
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}#if> ${po.fieldName};
#list>
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/one/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vo/${entityName}Page.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vo/${entityName}Page.javai
similarity index 85%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vo/${entityName}Page.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vo/${entityName}Page.javai
index 1bc4e035..43b5f902 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vo/${entityName}Page.javai
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vo/${entityName}Page.javai
@@ -12,6 +12,8 @@ import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
/**
* @Description: ${tableVo.ftlDescription}
@@ -20,6 +22,7 @@ import java.util.Date;
* @Version: V1.0
*/
@Data
+@ApiModel(value="${tableName}Page对象", description="${tableVo.ftlDescription}")
public class ${entityName}Page {
<#list originalColumns as po>
@@ -40,12 +43,14 @@ public class ${entityName}Page {
@Excel(name = "${po.filedComment}", width = 15)
#if>
#if>
+ @ApiModelProperty(value = "${po.filedComment}")
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}#if> ${po.fieldName};
#list>
<#list subTables as sub>
@ExcelCollection(name="${sub.ftlDescription}")
- private List<${sub.entityName}> ${sub.entityName?uncap_first}List;
+ @ApiModelProperty(value = "${sub.ftlDescription}")
+ private List<${sub.entityName}> ${sub.entityName?uncap_first}List;
#list>
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
similarity index 82%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
index 1f143ac6..e5382ad0 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
@@ -18,7 +18,7 @@
#if>
<#if po.queryMode=='single'>
- <#if query_field_no gt 1> #if>
+ <#if query_field_no gt 1> #if>
<#if query_field_no gt 1> #if>
<#if po.classType=='date'>
<#assign query_field_date=true>
@@ -42,7 +42,7 @@
<#if query_field_no gt 1> #if>
<#if query_field_no gt 1> #if>
<#else>
- <#if query_field_no gt 1> #if>
+ <#if query_field_no gt 1> #if>
<#if query_field_no gt 1> #if>
<#if po.classType=='date'>
<#assign query_field_date=true>
@@ -77,7 +77,7 @@
#if>
<#if query_flag>
-
+
查询
重置
@@ -182,7 +182,7 @@
import JDate from '@/components/jeecg/JDate.vue'
#if>
<#if list_need_dict>
- import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+ import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
#if>
<#if list_need_category>
import { loadCategoryData } from '@/api/api'
@@ -238,34 +238,15 @@
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
scopedSlots: {customRender: 'imgSlot'}
- <#elseif po.classType=='sel_search' || po.classType=='list_multi' || po.classType=='list' || po.classType=='radio' || po.classType=='checkbox' || po.classType=='sel_depart'>
- dataIndex: '${po.fieldName}',
- customRender:(text)=>{
- if(!text){
- return ''
- }else{
- return filterMultiDictText(this.dictOptions['${po.fieldName}'], text+"")
- }
- }
+ <#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox' || po.classType=='sel_depart' || po.classType=='sel_user'>
+ dataIndex: '${po.fieldName}_dictText'
<#elseif po.classType=='cat_tree'>
<#if list_need_category>
dataIndex: '${po.fieldName}',
- customRender:(text)=>{
- if(!text){
- return ''
- }else{
- return filterMultiDictText(this.dictOptions['${po.fieldName}'], text+"")
- }
- }
+ customRender: (text) => (text ? filterMultiDictText(this.dictOptions['${po.fieldName}'], text) : '')
<#else>
dataIndex: '${po.fieldName}',
- customRender:(text,record)=>{
- if(!text){
- return ''
- }else{
- return record['${po.dictText}']
- }
- }
+ customRender: (text, record) => (text ? record['${po.dictText}'] : '')
#if>
<#else>
dataIndex: '${po.fieldName}'
@@ -287,16 +268,7 @@
exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
},
- dictOptions:{
- <#list columns as po>
- <#if (po.isQuery=='Y' || po.isShowList=='Y')>
- <#if po.classType='sel_depart' || po.classType=='list_multi' || po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
- ${po.fieldName}:[],
- #if>
- #if>
- #list>
- },
-
+ dictOptions:{},
}
},
computed: {
@@ -308,30 +280,12 @@
initDictConfig(){
<#list columns as po>
<#if (po.isQuery=='Y' || po.isShowList=='Y') && po.classType!='popup'>
- <#if po.classType='sel_depart'>
- initDictOptions('sys_depart,depart_name,id').then((res) => {
- if (res.success) {
- this.$set(this.dictOptions, '${po.fieldName}', res.result)
- }
- })
- <#elseif po.classType=='cat_tree' && list_need_category==true>
+ <#if po.classType=='cat_tree' && list_need_category==true>
loadCategoryData({code:"${po.dictField}"}).then((res) => {
if (res.success) {
this.$set(this.dictOptions, '${po.fieldName}', res.result)
}
})
- <#elseif po.classType=='sel_search' || po.classType=='list_multi' || po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
- <#assign list_field_dictCode="">
- <#if po.dictTable?default("")?trim?length gt 1>
- <#assign list_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
- <#elseif po.dictField?default("")?trim?length gt 1>
- <#assign list_field_dictCode="${po.dictField}">
- #if>
- initDictOptions('${list_field_dictCode}').then((res) => {
- if (res.success) {
- this.$set(this.dictOptions, '${po.fieldName}', res.result)
- }
- })
#if>
#if>
#list>
@@ -341,5 +295,5 @@
}
\ No newline at end of file
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
similarity index 88%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
index 3e843816..8b11a840 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
@@ -47,7 +47,7 @@
<#elseif po.classType =='popup'>
<#assign form_popup=true>
<#elseif po.classType =='sel_depart'>
<#assign form_sel_depart=true>
-
+
<#elseif po.classType =='sel_user'>
<#assign form_sel_user = true>
-
+
<#elseif po.classType =='textarea'>
-
+
<#elseif po.classType=='list' || po.classType=='radio'>
<#assign form_select = true>
-
+
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
<#assign form_select_multi = true>
-
+
<#elseif po.classType=='sel_search'>
<#assign form_select_search = true>
-
+
<#elseif po.classType=='cat_tree'>
<#assign form_cat_tree = true>
- back="${po.dictText}" @change="handleCategoryChange"#if>/>
+ back="${po.dictText}" @change="handleCategoryChange"#if>/>
<#if po.dictText?default("")?trim?length gt 1>
<#assign form_cat_back = "${po.dictText}">
#if>
@@ -80,7 +80,7 @@
<#elseif po.classType=='file' || po.classType=='image'>
<#assign form_file = true>
-
+
<#elseif po.classType=='umeditor'>
<#assign form_editor = true>
@@ -136,6 +136,7 @@
import pick from 'lodash.pick'
import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
+ import { validateDuplicateValue } from '@/utils/util'
<#list subTables as sub>
<#if sub.foreignRelationType =='1'>
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
@@ -222,19 +223,7 @@
},
// 新增时子表默认添加几行空数据
addDefaultRowNum: 1,
- validatorRules: {
-<#list columns as po>
-<#if po.isShow =='Y'>
- <#if po.fieldName !='id'>
- <#if po.nullable =='N'>
- ${po.fieldName}: { rules: [{ required: true, message: '请输入${po.filedComment}!' }] },
- <#else>
- ${po.fieldName}:{},
- #if>
- #if>
-#if>
-#list>
- },
+ <#include "/common/validatorRulesTemplate.ftl">
refKeys: [<#list subTables as sub>'${sub.entityName?uncap_first}', #list>],
tableKeys:[<#list subTables as sub><#if sub.foreignRelationType =='0'>'${sub.entityName?uncap_first}', #if>#list>],
activeKey: '${subTables[0].entityName?uncap_first}',
@@ -313,8 +302,18 @@
placeholder: '请输入${'$'}{title}',
#if>
defaultValue: '',
- <#if col.nullable =='N'>
+ <#-- 子表的校验 -->
+ <#assign subFieldValidType = col.fieldValidType!''>
+ <#-- 非空校验 -->
+ <#if col.nullable == 'N' || subFieldValidType == '*'>
validateRules: [{ required: true, message: '${'$'}{title}不能为空' }],
+ <#-- 其他情况下,只要有值就被认为是正则校验 -->
+ <#elseif subFieldValidType?length gt 0>
+ <#assign subMessage = '格式不正确'>
+ <#if subFieldValidType == 'only' >
+ <#assign subMessage = '不能重复'>
+ #if>
+ validateRules: [{ pattern: "${subFieldValidType}", message: "${'$'}{title}${subMessage}" }],
#if>
},
#if>
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Form.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Form.vuei
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Form.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Form.vuei
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
similarity index 95%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
index a6bc2205..2bbf62e8 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
@@ -66,10 +66,14 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
- if(oConvertUtils.isEmpty(${entityName?uncap_first}.get${pidFieldName?cap_first}())){
- ${entityName?uncap_first}.set${pidFieldName?cap_first}("0");
+ String parentId = ${entityName?uncap_first}.get${pidFieldName?cap_first}();
+ if (oConvertUtils.isEmpty(parentId)) {
+ parentId = "0";
}
+ ${entityName?uncap_first}.set${pidFieldName?cap_first}(null);
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
+ // 使用 eq 防止模糊查询
+ queryWrapper.eq("${pidFieldName}", parentId);
Page<${entityName}> page = new Page<${entityName}>(pageNo, pageSize);
IPage<${entityName}> pageList = ${entityName?uncap_first}Service.page(page, queryWrapper);
return Result.ok(pageList);
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
similarity index 63%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
index f98eae7f..0781c10b 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
@@ -22,24 +22,37 @@ import org.jeecg.common.aspect.annotation.Dict;
@TableName("${tableName}")
public class ${entityName} implements Serializable {
private static final long serialVersionUID = 1L;
-
+
<#list originalColumns as po>
+ <#-- 生成字典Code -->
+ <#assign list_field_dictCode="">
+ <#if po.classType='sel_user'>
+ <#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'>
+ <#elseif po.classType='sel_depart'>
+ <#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'>
+ <#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'>
+ <#if po.dictTable?default("")?trim?length gt 1>
+ <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'>
+ <#elseif po.dictField?default("")?trim?length gt 1>
+ <#assign list_field_dictCode=', dicCode = "${po.dictField}"'>
+ #if>
+ #if>
/**${po.filedComment}*/
<#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR)
<#else>
<#if po.fieldDbType =='Date'>
<#if po.classType=='date'>
- @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd")
+ @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode})
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
<#else>
- @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+ @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode})
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
#if>
<#else>
- @Excel(name = "${po.filedComment}", width = 15)
+ @Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
#if>
<#-- <#if po.classType!='popup'>
<#if po.dictTable?default("")?trim?length gt 1>
@@ -48,6 +61,9 @@ public class ${entityName} implements Serializable {
@Dict(dicCode="${po.dictField}")
#if>
#if>-->
+ <#if list_field_dictCode?length gt 1>
+ @Dict(${list_field_dictCode?substring(2)})
+ #if>
#if>
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}#if> ${po.fieldName};
#list>
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
similarity index 85%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
index 7d9f5486..b4806b4f 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
@@ -91,7 +91,7 @@
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ${entityName}Modal from './modules/${entityName}Modal'
- import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+ import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: "${entityName}List",
@@ -130,15 +130,8 @@
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
scopedSlots: {customRender: 'imgSlot'}
- <#elseif po.classType=='list_multi' || po.classType=='list' || po.classType=='radio' || po.classType=='checkbox' || po.classType=='sel_depart'>
- dataIndex: '${po.fieldName}',
- customRender:(text)=>{
- if(!text){
- return ''
- }else{
- return filterMultiDictText(this.dictOptions['${po.fieldName}'], text+"")
- }
- }
+ <#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox' || po.classType=='sel_depart' || po.classType=='sel_user'>
+ dataIndex: '${po.fieldName}_dictText'
<#else>
dataIndex: '${po.fieldName}'
#if>
@@ -164,15 +157,7 @@
expandedRowKeys:[],
hasChildrenField:"${hasChildrenField}",
pidField:"${pidFieldName}",
- dictOptions:{
- <#list columns as po>
- <#if (po.isQuery=='Y' || po.isShowList=='Y')>
- <#if po.classType='sel_depart' || po.classType=='list_multi' || po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
- ${po.fieldName}:[],
- #if>
- #if>
- #list>
- }
+ dictOptions: {}
}
},
computed: {
@@ -258,25 +243,6 @@
initDictConfig(){
<#list columns as po>
<#if (po.isQuery=='Y' || po.isShowList=='Y') && po.classType!='popup'>
- <#if po.classType='sel_depart'>
- initDictOptions('sys_depart,depart_name,id').then((res) => {
- if (res.success) {
- this.$set(this.dictOptions, '${po.fieldName}', res.result)
- }
- })
- <#elseif po.classType=='list_multi' || po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
- <#assign list_field_dictCode="">
- <#if po.dictTable?default("")?trim?length gt 1>
- <#assign list_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
- <#elseif po.dictField?default("")?trim?length gt 1>
- <#assign list_field_dictCode="${po.dictField}">
- #if>
- initDictOptions('${list_field_dictCode}').then((res) => {
- if (res.success) {
- this.$set(this.dictOptions, '${po.fieldName}', res.result)
- }
- })
- #if>
#if>
#list>
},
@@ -353,5 +319,5 @@
}
\ No newline at end of file
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
similarity index 88%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
index 12df05c8..d64171eb 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
@@ -50,7 +50,7 @@
<#elseif po.classType =='popup'>
<#assign form_popup=true>
<#elseif po.classType =='sel_depart'>
<#assign form_sel_depart=true>
-
+
<#elseif po.classType =='sel_user'>
<#assign form_sel_user = true>
-
+
<#elseif po.classType =='textarea'>
-
+
<#elseif po.classType=='list' || po.classType=='radio'>
<#assign form_select = true>
-
+
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
<#assign form_select_multi = true>
-
+
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
<#elseif po.classType=='file' || po.classType=='image'>
<#assign form_file = true>
-
+
<#else>
#if>
@@ -91,6 +91,7 @@
import { httpAction } from '@/api/manage'
import pick from 'lodash.pick'
+ import { validateDuplicateValue } from '@/utils/util'
<#if form_date>
import JDate from '@/components/jeecg/JDate'
#if>
@@ -155,19 +156,7 @@
},
confirmLoading: false,
- validatorRules:{
- <#list columns as po>
- <#if po.isShow =='Y'>
- <#if po.fieldName !='id'>
- <#if po.nullable =='N'>
- ${po.fieldName}:{rules: [{ required: true, message: '请输入${po.filedComment}!' }]},
- <#else>
- ${po.fieldName}:{},
- #if>
- #if>
- #if>
- #list>
- },
+ <#include "/common/validatorRulesTemplate.ftl">
url: {
add: "/${entityPackage}/${entityName?uncap_first}/add",
edit: "/${entityPackage}/${entityName?uncap_first}/edit",
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/[1-n]Mapper.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/mapper/xml/[1-n]Mapper.xml
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/[1-n]Service.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/service/impl/[1-n]ServiceImpl.javai
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
similarity index 98%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
index b4dbb867..c46dc1a3 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
@@ -18,7 +18,7 @@
#if>
<#if po.queryMode=='single'>
- <#if query_field_no gt 1> #if>
+ <#if query_field_no gt 1> #if>
<#if query_field_no gt 1> #if>
<#if po.classType=='date'>
<#assign query_field_date=true>
@@ -42,7 +42,7 @@
<#if query_field_no gt 1> #if>
<#if query_field_no gt 1> #if>
<#else>
- <#if query_field_no gt 1> #if>
+ <#if query_field_no gt 1> #if>
<#if query_field_no gt 1> #if>
<#if po.classType=='date'>
<#assign query_field_date=true>
@@ -78,7 +78,7 @@
#if>
<#if query_flag>
-
+
查询
重置
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/[1-n]List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/[1-n]List.vuei
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/[1-n]List.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/[1-n]List.vuei
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei
similarity index 100%
rename from jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei
rename to jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/[1-n]Modal.vuei
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
index 9a837c19..7260adc3 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
@@ -8,20 +8,20 @@
<#list columns as po>
<#if po.fieldName !='id' && po_index<= tableVo.searchFieldNum>
-
+
<#elseif po_index == 2>
-
+
<#elseif po.fieldName !='id' && po_index< 5>
-
+
@@ -32,7 +32,7 @@
<#if (columns?size>1) >
#if>
-
+
查询
重置
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one2/java/${bussiPackage}/vue/${entityPackage}/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one2/java/${bussiPackage}/vue/${entityPackage}/${entityName}List.vuei
index ef865c82..62654761 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one2/java/${bussiPackage}/vue/${entityPackage}/${entityName}List.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/one2/java/${bussiPackage}/vue/${entityPackage}/${entityName}List.vuei
@@ -8,20 +8,20 @@
<#list columns as po>
<#if po.fieldName !='id' && po_index<= tableVo.searchFieldNum>
-
+
<#elseif po_index == 2>
-
+
<#elseif po.fieldName !='id' && po_index< 5>
-
+
@@ -32,7 +32,7 @@
<#if (columns?size>1) >
#if>
-
+
查询
重置
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
index ede267da..d6d1ea04 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
@@ -7,14 +7,14 @@
<#list columns as po><#rt/>
<#if po.fieldName !='id' && po_index<= tableVo.searchFieldNum>
-
+
#if>
#list>
-
+
查询
重置
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany2/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany2/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
index 7ffba946..a07b2366 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany2/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template/onetomany2/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
@@ -7,14 +7,14 @@
<#list columns as po><#rt/>
<#if po.fieldName !='id' && po_index<= tableVo.searchFieldNum>
-
+
#if>
#list>
-
+
查询
重置
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/static/bigscreen/template1/js/resize.js b/jeecg-boot/jeecg-boot-module-system/src/main/resources/static/bigscreen/template1/js/resize.js
new file mode 100644
index 00000000..e9795809
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/static/bigscreen/template1/js/resize.js
@@ -0,0 +1,28 @@
+
+window.onresize = function() {
+ setAppScale();
+};
+
+function setAppScale() {
+ var ratioY = $(window).height()/1536;
+ var ratioX = $(window).width()/4352;
+ var screenWidth = window.screen.width;
+ var screenHeigth = window.screen.height;
+ if (screenWidth >= 960) {
+ ratioX = 0.62
+ }
+ if(screenHeigth <= 1080){
+ ratioY = 0.62
+ }
+ $("body").css({
+ transform: "scale("+ ratioX+","+ ratioY+")",
+ transformOrigin: "left top",
+ overflow:"visible"
+ });
+ }
+
+
+$().ready(function(){
+ //初始化时调整大小
+ setAppScale();
+});
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/templates/bigscreen/template1/index.ftl b/jeecg-boot/jeecg-boot-module-system/src/main/resources/templates/bigscreen/template1/index.ftl
index dadbed85..6cfdf4c9 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/templates/bigscreen/template1/index.ftl
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/templates/bigscreen/template1/index.ftl
@@ -7,7 +7,7 @@
- JEECG-boot大屏指挥室
+ JEECG ROOM 作战指挥室
@@ -19,6 +19,7 @@
+
@@ -48,7 +49,7 @@
-
+
diff --git a/jeecg-boot/jeecg-boot-module-system/src/test/java/org/jeecg/modules/online/desform/test/DesformApiTest.java b/jeecg-boot/jeecg-boot-module-system/src/test/java/org/jeecg/modules/online/desform/test/DesformApiTest.java
new file mode 100644
index 00000000..bba82537
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module-system/src/test/java/org/jeecg/modules/online/desform/test/DesformApiTest.java
@@ -0,0 +1,191 @@
+package org.jeecg.modules.online.desform.test;
+
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.RestUtil;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * 表单设计器 API 接口单元测试
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@SuppressWarnings({"FieldCanBeLocal", "SpringJavaAutowiredMembersInspection"})
+public class DesformApiTest {
+
+ @Autowired
+ private RedisUtil redisUtil;
+
+ /**
+ * 测试地址:实际使用时替换成你自己的地址
+ */
+ private final String BASE_URL = "http://localhost:8080/jeecg-boot/desform/api/";
+
+ // 请实际使用时替换成你自己的用户名和密码
+ private final String USERNAME = "admin";
+ private final String PASSWORD = "123456";
+
+ /**
+ * 表单code,实际使用时可以替换成你要测试的表单code
+ */
+ private final String DESFORM_CODE = "qingjiadan";
+
+ /**
+ * 测试用例:新增
+ */
+ @Test
+ public void testAdd() {
+ // 用户Token
+ String token = this.getToken();
+ // 请求地址
+ String url = BASE_URL + DESFORM_CODE;
+ // 请求 Header (用于传递Token)
+ HttpHeaders headers = this.getHeaders(token);
+ // 请求方式是 POST 代表提交新增数据
+ HttpMethod method = HttpMethod.POST;
+
+ System.out.println("请求地址:" + url);
+ System.out.println("请求方式:" + method);
+ System.out.println("请求Token:" + token);
+
+ JSONObject params = new JSONObject();
+ params.put("name", "张三");
+ params.put("sex", "1");
+ params.put("begin_time", "2019-12-27");
+ params.put("remarks", "生病了");
+
+ System.out.println("请求参数:" + params.toJSONString());
+
+ // 利用 RestUtil 请求该url
+ ResponseEntity result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
+ if (result != null && result.getBody() != null) {
+ System.out.println("返回结果:" + result.getBody().toJSONString());
+ } else {
+ System.out.println("查询失败");
+ }
+ }
+
+
+ /**
+ * 测试用例:修改
+ */
+ @Test
+ public void testEdit() {
+ // 数据Id
+ String dataId = "f43ea15c654337fbcb2336dd5422ffc3";
+ // 用户Token
+ String token = this.getToken();
+ // 请求地址
+ String url = BASE_URL + DESFORM_CODE + "/" + dataId;
+ // 请求 Header (用于传递Token)
+ HttpHeaders headers = this.getHeaders(token);
+ // 请求方式是 PUT 代表提交修改数据
+ HttpMethod method = HttpMethod.PUT;
+
+ System.out.println("请求地址:" + url);
+ System.out.println("请求方式:" + method);
+ System.out.println("请求Token:" + token);
+
+ JSONObject params = new JSONObject();
+ params.put("name", "李四");
+ params.put("sex", "0");
+ params.put("begin_time", "2019-12-27");
+ params.put("remarks", "感冒了");
+
+ System.out.println("请求参数:" + params.toJSONString());
+
+ // 利用 RestUtil 请求该url
+ ResponseEntity result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
+ if (result != null && result.getBody() != null) {
+ System.out.println("返回结果:" + result.getBody().toJSONString());
+ } else {
+ System.out.println("查询失败");
+ }
+ }
+
+
+ /**
+ * 测试用例:删除
+ */
+ @Test
+ public void testDelete() {
+ // 数据Id
+ String dataId = "f43ea15c654337fbcb2336dd5422ffc3";
+ // 用户Token
+ String token = this.getToken();
+ // 请求地址
+ String url = BASE_URL + DESFORM_CODE + "/" + dataId;
+ // 请求 Header (用于传递Token)
+ HttpHeaders headers = this.getHeaders(token);
+ // 请求方式是 DELETE 代表删除数据
+ HttpMethod method = HttpMethod.DELETE;
+
+ System.out.println("请求地址:" + url);
+ System.out.println("请求方式:" + method);
+ System.out.println("请求Token:" + token);
+
+ // 利用 RestUtil 请求该url
+ ResponseEntity result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
+ if (result != null && result.getBody() != null) {
+ System.out.println("返回结果:" + result.getBody().toJSONString());
+ } else {
+ System.out.println("查询失败");
+ }
+ }
+
+ /**
+ * 测试用例:查询记录
+ */
+ @Test
+ public void testQuery() {
+ // 数据Id
+ String dataId = "18146ddaa062296442a9310a51baf67b";
+ // 用户Token
+ String token = this.getToken();
+ // 请求地址
+ String url = BASE_URL + DESFORM_CODE + "/" + dataId;
+ // 请求 Header (用于传递Token)
+ HttpHeaders headers = this.getHeaders(token);
+ // 请求方式是 GET 代表获取数据
+ HttpMethod method = HttpMethod.GET;
+
+ System.out.println("请求地址:" + url);
+ System.out.println("请求方式:" + method);
+ System.out.println("请求Token:" + token);
+
+ // 利用 RestUtil 请求该url
+ ResponseEntity result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
+ if (result != null && result.getBody() != null) {
+ System.out.println("返回结果:" + result.getBody().toJSONString());
+ } else {
+ System.out.println("查询失败");
+ }
+ }
+
+ private String getToken() {
+ String token = JwtUtil.sign(USERNAME, PASSWORD);
+ redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
+ redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 60);
+ return token;
+ }
+
+ private HttpHeaders getHeaders(String token) {
+ HttpHeaders headers = new HttpHeaders();
+ String mediaType = MediaType.APPLICATION_JSON_UTF8_VALUE;
+ headers.setContentType(MediaType.parseMediaType(mediaType));
+ headers.set("Accept", mediaType);
+ headers.set("X-Access-Token", token);
+ return headers;
+ }
+
+}
diff --git a/jeecg-boot/pom.xml b/jeecg-boot/pom.xml
index 2f18eeeb..dddab8f1 100644
--- a/jeecg-boot/pom.xml
+++ b/jeecg-boot/pom.xml
@@ -2,7 +2,7 @@
4.0.0
org.jeecgframework.boot
jeecg-boot-parent
- 2.1.3
+ 2.1.4
pom
@@ -17,7 +17,7 @@
jeecg-boot-base-common
jeecg-boot-module-system
-
+
jeecg
@@ -51,7 +51,7 @@
- 2.1.3
+ 2.1.4
1.8
UTF-8
UTF-8
@@ -62,6 +62,7 @@
3.2.3
1.0.0
3.6.0
+ 26.0-jre
@@ -206,6 +207,24 @@
+
+
+ org.hibernate
+ hibernate-re
+ 2.1.4
+
+
+ org.hibernate
+ hibernate-core
+
+
+ commons-collections
+ commons-collections
+
+
+
+
+
io.springfox
@@ -238,21 +257,6 @@
swagger-models
1.5.22
-
- org.hibernate
- hibernate-re
- 5.2.13
-
-
- org.hibernate
- hibernate-core
-
-
- commons-collections
- commons-collections
-
-
-
@@ -270,14 +274,14 @@
org.jeecgframework.boot
codegenerate
- 1.0.8
+ 1.1.0
org.jeecgframework
autopoi-web
- 1.0.4
+ 1.0.5
commons-codec
@@ -291,7 +295,19 @@
hutool-all
4.5.11
-
+
+
+
+ io.minio
+ minio
+ 4.0.0
+
+
+ com.google.guava
+ guava
+ ${guava.version}
+
+
com.aliyun
@@ -317,6 +333,18 @@
spring-boot-starter-websocket
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+
+
+ commons-dbcp
+ commons-dbcp
+ 1.4
+ compile
+
+
com.aliyun.oss
@@ -344,7 +372,11 @@
-
+
org.apache.maven.plugins
maven-compiler-plugin