Compare commits

...

73 Commits

Author SHA1 Message Date
8b3d83ae0b HW21-0499 表字典接口存在SQL注入漏洞,增加签名拦截器 2021-06-21 20:37:23 +08:00
081c2615be HW21-0499 表字典接口存在SQL注入漏洞,增加签名拦截器 2021-06-21 20:37:09 +08:00
f97c675771 online表单数据源配置,数据库类型识别错误 #2671 2021-06-21 19:29:37 +08:00
1beddbf8e8 online表单数据源配置,不支持数据库密码加密 #2672 2021-06-21 19:29:21 +08:00
8921e84303 群满,加新群 ④774126647 2021-06-17 17:44:43 +08:00
43329545d8 【gitee/I3HTFI】自定义树控件的表单里的外键直接显示id不显示name
新增监控在线用户
阿里监控去掉广告
2021-06-17 10:39:59 +08:00
50333488a5 解决issue#2639 2.4.5升级后出现后端排序报错 2021-06-07 18:21:13 +08:00
624444e3b9 用户添加页面无法修改手机号 2021-06-04 16:52:07 +08:00
1cd0f2627d JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-04 11:14:53 +08:00
18007b0524 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-03 14:04:31 +08:00
d92861ad77 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-03 13:59:37 +08:00
8a6181b108 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 16:25:47 +08:00
6840772959 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 15:51:21 +08:00
1bc7ee3345 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 15:38:47 +08:00
5f25f726c2 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 15:38:28 +08:00
9b14d2d6a5 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 15:38:14 +08:00
130f2bc4be JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 15:37:49 +08:00
832bc376be JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 15:32:35 +08:00
432385fc14 新增一种 Cron表达式 选择组件 2021-06-02 15:28:23 +08:00
4d5ac2b518 JeecgBoot低代码平台 2.4.5 版本发布,钉钉与企业微信集成版本 2021-06-02 15:26:58 +08:00
b83c26b8fd 熔断默认时间改成3秒 2021-06-02 15:25:58 +08:00
b59fc67696 新增图表API接口 2021-06-02 15:22:45 +08:00
af3afc7263 删除不需要的底层工具包 2021-06-02 15:21:16 +08:00
63c3dd26f5 即将发布新版 2021-06-02 09:37:32 +08:00
892196fe9a 外部URL菜单加载为空为空 2021-04-14 22:01:47 +08:00
bbda918cde 升级jimureport,修复已知bug 2021-04-13 16:15:10 +08:00
003ec82f48 阿里oos桶名字修改 2021-04-13 16:14:47 +08:00
4992faf66c minidao db类型说明、阿里oos桶名字修改 2021-04-13 16:14:35 +08:00
34c612d9e4 兼容数据库说明 2021-04-13 16:11:58 +08:00
844f1e228c 外部url菜单,内部打开是,也支持通过 ${token}方式传递当前登录TOKEN 2021-04-07 14:07:41 +08:00
cf5fde80d4 nacos建表语句优化 2021-04-06 14:06:55 +08:00
49ea36c50f 升级脚本到积木报表的最新版本 2021-04-06 14:06:35 +08:00
f6e2b67c61 升级SQL:积木报表的示例 2021-04-05 19:01:12 +08:00
69a4a7df6d 重构登录注册页面为a-form-model模式 2021-04-05 18:58:36 +08:00
649f99664e 积木报表升级到最新版本1.3.1-beta2 2021-04-05 18:53:14 +08:00
ef762ff21f 日志里把具体的文件加上吧 issues/I3BJDQ 2021-04-01 09:44:47 +08:00
02abd5c803 优化生成器模板:让代码更简洁,流程相关代码默认不生成 2021-04-01 09:42:47 +08:00
5e7342b27d 优化代码生成器模板:一对多代码生成(ERP模板)生成的子表实体ApiModel注释中value为附表名称 #2365 2021-04-01 09:40:43 +08:00
ca95d7090c minio上传文件,文件名包含点的时候拼接文件名有问题 issues/I3CLFL 2021-04-01 09:38:45 +08:00
cdec71999a spring-boot-starter-jimureport降低版本,公共仓库可以下载 2021-03-31 17:46:04 +08:00
7990eff7a4 JImageUpload组件单张无法预览和删除 #2382 2021-03-31 12:01:18 +08:00
280f8c26ac online报表配置支持多租户系统变量 issues/I3CL75 2021-03-31 12:00:51 +08:00
4e05eaa4c5 JEditableTable组件popup字段设置必填校验有问题 2021-03-31 11:59:47 +08:00
c6645ed800 描述文字写错修改 2021-03-28 19:51:53 +08:00
a674340c5e 微服务模式部署下,nacos的账户密码如果不使用默认提供的nacos/nacos,会导致gateway读取路由信息失败 #2375 2021-03-28 19:45:50 +08:00
cbd8890cb3 代码生成器,树列表新增,会默认加上上次选的父节点问题 2021-03-24 15:56:31 +08:00
b25fb55d10 代码生成器,树列表固定操作列,解决列表分类未翻译问题 2021-03-24 15:55:59 +08:00
88646bea1b 让不对接流程的表单,生成的页面代码更简洁 2021-03-23 22:26:19 +08:00
9915b84808 升级2.4.3后,微服务网关路由更新bug 2021-03-23 15:30:04 +08:00
35c1214de3 开发和测试环境取消swagger文档密码 2021-03-23 14:23:32 +08:00
434b1a7e63 BindingResult无法使用 #2219 2021-03-23 14:23:06 +08:00
5c7d84117c nacos分组配置问题 #2355 2021-03-23 14:22:37 +08:00
4b9890205e JeecgBoot2.4.3版本发布——企业级低代码平台 2021-03-18 13:43:13 +08:00
d5898139b5 2.3版本oracle、SqlServer数据库脚本 2021-03-18 12:57:39 +08:00
bf438069e2 2.4.3版本发布——企业级低代码平台 2021-03-17 18:46:12 +08:00
c5965b10d8 JeecgBoot2.4.3版本发布——企业级低代码平台 2021-03-17 18:43:44 +08:00
da5ace3397 JeecgBoot2.4.3版本发布——企业级低代码平台 2021-03-17 18:40:08 +08:00
4674097078 单体镜像制作脚本 2021-03-10 14:39:14 +08:00
fea1607f1b 单体镜像制作脚本 2021-03-10 14:35:50 +08:00
d2336bc5e1 依赖jar上传到maven官仓,简化使用 2021-03-09 22:20:12 +08:00
cf0d29557a 重写xxljob避免默认 9999端口冲突 2021-03-09 18:27:34 +08:00
bb4c3c86b0 官仓未同步成功,暂时用jeecg私服 2021-03-09 17:26:15 +08:00
84a6e28677 nacos server本地化采用jar方式启动,简化开发 2021-03-09 11:34:11 +08:00
5b70c1d8b8 nacos server本地化采用jar方式启动,简化开发 2021-03-09 11:33:03 +08:00
f942abe09b 微服务模式相关服务的链接改成host模式 2021-03-09 11:19:51 +08:00
ad4eb300f0 nacos server本地化采用jar方式启动,简化开发 2021-03-09 11:10:01 +08:00
064a5c4a0e nacos server本地化采用jar方式启动,简化开发 2021-03-09 10:33:28 +08:00
6d688a157b nacos server本地化采用jar方式启动,简化开发 2021-03-08 20:30:17 +08:00
d612af5e3b nacos server本地化采用jar方式启动,简化开发 2021-03-08 20:29:36 +08:00
e1c0b0fa38 system服务和demo服务有办法同时使用xxl-job吗 #2313 2021-03-05 17:13:44 +08:00
ac0979c824 system服务和demo服务有办法同时使用xxl-job吗 #2313 2021-03-05 17:08:56 +08:00
78ba7ccba8 system服务和demo服务有办法同时使用xxl-job吗 #2313 2021-03-05 17:02:49 +08:00
b8ff5ebd43 微服务部署下代码生成失效,单体模式下代码生成可用 #2324 2021-03-04 17:39:54 +08:00
368 changed files with 230541 additions and 25336 deletions

1
.gitattributes vendored
View File

@ -2,3 +2,4 @@
*.css linguist-language=Java
*.html linguist-language=Java
*.vue linguist-language=Java
*.sql linguist-language=Java

View File

@ -7,12 +7,12 @@
JEECG BOOT 低代码开发平台(前后端分离版本)
===============
当前最新版本: 2.4.2发布日期2021-01-26
当前最新版本: 2.4.5发布日期2021-06-07
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
[![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://www.jeecg.com)
[![](https://img.shields.io/badge/version-2.4.2-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot)
[![](https://img.shields.io/badge/version-2.4.5-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot)
[![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/zhangdaiscott/jeecg-boot)
[![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/zhangdaiscott/jeecg-boot)
@ -23,7 +23,7 @@ JEECG BOOT 低代码开发平台(前后端分离版本)
<h3 align="center">Java Low Code Platform for Enterprise web applications</h3>
JeecgBoot 是一款基于代码生成器的`低代码`开发平台!前后端分离架构 SpringBoot2.xSpringCloudAnt Design&VueMybatis-plusShiroJWT支持微服务。强大的代码生成器让前后端代码一键生成实现低代码开发! JeecgBoot 引领新的低代码开发模式(OnlineCoding-> 代码生成器-> 手工MERGE) 帮助解决Java项目70%的重复工作,让开发更多关注业务。既能快速提高效率,节省研发成本,同时又不失灵活性!
JeecgBoot 是一款基于代码生成器的`低代码平台`!前后端分离架构 SpringBoot2.xSpringCloudAnt Design&VueMybatis-plusShiroJWT支持微服务。强大的代码生成器让前后端代码一键生成实现低代码开发! JeecgBoot 引领新的低代码开发模式(OnlineCoding-> 代码生成器-> 手工MERGE) 帮助解决Java项目70%的重复工作,让开发更多关注业务。既能快速提高效率,节省研发成本,同时又不失灵活性!
JeecgBoot 提供了一系列`低代码模块`,实现在线开发`真正的零代码`Online表单开发、Online报表、报表配置能力、在线图表设计、大屏设计、移动配置能力、表单设计器、在线设计流程、流程自动化配置、插件能力可插拔等等
@ -61,7 +61,7 @@ Jeecg-Boot低代码开发平台可以应用在任何J2EE项目的开发中
交流互动
-----------------------------------
- QQ交流群 ③816531124、②769925425、①284271917
- QQ交流群 ④774126647、③816531124(满)、②769925425、①284271917
- 反馈问题: [反馈问题请按格式发Issues](https://github.com/zhangdaiscott/jeecg-boot/issues/new)
@ -73,7 +73,7 @@ Jeecg-Boot低代码开发平台可以应用在任何J2EE项目的开发中
为什么选择JEECG-BOOT?
-----------------------------------
* 1.采用最新主流前后分离框架Springboot+Mybatis+antd容易上手; 代码生成器依赖性低,灵活的扩展能力,可快速实现二次开发;
* 2.支持微服务SpringCloud Alibaba(Nacos、Gateway、Sentinel、Skywarking),提供切换机制支持单体和微服务自由切换
* 2.支持微服务SpringCloud Alibaba(Nacos、Gateway、Sentinel、Skywalking),提供切换机制支持单体和微服务自由切换
* 3.开发效率高,采用代码生成器,单表、树列表、一对多、一对一等数据模型,增删改查功能一键生成,菜单配置直接使用;
* 4.代码生成器提供强大模板机制,支持自定义模板,目前提供四套风格模板(单表两套、树模型一套、一对多三套)
* 5.代码生成器非常智能在线业务建模、在线配置、所见即所得支持23种类控件一键生成前后端代码大幅度提升开发效率不再为重复工作发愁。
@ -90,7 +90,7 @@ Jeecg-Boot低代码开发平台可以应用在任何J2EE项目的开发中
* 16.页面校验自动生成(必须输入、数字校验、金额校验、时间空间等);
* 17.支持SAAS服务模式提供SaaS多租户架构方案。
* 18.分布式文件服务集成minio、阿里OSS等优秀的第三方提供便捷的文件上传与管理同时也支持本地存储。
* 19.主流数据库兼容一套代码完全兼容Mysql、Postgresql、Oracle三大主流数据库。
* 19.主流数据库兼容一套代码完全兼容Mysql、Postgresql、Oracle、Sqlserver、MariaDB、达梦等主流数据库。
* 20.集成工作流activiti并实现了只需在页面配置流程转向可极大的简化bpm工作流的开发用bpm的流程设计器画出了流程走向一个工作流基本就完成了只需写很少量的java代码
* 21.低代码能力在线流程设计采用开源Activiti流程引擎实现在线画流程,自定义表单,表单挂靠,业务流转
* 22.多数据源:及其简易的使用方式,在线配置数据源配置,便捷的从其他数据抓取数据;
@ -143,7 +143,7 @@ Jeecg-Boot低代码开发平台可以应用在任何J2EE项目的开发中
- 安全框架Apache Shiro 1.7.0Jwt 3.11.0
- 微服务技术栈Spring Cloud Alibaba、Nacos、Gateway、Sentinel、Skywarking
- 微服务技术栈Spring Cloud Alibaba、Nacos、Gateway、Sentinel、Skywalking
- 数据库连接池阿里巴巴Druid 1.1.22
@ -328,7 +328,7 @@ Jeecg-Boot低代码开发平台可以应用在任何J2EE项目的开发中
8、服务监控 SpringBootAdmin√
9、链路跟踪 Skywarking [参考文档](https://www.kancloud.cn/zhangdaiscott/jeecgcloud/1771670)
9、链路跟踪 Skywalking [参考文档](https://www.kancloud.cn/zhangdaiscott/jeecgcloud/1771670)
10、消息中间件 RabbitMQ √
@ -336,7 +336,7 @@ Jeecg-Boot低代码开发平台可以应用在任何J2EE项目的开发中
12、分布式事务 Seata
13、分布式日志 elk + kafa
13、分布式日志 elk + kafka
14、支持 docker-compose、k8s、jenkins

View File

@ -1,3 +1,3 @@
NODE_ENV=production
VUE_APP_PLATFORM_NAME=JeecgBoot 企业级快速开发平台
VUE_APP_PLATFORM_NAME=JeecgBoot 企业级低代码平台
VUE_APP_SSO=false

View File

@ -1,4 +1,4 @@
NODE_ENV=production
VUE_APP_API_BASE_URL=https://bootapi.jeecg.com
VUE_APP_API_BASE_URL=http://localhost:8080/jeecg-boot
VUE_APP_CAS_BASE_URL=http://localhost:8888/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview

View File

@ -1,13 +1,13 @@
Ant Design Jeecg Vue
====
当前最新版本: 2.4.2发布日期20210126
当前最新版本: 2.4.5发布日期20210607
Overview
----
基于 [Ant Design of Vue](https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/) 实现的 Ant Design Pro Vue 版
Jeecg-boot 的前UI框架采用前后端分离方案提供强大代码生成器的快速开发平台。
Jeecg-boot 的前UI框架采用前后端分离方案提供强大代码生成器的低代码平台。
前端页面代码和后端功能代码一键生成不需要写任何代码保持jeecg一贯的强大

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "vue-antd-jeecg",
"version": "2.4.2",
"version": "2.4.5",
"private": true,
"scripts": {
"pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ",
@ -10,8 +10,8 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@jeecg/antd-online-mini": "2.4.22-beta",
"ant-design-vue": "^1.7.2",
"@jeecg/antd-online-mini": "2.4.5-RC",
"@antv/data-set": "^0.11.4",
"viser-vue": "^2.4.8",
"axios": "^0.18.0",
@ -43,7 +43,8 @@
"dom-align": "1.12.0",
"xe-utils": "2.4.8",
"vxe-table": "2.9.13",
"vxe-table-plugin-antd": "1.8.10"
"vxe-table-plugin-antd": "1.8.10",
"cron-parser": "^2.10.0"
},
"devDependencies": {
"@babel/polyfill": "^7.2.5",
@ -96,10 +97,7 @@
"vue/html-closing-bracket-newline": 0,
"vue/no-parsing-error": 0,
"no-tabs": 0,
"indent": [
"off",
2
],
"indent": ["off", 2],
"no-console": 0,
"space-before-function-paren": 0
}

View File

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>JeecgBoot 企业级快速开发平台</title>
<title>JeecgBoot 企业级低代码平台</title>
<link rel="icon" href="<%= BASE_URL %>logo.png">
<script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script>
<style>
@ -251,7 +251,7 @@
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载 JeecgBoot 快速开发平台,请耐心等待
<div class="load_title">正在加载 JeecgBoot 低代码平台,请耐心等待
</div>
</div>

View File

@ -38,6 +38,7 @@ const queryPermissionRule = (params)=>getAction("/sys/permission/queryPermission
// 部门管理
const queryDepartTreeList = (params)=>getAction("/sys/sysDepart/queryTreeList",params);
const queryDepartTreeSync = (params)=>getAction("/sys/sysDepart/queryDepartTreeSync",params);
const queryIdTree = (params)=>getAction("/sys/sysDepart/queryIdTree",params);
const queryParentName = (params)=>getAction("/sys/sysDepart/queryParentName",params);
const searchByKeywords = (params)=>getAction("/sys/sysDepart/searchBy",params);
@ -52,7 +53,6 @@ const saveDeptRolePermission = (params)=>postAction("/sys/sysDepartPermission/sa
const queryMyDepartTreeList = (params)=>getAction("/sys/sysDepart/queryMyDeptTreeList",params);
//日志管理
//const getLogList = (params)=>getAction("/sys/log/list",params);
const deleteLog = (params)=>deleteAction("/sys/log/delete",params);
const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);
@ -69,7 +69,7 @@ export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItem
function getDictItemsFromCache(dictCode) {
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]) {
let dictItems = Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode];
console.log("-----------getDictItemsFromCache----------dictCode="+dictCode+"---- dictItems=",dictItems)
//console.log("-----------getDictItemsFromCache----------dictCode="+dictCode+"---- dictItems=",dictItems)
return dictItems;
}
}
@ -101,6 +101,8 @@ export const transitRESTful = {
}
export {
// imgView,
// doMian,
addRole,
editRole,
checkRoleCode,
@ -124,6 +126,7 @@ export {
getPermissionRuleList,
queryPermissionRule,
queryDepartTreeList,
queryDepartTreeSync,
queryIdTree,
queryParentName,
searchByKeywords,

View File

@ -71,4 +71,17 @@ export function thirdLogin(token,thirdType) {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
/**
* 强退其他账号
* @param token
* @returns {*}
*/
export function forceLogout(parameter) {
return axios({
url: '/sys/online/forceLogout',
method: 'post',
data: parameter
})
}

View File

@ -1,5 +1,6 @@
import Vue from 'vue'
import { axios } from '@/utils/request'
import signMd5Utils from '@/utils/encryption/signMd5Utils'
const api = {
user: '/mock/api/user',
@ -13,19 +14,29 @@ export default api
//post
export function postAction(url,parameter) {
let sign = signMd5Utils.getSign(url, parameter);
//将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
return axios({
url: url,
method:'post' ,
data: parameter
data: parameter,
headers: signHeader
})
}
//post method= {post | put}
export function httpAction(url,parameter,method) {
let sign = signMd5Utils.getSign(url, parameter);
//将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
return axios({
url: url,
method:method ,
data: parameter
data: parameter,
headers: signHeader
})
}
@ -40,10 +51,15 @@ export function putAction(url,parameter) {
//get
export function getAction(url,parameter) {
let sign = signMd5Utils.getSign(url, parameter);
//将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
return axios({
url: url,
method: 'get',
params: parameter
params: parameter,
headers: signHeader
})
}

View File

@ -6,7 +6,7 @@
</template>
<script>
import JVxeCellMixins, { vModel, dispatchEvent } from '@/components/jeecg/JVxeTable/mixins/JVxeCellMixins'
import JVxeCellMixins, { dispatchEvent, vModel } from '@/components/jeecg/JVxeTable/mixins/JVxeCellMixins'
export default {
name: 'JVxePopupCell',
@ -22,6 +22,8 @@
orgFields: col.orgFields,
destFields: col.destFields,
groupId: caseId,
param: col.param,
sorter: col.sorter,
}
},
},
@ -48,7 +50,9 @@
// 【组件增强】注释详见JVxeCellMixins.js
enhanced: {
aopEvents: {
editActived: event => dispatchEvent(event, 'ant-input'),
editActived(event) {
dispatchEvent.call(this, event, 'ant-input')
},
},
},
}

View File

@ -254,7 +254,9 @@ export const DictSearchInputCell = {
// 【组件增强】注释详见JVxeCellMixins.js
enhanced: {
aopEvents: {
editActived: event => dispatchEvent(event, 'ant-select'),
editActived(event) {
dispatchEvent.call(this, event, 'ant-select')
},
},
}
}

View File

@ -39,5 +39,5 @@ UserMenu.vue:首页右上侧的内容
![输入图片说明](https://static.oschina.net/uploads/img/201904/12201226_laQK.png "在这里输入图片标题")
####16.trend包 趋势显示组件(如下图)
![输入图片说明](https://static.oschina.net/uploads/img/201904/12201600_Wo8K.png "在这里输入图片标题")
![corn表达式](https://oscimg.oschina.net/oscnet/661f9ac09016395f9f49286143af3241623.jpg)
![corn控件添加清除按钮](https://oscimg.oschina.net/oscnet/15096e49f2e29bd829e304d56770025d03c.jpg)
![cron表达式](https://oscimg.oschina.net/oscnet/661f9ac09016395f9f49286143af3241623.jpg)
![cron控件添加清除按钮](https://oscimg.oschina.net/oscnet/15096e49f2e29bd829e304d56770025d03c.jpg)

View File

@ -12,13 +12,13 @@ export default class Area {
let arr = []
const province = pcaa['86']
Object.keys(province).map(key=>{
arr.push({id:key, text:province[key], pid:'86'});
arr.push({id:key, text:province[key], pid:'86', index:1});
const city = pcaa[key];
Object.keys(city).map(key2=>{
arr.push({id:key2, text:city[key2], pid:key});
arr.push({id:key2, text:city[key2], pid:key, index:2});
const qu = pcaa[key2];
Object.keys(qu).map(key3=>{
arr.push({id:key3, text:qu[key3], pid:key2});
arr.push({id:key3, text:qu[key3], pid:key2, index:3});
})
})
})
@ -45,33 +45,35 @@ export default class Area {
return ''
}
let arr = []
this.getAreaBycode(code,arr);
this.getAreaBycode(code, arr, 3);
return arr.join('/')
}
getRealCode(code){
let arr = []
this.getPcode(code, arr)
this.getPcode(code, arr, 3)
return arr;
}
getPcode(id, arr){
getPcode(id, arr, index){
for(let item of this.all){
if(item.id === id){
if(item.id === id && item.index == index){
arr.unshift(id)
if(item.pid != '86'){
this.getPcode(item.pid,arr)
this.getPcode(item.pid, arr, --index)
}
}
}
}
getAreaBycode(code,arr){
//console.log("this.all.length",this.all)
getAreaBycode(code, arr, index){
for(let item of this.all){
if(item.id === code){
if(item.id === code && item.index == index){
arr.unshift(item.text);
this.getAreaBycode(item.pid,arr)
if(item.pid != '86'){
this.getAreaBycode(item.pid, arr, --index)
}
}
}
}

View File

@ -25,7 +25,6 @@
props: {
dictCode: String,
placeholder: String,
triggerChange: Boolean,
disabled: Boolean,
value: [String, Number],
type: String,
@ -82,19 +81,15 @@
}
})
},
handleInput(e) {
handleInput(e='') {
let val;
if(this.tagType=="radio"){
if(Object.keys(e).includes('target')){
val = e.target.value
}else{
val = e
}
console.log(val);
if(this.triggerChange){
this.$emit('change', val);
}else{
this.$emit('input', val);
}
this.$emit('change', val);
},
setCurrentDictOptions(dictOptions){
this.dictOptions = dictOptions
@ -102,6 +97,10 @@
getCurrentDictOptions(){
return this.dictOptions
}
},
model:{
prop: 'value',
event: 'change'
}
}
</script>

View File

@ -65,7 +65,11 @@
type: Number,
default: 10,
required: false
}
},
getPopupContainer: {
type:Function,
default: null
},
},
data(){
this.loadData = debounce(this.loadData, 800);//消抖
@ -226,7 +230,9 @@
return this.options
},
getParentContainer(node){
if(!this.popContainer){
if(typeof this.getPopupContainer === 'function'){
return this.getPopupContainer(node)
} else if(!this.popContainer){
return node.parentNode
}else{
return document.querySelector(this.popContainer)

View File

@ -1,7 +1,7 @@
<template>
<div class="components-input-demo-presuffix">
<a-input @click="openModal" placeholder="corn表达式" v-model="cron" @change="handleOK">
<a-icon slot="prefix" type="schedule" title="corn控件"/>
<a-input @click="openModal" placeholder="cron表达式" v-model="cron" @change="(e)=>handleOK(e.target.value)">
<a-icon slot="prefix" type="schedule" title="cron控件"/>
<a-icon v-if="cron" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
</a-input>
<JCronModal ref="innerVueCron" :data="cron" @ok="handleOK"></JCronModal>

View File

@ -0,0 +1,246 @@
<template>
<div class="j-easy-cron">
<div class="content">
<div>
<a-tabs size="small" v-model="curtab">
<a-tab-pane tab="" key="second" v-if="!hideSecond">
<second-ui v-model="second" :disabled="disabled"></second-ui>
</a-tab-pane>
<a-tab-pane tab="" key="minute">
<minute-ui v-model="minute" :disabled="disabled"></minute-ui>
</a-tab-pane>
<a-tab-pane tab="" key="hour">
<hour-ui v-model="hour" :disabled="disabled"></hour-ui>
</a-tab-pane>
<a-tab-pane tab="" key="day">
<day-ui v-model="day" :week="week" :disabled="disabled"></day-ui>
</a-tab-pane>
<a-tab-pane tab="" key="month">
<month-ui v-model="month" :disabled="disabled"></month-ui>
</a-tab-pane>
<a-tab-pane tab="" key="week">
<week-ui v-model="week" :day="day" :disabled="disabled"></week-ui>
</a-tab-pane>
<a-tab-pane tab="" key="year" v-if="!hideYear && !hideSecond">
<year-ui v-model="year" :disabled="disabled"></year-ui>
</a-tab-pane>
</a-tabs>
</div>
<a-divider/>
<!-- 执行时间预览 -->
<a-row :gutter="8">
<a-col :span="18" style="margin-top: 22px;">
<a-row :gutter="8">
<a-col :span="8" style="margin-bottom: 8px;">
<a-input addon-before="" v-model="inputValues.second" @blur="onInputBlur"/>
</a-col>
<a-col :span="8" style="margin-bottom: 8px;">
<a-input addon-before="" v-model="inputValues.minute" @blur="onInputBlur"/>
</a-col>
<a-col :span="8" style="margin-bottom: 8px;">
<a-input addon-before="" v-model="inputValues.hour" @blur="onInputBlur"/>
</a-col>
<a-col :span="8" style="margin-bottom: 8px;">
<a-input addon-before="" v-model="inputValues.day" @blur="onInputBlur"/>
</a-col>
<a-col :span="8" style="margin-bottom: 8px;">
<a-input addon-before="" v-model="inputValues.month" @blur="onInputBlur"/>
</a-col>
<a-col :span="8" style="margin-bottom: 8px;">
<a-input addon-before="" v-model="inputValues.week" @blur="onInputBlur"/>
</a-col>
<a-col :span="8" style="margin-bottom: 8px;">
<a-input addon-before="" v-model="inputValues.year" @blur="onInputBlur"/>
</a-col>
<a-col :span="16" style="margin-bottom: 8px;">
<a-input addon-before="Cron" v-model="inputValues.cron" @blur="onInputCronBlur"/>
</a-col>
</a-row>
</a-col>
<a-col :span="6">
<div>近十次执行时间(不含年)</div>
<a-textarea type="textarea" :value="preTimeList" :rows="5"/>
</a-col>
</a-row>
</div>
</div>
</template>
<script>
import SecondUi from './tabs/second'
import MinuteUi from './tabs/minute'
import HourUi from './tabs/hour'
import DayUi from './tabs/day'
import WeekUi from './tabs/week'
import MonthUi from './tabs/month'
import YearUi from './tabs/year'
import CronParser from 'cron-parser'
import dateFormat from './format-date'
import { simpleDebounce } from '@/utils/util'
import ACol from 'ant-design-vue/es/grid/Col'
export default {
name: 'easy-cron',
components: {
ACol,
SecondUi,
MinuteUi,
HourUi,
DayUi,
WeekUi,
MonthUi,
YearUi
},
props: {
cronValue: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
},
hideSecond: {
type: Boolean,
default: false
},
hideYear: {
type: Boolean,
default: false
},
remote: {
type: Function,
default: null
}
},
data() {
return {
curtab: this.hideSecond ? 'minute' : 'second',
second: '*',
minute: '*',
hour: '*',
day: '*',
month: '*',
week: '?',
year: '*',
inputValues: {second: '', minute: '', hour: '', day: '', month: '', week: '', year: '', cron: ''},
preTimeList: '执行预览,会忽略年份参数',
}
},
computed: {
cronValue_c() {
let result = []
if (!this.hideSecond) result.push(this.second ? this.second : '*')
result.push(this.minute ? this.minute : '*')
result.push(this.hour ? this.hour : '*')
result.push(this.day ? this.day : '*')
result.push(this.month ? this.month : '*')
result.push(this.week ? this.week : '?')
if (!this.hideYear && !this.hideSecond) result.push(this.year ? this.year : '*')
return result.join(' ')
},
cronValue_c2() {
const v = this.cronValue_c
if (this.hideYear || this.hideSecond) return v
const vs = v.split(' ')
return vs.slice(0, vs.length - 1).join(' ')
}
},
watch: {
cronValue(newVal, oldVal) {
if (newVal === this.cronValue_c) {
// console.info('same cron value: ' + newVal)
return
}
this.formatValue()
},
cronValue_c(newVal, oldVal) {
this.calTriggerList()
this.$emit('change', newVal)
Object.assign(this.inputValues, {
second: this.second,
minute: this.minute,
hour: this.hour,
day: this.day,
month: this.month,
week: this.week,
year: this.year,
cron: this.cronValue_c,
})
}
},
created() {
this.formatValue()
this.$nextTick(() => {
this.calTriggerListInner()
})
},
methods: {
formatValue() {
if (!this.cronValue) return
const values = this.cronValue.split(' ').filter(item => !!item)
if (!values || values.length <= 0) return
let i = 0
if (!this.hideSecond) this.second = values[i++]
if (values.length > i) this.minute = values[i++]
if (values.length > i) this.hour = values[i++]
if (values.length > i) this.day = values[i++]
if (values.length > i) this.month = values[i++]
if (values.length > i) this.week = values[i++]
if (values.length > i) this.year = values[i]
},
calTriggerList: simpleDebounce(function () {
this.calTriggerListInner()
}, 500),
calTriggerListInner() {
// 设置了回调函数
if (this.remote) {
this.remote(this.cronValue_c, +new Date(), v => {
this.preTimeList = v
})
return
}
const format = 'yyyy-MM-dd hh:mm:ss'
const options = {
currentDate: dateFormat(new Date(), format)
}
const iter = CronParser.parseExpression(this.cronValue_c2, options)
const result = []
for (let i = 1; i <= 10; i++) {
result.push(dateFormat(new Date(iter.next()), format))
}
this.preTimeList = result.length > 0 ? result.join('\n') : '无执行时间'
},
onInputBlur(){
this.second = this.inputValues.second
this.minute = this.inputValues.minute
this.hour = this.inputValues.hour
this.day = this.inputValues.day
this.month = this.inputValues.month
this.week = this.inputValues.week
this.year = this.inputValues.year
},
onInputCronBlur(event){
this.$emit('change', event.target.value)
},
},
model: {
prop: 'cronValue',
event: 'change'
},
}
</script>
<style scoped lang="less">
.j-easy-cron {
/deep/ .content {
.ant-checkbox-wrapper + .ant-checkbox-wrapper {
margin-left: 0;
}
}
}
</style>

View File

@ -0,0 +1,99 @@
<template>
<div class="input-cron">
<a-input :placeholder="placeholder" v-model="editCronValue" :disabled="disabled">
<a slot="addonAfter" @click="showConfigDlg" class="config-btn" :disabled="disabled">
<a-icon type="setting"></a-icon>
选择
</a>
</a-input>
<j-modal :visible.sync="show" title="Cron表达式" width="800px">
<easy-cron
v-model="editCronValue"
:exeStartTime="exeStartTime"
:hideYear="hideYear"
:remote="remote"
:hideSecond="hideSecond"
style="width: 100%"
></easy-cron>
</j-modal>
</div>
</template>
<script>
import EasyCron from './EasyCron.vue'
export default {
name: 'input-cron',
components: {EasyCron},
model: {
prop: 'cronValue',
event: 'change'
},
props: {
cronValue: {
type: String,
default: ''
},
width: {
type: String,
default: '800px'
},
placeholder: {
type: String,
default: '请输入cron表达式'
},
disabled: {
type: Boolean,
default: false
},
exeStartTime: {
type: [Number, String, Object],
default: 0
},
hideSecond: {
type: Boolean,
default: false
},
hideYear: {
type: Boolean,
default: false
},
remote: {
type: Function,
default: null
}
},
data() {
return {
editCronValue: this.cronValue,
show: false,
}
},
watch: {
cronValue(newVal, oldVal) {
if (newVal === this.editCronValue) {
return
}
this.editCronValue = newVal
},
editCronValue(newVal, oldVal) {
this.$emit('change', newVal)
}
},
methods: {
showConfigDlg() {
if (!this.disabled) {
this.show = true
}
}
}
}
</script>
<style scoped>
.config-btn {
cursor: pointer;
}
</style>

View File

@ -0,0 +1,37 @@
const dateFormat = (date, block) => {
if (!date) {
return ''
}
let format = block || 'yyyy-MM-dd'
date = new Date(date)
const map = {
M: date.getMonth() + 1, // 月份
d: date.getDate(), // 日
h: date.getHours(), // 小时
m: date.getMinutes(), // 分
s: date.getSeconds(), // 秒
q: Math.floor((date.getMonth() + 3) / 3), // 季度
S: date.getMilliseconds() // 毫秒
}
format = format.replace(/([yMdhmsqS])+/g, (all, t) => {
let v = map[t]
if (v !== undefined) {
if (all.length > 1) {
v = `0${v}`
v = v.substr(v.length - 2)
}
return v
} else if (t === 'y') {
return (date.getFullYear().toString()).substr(4 - all.length)
}
return all
})
return format
}
export default dateFormat

View File

@ -0,0 +1,6 @@
// 原开源项目地址https://gitee.com/toktok/easy-cron
import InputCron from './InputCron.vue'
InputCron.name = 'JEasyCron'
export default InputCron

View File

@ -0,0 +1,21 @@
export const WEEK_MAP_EN = {
'SUN': '0',
'MON': '1',
'TUE': '2',
'WED': '3',
'THU': '4',
'FRI': '5',
'SAT': '6'
}
export const replaceWeekName = (c) => {
// console.info('after: ' + c)
if (c) {
Object.keys(WEEK_MAP_EN).forEach(k => {
c = c.replace(new RegExp(k, 'g'), WEEK_MAP_EN[k])
})
c = c.replace(new RegExp('7', 'g'), '0')
}
// console.info('after: ' + c)
return c
}

View File

@ -0,0 +1,101 @@
<template>
<div class="config-list">
<a-radio-group v-model="type">
<div class="item">
<a-radio value="TYPE_NOT_SET" class="choice" :disabled="disableChoice">不设置</a-radio>
<span class="tip-info">日和周只能设置其中之一</span>
</div>
<div class="item">
<a-radio value="TYPE_EVERY" class="choice" :disabled="disableChoice">每日</a-radio>
</div>
<div class="item">
<a-radio value="TYPE_RANGE" class="choice" :disabled="disableChoice">区间</a-radio>
<a-input-number :disabled="type!==TYPE_RANGE || disableChoice" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.start"/>
<a-input-number :disabled="type!==TYPE_RANGE || disableChoice" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.end"/>
</div>
<div class="item">
<a-radio value="TYPE_LOOP" class="choice" :disabled="disableChoice">循环</a-radio>
<a-input-number :disabled="type!==TYPE_LOOP || disableChoice" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.start"/>
日开始,间隔
<a-input-number :disabled="type!==TYPE_LOOP || disableChoice" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.interval"/>
</div>
<div class="item">
<a-radio value="TYPE_WORK" class="choice" :disabled="disableChoice">工作日</a-radio>
本月
<a-input-number :disabled="type!==TYPE_WORK || disableChoice" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueWork"/>
日,最近的工作日
</div>
<div class="item">
<a-radio value="TYPE_LAST" class="choice" :disabled="disableChoice">最后一日</a-radio>
</div>
<div class="item">
<a-radio value="TYPE_SPECIFY" class="choice" :disabled="disableChoice">指定</a-radio>
<div class="list">
<a-checkbox-group v-model="valueList">
<template v-for="i in maxValue+1">
<a-checkbox class="list-check-item" :key="`key-${i-1}`" :value="i-1" :disabled="type!==TYPE_SPECIFY || disabled">{{i-1}}</a-checkbox>
</template>
</a-checkbox-group>
</div>
</div>
</a-radio-group>
</div>
</template>
<script>
import mixin from './mixin'
export default {
name: 'day',
mixins: [mixin],
props: {
week: {
type: String,
default: '?'
}
},
data() {
return {}
},
computed: {
disableChoice() {
return (this.week && this.week !== '?') || this.disabled
}
},
watch: {
value_c(newVal, oldVal) {
// 数值变化
this.updateValue()
},
week(newVal, oldVal) {
// console.info('new week: ' + newVal)
this.updateValue()
}
},
methods: {
updateValue() {
this.$emit('change', this.disableChoice ? '?' : this.value_c)
}
},
created() {
this.DEFAULT_VALUE = '*'
this.minValue = 1
this.maxValue = 31
this.valueRange.start = 1
this.valueRange.end = 31
this.valueLoop.start = 1
this.valueLoop.interval = 1
this.parseProp(this.prop)
}
}
</script>
<style lang="less" scoped>
@import "mixin.less";
</style>

View File

@ -0,0 +1,67 @@
<template>
<div class="config-list">
<a-radio-group v-model="type">
<div class="item">
<a-radio value="TYPE_EVERY" class="choice" :disabled="disabled">每时</a-radio>
</div>
<div class="item">
<a-radio value="TYPE_RANGE" class="choice" :disabled="disabled">区间</a-radio>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.start"/>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.end"/>
</div>
<div class="item">
<a-radio value="TYPE_LOOP" class="choice" :disabled="disabled">循环</a-radio>
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.start"/>
时开始,间隔
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.interval"/>
</div>
<div class="item">
<a-radio value="TYPE_SPECIFY" class="choice" :disabled="disabled">指定</a-radio>
<div class="list">
<a-checkbox-group v-model="valueList">
<template v-for="i in maxValue+1">
<a-checkbox class="list-check-item" :key="`key-${i-1}`" :value="i-1" :disabled="type!==TYPE_SPECIFY || disabled">{{i-1}}</a-checkbox>
</template>
</a-checkbox-group>
</div>
</div>
</a-radio-group>
</div>
</template>
<script>
import mixin from './mixin'
export default {
name: 'minute',
mixins: [mixin],
data() {
return {}
},
watch: {
value_c(newVal, oldVal) {
this.$emit('change', newVal)
}
},
created() {
this.DEFAULT_VALUE = '*'
this.minValue = 0
this.maxValue = 23
this.valueRange.start = 0
this.valueRange.end = 23
this.valueLoop.start = 0
this.valueLoop.interval = 1
this.parseProp(this.prop)
}
}
</script>
<style lang="less" scoped>
@import "mixin.less";
</style>

View File

@ -0,0 +1,67 @@
<template>
<div class="config-list">
<a-radio-group v-model="type">
<div class="item">
<a-radio value="TYPE_EVERY" class="choice" :disabled="disabled">每分</a-radio>
</div>
<div class="item">
<a-radio value="TYPE_RANGE" class="choice" :disabled="disabled">区间</a-radio>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.start"/>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.end"/>
</div>
<div class="item">
<a-radio value="TYPE_LOOP" class="choice" :disabled="disabled">循环</a-radio>
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.start"/>
分开始,间隔
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.interval"/>
</div>
<div class="item">
<a-radio value="TYPE_SPECIFY" class="choice" :disabled="disabled">指定</a-radio>
<div class="list">
<a-checkbox-group v-model="valueList">
<template v-for="i in maxValue+1">
<a-checkbox class="list-check-item" :key="`key-${i-1}`" :value="i-1" :disabled="type!==TYPE_SPECIFY || disabled">{{i-1}}</a-checkbox>
</template>
</a-checkbox-group>
</div>
</div>
</a-radio-group>
</div>
</template>
<script>
import mixin from './mixin'
export default {
name: 'minute',
mixins: [mixin],
data() {
return {}
},
watch: {
value_c(newVal, oldVal) {
this.$emit('change', newVal)
}
},
created() {
this.DEFAULT_VALUE = '*'
this.minValue = 0
this.maxValue = 59
this.valueRange.start = 0
this.valueRange.end = 59
this.valueLoop.start = 0
this.valueLoop.interval = 1
this.parseProp(this.prop)
}
}
</script>
<style lang="less" scoped>
@import "mixin.less";
</style>

View File

@ -0,0 +1,151 @@
// 主要用于日和星期的互斥使用
const TYPE_NOT_SET = 'TYPE_NOT_SET'
const TYPE_EVERY = 'TYPE_EVERY'
const TYPE_RANGE = 'TYPE_RANGE'
const TYPE_LOOP = 'TYPE_LOOP'
const TYPE_WORK = 'TYPE_WORK'
const TYPE_LAST = 'TYPE_LAST'
const TYPE_SPECIFY = 'TYPE_SPECIFY'
const DEFAULT_VALUE = '?'
export default {
model: {
prop: 'prop',
event: 'change'
},
props: {
prop: {
type: String,
default: DEFAULT_VALUE
},
disabled: {
type: Boolean,
default: false
}
},
data () {
const type = TYPE_EVERY
return {
DEFAULT_VALUE,
// 类型
type,
// 启用日或者星期互斥用
TYPE_NOT_SET,
TYPE_EVERY,
TYPE_RANGE,
TYPE_LOOP,
TYPE_WORK,
TYPE_LAST,
TYPE_SPECIFY,
// 对于不同的类型,所定义的值也有所不同
valueRange: {
start: 0,
end: 0
},
valueLoop: {
start: 0,
interval: 1
},
valueWeek: {
start: 0,
end: 0
},
valueList: [],
valueWork: 1,
maxValue: 0,
minValue: 0
}
},
watch: {
prop (newVal, oldVal) {
if (newVal === this.value_c) {
// console.info('skip ' + newVal)
return
}
this.parseProp(newVal)
}
},
computed: {
value_c () {
let result = []
switch (this.type) {
case TYPE_NOT_SET:
result.push('?')
break
case TYPE_EVERY:
result.push('*')
break
case TYPE_RANGE:
result.push(`${this.valueRange.start}-${this.valueRange.end}`)
break
case TYPE_LOOP:
result.push(`${this.valueLoop.start}/${this.valueLoop.interval}`)
break
case TYPE_WORK:
result.push(`${this.valueWork}W`)
break
case TYPE_LAST:
result.push('L')
break
case TYPE_SPECIFY:
result.push(this.valueList.join(','))
break
default:
result.push(this.DEFAULT_VALUE)
break
}
return result.length > 0 ? result.join('') : this.DEFAULT_VALUE
}
},
methods: {
parseProp (value) {
if (value === this.value_c) {
// console.info('same ' + value)
return
}
if (typeof (this.preProcessProp) === 'function') {
value = this.preProcessProp(value)
}
try {
if (!value || value === this.DEFAULT_VALUE) {
this.type = TYPE_EVERY
} else if (value.indexOf('?') >= 0) {
this.type = TYPE_NOT_SET
} else if (value.indexOf('-') >= 0) {
this.type = TYPE_RANGE
const values = value.split('-')
if (values.length >= 2) {
this.valueRange.start = parseInt(values[0])
this.valueRange.end = parseInt(values[1])
}
} else if (value.indexOf('/') >= 0) {
this.type = TYPE_LOOP
const values = value.split('/')
if (values.length >= 2) {
this.valueLoop.start = value[0] === '*' ? 0 : parseInt(values[0])
this.valueLoop.interval = parseInt(values[1])
}
} else if (value.indexOf('W') >= 0) {
this.type = TYPE_WORK
const values = value.split('W')
if (!values[0] && !isNaN(values[0])) {
this.valueWork = parseInt(values[0])
}
} else if (value.indexOf('L') >= 0) {
this.type = TYPE_LAST
const values = value.split('L')
this.valueLast = parseInt(values[0])
} else if (value.indexOf(',') >= 0 || !isNaN(value)) {
this.type = TYPE_SPECIFY
this.valueList = value.split(',').map(item => parseInt(item))
} else {
this.type = TYPE_EVERY
}
} catch (e) {
// console.info(e)
this.type = TYPE_EVERY
}
}
}
}

View File

@ -0,0 +1,35 @@
.config-list {
text-align: left;
margin: 0 10px 10px 10px;
}
.item {
margin-top: 5px;
}
.choice {
padding: 5px 8px;
}
.w60 {
width: 60px;
}
.w80 {
width: 80px;
}
.list {
margin: 0 20px;
}
.list-check-item {
padding: 1px 3px;
width: 4em;
}
.tip-info {
color: #999
}

View File

@ -0,0 +1,67 @@
<template>
<div class="config-list">
<a-radio-group v-model="type">
<div class="item">
<a-radio value="TYPE_EVERY" class="choice" :disabled="disabled">每月</a-radio>
</div>
<div class="item">
<a-radio value="TYPE_RANGE" class="choice" :disabled="disabled">区间</a-radio>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.start"/>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.end"/>
</div>
<div class="item">
<a-radio value="TYPE_LOOP" class="choice" :disabled="disabled">循环</a-radio>
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.start"/>
月开始,间隔
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.interval"/>
</div>
<div class="item">
<a-radio value="TYPE_SPECIFY" class="choice" :disabled="disabled">指定</a-radio>
<div class="list">
<a-checkbox-group v-model="valueList">
<template v-for="i in maxValue+1">
<a-checkbox class="list-check-item" :key="`key-${i-1}`" :value="i-1" :disabled="type!==TYPE_SPECIFY || disabled">{{i-1}}</a-checkbox>
</template>
</a-checkbox-group>
</div>
</div>
</a-radio-group>
</div>
</template>
<script>
import mixin from './mixin'
export default {
name: 'month',
mixins: [mixin],
data() {
return {}
},
watch: {
value_c(newVal, oldVal) {
this.$emit('change', newVal)
}
},
created() {
this.DEFAULT_VALUE = '*'
this.minValue = 1
this.maxValue = 12
this.valueRange.start = 1
this.valueRange.end = 12
this.valueLoop.start = 1
this.valueLoop.interval = 1
this.parseProp(this.prop)
}
}
</script>
<style lang="less" scoped>
@import "mixin.less";
</style>

View File

@ -0,0 +1,68 @@
<template>
<div class="config-list">
<a-radio-group v-model="type">
<div class="item">
<a-radio value="TYPE_EVERY" class="choice" :disabled="disabled">每秒</a-radio>
</div>
<div class="item">
<a-radio value="TYPE_RANGE" class="choice" :disabled="disabled">区间</a-radio>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.start"/>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueRange.end"/>
</div>
<div class="item">
<a-radio value="TYPE_LOOP" class="choice" :disabled="disabled">循环</a-radio>
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.start"/>
秒开始,间隔
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.interval"/>
</div>
<div class="item">
<a-radio value="TYPE_SPECIFY" class="choice" :disabled="disabled">指定</a-radio>
<div class="list">
<a-checkbox-group v-model="valueList">
<template v-for="i in maxValue+1">
<a-checkbox class="list-check-item" :key="`key-${i-1}`" :value="i-1" :disabled="type!==TYPE_SPECIFY || disabled">{{i-1}}</a-checkbox>
</template>
</a-checkbox-group>
</div>
</div>
</a-radio-group>
</div>
</template>
<script>
import mixin from './mixin'
export default {
name: 'second',
mixins: [mixin],
data() {
return {}
},
watch: {
value_c(newVal, oldVal) {
this.$emit('change', newVal)
}
},
created() {
this.DEFAULT_VALUE = '*'
this.minValue = 0
this.maxValue = 59
this.valueRange.start = 0
this.valueRange.end = 59
this.valueLoop.start = 0
this.valueLoop.interval = 1
// console.info('created')
this.parseProp(this.prop)
}
}
</script>
<style lang="less" scoped>
@import "mixin.less";
</style>

View File

@ -0,0 +1,117 @@
<template>
<div class="config-list">
<a-radio-group v-model="type">
<div class="item">
<a-radio value="TYPE_NOT_SET" class="choice" :disabled="disableChoice">不设置</a-radio>
<span class="tip-info">日和周只能设置其中之一</span>
</div>
<div class="item">
<a-radio value="TYPE_RANGE" class="choice" :disabled="disableChoice">区间</a-radio>
<a-select v-model="valueRange.start" class="w80" :disabled="type!==TYPE_RANGE || disableChoice">
<template v-for="(v, k) of WEEK_MAP">
<a-select-option :value="v">{{k}}</a-select-option>
</template>
</a-select>
<a-select v-model="valueRange.end" class="w80" :disabled="type!==TYPE_RANGE || disableChoice">
<template v-for="(v, k) of WEEK_MAP">
<a-select-option :value="v">{{k}}</a-select-option>
</template>
</a-select>
</div>
<div class="item">
<a-radio value="TYPE_LOOP" class="choice" :disabled="disableChoice">循环</a-radio>
<a-select v-model="valueLoop.start" class="w80" :disabled="type!==TYPE_LOOP || disableChoice">
<template v-for="(v, k) of WEEK_MAP">
<a-select-option :value="v">{{k}}</a-select-option>
</template>
</a-select>
开始,间隔
<a-input-number :disabled="type!==TYPE_LOOP || disableChoice" :max="maxValue" :min="minValue" :precision="0" class="w60" v-model="valueLoop.interval"/>
</div>
<div class="item">
<a-radio value="TYPE_SPECIFY" class="choice" :disabled="disableChoice">指定</a-radio>
<div class="list">
<a-checkbox-group v-model="valueList">
<template v-for="i in maxValue+1">
<a-checkbox class="list-check-item" :key="`key-${i-1}`" :value="i-1" :disabled="type!==TYPE_SPECIFY || disabled">{{i-1}}</a-checkbox>
</template>
</a-checkbox-group>
</div>
</div>
</a-radio-group>
</div>
</template>
<script>
import mixin from './mixin'
import { replaceWeekName, WEEK_MAP_EN } from './const.js'
const WEEK_MAP = {
'周日': 0,
'周一': 1,
'周二': 2,
'周三': 3,
'周四': 4,
'周五': 5,
'周六': 6
}
export default {
name: 'week',
mixins: [mixin],
props: {
day: {
type: String,
default: '*'
}
},
data() {
return {
WEEK_MAP,
WEEK_MAP_EN
}
},
computed: {
disableChoice() {
return (this.day && this.day !== '?') || this.disabled
}
},
watch: {
value_c(newVal, oldVal) {
// 如果设置日,那么星期就直接不设置
this.updateValue()
},
day(newVal) {
// console.info('new day: ' + newVal)
this.updateValue()
}
},
methods: {
updateValue() {
this.$emit('change', this.disableChoice ? '?' : this.value_c)
},
preProcessProp(c) {
return replaceWeekName(c)
}
},
created() {
this.DEFAULT_VALUE = '*'
// 0,7表示周日 1表示周一
this.minValue = 0
this.maxValue = 6
this.valueRange.start = 0
this.valueRange.end = 6
this.valueLoop.start = 2
this.valueLoop.interval = 1
this.parseProp(this.prop)
}
}
</script>
<style lang="less" scoped>
@import "mixin.less";
</style>

View File

@ -0,0 +1,60 @@
<template>
<div class="config-list">
<a-radio-group v-model="type">
<div class="item">
<a-radio value="TYPE_EVERY" class="choice" :disabled="disabled">每年</a-radio>
</div>
<div class="item">
<a-radio value="TYPE_RANGE" class="choice" :disabled="disabled">区间</a-radio>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :min="0" :precision="0" class="w60" v-model="valueRange.start"/>
<a-input-number :disabled="type!==TYPE_RANGE || disabled" :min="1" :precision="0" class="w60" v-model="valueRange.end"/>
</div>
<div class="item">
<a-radio value="TYPE_LOOP" class="choice" :disabled="disabled">循环</a-radio>
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :min="0" :precision="0" class="w60" v-model="valueLoop.start"/>
年开始,间隔
<a-input-number :disabled="type!==TYPE_LOOP || disabled" :min="1" :precision="0" class="w60" v-model="valueLoop.interval"/>
</div>
</a-radio-group>
</div>
</template>
<script>
import mixin from './mixin'
export default {
name: 'year',
mixins: [mixin],
data() {
return {}
},
watch: {
value_c(newVal, oldVal) {
// console.info('change:' + newVal)
this.$emit('change', newVal)
}
},
created() {
const nowYear = (new Date()).getFullYear()
this.DEFAULT_VALUE = '*'
this.minValue = 0
this.maxValue = 0
this.valueRange.start = nowYear
this.valueRange.end = nowYear + 100
this.valueLoop.start = nowYear
this.valueLoop.interval = 1
// console.info('created')
this.parseProp(this.prop)
}
}
</script>
<style lang="less" scoped>
@import "mixin.less";
</style>

View File

@ -0,0 +1,51 @@
import CronParser from 'cron-parser'
import { replaceWeekName } from './tabs/const'
export default (rule, value, callback) => {
// 没填写就不校验
if (!value) {
callback()
return true
}
const values = value.split(' ').filter(item => !!item)
if (values.length > 7) {
callback(new Error('Cron表达式最多7项'))
return false
}
// 检查第7项
let e = value
if (values.length === 7) {
const year = replaceWeekName(values[6])
if (year !== '*' && year !== '?') {
let yearValues = []
if (year.indexOf('-') >= 0) {
yearValues = year.split('-')
} else if (year.indexOf('/')) {
yearValues = year.split('/')
} else {
yearValues = [year]
}
// console.info(yearValues)
// 判断是否都是数字
const checkYear = yearValues.some(item => isNaN(item))
if (checkYear) {
callback(new Error('Cron表达式参数[]错误' + year))
return false
}
}
// 取其中的前六项
e = values.slice(0, 6).join(' ')
}
// 6位 没有年
// 5位没有秒、年
let result = true
try {
const iter = CronParser.parseExpression(e)
iter.next()
callback()
} catch (e) {
callback(new Error('Cron表达式错误' + e))
result = false
}
return result
}

View File

@ -350,7 +350,7 @@
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
<a-upload
name="file"
:data="{'isup':1}"
:data="{'isup':1, ...(col.data||{})}"
:multiple="false"
:action="col.action"
:headers="uploadGetHeaders(row,col)"
@ -381,6 +381,8 @@
:dest-fields="col.destFields"
:code="col.popupCode"
:groupId="caseId"
:param="col.param"
:sorter="col.sorter"
@input="(value,others)=>popupCallback(value,others,id,row,col,rowIndex)"
/>
<span
@ -595,6 +597,33 @@
</template>
<!-- select搜索 -end -->
<!-- select异步搜索 -begin -->
<template v-else-if="col.type === formTypes.sel_search_async">
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
<j-search-select-tag
v-if="isEditRow(row, col)"
:id="id"
:key="i"
:value="searchSelectAsyncValues[id]"
:placeholder="replaceProps(col, col.placeholder)"
:dict="col.dict"
:async="true"
:getPopupContainer="getParentContainer"
v-bind="buildProps(row,col)"
style="width: 100%;"
@change="(v)=>handleSearchSelectAsyncChange(v,id,row,col)"
>
</j-search-select-tag>
<span
v-else
class="j-td-span no-edit"
:class="{disabled: buildProps(row,col).disabled}"
@click="handleEditRow(row, col)"
>{{ searchSelectAsyncValues[id] }}</span>
</a-tooltip>
</template>
<!-- select异步搜索 -end -->
<div v-else-if="col.type === formTypes.slot" :key="i">
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
<slot
@ -615,7 +644,7 @@
</div>
<!-- else (normal) -->
<span v-else :key="i" v-bind="buildProps(row,col)">{{ inputValues[rowIndex][col.key] }}</span>
<span class="comp-normal" v-else :key="i" :title="inputValues[rowIndex][col.key]" v-bind="buildProps(row,col)">{{ inputValues[rowIndex][col.key] }}</span>
</template>
</div>
</div>
@ -672,13 +701,13 @@
import Draggable from 'vuedraggable'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { FormTypes, VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
import { cloneObject, randomString, randomNumber, getEventPath } from '@/utils/util'
import { cloneObject, getEventPath, randomNumber, randomString } from '@/utils/util'
import JDate from '@/components/jeecg/JDate'
import { filterDictText, initDictOptions } from '@/components/dict/JDictSelectUtil'
import { getFileAccessHttpUrl } from '@/api/manage';
import { getFileAccessHttpUrl } from '@/api/manage'
import JInputPop from '@/components/jeecg/minipop/JInputPop'
import JFilePop from '@/components/jeecg/minipop/JFilePop'
import { getNoAuthCols } from "@/utils/authFilter"
import { getNoAuthCols } from '@/utils/authFilter'
// 行高,需要在实例加载完成前用到
let rowHeight = 61
@ -814,6 +843,7 @@
metaCheckboxValues: {},
multiSelectValues: {},
searchSelectValues: {},
searchSelectAsyncValues: {},
// 绑定左侧选择框已选择的id
selectedRowIds: [],
// 存储被删除行的id
@ -1048,6 +1078,10 @@
this.inputValues = []
this.rows = []
this.deleteIds = []
this.selectedRowIds = []
this.tooltips = {}
this.notPassedIds = []
// 重置values
this.selectValues = {}
this.checkboxValues = {}
this.jdateValues = {}
@ -1055,14 +1089,16 @@
this.departCompValues = {}
this.userCompValues = {}
this.slotValues = {}
this.selectedRowIds = []
this.tooltips = {}
this.notPassedIds = []
this.uploadValues = []
this.popupValues = []
this.radioValues = []
this.multiSelectValues = []
this.searchSelectValues = []
//update-begin-author:shunjlei date:20210415 for:类型赋值错误
this.uploadValues = {}
this.popupValues = {}
this.radioValues = {}
this.multiSelectValues = {}
this.searchSelectValues = {}
this.searchSelectAsyncValues = {}
//update-end-author:shunjlei date:20210415 for:类型赋值错误
// 重置滚动条
this.scrollTop = 0
this.$nextTick(() => {
this.getElement('tbody').scrollTop = 0
@ -1136,6 +1172,7 @@
let radioValues = { ...this.radioValues }
let multiSelectValues = { ...this.multiSelectValues }
let searchSelectValues = { ...this.searchSelectValues }
let searchSelectAsyncValues = { ...this.searchSelectAsyncValues }
// 禁用行的id
let disabledRowIds = (this.disabledRowIds || [])
dataSource.forEach((data, newValueIndex) => {
@ -1225,6 +1262,8 @@
radioValues[inputId] = sourceValue
} else if (column.type === FormTypes.sel_search) {
searchSelectValues[inputId] = sourceValue
} else if (column.type === FormTypes.sel_search_async) {
searchSelectAsyncValues[inputId] = sourceValue
} else if (column.type === FormTypes.list_multi) {
if (typeof sourceValue === 'string' && sourceValue.length > 0) {
multiSelectValues[inputId] = sourceValue.split(',')
@ -1245,6 +1284,8 @@
status: 'done',
path: sourceValue
}
} else {
uploadValues[inputId] = null
}
} else {
value[column.key] = sourceValue
@ -1309,6 +1350,7 @@
this.radioValues = radioValues
this.multiSelectValues = multiSelectValues
this.searchSelectValues = searchSelectValues
this.searchSelectAsyncValues = searchSelectAsyncValues
// 重新计算所有统计列
this.recalcAllStatisticsColumns()
// 更新到 dom
@ -1543,6 +1585,8 @@
value[column.key] = this.radioValues[inputId]
} else if (column.type === FormTypes.sel_search) {
value[column.key] = this.searchSelectValues[inputId]
} else if (column.type === FormTypes.sel_search_async) {
value[column.key] = this.searchSelectAsyncValues[inputId]
} else if (column.type === FormTypes.list_multi) {
if (!this.multiSelectValues[inputId] || this.multiSelectValues[inputId].length === 0) {
value[column.key] = ''
@ -1671,6 +1715,7 @@
radioValues: this.radioValues,
multiSelectValues: this.multiSelectValues,
searchSelectValues: this.searchSelectValues,
searchSelectAsyncValues: this.searchSelectAsyncValues,
})
},
/** 设置某行某列的值 */
@ -1736,6 +1781,8 @@
edited = this.setOneValue(this.multiSelectValues, modelKey, newValue, true)
} else if (column.type === FormTypes.sel_search) {
edited = this.setOneValue(this.searchSelectValues, modelKey, newValue)
} else if (column.type === FormTypes.sel_search_async) {
edited = this.setOneValue(this.searchSelectAsyncValues, modelKey, newValue)
} else {
edited = false
}
@ -2704,7 +2751,7 @@
}
this.setOneValue(this.popupValues, id, popupValue)
// 做单个表单验证
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
this.validateOneInput(popupValue, row, column, this.notPassedIds, true, 'change')
// 触发valueChange 事件
this.elemValueChange('input', row, column, value)
},
@ -2731,6 +2778,11 @@
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
this.elemValueChange(FormTypes.sel_search, row, column, value)
},
handleSearchSelectAsyncChange(value, id, row, column) {
this.searchSelectAsyncValues = this.bindValuesChange(value, id, 'searchSelectAsyncValues')
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
this.elemValueChange(FormTypes.sel_search_async, row, column, value)
},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
@ -2992,6 +3044,8 @@
border-bottom: @border;
transition: background-color 300ms;
width: 100%;
height: 61px;
overflow: hidden;
position: absolute;
left: 0;
z-index: 10;
@ -3101,6 +3155,12 @@
}
}
.comp-normal {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.j-td-span {
position: relative;
padding: 4px 11px;

View File

@ -128,6 +128,9 @@
this.reload()
}
})
//update--begin--autor:liusq-----date:20210316------for富文本编辑器tab父组件可能导致的赋值问题------
this.reload()
//update--end--autor:liusq-----date:20210316------for富文本编辑器tab父组件可能导致的赋值问题------
}else{
//update--begin--autor:wangshuai-----date:20200724------for富文本编辑器切换tab无法修改------
let tabLayout = getVmParentByName(this, 'TabLayout')

View File

@ -11,13 +11,13 @@
:beforeUpload="beforeUpload"
:disabled="disabled"
:isMultiple="isMultiple"
:showUploadList="isMultiple"
@change="handleChange"
@preview="handlePreview"
:class="!isMultiple?'imgupload':''">
<div :style="{'width':(!isMultiple?'104px':'auto'),'height':(!isMultiple?'104px':'auto')}">
<img v-if="!isMultiple && picUrl" :src="getAvatarView()" style="width:100%;height:100%"/>
<div v-else class="iconp">
:class="[!isMultiple?'imgupload':'', (!isMultiple && picUrl)?'image-upload-single-over':'' ]">
<div>
<!--<img v-if="!isMultiple && picUrl" :src="getAvatarView()" style="width:100%;height:100%"/>-->
<div class="iconp">
<a-icon :type="uploadLoading ? 'loading' : 'plus'" />
<div class="ant-upload-text">{{ text }}</div>
</div>
@ -189,7 +189,7 @@
path = ''
}
let arr = [];
if(!this.isMultiple){
if(!this.isMultiple && uploadFiles.length>0){
arr.push(uploadFiles[uploadFiles.length-1].response.message)
}else{
for(let a=0;a<uploadFiles.length;a++){
@ -231,8 +231,9 @@
* https://github.com/zhangdaiscott/jeecg-boot/issues/1810
* https://github.com/zhangdaiscott/jeecg-boot/issues/1779
*/
/deep/ .imgupload .ant-upload-select{display:block}
/deep/ .imgupload .ant-upload.ant-upload-select-picture-card{ width:120px;height: 120px;}
/deep/ .imgupload .iconp{padding:32px;}
/deep/ .imgupload .iconp{padding:20px;}
/* update--end--autor:lvdandan-----date:20201016------forj-image-upload图片组件单张图片详情回显空白*/
/deep/ .image-upload-single-over .ant-upload-select{display: none}
</style>

View File

@ -6,6 +6,13 @@
:confirmLoading="uploading"
@cancel="handleClose">
<div style="margin: 0px 0px 5px 1px" v-if="online">
<span style="display: inline-block;height: 32px;line-height: 32px;vertical-align: middle;">是否开启校验:</span>
<span style="display: inline-block;height: 32px;margin-left: 6px">
<a-switch :checked="validateStatus==1" @change="handleChangeValidateStatus" checked-children="" un-checked-children="" size="small"/>
</span>
</div>
<a-upload
name="file"
:multiple="true"
@ -47,6 +54,12 @@
type: String,
default: '',
required: false
},
//是否online导入
online:{
type: Boolean,
default: false,
required: false
}
},
data(){
@ -55,7 +68,8 @@
uploading:false,
fileList:[],
uploadAction:'',
foreignKeys:''
foreignKeys:'',
validateStatus: 0
}
},
watch: {
@ -78,6 +92,7 @@
this.uploading = false
this.visible = true
this.foreignKeys = arg;
this.validateStatus = 0
},
handleRemove(file) {
const index = this.fileList.indexOf(file);
@ -98,6 +113,9 @@
if(this.foreignKeys && this.foreignKeys.length>0){
formData.append('foreignKeys',this.foreignKeys);
}
if(this.online==true){
formData.append('validateStatus',this.validateStatus);
}
fileList.forEach((file) => {
formData.append('files[]', file);
});
@ -105,14 +123,41 @@
postAction(this.uploadAction, formData).then((res) => {
this.uploading = false
if(res.success){
this.$message.success(res.message)
if(res.code == 201){
this.errorTip(res.message, res.result)
}else{
this.$message.success(res.message)
}
this.visible=false
this.$emit('ok')
}else{
this.$message.warning(res.message)
}
})
}
},
// 是否开启校验 开关改变事件
handleChangeValidateStatus(checked){
this.validateStatus = checked==true?1:0
},
// 错误信息提示
errorTip(tipMessage, fileUrl) {
const h = this.$createElement;
let href = window._CONFIG['domianURL'] + fileUrl
this.$warning({
title: '导入成功,但是有错误数据!',
content: h('div', {}, [
h('div', tipMessage),
h('span', '具体详情请 '),
h('a', {
attrs: {
href: href,
target: '_blank'
},
},'点击下载'),
]),
onOk() {},
});
},
}
}

View File

@ -8,10 +8,11 @@
v-on="$listeners"
@ok="handleOk"
@cancel="handleCancel"
destroyOnClose
>
<slot></slot>
<!--有设置标题-->
<template v-if="!isNoTitle" slot="title">
<a-row class="j-modal-title-row" type="flex">
<a-col class="left">
@ -22,6 +23,14 @@
</a-col>
</a-row>
</template>
<!--没有设置标题-->
<template v-else slot="title">
<a-row class="j-modal-title-row" type="flex">
<a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen">
<a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/>
</a-col>
</a-row>
</template>
<!-- 处理 scopedSlots -->
<template v-for="slotName of scopedSlotsKeys" :slot="slotName">
@ -161,7 +170,6 @@
<style lang="less">
.j-modal-box {
&.fullscreen {
top: 0;
left: 0;
@ -190,7 +198,6 @@
height: calc(100% - 55px);
}
}
&.no-title.no-footer {
.ant-modal-body {
height: 100%;
@ -217,6 +224,12 @@
}
}
}
&.no-title{
.ant-modal-header {
padding: 0px 24px;
border-bottom: 0px !important;
}
}
}
@media (max-width: 767px) {

View File

@ -10,6 +10,7 @@
ref="jPopupOnlReport"
:code="code"
:multi="multi"
:sorter="sorter"
:groupId="uniqGroupId"
:param="param"
@ok="callBack"
@ -47,6 +48,11 @@
default: '',
required: false
},
/** 排序列,指定要排序的列,使用方式:列名=desc|asc */
sorter: {
type: String,
default: ''
},
width: {
type: Number,
default: 1200,

View File

@ -12,7 +12,7 @@
<a-upload
name="file"
:multiple="true"
:multiple="multiple"
:action="uploadAction"
:headers="headers"
:data="{'biz':bizPath}"
@ -135,6 +135,10 @@
required:false,
default: true
},
multiple: {
type: Boolean,
default: true
},
},
watch:{
value:{

View File

@ -13,7 +13,7 @@ import JVxeDetailsModal from './JVxeDetailsModal'
import JVxePagination from './JVxePagination'
import { cloneObject, getVmParentByName, pushIfNotExist, randomString, simpleDebounce } from '@/utils/util'
import { UtilTools } from 'vxe-table/packages/tools/src/utils'
import { getNoAuthCols } from "@/utils/authFilter"
import { getNoAuthCols } from '@/utils/authFilter'
export default {
name: 'JVxeTable',
@ -95,6 +95,9 @@ export default {
// 是否异步删除行,如果你要实现异步删除,那么需要把这个选项开启,
// 在remove事件里调用confirmRemove方法才会真正删除除非删除的全是新增的行
asyncRemove: PropTypes.bool.def(false),
// 是否一直显示组件如果为false则只有点击的时候才出现组件
// 注:该参数不能动态修改;如果行、列字段多的情况下,会根据机器性能造成不同程度的卡顿。
alwaysEdit: PropTypes.bool.def(false),
},
data() {
return {
@ -354,7 +357,7 @@ export default {
col.visible = false
} else if (enhanced.switches.editRender) {
renderName = 'editRender'
renderOptions.type = enhanced.switches.visible ? 'visible' : 'default'
renderOptions.type = (enhanced.switches.visible || this.alwaysEdit) ? 'visible' : 'default'
}
} else {
renderOptions.name = JVXETypes._prefix + JVXETypes.normal
@ -1076,7 +1079,7 @@ export default {
// 添加默认值
xTable.tableFullColumn.forEach(column => {
let col = column.own
if (record[col.key] == null || record[col.key] === '') {
if (col.key && (record[col.key] == null || record[col.key] === '')) {
// 设置默认值
let createValue = getEnhancedMixins(col.$type || col.type, 'createValue')
record[col.key] = createValue({row: record, column, $table: xTable})

View File

@ -55,7 +55,9 @@
// 【组件增强】注释详见JVxeCellMixins.js
enhanced: {
aopEvents: {
editActived: event => dispatchEvent(event, 'ant-calendar-picker', el => el.children[0].dispatchEvent(event.$event)),
editActived(event) {
dispatchEvent.call(this, event, 'ant-calendar-picker', el => el.children[0].dispatchEvent(event.$event))
},
},
}
}

View File

@ -34,7 +34,7 @@
return this.rowIndex === 0
},
disabledMoveDown() {
return this.rowIndex === (this.rows.length - 1)
return this.rowIndex === (this.fullDataLength - 1)
},
},
methods: {

View File

@ -116,7 +116,9 @@
// 【组件增强】注释详见JVxeCellMixins.js
enhanced: {
aopEvents: {
editActived: event => dispatchEvent(event, 'ant-select'),
editActived(event) {
dispatchEvent.call(this, event, 'ant-select')
},
},
translate: {enabled: true},
getValue(value) {

View File

@ -23,7 +23,9 @@
autofocus: '.ant-input',
},
aopEvents: {
editActived: event => dispatchEvent(event, 'anticon-fullscreen'),
editActived(event) {
dispatchEvent.call(this, event, 'anticon-fullscreen')
},
},
},
}

View File

@ -36,6 +36,9 @@ export default {
rows() {
return this.params.data
},
fullDataLength() {
return this.params.$table.tableFullData.length
},
rowIndex() {
return this.params.rowIndex
},
@ -291,6 +294,10 @@ export function vModel(value, row, property) {
/** 模拟触发事件 */
export function dispatchEvent({cell, $event}, className, handler) {
// alwaysEdit 下不模拟触发事件,否者会导致触发两次
if (this && this.alwaysEdit) {
return
}
window.setTimeout(() => {
let element = cell.getElementsByClassName(className)
if (element && element.length > 0) {
@ -298,7 +305,9 @@ export function dispatchEvent({cell, $event}, className, handler) {
handler(element[0])
} else {
// 模拟触发点击事件
element[0].dispatchEvent($event)
if($event){
element[0].dispatchEvent($event)
}
}
}
}, 10)

View File

@ -141,6 +141,33 @@ export async function validateFormAndTables(form, cases, autoJumpTab) {
return dataMap
}
/**
* 一次性验证主表单和所有的次表单
* @param form 主表单 form 对象
* @param cases 接收一个数组每项都是一个JVxeTable实例
* @param autoJumpTab
* @returns {Promise<any>}
* @author sunjianlei
*/
export async function validateFormModelAndTables(form,formData, cases, autoJumpTab) {
if (!(form && typeof form.validate === 'function')) {
throw `form 参数需要的是一个form对象而传入的却是${typeof form}`
}
let dataMap = {}
let values = await new Promise((resolve, reject) => {
// 验证主表表单
form.validate((valid,obj) => {
valid ?resolve(formData): reject({error: VALIDATE_FAILED, originError: valid})
})
})
Object.assign(dataMap, {formValue: values})
// 验证所有子表的表单
let subData = await validateTables(cases, autoJumpTab)
// 合并最终数据
dataMap = Object.assign(dataMap, {tablesValue: subData})
return dataMap
}
/**
* 验证并获取一个或多个表格的所有值
*

View File

@ -26,6 +26,7 @@ import JSlider from './JSlider.vue'
import JSwitch from './JSwitch.vue'
import JTime from './JTime.vue'
import JTreeTable from './JTreeTable.vue'
import JEasyCron from "@/components/jeecg/JEasyCron";
//jeecgbiz
import JSelectDepart from '../jeecgbiz/JSelectDepart.vue'
@ -71,5 +72,6 @@ export default {
Vue.component('JSelectPosition', JSelectPosition)
Vue.component('JSelectRole', JSelectRole)
Vue.component('JSelectUserByDep', JSelectUserByDep)
Vue.component(JEasyCron.name, JEasyCron)
}
}

View File

@ -1,6 +1,6 @@
<template>
<a-modal
title="corn表达式"
title="cron表达式"
:width="modalWidth"
:visible="visible"
:confirmLoading="confirmLoading"

View File

@ -78,7 +78,7 @@
const MODAL_WIDTH = 1200;
export default {
name: 'JPopupOnlReport',
props: ['multi', 'code', 'groupId', 'param'],
props: ['multi', 'code', 'sorter', 'groupId', 'param'],
components:{
},
data(){
@ -122,8 +122,9 @@
cgRpConfigId:"",
modalWidth:MODAL_WIDTH,
tableScroll:{x:true},
dynamicParam:{}
dynamicParam:{},
// 排序字段,默认无排序
iSorter: null,
}
},
mounted() {
@ -139,7 +140,28 @@
this.dynamicParamHandler()
this.loadData();
},
}
},
sorter: {
immediate: true,
handler() {
if (this.sorter) {
let arr = this.sorter.split('=')
if (arr.length === 2 && ['asc', 'desc'].includes(arr[1].toLowerCase())) {
this.iSorter = {column: arr[0], order: arr[1].toLowerCase()}
// 排序字段受控
this.table.columns.forEach(col => {
if (col.dataIndex === this.iSorter.column) {
this.$set(col, 'sortOrder', this.iSorter.order === 'asc' ? 'ascend' : 'descend')
} else {
this.$set(col, 'sortOrder', false)
}
})
} else {
console.warn('【JPopup】sorter参数不合法')
}
}
},
},
},
computed:{
showSearchFlag(){
@ -167,6 +189,10 @@
return filterMultiDictText(this.dictOptions[dictCode], text+"");
}
}
// 排序字段受控
if (this.iSorter && currColumns[a].dataIndex === this.iSorter.column) {
currColumns[a].sortOrder = this.iSorter.order === 'asc' ? 'ascend' : 'descend'
}
}
this.table.columns = [...currColumns]
this.initQueryInfo()
@ -253,7 +279,7 @@
paramTarget['self_'+key] = this.dynamicParam[key]
})
}
let param = Object.assign(paramTarget, this.queryParam, this.sorter);
let param = Object.assign(paramTarget, this.queryParam, this.iSorter);
param.pageNo = this.table.pagination.current;
param.pageSize = this.table.pagination.pageSize;
return filterObj(param);
@ -288,8 +314,18 @@
handleChangeInTable(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
if (Object.keys(sorter).length > 0) {
this.sorter.column = sorter.field
this.sorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
this.iSorter = {
column: sorter.field,
order: 'ascend' === sorter.order ? 'asc' : 'desc'
}
// 排序字段受控
this.table.columns.forEach(col => {
if (col.dataIndex === sorter.field) {
this.$set(col, 'sortOrder',sorter.order)
} else {
this.$set(col, 'sortOrder', false)
}
})
}
this.table.pagination = pagination
this.loadData()
@ -342,7 +378,13 @@
combineRowKey(record){
let res = ''
Object.keys(record).forEach(key=>{
res+=record[key]
//update-begin---author:liusq Date:20210203 forpop选择器列主键问题 issues/I29P9Q------------
if(key=='id'){
res=record[key]+res
}else{
res+=record[key]
}
//update-end---author:liusq Date:20210203 forpop选择器列主键问题 issues/I29P9Q------------
})
if(res.length>50){
res = res.substring(0,50)

View File

@ -95,7 +95,6 @@
}).join(',')
}
//update-end-author:lvdandan date:20200513 for:TESTA-438 部门选择组件自定义返回值,数据无法回填
this.backDeparInfo()
},
//返回选中的部门信息
backDeparInfo(){
@ -128,6 +127,7 @@
this.departIds = idstr
}
this.$emit("change", value)
this.backDeparInfo()
},
getDepartNames(){
return this.departNames

View File

@ -167,7 +167,9 @@
if(!this.checkedKeys || this.checkedKeys.length==0){
this.$emit("ok",'')
}else{
this.$emit("ok",this.checkedRows,this.checkedKeys.join(","))
let checkRow = this.getCheckedRows(this.checkedKeys)
let keyStr = this.checkedKeys.join(",")
this.$emit("ok", checkRow, keyStr)
}
this.handleClear()
},

View File

@ -56,8 +56,9 @@
</template>
<script>
import {filterObj} from '@/utils/util'
import { pushIfNotExist, filterObj } from '@/utils/util'
import {queryDepartTreeList, getUserList, queryUserByDepId} from '@/api/api'
import { getAction } from '@/api/manage'
export default {
name: 'JSelectUserByDepModal',
@ -106,6 +107,7 @@
],
scrollTrigger: {},
dataSource: [],
selectionRows: [],
selectedRowKeys: [],
selectUserRows: [],
selectUserIds: [],
@ -163,11 +165,13 @@
pageSize: values.length
}).then((res) => {
if (res.success) {
this.selectionRows = []
let selectedRowKeys = []
let realNames = []
res.result.records.forEach(user => {
realNames.push(user['realname'])
selectedRowKeys.push(user['id'])
this.selectionRows.push(user)
})
this.selectedRowKeys = selectedRowKeys
this.$emit('initComp', realNames.join(','))
@ -182,20 +186,16 @@
if (arg === 1) {
this.ipagination.current = 1;
}
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
})
}
let params = this.getQueryParams()//查询条件
this.loading = true
getAction('/sys/user/queryUserComponentData', params).then(res=>{
if (res.success) {
this.dataSource = res.result.records
this.ipagination.total = res.result.total
}
}).finally(() => {
this.loading = false
})
},
// 触发屏幕自适应
resetScreenSize() {
@ -218,6 +218,7 @@
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.departId = this.selectedDepIds.join(',')
return filterObj(param);
},
getQueryField() {
@ -229,13 +230,13 @@
},
searchReset(num) {
let that = this;
that.selectedRowKeys = [];
that.selectUserIds = [];
that.selectedDepIds = [];
if (num !== 0) {
that.queryParam = {};
that.loadData(1);
}
that.selectedRowKeys = [];
that.selectUserIds = [];
that.selectedDepIds = [];
},
close() {
this.searchReset(0);
@ -258,30 +259,27 @@
that.close();
},
//获取选择用户信息
getSelectUserRows(rowId) {
let dataSource = this.dataSource;
let userIds = "";
this.selectUserRows = [];
for (let i = 0, len = dataSource.length; i < len; i++) {
if (this.selectedRowKeys.includes(dataSource[i].id)) {
this.selectUserRows.push(dataSource[i]);
userIds = userIds + "," + dataSource[i].username
getSelectUserRows() {
this.selectUserRows = []
for (let row of this.selectionRows) {
if (this.selectedRowKeys.includes(row.id)) {
this.selectUserRows.push(row)
}
}
this.selectUserIds = userIds.substring(1);
this.selectUserIds = this.selectUserRows.map(row => row.username).join(',')
},
// 点击树节点,筛选出对应的用户
onDepSelect(selectedDepIds) {
if (selectedDepIds[0] != null) {
this.initQueryUserByDepId(selectedDepIds); // 调用方法根据选选择的id查询用户信息
if (this.selectedDepIds[0] !== selectedDepIds[0]) {
this.selectedDepIds = [selectedDepIds[0]];
}
this.loadData(1);
}
},
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
selectionRows.forEach(row => pushIfNotExist(this.selectionRows, row, 'id'))
},
onSearch() {
this.loadData(1);

View File

@ -0,0 +1,214 @@
<template>
<span v-if="syncToApp || syncToLocal">
<j-third-app-dropdown v-if="enabledTypes.wechatEnterprise" type="wechatEnterprise" name="企微" v-bind="bindAttrs" v-on="bindEvents"/>
<j-third-app-dropdown v-if="enabledTypes.dingtalk" type="dingtalk" name="钉钉" v-bind="bindAttrs" v-on="bindEvents"/>
</span>
<span v-else>未设置任何同步方向</span>
</template>
<script>
import { getAction } from '@/api/manage'
import { cloneObject } from '@/utils/util'
import JThirdAppDropdown from './JThirdAppDropdown'
const backEndUrl = {
// 获取启用的第三方App
getEnabledType: '/sys/thirdApp/getEnabledType',
// 企业微信
wechatEnterprise: {
user: '/sys/thirdApp/sync/wechatEnterprise/user',
depart: '/sys/thirdApp/sync/wechatEnterprise/depart',
},
// 钉钉
dingtalk: {
user: '/sys/thirdApp/sync/dingtalk/user',
depart: '/sys/thirdApp/sync/dingtalk/depart',
}
}
export default {
name: 'JThirdAppButton',
components: {JThirdAppDropdown},
props: {
// 同步类型,可以是 user、depart
bizType: {
type: String,
required: true,
},
// 是否允许同步到第三方APP
syncToApp: Boolean,
// 是否允许第三方APP同步到本地
syncToLocal: Boolean,
// 选择的行
selectedRowKeys: Array,
},
data() {
return {
enabledTypes: {},
attrs: {
dingtalk: {},
},
}
},
computed: {
bindAttrs() {
return {
syncToApp: this.syncToApp,
syncToLocal: this.syncToLocal
}
},
bindEvents() {
return {
'to-app': this.onToApp,
'to-local': this.onToLocal,
}
},
},
created() {
this.loadEnabledTypes()
},
methods: {
handleMenuClick() {
console.log(arguments)
},
onToApp(e) {
this.doSync(e.type, '/toApp')
},
onToLocal(e) {
this.doSync(e.type, '/toLocal')
},
// 获取启用的第三方App
async loadEnabledTypes() {
this.enabledTypes = await loadEnabledTypes()
},
// 开始同步第三方App
doSync(type, direction) {
let urls = backEndUrl[type]
if (!(urls && urls[this.bizType])) {
console.warn('配置出错')
return
}
let url = urls[this.bizType] + direction
let selectedRowKeys = this.selectedRowKeys
let content = '确定要开始同步全部数据吗可能花费较长时间'
if (Array.isArray(selectedRowKeys) && selectedRowKeys.length > 0) {
content = `确定要开始同步这 ${selectedRowKeys.length} 项吗`
} else {
selectedRowKeys = []
}
return new Promise((resolve, reject) => {
let model = this.$confirm({
title: '同步',
content,
onOk: () => {
model.update({
keyboard: false,
okText: '同步中',
cancelButtonProps: {props: {disabled: true}}
})
return getAction(url, {
ids: selectedRowKeys.join(',')
}).then(res => {
let options = null
if (res.result) {
options = {
width: 600,
title: res.message,
content: (h) => {
let nodes
let successInfo = [
`成功信息如下`,
this.renderTextarea(h, res.result.successInfo.map((v, i) => `${i + 1}. ${v}`).join('\n')),
]
if (res.success) {
nodes = [
...successInfo,
h('br'),
`无失败信息`,
]
} else {
nodes = [
`失败信息如下`,
this.renderTextarea(h, res.result.failInfo.map((v, i) => `${i + 1}. ${v}`).join('\n')),
h('br'),
...successInfo,
]
}
return nodes
}
}
}
if (res.success) {
if (options != null) {
this.$success(options)
} else {
this.$message.success(res.message)
}
this.$emit('sync-ok')
} else {
if (options != null) {
this.$warning(options)
} else {
this.$message.warning(res.message)
}
this.$emit('sync-error')
}
}).catch(() => model.destroy()).finally(() => {
resolve()
this.$emit('sync-finally', {
type,
direction,
isToApp: direction === '/toApp',
isToLocal: direction === '/toLocal',
})
})
},
onCancel() {
resolve()
},
})
})
},
renderTextarea(h, value) {
return h('a-textarea', {
props: {
value: value,
readOnly: true,
autosize: {minRows: 5, maxRows: 10},
},
style: {
// 关闭textarea的自动换行使其可以左右滚动
whiteSpace: 'pre',
overflow: 'auto',
}
})
}
},
}
// 启用了哪些第三方App在此缓存
let enabledTypes = null
// 获取启用的第三方App
export async function loadEnabledTypes() {
// 获取缓存
if (enabledTypes != null) {
return cloneObject(enabledTypes)
} else {
let {success, result} = await getAction(backEndUrl.getEnabledType)
if (success) {
// 在此缓存
enabledTypes = cloneObject(result)
return result
} else {
console.warn('getEnabledType查询失败', res)
}
}
return {}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,34 @@
<template>
<a-dropdown v-if="syncToApp && syncToLocal">
<a-button type="primary" icon="sync">同步{{name}}</a-button>
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item v-if="syncToApp" key="to-app">同步到{{name}}</a-menu-item>
<a-menu-item v-if="syncToLocal" key="to-local">同步到本地</a-menu-item>
</a-menu>
</a-dropdown>
<a-button v-else-if="syncToApp" type="primary" icon="sync" @click="handleMenuClick({key:'to-app'})">同步{{name}}</a-button>
<a-button v-else type="primary" icon="sync" @click="handleMenuClick({key:'to-local'})">同步{{name}}到本地</a-button>
</template>
<script>
/* JThirdAppButton 的子组件,不可单独使用 */
export default {
name: 'JThirdAppDropdown',
props: {
type: String,
name: String,
syncToApp: Boolean,
syncToLocal: Boolean,
},
methods: {
handleMenuClick(event) {
this.$emit(event.key, {type: this.type})
},
},
}
</script>
<style scoped>
</style>

View File

@ -38,16 +38,20 @@
//url = "http://www.baidu.com"
console.log("------url------"+url)
if (url !== null && url !== undefined) {
this.url = url;
//-----------------------------------------------------------------------------------------
//url支持通过 ${token}方式传递当前登录TOKEN
let tokenStr = "${token}";
if(url.indexOf(tokenStr)!=-1) {
let token = Vue.ls.get(ACCESS_TOKEN);
this.url = url.replace(tokenStr, token);
} else {
this.url = url
}
//-----------------------------------------------------------------------------------------
/*update_begin author:wuxianquan date:20190908 for:判断打开方式新窗口打开时this.$route.meta.internalOrExternal==true */
if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){
this.closeCurrent();
//外部url加入token
let tokenStr = "${token}";
if(url.indexOf(tokenStr)!=-1){
let token = Vue.ls.get(ACCESS_TOKEN);
this.url = url.replace(tokenStr,token);
}
window.open(this.url);
}
/*update_end author:wuxianquan date:20190908 for:判断打开方式新窗口打开时this.$route.meta.internalOrExternal==true */

View File

@ -36,9 +36,10 @@
import Contextmenu from '@/components/menu/Contextmenu'
import { mixin, mixinDevice } from '@/utils/mixin.js'
import { triggerWindowResizeEvent } from '@/utils/util'
const indexKey = '/dashboard/analysis'
import Vue from 'vue'
import { CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
const indexKey = '/dashboard/analysis'
export default {
name: 'TabLayout',
@ -86,13 +87,6 @@
// 复制一个route对象出来不能影响原route
let currentRoute = Object.assign({}, this.$route)
currentRoute.meta = Object.assign({}, currentRoute.meta)
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
let storeKey = 'route:title:' + currentRoute.fullPath
let routeTitle = this.$ls.get(storeKey)
if (routeTitle) {
currentRoute.meta.title = routeTitle
}
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
this.pageList.push(currentRoute)
this.linkList.push(currentRoute.fullPath)
this.activePage = currentRoute.fullPath
@ -171,7 +165,7 @@
// update-begin-author:sunjianlei date:20200120 for: 动态更改页面标题
changeTitle(title) {
let projectTitle = "Jeecg-Boot 企业级快速开发平台"
let projectTitle = "Jeecg-Boot 企业级低代码平台"
// 首页特殊处理
if (this.$route.path === indexKey) {
document.title = projectTitle

View File

@ -9,7 +9,7 @@
</a>
</div>
<div class="desc">
Jeecg Boot 是中国最具影响力的 企业级 快速开发平台
Jeecg Boot 是中国最具影响力的 企业级 低代码平台
</div>
</div>

View File

@ -57,7 +57,8 @@ import {
Cascader,
Slider,
Transfer,
Rate
Rate,
Collapse,
} from 'ant-design-vue'
import Viser from 'viser-vue'
@ -112,6 +113,7 @@ Vue.use(Cascader)
Vue.use(Slider)
Vue.use(Transfer)
Vue.use(Rate)
Vue.use(Collapse)
Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message

View File

@ -11,6 +11,7 @@
:menu="menus"
:theme="theme"
@select="onSelect"
@updateMenuTitle="onUpdateMenuTitle"
:mode="mode"
:style="smenuStyle">
</s-menu>
@ -19,7 +20,7 @@
</template>
<script>
import ALayoutSider from "ant-design-vue/es/layout/Sider"
import ALayoutSider from 'ant-design-vue/es/layout/Sider'
import Logo from '../tools/Logo'
import SMenu from './index'
import { mixin, mixinDevice } from '@/utils/mixin.js'
@ -68,6 +69,9 @@
methods: {
onSelect (obj) {
this.$emit('menuSelect', obj)
},
onUpdateMenuTitle (obj) {
this.$emit('updateMenuTitle', obj)
}
}
}

View File

@ -82,18 +82,49 @@ export default {
} else {
this.selectedKeys = [routes.pop().path]
}
const openKeys = []
let openKeys = []
if (this.mode === 'inline') {
routes.forEach(item => {
openKeys.push(item.path)
})
}
// update-begin-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
// 包含冒号的是动态菜单
if (this.selectedKeys[0].includes(':')) {
let selectedKey = this.$route.fullPath
this.selectedKeys = [selectedKey]
let newOpenKeys = []
this.fullOpenKeys(this.menu, selectedKey, newOpenKeys)
if (newOpenKeys.length > 0) {
openKeys = newOpenKeys.reverse()
}
}
// update-end-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
//update-begin-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对
if(!this.selectedKeys || this.selectedKeys[0].indexOf(":")<0){
this.collapsed ? (this.cachedOpenKeys = openKeys) : (this.openKeys = openKeys)
}
//update-end-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对
},
// update-begin-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
// 递归查找当前选中的菜单和父级菜单填充openKeys
fullOpenKeys(menus, selectedKey, openKeys) {
for (let item of menus) {
if (item.path === selectedKey) {
openKeys.push(item.path)
this.$emit('updateMenuTitle', item)
return true
} else if (Array.isArray(item.children)) {
if (this.fullOpenKeys(item.children, selectedKey, openKeys)) {
openKeys.push(item.path)
return true
}
}
}
},
// update-end-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
// render
renderItem (menu) {

View File

@ -17,7 +17,7 @@
:type="collapsed ? 'menu-unfold' : 'menu-fold'"
@click="toggle"/>
<span v-if="device === 'desktop'">欢迎进入 Jeecg-Boot 企业级快速开发平台</span>
<span v-if="device === 'desktop'">欢迎进入 Jeecg-Boot 企业级低代码平台</span>
<span v-else>Jeecg-Boot</span>
<user-menu :theme="theme"/>
@ -31,7 +31,9 @@
<s-menu
mode="horizontal"
:menu="menus"
:theme="theme"></s-menu>
:theme="theme"
@updateMenuTitle="handleUpdateMenuTitle"
></s-menu>
</div>
<a-icon
v-else
@ -50,7 +52,6 @@
import UserMenu from '../tools/UserMenu'
import SMenu from '../menu/'
import Logo from '../tools/Logo'
import { mixin } from '@/utils/mixin.js'
export default {
@ -156,8 +157,15 @@
this.topMenuStyle.headerIndexLeft = { 'width': `calc(100% - ${rightWidth})` }
}
}
}
},
//update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
// update-begin-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
handleUpdateMenuTitle(value) {
this.$emit('updateMenuTitle', value)
},
// update-end-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
}
}
</script>

View File

@ -16,6 +16,7 @@
v-if="device === 'mobile'"
:menus="menus"
@menuSelect="menuSelect"
@updateMenuTitle="handleUpdateMenuTitle"
:theme="navTheme"
:collapsed="false"
:collapsible="true"></side-menu>
@ -26,6 +27,7 @@
mode="inline"
:menus="menus"
@menuSelect="myMenuSelect"
@updateMenuTitle="handleUpdateMenuTitle"
:theme="navTheme"
:collapsed="collapsed"
:collapsible="true"></side-menu>
@ -45,6 +47,7 @@
mode="inline"
:menus="menus"
@menuSelect="menuSelect"
@updateMenuTitle="handleUpdateMenuTitle"
:theme="navTheme"
:collapsed="false"
:collapsible="true"></side-menu>
@ -62,6 +65,7 @@
:collapsed="collapsed"
:device="device"
@toggle="toggle"
@updateMenuTitle="handleUpdateMenuTitle"
/>
<!-- layout content -->
@ -85,15 +89,14 @@
import SideMenu from '@/components/menu/SideMenu'
import GlobalHeader from '@/components/page/GlobalHeader'
import GlobalFooter from '@/components/page/GlobalFooter'
import { triggerWindowResizeEvent } from '@/utils/util'
import { mapActions, mapState } from 'vuex'
import { mixin, mixinDevice } from '@/utils/mixin.js'
// update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
// import SettingDrawer from '@/components/setting/SettingDrawer'
// 注释这个因为在个人设置模块已经加载了SettingDrawer页面
// update-end ---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
import { triggerWindowResizeEvent } from '@/utils/util'
import { mapState, mapActions } from 'vuex'
import { mixin, mixinDevice } from '@/utils/mixin.js'
export default {
name: 'GlobalLayout',
components: {
@ -160,10 +163,6 @@
//此处触发动态路由被点击事件
this.findMenuBykey(this.menus,value.key)
this.$emit("dynamicRouterShow",value.key,this.activeMenu.meta.title)
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
let storeKey = 'route:title:' + this.activeMenu.path
this.$ls.set(storeKey, this.activeMenu.meta.title)
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
},
findMenuBykey(menus,key){
for(let i of menus){
@ -173,8 +172,17 @@
this.findMenuBykey(i.children,key)
}
}
}
},
//update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
// update-begin-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
handleUpdateMenuTitle(value) {
this.findMenuBykey(this.menus, value.path)
this.activeMenu.meta.title = value.meta.title
this.$emit('dynamicRouterShow', value.path, this.activeMenu.meta.title)
},
// update-end-author:sunjianlei date:20210409 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题
}
}

View File

@ -185,8 +185,8 @@
return that.Logout({}).then(() => {
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
that.$router.push({ path: '/user/login' });
window.location.reload()
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
//window.location.reload()
}).catch(err => {
that.$message.error({
title: '错误',
@ -225,11 +225,17 @@
// 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')) {
//update-begin-author:taoyan date:20210528 for: 【菜单问题】配置一个iframe地址的菜单内部打开在搜索菜单上打开却新开了一个窗口
if (route.meta.internalOrExternal === true) {
window.open(route.meta.url, '_blank')
} else {
this.$router.push({ path: route.path })
if(route.component.includes('layouts/IframePageView')){
this.$router.push(route)
}else{
this.$router.push({ path: route.path })
}
}
//update-end-author:taoyan date:20210528 for: 【菜单问题】配置一个iframe地址的菜单内部打开在搜索菜单上打开却新开了一个窗口
this.searchMenuVisible = false
},
// update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题

View File

@ -20,7 +20,6 @@ import 'ant-design-vue/dist/antd.less'; // or 'ant-design-vue/dist/antd.less'
import '@/permission' // permission control
import '@/utils/filter' // base filter
import Print from 'vue-print-nb-jeecg'
/*import '@babel/polyfill'*/
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
import SSO from '@/cas/sso.js'
@ -47,7 +46,9 @@ import '@/assets/less/JAreaLinkage.less'
import VueAreaLinkage from 'vue-area-linkage'
import '@/components/jeecg/JVxeTable/install'
import '@/components/JVxeCells/install'
//表单验证
import { rules } from '@/utils/rules'
Vue.prototype.rules = rules
Vue.config.productionTip = false
Vue.use(Storage, config.storageOptions)
Vue.use(Antd)

View File

@ -0,0 +1,190 @@
import JEditableTable from '@/components/jeecg/JEditableTable'
import { VALIDATE_NO_PASSED, getRefPromise,validateFormModelAndTables} from '@/utils/JEditableTableUtil'
import { httpAction, getAction } from '@/api/manage'
export const JEditableTableModelMixin = {
components: {
JEditableTable
},
data() {
return {
title: '操作',
visible: false,
confirmLoading: false,
model:{},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
}
}
},
methods: {
/** 获取所有的editableTable实例 */
getAllTable() {
if (!(this.refKeys instanceof Array)) {
throw this.throwNotArray('refKeys')
}
let values = this.refKeys.map(key => getRefPromise(this, key))
return Promise.all(values)
},
/** 遍历所有的JEditableTable实例 */
eachAllTable(callback) {
// 开始遍历
this.getAllTable().then(tables => {
tables.forEach((item, index) => {
if (typeof callback === 'function') {
callback(item, index)
}
})
})
},
/** 当点击新增按钮时调用此方法 */
add() {
//update-begin-author:lvdandan date:20201113 for:LOWCOD-1049 JEditaTable,子表默认添加一条数据addDefaultRowNum设置无效 #1930
return new Promise((resolve) => {
this.tableReset();
resolve();
}).then(() => {
// 默认新增空数据
let rowNum = this.addDefaultRowNum
if (typeof rowNum !== 'number') {
rowNum = 1
console.warn('由于你没有在 data 中定义 addDefaultRowNum addDefaultRowNum 不是数字所以默认添加一条空数据如果不想默认添加空数据请将定义 addDefaultRowNum 0')
}
this.eachAllTable((item) => {
item.add(rowNum)
})
if (typeof this.addAfter === 'function') this.addAfter(this.model)
this.edit(this.model)
})
//update-end-author:lvdandan date:20201113 for:LOWCOD-1049 JEditaTable,子表默认添加一条数据addDefaultRowNum设置无效 #1930
},
/** 当点击了编辑(修改)按钮时调用此方法 */
edit(record) {
if(record && '{}'!=JSON.stringify(record)&&record.id){
this.tableReset();
}
if (typeof this.editBefore === 'function') this.editBefore(record)
this.visible = true
this.activeKey = this.refKeys[0]
this.$refs.form.resetFields()
this.model = Object.assign({}, record)
if (typeof this.editAfter === 'function') this.editAfter(this.model)
},
/** 关闭弹窗并将所有JEditableTable实例回归到初始状态 */
close() {
this.visible = false
this.$emit('close')
},
//清空子表table的数据
tableReset(){
this.eachAllTable((item) => {
item.clearRow()
})
},
/** 查询某个tab的数据 */
requestSubTableData(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
let { result } = res
let dataSource = []
if (result) {
if (Array.isArray(result)) {
dataSource = result
} else if (Array.isArray(result.records)) {
dataSource = result.records
}
}
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
}).finally(() => {
tab.loading = false
})
},
/** 发起请求,自动判断是执行新增还是修改操作 */
request(formData) {
let url = this.url.add, method = 'post'
if (this.model.id) {
url = this.url.edit
method = 'put'
}
this.confirmLoading = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
},
/* --- handle 事件 --- */
/** ATab 选项卡切换事件 */
handleChangeTabs(key) {
// 自动重置scrollTop状态防止出现白屏
getRefPromise(this, key).then(editableTable => {
editableTable.resetScrollTop()
})
},
/** 关闭按钮点击事件 */
handleCancel() {
this.close()
},
/** 确定按钮点击事件 */
handleOk() {
/** 触发表单验证 */
this.getAllTable().then(tables => {
/** 一次性验证主表和所有的次表 */
return validateFormModelAndTables(this.$refs.form,this.model, tables)
}).then(allValues => {
/** 一次性验证一对一的所有子表 */
return this.validateSubForm(allValues)
}).then(allValues => {
if (typeof this.classifyIntoFormData !== 'function') {
throw this.throwNotFunction('classifyIntoFormData')
}
let formData = this.classifyIntoFormData(allValues)
// 发起请求
return this.request(formData)
}).catch(e => {
if (e.error === VALIDATE_NO_PASSED) {
// 如果有未通过表单验证的子表就自动跳转到它所在的tab
//update--begin--autor:liusq-----date:20210316------for未通过表单验证跳转tab问题------
this.activeKey = e.index == null ? this.activeKey : (e.paneKey?e.paneKey:this.refKeys[e.index])
//update--end--autor:liusq-----date:20210316------for未通过表单验证跳转tab问题------
} else {
console.error(e)
}
})
},
//校验所有子表表单
validateSubForm(allValues){
return new Promise((resolve) => {
resolve(allValues)
})
},
/* --- throw --- */
/** not a function */
throwNotFunction(name) {
return `${name} 未定义或不是一个函数`
},
/** not a array */
throwNotArray(name) {
return `${name} 未定义或不是一个数组`
}
}
}

View File

@ -52,10 +52,13 @@ export const JVxeTableMixin = {
rowNum = 1
console.warn('由于你没有在 data 中定义 addDefaultRowNum addDefaultRowNum 不是数字所以默认添加一条空数据如果不想默认添加空数据请将定义 addDefaultRowNum 0')
}
//update-begin-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
this.eachAllTable((item) => {
item.addRows()
//item.add(rowNum)
setTimeout(()=>{
item.addRows()
}, 30)
})
//update-end-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
if (typeof this.addAfter === 'function') this.addAfter(this.model)
this.edit({})
},

View File

@ -0,0 +1,181 @@
import { VALIDATE_FAILED, getRefPromise, validateFormAndTables,validateFormModelAndTables} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
import { httpAction, getAction } from '@/api/manage'
export const JVxeTableModelMixin = {
data() {
return {
title: '操作',
visible: false,
confirmLoading: false,
scrolling: true,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
}
}
},
methods: {
/** 获取所有的JVxeTable实例 */
getAllTable() {
if (!(this.refKeys instanceof Array)) {
throw this.throwNotArray('refKeys')
}
let values = this.refKeys.map(key => getRefPromise(this, key))
return Promise.all(values)
},
/** 遍历所有的JVxeTable实例 */
eachAllTable(callback) {
// 开始遍历
this.getAllTable().then(tables => {
console.log("tables",tables)
tables.forEach((item, index) => {
if (typeof callback === 'function') {
callback(item, index)
}
})
})
},
/** 当点击新增按钮时调用此方法 */
add() {
if (typeof this.addBefore === 'function') this.addBefore()
// 默认新增空数据
let rowNum = this.addDefaultRowNum
if (typeof rowNum !== 'number') {
rowNum = 1
console.warn('由于你没有在 data 中定义 addDefaultRowNum addDefaultRowNum 不是数字所以默认添加一条空数据如果不想默认添加空数据请将定义 addDefaultRowNum 0')
}
this.eachAllTable((item) => {
//update-begin-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
setTimeout(()=>{
item.addRows()
}, 30)
//update-end-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
})
if (typeof this.addAfter === 'function') this.addAfter(this.model)
this.edit(this.model)
},
/** 当点击了编辑(修改)按钮时调用此方法 */
edit(record) {
if (typeof this.editBefore === 'function') this.editBefore(record)
this.visible = true
this.activeKey = this.refKeys[0]
this.$refs.form.resetFields()
this.model = Object.assign({}, record)
if (typeof this.editAfter === 'function') this.editAfter(this.model)
},
/** 关闭弹窗并将所有JVxeTable实例回归到初始状态 */
close() {
this.visible = false
this.eachAllTable((item) => {
item._remove()
})
this.$emit('close')
},
/** 查询某个tab的数据 */
requestSubTableData(url, params, tab, success) {
tab.loading = true
getAction(url, params).then(res => {
let { result } = res
let dataSource = []
if (result) {
if (Array.isArray(result)) {
dataSource = result
} else if (Array.isArray(result.records)) {
dataSource = result.records
}
}
tab.dataSource = dataSource
typeof success === 'function' ? success(res) : ''
}).finally(() => {
tab.loading = false
})
},
/** 发起请求,自动判断是执行新增还是修改操作 */
request(formData) {
let url = this.url.add, method = 'post'
if (this.model.id) {
url = this.url.edit
method = 'put'
}
this.confirmLoading = true
console.log("formData===>",formData);
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
},
/* --- handle 事件 --- */
/** ATab 选项卡切换事件 */
handleChangeTabs(key) {
// 自动重置scrollTop状态防止出现白屏
getRefPromise(this, key).then(vxeTable => {
vxeTable.resetScrollTop()
})
},
/** 关闭按钮点击事件 */
handleCancel() {
this.close()
},
/** 确定按钮点击事件 */
handleOk() {
/** 触发表单验证 */
this.getAllTable().then(tables => {
/** 一次性验证主表和所有的次表 */
return validateFormModelAndTables(this.$refs.form,this.model, tables)
}).then(allValues => {
/** 一次性验证一对一的所有子表 */
return this.validateSubForm(allValues)
}).then(allValues => {
if (typeof this.classifyIntoFormData !== 'function') {
throw this.throwNotFunction('classifyIntoFormData')
}
let formData = this.classifyIntoFormData(allValues)
// 发起请求
return this.request(formData)
}).catch(e => {
if (e.error === VALIDATE_FAILED) {
// 如果有未通过表单验证的子表就自动跳转到它所在的tab
this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
} else {
console.error(e)
}
})
},
//校验所有子表表单
validateSubForm(allValues){
return new Promise((resolve) => {
resolve(allValues)
})
},
/* --- throw --- */
/** not a function */
throwNotFunction(name) {
return `${name} 未定义或不是一个函数`
},
/** not a array */
throwNotArray(name) {
return `${name} 未定义或不是一个数组`
}
}
}

View File

@ -66,7 +66,7 @@ export const JeecgListMixin = {
let head = {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)}
let tenantid = Vue.ls.get(TENANT_ID)
if(tenantid){
head['tenant_id'] = tenantid
head['tenant-id'] = tenantid
}
return head;
}
@ -177,6 +177,8 @@ export const JeecgListMixin = {
that.loading = true;
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.success) {
//重新计算分页问题
that.reCalculatePage(that.selectedRowKeys.length)
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
@ -198,6 +200,8 @@ export const JeecgListMixin = {
var that = this;
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
//重新计算分页问题
that.reCalculatePage(1)
that.$message.success(res.message);
that.loadData();
} else {
@ -205,6 +209,17 @@ export const JeecgListMixin = {
}
});
},
reCalculatePage(count){
//总数量-count
let total=this.ipagination.total-count;
//获取删除后的分页数
let currentIndex=Math.ceil(total/this.ipagination.pageSize);
//删除后的分页数<所在当前页
if(currentIndex<this.ipagination.current){
this.ipagination.current=currentIndex;
}
console.log('currentIndex',currentIndex)
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
@ -218,6 +233,7 @@ export const JeecgListMixin = {
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
console.log(pagination)
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"

View File

@ -14,6 +14,7 @@ const FormTypes = {
popup:'popup',
list_multi:"list_multi",
sel_search:"sel_search",
sel_search_async:"sel_search_async",
radio:'radio',
checkbox_meta:"checkbox_meta",
input_pop:'input_pop',
@ -76,6 +77,36 @@ export function validateFormAndTables(form, cases) {
return Promise.reject(error)
})
}
/**
* 一次性验证主表单和所有的次表单(新版本)
* @param form 主表单 form 对象
* @param cases 接收一个数组每项都是一个JEditableTable实例
* @returns {Promise<any>}
* @author sunjianlei
*/
export function validateFormModelAndTables(form,values, cases) {
if (!(form && typeof form.validate === 'function')) {
throw `form 参数需要的是一个form对象而传入的却是${typeof form}`
}
let options = {}
return new Promise((resolve, reject) => {
// 验证主表表单
form.validate((valid,obj) => {
valid ?resolve(values):reject({ error: VALIDATE_NO_PASSED })
})
}).then(values => {
Object.assign(options, { formValue: values })
// 验证所有子表的表单
return validateTables(cases)
}).then(all => {
Object.assign(options, { tablesValue: all })
return Promise.resolve(options)
}).catch(error => {
return Promise.reject(error)
})
}
/**

View File

@ -9,10 +9,10 @@ export function disabledAuthFilter(code,formData) {
}
function nodeDisabledAuth(code,formData){
console.log("页面权限禁用--NODE--开始");
//console.log("页面权限禁用--NODE--开始");
let permissionList = [];
try {
console.log("页面权限禁用--NODE--开始",formData);
//console.log("页面权限禁用--NODE--开始",formData);
if (formData) {
let bpmList = formData.permissionList;
permissionList = bpmList.filter(item=>item.type=='2')
@ -53,7 +53,7 @@ function nodeDisabledAuth(code,formData){
}
function globalDisabledAuth(code){
console.log("全局页面禁用权限--Global--开始");
//console.log("全局页面禁用权限--Global--开始");
let permissionList = [];
let allPermissionList = [];
@ -106,7 +106,7 @@ function globalDisabledAuth(code){
}else{
for (let item2 of permissionList) {
if(code === item2.action){
console.log("全局页面权限解除禁用--Global--生效");
//console.log("全局页面权限解除禁用--Global--生效");
gFlag = false;
}
}

View File

@ -0,0 +1,127 @@
import md5 from 'md5'
//签名密钥串(前后端要一致,正式发布请自行修改)
const signatureSecret = "dd05f1c54d63749eda95f9fa6d49v442a";
export default class signMd5Utils {
/**
* json参数升序
* @param jsonObj 发送参数
*/
static sortAsc(jsonObj) {
let arr = new Array();
let num = 0;
for (let i in jsonObj) {
arr[num] = i;
num++;
}
let sortArr = arr.sort();
let sortObj = {};
for (let i in sortArr) {
sortObj[sortArr[i]] = jsonObj[sortArr[i]];
}
return sortObj;
}
/**
* @param url 请求的url,应该包含请求参数(url的?后面的参数)
* @param requestParams 请求参数(POST的JSON参数)
* @returns {string} 获取签名
*/
static getSign(url, requestParams) {
let urlParams = this.parseQueryString(url);
let jsonObj = this.mergeObject(urlParams, requestParams);
//console.log("sign jsonObj: ",jsonObj)
let requestBody = this.sortAsc(jsonObj);
console.log("sign requestBody: ",requestBody)
return md5(JSON.stringify(requestBody) + signatureSecret).toUpperCase();
}
/**
* @param url 请求的url
* @returns {{}} 将url中请求参数组装成json对象(url的?后面的参数)
*/
static parseQueryString(url) {
let urlReg = /^[^\?]+\?([\w\W]+)$/,
paramReg = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
urlArray = urlReg.exec(url),
result = {};
// 获取URL上最后带逗号的参数变量 sys/dict/getDictItems/sys_user,realname,username
let lastpathVariable = url.substring(url.lastIndexOf('/') + 1);
if(lastpathVariable.includes(",")){
if(lastpathVariable.includes("?")){
lastpathVariable = lastpathVariable.substring(0, lastpathVariable.indexOf("?"));
}
result["x-path-variable"] = lastpathVariable;
}
if (urlArray && urlArray[1]) {
let paramString = urlArray[1], paramResult;
while ((paramResult = paramReg.exec(paramString)) != null) {
//数字值转为string类型前后端加密规则保持一致
if(this.myIsNaN(paramResult[2])){
paramResult[2] = paramResult[2].toString()
}
result[paramResult[1]] = paramResult[2];
}
}
return result;
}
/**
* @returns {*} 将两个对象合并成一个
*/
static mergeObject(objectOne, objectTwo) {
if (objectTwo && Object.keys(objectTwo).length > 0) {
for (let key in objectTwo) {
if (objectTwo.hasOwnProperty(key) === true) {
//数字值转为string类型前后端加密规则保持一致
if(this.myIsNaN(objectTwo[key])){
objectTwo[key] = objectTwo[key].toString()
}
objectOne[key] = objectTwo[key];
}
}
}
return objectOne;
}
static urlEncode(param, key, encode) {
if (param == null) return '';
let paramStr = '';
let t = typeof (param);
if (t == 'string' || t == 'number' || t == 'boolean') {
paramStr += '&' + key + '=' + ((encode == null || encode) ? encodeURIComponent(param) : param);
} else {
for (let i in param) {
let k = key == null ? i : key + (param instanceof Array ? '[' + i + ']' : '.' + i);
paramStr += this.urlEncode(param[i], k, encode);
}
}
return paramStr;
};
static getDateTimeToString() {
const date_ = new Date()
const year = date_.getFullYear()
let month = date_.getMonth() + 1
let day = date_.getDate()
if (month < 10) month = '0' + month
if (day < 10) day = '0' + day
let hours = date_.getHours()
let mins = date_.getMinutes()
let secs = date_.getSeconds()
const msecs = date_.getMilliseconds()
if (hours < 10) hours = '0' + hours
if (mins < 10) mins = '0' + mins
if (secs < 10) secs = '0' + secs
if (msecs < 10) secs = '0' + msecs
return year + '' + month + '' + day + '' + hours + '' + mins + '' + secs
}
// true:数值型的false非数值型
static myIsNaN(value) {
return typeof value === 'number' && !isNaN(value);
}
}

View File

@ -5,7 +5,7 @@ const hasPermission = {
//console.log(options);
Vue.directive('has', {
inserted: (el, binding, vnode)=>{
console.log("页面权限控制----");
//console.log("页面权限控制----");
//console.time()
//节点权限处理,如果命中则不进行全局权限处理
if(!filterNodePermission(el, binding, vnode)){
@ -68,7 +68,7 @@ export function filterNodePermission(el, binding, vnode) {
* 全局权限控制
*/
export function filterGlobalPermission(el, binding, vnode) {
console.log("全局页面权限--Global--");
//console.log("全局页面权限--Global--");
let permissionList = [];
let allPermissionList = [];

View File

@ -104,7 +104,7 @@ service.interceptors.request.use(config => {
if (!tenantid) {
tenantid = 0;
}
config.headers[ 'tenant_id' ] = tenantid
config.headers[ 'tenant-id' ] = tenantid
//update-end-author:taoyan date:2020707 for:多租户
if(config.method=='get'){
if(config.url.indexOf("sys/dict/getDictItems")<0){

View File

@ -0,0 +1,110 @@
const validateMobile = (rule, value, callback) => {
let reg = /^1(3|4|5|7|8)\d{9}$/
if (!reg.test(value)) {
callback('请输入正确手机号')
} else {
callback()
}
}
const validateEn = (rule, value, callback) => {
let reg = /^[_a-zA-Z0-9]+$/
let reg2 = /^.{4,18}$/
// 长度为6到18个字符
if (value !== '' && !reg.test(value)) {
callback('只允许字母数字下划线')
} else if (value !== '' && !reg2.test(value)) {
callback('长度6到18个字符')
} else {
callback()
}
}
export const rules = {
mobile: [{
required: true,
message: '请输入手机号',
trigger: 'blur'
}, { validator: validateMobile, trigger: 'blur' }],
userName: [{
required: true, message: '请输入用户名', trigger: 'blur'
}, { validator: validateEn }],
email: [
{ required: false, type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
],
// 验证自然数
naturalNumber: /^(([0-9]*[1-9][0-9]*)|(0+))$/,
naturalNumberMsg: '请输入自然数',
// 英文
english: /^.[A-Za-z]+$/,
englishMsg: '请输入英文字符',
// 座机
telephone: /^\d{3}-\d{7,8}|\d{4}-\d{7,8}$/,
telephoneMsg: '请输入正确的座机号',
// 银行卡号码
bankCard: /^[1-9]\d{9,19}$/,
bankCardMsg: '请输入正确的银行卡号码',
// 证件号码
IDNumber: /^[a-z0-9A-Z]{0,50}$/,
IDNumberMsg: '请输入正确的证件号码',
// 身份证号码,包括15位和18位的
IDCard: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{7}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/,
IDCardMsg: '请输入正确的身份证号码',
// QQ号码
qq: /^[1-9]\d{4,11}$/,
qqMsg: '请输入正确的QQ号码',
// 网址, 仅支持http和https开头的
url: /^(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-.,@?^=%&:/~+#]*[\w\-@?^=%&/~+#])?$/,
urlMsg: '请输入以http和https开头的网址',
// 0到20位的英文字符和数字
enNum0to20: /^[a-z0-9A-Z]{0,20}$/,
enNum0to20Msg: '请输入20位以内的英文字符和数字',
// 2到100位的中英文字符和空格
cnEnSpace2to100: /^[a-zA-Z\u4E00-\u9FA5\s*]{2,100}$/,
cnEnSpace2to100Msg: '请输入2到100位的中英文字符和空格',
// 数字和换行符
numLinefeed: /^[0-9\n*]+$/,
numLinefeedMsg: '请输入数字和换行符',
// 255位以内的字符
char0to255: /^.{0,255}$/,
char0to255Msg: '请输入255位以内的字符',
required: function(min, max) {
let rule = [{ required: true, message: '', trigger: 'blur' }]
if (min) {
let r = { min: min, message: '最小长度' + min + '位字符' }
rule.push(r)
}
if (max) {
let m = { max: max, message: '最大长度' + max + '位字符' }
rule.push(m)
}
return rule
},
select: function() {
let rule = [{ required: true, message: '', trigger: 'change' }]
return rule
},
checked: function(min, max) {
let rule = [{ required: true, type: 'array', message: '', trigger: 'change' }]
if (min) {
let r = { type: 'array', min: min, message: '最少选择' + min + '项' }
rule.push(r)
}
if (max) {
let m = { type: 'array', max: max, message: '最多选择' + max + '项' }
rule.push(m)
}
return rule
}
}
/**
* @description 排序值验证排序值不可以大于255
*/
export const validateOrder = function(rule, value, callback) {
if (parseInt(value) > 255) {
return callback(new Error('排序值不可以大于255'))
} else {
callback()
}
}

View File

@ -145,7 +145,6 @@ function generateChildRouters (data) {
component: componentPath,
//component: resolve => require(['@/' + component+'.vue'], resolve),
hidden:item.hidden,
//component:()=> import(`@/views/${item.component}.vue`),
meta: {
title:item.meta.title ,
icon: item.meta.icon,

View File

@ -8,6 +8,10 @@
<a-tab-pane tab="高级示例" key="2" forceRender>
<j-vxe-demo2/>
</a-tab-pane>
<a-tab-pane tab="联动示例" key="3" forceRender>
<j-vxe-demo3/>
</a-tab-pane>
</a-tabs>
@ -17,10 +21,11 @@
<script>
import JVxeDemo1 from '@views/jeecg/JVxeDemo/JVxeDemo1'
import JVxeDemo2 from '@views/jeecg/JVxeDemo/JVxeDemo2'
import JVxeDemo3 from '@views/jeecg/JVxeDemo/JVxeDemo3'
export default {
name: 'JVXETableDemo',
components: {JVxeDemo2, JVxeDemo1},
components: {JVxeDemo2, JVxeDemo1,JVxeDemo3},
data() {
return {}
},

View File

@ -0,0 +1,132 @@
<template>
<j-vxe-table
ref="vTable"
toolbar
row-number
row-selection
keep-source
:height="484"
:dataSource="dataSource"
:columns="columns"
@valueChange="handleValueChange"
/>
</template>
<script>
import moment from 'moment'
import { randomNumber, randomUUID } from '@/utils/util'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
export default {
name: 'JVxeDemo2',
data() {
return {
columns: [
{
title: '/直辖市/自治区',
key: 's1',
type: JVXETypes.select,
width: '240px',
options: [],
placeholder: '请选择${title}'
},
{
title: '市',
key: 's2',
type: JVXETypes.select,
width: '240px',
options: [],
placeholder: '请选择${title}'
},
{
title: '/',
key: 's3',
type: JVXETypes.select,
width: '240px',
options: [],
placeholder: '请选择${title}'
}
],
dataSource: [],
mockData: [
{ text: '北京市', value: '110000', parent: null },
{ text: '天津市', value: '120000', parent: null },
{ text: '河北省', value: '130000', parent: null },
{ text: '上海市', value: '310000', parent: null },
{ text: '北京市', value: '110100', parent: '110000' },
{ text: '天津市市', value: '120100', parent: '120000' },
{ text: '石家庄市', value: '130100', parent: '130000' },
{ text: '唐山市', value: '130200', parent: '130000' },
{ text: '秦皇岛市', value: '130300', parent: '130000' },
{ text: '上海市', value: '310100', parent: '310000' },
{ text: '东城区', value: '110101', parent: '110100' },
{ text: '西城区', value: '110102', parent: '110100' },
{ text: '朝阳区', value: '110105', parent: '110100' },
{ text: '和平区', value: '120101', parent: '120100' },
{ text: '河东区', value: '120102', parent: '120100' },
{ text: '河西区', value: '120103', parent: '120100' },
{ text: '黄浦区', value: '310101', parent: '310100' },
{ text: '徐汇区', value: '310104', parent: '310100' },
{ text: '长宁区', value: '310105', parent: '310100' },
{ text: '长安区', value: '130102', parent: '130100' },
{ text: '桥西区', value: '130104', parent: '130100' },
{ text: '新华区', value: '130105', parent: '130100' },
{ text: '路南区', value: '130202', parent: '130200' },
{ text: '路北区', value: '130203', parent: '130200' },
{ text: '古冶区', value: '130204', parent: '130200' },
{ text: '海港区', value: '130302', parent: '130300' },
{ text: '山海关区', value: '130303', parent: '130300' },
{ text: '北戴河区', value: '130304', parent: '130300' },
]
}
},
created() {
// 初始化数据
this.columns[0].options = this.request(null)
},
methods: {
request(parentId) {
return this.mockData.filter(i => i.parent === parentId)
},
/** 当选项被改变时,联动其他组件 */
handleValueChange(event) {
const { type, row, column, value, target } = event
console.log("event",event)
if (type === JVXETypes.select) {
// 第一列
if (column.key === 's1') {
// 设置第二列的 options
console.log('this.request(value)::',this.request(value))
target.$refs.vxe.columns[3].options = this.request(value)
// 清空后两列的数据
target.setValues([{
rowKey: row.id,
values: { s2: '', s3: '' }
}])
target.$refs.vxe.columns[4].options = []
} else
// 第二列
if (column.key === 's2') {
target.$refs.vxe.columns[4].options = this.request(value)
target.setValues([{
rowKey: row.id,
values: { s3: '' }
}])
}
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,215 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="6" :sm="24">
<a-form-item label="订单号">
<a-input placeholder="请输入订单号" v-model="queryParam.orderCode"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="订单类型">
<a-select placeholder="请输入订单类型" v-model="queryParam.ctype">
<a-select-option value="1">国内订单</a-select-option>
<a-select-option value="2">国际订单</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i>
<span>已选择</span>
<a style="font-weight: 600">
{{ selectedRowKeys.length }}
</a>
<span>项</span>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<jeecg-order-modal-for-j-vextable ref="modalForm" @ok="modalFormOk"></jeecg-order-modal-for-j-vextable>
</a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JeecgOrderModalForJVextable from './modules/JeecgOrderModalForJVexTable'
export default {
name: 'JeecgOrderMainListForJVxeTable',
mixins: [JeecgListMixin],
components: {
JeecgOrderModalForJVextable
},
data() {
return {
description: '订单管理页面',
// 请求参数
url: {
list: '/test/jeecgOrderMain/list',
delete: '/test/jeecgOrderMain/delete',
deleteBatch: '/test/jeecgOrderMain/deleteBatch'
},
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function(t, r, index) {
return parseInt(index) + 1
}
},
{
title: '订单号',
align: 'center',
dataIndex: 'orderCode'
},
{
title: '订单类型',
align: 'center',
dataIndex: 'ctype',
customRender: (text) => {
let re = ''
if (text === '1') {
re = '国内订单'
} else if (text === '2') {
re = '国际订单'
}
return re
}
},
{
title: '订单日期',
align: 'center',
dataIndex: 'orderDate'
},
{
title: '订单金额',
align: 'center',
dataIndex: 'orderMoney'
},
{
title: '订单备注',
align: 'center',
dataIndex: 'content'
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
}
]
}
},
methods: {
initDictConfig() {
}
}
}
</script>
<style scoped>
.ant-card-body .table-operator {
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td {
padding-top: 15px;
padding-bottom: 15px;
}
.anty-row-operator button {
margin: 0 5px
}
.ant-btn-danger {
background-color: #ffffff
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
</style>

View File

@ -2,26 +2,35 @@
<a-card :bordered="false" style="height:100%;padding-bottom:200px; ">
<div class="table-page-search-wrapper">
<a-form layout="inline" :form="form">
<a-form-model ref="form" :model="formData" layout="inline">
<!-- 字典下拉 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="性别">
<a-form-model-item label="性别" prop="sex">
<j-dict-select-tag v-model="formData.sex" title="性别" dictCode="sex" placeholder="请选择性别"/>
<!-- <j-dict-select-tag title="性别" dictCode="sex" disabled/>-->
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.sex}}</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="性别2" prop="sex2">
<j-dict-select-tag v-model="formData.sex2" type="radioButton" title="性别2" dictCode="sex" placeholder="请选择性别2"/>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.sex2}}</a-col>
</a-row>
<!-- 字典表下拉 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="字典表下拉">
<a-form-model-item label="字典表下拉" prop="user">
<j-dict-select-tag v-model="formData.user" placeholder="请选择用户" dictCode="sys_user,realname,id"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.user}}</a-col>
</a-row>
@ -29,9 +38,9 @@
<!-- 带条件字典表下拉 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="字典表下拉(带条件)">
<a-form-model-item label="字典表下拉(带条件)" prop="user2">
<j-dict-select-tag v-model="formData.user2" placeholder="请选择用户" dictCode="sys_user,realname,id,username!='admin' order by create_time"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.user2}}</a-col>
</a-row>
@ -40,10 +49,10 @@
<!-- 字典搜索 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="字典搜索(同步)">
<a-form-model-item label="字典搜索(同步)" prop="searchValue">
<j-search-select-tag placeholder="请做出你的选择" v-model="formData.searchValue" :dictOptions="searchOptions">
</j-search-select-tag>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.searchValue}}</a-col>
</a-row>
@ -51,7 +60,7 @@
<!-- 字典搜索 异步加载 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="字典搜索(异步)">
<a-form-model-item label="字典搜索(异步)" prop="asyncSelectValue">
<j-search-select-tag
placeholder="请做出你的选择"
v-model="formData.asyncSelectValue"
@ -59,7 +68,7 @@
:pageSize="6"
:async="true">
</j-search-select-tag>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.asyncSelectValue}}</a-col>
</a-row>
@ -67,13 +76,13 @@
<!-- JMultiSelectTag -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="字典下拉(多选)">
<a-form-model-item label="字典下拉(多选)" prop="selMuti">
<j-multi-select-tag
v-model="formData.selMuti"
dictCode="sex"
placeholder="请选择">
</j-multi-select-tag>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">多选组合(v-model){{ formData.selMuti }}</a-col>
</a-row>
@ -81,48 +90,48 @@
<!-- 部门选择控件 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="选择部门 自定义返回值">
<j-select-depart v-model="orgCodes" :trigger-change="true" customReturnField="orgCode" :multi="true"></j-select-depart>
</a-form-item>
<a-form-model-item label="选择部门 自定义返回值" prop="orgCodes">
<j-select-depart v-model="formData.orgCodes" :trigger-change="true" customReturnField="orgCode" :multi="true"></j-select-depart>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的部门Code(v-decorator):{{ orgCodes }}</a-col>
<a-col :span="12">选中的部门Code(v-model):{{ formData.orgCodes }}</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="选择部门">
<j-select-depart v-model="departId" :multi="true"></j-select-depart>
</a-form-item>
<a-form-model-item label="选择部门" prop="departId">
<j-select-depart v-model="formData.departId" :multi="true"></j-select-depart>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的部门ID(v-model):{{ departId }}</a-col>
<a-col :span="12">选中的部门ID(v-model):{{ formData.departId }}</a-col>
</a-row>
<!-- 通过部门选择用户控件 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="选择用户">
<j-select-user-by-dep v-model="userIds" :multi="true"></j-select-user-by-dep>
</a-form-item>
<a-form-model-item label="选择用户" prop="userIds">
<j-select-user-by-dep v-model="formData.userIds" :multi="true"></j-select-user-by-dep>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的用户(v-model):{{ userIds }}</a-col>
<a-col :span="12">选中的用户(v-model):{{ formData.userIds }}</a-col>
</a-row>
<!-- 用户选择控件 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="选择用户">
<j-select-multi-user v-model="multiUser" :query-config="selectUserQueryConfig"/>
</a-form-item>
<a-form-model-item label="选择用户" prop="multiUser">
<j-select-multi-user v-model="formData.multiUser" :query-config="selectUserQueryConfig"/>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的用户(v-model):{{ multiUser }}</a-col>
<a-col :span="12">选中的用户(v-model):{{ formData.multiUser }}</a-col>
</a-row>
<!-- 角色选择 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="选择角色">
<a-form-model-item label="选择角色" prop="selectRole">
<j-select-role v-model="formData.selectRole" @change="changeMe"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.selectRole}}</a-col>
</a-row>
@ -130,9 +139,9 @@
<!-- 职务选择 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="选择职务">
<a-form-model-item label="选择职务" prop="selectPosition">
<j-select-position :buttons="false" v-model="formData.selectPosition" />
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中值:{{ formData.selectPosition}}</a-col>
</a-row>
@ -140,90 +149,90 @@
<!-- JCheckbox -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="多选组合">
<a-form-model-item label="多选组合" prop="jCheckbox">
<j-checkbox
v-model="jcheckbox.values"
:options="jcheckbox.options"
v-model="formData.jCheckbox"
:options="jCheckboxOptions"
/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">多选组合(v-model){{ jcheckbox.values }}</a-col>
<a-col :span="12">多选组合(v-model){{ formData.jCheckbox }}</a-col>
</a-row>
<!-- JCodeEditor -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="代码输入框" style="min-height: 120px">
<a-form-model-item label="代码输入框" style="min-height: 120px" prop="jCodeEditor">
<j-code-editor
language="javascript"
v-model="jcodedditor.value"
v-model="formData.jCodeEditor"
:fullScreen="true"
style="min-height: 100px"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">代码输入框(v-model){{ jcodedditor.value }}</a-col>
<a-col :span="12">代码输入框(v-model){{ formData.jCodeEditor }}</a-col>
</a-row>
<!-- JDate -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="日期选择框">
<j-date v-model="jdate.value" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
</a-form-item>
<a-form-model-item label="日期选择框" prop="jDate">
<j-date v-model="formData.jDate" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
<a-col :span="12">日期选择框(v-model){{ jdate.value }}</a-col>
<a-col :span="12">日期选择框(v-model){{ formData.jDate }}</a-col>
</a-row>
<!-- JEditor -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="富文本编辑器" style="min-height: 300px">
<j-editor v-model="jeditor.value"/>
</a-form-item>
<a-form-model-item label="富文本编辑器" style="min-height: 300px" prop="jEditor">
<j-editor v-model="formData.jEditor"/>
</a-form-model-item>
</a-col>
<a-col :span="12">富文本编辑器(v-model){{ jeditor.value }}</a-col>
<a-col :span="12">富文本编辑器(v-model){{ formData.jEditor }}</a-col>
</a-row>
<!-- JEllipsis -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="过长剪切">
<j-ellipsis :value="jellipsis.value" :length="30"/>
</a-form-item>
<a-form-model-item label="过长剪切" prop="jEllipsis">
<j-ellipsis :value="formData.jEllipsis" :length="30"/>
</a-form-model-item>
</a-col>
<a-col :span="12">过长剪切:{{ jellipsis.value }}</a-col>
<a-col :span="12">过长剪切:{{ formData.jEllipsis }}</a-col>
</a-row>
<!-- JSlider -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="滑块验证码">
<a-form-model-item label="滑块验证码" prop="jSlider">
<j-slider @onSuccess="handleJSliderSuccess"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">滑块验证码验证通过:{{ jslider.value }}</a-col>
<a-col :span="12">滑块验证码验证通过:{{ formData.jSlider }}</a-col>
</a-row>
<!-- JSelectMultiple -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="多选下拉框">
<j-select-multiple v-model="jselectMultiple.value" :options="jselectMultiple.options"/>
</a-form-item>
<a-form-model-item label="多选下拉框" prop="jSelectMultiple">
<j-select-multiple v-model="formData.jSelectMultiple" :options="jSelectMultipleOptions"/>
</a-form-model-item>
</a-col>
<a-col :span="12">多选下拉框(v-model){{ jselectMultiple.value }}</a-col>
<a-col :span="12">多选下拉框(v-model){{ formData.jSelectMultiple }}</a-col>
</a-row>
<!-- JSelectMultiple -->
<a-row :gutter="24">
<a-col>
<a-form-item label="JModal弹窗">
<a-form-model-item label="JModal弹窗">
<a-button style="margin-right: 8px;" @click="()=>modal.visible=true">点击弹出JModal</a-button>
<span style="margin-right: 8px;">全屏化:<a-switch v-model="modal.fullscreen"/></span>
<span style="margin-right: 8px;">允许切换全屏:<a-switch v-model="modal.switchFullscreen"/></span>
</a-form-item>
</a-form-model-item>
<j-modal
:visible.sync="modal.visible"
@ -244,16 +253,16 @@
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="树字典">
<j-tree-dict v-model="formData.treeDict" placeholder="请选择树字典" parentCode="B01" />
</a-form-item>
<a-form-model-item label="树字典" prop="treeDict">
<j-tree-dict v-model="formData.treeDict" placeholder="请选择树字典" parentCode="A01" />
</a-form-model-item>
</a-col>
<a-col :span="12">选中的值(v-model){{ formData.treeDict }}</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="下拉树选择">
<a-form-model-item label="下拉树选择" prop="treeSelect">
<j-tree-select
v-model="formData.treeSelect"
placeholder="请选择菜单"
@ -261,14 +270,14 @@
pidField="parent_id"
pidValue=""
/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的值(v-model){{ formData.treeSelect }}</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="下拉树多选">
<a-form-model-item label="下拉树多选" prop="treeSelectMultiple">
<j-tree-select
v-model="formData.treeSelectMultiple"
placeholder="请选择菜单"
@ -277,7 +286,7 @@
pidValue=""
multiple
/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的值(v-model){{ formData.treeSelectMultiple }}</a-col>
</a-row>
@ -285,9 +294,9 @@
<!-- 分类字典树 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="分类字典树">
<a-form-model-item label="分类字典树" prop="selectCategory">
<j-category-select v-model="formData.selectCategory" pcode="B01" :multiple="true"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的值(v-model){{ formData.selectCategory }}</a-col>
</a-row>
@ -295,23 +304,23 @@
<!-- VueCron -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="cron表达式">
<j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron>
</a-form-item>
<a-form-model-item label="cron表达式" prop="cronExpression">
<j-cron v-model="formData.cronExpression"></j-cron>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="高级查询">
<a-form-model-item label="高级查询">
<j-super-query :fieldList="superQuery.fieldList" />
</a-form-item>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="高级查询自定义按钮">
<a-form-model-item label="高级查询自定义按钮">
<j-super-query :fieldList="superQuery.fieldList">
<!--
v-slot:button 可以更高自由的定制按钮
@ -334,34 +343,34 @@
</a-button-group>
</template>
</j-super-query>
</a-form-item>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="图片上传">
<j-image-upload v-model="imgList"></j-image-upload>
</a-form-item>
<a-form-model-item label="图片上传" prop="imgList">
<j-image-upload bizPath="scott/pic" v-model="formData.imgList"></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的值(v-model){{ imgList }}</a-col>
<a-col :span="12">选中的值(v-model){{ formData.imgList }}</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 65px;margin-bottom:50px;">
<a-col :span="12">
<a-form-item label="文件上传">
<j-upload v-model="fileList"></j-upload>
</a-form-item>
<a-form-model-item label="文件上传" prop="fileList">
<j-upload v-model="formData.fileList"></j-upload>
</a-form-model-item>
</a-col>
<a-col :span="12">
选中的值(v-model)
<j-ellipsis :value="fileList" :length="30" v-if="fileList.length>0"/>
<j-ellipsis :value="formData.fileList" :length="30" v-if="formData.fileList.length>0"/>
</a-col>
</a-row>
<!-- 特殊查询组件 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="特殊查询组件">
<a-form-model-item label="特殊查询组件" prop="jInput">
<a-row>
<a-col :span="15">
<j-input v-model="formData.jInput" :type="jInput.type"/>
@ -371,27 +380,27 @@
<a-select v-model="jInput.type" :options="jInput.options"></a-select>
</a-col>
</a-row>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">输入的值(v-model){{ formData.jInput }}</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="15">
<a-form-item label="MarkdownEditor" style="min-height: 300px">
<j-markdown-editor v-model="content"></j-markdown-editor>
</a-form-item>
<a-form-model-item label="MarkdownEditor" prop="content" style="min-height: 300px">
<j-markdown-editor v-model="formData.content"></j-markdown-editor>
</a-form-model-item>
</a-col>
<a-col :span="9">
输入的值(v-model){{ content }}
输入的值(v-model){{ formData.content }}
</a-col>
</a-row>
<!-- 省市县级联 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="省市县级联">
<a-form-model-item label="省市县级联" prop="areaLinkage1">
<j-area-linkage v-model="formData.areaLinkage1" type="cascader"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">输入的值(v-model){{ formData.areaLinkage1 }}</a-col>
</a-row>
@ -400,9 +409,9 @@
<!-- 省市县级联 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="省市县级联">
<a-form-model-item label="省市县级联" prop="areaLinkage2">
<j-area-linkage v-model="formData.areaLinkage2" type="select"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">输入的值(v-model){{ formData.areaLinkage2 }}</a-col>
</a-row>
@ -410,23 +419,23 @@
<!-- 功能示例:关闭当前页面 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="功能示例关闭当前页面">
<a-form-model-item label="功能示例关闭当前页面">
<a-button type="primary" @click="handleCloseCurrentPage">点击关闭当前页面</a-button>
</a-form-item>
</a-form-model-item>
</a-col>
</a-row>
<!-- JPopup示例 -->
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="JPopup示例">
<a-form-model-item label="JPopup示例" prop="jPopup">
<j-popup v-model="formData.jPopup" code="demo" field="name" orgFields="name" destFields="name" :multi="true"/>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="12">选择的值(v-model){{ formData.jPopup }}</a-col>
</a-row>
</a-form>
</a-form-model>
</div>
</a-card>
@ -490,49 +499,35 @@
formData: {
areaLinkage1: '110105',
areaLinkage2: '140221',
sex: 1
},
form: this.$form.createForm(this),
departId: '57197590443c44f083d42ae24ef26a2c,a7d7e77e06c84325a40932163adcdaa6',
orgCodes: 'A02A01,A02A02',
userIds: 'admin',
multiUser: 'admin,jeecg',
jcheckbox: {
values: 'spring,jeecgboot',
options: [
{ label: 'Jeecg', value: 'jeecg' },
{ label: 'Jeecg-Boot', value: 'jeecgboot' },
{ label: 'Spring', value: 'spring', disabled: true },
{ label: 'MyBaits', value: 'mybatis' }
]
},
jcodedditor: {
value: `function sayHi(word) {
alert(word)
}
sayHi('hello, world!')`
},
jdate: {
value: '2019-5-10 15:33:06'
},
jeditor: {
value: '<h2 style="text-align: center;">富文本编辑器</h2> <p>这里是富文本编辑器。</p>'
},
jellipsis: {
value: '这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。'
},
jslider: {
value: false
},
jselectMultiple: {
options: [
{ text: '字符串', value: 'String' },
{ text: '整数型', value: 'Integer' },
{ text: '浮点型', value: 'Double' },
{ text: '布尔型', value: 'Boolean' }
],
value: 'Integer,Boolean'
sex: 1,
orgCodes: 'A02A01,A02A02',
departId: '57197590443c44f083d42ae24ef26a2c,a7d7e77e06c84325a40932163adcdaa6',
userIds: 'admin',
multiUser: 'admin,jeecg',
jCheckbox: 'spring,jeecgboot',
jCodeEditor: `function sayHi(word) {\n alert(word)\n}\nsayHi('hello, world!')`,
jDate: '2019-5-10 15:33:06',
jEditor: '<h2 style="text-align: center;">富文本编辑器</h2> <p>这里是富文本编辑器。</p>',
jEllipsis: '这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。这是一串很长很长的文字段落。',
jSlider: false,
jSelectMultiple: 'Integer,Boolean',
imgList:[],
fileList:[],
content: '',
cronExpression: '* * * * * ? *',
},
jCheckboxOptions: [
{label: 'Jeecg', value: 'jeecg'},
{label: 'Jeecg-Boot', value: 'jeecgboot'},
{label: 'Spring', value: 'spring', disabled: true},
{label: 'MyBaits', value: 'mybatis'}
],
jSelectMultipleOptions: [
{text: '字符串', value: 'String'},
{text: '整数型', value: 'Integer'},
{text: '浮点型', value: 'Double'},
{text: '布尔型', value: 'Boolean'}
],
modal: {
title: '这里是标题',
visible: false,
@ -556,8 +551,6 @@ sayHi('hello, world!')`
},
]
},
fileList:[],
imgList:[],
jInput: {
type: 'like',
options: [
@ -567,7 +560,6 @@ sayHi('hello, world!')`
{ value: 'le', label: '小于等于le)' },
],
},
content: '',
searchOptions:[{
text:"选项一",
value:"1"
@ -599,10 +591,10 @@ sayHi('hello, world!')`
handleChange() {
},
getDepartIdValue() {
return this.form.getFieldValue('departId')
return this.formData.departId
},
getOrgCodesValue() {
return this.form.getFieldValue('orgCodes')
return this.formData.orgCodes
},
changeMe() {
console.log('you so ... , change Me')
@ -626,12 +618,7 @@ sayHi('hello, world!')`
this.selectedDepUsers = selectedDepUsers
},
handleJSliderSuccess(value) {
this.jslider.value = value
},
setCorn(data){
this.$nextTick(() => {
this.form.cronExpression = data;
})
this.formData.jSlider = value
},
handleCloseCurrentPage() {

View File

@ -0,0 +1,208 @@
<template>
<a-card :bordered="false">
<a-spin :spinning="loading">
<a-form-model ref="form" :model="model" :rules="rules">
<a-tabs>
<a-tab-pane tab="消息选项" key="1">
<a-form-model-item label="测试APP" prop="app" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="model.app" placeholder="请选择测试APP" :options="appOptions"/>
</a-form-model-item>
<a-form-model-item label="发送给所有人" prop="sendAll" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-switch checkedChildren="" unCheckedChildren="" v-model="model.sendAll" @change="onSendAllChange"/>
</a-form-model-item>
<a-form-model-item label="接收人" prop="receiver" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-select-multi-user v-model="model.receiver" :disabled="model.sendAll" placeholder="请选择接收人"/>
</a-form-model-item>
<a-form-model-item label="消息内容" prop="content" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea :rows="5" v-model="model.content" placeholder="请输入消息内容"/>
</a-form-model-item>
<div style="text-align: center;">
<a-button type="primary" size="large" @click="onSend" style="width: 120px;">发送</a-button>
</div>
</a-tab-pane>
</a-tabs>
<a-tabs>
<a-tab-pane tab="测试结果(刷新自动清空)" key="1">
<a-table
rowKey="id"
bordered
size="middle"
:columns="columns"
:dataSource="dataSource"
>
<div slot="action" slot-scope="text, record">
<template v-if="record.app==='DINGTALK'">
<a-popconfirm v-if="!record.recalled" title="确定吗?" @confirm="handleRecall(record)">
<a @click="">撤回</a>
</a-popconfirm>
<span v-else>已撤回</span>
</template>
<template v-else>-</template>
</div>
</a-table>
</a-tab-pane>
</a-tabs>
</a-form-model>
</a-spin>
</a-card>
</template>
<script>
import { loadEnabledTypes } from '@/components/jeecgbiz/thirdApp/JThirdAppButton'
import { postAction } from '@/api/manage'
import { randomUUID } from '@/utils/util'
export default {
name: 'ThirdAppMessageTest',
data() {
return {
loading: false,
labelCol: {span: 6},
wrapperCol: {span: 12},
model: {
sendAll: false,
},
enabledTypes: {},
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: (t, r, index) => {
return this.dataSource.length - index
}
},
{
title: '测试APP',
align: 'center',
dataIndex: 'app',
customRender: (t, r, index) => {
if (t === 'WECHAT_ENTERPRISE') {
return '企业微信'
}
if (t === 'DINGTALK') {
return '钉钉'
} else {
return t
}
}
},
{
title: '接收人',
align: 'center',
dataIndex: 'receiver',
customRender: (t, r, index) => {
return r.sendAll ? '全体' : t
}
},
{
title: '消息内容',
align: 'center',
dataIndex: 'content'
},
{
title: 'response',
align: 'center',
dataIndex: 'response'
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 80,
scopedSlots: {customRender: 'action'}
}
],
dataSource: [],
}
},
computed: {
rules() {
return {
app: [{required: true, message: '请选择测试APP'}],
url: [{required: this.show, message: '请输入菜单路径!'}],
receiver: [{required: !this.model.sendAll, message: '请选择接收人'}],
content: [{required: true, message: '消息内容不能为空'}]
}
},
appOptions() {
return [
{
label: `企业微信${this.enabledTypes.wechatEnterprise ? '' : '已禁用'}`,
value: 'WECHAT_ENTERPRISE',
disabled: !this.enabledTypes.wechatEnterprise
},
{
label: `钉钉${this.enabledTypes.dingtalk ? '' : '已禁用'}`,
value: 'DINGTALK',
disabled: !this.enabledTypes.dingtalk
},
]
},
},
created() {
this.loadEnabledTypes()
},
methods: {
// 获取启用的第三方App
async loadEnabledTypes() {
this.enabledTypes = await loadEnabledTypes()
},
onSendAllChange() {
this.$refs.form.clearValidate('receiver')
},
onSend() {
this.$refs.form.validate((ok, err) => {
if (ok) {
this.loading = true
postAction('/sys/thirdApp/sendMessageTest', this.model).then(({success, result, message}) => {
if (success) {
let response = ''
try {
response = JSON.stringify(result)
} catch (e) {
response = result
}
this.dataSource.unshift(Object.assign({id: randomUUID()}, this.model, {response}))
} else {
this.$message.warning(message)
}
}).finally(() => this.loading = false)
}
})
},
handleRecall(record) {
try {
let response = JSON.parse(record.response)
postAction('/sys/thirdApp/recallMessageTest', {
app: record.app,
msg_task_id: response.result
}).then(res => {
if (res.success) {
this.$set(record, 'recalled', true)
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).catch(e => this.$message.warning(e.message || e))
} catch (e) {
this.$message.warning(e.message || e)
}
},
},
}
</script>
<style scoped>
</style>

View File

@ -1,38 +1,38 @@
<template>
<a-card :bordered="false">
<a-form @submit="handleSubmit" :form="form">
<a-form-model ref="form" :model="model" :rules="rules" @submit="handleSubmit">
<a-row>
<a-col :md="24" :sm="24">
<a-form-item label="Note" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
<a-input v-decorator="['note',{rules: [{ required: true, message: 'Please input your note!' }]}]"/>
</a-form-item>
<a-form-model-item label="Note" prop="note" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
<a-input v-model="model.note"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :md="24" :sm="24">
<a-form-item label="Gender" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
<a-select v-decorator="['gender',{rules: [{ required: true, message: 'Please select your gender!' }]}]" placeholder="Select a option and change input text above" @change="this.handleSelectChange">
<a-form-model-item label="Gender" prop="gender" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
<a-select v-model="model.gender" placeholder="Select a option and change input text above" @change="handleSelectChange">
<a-select-option value="male">male</a-select-option>
<a-select-option value="female">female</a-select-option>
</a-select>
</a-form-item>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :md="24" :sm="24">
<a-form-item label="Gender" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
<a-form-model-item label="Gender" prop="cascader" :labelCol="{ span: 7 }" :wrapperCol="{ span: 15 }">
<a-cascader :options="areaOptions" @change="onChange" :showSearch="{filter}" placeholder="Please select" />
</a-form-item>
</a-form-model-item>
</a-col>
</a-row>
<a-form-item :wrapperCol="{ span: 12, offset: 5 }">
<a-form-model-item :wrapperCol="{ span: 12, offset: 5 }">
<a-col :md="24" :sm="24">
<a-form-item :wrapperCol="{ span: 12, offset: 5 }">
<a-form-model-item :wrapperCol="{ span: 12, offset: 5 }">
<a-button type="primary" htmlType="submit">Submit</a-button>
</a-form-item>
</a-form-model-item>
</a-col>
</a-form-item>
</a-form>
</a-form-model-item>
</a-form-model>
</a-card>
</template>
@ -43,24 +43,27 @@
data () {
return {
formLayout: 'horizontal',
form: this.$form.createForm(this),
model: {},
rules: {
note: [{required: true, message: 'Please input your note!'}],
gender:[{ required: true, message: 'Please select your gender!' }]
},
areaOptions:[]
}
},
methods: {
handleSubmit (e) {
e.preventDefault()
this.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values)
this.$refs.form.validate((ok, err) => {
if (ok) {
console.log('Received values of form: ', this.model)
this.$message.success('succeed!')
}
})
},
handleSelectChange (value) {
console.log(value)
this.form.setFieldsValue({
note: `Hi, ${value === 'male' ? 'man' : 'lady'}!`,
})
this.model.note = `Hi, ${value === 'male' ? 'man' : 'lady'}!`
},
onChange(value, selectedOptions) {
console.log(value, selectedOptions);

View File

@ -99,7 +99,11 @@
placeholder: '点击上传',
token: true,
responseName: 'message',
action: window._CONFIG['domianURL'] + '/sys/common/upload'
action: window._CONFIG['domianURL'] + '/sys/common/upload',
data: {
biz: 'temp',
// 更多扩展参数
},
},
{
title: '字段类型',

View File

@ -7,80 +7,47 @@
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="姓名"
hasFeedback >
<a-input placeholder="请输入姓名" v-decorator="['name', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="关键词"
hasFeedback >
<a-input placeholder="请输入关键词" v-decorator="['keyWord', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="打卡时间"
hasFeedback >
<a-date-picker showTime format="YYYY-MM-DD HH:mm:ss" v-decorator="[ 'punchTime', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="性别">
<!-- <a-select v-decorator="['sex', {}]" placeholder="请选择性别">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="1"></a-select-option>
<a-select-option value="2"></a-select-option>
</a-select>-->
<j-dict-select-tag type="radio" v-decorator="['sex', {}]" :trigger-change="true" dictCode="sex"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="年龄"
hasFeedback >
<a-input placeholder="请输入年龄" v-decorator="['age', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="生日"
hasFeedback >
<a-date-picker v-decorator="[ 'birthday', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="邮箱"
hasFeedback >
<a-input placeholder="请输入邮箱" v-decorator="['email', {}]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="个人简介"
hasFeedback >
<a-input placeholder="请输入个人简介" v-decorator="['content', {}]" />
</a-form-item>
</a-form>
<a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model" :rules="validatorRules">
<a-form-model-item label="姓名" required prop="name" hasFeedback>
<a-input v-model="model.name" placeholder="请输入姓名"/>
</a-form-model-item>
<a-form-model-item label="关键词" prop="keyWord" hasFeedback>
<a-input v-model="model.keyWord" placeholder="请输入关键词"/>
</a-form-model-item>
<a-form-model-item label="打卡时间" prop="punchTime" hasFeedback>
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.punchTime" />
</a-form-model-item>
<a-form-model-item label="性别" prop="sex" hasFeedback>
<j-dict-select-tag type="radio" v-model="model.sex" :trigger-change="true" dictCode="sex"/>
</a-form-model-item>
<a-form-model-item label="年龄" prop="age" hasFeedback>
<a-input placeholder="请输入年龄" v-model="model.age"/>
</a-form-model-item>
<a-form-model-item label="生日" prop="age" hasFeedback>
<a-date-picker valueFormat="YYYY-MM-DD" v-model="model.birthday"/>
</a-form-model-item>
<a-form-model-item label="邮箱" prop="email" hasFeedback >
<a-input placeholder="请输入邮箱" v-model="model.email"/>
</a-form-model-item>
<a-form-model-item label="个人简介" prop="content" hasFeedback>
<a-input type="textarea" placeholder="请输入个人简介" v-model="model.content"/>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import pick from 'lodash.pick'
import moment from "moment"
export default {
name: "JeecgDemoModal",
@ -89,18 +56,28 @@
title:"操作",
visible: false,
model: {},
layout: {
labelCol: { span: 3 },
wrapperCol: { span: 14 },
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
sm: { span: 3 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
name: [
{ required: true, message: '请输入姓名!' },
{ min: 2, max: 30, message: '长度在 2 30 个字符', trigger: 'blur' }
],
email: [
{ required: false, type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
]
},
url: {
add: "/test/jeecgDemo/add",
@ -115,26 +92,19 @@
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'name','keyWord','sex','age','email','content'))
//时间格式化
this.form.setFieldsValue({punchTime:this.model.punchTime?moment(this.model.punchTime,'YYYY-MM-DD HH:mm:ss'):null})
this.form.setFieldsValue({birthday:this.model.birthday?moment(this.model.birthday):null})
});
},
close () {
this.$refs.form.resetFields();
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
@ -145,13 +115,7 @@
httpurl+=this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
//时间格式化
formData.punchTime = formData.punchTime?formData.punchTime.format('YYYY-MM-DD HH:mm:ss'):null;
formData.birthday = formData.birthday?formData.birthday.format():null;
console.log(formData)
httpAction(httpurl,formData,method).then((res)=>{
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
@ -162,17 +126,12 @@
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
},
}
}
}
</script>

View File

@ -63,7 +63,7 @@
<a-table :columns="columns" :dataSource="data" :pagination="false" size="middle">
<template v-for="(col, i) in ['name', 'workId', 'department']" :slot="col" slot-scope="text, record, index">
<a-tooltip title="必填项" :defaultVisible="false" overlayStyle="{ color: 'red' }">
<a-tooltip title="必填项" :defaultVisible="false" :overlayStyle="{ color: 'red' }">
<a-input :key="col" v-if="record.editable" style="margin: -5px 0" :value="text" :placeholder="columns[i].title" @change="e => handlerRowChange(e.target.value, record.key, col)"/>
<template v-else>{{ text }}</template>
</a-tooltip>

View File

@ -8,53 +8,38 @@
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="orderMainModel" :rules="validatorRules">
<!-- 主表单区域 -->
<a-row class="form-row" :gutter="16">
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单号">
<a-input placeholder="请输入订单号" v-decorator="['orderCode', {rules: [{ required: true, message: '请输入订单号!' }]}]" />
</a-form-item>
<a-form-model-item label="订单号" required prop="orderCode">
<a-input v-model="orderMainModel.orderCode" placeholder="请输入订单号"/>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单类型">
<a-select placeholder="请输入订单类型" v-decorator="['ctype',{}]">
<a-form-model-item label="订单类型" prop="ctype">
<a-select placeholder="请选择订单类型" v-model="orderMainModel.ctype" >
<a-select-option value="1">国内订单</a-select-option>
<a-select-option value="2">国际订单</a-select-option>
</a-select>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单日期">
<a-date-picker showTime format="YYYY-MM-DD HH:mm:ss" v-decorator="[ 'orderDate',{}]"/>
</a-form-item>
<a-form-model-item label="订单日期" prop="orderDate">
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="orderMainModel.orderDate"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="16">
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单金额">
<a-input-number style="width: 200px" v-decorator="[ 'orderMoney', {}]" />
</a-form-item>
<a-form-model-item label="订单金额" prop="orderMoney">
<a-input-number style="width: 200px" v-model="orderMainModel.orderMoney"/>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单备注">
<a-input placeholder="请输入订单备注" v-decorator="['content', {}]" />
</a-form-item>
<a-form-model-item label="订单备注" prop="content">
<a-input placeholder="请输入订单备注" v-model="orderMainModel.content" />
</a-form-model-item>
</a-col>
</a-row>
@ -65,47 +50,49 @@
<a-row type="flex" style="margin-bottom:10px" :gutter="16">
<a-col :span="5">客户名</a-col>
<a-col :span="5">性别</a-col>
<a-col :span="5">身份证号码</a-col>
<a-col :span="5">手机号</a-col>
<a-col :span="4">操作</a-col>
<a-col :span="6">身份证号码</a-col>
<a-col :span="6">手机号</a-col>
<a-col :span="2">操作</a-col>
</a-row>
<a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in orderMainModel.jeecgOrderCustomerList" :key="index">
<a-col :span="6" style="display: none">
<a-form-item>
<a-input placeholder="id" v-decorator="['jeecgOrderCustomerList['+index+'].id', {'initialValue':item.id}]" />
</a-form-item>
<a-form-model-item>
<a-input placeholder="id" v-model="item.id" />
</a-form-model-item>
</a-col>
<a-col :span="5">
<a-form-item>
<a-input placeholder="客户名" v-decorator="['jeecgOrderCustomerList['+index+'].name', {'initialValue':item.name,rules: [{ required: true, message: '请输入用户名!' }]}]" />
</a-form-item>
<a-form-model-item>
<a-input placeholder="客户名" v-model="item.name" />
</a-form-model-item>
</a-col>
<a-col :span="5">
<a-form-item>
<a-select placeholder="性别" v-decorator="['jeecgOrderCustomerList['+index+'].sex', {'initialValue':item.sex}]">
<a-form-model-item>
<a-select placeholder="性别" v-model="item.sex" >
<a-select-option value="1">男</a-select-option>
<a-select-option value="2">女</a-select-option>
</a-select>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :span="5">
<a-form-item>
<a-input placeholder="身份证号" v-decorator="['jeecgOrderCustomerList['+index+'].idcard', {'initialValue':item.idcard,rules: [{ pattern: '^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|[xX])$', message: '身份证号格式不对!' }]}]"/>
</a-form-item>
<a-col :span="6">
<a-form-model-item :prop="'jeecgOrderCustomerList.' + index + '.idcard'" :rules="[{required: true,message: '请输入身份证号',trigger: 'blur'},{ pattern: rules.IDCard, message: '身份证号格式不对!' }]">
<a-input placeholder="身份证号" v-model="item.idcard" />
</a-form-model-item>
</a-col>
<a-col :span="5">
<a-form-item>
<a-input placeholder="手机号" v-decorator="['jeecgOrderCustomerList['+index+'].telphone', {'initialValue':item.telphone,rules: [{ pattern: '^1(3|4|5|7|8)\\d{9}$', message: '手机号格式不对!' }]}]"/>
</a-form-item>
<a-col :span="6">
<a-form-model-item :prop="'jeecgOrderCustomerList.' + index + '.telphone'" :rules="rules.mobile">
<a-input placeholder="手机号" v-model="item.telphone"/>
</a-form-model-item>
</a-col>
<a-col :span="4">
<a-form-item>
<a-button @click="addRowCustom" icon="plus"></a-button>&nbsp;
<a-button @click="delRowCustom(index)" icon="minus"></a-button>
</a-form-item>
<a-col :span="2">
<a-form-model-item>
<a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/>
</a-form-model-item>
</a-col>
</a-row>
<a-button type="dashed" style="width: 98%;margin-top: 10px" @click="addRowCustom">
<a-icon type="plus" /> 添加客户信息
</a-button>
</div>
</a-tab-pane>
@ -118,32 +105,34 @@
</a-row>
<a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in orderMainModel.jeecgOrderTicketList" :key="index">
<a-col :span="6" style="display: none">
<a-form-item>
<a-input placeholder="id" v-decorator="['jeecgOrderTicketList['+index+'].id', {'initialValue':item.id}]" />
</a-form-item>
<a-form-model-item>
<a-input placeholder="id" v-model="item.id" />
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-item>
<a-input placeholder="航班号" v-decorator="['jeecgOrderTicketList['+index+'].ticketCode', {'initialValue':item.ticketCode,rules: [{ required: true, message: '请输入航班号!' }]}]" />
</a-form-item>
<a-form-model-item :prop="'jeecgOrderTicketList.' + index + '.ticketCode'" :rules="{required: true,message: '请输入航班号',trigger: 'blur'}">
<a-input placeholder="航班号" v-model="item.ticketCode"/>
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-item>
<j-date placeholder="航班时间" :trigger-change="true" v-decorator="['jeecgOrderTicketList['+index+'].tickectDate', {'initialValue':item.tickectDate}]"></j-date>
</a-form-item>
<a-form-model-item>
<a-date-picker placeholder="航班时间" valueFormat="YYYY-MM-DD" v-model="item.tickectDate" />
</a-form-model-item>
</a-col>
<a-col :span="6">
<a-form-item>
<a-button @click="addRowTicket" icon="plus"></a-button>&nbsp;
<a-button @click="delRowTicket(index)" icon="minus"></a-button>
</a-form-item>
<a-form-model-item>
<a-icon type="minus-circle" @click="delRowTicket(index)" style="fontSize :20px"/>
</a-form-model-item>
</a-col>
</a-row>
<a-button type="dashed" style="width: 98%;margin-top: 10px" @click="addRowTicket">
<a-icon type="plus" /> 添加机票信息
</a-button>
</div>
</a-tab-pane>
</a-tabs>
</a-form>
</a-form-model>
</a-spin>
</a-modal>
</template>
@ -151,9 +140,6 @@
<script>
import { httpAction,getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import pick from 'lodash.pick'
import moment from "moment"
export default {
name: "JeecgOrderMainModal",
components: {
@ -163,8 +149,10 @@
return {
title:"操作",
visible: false,
orderMainModel: {jeecgOrderCustomerList: [{}],
jeecgOrderTicketList: [{}]},
orderMainModel: {
jeecgOrderCustomerList: [{}],
jeecgOrderTicketList: [{}]
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
@ -173,10 +161,11 @@
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
orderCode: [
{ required: true, message: '订单号不能为空', trigger: 'blur' }
]
},
url: {
add: "/test/jeecgOrderMain/add",
@ -193,10 +182,10 @@
this.edit({});
},
edit (record) {
this.form.resetFields();
this.orderMainModel = Object.assign({}, record);
this.orderMainModel.jeecgOrderCustomerList = [{}];
this.orderMainModel.jeecgOrderTicketList = [{}];
this.orderMainModel = Object.assign({
jeecgOrderCustomerList: [{}],
jeecgOrderTicketList: [{}]
}, record);
//--------------------------------------------------------
//初始化明细表数据
console.log(this.orderMainModel.id)
@ -217,12 +206,7 @@
}
})
}
//--------------------------------------------------------
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.orderMainModel,'orderCode','ctype','orderMoney','content'))
this.form.setFieldsValue({orderDate:this.orderMainModel.orderDate?moment(this.orderMainModel.orderDate):null}) //时间格式化
});
},
close () {
this.$emit('close');
@ -231,8 +215,8 @@
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
@ -241,18 +225,9 @@
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
method = 'put';
}
let orderMainData = Object.assign(this.orderMainModel, values);
//时间格式化
orderMainData.orderDate = orderMainData.orderDate?orderMainData.orderDate.format('YYYY-MM-DD HH:mm:ss'):null;
let formData = {
...orderMainData,
jeecgOrderCustomerList: orderMainData.jeecgOrderCustomerList,
jeecgOrderTicketList: orderMainData.jeecgOrderTicketList
}
console.log(formData)
httpAction(httpurl,formData,method).then((res)=>{
httpAction(httpurl,this.orderMainModel,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
@ -276,9 +251,8 @@
},
delRowCustom (index) {
console.log(index)
let all = this.form.getFieldsValue()
let all = this.orderMainModel
all['jeecgOrderCustomerList'].splice(index,1);
this.form.setFieldsValue(all)
this.orderMainModel.jeecgOrderCustomerList.splice(index,1);
this.$forceUpdate();
},
@ -289,9 +263,8 @@
},
delRowTicket (index) {
console.log(index)
let all = this.form.getFieldsValue()
let all = this.orderMainModel
all['jeecgOrderTicketList'].splice(index,1);
this.form.setFieldsValue(all)
this.orderMainModel.jeecgOrderTicketList.splice(index,1);
this.$forceUpdate();
},

View File

@ -9,58 +9,41 @@
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model" >
<!-- 主表单区域 -->
<a-row class="form-row" :gutter="0">
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单号">
<a-input
placeholder="请输入订单号"
v-decorator="['orderCode', {rules: [{ required: true, message: '请输入订单号!' }]}]"/>
</a-form-item>
<a-form-model-item label="订单号" prop="orderCode" :rules="[{ required: true, message: '请输入订单号!' }]">
<a-input placeholder="请输入订单号" v-model="model.orderCode"/>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单类型">
<a-select placeholder="请选择订单类型" v-decorator="['ctype',{}]">
<a-form-model-item label="订单类型">
<a-select placeholder="请选择订单类型" v-model="model.ctype">
<a-select-option value="1">国内订单</a-select-option>
<a-select-option value="2">国际订单</a-select-option>
</a-select>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单日期">
<a-date-picker showTime format="YYYY-MM-DD HH:mm:ss" style="width: 100%" v-decorator="[ 'orderDate',{}]"/>
</a-form-item>
<a-form-model-item label="订单日期">
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" style="width: 100%" v-model="model.orderDate"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="0">
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单金额">
<a-input-number placeholder="请输入订单金额" style="width: 100%" v-decorator="[ 'orderMoney', {}]"/>
</a-form-item>
<a-form-model-item label="订单金额">
<a-input-number placeholder="请输入订单金额" style="width: 100%" v-model="model.orderMoney"/>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单备注">
<a-input placeholder="请输入订单备注" v-decorator="['content', {}]"/>
</a-form-item>
<a-form-model-item label="订单备注">
<a-input placeholder="请输入订单备注" v-model="model.content"/>
</a-form-model-item>
</a-col>
</a-row>
</a-form>
</a-form-model>
<!-- 子表单区域 -->
<a-tabs v-model="activeKey" @change="handleChangeTabs">
@ -100,11 +83,9 @@
<script>
import JEditableTable from '@/components/jeecg/JEditableTable'
import { FormTypes, VALIDATE_NO_PASSED, getRefPromise, validateFormAndTables } from '@/utils/JEditableTableUtil'
import { FormTypes, VALIDATE_NO_PASSED, getRefPromise, validateFormModelAndTables } from '@/utils/JEditableTableUtil'
import { httpAction, getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import pick from 'lodash.pick'
import moment from 'moment'
export default {
name: 'JeecgOrderModalForJEditableTable',
@ -115,7 +96,6 @@
return {
title: '操作',
visible: false,
form: this.$form.createForm(this),
confirmLoading: false,
model: {},
labelCol: {
@ -235,15 +215,7 @@
edit(record) {
this.visible = true
this.activeKey = '1'
this.form.resetFields()
this.model = Object.assign({}, record)
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'orderCode', 'ctype', 'orderMoney', 'content'))
//时间格式化
this.form.setFieldsValue({ orderDate: this.model.orderDate ? moment(this.model.orderDate) : null })
})
// 加载子表数据
if (this.model.id) {
let params = { id: this.model.id }
@ -259,6 +231,7 @@
editableTables[1].initialize()
})
this.$emit('close')
this.$refs.form.resetFields();
},
/** 查询某个tab的数据 */
requestTableData(url, params, tab) {
@ -286,7 +259,7 @@
validateFields() {
this.getAllTable().then(tables => {
/** 一次性验证主表和所有的次表 */
return validateFormAndTables(this.form, tables)
return validateFormModelAndTables(this.$refs.form,this.model, tables)
}).then(allValues => {
let formData = this.classifyIntoFormData(allValues)
// 发起请求
@ -303,8 +276,6 @@
/** 整理成formData */
classifyIntoFormData(allValues) {
let orderMain = Object.assign(this.model, allValues.formValue)
//时间格式化
orderMain.orderDate = orderMain.orderDate ? orderMain.orderDate.format('YYYY-MM-DD HH:mm:ss') : null
return {
...orderMain, // 展开
jeecgOrderCustomerList: allValues.tablesValue[0].values,

View File

@ -0,0 +1,312 @@
<template>
<a-modal
:title="title"
:width="1200"
:visible="visible"
:destroyOnClose="true"
:maskClosable="false"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model" >
<!-- 主表单区域 -->
<a-row class="form-row" :gutter="0">
<a-col :lg="8">
<a-form-model-item label="订单号" prop="orderCode" :rules="[{ required: true, message: '请输入订单号!' }]">
<a-input placeholder="请输入订单号" v-model="model.orderCode"/>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-model-item label="订单类型">
<a-select placeholder="请选择订单类型" v-model="model.ctype">
<a-select-option value="1">国内订单</a-select-option>
<a-select-option value="2">国际订单</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-model-item label="订单日期">
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" style="width: 100%" v-model="model.orderDate"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="0">
<a-col :lg="8">
<a-form-model-item label="订单金额">
<a-input-number placeholder="请输入订单金额" style="width: 100%" v-model="model.orderMoney"/>
</a-form-model-item>
</a-col>
<a-col :lg="8">
<a-form-model-item label="订单备注">
<a-input placeholder="请输入订单备注" v-model="model.content"/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
<!-- 子表单区域 -->
<a-tabs v-model="activeKey" @change="handleChangeTabs">
<a-tab-pane tab="客户信息" key="1" :forceRender="true">
<j-vxe-table
ref="editableTable1"
toolbar
row-number
row-selection
keep-source
:height="300"
:loading="table1.loading"
:dataSource="table1.dataSource"
:columns="table1.columns"
style="margin-top: 8px;"/>
</a-tab-pane>
<a-tab-pane tab="机票信息" key="2" :forceRender="true">
<j-vxe-table
ref="editableTable2"
toolbar
row-number
row-selection
keep-source
:height="300"
:loading="table2.loading"
:dataSource="table2.dataSource"
:columns="table2.columns"
style="margin-top: 8px;"/>
</a-tab-pane>
</a-tabs>
</a-spin>
</a-modal>
</template>
<script>
import JEditableTable from '@/components/jeecg/JEditableTable'
import { VALIDATE_FAILED, getRefPromise, validateFormModelAndTables } from '@/components/jeecg/JVxeTable/utils/vxeUtils'
import { httpAction, getAction } from '@/api/manage'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import JDate from '@/components/jeecg/JDate'
export default {
name: 'JeecgOrderModalForJvexTable',
components: {
JDate, JEditableTable
},
data() {
return {
title: '操作',
visible: false,
confirmLoading: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 24 - 6 }
},
activeKey: '1',
// 客户信息
table1: {
loading: false,
dataSource: [],
columns: [
{
title: '客户名',
key: 'name',
width: '24%',
type: JVXETypes.input,
defaultValue: '',
placeholder: '请输入${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{
title: '性别',
key: 'sex',
width: '18%',
type: JVXETypes.select,
options: [ // 下拉选项
{ title: '男', value: '1' },
{ title: '女', value: '2' }
],
defaultValue: '',
placeholder: '请选择${title}'
},
{
title: '身份证号',
key: 'idcard',
width: '24%',
type: JVXETypes.input,
defaultValue: '',
placeholder: '请输入${title}',
validateRules: [{
pattern: '^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|[xX])$',
message: '${title}格式不正确'
}]
},
{
title: '手机号',
key: 'telphone',
width: '24%',
type: JVXETypes.input,
defaultValue: '',
placeholder: '请输入${title}',
validateRules: [{
pattern: '^1(3|4|5|7|8)\\d{9}$',
message: '${title}格式不正确'
}]
}
]
},
// 机票信息
table2: {
loading: false,
dataSource: [],
columns: [
{
title: '航班号',
key: 'ticketCode',
width: '40%',
type: JVXETypes.input,
defaultValue: '',
placeholder: '请输入${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{
title: '航班时间',
key: 'tickectDate',
width: '30%',
type: JVXETypes.date,
placeholder: '请选择${title}',
defaultValue: ''
}
]
},
url: {
add: '/test/jeecgOrderMain/add',
edit: '/test/jeecgOrderMain/edit',
orderCustomerList: '/test/jeecgOrderMain/queryOrderCustomerListByMainId',
orderTicketList: '/test/jeecgOrderMain/queryOrderTicketListByMainId'
}
}
},
created() {
},
methods: {
// 获取所有的editableTable实例
getAllTable() {
return Promise.all([
getRefPromise(this, 'editableTable1'),
getRefPromise(this, 'editableTable2')
])
},
add() {
// 默认新增一条数据
this.getAllTable().then(editableTables => {
//editableTables[0].add()
//editableTables[1].add()
})
this.edit({})
},
edit(record) {
this.visible = true
this.activeKey = '1'
this.model = Object.assign({}, record)
// 加载子表数据
if (this.model.id) {
let params = { id: this.model.id }
this.requestTableData(this.url.orderCustomerList, params, this.table1)
this.requestTableData(this.url.orderTicketList, params, this.table2)
}
},
close() {
this.visible = false
this.getAllTable().then(editableTables => {
this.table1.dataSource=[];
this.table2.dataSource=[];
})
this.$emit('close')
},
/** 查询某个tab的数据 */
requestTableData(url, params, tab) {
tab.loading = true
getAction(url, params).then(res => {
tab.dataSource = res.result || []
}).finally(() => {
tab.loading = false
})
},
handleOk() {
this.validateFields()
},
handleCancel() {
this.close()
},
/** ATab 选项卡切换事件 */
handleChangeTabs(key) {
getRefPromise(this, `editableTable${key}`).then(editableTable => {
editableTable.resetScrollTop()
})
},
/** 触发表单验证 */
validateFields() {
this.getAllTable().then(tables => {
/** 一次性验证主表和所有的次表 */
return validateFormModelAndTables(this.$refs.form,this.model, tables)
}).then(allValues => {
let formData = this.classifyIntoFormData(allValues)
// 发起请求
return this.requestAddOrEdit(formData)
}).catch(e => {
if (e.error === VALIDATE_FAILED) {
// 如果有未通过表单验证的子表就自动跳转到它所在的tab
this.activeKey = e.index == null ? this.activeKey : (e.index + 1).toString()
} else {
console.error(e)
}
})
},
/** 整理成formData */
classifyIntoFormData(allValues) {
let orderMain = Object.assign(this.model, allValues.formValue)
return {
...orderMain, // 展开
jeecgOrderCustomerList: allValues.tablesValue[0].tableData,
jeecgOrderTicketList: allValues.tablesValue[1].tableData
}
},
/** 发起新增或修改的请求 */
requestAddOrEdit(formData) {
let url = this.url.add, method = 'post'
if (this.model.id) {
url = this.url.edit
method = 'put'
}
this.confirmLoading = true
httpAction(url, formData, method).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
}
}
</script>
<style scoped>
</style>

View File

@ -1,6 +1,6 @@
<template>
<a-modal
title="corn表达式"
title="cron表达式"
:width="modalWidth"
:visible="visible"
:confirmLoading="confirmLoading"

View File

@ -11,64 +11,64 @@
<!-- 编辑 -->
<a-spin :spinning="confirmLoading" v-if="editStatus">
<a-form :form="form">
<a-form-item
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="客户姓名"
prop="name"
required
hasFeedback>
<a-input placeholder="请输入客户姓名" v-decorator="['name', {rules: [{ required: true, message: '请输入客户姓名!' }]}]"
:readOnly="disableSubmit"/>
</a-form-item>
<a-form-item
<a-input placeholder="请输入客户姓名" v-model="model.name" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="性别"
hasFeedback>
<a-select v-decorator="['sex', {}]" placeholder="请选择性别">
<a-select v-model="model.sex" placeholder="请选择性别">
<a-select-option value="1">男性</a-select-option>
<a-select-option value="2">女性</a-select-option>
</a-select>
</a-form-item>
<a-form-item
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="身份证号码"
prop="idcard"
hasFeedback>
<a-input placeholder="请输入身份证号码" v-decorator="['idcard', validatorRules.idcard]" :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item
<a-input placeholder="请输入身份证号码" v-model="model.idcard" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="身份证扫描件"
hasFeedback>
<j-image-upload text="上传" v-model="fileList" :isMultiple="true"></j-image-upload>
</a-form-item>
<a-form-item
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="联系方式"
prop="telphone"
hasFeedback>
<a-input v-decorator="[ 'telphone', validatorRules.telphone]" :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item
<a-input v-model="model.telphone" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单号码"
v-model="this.orderId"
:hidden="hiding"
hasFeedback>
<a-input v-decorator="[ 'orderId', {}]" disabled="disabled"/>
</a-form-item>
</a-form>
<a-input v-model="model.orderId" disabled="disabled"/>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import {httpAction} from '@/api/manage'
import pick from 'lodash.pick'
import Vue from 'vue'
import {ACCESS_TOKEN} from "@/store/mutation-types"
import JImageUpload from '../../../../components/jeecg/JImageUpload'
@ -89,59 +89,6 @@
xs: {span: 24},
sm: {span: 16},
},
// 表头
columns: [
{
title: '客户名',
align: "center",
dataIndex: 'name',
},
{
title: '性别',
align: "center",
dataIndex: 'sex',
},
{
title: '身份证号码',
align: "center",
dataIndex: 'idcard',
},
{
title: '身份证扫描件',
align: "center",
dataIndex: 'idcardPic',
},
{
title: '电话',
dataIndex: 'telphone',
align: "center",
},
{
title: '订单号码',
dataIndex: 'orderId',
align: "center",
},
{
title: '创建人',
dataIndex: 'createBy',
align: "center",
},
{
title: '创建时间',
dataIndex: 'createTime',
align: "center",
},
{
title: '更新时间',
dataIndex: 'updateBy',
align: "center",
},
{
title: '更新人',
dataIndex: 'updateTime',
align: "center",
},
],
fileList: [],
disableSubmit: false,
selectedRowKeys: [],
@ -155,7 +102,6 @@
addStatus: false,
editStatus: false,
confirmLoading: false,
form: this.$form.createForm(this),
url: {
add: "/test/order/addCustomer",
edit: "/test/order/editCustomer",
@ -163,8 +109,9 @@
getOrderCustomerList: "/test/order/listOrderCustomerByMainId",
},
validatorRules: {
telphone: {rules: [{validator: this.validateMobile}]},
idcard: {rules: [{validator: this.validateIdCard}]}
name :[{required: true, message: '请输入客户姓名!'}],
telphone: [{validator: this.validateMobile}],
idcard: [{validator: this.validateIdCard}]
},
}
},
@ -181,7 +128,6 @@
add(orderId) {
this.hiding = true;
if (orderId) {
this.orderId = orderId;
this.edit({orderId}, '');
} else {
this.$message.warning("请选择一个客户信息");
@ -201,17 +147,12 @@
this.hiding = true;
this.disableSubmit = false;
}
this.form.resetFields();
this.orderId = record.orderId;
this.model = Object.assign({}, record);
if (record.id) {
this.hiding = false;
this.addStatus = false;
this.editStatus = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'id', 'name', 'sex', 'idcard','telphone', 'orderId', 'createBy', 'createTime', 'updateBy', 'updateTime'))
});
setTimeout(() => {
this.fileList = record.idcardPic
}, 5)
@ -226,12 +167,13 @@
this.visible = false;
this.picUrl = "";
this.fileList=[];
this.$refs.form.resetFields();
},
handleOk() {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
@ -242,9 +184,7 @@
httpurl += this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
console.log(formData);
formData.orderId = this.orderId;
let formData = Object.assign({}, this.model);
if(this.fileList != '') {
formData.idcardPic = this.fileList;
}else{
@ -261,6 +201,8 @@
that.confirmLoading = false;
that.close();
})
}else{
return false;
}
})
},

View File

@ -8,46 +8,45 @@
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-model ref="form" :model="orderMainModel" :rules="validatorRules">
<!-- 主表单区域 -->
<a-form-item
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="orderCode"
label="订单号"
required
hasFeedback>
<a-input
placeholder="请输入订单号"
v-decorator="['orderCode', {rules: [{ required: true, message: '请输入订单号!' }]}]"
/>
</a-form-item>
<a-form-item
<a-input placeholder="请输入订单号" v-model="orderMainModel.orderCode" />
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单类型">
<a-select placeholder="请输入订单类型" v-decorator="['ctype',{}]">
<a-select placeholder="请输入订单类型" v-model="orderMainModel.ctype">
<a-select-option value="1">国内订单</a-select-option>
<a-select-option value="2">国际订单</a-select-option>
</a-select>
</a-form-item>
<a-form-item
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单日期">
<a-date-picker showTime format='YYYY-MM-DD HH:mm:ss' v-decorator="[ 'orderDate',{}]"/>
</a-form-item>
<a-form-item
<a-date-picker showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="orderMainModel.orderDate"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单金额">
<a-input-number style="width: 200px" v-decorator="[ 'orderMoney', {}]"/>
</a-form-item>
<a-form-item
<a-input-number style="width: 200px" v-model="orderMainModel.orderMoney" />
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单备注">
<a-input placeholder="请输入订单备注" v-decorator="['content', {}]"/>
</a-form-item>
</a-form>
<a-input placeholder="请输入订单备注" v-model="orderMainModel.content"/>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
@ -80,8 +79,11 @@
sm: {span: 16},
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules: {},
validatorRules: {
orderCode: [
{ required: true, message: '请输入订单号!' }
]
},
url: {
add: "/test/order/add",
edit: "/test/order/edit",
@ -95,26 +97,21 @@
this.edit({});
},
edit(record) {
this.form.resetFields();
this.orderMainModel = Object.assign({}, record);
//初始化明细表数据
console.log(this.orderMainModel.id)
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.orderMainModel, 'orderCode', 'ctype', 'orderMoney', 'content'))
this.form.setFieldsValue({orderDate: this.orderMainModel.orderDate ? moment(this.orderMainModel.orderDate) : null}) //时间格式化
});
console.log(this.orderMainModel)
//初始化明细表数据
this.visible = true;
},
close() {
this.$emit('close');
this.visible = false;
this.$refs.form.resetFields();
},
handleOk() {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
@ -125,15 +122,8 @@
httpurl += this.url.edit;
method = 'put';
}
let orderMainData = Object.assign(this.orderMainModel, values);
//时间格式化
orderMainData.orderDate = orderMainData.orderDate ? orderMainData.orderDate.format('YYYY-MM-DD HH:mm:ss') : null;
let formData = {
...orderMainData
}
console.log(formData)
httpAction(httpurl, formData, method).then((res) => {
httpAction(httpurl, this.orderMainModel, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
@ -144,6 +134,8 @@
that.confirmLoading = false;
that.close();
})
}else{
return false;
}
})
},

View File

@ -10,58 +10,56 @@
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-item
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="航班号"
prop="ticketCode"
hasFeedback>
<a-input
placeholder="请输入航班号"
:readOnly="disableSubmit"
v-decorator="['ticketCode', {rules:[{ required: true,message: '请输入航班号!'}]}]"/>
</a-form-item>
<a-form-item
<a-input placeholder="请输入航班号" :readOnly="disableSubmit" v-model="model.ticketCode"></a-input>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="航班时间"
prop="tickectDate"
hasFeedback>
<j-date :trigger-change="true" v-decorator="['tickectDate',{rules:[{ required: true,message: '请输入航班号!'}]}]"></j-date>
</a-form-item>
<a-form-item
<j-date v-model="model.tickectDate"></j-date>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="订单号码"
v-model="this.orderId"
:hidden="hiding"
hasFeedback>
<a-input v-decorator="[ 'orderId', {}]" disabled="disabled"/>
</a-form-item>
<a-form-item
<a-input v-model="model.orderId" disabled="disabled"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="创建人"
:hidden="hiding"
hasFeedback>
<a-input v-decorator="[ 'createBy', {}]" :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item
<a-input v-model="model.createBy" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="创建时间"
:hidden="hiding"
hasFeedback>
<a-input v-decorator="[ 'createTime', {}]" :readOnly="disableSubmit"/>
</a-form-item>
</a-form>
<a-input v-model="model.createTime" :readOnly="disableSubmit"/>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</template>
<script>
import {httpAction} from '@/api/manage'
import pick from 'lodash.pick'
import moment from 'moment'
import JDate from '@/components/jeecg/JDate'
@ -89,8 +87,10 @@
orderId: '',
hiding: false,
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules: {},
validatorRules: {
ticketCode:[{required : true, message: '请输入航班号!'}],
tickectDate:[{required : true, message: '请输入航班时间!'}]
},
url: {
add: '/test/order/addTicket',
edit: '/test/order/editTicket'
@ -121,23 +121,19 @@
this.hiding = true;
this.disableSubmit = false;
}
this.form.resetFields();
this.orderId = record.orderId;
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'ticketCode', 'tickectDate', 'orderId', 'createBy', 'createTime', 'updateBy', 'updateTime'))
})
},
close() {
this.$emit('close');
this.visible = false;
this.$refs.form.resetFields();
},
handleOk() {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
@ -148,9 +144,8 @@
httpurl += this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
formData.mainId = this.orderId;
httpAction(httpurl, formData, method).then((res) => {
this.model.mainId = this.model.orderId;
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok')
@ -161,6 +156,8 @@
that.confirmLoading = false;
that.close();
})
}else{
return false;
}
})
},

View File

@ -74,14 +74,11 @@
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="基本信息" key="1" >
<a-card :bordered="false" v-if="selectedKeys.length>0">
<a-form :form="form">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构名称">
<a-input placeholder="请输入机构/部门名称" v-decorator="['departName', validatorRules.departName ]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departName" label="机构名称">
<a-input placeholder="请输入机构/部门名称" v-model="model.departName" />
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
<a-tree-select
style="width:100%"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
@ -90,26 +87,20 @@
v-model="model.parentId"
placeholder="">
</a-tree-select>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构编码">
<a-input disabled placeholder="请输入机构编码" v-decorator="['orgCode', validatorRules.orgCode ]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构类型">
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCode" label="机构编码">
<a-input disabled placeholder="请输入机构编码" v-model="model.orgCode" />
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCategory" label="机构类型">
<template v-if="orgCategoryDisabled">
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">
<a-radio value="1">
公司
</a-radio>
</a-radio-group>
</template>
<template v-else>
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">
<a-radio value="2">
部门
</a-radio>
@ -118,32 +109,20 @@
</a-radio>
</a-radio-group>
</template>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="排序">
<a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="手机号">
<a-input placeholder="请输入手机号" v-decorator="['mobile', {'initialValue':''}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="地址">
<a-input placeholder="请输入地址" v-decorator="['address', {'initialValue':''}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="备注">
<a-textarea placeholder="请输入备注" v-decorator="['memo', {'initialValue':''}]"/>
</a-form-item>
</a-form>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input-number v-model="model.departOrder" />
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号">
<a-input placeholder="请输入手机号" v-model="model.mobile" />
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="地址">
<a-input placeholder="请输入地址" v-model="model.address"/>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
<a-textarea placeholder="请输入备注" v-model="model.memo"/>
</a-form-model-item>
</a-form-model>
<div class="anty-form-btn">
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
@ -166,7 +145,6 @@
</template>
<script>
import DepartModal from './modules/DepartModal'
import pick from 'lodash.pick'
import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api'
import {httpAction, deleteAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
@ -240,11 +218,8 @@
selectedKeys: [],
autoIncr: 1,
currSelected: {},
allTreeKeys:[],
checkStrictly: true,
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 5}
@ -258,10 +233,10 @@
edges: []
},
validatorRules: {
departName: {rules: [{required: true, message: '请输入机构/部门名称!'}]},
orgCode: {rules: [{required: true, message: '请输入机构编码!'}]},
orgCategory: {rules: [{required: true, message: '请输入机构类型!'}]},
mobile: {rules: [{validator: this.validateMobile}]}
departName: [{required: true, message: '请输入机构/部门名称!'}],
orgCode: [{required: true, message: '请输入机构编码!'}],
orgCategory:[{required: true, message: '请输入机构类型!'}],
mobile:[{validator: this.validateMobile}]
},
url: {
delete: '/sys/sysDepart/delete',
@ -323,8 +298,6 @@
},
onExpand(expandedKeys) {
console.log('onExpand', expandedKeys)
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.iExpandedKeys = expandedKeys
this.autoExpandParent = false
},
@ -337,7 +310,7 @@
this.dropTrigger = ''
}
},
// 右键店家下拉关闭下拉框
// 右键下拉关闭下拉框
closeDrop() {
this.dropTrigger = ''
},
@ -402,14 +375,13 @@
onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info)
this.hiding = false
//this.checkedKeys = checkedKeys.checked
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
//---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
if(this.checkStrictly){
this.checkedKeys = checkedKeys.checked;
}else{
this.checkedKeys = checkedKeys
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
//---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
},
onSelect(selectedKeys, e) {
console.log('selected', selectedKeys, e)
@ -431,10 +403,6 @@
}else{
this.orgCategoryDisabled = false;
}
this.$nextTick(() => {
this.form.getFieldDecorator('fax', {initialValue: ''})
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
})
},
getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title
@ -443,7 +411,6 @@
this.hiding = true
this.checkedKeys = []
this.currSelected = {}
this.form.resetFields()
this.selectedKeys = []
this.$refs.departAuth.departId = ''
},
@ -457,16 +424,14 @@
this.currSelected.receiptTriggerType = value
},
submitCurrForm() {
this.form.validateFields((err, values) => {
if (!err) {
this.$refs.form.validate(valid => {
if (valid) {
if (!this.currSelected.id) {
this.$message.warning('请点击选择要修改部门!')
return
}
let formData = Object.assign(this.currSelected, values)
console.log('Received values of form: ', formData)
httpAction(this.url.edit, formData, 'put').then((res) => {
httpAction(this.url.edit, this.currSelected, 'put').then((res) => {
if (res.success) {
this.$message.success('保存成功!')
this.loadTree()
@ -478,12 +443,13 @@
})
},
emptyCurrForm() {
this.form.resetFields()
this.$refs.form.resetFields();
this.model={}
},
nodeSettingFormSubmit() {
this.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values)
this.$refs.form.validate(valid => {
if (valid) {
console.log('Received values of form: ', this.model)
}
})
},
@ -520,7 +486,7 @@
that.$message.success('删除成功!')
that.loadTree()
//删除后同步清空右侧基本信息内容
let orgCode=that.form.getFieldValue("orgCode");
let orgCode=that.model.orgCode;
if(orgCode && orgCode === that.rightClickSelectedOrgCode){
that.onClearSelected()
}
@ -552,7 +518,7 @@
}
}
},
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
//---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
expandAll () {
this.iExpandedKeys = this.allTreeKeys
},
@ -583,7 +549,7 @@
}
}
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
//---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------
},
created() {

View File

@ -0,0 +1,680 @@
<template xmlns:background-color="http://www.w3.org/1999/xhtml">
<a-row :gutter="10">
<a-col :md="12" :sm="24">
<a-card :bordered="false">
<!-- 按钮操作区域 -->
<a-row style="margin: 0 0 0 14px" class="table-operator">
<a-button @click="handleAdd(1)" type="primary">添加部门</a-button>
<a-button @click="handleAdd(2)" type="primary">添加下级</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<j-third-app-button biz-type="depart" :selected-row-keys="selectedRowKeys" syncToApp @sync-finally="onSyncFinally"/>
<a-button title="删除多条数据" @click="batchDel" type="default">批量删除</a-button>
</a-row>
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a-alert type="info" :showIcon="true">
<div slot="message">
当前选择:<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
<a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a>
</div>
</a-alert>
<a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/>
<!-- 树-->
<a-col :md="10" :sm="24">
<template>
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">
<span style="user-select: none">
<a-tree
v-if="loading"
checkable
multiple
@select="onSelect"
@check="onCheck"
@rightClick="rightHandle"
:selectedKeys="selectedKeys"
:checkedKeys="checkedKeys"
:treeData="departTree"
:checkStrictly="checkStrictly"
:expandedKeys.sync="iExpandedKeys"
:load-data="loadSubTree"
@expand="onExpand"/>
</span>
<a-menu slot="overlay">
<a-menu-item @click="handleAdd(3)" key="1">添加</a-menu-item>
<a-menu-item @click="handleDelete" key="2">删除</a-menu-item>
<a-menu-item @click="closeDrop" key="3">取消</a-menu-item>
</a-menu>
</a-dropdown>
</template>
</a-col>
</div>
</a-card>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<div class="drawer-bootom-button">
<a-dropdown :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
</div>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col>
<a-col :md="12" :sm="24">
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="基本信息" key="1" >
<a-card :bordered="false" v-if="selectedKeys.length>0">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="机构名称" prop="departName" >
<a-input placeholder="请输入机构/部门名称" v-model="model.departName"/>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门" prop="parentId">
<a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :treeData="treeData" :disabled="disable" v-model="model.parentId" placeholder="">
</a-tree-select>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="机构编码" prop="orgCode">
<a-input disabled placeholder="请输入机构编码" v-model="model.orgCode"/>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="机构类型" prop="orgCategory">
<template v-if="orgCategoryDisabled">
<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">
<a-radio value="1">
公司
</a-radio>
</a-radio-group>
</template>
<template v-else>
<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">
<a-radio value="2">
部门
</a-radio>
<a-radio value="3">
岗位
</a-radio>
</a-radio-group>
</template>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序" prop="departOrder">
<a-input-number v-model="model.departOrder"/>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号" prop="mobile">
<a-input placeholder="请输入手机号" v-model="model.mobile"/>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="地址" prop="address">
<a-input placeholder="请输入地址" v-model="model.address"/>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注" prop="memo">
<a-textarea placeholder="请输入备注" v-model="model.memo"/>
</a-form-model-item>
</a-form-model>
<div class="anty-form-btn">
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
</div>
</a-card>
<a-card v-else >
<a-empty>
<span slot="description"> 请先选择一个部门! </span>
</a-empty>
</a-card>
</a-tab-pane>
<a-tab-pane tab="部门权限" key="2" forceRender>
<depart-auth-modal ref="departAuth"/>
</a-tab-pane>
</a-tabs>
</a-col>
<depart-modal ref="departModal" @ok="loadTree"></depart-modal>
</a-row>
</template>
<script>
import DepartModal from './modules/DepartModal'
import { deleteByDepartId, queryDepartTreeSync, searchByKeywords } from '@/api/api'
import { deleteAction, httpAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DepartAuthModal from './modules/DepartAuthModal'
import { cloneObject } from '@/utils/util'
import JThirdAppButton from '@comp/jeecgbiz/thirdApp/JThirdAppButton'
// 表头
const columns = [
{
title: '机构名称',
dataIndex: 'departName'
},
{
title: '机构类型',
align: 'center',
dataIndex: 'orgType'
},
{
title: '机构编码',
dataIndex: 'orgCode',
},
{
title: '手机号',
dataIndex: 'mobile'
},
{
title: '传真',
dataIndex: 'fax'
},
{
title: '地址',
dataIndex: 'address'
},
{
title: '排序',
align: 'center',
dataIndex: 'departOrder'
},
{
title: '操作',
align: 'center',
dataIndex: 'action',
scopedSlots: {customRender: 'action'}
}
]
export default {
name: 'DepartList',
mixins: [JeecgListMixin],
components: {
JThirdAppButton,
DepartAuthModal,
DepartModal
},
data() {
return {
iExpandedKeys: [],
loading: true,
autoExpandParent: false,
currFlowId: '',
currFlowName: '',
disable: true,
treeData: [],
visible: false,
departTree: [],
departTreeAll: [],
loadedKeys: [],
allIds: [],
rightClickSelectedKey: '',
rightClickSelectedOrgCode: '',
hiding: true,
model: {},
dropTrigger: '',
depart: {},
columns: columns,
disableSubmit: false,
checkedKeys: [],
selectedKeys: [],
autoIncr: 1,
currSelected: {},
allTreeKeys:[],
loadTreeKeys:[],
checkStrictly: true,
labelCol: {
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16}
},
graphDatasource: {
nodes: [],
edges: []
},
validatorRules: {
departName: [{required: true, message: '请输入机构/部门名称!'}],
orgCode: [{required: true, message: '请输入机构编码!'}],
orgCategory: [{required: true, message: '请输入机构类型!'}],
mobile: [{validator: this.validateMobile}]
},
url: {
delete: '/sys/sysDepart/delete',
edit: '/sys/sysDepart/edit',
deleteBatch: '/sys/sysDepart/deleteBatch',
exportXlsUrl: "sys/sysDepart/exportXls",
importExcelUrl: "sys/sysDepart/importExcel",
},
orgCategoryDisabled:false,
}
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}
},
methods: {
loadData() {
this.refresh();
},
loadTree() {
var that = this
//上级部门树信息
that.treeData = []
//保存的树信息,搜索是需要用到
that.departTreeAll = []
//所有的树信息
that.departTree = []
//所有的树节点key信息
that.allIds = []
that.iExpandedKeys = []
that.loading = false
queryDepartTreeSync().then((res) => {
if (res.success) {
this.allTreeKeys = [];
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
that.treeData.push(temp)
that.departTreeAll.push(temp)
that.departTree.push(temp)
that.allIds.push(temp.key)
that.allTreeKeys.push(temp.key)
if(that.loadTreeKeys.indexOf(temp.key)>=0){
that.iExpandedKeys.push(temp.key)
}
}
that.$nextTick(()=>{
that.loading = true
})
}
})
},
loadSubTree(treeNode) {
var that = this;
return new Promise(resolve => {
queryDepartTreeSync({pid:treeNode.dataRef.id}).then((res) => {
if (res.success) {
//判断chidlren是否为空并修改isLeaf属性值
if(res.result.length == 0){
treeNode.dataRef['isLeaf']=true
return;
}else{
treeNode.dataRef['children']= res.result;
}
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
that.allIds.push(temp.key)
if(that.loadTreeKeys.indexOf(temp.key)>0){
that.iExpandedKeys.push(temp.key)
}
}
}
})
resolve();
});
//保存全部部门信息,方便后面搜索使用
that.departTreeAll=that.departTree
},
refresh() {
this.loading = true
this.loadTree()
},
// 右键操作方法
rightHandle(node) {
this.dropTrigger = 'contextmenu'
console.log(node.node.eventKey)
this.rightClickSelectedKey = node.node.eventKey
this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
},
onExpand(expandedKeys) {
console.log('onExpand', expandedKeys)
this.iExpandedKeys = expandedKeys
this.autoExpandParent = false
this.allTreeKeys=expandedKeys
this.loadTreeKeys=expandedKeys
},
backFlowList() {
this.$router.back(-1)
},
// 右键点击下拉框改变事件
dropStatus(visible) {
if (visible == false) {
this.dropTrigger = ''
}
},
// 右键店家下拉关闭下拉框
closeDrop() {
this.dropTrigger = ''
},
addRootNode() {
this.$refs.nodeModal.add(this.currFlowId, '')
},
batchDel: function () {
console.log(this.checkedKeys)
if (this.checkedKeys.length <= 0) {
this.$message.warning('请选择一条记录!')
} else {
var ids = ''
for (var a = 0; a < this.checkedKeys.length; a++) {
ids += this.checkedKeys[a]+ ','
}
var that = this
this.$confirm({
title: '确认删除',
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据,以及子节点数据吗?',
onOk: function () {
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadTree()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
})
}
})
}
},
onSearch(value) {
let that = this
if (value) {
searchByKeywords({keyWord: value}).then((res) => {
if (res.success) {
that.departTree = []
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
that.departTree.push(temp)
}
} else {
that.$message.warning(res.message)
}
})
} else {
that.departTree=that.departTreeAll
}
},
nodeModalOk() {
this.loadTree()
},
nodeModalClose() {
},
hide() {
this.visible = false
},
onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info)
this.hiding = false
//this.checkedKeys = checkedKeys.checked
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
if(this.checkStrictly){
this.checkedKeys = checkedKeys.checked;
}else{
this.checkedKeys = checkedKeys
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
},
onSelect(selectedKeys, e) {
console.log('selected', selectedKeys, e)
this.hiding = false
let record = e.node.dataRef
console.log('onSelect-record', record)
this.currSelected = Object.assign({}, record)
this.model = this.currSelected
this.selectedKeys = [record.key]
this.model.parentId = record.parentId
this.setValuesToForm(record)
this.$refs.departAuth.show(record.id);
},
// 触发onSelect事件时,为部门树右侧的form表单赋值
setValuesToForm(record) {
if(record.orgCategory == '1'){
this.orgCategoryDisabled = true;
}else{
this.orgCategoryDisabled = false;
}
this.$nextTick(() => {
this.model = cloneObject(record)
})
},
getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title
},
onClearSelected() {
this.hiding = true
this.checkedKeys = []
this.currSelected = {}
this.model = cloneObject(this.currSelected)
this.selectedKeys = []
this.$refs.departAuth.departId = ''
},
handleNodeTypeChange(val) {
this.currSelected.nodeType = val
},
notifyTriggerTypeChange(value) {
this.currSelected.notifyTriggerType = value
},
receiptTriggerTypeChange(value) {
this.currSelected.receiptTriggerType = value
},
submitCurrForm() {
this.$refs.form.validate((ok, err) => {
if (ok) {
if (!this.currSelected.id) {
this.$message.warning('请点击选择要修改部门!')
return
}
let formData = Object.assign(this.currSelected, this.model)
console.log('Received values of form: ', formData)
httpAction(this.url.edit, formData, 'put').then((res) => {
if (res.success) {
this.$message.success('保存成功!')
this.loadTree()
} else {
this.$message.error(res.message)
}
})
}
})
},
emptyCurrForm() {
this.model = this.currSelected
},
nodeSettingFormSubmit() {
this.$refs.form.validate((ok, err) => {
if (ok) {
console.log('Received values of form: ', this.model)
}
})
},
openSelect() {
this.$refs.sysDirectiveModal.show()
},
handleAdd(num) {
if (num == 1) {
this.$refs.departModal.add()
this.$refs.departModal.title = '新增'
} else if (num == 2) {
let key = this.currSelected.key
if (!key) {
this.$message.warning('请先点击选中上级部门!')
return false
}
this.$refs.departModal.add(this.selectedKeys[0])
this.$refs.departModal.title = '新增'
} else {
this.$refs.departModal.add(this.rightClickSelectedKey)
this.$refs.departModal.title = '新增'
}
},
handleDelete() {
var that = this
this.$confirm({
title: '确认删除',
content: '确定要删除此部门以及子节点数据吗?',
onOk: function () {
deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => {
if (resp.success) {
//删除成功后,去除已选中中的数据
that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1);
that.$message.success('删除成功!')
that.loadTree()
//删除后同步清空右侧基本信息内容
let orgCode = that.model.orgCode
if(orgCode && orgCode === that.rightClickSelectedOrgCode){
that.onClearSelected()
}
} else {
that.$message.warning('删除失败!')
}
})
}
})
},
selectDirectiveOk(record) {
console.log('选中指令数据', record)
this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode})
this.currSelected.sysCode = record.sysCode
},
getFlowGraphData(node) {
this.graphDatasource.nodes.push({
id: node.id,
text: node.flowNodeName
})
if (node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
let temp = node.children[a]
this.graphDatasource.edges.push({
source: node.id,
target: temp.id
})
this.getFlowGraphData(temp)
}
}
},
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
expandAll () {
this.iExpandedKeys = this.allTreeKeys
//this.loadTree()
},
closeAll () {
this.iExpandedKeys = []
},
checkALL () {
this.checkStriccheckStrictlytly = false
//this.checkedKeys = this.allTreeKeys
this.checkedKeys = this.allIds
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
getAllKeys(node) {
// console.log('node',node);
this.allTreeKeys.push(node.key)
if (node.children && node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
this.getAllKeys(node.children[a])
}
}
},
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
// 验证手机号
validateMobile(rule,value,callback){
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)){
callback();
}else{
callback("您的手机号码格式不正确!");
}
},
onSyncFinally({isToLocal}) {
// 同步到本地时刷新下数据
if (isToLocal) {
this.loadData()
}
},
},
created() {
this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name
// this.loadTree()
},
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
<style scoped>
.ant-card-body .table-operator {
margin: 15px;
}
.anty-form-btn {
width: 100%;
text-align: center;
}
.anty-form-btn button {
margin: 0 5px;
}
.anty-node-layout .ant-layout-header {
padding-right: 0
}
.header {
padding: 0 8px;
}
.header button {
margin: 0 3px
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
#app .desktop {
height: auto !important;
}
/** Button按钮间距 */
.drawer-bootom-button {
/*position: absolute;*/
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: left;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

View File

@ -25,7 +25,7 @@
<div style="margin-top: 24px;" v-else-if="userIdentity === '2' && departTree.length==0">
<h3><span>您的部门下暂无有效部门信息</span></h3>
</div>
<div style="margin-top: 24px;" v-else><h3>普通员工暂此权限</h3></div>
<div style="margin-top: 24px;" v-else><h3>普通员工暂此权限</h3></div>
</div>
</a-card>
</a-col>
@ -49,8 +49,8 @@
<script>
import DeptBaseInfo from './modules/DeptBaseInfo'
import DeptUserInfo from './modules/DeptUserInfo'
import {queryMyDepartTreeList, searchByKeywords} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import { queryMyDepartTreeList, searchByKeywords } from '@/api/api'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DeptRoleInfo from './modules/DeptRoleInfo'
export default {

View File

@ -214,9 +214,8 @@
},
handleAddSub(record) {
this.$refs.modalForm.title = "添加子菜单";
this.$refs.modalForm.localMenuType = 1;
this.$refs.modalForm.disableSubmit = false;
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id,menuType:1});
},
handleExpandedRowsChange(expandedRows) {
this.expandedRowKeys = expandedRows

View File

@ -181,9 +181,8 @@
},
handleAddSub(record) {
this.$refs.modalForm.title = "添加子菜单";
this.$refs.modalForm.localMenuType = 1;
this.$refs.modalForm.disableSubmit = false;
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id,menuType:1});
},
handleExpandedRowsChange(expandedRows) {
this.expandedRowKeys = expandedRows

View File

@ -3,22 +3,22 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-form-model layout="inline" :model="queryParam" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="10">
<a-form-item label="任务类名">
<a-form-model-item label="任务类名" prop="jobClassName">
<a-input placeholder="请输入任务类名" v-model="queryParam.jobClassName"></a-input>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="10">
<a-form-item label="任务状态">
<a-form-model-item label="任务状态" prop="status">
<a-select style="width: 220px" v-model="queryParam.status" placeholder="请选择状态">
<a-select-option value="">全部</a-select-option>
<a-select-option value="0">正常</a-select-option>
<a-select-option value="-1">停止</a-select-option>
</a-select>
</a-form-item>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="10" >
@ -29,7 +29,7 @@
</a-col>
</a-row>
</a-form>
</a-form-model>
</div>
<!-- 操作按钮区域 -->
@ -225,7 +225,7 @@
title:"确认暂停",
content:"是否暂停选中任务?",
onOk: function(){
getAction(that.url.pause,{jobClassName:record.jobClassName}).then((res)=>{
getAction(that.url.pause,{id:record.id}).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
@ -245,7 +245,7 @@
title:"确认启动",
content:"是否启动选中任务?",
onOk: function(){
getAction(that.url.resume,{jobClassName:record.jobClassName}).then((res)=>{
getAction(that.url.resume,{id:record.id}).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();

View File

@ -384,11 +384,8 @@
this.$message.error('请选择一个角色!')
} else {
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.selectedRole = [this.currentRoleId]
this.$refs.modalForm2.add()
this.$refs.modalForm2.title = '新增'
this.$refs.modalForm2.edit({activitiSync:'1',userIdentity:1,selectedroles:this.currentRoleId})
}
},
modalFormOk2() {

View File

@ -102,6 +102,11 @@
<!-- 表单区域 -->
<sysAnnouncement-modal ref="modalForm" @ok="modalFormOk"></sysAnnouncement-modal>
<!-- 查看详情 -->
<j-modal class="detail-modal" title="查看详情" :visible.sync="detailModal.visible" :top="50" :width="600" switchFullscreen :footer="null">
<iframe v-if="detailModal.url" class="detail-iframe" :src="detailModal.url"/>
</j-modal>
</a-card>
</template>
@ -110,6 +115,7 @@
import {doReleaseData, doReovkeData} from '@/api/api'
import {getAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default {
name: "SysAnnouncementList",
@ -237,6 +243,7 @@
scopedSlots: {customRender: 'action'},
}
],
detailModal: {visible: false, url: '',},
url: {
list: "/sys/annountCement/list",
delete: "/sys/annountCement/delete",
@ -284,14 +291,42 @@
getAction("sys/annountCement/syncNotic",{anntId:anntId})
},
handleDetail:function(record){
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title="详情";
this.$refs.modalForm.disableSubmit = true;
this.$refs.modalForm.disabled = true;
const domain = window._CONFIG['domianURL']
const token = this.$ls.get(ACCESS_TOKEN)
this.detailModal.url = `${domain}/sys/annountCement/show/${record.id}?token=${token}`
this.detailModal.visible = true
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
<style scoped lang="less">
@import '~@assets/less/common.less';
/** 查看详情弹窗的样式 */
.detail-modal {
.detail-iframe {
border: 0;
width: 100%;
height: 88vh;
min-height: 600px;
}
&.fullscreen .detail-iframe {
height: 100%;
}
}
.detail-modal /deep/ .ant-modal {
top: 30px;
.ant-modal-body {
font-size: 0;
padding: 0;
}
}
.detail-modal.fullscreen /deep/ .ant-modal {
top: 0;
}
</style>

Some files were not shown because too many files have changed in this diff Show More