Jeecg Boot 2.2.1 版本发布,低代码平台
This commit is contained in:
parent
cb7ae9ca6f
commit
109a95a96b
|
@ -7,7 +7,7 @@
|
||||||
JEECG BOOT 低代码开发平台(前后端分离版本)
|
JEECG BOOT 低代码开发平台(前后端分离版本)
|
||||||
===============
|
===============
|
||||||
|
|
||||||
当前最新版本: 2.2.0(发布日期:2020-05-06)
|
当前最新版本: 2.2.1(发布日期:2020-07-11)
|
||||||
|
|
||||||
|
|
||||||
[](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
|
[](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
docs
|
||||||
|
public
|
||||||
|
src
|
||||||
|
.dockerignore
|
||||||
|
.editorconfig
|
||||||
|
.eslintignore
|
||||||
|
.gitattributes
|
||||||
|
.gitignore
|
||||||
|
.prettierrc
|
||||||
|
babel.config.js
|
||||||
|
Dockerfile
|
||||||
|
idea.config.js
|
||||||
|
LICENSE
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
|
README.md
|
||||||
|
vue.config.js
|
||||||
|
yarn
|
||||||
|
yarn.lock
|
||||||
|
yarn-error.log
|
||||||
|
.idea
|
||||||
|
.svn
|
||||||
|
node_modules
|
|
@ -1 +0,0 @@
|
||||||
/src
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
FROM nginx
|
||||||
|
MAINTAINER jeecgos@163.com
|
||||||
|
VOLUME /tmp
|
||||||
|
ENV LANG en_US.UTF-8
|
||||||
|
RUN echo "server { \
|
||||||
|
listen 80; \
|
||||||
|
location ^~ /jeecg-boot { \
|
||||||
|
proxy_pass http://jeecg-boot-system:8080/jeecg-boot/; \
|
||||||
|
proxy_set_header Host jeecg-boot-system; \
|
||||||
|
proxy_set_header X-Real-IP \$remote_addr; \
|
||||||
|
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
|
||||||
|
} \
|
||||||
|
#解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 \
|
||||||
|
location / { \
|
||||||
|
root /var/www/html/; \
|
||||||
|
index index.html index.htm; \
|
||||||
|
if (!-e \$request_filename) { \
|
||||||
|
rewrite ^(.*)\$ /index.html?s=\$1 last; \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
access_log /var/log/nginx/access.log ; \
|
||||||
|
} " > /etc/nginx/conf.d/default.conf \
|
||||||
|
&& mkdir -p /var/www \
|
||||||
|
&& mkdir -p /var/www/html
|
||||||
|
|
||||||
|
ADD dist/ /var/www/html/
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
|
@ -1,7 +1,7 @@
|
||||||
Ant Design Jeecg Vue
|
Ant Design Jeecg Vue
|
||||||
====
|
====
|
||||||
|
|
||||||
当前最新版本: 2.2.0(发布日期:2020-05-06)
|
当前最新版本: 2.2.1(发布日期:20200711)
|
||||||
|
|
||||||
Overview
|
Overview
|
||||||
----
|
----
|
||||||
|
@ -104,3 +104,32 @@ yarn run lint
|
||||||
----
|
----
|
||||||
|
|
||||||
> @vue/cli 升级后,eslint 规则更新了。由于影响到全部 .vue 文件,需要逐个验证。既暂时关闭部分原本不验证的规则,后期维护时,在逐步修正这些 rules
|
> @vue/cli 升级后,eslint 规则更新了。由于影响到全部 .vue 文件,需要逐个验证。既暂时关闭部分原本不验证的规则,后期维护时,在逐步修正这些 rules
|
||||||
|
|
||||||
|
|
||||||
|
Docker 镜像使用
|
||||||
|
----
|
||||||
|
|
||||||
|
```
|
||||||
|
# 1.修改前端项目的后台域名
|
||||||
|
public/index.html
|
||||||
|
域名改成: http://jeecg-boot-system:8080/jeecg-boot
|
||||||
|
|
||||||
|
# 2.先进入打包前端项目
|
||||||
|
yarn run build
|
||||||
|
|
||||||
|
# 3.构建镜像
|
||||||
|
docker build -t nginx:jeecgboot .
|
||||||
|
|
||||||
|
# 4.启动镜像
|
||||||
|
docker run --name jeecg-boot-nginx -p 80:80 -d nginx:jeecgboot
|
||||||
|
|
||||||
|
# 5.配置host
|
||||||
|
|
||||||
|
# jeecgboot
|
||||||
|
127.0.0.1 jeecg-boot-redis
|
||||||
|
127.0.0.1 jeecg-boot-mysql
|
||||||
|
127.0.0.1 jeecg-boot-system
|
||||||
|
|
||||||
|
# 6.访问前台项目
|
||||||
|
http://localhost:80
|
||||||
|
```
|
File diff suppressed because it is too large
Load Diff
|
@ -1,22 +1,19 @@
|
||||||
{
|
{
|
||||||
"name": "vue-antd-jeecg",
|
"name": "vue-antd-jeecg",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"pre": "yarn --registry https://registry.npm.taobao.org || cnpm install || npm install --registry https://registry.npm.taobao.org ",
|
"pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ",
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/data-set": "^0.11.2",
|
"ant-design-vue": "^1.6.3",
|
||||||
"@jeecg/antd-online-beta220": "^1.0.1",
|
"@antv/data-set": "^0.11.4",
|
||||||
"@tinymce/tinymce-vue": "^2.0.0",
|
"@jeecg/antd-online-mini": "2.2.1",
|
||||||
"ant-design-vue": "1.5.2",
|
"viser-vue": "^2.4.8",
|
||||||
"area-data": "^5.0.6",
|
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
"clipboard": "^2.0.4",
|
|
||||||
"codemirror": "^5.46.0",
|
|
||||||
"dayjs": "^1.8.0",
|
"dayjs": "^1.8.0",
|
||||||
"enquire.js": "^2.1.6",
|
"enquire.js": "^2.1.6",
|
||||||
"js-cookie": "^2.2.0",
|
"js-cookie": "^2.2.0",
|
||||||
|
@ -24,20 +21,25 @@
|
||||||
"lodash.pick": "^4.4.0",
|
"lodash.pick": "^4.4.0",
|
||||||
"md5": "^2.2.1",
|
"md5": "^2.2.1",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"tinymce": "^5.1.4",
|
|
||||||
"viser-vue": "^2.4.4",
|
|
||||||
"vue": "^2.6.10",
|
"vue": "^2.6.10",
|
||||||
"vue-area-linkage": "^5.1.0",
|
"vue-cropper": "^0.5.4",
|
||||||
"vue-cropper": "^0.4.8",
|
|
||||||
"vue-i18n": "^8.7.0",
|
"vue-i18n": "^8.7.0",
|
||||||
"vue-loader": "^15.7.0",
|
"vue-loader": "^15.7.0",
|
||||||
"vue-ls": "^3.2.0",
|
"vue-ls": "^3.2.0",
|
||||||
"vue-photo-preview": "^1.1.3",
|
|
||||||
"vue-print-nb-jeecg": "^1.0.9",
|
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
|
"vuex": "^3.1.0",
|
||||||
|
"vue-print-nb-jeecg": "^1.0.9",
|
||||||
|
"clipboard": "^2.0.4",
|
||||||
|
"vue-photo-preview": "^1.1.3",
|
||||||
"vue-splitpane": "^1.0.4",
|
"vue-splitpane": "^1.0.4",
|
||||||
"vuedraggable": "^2.20.0",
|
"vuedraggable": "^2.20.0",
|
||||||
"vuex": "^3.1.0"
|
"codemirror": "^5.46.0",
|
||||||
|
"@tinymce/tinymce-vue": "^2.1.0",
|
||||||
|
"tinymce": "^5.3.2",
|
||||||
|
"@toast-ui/editor": "^2.1.2",
|
||||||
|
"vue-area-linkage": "^5.1.0",
|
||||||
|
"area-data": "^5.0.6",
|
||||||
|
"jsoneditor": "^9.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/polyfill": "^7.2.5",
|
"@babel/polyfill": "^7.2.5",
|
||||||
|
@ -45,7 +47,7 @@
|
||||||
"@vue/cli-plugin-eslint": "^3.3.0",
|
"@vue/cli-plugin-eslint": "^3.3.0",
|
||||||
"@vue/cli-service": "^3.3.0",
|
"@vue/cli-service": "^3.3.0",
|
||||||
"@vue/eslint-config-standard": "^4.0.0",
|
"@vue/eslint-config-standard": "^4.0.0",
|
||||||
"babel-eslint": "^10.0.1",
|
"babel-eslint": "7.2.3",
|
||||||
"compression-webpack-plugin": "^3.1.0",
|
"compression-webpack-plugin": "^3.1.0",
|
||||||
"eslint": "^5.16.0",
|
"eslint": "^5.16.0",
|
||||||
"eslint-plugin-vue": "^5.1.0",
|
"eslint-plugin-vue": "^5.1.0",
|
||||||
|
@ -89,9 +91,10 @@
|
||||||
"vue/no-use-v-if-with-v-for": 0,
|
"vue/no-use-v-if-with-v-for": 0,
|
||||||
"vue/html-closing-bracket-newline": 0,
|
"vue/html-closing-bracket-newline": 0,
|
||||||
"vue/no-parsing-error": 0,
|
"vue/no-parsing-error": 0,
|
||||||
"no-console": 0,
|
|
||||||
"no-tabs": 0,
|
"no-tabs": 0,
|
||||||
"indent": [1, 4]
|
"indent": ["off", 2],
|
||||||
|
"no-console": 0,
|
||||||
|
"space-before-function-paren": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"postcss": {
|
"postcss": {
|
||||||
|
|
|
@ -7680,6 +7680,13 @@ font.weak {
|
||||||
color: #f5222d;
|
color: #f5222d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 侧边导航栏首页颜色跟随主题变化
|
||||||
|
.ant-menu.ant-menu-root > .ant-menu-item:first-child.ant-menu-item-selected {
|
||||||
|
& > a,
|
||||||
|
& > a:hover {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// begin -------- JAreaLinkage 三级联动样式 --------------
|
// begin -------- JAreaLinkage 三级联动样式 --------------
|
||||||
.cascader-menu-list .cascader-menu-option.hover,
|
.cascader-menu-list .cascader-menu-option.hover,
|
||||||
|
@ -7699,3 +7706,13 @@ font.weak {
|
||||||
box-shadow: 0 0 0 2px color(~`colorPalette("@{primary-color}", 1)`);
|
box-shadow: 0 0 0 2px color(~`colorPalette("@{primary-color}", 1)`);
|
||||||
}
|
}
|
||||||
// end -------- JAreaLinkage 三级联动样式 --------------
|
// end -------- JAreaLinkage 三级联动样式 --------------
|
||||||
|
|
||||||
|
// TESTA-521
|
||||||
|
.ant-menu-submenu-selected {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TESTA-521
|
||||||
|
.tab-layout-tabs.ant-tabs.ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
|
||||||
|
border-color: @primary-color !important;
|
||||||
|
}
|
|
@ -246,6 +246,7 @@
|
||||||
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
|
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
|
||||||
window._CONFIG['onlinePreviewDomainURL'] = 'http://fileview.jeecg.com/onlinePreview'
|
window._CONFIG['onlinePreviewDomainURL'] = 'http://fileview.jeecg.com/onlinePreview'
|
||||||
window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/static';
|
window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/static';
|
||||||
|
//window._CONFIG['downloadUrl'] = window._CONFIG['domianURL'] + '/sys/common/download';
|
||||||
window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe';
|
window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe';
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -2,10 +2,17 @@ import { getAction, deleteAction, putAction, postAction, httpAction } from '@/ap
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||||
|
|
||||||
|
////根路径
|
||||||
|
// const doMian = "/jeecg-boot/";
|
||||||
|
////图片预览请求地址
|
||||||
|
// const imgView = "http://localhost:8080/jeecg-boot/sys/common/view/";
|
||||||
|
|
||||||
//角色管理
|
//角色管理
|
||||||
const addRole = (params)=>postAction("/sys/role/add",params);
|
const addRole = (params)=>postAction("/sys/role/add",params);
|
||||||
const editRole = (params)=>putAction("/sys/role/edit",params);
|
const editRole = (params)=>putAction("/sys/role/edit",params);
|
||||||
|
// const getRoleList = (params)=>getAction("/sys/role/list",params);
|
||||||
|
// const deleteRole = (params)=>deleteAction("/sys/role/delete",params);
|
||||||
|
// const deleteRoleList = (params)=>deleteAction("/sys/role/deleteBatch",params);
|
||||||
const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params);
|
const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params);
|
||||||
const queryall = (params)=>getAction("/sys/role/queryall",params);
|
const queryall = (params)=>getAction("/sys/role/queryall",params);
|
||||||
|
|
||||||
|
@ -14,6 +21,8 @@ const addUser = (params)=>postAction("/sys/user/add",params);
|
||||||
const editUser = (params)=>putAction("/sys/user/edit",params);
|
const editUser = (params)=>putAction("/sys/user/edit",params);
|
||||||
const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params);
|
const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params);
|
||||||
const getUserList = (params)=>getAction("/sys/user/list",params);
|
const getUserList = (params)=>getAction("/sys/user/list",params);
|
||||||
|
// const deleteUser = (params)=>deleteAction("/sys/user/delete",params);
|
||||||
|
// const deleteUserList = (params)=>deleteAction("/sys/user/deleteBatch",params);
|
||||||
const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
|
const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
|
||||||
//验证用户是否存在
|
//验证用户是否存在
|
||||||
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
|
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
|
||||||
|
@ -24,15 +33,20 @@ const changePassword = (params)=>putAction("/sys/user/changePassword",params);
|
||||||
const addPermission= (params)=>postAction("/sys/permission/add",params);
|
const addPermission= (params)=>postAction("/sys/permission/add",params);
|
||||||
const editPermission= (params)=>putAction("/sys/permission/edit",params);
|
const editPermission= (params)=>putAction("/sys/permission/edit",params);
|
||||||
const getPermissionList = (params)=>getAction("/sys/permission/list",params);
|
const getPermissionList = (params)=>getAction("/sys/permission/list",params);
|
||||||
|
/*update_begin author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */
|
||||||
const getSystemMenuList = (params)=>getAction("/sys/permission/getSystemMenuList",params);
|
const getSystemMenuList = (params)=>getAction("/sys/permission/getSystemMenuList",params);
|
||||||
const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",params);
|
const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",params);
|
||||||
const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params)
|
const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params)
|
||||||
|
/*update_end author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */
|
||||||
|
|
||||||
|
// const deletePermission = (params)=>deleteAction("/sys/permission/delete",params);
|
||||||
|
// const deletePermissionList = (params)=>deleteAction("/sys/permission/deleteBatch",params);
|
||||||
const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params);
|
const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params);
|
||||||
const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params);
|
const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params);
|
||||||
const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params);
|
const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params);
|
||||||
const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params);
|
const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params);
|
||||||
const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params);
|
const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params);
|
||||||
|
//const queryPermissionsByUser = (params)=>getAction("/sys/permission/queryByUser",params);
|
||||||
const queryPermissionsByUser = (params)=>getAction("/sys/permission/getUserPermissionByToken",params);
|
const queryPermissionsByUser = (params)=>getAction("/sys/permission/getUserPermissionByToken",params);
|
||||||
const loadAllRoleIds = (params)=>getAction("/sys/permission/loadAllRoleIds",params);
|
const loadAllRoleIds = (params)=>getAction("/sys/permission/loadAllRoleIds",params);
|
||||||
const getPermissionRuleList = (params)=>getAction("/sys/permission/getPermRuleListByPermId",params);
|
const getPermissionRuleList = (params)=>getAction("/sys/permission/getPermRuleListByPermId",params);
|
||||||
|
@ -54,15 +68,21 @@ const saveDeptRolePermission = (params)=>postAction("/sys/sysDepartPermission/sa
|
||||||
const queryMyDepartTreeList = (params)=>getAction("/sys/sysDepart/queryMyDeptTreeList",params);
|
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 deleteLog = (params)=>deleteAction("/sys/log/delete",params);
|
||||||
const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);
|
const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);
|
||||||
|
|
||||||
//数据字典
|
//数据字典
|
||||||
const addDict = (params)=>postAction("/sys/dict/add",params);
|
const addDict = (params)=>postAction("/sys/dict/add",params);
|
||||||
const editDict = (params)=>putAction("/sys/dict/edit",params);
|
const editDict = (params)=>putAction("/sys/dict/edit",params);
|
||||||
|
//const getDictList = (params)=>getAction("/sys/dict/list",params);
|
||||||
const treeList = (params)=>getAction("/sys/dict/treeList",params);
|
const treeList = (params)=>getAction("/sys/dict/treeList",params);
|
||||||
|
// const delDict = (params)=>deleteAction("/sys/dict/delete",params);
|
||||||
|
//const getDictItemList = (params)=>getAction("/sys/dictItem/list",params);
|
||||||
const addDictItem = (params)=>postAction("/sys/dictItem/add",params);
|
const addDictItem = (params)=>postAction("/sys/dictItem/add",params);
|
||||||
const editDictItem = (params)=>putAction("/sys/dictItem/edit",params);
|
const editDictItem = (params)=>putAction("/sys/dictItem/edit",params);
|
||||||
|
//const delDictItem = (params)=>deleteAction("/sys/dictItem/delete",params);
|
||||||
|
//const delDictItemList = (params)=>deleteAction("/sys/dictItem/deleteBatch",params);
|
||||||
|
|
||||||
//字典标签专用(通过code获取字典数组)
|
//字典标签专用(通过code获取字典数组)
|
||||||
export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);
|
export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);
|
||||||
|
@ -81,18 +101,33 @@ const doReovkeData = (params)=>getAction("/sys/annountCement/doReovkeData",param
|
||||||
//获取系统访问量
|
//获取系统访问量
|
||||||
const getLoginfo = (params)=>getAction("/sys/loginfo",params);
|
const getLoginfo = (params)=>getAction("/sys/loginfo",params);
|
||||||
const getVisitInfo = (params)=>getAction("/sys/visitInfo",params);
|
const getVisitInfo = (params)=>getAction("/sys/visitInfo",params);
|
||||||
|
//数据日志访问
|
||||||
|
// const getDataLogList = (params)=>getAction("/sys/dataLog/list",params);
|
||||||
|
|
||||||
// 根据部门主键查询用户信息
|
// 根据部门主键查询用户信息
|
||||||
const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params);
|
const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params);
|
||||||
|
|
||||||
|
// 查询用户角色表里的所有信息
|
||||||
|
// const queryUserRoleMap = (params)=>getAction("/sys/user/queryUserRoleMap",params);
|
||||||
// 重复校验
|
// 重复校验
|
||||||
const duplicateCheck = (params)=>getAction("/sys/duplicate/check",params);
|
const duplicateCheck = (params)=>getAction("/sys/duplicate/check",params);
|
||||||
// 加载分类字典
|
// 加载分类字典
|
||||||
const loadCategoryData = (params)=>getAction("/sys/category/loadAllData",params);
|
const loadCategoryData = (params)=>getAction("/sys/category/loadAllData",params);
|
||||||
const checkRuleByCode = (params) => getAction('/sys/checkRule/checkByCode', params)
|
const checkRuleByCode = (params) => getAction('/sys/checkRule/checkByCode', params)
|
||||||
//我的通告
|
//加载我的通告信息
|
||||||
const getUserNoticeInfo= (params)=>getAction("/sys/sysAnnouncementSend/getMyAnnouncementSend",params);
|
const getUserNoticeInfo= (params)=>getAction("/sys/sysAnnouncementSend/getMyAnnouncementSend",params);
|
||||||
|
const getTransitURL = url => `/sys/common/transitRESTful?url=${encodeURIComponent(url)}`
|
||||||
|
// 中转HTTP请求
|
||||||
|
export const transitRESTful = {
|
||||||
|
get: (url, parameter) => getAction(getTransitURL(url), parameter),
|
||||||
|
post: (url, parameter) => postAction(getTransitURL(url), parameter),
|
||||||
|
put: (url, parameter) => putAction(getTransitURL(url), parameter),
|
||||||
|
http: (url, parameter) => httpAction(getTransitURL(url), parameter),
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
// imgView,
|
||||||
|
// doMian,
|
||||||
addRole,
|
addRole,
|
||||||
editRole,
|
editRole,
|
||||||
checkRoleCode,
|
checkRoleCode,
|
||||||
|
|
|
@ -56,3 +56,6 @@
|
||||||
.j-inner-table-wrapper /deep/ .ant-table-expanded-row .ant-table-wrapper .ant-table-tbody .ant-table-row {
|
.j-inner-table-wrapper /deep/ .ant-table-expanded-row .ant-table-wrapper .ant-table-tbody .ant-table-row {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden{display: none}
|
|
@ -7,7 +7,7 @@
|
||||||
<a-radio-button v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio-button>
|
<a-radio-button v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio-button>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
|
|
||||||
<a-select v-else-if="tagType=='select'" :getPopupContainer = "(target) => target.parentNode" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
|
<a-select v-else-if="tagType=='select'" :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
|
||||||
<a-select-option :value="undefined">请选择</a-select-option>
|
<a-select-option :value="undefined">请选择</a-select-option>
|
||||||
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
|
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
|
||||||
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
|
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
|
||||||
|
@ -28,7 +28,11 @@
|
||||||
triggerChange: Boolean,
|
triggerChange: Boolean,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
value: [String, Number],
|
value: [String, Number],
|
||||||
type: String
|
type: String,
|
||||||
|
getPopupContainer:{
|
||||||
|
type: Function,
|
||||||
|
default: (node) => node.parentNode
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -56,7 +60,10 @@
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
getValueSting(){
|
getValueSting(){
|
||||||
return this.value != null ? this.value.toString() : null;
|
// update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
|
||||||
|
// 当有null或“” placeholder不显示
|
||||||
|
return this.value != null ? this.value.toString() : undefined;
|
||||||
|
// update-end author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -36,15 +36,20 @@ export async function initDictOptions(dictCode) {
|
||||||
*/
|
*/
|
||||||
export function filterDictText(dictOptions, text) {
|
export function filterDictText(dictOptions, text) {
|
||||||
// --update-begin----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---
|
// --update-begin----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---
|
||||||
if (text != null && dictOptions instanceof Array) {
|
if (text != null && Array.isArray(dictOptions)) {
|
||||||
let result = []
|
let result = []
|
||||||
// 允许多个逗号分隔
|
// 允许多个逗号分隔,允许传数组对象
|
||||||
let splitText = text.toString().trim().split(',')
|
let splitText
|
||||||
|
if (Array.isArray(text)) {
|
||||||
|
splitText = text
|
||||||
|
} else {
|
||||||
|
splitText = text.toString().trim().split(',')
|
||||||
|
}
|
||||||
for (let txt of splitText) {
|
for (let txt of splitText) {
|
||||||
let dictText = txt
|
let dictText = txt
|
||||||
for (let dictItem of dictOptions) {
|
for (let dictItem of dictOptions) {
|
||||||
if (txt === dictItem.value.toString()) {
|
if (txt.toString() === dictItem.value.toString()) {
|
||||||
dictText = dictItem.text
|
dictText = (dictItem.text || dictItem.title || dictItem.label)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="!reloading" class="j-area-linkage">
|
<div class="j-area-linkage">
|
||||||
|
<div v-if="reloading">
|
||||||
|
<span> Reloading... </span>
|
||||||
|
</div>
|
||||||
<area-cascader
|
<area-cascader
|
||||||
v-if="_type === enums.type[0]"
|
v-else-if="_type === enums.type[0]"
|
||||||
:value="innerValue"
|
:value="innerValue"
|
||||||
:data="pcaa"
|
:data="pcaa"
|
||||||
:level="1"
|
:level="1"
|
||||||
|
@ -90,19 +93,23 @@
|
||||||
this.initAreaData();
|
this.initAreaData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
/** 重新加载组件 */
|
||||||
|
reload() {
|
||||||
|
this.reloading = true
|
||||||
|
this.$nextTick(() => this.reloading = false)
|
||||||
|
},
|
||||||
|
|
||||||
/** 通过 value 反推 options */
|
/** 通过 value 反推 options */
|
||||||
loadDataByValue(value) {
|
loadDataByValue(value) {
|
||||||
if(!value || value.length==0){
|
if (!value || value.length === 0) {
|
||||||
this.innerValue = []
|
this.innerValue = []
|
||||||
this.reloading = true;
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.reloading = false
|
|
||||||
},100)
|
|
||||||
} else {
|
} else {
|
||||||
this.initAreaData();
|
this.initAreaData()
|
||||||
let arr = this.areaData.getRealCode(value);
|
let arr = this.areaData.getRealCode(value)
|
||||||
this.innerValue = arr
|
this.innerValue = arr
|
||||||
}
|
}
|
||||||
|
this.reload()
|
||||||
},
|
},
|
||||||
/** 通过地区code获取子级 */
|
/** 通过地区code获取子级 */
|
||||||
loadDataByCode(value) {
|
loadDataByCode(value) {
|
||||||
|
|
|
@ -196,9 +196,14 @@
|
||||||
if(!value){
|
if(!value){
|
||||||
this.$emit('change', '');
|
this.$emit('change', '');
|
||||||
this.treeValue = ''
|
this.treeValue = ''
|
||||||
} else if (value instanceof Array) {
|
} else if (Array.isArray(value)) {
|
||||||
//this.$emit('change', value.map(item => item.value).join(','))
|
let labels = []
|
||||||
//this.treeValue = value
|
let values = value.map(item => {
|
||||||
|
labels.push(item.label)
|
||||||
|
return item.value
|
||||||
|
})
|
||||||
|
this.backValue(values.join(','), labels.join(','))
|
||||||
|
this.treeValue = value
|
||||||
} else {
|
} else {
|
||||||
this.backValue(value.value,value.label)
|
this.backValue(value.value,value.label)
|
||||||
this.treeValue = value
|
this.treeValue = value
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
import 'codemirror/mode/swift/swift.js'
|
import 'codemirror/mode/swift/swift.js'
|
||||||
import 'codemirror/mode/vue/vue.js'
|
import 'codemirror/mode/vue/vue.js'
|
||||||
|
|
||||||
|
import { isIE11, isIE } from '@/utils/browser'
|
||||||
|
|
||||||
// 尝试获取全局实例
|
// 尝试获取全局实例
|
||||||
const CodeMirror = window.CodeMirror || _CodeMirror
|
const CodeMirror = window.CodeMirror || _CodeMirror
|
||||||
|
|
||||||
|
@ -85,7 +87,21 @@
|
||||||
zIndex: {
|
zIndex: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: 999
|
default: 999
|
||||||
}
|
},
|
||||||
|
// 是否自适应高度,可以传String或Boolean
|
||||||
|
// 传 String 类型只能写"!ie" ,
|
||||||
|
// 填写这个字符串,代表其他浏览器自适应高度
|
||||||
|
// 唯独IE下不自适应高度,因为IE下不支持min、max-height样式
|
||||||
|
// 如果填写的不是"!ie"就视为true
|
||||||
|
autoHeight: {
|
||||||
|
type: [String, Boolean],
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
// 不自适应高度的情况下生效的固定高度
|
||||||
|
height: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '240px'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
@ -217,14 +233,30 @@
|
||||||
hintOptions: this.options.hintOptions
|
hintOptions: this.options.hintOptions
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isAutoHeight() {
|
||||||
|
let {autoHeight} = this
|
||||||
|
if (typeof autoHeight === 'string' && autoHeight.toLowerCase().trim() === '!ie') {
|
||||||
|
autoHeight = !(isIE() || isIE11())
|
||||||
|
} else {
|
||||||
|
autoHeight = true
|
||||||
|
}
|
||||||
|
return autoHeight
|
||||||
|
},
|
||||||
fullScreenParentProps() {
|
fullScreenParentProps() {
|
||||||
let props = {
|
let props = {
|
||||||
class: ['full-screen-parent', this.fullCoder ? 'full-screen' : ''],
|
class: {
|
||||||
|
'full-screen-parent': true,
|
||||||
|
'full-screen': this.fullCoder,
|
||||||
|
'auto-height': this.isAutoHeight
|
||||||
|
},
|
||||||
style: {}
|
style: {}
|
||||||
}
|
}
|
||||||
if (this.fullCoder) {
|
if (this.fullCoder) {
|
||||||
props.style['z-index'] = this.zIndex
|
props.style['z-index'] = this.zIndex
|
||||||
}
|
}
|
||||||
|
if (!this.isAutoHeight) {
|
||||||
|
props.style['height'] = (typeof this.height === 'number' ? this.height + 'px' : this.height)
|
||||||
|
}
|
||||||
return props
|
return props
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -240,7 +272,8 @@
|
||||||
// 编辑器赋值
|
// 编辑器赋值
|
||||||
if(this.value||this.code){
|
if(this.value||this.code){
|
||||||
this.hasCode=true
|
this.hasCode=true
|
||||||
this.coder.setValue(this.value || this.code)
|
//this.coder.setValue(this.value || this.code)
|
||||||
|
this.setCodeContent(this.value || this.code)
|
||||||
}else{
|
}else{
|
||||||
this.coder.setValue('')
|
this.coder.setValue('')
|
||||||
this.hasCode=false
|
this.hasCode=false
|
||||||
|
@ -408,6 +441,7 @@
|
||||||
top: 12px;
|
top: 12px;
|
||||||
right: 12px;
|
right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.full-screen-child {
|
.full-screen-child {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
|
@ -415,12 +449,25 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full-screen-child {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.auto-height {
|
||||||
.full-screen-child {
|
.full-screen-child {
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
max-height: 320px;
|
max-height: 320px;
|
||||||
|
height: unset;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.full-screen .full-screen-child {
|
||||||
|
height: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-cursor{
|
.CodeMirror-cursor{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<a-date-picker
|
<a-date-picker
|
||||||
|
dropdownClassName="j-date-picker"
|
||||||
:disabled="disabled || readOnly"
|
:disabled="disabled || readOnly"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@change="handleDateChange"
|
@change="handleDateChange"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!-- JEditableTable -->
|
<!-- JEditableTable -->
|
||||||
<!-- @version 1.5.0 -->
|
<!-- @version 1.6.1 -->
|
||||||
<!-- @author sjlei -->
|
<!-- @author sjlei -->
|
||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
|
@ -99,10 +99,12 @@
|
||||||
class="tr"
|
class="tr"
|
||||||
:class="selectedRowIds.indexOf(row.id) !== -1 ? 'tr-checked' : ''"
|
:class="selectedRowIds.indexOf(row.id) !== -1 ? 'tr-checked' : ''"
|
||||||
:style="buildTrStyle(rowIndex)"
|
:style="buildTrStyle(rowIndex)"
|
||||||
:key="row.id">
|
:key="row.id"
|
||||||
|
@click="handleClickTableRow"
|
||||||
|
>
|
||||||
<!-- 左侧固定td -->
|
<!-- 左侧固定td -->
|
||||||
|
|
||||||
<div v-if="dragSort" class="td td-ds" :style="style.tdLeftDs">
|
<div v-if="dragSort" class="td td-ds" :style="style.tdLeftDs" @dblclick="_handleRowInsertDown(rowIndex)" >
|
||||||
<a-dropdown :trigger="['click']" :getPopupContainer="getParentContainer">
|
<a-dropdown :trigger="['click']" :getPopupContainer="getParentContainer">
|
||||||
<div class="td-ds-icons">
|
<div class="td-ds-icons">
|
||||||
<a-icon type="align-left"/>
|
<a-icon type="align-left"/>
|
||||||
|
@ -144,27 +146,23 @@
|
||||||
|
|
||||||
<!-- native input -->
|
<!-- native input -->
|
||||||
<label :key="i" v-if="col.type === formTypes.input || col.type === formTypes.inputNumber">
|
<label :key="i" v-if="col.type === formTypes.input || col.type === formTypes.inputNumber">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
v-if="isEditRow(row, col)"
|
||||||
:id="id"
|
:id="id"
|
||||||
v-bind="buildProps(row,col)"
|
v-bind="buildProps(row,col)"
|
||||||
:data-input-number="col.type === formTypes.inputNumber"
|
:data-input-number="col.type === formTypes.inputNumber"
|
||||||
:placeholder="replaceProps(col, col.placeholder)"
|
:placeholder="replaceProps(col, col.placeholder)"
|
||||||
@blur="(e)=>{handleBlurCommono(e.target,rowIndex,row,col)}"
|
@blur="(e)=>{handleBlurCommono(e.target,rowIndex,row,col)}"
|
||||||
@input="(e)=>{handleInputCommono(e.target,rowIndex,row,col)}"
|
@input="(e)=>{handleInputCommono(e.target,rowIndex,row,col)}"
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
/>
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}"/>
|
<span
|
||||||
|
v-else
|
||||||
|
class="j-td-span no-edit"
|
||||||
|
:class="{disabled: buildProps(row,col).disabled}"
|
||||||
|
@click="handleEditRow(row, col)"
|
||||||
|
>{{ inputValues[rowIndex][col.key] }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
<!-- checkbox -->
|
<!-- checkbox -->
|
||||||
<template v-else-if="col.type === formTypes.checkbox">
|
<template v-else-if="col.type === formTypes.checkbox">
|
||||||
|
@ -178,21 +176,9 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- select -->
|
<!-- select -->
|
||||||
<template v-else-if="col.type === formTypes.select">
|
<template v-else-if="col.type === formTypes.select">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
|
|
||||||
<a-select
|
<a-select
|
||||||
|
v-if="isEditRow(row, col)"
|
||||||
:id="id"
|
:id="id"
|
||||||
:key="i"
|
:key="i"
|
||||||
v-bind="buildProps(row,col)"
|
v-bind="buildProps(row,col)"
|
||||||
|
@ -206,32 +192,20 @@
|
||||||
@search="(v)=>handleSearchSelect(v,id,row,col)"
|
@search="(v)=>handleSearchSelect(v,id,row,col)"
|
||||||
@blur="(v)=>handleBlurSearch(v,id,row,col)"
|
@blur="(v)=>handleBlurSearch(v,id,row,col)"
|
||||||
allowClear
|
allowClear
|
||||||
>
|
/>
|
||||||
|
<span
|
||||||
<!--<template v-for="(opt,optKey) in col.options">-->
|
v-else
|
||||||
<!--<a-select-option :value="opt.value" :key="optKey">{{ opt.title }}</a-select-option>-->
|
class="j-td-span no-edit"
|
||||||
<!--</template>-->
|
:class="{disabled: buildProps(row,col).disabled}"
|
||||||
</a-select>
|
@click.stop="handleEditRow(row, col)"
|
||||||
</span>
|
>{{ getSelectTranslateText(selectValues[id], row, col) }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- date -->
|
<!-- date -->
|
||||||
<template v-else-if="col.type === formTypes.date || col.type === formTypes.datetime">
|
<template v-else-if="col.type === formTypes.date || col.type === formTypes.datetime">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
|
|
||||||
<j-date
|
<j-date
|
||||||
|
v-if="isEditRow(row, col)"
|
||||||
:id="id"
|
:id="id"
|
||||||
:key="i"
|
:key="i"
|
||||||
v-bind="buildProps(row,col)"
|
v-bind="buildProps(row,col)"
|
||||||
|
@ -243,26 +217,21 @@
|
||||||
:showTime="col.type === formTypes.datetime"
|
:showTime="col.type === formTypes.datetime"
|
||||||
:dateFormat="col.type === formTypes.date? 'YYYY-MM-DD':'YYYY-MM-DD HH:mm:ss'"
|
:dateFormat="col.type === formTypes.date? 'YYYY-MM-DD':'YYYY-MM-DD HH:mm:ss'"
|
||||||
allowClear
|
allowClear
|
||||||
@change="(v)=>handleChangeJDateCommon(v,id,row,col,col.type === formTypes.datetime)"/>
|
@change="(v)=>handleChangeJDateCommon(v,id,row,col,col.type === formTypes.datetime)"
|
||||||
|
/>
|
||||||
</span>
|
<span
|
||||||
|
v-else
|
||||||
|
class="j-td-span no-edit"
|
||||||
|
:class="{disabled: buildProps(row,col).disabled}"
|
||||||
|
@click="handleEditRow(row, col)"
|
||||||
|
>{{ jdateValues[id] }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- input_pop -->
|
<!-- input_pop -->
|
||||||
<template v-else-if="col.type === formTypes.input_pop">
|
<template v-else-if="col.type === formTypes.input_pop">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer">
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
<j-input-pop
|
<j-input-pop
|
||||||
|
v-if="isEditRow(row, col)"
|
||||||
:id="id"
|
:id="id"
|
||||||
:key="i"
|
:key="i"
|
||||||
:width="300"
|
:width="300"
|
||||||
|
@ -273,12 +242,17 @@
|
||||||
:value="jInputPopValues[id]"
|
:value="jInputPopValues[id]"
|
||||||
:getCalendarContainer="getParentContainer"
|
:getCalendarContainer="getParentContainer"
|
||||||
:placeholder="replaceProps(col, col.placeholder)"
|
:placeholder="replaceProps(col, col.placeholder)"
|
||||||
@change="(v)=>handleChangeJInputPopCommon(v,id,row,col)">
|
@change="(v)=>handleChangeJInputPopCommon(v,id,row,col)"
|
||||||
</j-input-pop>
|
/>
|
||||||
</span>
|
<span
|
||||||
|
v-else
|
||||||
|
class="j-td-span no-edit"
|
||||||
|
:class="{disabled: buildProps(row,col).disabled}"
|
||||||
|
@click="handleEditRow(row, col)"
|
||||||
|
>{{ jInputPopValues[id] }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- upload -->
|
||||||
<div v-else-if="col.type === formTypes.upload" :key="i">
|
<div v-else-if="col.type === formTypes.upload" :key="i">
|
||||||
<template v-if="uploadValues[id] != null" v-for="(file,fileKey) of [(uploadValues[id]||{})]">
|
<template v-if="uploadValues[id] != null" v-for="(file,fileKey) of [(uploadValues[id]||{})]">
|
||||||
<a-input
|
<a-input
|
||||||
|
@ -323,19 +297,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div :hidden="uploadValues[id] != null">
|
<div :hidden="uploadValues[id] != null">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
<a-upload
|
<a-upload
|
||||||
name="file"
|
name="file"
|
||||||
:data="{'isup':1}"
|
:data="{'isup':1}"
|
||||||
|
@ -348,7 +310,6 @@
|
||||||
>
|
>
|
||||||
<a-button icon="upload">{{ col.placeholder }}</a-button>
|
<a-button icon="upload">{{ col.placeholder }}</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</span>
|
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -356,21 +317,9 @@
|
||||||
|
|
||||||
<!-- update-begin-author:taoyan date:0827 for:popup -->
|
<!-- update-begin-author:taoyan date:0827 for:popup -->
|
||||||
<template v-else-if="col.type === formTypes.popup">
|
<template v-else-if="col.type === formTypes.popup">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
|
|
||||||
<j-popup
|
<j-popup
|
||||||
|
v-if="isEditRow(row, col)"
|
||||||
:id="id"
|
:id="id"
|
||||||
:key="i"
|
:key="i"
|
||||||
v-bind="buildProps(row,col)"
|
v-bind="buildProps(row,col)"
|
||||||
|
@ -382,8 +331,14 @@
|
||||||
:dest-fields="col.destFields"
|
:dest-fields="col.destFields"
|
||||||
:code="col.popupCode"
|
:code="col.popupCode"
|
||||||
:groupId="caseId"
|
:groupId="caseId"
|
||||||
@input="(value,others)=>popupCallback(value,others,id,row,col,rowIndex)"/>
|
@input="(value,others)=>popupCallback(value,others,id,row,col,rowIndex)"
|
||||||
</span>
|
/>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="j-td-span no-edit"
|
||||||
|
:class="{disabled: buildProps(row,col).disabled}"
|
||||||
|
@click="handleEditRow(row, col)"
|
||||||
|
>{{ getPopupValue(id) }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- update-end-author:taoyan date:0827 for:popup -->
|
<!-- update-end-author:taoyan date:0827 for:popup -->
|
||||||
|
@ -430,19 +385,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div :hidden="uploadValues[id] != null">
|
<div :hidden="uploadValues[id] != null">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
<a-upload
|
<a-upload
|
||||||
name="file"
|
name="file"
|
||||||
:data="{'isup':1}"
|
:data="{'isup':1}"
|
||||||
|
@ -455,7 +398,6 @@
|
||||||
>
|
>
|
||||||
<a-button icon="upload">上传文件</a-button>
|
<a-button icon="upload">上传文件</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</span>
|
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -512,19 +454,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div :hidden="uploadValues[id] != null">
|
<div :hidden="uploadValues[id] != null">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
<a-upload
|
<a-upload
|
||||||
name="file"
|
name="file"
|
||||||
:data="{'isup':1}"
|
:data="{'isup':1}"
|
||||||
|
@ -537,29 +467,15 @@
|
||||||
>
|
>
|
||||||
<a-button icon="upload">上传图片</a-button>
|
<a-button icon="upload">上传图片</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</span>
|
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- update-end-author:taoyan date:0827 for:图片逻辑新增 -->
|
<!-- update-end-author:taoyan date:0827 for:图片逻辑新增 -->
|
||||||
|
|
||||||
|
|
||||||
<!-- radio-begin -->
|
<!-- radio-begin -->
|
||||||
<template v-else-if="col.type === formTypes.radio">
|
<template v-else-if="col.type === formTypes.radio">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
:id="id"
|
:id="id"
|
||||||
:key="i"
|
:key="i"
|
||||||
|
@ -568,29 +484,15 @@
|
||||||
@change="(e)=>handleRadioChange(e.target.value,id,row,col)">
|
@change="(e)=>handleRadioChange(e.target.value,id,row,col)">
|
||||||
<a-radio v-for="(item, key) in col.options" :key="key" :value="item.value">{{ item.text }}</a-radio>
|
<a-radio v-for="(item, key) in col.options" :key="key" :value="item.value">{{ item.text }}</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</span>
|
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- radio-end -->
|
<!-- radio-end -->
|
||||||
|
|
||||||
|
|
||||||
<!-- select多选 -begin -->
|
<!-- select多选 -begin -->
|
||||||
<template v-else-if="col.type === formTypes.list_multi">
|
<template v-else-if="col.type === formTypes.list_multi">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
|
|
||||||
<a-select
|
<a-select
|
||||||
|
v-if="isEditRow(row, col)"
|
||||||
:id="id"
|
:id="id"
|
||||||
:key="i"
|
:key="i"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
|
@ -602,30 +504,23 @@
|
||||||
:getPopupContainer="getParentContainer"
|
:getPopupContainer="getParentContainer"
|
||||||
:placeholder="replaceProps(col, col.placeholder)"
|
:placeholder="replaceProps(col, col.placeholder)"
|
||||||
@change="(v)=>handleMultiSelectChange(v,id,row,col)"
|
@change="(v)=>handleMultiSelectChange(v,id,row,col)"
|
||||||
allowClear>
|
allowClear
|
||||||
</a-select>
|
/>
|
||||||
</span>
|
<span
|
||||||
|
v-else
|
||||||
|
class="j-td-span no-edit"
|
||||||
|
:class="{disabled: buildProps(row,col).disabled}"
|
||||||
|
@click="handleEditRow(row, col)"
|
||||||
|
>{{ getSelectTranslateText(multiSelectValues[id], row, col) }} </span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- select多选 -end -->
|
<!-- select多选 -end -->
|
||||||
|
|
||||||
<!-- select搜索 -begin -->
|
<!-- select搜索 -begin -->
|
||||||
<template v-else-if="col.type === formTypes.sel_search">
|
<template v-else-if="col.type === formTypes.sel_search">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
|
|
||||||
<a-select
|
<a-select
|
||||||
|
v-if="isEditRow(row, col)"
|
||||||
:id="id"
|
:id="id"
|
||||||
:key="i"
|
:key="i"
|
||||||
showSearch
|
showSearch
|
||||||
|
@ -638,28 +533,20 @@
|
||||||
:getPopupContainer="getParentContainer"
|
:getPopupContainer="getParentContainer"
|
||||||
:placeholder="replaceProps(col, col.placeholder)"
|
:placeholder="replaceProps(col, col.placeholder)"
|
||||||
@change="(v)=>handleSearchSelectChange(v,id,row,col)"
|
@change="(v)=>handleSearchSelectChange(v,id,row,col)"
|
||||||
allowClear>
|
allowClear
|
||||||
</a-select>
|
/>
|
||||||
</span>
|
<span
|
||||||
|
v-else
|
||||||
|
class="j-td-span no-edit"
|
||||||
|
:class="{disabled: buildProps(row,col).disabled}"
|
||||||
|
@click="handleEditRow(row, col)"
|
||||||
|
>{{ getSelectTranslateText(searchSelectValues[id], row, col) }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<!-- select搜索 -end -->
|
<!-- select搜索 -end -->
|
||||||
|
|
||||||
|
|
||||||
<div v-else-if="col.type === formTypes.slot" :key="i">
|
<div v-else-if="col.type === formTypes.slot" :key="i">
|
||||||
<a-tooltip
|
<a-tooltip v-bind="buildTooltipProps(row, col, id)">
|
||||||
:key="i"
|
|
||||||
:id="id"
|
|
||||||
placement="top"
|
|
||||||
:title="(tooltips[id] || {}).title"
|
|
||||||
:visible="(tooltips[id] || {}).visible || false"
|
|
||||||
:autoAdjustOverflow="true"
|
|
||||||
:getPopupContainer="getParentContainer"
|
|
||||||
>
|
|
||||||
|
|
||||||
<span
|
|
||||||
@mouseover="()=>{handleMouseoverCommono(row,col)}"
|
|
||||||
@mouseout="()=>{handleMouseoutCommono(row,col)}">
|
|
||||||
<slot
|
<slot
|
||||||
:name="(col.slot || col.slotName) || col.key"
|
:name="(col.slot || col.slotName) || col.key"
|
||||||
:index="rowIndex"
|
:index="rowIndex"
|
||||||
|
@ -674,7 +561,6 @@
|
||||||
:handleChange="(v)=>handleChangeSlotCommon(v,id,row,col)"
|
:handleChange="(v)=>handleChangeSlotCommon(v,id,row,col)"
|
||||||
:isNotPass="notPassedIds.includes(col.key+row.id)"
|
:isNotPass="notPassedIds.includes(col.key+row.id)"
|
||||||
/>
|
/>
|
||||||
</span>
|
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -736,9 +622,9 @@
|
||||||
import Draggable from 'vuedraggable'
|
import Draggable from 'vuedraggable'
|
||||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
import { FormTypes, VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
|
import { FormTypes, VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
|
||||||
import { cloneObject, randomString, randomNumber } from '@/utils/util'
|
import { cloneObject, randomString, randomNumber, getEventPath } from '@/utils/util'
|
||||||
import JDate from '@/components/jeecg/JDate'
|
import JDate from '@/components/jeecg/JDate'
|
||||||
import { initDictOptions } from '@/components/dict/JDictSelectUtil'
|
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 JInputPop from '@/components/jeecg/minipop/JInputPop'
|
||||||
import JFilePop from '@/components/jeecg/minipop/JFilePop'
|
import JFilePop from '@/components/jeecg/minipop/JFilePop'
|
||||||
|
@ -813,6 +699,11 @@
|
||||||
type: String,
|
type: String,
|
||||||
default: 'orderNum'
|
default: 'orderNum'
|
||||||
},
|
},
|
||||||
|
// 是否一直显示编辑框,如果为false则只有点击的时候才出现输入框
|
||||||
|
alwaysEdit: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -821,7 +712,6 @@
|
||||||
// 当前实例是否是行编辑
|
// 当前实例是否是行编辑
|
||||||
isJEditableTable: true,
|
isJEditableTable: true,
|
||||||
// caseId,用于防止有多个实例的时候会冲突
|
// caseId,用于防止有多个实例的时候会冲突
|
||||||
caseIdPrefix: '_jet-',
|
|
||||||
caseId: `_jet-${randomString(6)}-`,
|
caseId: `_jet-${randomString(6)}-`,
|
||||||
// 临时ID标识,凡是以该标识结尾的ID都是临时ID,不添加到数据库中
|
// 临时ID标识,凡是以该标识结尾的ID都是临时ID,不添加到数据库中
|
||||||
tempId: `_tid-${randomString(6)}`,
|
tempId: `_tid-${randomString(6)}`,
|
||||||
|
@ -881,6 +771,10 @@
|
||||||
statisticsColumns: {},
|
statisticsColumns: {},
|
||||||
// 只有在行编辑被销毁时才主动清空GroupRequest的内存
|
// 只有在行编辑被销毁时才主动清空GroupRequest的内存
|
||||||
destroyCleanGroupRequest: false,
|
destroyCleanGroupRequest: false,
|
||||||
|
// 当前正在编辑的行的id
|
||||||
|
currentEditRows: {},
|
||||||
|
// 上次push数据的事件,用于判断是否点击过快
|
||||||
|
lastPushTimeMap: new Map(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -888,6 +782,13 @@
|
||||||
// 当前显示的tr
|
// 当前显示的tr
|
||||||
this.visibleTrEls = []
|
this.visibleTrEls = []
|
||||||
this.disabledRowIds = (this.disabledRowIds || [])
|
this.disabledRowIds = (this.disabledRowIds || [])
|
||||||
|
// 解决火狐浏览器下拖拽会打开新的Tab的问题
|
||||||
|
document.body.ondrop = (event) => {
|
||||||
|
if (this.dragging) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 计算属性
|
// 计算属性
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -1033,6 +934,9 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加事件监听
|
||||||
|
this.addEventListener()
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
@ -1225,7 +1129,7 @@
|
||||||
if (!sourceValueIsEmpty) {
|
if (!sourceValueIsEmpty) {
|
||||||
// 判断是否是多选
|
// 判断是否是多选
|
||||||
if (typeof sourceValue === 'string' && (column.props || {})['mode'] === 'multiple') {
|
if (typeof sourceValue === 'string' && (column.props || {})['mode'] === 'multiple') {
|
||||||
sourceValue = sourceValue.split(',')
|
sourceValue = sourceValue === '' ? [] : sourceValue.split(',')
|
||||||
}
|
}
|
||||||
selectValues[inputId] = sourceValue
|
selectValues[inputId] = sourceValue
|
||||||
} else {
|
} else {
|
||||||
|
@ -1330,7 +1234,7 @@
|
||||||
|
|
||||||
// 更新form表单的值
|
// 更新form表单的值
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.updateFormValues()
|
this.forceUpdateFormValues()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return rows
|
return rows
|
||||||
|
@ -1399,6 +1303,9 @@
|
||||||
* @param num 添加的行数,默认1
|
* @param num 添加的行数,默认1
|
||||||
*/
|
*/
|
||||||
insert(insertIndex, num = 1) {
|
insert(insertIndex, num = 1) {
|
||||||
|
if (this.checkTooFastClick('insert', 1500)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!insertIndex && num < 1) return
|
if (!insertIndex && num < 1) return
|
||||||
let rows = this.rows
|
let rows = this.rows
|
||||||
let newRows = []
|
let newRows = []
|
||||||
|
@ -1491,6 +1398,7 @@
|
||||||
let values = []
|
let values = []
|
||||||
// 遍历inputValues来获取每行的值
|
// 遍历inputValues来获取每行的值
|
||||||
for (let value of inputValues) {
|
for (let value of inputValues) {
|
||||||
|
if (value == null) console.warn(this.caseId, '+++++++++ value.1: ', value, cloneObject(inputValues))
|
||||||
let rowIdsFlag = false
|
let rowIdsFlag = false
|
||||||
// 如果带有rowIds,那么就只存这几行的数据
|
// 如果带有rowIds,那么就只存这几行的数据
|
||||||
if (rowIds == null) {
|
if (rowIds == null) {
|
||||||
|
@ -1705,7 +1613,24 @@
|
||||||
}
|
}
|
||||||
// 在 checkboxValues 中寻找值
|
// 在 checkboxValues 中寻找值
|
||||||
if (!edited) {
|
if (!edited) {
|
||||||
edited = this.setOneValue(this.checkboxValues, modelKey, newValue)
|
// checkbox 特殊处理 CustomValue
|
||||||
|
let key = this.valuesHasOwnProperty(this.checkboxValues, modelKey)
|
||||||
|
// 找到对应的column
|
||||||
|
let sourceValue
|
||||||
|
for (let column of this.columns) {
|
||||||
|
if (column.key === newValueKey) {
|
||||||
|
edited = true
|
||||||
|
// 判断是否设定了customValue(自定义值)
|
||||||
|
if (column.customValue instanceof Array) {
|
||||||
|
let customValue = (column.customValue[0] || '').toString()
|
||||||
|
sourceValue = (newValue === customValue)
|
||||||
|
} else {
|
||||||
|
sourceValue = !!newValue
|
||||||
|
}
|
||||||
|
this.$set(this.checkboxValues, key, sourceValue)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 在 jdateValues 中寻找值
|
// 在 jdateValues 中寻找值
|
||||||
if (!edited) {
|
if (!edited) {
|
||||||
|
@ -1733,7 +1658,7 @@
|
||||||
}
|
}
|
||||||
// 在 multiSelectValues 中寻找值
|
// 在 multiSelectValues 中寻找值
|
||||||
if (!edited) {
|
if (!edited) {
|
||||||
edited = this.setOneValue(this.multiSelectValues, modelKey, newValue)
|
edited = this.setOneValue(this.multiSelectValues, modelKey, newValue, true)
|
||||||
}
|
}
|
||||||
// 在 searchSelectValues 中寻找值
|
// 在 searchSelectValues 中寻找值
|
||||||
if (!edited) {
|
if (!edited) {
|
||||||
|
@ -1745,9 +1670,21 @@
|
||||||
// 强制更新formValues
|
// 强制更新formValues
|
||||||
this.forceUpdateFormValues()
|
this.forceUpdateFormValues()
|
||||||
},
|
},
|
||||||
setOneValue(valuesObject, modelKey, value) {
|
/**
|
||||||
|
* 设置单个组件的值
|
||||||
|
* @param valuesObject 组件存储值的对象
|
||||||
|
* @param modelKey 组件存储值的对象里的key
|
||||||
|
* @param value 新值
|
||||||
|
* @param isMultiple 是否多选,如果是就会对 value 进行一个 split(',') 的操作
|
||||||
|
*/
|
||||||
|
setOneValue(valuesObject, modelKey, value, isMultiple = false) {
|
||||||
let key = this.valuesHasOwnProperty(valuesObject, modelKey)
|
let key = this.valuesHasOwnProperty(valuesObject, modelKey)
|
||||||
if (key) {
|
if (key) {
|
||||||
|
// 处理多选数组
|
||||||
|
if (isMultiple && !Array.isArray(value)) {
|
||||||
|
value = (value || '').toString().trim()
|
||||||
|
value = value === '' ? [] : value.split(',')
|
||||||
|
}
|
||||||
this.$set(valuesObject, key, value)
|
this.$set(valuesObject, key, value)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -1802,36 +1739,12 @@
|
||||||
tooltips[inputId].visible = !passed
|
tooltips[inputId].visible = !passed
|
||||||
tooltips[inputId].passed = passed
|
tooltips[inputId].passed = passed
|
||||||
let index = notPassedIds.indexOf(inputId)
|
let index = notPassedIds.indexOf(inputId)
|
||||||
let borderColor = null, boxShadow = null
|
|
||||||
if (!passed) {
|
if (!passed) {
|
||||||
tooltips[inputId].title = this.replaceProps(column, message)
|
tooltips[inputId].title = this.replaceProps(column, message)
|
||||||
borderColor = 'red'
|
|
||||||
boxShadow = `0 0 0 2px rgba(255, 0, 0, 0.2)`
|
|
||||||
if (index === -1) notPassedIds.push(inputId)
|
if (index === -1) notPassedIds.push(inputId)
|
||||||
} else {
|
} else {
|
||||||
if (index !== -1) notPassedIds.splice(index, 1)
|
if (index !== -1) notPassedIds.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
let element = document.getElementById(inputId)
|
|
||||||
if (element != null) {
|
|
||||||
// select 在 .ant-select-selection 上设置 border-color
|
|
||||||
if (column.type === FormTypes.select) {
|
|
||||||
element = element.getElementsByClassName('ant-select-selection')[0]
|
|
||||||
}
|
|
||||||
// jdate 在 input 上设置 border-color
|
|
||||||
if (column.type === FormTypes.date || column.type === FormTypes.datetime) {
|
|
||||||
element = element.getElementsByTagName('input')[0]
|
|
||||||
}
|
|
||||||
// upload 在 .ant-upload .ant-btn 上设置 border-color
|
|
||||||
if (column.type === FormTypes.upload || column.type === FormTypes.file || column.type === FormTypes.image) {
|
|
||||||
element = element.getElementsByClassName('ant-upload')[0].getElementsByClassName('ant-btn')[0]
|
|
||||||
}
|
|
||||||
element.style.borderColor = borderColor
|
|
||||||
element.style.boxShadow = boxShadow
|
|
||||||
if (element.tagName === 'SPAN') {
|
|
||||||
element.style.display = 'block'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 是否更新到data
|
// 是否更新到data
|
||||||
if (update) {
|
if (update) {
|
||||||
|
@ -1854,7 +1767,7 @@
|
||||||
message = msg
|
message = msg
|
||||||
}
|
}
|
||||||
if (flag == null) {
|
if (flag == null) {
|
||||||
nextThen([null, message])
|
nextThen([true, message])
|
||||||
} else {
|
} else {
|
||||||
nextThen([!!flag, message])
|
nextThen([!!flag, message])
|
||||||
}
|
}
|
||||||
|
@ -1981,7 +1894,8 @@
|
||||||
/** 强制更新FormValues */
|
/** 强制更新FormValues */
|
||||||
forceUpdateFormValues() {
|
forceUpdateFormValues() {
|
||||||
this.visibleTrEls = []
|
this.visibleTrEls = []
|
||||||
this.updateFormValues()
|
this.$forceUpdate()
|
||||||
|
this.$nextTick(() => this.updateFormValues())
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重新计算所有统计列
|
// 重新计算所有统计列
|
||||||
|
@ -2189,18 +2103,6 @@
|
||||||
|
|
||||||
/* --- common function begin --- */
|
/* --- common function begin --- */
|
||||||
|
|
||||||
/** 鼠标移入 */
|
|
||||||
handleMouseoverCommono(row, column) {
|
|
||||||
let inputId = column.key + row.id
|
|
||||||
if (this.notPassedIds.indexOf(inputId) !== -1) {
|
|
||||||
this.showOrHideTooltip(inputId, true, true)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 鼠标移出 */
|
|
||||||
handleMouseoutCommono(row, column) {
|
|
||||||
let inputId = column.key + row.id
|
|
||||||
this.showOrHideTooltip(inputId, false)
|
|
||||||
},
|
|
||||||
/** input事件 */
|
/** input事件 */
|
||||||
handleInputCommono(target, index, row, column) {
|
handleInputCommono(target, index, row, column) {
|
||||||
let oldValue = this.inputValues[index][column.key] || ''
|
let oldValue = this.inputValues[index][column.key] || ''
|
||||||
|
@ -2321,26 +2223,39 @@
|
||||||
this.uploadValues = this.bindValuesChange(obj, obj.id, 'uploadValues')
|
this.uploadValues = this.bindValuesChange(obj, obj.id, 'uploadValues')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 记录用到数据绑定的组件的值 */
|
handleClickTableRow(event) {
|
||||||
bindValuesChange(value, id, key) {
|
let {target} = event
|
||||||
// let values = Object.assign({}, this[key])
|
if (target.className === 'td' || target.className === 'tr') {
|
||||||
// values[id] = value
|
// 清空编辑状态
|
||||||
// return values
|
this.currentEditRows = {}
|
||||||
this.$set(this[key], id, value)
|
}
|
||||||
return this[key]
|
|
||||||
},
|
},
|
||||||
|
// 点击后编辑当前行
|
||||||
/** 显示或隐藏tooltip */
|
handleEditRow(row, col) {
|
||||||
showOrHideTooltip(inputId, show, force = false) {
|
if (this.alwaysEdit) {
|
||||||
if (!this.tooltips[inputId] && !force) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 将点击的组件置为可编辑并还原其他组件的编辑状态
|
||||||
let tooltip = this.tooltips[inputId] || {}
|
this.currentEditRows = {
|
||||||
if (tooltip.visible !== show) {
|
[row.id]: {
|
||||||
tooltip.visible = show
|
[col.key]: true
|
||||||
this.$set(this.tooltips, inputId, tooltip)
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (col.type === FormTypes.input || col.type === FormTypes.inputNumber) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.forceUpdateFormValues()
|
||||||
|
// 自动获取焦点
|
||||||
|
let el = document.getElementById(`${col.key}${row.id}`)
|
||||||
|
if (el) {
|
||||||
|
el.focus()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 记录用到数据绑定的组件的值 */
|
||||||
|
bindValuesChange(value, id, key) {
|
||||||
|
this.$set(this[key], id, value)
|
||||||
|
return this[key]
|
||||||
},
|
},
|
||||||
|
|
||||||
/** value 触发valueChange事件 */
|
/** value 触发valueChange事件 */
|
||||||
|
@ -2424,10 +2339,11 @@
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let newOptions = (column.options || [])// .concat(res.result)
|
let newOptions = (column.options || [])// .concat(res.result)
|
||||||
res.result.forEach(item => {
|
res.result.forEach(item => {
|
||||||
|
// 过滤重复数据
|
||||||
for (let option of newOptions) if (option.value === item.value) return
|
for (let option of newOptions) if (option.value === item.value) return
|
||||||
newOptions.push(item)
|
newOptions.push(item)
|
||||||
})
|
})
|
||||||
column.options = newOptions
|
this.$set(column, 'options', newOptions)
|
||||||
} else {
|
} else {
|
||||||
console.group(`JEditableTable 查询字典(${column.dictCode})发生异常`)
|
console.group(`JEditableTable 查询字典(${column.dictCode})发生异常`)
|
||||||
console.log(res.message)
|
console.log(res.message)
|
||||||
|
@ -2451,6 +2367,27 @@
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 辅助方法:动态构造Tooltip的Props,防止出现不消失的情况 */
|
||||||
|
buildTooltipProps(row, col, id) {
|
||||||
|
let {notPassedIds, tooltips} = this
|
||||||
|
let props = {
|
||||||
|
title: (tooltips[id] || {}).title,
|
||||||
|
placement: 'top',
|
||||||
|
autoAdjustOverflow: true,
|
||||||
|
getPopupContainer: this.getParentContainer,
|
||||||
|
class: {
|
||||||
|
'j-check-failed': false
|
||||||
|
},
|
||||||
|
}
|
||||||
|
let isCheckFailed = notPassedIds.includes(id)
|
||||||
|
if (isCheckFailed) {
|
||||||
|
props.class['j-check-failed'] = true
|
||||||
|
} else {
|
||||||
|
props['visible'] = false
|
||||||
|
}
|
||||||
|
return props
|
||||||
|
},
|
||||||
|
|
||||||
/** 辅助方法:指定a-select 和 j-data 的父容器 */
|
/** 辅助方法:指定a-select 和 j-data 的父容器 */
|
||||||
getParentContainer(node) {
|
getParentContainer(node) {
|
||||||
let element = (() => {
|
let element = (() => {
|
||||||
|
@ -2569,6 +2506,25 @@
|
||||||
|
|
||||||
return props
|
return props
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 辅助方法:防止过快点击,如果点击过快的话就返回 true */
|
||||||
|
checkTooFastClick(key = 'default', ms = 300) {
|
||||||
|
let nowTime = Date.now()
|
||||||
|
let lastTime = this.lastPushTimeMap.get(key)
|
||||||
|
if (!lastTime) {
|
||||||
|
lastTime = nowTime
|
||||||
|
this.lastPushTimeMap.set(key, nowTime)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let diffTime = nowTime - lastTime
|
||||||
|
if (diffTime <= ms) {
|
||||||
|
this.$message.warn('你点击的太快了,请慢点点击!')
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
this.lastPushTimeMap.set(key, nowTime)
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
|
||||||
/** upload 辅助方法:获取 headers */
|
/** upload 辅助方法:获取 headers */
|
||||||
uploadGetHeaders(row, column) {
|
uploadGetHeaders(row, column) {
|
||||||
let headers = {}
|
let headers = {}
|
||||||
|
@ -2601,31 +2557,27 @@
|
||||||
/** popup回调 */
|
/** popup回调 */
|
||||||
popupCallback(value, others, id, row, column, index) {
|
popupCallback(value, others, id, row, column, index) {
|
||||||
// 存储输入的值
|
// 存储输入的值
|
||||||
this.popupValues[id] = value
|
let popupValue = value
|
||||||
if (others) {
|
if (others) {
|
||||||
Object.keys(others).map((key) => {
|
let rowKey = this.getCleanId(row.id)
|
||||||
this.columns.map(k=>{
|
let setValueItem = {rowKey, values: {}}
|
||||||
if(k.key === key){
|
Object.keys(others).forEach(key => {
|
||||||
let tempId = id.substring(id.indexOf(this.caseIdPrefix))
|
// 当前列直接赋值,其他列通过setValues赋值
|
||||||
if(k.type === 'date'){
|
if (key === column.key) {
|
||||||
this.handleChangeJDateCommon(others[key], key+tempId, {id:tempId}, k, false)
|
popupValue = others[key]
|
||||||
}else if(k.type === 'datetime'){
|
|
||||||
this.handleChangeJDateCommon(others[key], key+tempId, {id:tempId}, k, true)
|
|
||||||
} else {
|
} else {
|
||||||
this.inputValues[index][key] = others[key]
|
setValueItem.values[key] = others[key]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
if (Object.keys(setValueItem).length > 0) {
|
||||||
|
this.setValues([setValueItem])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
this.setOneValue(this.popupValues, id, popupValue)
|
||||||
// 做单个表单验证
|
// 做单个表单验证
|
||||||
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
|
this.validateOneInput(value, row, column, this.notPassedIds, true, 'change')
|
||||||
// 触发valueChange 事件
|
// 触发valueChange 事件
|
||||||
this.elemValueChange('input', row, column, value)
|
this.elemValueChange('input', row, column, value)
|
||||||
// 更新form表单的值
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.forceUpdateFormValues()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/** popup输入框回显 */
|
/** popup输入框回显 */
|
||||||
getPopupValue(id) {
|
getPopupValue(id) {
|
||||||
|
@ -2654,17 +2606,101 @@
|
||||||
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
},
|
},
|
||||||
getEllipsisWord(content, len){
|
getEllipsisWord(content, len){
|
||||||
if(!content || content.length==0){
|
if(!content || content.length === 0){
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
if(content.length>len){
|
if(content.length>len){
|
||||||
return content.substr(0,len)
|
return content.substr(0,len)
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
|
},
|
||||||
|
|
||||||
|
/* --------------------------- 2020年5月18日 默认span模式 ------------------------------ */
|
||||||
|
|
||||||
|
/** 获取Select等组件翻译后的文本 */
|
||||||
|
getSelectTranslateText(value, row, col) {
|
||||||
|
// 翻译支持单选和多选(数组、逗号分割)
|
||||||
|
return filterDictText(col.options, value)
|
||||||
|
},
|
||||||
|
|
||||||
|
// 判定当前行是否是正在编辑的
|
||||||
|
isEditRow(row, col) {
|
||||||
|
if (this.alwaysEdit) {
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
let current = this.currentEditRows[row.id]
|
||||||
|
return !!(current && current[col.key] === true)
|
||||||
|
},
|
||||||
|
|
||||||
|
/* ---- 事件监听 ---- */
|
||||||
|
|
||||||
|
// 鼠标弹起事件,用于清空输入状态
|
||||||
|
handleMouseup(event) {
|
||||||
|
if (this.alwaysEdit || Object.keys(this.currentEditRows).length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// console.log(this.caseId + 'handleMouseup: ', event)
|
||||||
|
let {target} = event
|
||||||
|
if (!target){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let className = target.className || ''
|
||||||
|
if (typeof className === 'string') {
|
||||||
|
// 点击的标签是span
|
||||||
|
if (className.includes('j-td-span') && className.includes('no-edit')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 点击的标签是下拉
|
||||||
|
if (className.includes('ant-select-dropdown-menu-item')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 事件冒泡路径
|
||||||
|
let path = getEventPath(event)
|
||||||
|
for (let p of path) {
|
||||||
|
// 如果点击的是 tr 就不处理(tr单独处理)
|
||||||
|
if ((p.id || '').startsWith(`${this.caseId}tbody-tr`)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let pClassName = p.className || ''
|
||||||
|
pClassName = typeof pClassName === 'string' ? pClassName : pClassName.toString()
|
||||||
|
|
||||||
|
/* --- 特殊处理以下组件,点击以下标签时不清空编辑状态 --- */
|
||||||
|
|
||||||
|
// 点击的标签是JInputPop
|
||||||
|
if (pClassName.includes('j-input-pop')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 点击的标签是JPopup的弹出层
|
||||||
|
if (pClassName.includes('j-popup-modal')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 点击的标签是日期选择器的弹出层
|
||||||
|
if (pClassName.includes('j-date-picker') || pClassName.includes('ant-calendar-picker-container')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 清空编辑状态
|
||||||
|
this.currentEditRows = {}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 添加事件监听
|
||||||
|
addEventListener() {
|
||||||
|
window.addEventListener('mouseup', this.handleMouseup)
|
||||||
|
},
|
||||||
|
// 移除事件监听
|
||||||
|
removeEventListener() {
|
||||||
|
window.removeEventListener('mouseup', this.handleMouseup)
|
||||||
|
},
|
||||||
|
|
||||||
|
/* --------------------------- 2020年5月18日 默认span模式 ------------------------------ */
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
this.removeEventListener()
|
||||||
this.destroyCleanGroupRequest = true
|
this.destroyCleanGroupRequest = true
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -2902,6 +2938,69 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------- 2020年5月18日 begin 默认span模式 ------------------------------ */
|
||||||
|
|
||||||
|
label {
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.j-td-span {
|
||||||
|
position: relative;
|
||||||
|
padding: 4px 11px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
height: 32px;
|
||||||
|
cursor: text;
|
||||||
|
transition: all 0.3s;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: rgba(0, 0, 0, 0.25);
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------- 2020年5月18日 end 默认span模式 ------------------------------ */
|
||||||
|
|
||||||
|
/* --------------------------- 2020年5月28日 begin 新增校验未通过的样式 ------------------------------ */
|
||||||
|
|
||||||
|
.j-check-failed.j-td-span {
|
||||||
|
background-color: rgba(255, 0, 0, 0.05);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: rgba(255, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.j-check-failed.j-td-span,
|
||||||
|
input.j-check-failed,
|
||||||
|
.j-check-failed /deep/ input,
|
||||||
|
.ant-select.j-check-failed /deep/ .ant-select-selection,
|
||||||
|
.ant-upload.j-check-failed /deep/ .ant-btn {
|
||||||
|
border-color: red;
|
||||||
|
box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------- 2020年5月28日 end 新增校验未通过的样式 ------------------------------ */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="tinymce-editor">
|
<div class="tinymce-editor">
|
||||||
<editor
|
<editor
|
||||||
|
v-if="!reloading"
|
||||||
v-model="myValue"
|
v-model="myValue"
|
||||||
:init="init"
|
:init="init"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
@ -23,7 +24,9 @@
|
||||||
import 'tinymce/plugins/colorpicker'
|
import 'tinymce/plugins/colorpicker'
|
||||||
import 'tinymce/plugins/textcolor'
|
import 'tinymce/plugins/textcolor'
|
||||||
import 'tinymce/plugins/fullscreen'
|
import 'tinymce/plugins/fullscreen'
|
||||||
|
import 'tinymce/icons/default'
|
||||||
import { uploadAction,getFileAccessHttpUrl } from '@/api/manage'
|
import { uploadAction,getFileAccessHttpUrl } from '@/api/manage'
|
||||||
|
import { getVmParentByName } from '@/utils/util'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Editor
|
Editor
|
||||||
|
@ -83,21 +86,51 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
myValue: this.value
|
myValue: this.value,
|
||||||
|
reloading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
tinymce.init({})
|
this.initATabsChangeAutoReload()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
this.reloading = true
|
||||||
|
this.$nextTick(() => this.reloading = false)
|
||||||
|
},
|
||||||
|
|
||||||
onClick(e) {
|
onClick(e) {
|
||||||
this.$emit('onClick', e, tinymce)
|
this.$emit('onClick', e, tinymce)
|
||||||
},
|
},
|
||||||
//可以添加一些自己的自定义事件,如清空内容
|
//可以添加一些自己的自定义事件,如清空内容
|
||||||
clear() {
|
clear() {
|
||||||
this.myValue = ''
|
this.myValue = ''
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动判断父级是否是 <a-tabs/> 组件,然后添加事件监听,自动触发reload()
|
||||||
|
*
|
||||||
|
* 由于 tabs 组件切换会导致 tinymce 无法输入,
|
||||||
|
* 只有重新加载才能使用(无论是vue版的还是jQuery版tinymce都有这个通病)
|
||||||
|
*/
|
||||||
|
initATabsChangeAutoReload() {
|
||||||
|
// 获取父级
|
||||||
|
let tabs = getVmParentByName(this, 'ATabs')
|
||||||
|
let tabPane = getVmParentByName(this, 'ATabPane')
|
||||||
|
if (tabs && tabPane) {
|
||||||
|
// 用户自定义的 key
|
||||||
|
let currentKey = tabPane.$vnode.key
|
||||||
|
// 添加事件监听
|
||||||
|
tabs.$on('change', (key) => {
|
||||||
|
// 切换到自己时执行reload
|
||||||
|
if (currentKey === key) {
|
||||||
|
this.reload()
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newValue) {
|
value(newValue) {
|
||||||
|
|
|
@ -86,6 +86,9 @@
|
||||||
} else {
|
} else {
|
||||||
this.initFileList(val)
|
this.initFileList(val)
|
||||||
}
|
}
|
||||||
|
if(!val || val.length==0){
|
||||||
|
this.picUrl = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
export default {
|
||||||
|
minHeight: '200px',
|
||||||
|
previewStyle: 'vertical',
|
||||||
|
useCommandShortcut: true,
|
||||||
|
useDefaultHTMLSanitizer: true,
|
||||||
|
usageStatistics: false,
|
||||||
|
hideModeSwitch: false,
|
||||||
|
toolbarItems: [
|
||||||
|
'heading',
|
||||||
|
'bold',
|
||||||
|
'italic',
|
||||||
|
'strike',
|
||||||
|
'divider',
|
||||||
|
'hr',
|
||||||
|
'quote',
|
||||||
|
'divider',
|
||||||
|
'ul',
|
||||||
|
'ol',
|
||||||
|
'task',
|
||||||
|
'indent',
|
||||||
|
'outdent',
|
||||||
|
'divider',
|
||||||
|
'table',
|
||||||
|
'image',
|
||||||
|
'link',
|
||||||
|
'divider',
|
||||||
|
'code',
|
||||||
|
'codeblock'
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
<template>
|
||||||
|
<div class="j-markdown-editor" :id="id"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import 'codemirror/lib/codemirror.css'
|
||||||
|
import '@toast-ui/editor/dist/toastui-editor.css';
|
||||||
|
import '@toast-ui/editor/dist/i18n/zh-cn';
|
||||||
|
|
||||||
|
import Editor from '@toast-ui/editor';
|
||||||
|
import defaultOptions from './default-options'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'JMarkdownEditor',
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default() {
|
||||||
|
return 'markdown-editor-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Object,
|
||||||
|
default() {
|
||||||
|
return defaultOptions
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
default: 'markdown'
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '300px'
|
||||||
|
},
|
||||||
|
language: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'zh-CN'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
editor: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
editorOptions() {
|
||||||
|
const options = Object.assign({}, defaultOptions, this.options)
|
||||||
|
options.initialEditType = this.mode
|
||||||
|
options.height = this.height
|
||||||
|
options.language = this.language
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(newValue, preValue) {
|
||||||
|
if (newValue !== preValue && newValue !== this.editor.getMarkdown()) {
|
||||||
|
this.editor.setMarkdown(newValue)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
language(val) {
|
||||||
|
this.destroyEditor()
|
||||||
|
this.initEditor()
|
||||||
|
},
|
||||||
|
height(newValue) {
|
||||||
|
this.editor.height(newValue)
|
||||||
|
},
|
||||||
|
mode(newValue) {
|
||||||
|
this.editor.changeMode(newValue)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initEditor()
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
this.destroyEditor()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initEditor() {
|
||||||
|
this.editor = new Editor({
|
||||||
|
el: document.getElementById(this.id),
|
||||||
|
...this.editorOptions
|
||||||
|
})
|
||||||
|
if (this.value) {
|
||||||
|
this.editor.setMarkdown(this.value)
|
||||||
|
}
|
||||||
|
this.editor.on('change', () => {
|
||||||
|
this.$emit('change', this.editor.getMarkdown())
|
||||||
|
})
|
||||||
|
},
|
||||||
|
destroyEditor() {
|
||||||
|
if (!this.editor) return
|
||||||
|
this.editor.off('change')
|
||||||
|
this.editor.remove()
|
||||||
|
},
|
||||||
|
setMarkdown(value) {
|
||||||
|
this.editor.setMarkdown(value)
|
||||||
|
},
|
||||||
|
getMarkdown() {
|
||||||
|
return this.editor.getMarkdown()
|
||||||
|
},
|
||||||
|
setHtml(value) {
|
||||||
|
this.editor.setHtml(value)
|
||||||
|
},
|
||||||
|
getHtml() {
|
||||||
|
return this.editor.getHtml()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
model: {
|
||||||
|
prop: 'value',
|
||||||
|
event: 'change'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
.j-markdown-editor {
|
||||||
|
/deep/ .tui-editor-defaultUI {
|
||||||
|
.te-mode-switch,
|
||||||
|
.tui-scrollsync
|
||||||
|
{
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -39,6 +39,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { getClass, getStyle } from '@/utils/props-util'
|
import { getClass, getStyle } from '@/utils/props-util'
|
||||||
|
import { triggerWindowResizeEvent } from '@/utils/util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JModal',
|
name: 'JModal',
|
||||||
|
@ -151,6 +152,7 @@
|
||||||
/** 切换全屏 */
|
/** 切换全屏 */
|
||||||
toggleFullscreen() {
|
toggleFullscreen() {
|
||||||
this.innerFullscreen = !this.innerFullscreen
|
this.innerFullscreen = !this.innerFullscreen
|
||||||
|
triggerWindowResizeEvent()
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -165,7 +167,12 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
|
// 兼容1.6.2版本的antdv
|
||||||
|
& .ant-modal {
|
||||||
|
top: 0;
|
||||||
|
padding: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
& .ant-modal-content {
|
& .ant-modal-content {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
@ -189,7 +196,6 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.j-modal-title-row {
|
.j-modal-title-row {
|
||||||
|
@ -208,12 +214,9 @@
|
||||||
&:hover {
|
&:hover {
|
||||||
color: rgba(0, 0, 0, 0.75);
|
color: rgba(0, 0, 0, 0.75);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
|
|
|
@ -0,0 +1,205 @@
|
||||||
|
<template>
|
||||||
|
<div class="components-input-demo-presuffix" v-if="avalid">
|
||||||
|
<!---->
|
||||||
|
<a-input @click="openModal" :placeholder="placeholder" v-model="showText" readOnly :disabled="disabled">
|
||||||
|
<a-icon slot="prefix" type="cluster" :title="title"/>
|
||||||
|
<a-icon v-if="showText" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
|
||||||
|
</a-input>
|
||||||
|
|
||||||
|
<j-popup-onl-report
|
||||||
|
ref="jPopupOnlReport"
|
||||||
|
:code="code"
|
||||||
|
:multi="multi"
|
||||||
|
:groupId="uniqGroupId"
|
||||||
|
@ok="callBack"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import JPopupOnlReport from './modal/JPopupOnlReport'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'JPopup',
|
||||||
|
components: {
|
||||||
|
JPopupOnlReport
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
code: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
field: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
orgFields: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
destFields: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
width: {
|
||||||
|
type: Number,
|
||||||
|
default: 1200,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: '请选择',
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
triggerChange: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
multi: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
/** 分组ID,用于将多个popup的请求合并到一起,不传不分组 */
|
||||||
|
groupId: String
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showText: '',
|
||||||
|
title: '',
|
||||||
|
avalid: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
uniqGroupId() {
|
||||||
|
if (this.groupId) {
|
||||||
|
let { groupId, code, field, orgFields, destFields } = this
|
||||||
|
return `${groupId}_${code}_${field}_${orgFields}_${destFields}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
immediate: true,
|
||||||
|
handler: function(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.showText = ''
|
||||||
|
} else {
|
||||||
|
this.showText = val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if (!this.orgFields || !this.destFields || !this.code) {
|
||||||
|
this.$message.error('popup参数未正确配置!')
|
||||||
|
this.avalid = false
|
||||||
|
}
|
||||||
|
if (this.destFields.split(',').length != this.orgFields.split(',').length) {
|
||||||
|
this.$message.error('popup参数未正确配置,原始值和目标值数量不一致!')
|
||||||
|
this.avalid = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openModal() {
|
||||||
|
if (this.disabled === false) {
|
||||||
|
this.$refs.jPopupOnlReport.show()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleEmpty() {
|
||||||
|
this.showText = ''
|
||||||
|
let destFieldsArr = this.destFields.split(',')
|
||||||
|
if (destFieldsArr.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let res = {}
|
||||||
|
for (let i = 0; i < destFieldsArr.length; i++) {
|
||||||
|
res[destFieldsArr[i]] = ''
|
||||||
|
}
|
||||||
|
if (this.triggerChange) {
|
||||||
|
this.$emit('callback', res)
|
||||||
|
} else {
|
||||||
|
this.$emit('input', '', res)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callBack(rows) {
|
||||||
|
// update--begin--autor:lvdandan-----date:20200630------for:多选时未带回多个值------
|
||||||
|
let orgFieldsArr = this.orgFields.split(',')
|
||||||
|
let destFieldsArr = this.destFields.split(',')
|
||||||
|
let resetText = false
|
||||||
|
if (this.field && this.field.length > 0) {
|
||||||
|
this.showText = ''
|
||||||
|
resetText = true
|
||||||
|
}
|
||||||
|
let res = {}
|
||||||
|
if (orgFieldsArr.length > 0) {
|
||||||
|
for (let i = 0; i < orgFieldsArr.length; i++) {
|
||||||
|
let tempDestArr = []
|
||||||
|
for(let rw of rows){
|
||||||
|
let val = rw[orgFieldsArr[i]]
|
||||||
|
if(!val){
|
||||||
|
val = ""
|
||||||
|
}
|
||||||
|
tempDestArr.push(val)
|
||||||
|
}
|
||||||
|
res[destFieldsArr[i]] = tempDestArr.join(",")
|
||||||
|
}
|
||||||
|
if (resetText === true) {
|
||||||
|
let tempText = []
|
||||||
|
for(let rw of rows){
|
||||||
|
let val = rw[orgFieldsArr[destFieldsArr.indexOf(this.field)]]
|
||||||
|
if(!val){
|
||||||
|
val = ""
|
||||||
|
}
|
||||||
|
tempText.push(val)
|
||||||
|
}
|
||||||
|
this.showText = tempText.join(",")
|
||||||
|
}
|
||||||
|
// update--end--autor:lvdandan-----date:20200630------for:多选时未带回多个值------
|
||||||
|
}
|
||||||
|
if (this.triggerChange) {
|
||||||
|
//v-dec时即triggerChange为true时 将整个对象给form页面 让他自己setFieldsValue
|
||||||
|
this.$emit('callback', res)
|
||||||
|
} else {
|
||||||
|
//v-model时 需要传一个参数field 表示当前这个字段 从而根据这个字段的顺序找到原始值
|
||||||
|
// this.$emit("input",row[orgFieldsArr[destFieldsArr.indexOf(this.field)]])
|
||||||
|
this.$emit('input', this.showText, res)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.components-input-demo-presuffix .anticon-close-circle {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #ccc;
|
||||||
|
transition: color 0.3s;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.components-input-demo-presuffix .anticon-close-circle:hover {
|
||||||
|
color: #f5222d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.components-input-demo-presuffix .anticon-close-circle:active {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -145,6 +145,10 @@
|
||||||
<j-date v-else-if=" item.type=='datetime' " v-model="item.val" placeholder="请选择时间" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"></j-date>
|
<j-date v-else-if=" item.type=='datetime' " v-model="item.val" placeholder="请选择时间" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"></j-date>
|
||||||
<a-time-picker v-else-if="item.type==='time'" :value="item.val ? moment(item.val,'HH:mm:ss') : null" format="HH:mm:ss" style="width: 100%" @change="(time,value)=>item.val=value"/>
|
<a-time-picker v-else-if="item.type==='time'" :value="item.val ? moment(item.val,'HH:mm:ss') : null" format="HH:mm:ss" style="width: 100%" @change="(time,value)=>item.val=value"/>
|
||||||
<a-input-number v-else-if=" item.type=='int'||item.type=='number' " style="width: 100%" placeholder="请输入数值" v-model="item.val"/>
|
<a-input-number v-else-if=" item.type=='int'||item.type=='number' " style="width: 100%" placeholder="请输入数值" v-model="item.val"/>
|
||||||
|
<a-select v-else-if="item.type=='switch'" placeholder="请选择" v-model="item.val">
|
||||||
|
<a-select-option value="Y">是</a-select-option>
|
||||||
|
<a-select-option value="N">否</a-select-option>
|
||||||
|
</a-select>
|
||||||
<a-input v-else v-model="item.val" placeholder="请输入值"/>
|
<a-input v-else v-model="item.val" placeholder="请输入值"/>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
|
@ -508,7 +512,16 @@
|
||||||
renderSaveTreeData(item) {
|
renderSaveTreeData(item) {
|
||||||
item.icon = this.treeIcon
|
item.icon = this.treeIcon
|
||||||
item.originTitle = item['title']
|
item.originTitle = item['title']
|
||||||
item.title = (fn, vNode) => {
|
item.title = (arg1, arg2) => {
|
||||||
|
let vNode
|
||||||
|
// 兼容旧版的Antdv
|
||||||
|
if (arg1.dataRef) {
|
||||||
|
vNode = arg1
|
||||||
|
} else if (arg2.dataRef) {
|
||||||
|
vNode = arg2
|
||||||
|
} else {
|
||||||
|
return <span style="color:red;">Antdv版本不支持</span>
|
||||||
|
}
|
||||||
let {originTitle} = vNode.dataRef
|
let {originTitle} = vNode.dataRef
|
||||||
return (
|
return (
|
||||||
<div class="j-history-tree-title">
|
<div class="j-history-tree-title">
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<a-switch v-model="checkStatus" :disabled="disabled" @change="handleChange"/>
|
<div>
|
||||||
|
<a-select v-if="query" style="width: 100%" @change="handleSelectChange">
|
||||||
|
<a-select-option v-for="(item, index) in queryOption" :key="index" :value="item.value">
|
||||||
|
{{ item.text }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<a-switch v-else v-model="checkStatus" :disabled="disabled" @change="handleChange"/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
@ -7,7 +14,7 @@
|
||||||
name: 'JSwitch',
|
name: 'JSwitch',
|
||||||
props: {
|
props: {
|
||||||
value:{
|
value:{
|
||||||
type: String,
|
type: String | Number,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
disabled:{
|
disabled:{
|
||||||
|
@ -19,6 +26,11 @@
|
||||||
type:Array,
|
type:Array,
|
||||||
required:false,
|
required:false,
|
||||||
default:()=>['Y','N']
|
default:()=>['Y','N']
|
||||||
|
},
|
||||||
|
query:{
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
@ -30,6 +42,7 @@
|
||||||
value:{
|
value:{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(val){
|
handler(val){
|
||||||
|
if(!this.query){
|
||||||
if(!val){
|
if(!val){
|
||||||
this.checkStatus = false
|
this.checkStatus = false
|
||||||
this.$emit('change', this.options[1]);
|
this.$emit('change', this.options[1]);
|
||||||
|
@ -41,12 +54,25 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
queryOption(){
|
||||||
|
let arr = []
|
||||||
|
arr.push({value:this.options[0],text:'是'})
|
||||||
|
arr.push({value:this.options[1],text:'否'})
|
||||||
|
return arr;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleChange(checked){
|
handleChange(checked){
|
||||||
let flag = checked===false?this.options[1]:this.options[0];
|
let flag = checked===false?this.options[1]:this.options[0];
|
||||||
this.$emit('change', flag);
|
this.$emit('change', flag);
|
||||||
|
},
|
||||||
|
handleSelectChange(value){
|
||||||
|
this.$emit('change', value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
|
|
|
@ -121,7 +121,6 @@
|
||||||
getAction(this.url_root,param).then(res=>{
|
getAction(this.url_root,param).then(res=>{
|
||||||
if(res.success){
|
if(res.success){
|
||||||
this.handleTreeNodeValue(res.result)
|
this.handleTreeNodeValue(res.result)
|
||||||
console.log("aaaa",res.result)
|
|
||||||
this.treeData = [...res.result]
|
this.treeData = [...res.result]
|
||||||
}else{
|
}else{
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
|
|
|
@ -236,7 +236,6 @@
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
let test=JSON.parse(mycondition);
|
let test=JSON.parse(mycondition);
|
||||||
console.log("aaaaasdsdd",typeof test)
|
|
||||||
if(typeof test == 'object' && test){
|
if(typeof test == 'object' && test){
|
||||||
resolve()
|
resolve()
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -225,7 +225,13 @@
|
||||||
let arr = [];
|
let arr = [];
|
||||||
|
|
||||||
for(var a=0;a<uploadFiles.length;a++){
|
for(var a=0;a<uploadFiles.length;a++){
|
||||||
|
// update-begin-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
|
||||||
|
if(uploadFiles[a].status === 'done' ) {
|
||||||
arr.push(uploadFiles[a].response.message)
|
arr.push(uploadFiles[a].response.message)
|
||||||
|
}else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// update-end-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
|
||||||
}
|
}
|
||||||
if(arr.length>0){
|
if(arr.length>0){
|
||||||
path = arr.join(",")
|
path = arr.join(",")
|
||||||
|
@ -279,12 +285,18 @@
|
||||||
//returnUrl为false时返回文件名称、文件路径及文件大小
|
//returnUrl为false时返回文件名称、文件路径及文件大小
|
||||||
this.newFileList = [];
|
this.newFileList = [];
|
||||||
for(var a=0;a<fileList.length;a++){
|
for(var a=0;a<fileList.length;a++){
|
||||||
|
// update-begin-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
|
||||||
|
if(fileList[a].status === 'done' ) {
|
||||||
var fileJson = {
|
var fileJson = {
|
||||||
fileName:fileList[a].name,
|
fileName:fileList[a].name,
|
||||||
filePath:fileList[a].response.message,
|
filePath:fileList[a].response.message,
|
||||||
fileSize:fileList[a].size
|
fileSize:fileList[a].size
|
||||||
};
|
};
|
||||||
this.newFileList.push(fileJson);
|
this.newFileList.push(fileJson);
|
||||||
|
}else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// update-end-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
|
||||||
}
|
}
|
||||||
this.$emit('change', this.newFileList);
|
this.$emit('change', this.newFileList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
# JPopup 弹窗选择组件
|
||||||
|
|
||||||
|
## 参数配置
|
||||||
|
| 参数 | 类型 | 必填 |说明|
|
||||||
|
|--------------|---------|----|---------|
|
||||||
|
| placeholder |string | | placeholder |
|
||||||
|
| code |string | | online报表编码 |
|
||||||
|
| orgFields |string | | online报表中显示的列,多个以逗号隔开 |
|
||||||
|
| destFields |string | | 回调对象的属性,多个以逗号隔开,其顺序和orgFields一一对应 |
|
||||||
|
| field |string | | v-model模式专用,表示从destFields中选择一个属性的值返回给当前组件 |
|
||||||
|
| triggerChange |Boolean | | v-decorator模式下需设置成true |
|
||||||
|
| callback(事件) |function | | 回调事件,v-decorator模式下用到,用于设置form控件的值 |
|
||||||
|
|
||||||
|
使用示例
|
||||||
|
----
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-form-item label="v-model模式指定一个值返回至当前组件" style="width: 300px">
|
||||||
|
<j-popup
|
||||||
|
v-model="selectValue"
|
||||||
|
code="user_msg"
|
||||||
|
org-fields="username,realname"
|
||||||
|
dest-fields="popup,other"
|
||||||
|
field="popup"/>
|
||||||
|
{{ selectValue }}
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label="v-decorator模式支持回调多个值至当前表单" style="width: 300px">
|
||||||
|
<j-popup
|
||||||
|
v-decorator="['one']"
|
||||||
|
:trigger-change="true"
|
||||||
|
code="user_msg"
|
||||||
|
org-fields="username,realname"
|
||||||
|
dest-fields="one,two"
|
||||||
|
@callback="popupCallback"/>
|
||||||
|
{{ getFormFieldValue('one') }}
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label="v-decorator模式被回调的值" style="width: 300px">
|
||||||
|
<a-input v-decorator="['two']"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</a-form >
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
selectValue:"",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
getFormFieldValue(field){
|
||||||
|
return this.form.getFieldValue(field)
|
||||||
|
},
|
||||||
|
popupCallback(row){
|
||||||
|
this.form.setFieldsValue(row)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,9 +1,11 @@
|
||||||
import JModal from './JModal'
|
import JModal from './JModal'
|
||||||
import JFormContainer from './JFormContainer.vue'
|
import JFormContainer from './JFormContainer.vue'
|
||||||
|
import JPopup from './JPopup.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install(Vue) {
|
install(Vue) {
|
||||||
Vue.component('JFormContainer', JFormContainer)
|
Vue.component('JFormContainer', JFormContainer)
|
||||||
|
Vue.component('JPopup', JPopup)
|
||||||
Vue.component(JModal.name, JModal)
|
Vue.component(JModal.name, JModal)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<a-popover trigger="contextmenu" v-model="visible" :placement="position">
|
<a-popover trigger="contextmenu" v-model="visible" :placement="position" overlayClassName="j-input-pop">
|
||||||
<!--"(node) => node.parentNode.parentNode"-->
|
<!--"(node) => node.parentNode.parentNode"-->
|
||||||
<div slot="title">
|
<div slot="title">
|
||||||
<span>{{ title }}</span>
|
<span>{{ title }}</span>
|
||||||
|
@ -7,11 +7,11 @@
|
||||||
<a-icon type="close" @click="visible=false"/>
|
<a-icon type="close" @click="visible=false"/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a-input :value="inputContent" @change="handleInputChange">
|
<a-input :value="inputContent" :disabled="disabled" @change="handleInputChange">
|
||||||
<a-icon slot="suffix" type="fullscreen" @click.stop="pop" />
|
<a-icon slot="suffix" type="fullscreen" @click.stop="pop" />
|
||||||
</a-input>
|
</a-input>
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<textarea :value="inputContent" @input="handleInputChange" :style="{ height: height + 'px', width: width + 'px' }"></textarea>
|
<textarea :value="inputContent" :disabled="disabled" @input="handleInputChange" :style="{ height: height + 'px', width: width + 'px' }"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
</template>
|
</template>
|
||||||
|
@ -48,7 +48,11 @@
|
||||||
type:String,
|
type:String,
|
||||||
default:'',
|
default:'',
|
||||||
required:false
|
required:false
|
||||||
}
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
|
|
|
@ -0,0 +1,326 @@
|
||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="modalWidth"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
wrapClassName="j-popup-modal"
|
||||||
|
@ok="handleSubmit"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
|
||||||
|
<div class="table-page-search-wrapper">
|
||||||
|
<a-form layout="inline" @keyup.enter.native="searchByquery">
|
||||||
|
<a-row :gutter="24" v-if="showSearchFlag">
|
||||||
|
<template v-for="(item,index) in queryInfo">
|
||||||
|
<template v-if=" item.hidden==='1' ">
|
||||||
|
<a-col :md="8" :sm="24" :key=" 'query'+index " v-show="toggleSearchStatus">
|
||||||
|
<online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
|
||||||
|
</a-col>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<a-col :md="8" :sm="24" :key=" 'query'+index ">
|
||||||
|
<online-query-form-item :queryParam="queryParam" :item="item" :dictOptions="dictOptions"></online-query-form-item>
|
||||||
|
</a-col>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<a-col :md="8" :sm="8">
|
||||||
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||||
|
<a-button type="primary" @click="searchByquery" icon="search">查询</a-button>
|
||||||
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||||
|
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||||
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||||
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||||
|
<i class="anticon anticon-info-circle ant-alert-icon"></i>
|
||||||
|
已选择 <a style="font-weight: 600">{{ table.selectedRowKeys.length }}</a>项
|
||||||
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||||
|
|
||||||
|
<a v-if="!showSearchFlag" style="margin-left: 24px" @click="onlyReload">刷新</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a-table
|
||||||
|
ref="table"
|
||||||
|
size="middle"
|
||||||
|
bordered
|
||||||
|
:rowKey="combineRowKey"
|
||||||
|
:columns="table.columns"
|
||||||
|
:dataSource="table.dataSource"
|
||||||
|
:pagination="table.pagination"
|
||||||
|
:loading="table.loading"
|
||||||
|
:rowSelection="{fixed:true,selectedRowKeys: table.selectedRowKeys, onChange: handleChangeInTableSelect}"
|
||||||
|
@change="handleChangeInTable"
|
||||||
|
style="min-height: 300px"
|
||||||
|
:scroll="tableScroll"
|
||||||
|
:customRow="clickThenCheck">
|
||||||
|
</a-table>
|
||||||
|
|
||||||
|
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAction } from '@/api/manage'
|
||||||
|
import {filterObj} from '@/utils/util'
|
||||||
|
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
|
||||||
|
import { httpGroupRequest } from '@/api/GroupRequest.js'
|
||||||
|
|
||||||
|
const MODAL_WIDTH = 1200;
|
||||||
|
export default {
|
||||||
|
name: 'JPopupOnlReport',
|
||||||
|
props: ['multi', 'code', 'groupId'],
|
||||||
|
components:{
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
visible:false,
|
||||||
|
title:"",
|
||||||
|
confirmLoading:false,
|
||||||
|
queryInfo:[],
|
||||||
|
toggleSearchStatus:false,
|
||||||
|
queryParam:{
|
||||||
|
|
||||||
|
},
|
||||||
|
dictOptions: {},
|
||||||
|
url: {
|
||||||
|
getColumns: '/online/cgreport/api/getRpColumns/',
|
||||||
|
getData: '/online/cgreport/api/getData/',
|
||||||
|
getQueryInfo: '/online/cgreport/api/getQueryInfo/'
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
loading: true,
|
||||||
|
// 表头
|
||||||
|
columns: [],
|
||||||
|
//数据集
|
||||||
|
dataSource: [],
|
||||||
|
// 选择器
|
||||||
|
selectedRowKeys: [],
|
||||||
|
selectionRows: [],
|
||||||
|
// 分页参数
|
||||||
|
pagination: {
|
||||||
|
current: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
pageSizeOptions: ['10', '20', '30'],
|
||||||
|
showTotal: (total, range) => {
|
||||||
|
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
||||||
|
},
|
||||||
|
showQuickJumper: true,
|
||||||
|
showSizeChanger: true,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cgRpConfigId:"",
|
||||||
|
modalWidth:MODAL_WIDTH,
|
||||||
|
tableScroll:{x:MODAL_WIDTH-100}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadColumnsInfo()
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
code() {
|
||||||
|
this.loadColumnsInfo()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
showSearchFlag(){
|
||||||
|
return this.queryInfo && this.queryInfo.length>0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
loadColumnsInfo(){
|
||||||
|
let url = `${this.url.getColumns}${this.code}`
|
||||||
|
//缓存key
|
||||||
|
let groupIdKey
|
||||||
|
if (this.groupId) {
|
||||||
|
groupIdKey = this.groupId + url
|
||||||
|
}
|
||||||
|
httpGroupRequest(() => getAction(url), groupIdKey).then(res => {
|
||||||
|
if(res.success){
|
||||||
|
this.initDictOptionData(res.result.dictOptions);
|
||||||
|
this.cgRpConfigId = res.result.cgRpConfigId
|
||||||
|
this.title = res.result.cgRpConfigName
|
||||||
|
let currColumns = res.result.columns
|
||||||
|
for(let a=0;a<currColumns.length;a++){
|
||||||
|
if(currColumns[a].customRender){
|
||||||
|
let dictCode = currColumns[a].customRender;
|
||||||
|
currColumns[a].customRender=(text)=>{
|
||||||
|
return filterMultiDictText(this.dictOptions[dictCode], text+"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.table.columns = [...currColumns]
|
||||||
|
this.initQueryInfo()
|
||||||
|
this.loadData(1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
initQueryInfo() {
|
||||||
|
let url = `${this.url.getQueryInfo}${this.cgRpConfigId}`
|
||||||
|
//缓存key
|
||||||
|
let groupIdKey
|
||||||
|
if (this.groupId) {
|
||||||
|
groupIdKey = this.groupId + url
|
||||||
|
}
|
||||||
|
httpGroupRequest(() => getAction(url), groupIdKey).then((res) => {
|
||||||
|
// console.log("获取查询条件", res);
|
||||||
|
if (res.success) {
|
||||||
|
this.queryInfo = res.result
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadData(arg) {
|
||||||
|
if (arg == 1) {
|
||||||
|
this.table.pagination.current = 1
|
||||||
|
}
|
||||||
|
let params = this.getQueryParams();//查询条件
|
||||||
|
this.table.loading = true
|
||||||
|
let url = `${this.url.getData}${this.cgRpConfigId}`
|
||||||
|
//缓存key
|
||||||
|
let groupIdKey
|
||||||
|
if (this.groupId) {
|
||||||
|
groupIdKey = this.groupId + url + JSON.stringify(params)
|
||||||
|
}
|
||||||
|
httpGroupRequest(() => getAction(url, params), groupIdKey).then(res => {
|
||||||
|
this.table.loading = false
|
||||||
|
// console.log("daa",res)
|
||||||
|
let data = res.result
|
||||||
|
if (data) {
|
||||||
|
this.table.pagination.total = Number(data.total)
|
||||||
|
this.table.dataSource = data.records
|
||||||
|
} else {
|
||||||
|
this.table.pagination.total = 0
|
||||||
|
this.table.dataSource = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryParams() {
|
||||||
|
let param = Object.assign({}, this.queryParam, this.sorter);
|
||||||
|
param.pageNo = this.table.pagination.current;
|
||||||
|
param.pageSize = this.table.pagination.pageSize;
|
||||||
|
return filterObj(param);
|
||||||
|
},
|
||||||
|
handleChangeInTableSelect(selectedRowKeys, selectionRows) {
|
||||||
|
this.table.selectedRowKeys = selectedRowKeys
|
||||||
|
this.table.selectionRows = selectionRows
|
||||||
|
},
|
||||||
|
handleChangeInTable(pagination, filters, sorter) {
|
||||||
|
//分页、排序、筛选变化时触发
|
||||||
|
if (Object.keys(sorter).length > 0) {
|
||||||
|
this.sorter.column = sorter.field
|
||||||
|
this.sorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
|
||||||
|
}
|
||||||
|
this.table.pagination = pagination
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
if(!this.multi){
|
||||||
|
if(this.table.selectionRows && this.table.selectionRows.length>1){
|
||||||
|
this.$message.warning("请选择一条记录")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!this.table.selectionRows || this.table.selectionRows.length==0){
|
||||||
|
this.$message.warning("请选择一条记录")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.$emit('ok', this.table.selectionRows);
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close');
|
||||||
|
this.visible = false;
|
||||||
|
this.onClearSelected()
|
||||||
|
},
|
||||||
|
show(){
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
handleToggleSearch(){
|
||||||
|
this.toggleSearchStatus = !this.toggleSearchStatus;
|
||||||
|
},
|
||||||
|
searchByquery(){
|
||||||
|
this.loadData(1);
|
||||||
|
},
|
||||||
|
onlyReload(){
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
|
searchReset(){
|
||||||
|
Object.keys(this.queryParam).forEach(key=>{
|
||||||
|
this.queryParam[key]=""
|
||||||
|
})
|
||||||
|
this.loadData(1);
|
||||||
|
},
|
||||||
|
onClearSelected(){
|
||||||
|
this.table.selectedRowKeys = []
|
||||||
|
this.table.selectionRows = []
|
||||||
|
},
|
||||||
|
combineRowKey(record){
|
||||||
|
let res = ''
|
||||||
|
Object.keys(record).forEach(key=>{
|
||||||
|
res+=record[key]
|
||||||
|
})
|
||||||
|
if(res.length>50){
|
||||||
|
res = res.substring(0,50)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
},
|
||||||
|
|
||||||
|
clickThenCheck(record){
|
||||||
|
return {
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
let rowKey = this.combineRowKey(record)
|
||||||
|
if(!this.table.selectedRowKeys || this.table.selectedRowKeys.length==0){
|
||||||
|
let arr1=[],arr2=[]
|
||||||
|
arr1.push(record)
|
||||||
|
arr2.push(rowKey)
|
||||||
|
this.table.selectedRowKeys=arr2
|
||||||
|
this.table.selectionRows=arr1
|
||||||
|
}else{
|
||||||
|
if(this.table.selectedRowKeys.indexOf(rowKey)<0){
|
||||||
|
this.table.selectedRowKeys.push(rowKey)
|
||||||
|
this.table.selectionRows.push(record)
|
||||||
|
}else{
|
||||||
|
let rowKey_index = this.table.selectedRowKeys.indexOf(rowKey)
|
||||||
|
this.table.selectedRowKeys.splice(rowKey_index,1);
|
||||||
|
this.table.selectionRows.splice(rowKey_index,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//防止字典中有垃圾数据
|
||||||
|
initDictOptionData(dictOptions){
|
||||||
|
let obj = { }
|
||||||
|
Object.keys(dictOptions).map(k=>{
|
||||||
|
obj[k] = dictOptions[k].filter(item=>{
|
||||||
|
return item!=null
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.dictOptions = obj
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,9 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<a-modal
|
<j-modal
|
||||||
centered
|
centered
|
||||||
:title="name + '选择'"
|
:title="name + '选择'"
|
||||||
:width="width"
|
:width="width"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
|
switchFullscreen
|
||||||
@ok="handleOk"
|
@ok="handleOk"
|
||||||
@cancel="close"
|
@cancel="close"
|
||||||
cancelText="关闭">
|
cancelText="关闭">
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-table
|
<a-table
|
||||||
size="small"
|
size="middle"
|
||||||
bordered
|
bordered
|
||||||
:rowKey="rowKey"
|
:rowKey="rowKey"
|
||||||
:columns="innerColumns"
|
:columns="innerColumns"
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-card :title="'已选' + name" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}">
|
<a-card :title="'已选' + name" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}">
|
||||||
|
|
||||||
<a-table size="small" :rowKey="rowKey" bordered v-bind="selectedTable">
|
<a-table size="middle" :rowKey="rowKey" bordered v-bind="selectedTable">
|
||||||
<span slot="action" slot-scope="text, record, index">
|
<span slot="action" slot-scope="text, record, index">
|
||||||
<a @click="handleDeleteSelected(record, index)">删除</a>
|
<a @click="handleDeleteSelected(record, index)">删除</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -58,7 +59,7 @@
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -118,12 +118,14 @@
|
||||||
deep: true,
|
deep: true,
|
||||||
handler(val) {
|
handler(val) {
|
||||||
let rows = val.map(key => this.dataSourceMap[key])
|
let rows = val.map(key => this.dataSourceMap[key])
|
||||||
this.$emit('select', rows)
|
|
||||||
let data = val.join(',')
|
let data = val.join(',')
|
||||||
|
if (data !== this.value) {
|
||||||
|
this.$emit('select', rows)
|
||||||
this.$emit('input', data)
|
this.$emit('input', data)
|
||||||
this.$emit('change', data)
|
this.$emit('change', data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleOptions(options, dataSourceMap) {
|
handleOptions(options, dataSourceMap) {
|
||||||
|
|
|
@ -76,6 +76,18 @@
|
||||||
methods:{
|
methods:{
|
||||||
initComp(departNames){
|
initComp(departNames){
|
||||||
this.departNames = departNames
|
this.departNames = departNames
|
||||||
|
//update-begin-author:lvdandan date:20200513 for:TESTA-438 部门选择组件自定义返回值,数据无法回填
|
||||||
|
//TODO 当返回字段为部门名称时会有问题,因为部门名称不唯一
|
||||||
|
//返回字段不为id时,根据返回字段获取id
|
||||||
|
if(this.customReturnField !== 'id' && this.value){
|
||||||
|
const dataList = this.$refs.innerDepartSelectModal.dataList;
|
||||||
|
console.log('this.value',this.value)
|
||||||
|
this.departIds = this.value.split(',').map(item => {
|
||||||
|
const data = dataList.filter(d=>d[this.customReturnField] === item)
|
||||||
|
return data.length > 0 ? data[0].id : ''
|
||||||
|
}).join(',')
|
||||||
|
}
|
||||||
|
//update-end-author:lvdandan date:20200513 for:TESTA-438 部门选择组件自定义返回值,数据无法回填
|
||||||
},
|
},
|
||||||
openModal(){
|
openModal(){
|
||||||
this.$refs.innerDepartSelectModal.show()
|
this.$refs.innerDepartSelectModal.show()
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
import JSelectBizComponent from './JSelectBizComponent'
|
import JSelectBizComponent from './JSelectBizComponent'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JSelectMultiUser',
|
name: 'JSelectRole',
|
||||||
components: { JSelectBizComponent },
|
components: { JSelectBizComponent },
|
||||||
props: ['value'],
|
props: ['value'],
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<a-modal
|
<j-modal
|
||||||
title="选择部门"
|
title="选择部门"
|
||||||
:width="modalWidth"
|
:width="modalWidth"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
:confirmLoading="confirmLoading"
|
:confirmLoading="confirmLoading"
|
||||||
@ok="handleSubmit"
|
@ok="handleSubmit"
|
||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
|
switchFullscreen
|
||||||
cancelText="关闭">
|
cancelText="关闭">
|
||||||
<a-spin tip="Loading..." :spinning="false">
|
<a-spin tip="Loading..." :spinning="false">
|
||||||
<a-input-search style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" @search="onSearch" />
|
<a-input-search style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" @search="onSearch" />
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
</a-tree>
|
</a-tree>
|
||||||
|
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<a-modal
|
<j-modal
|
||||||
:width="modalWidth"
|
:width="modalWidth"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
:title="title"
|
:title="title"
|
||||||
|
switchFullscreen
|
||||||
@ok="handleSubmit"
|
@ok="handleSubmit"
|
||||||
@cancel="close"
|
@cancel="close"
|
||||||
|
style="top:50px"
|
||||||
cancelText="关闭"
|
cancelText="关闭"
|
||||||
style="margin-top: -70px"
|
|
||||||
wrapClassName="ant-modal-cust-warp"
|
|
||||||
>
|
>
|
||||||
<a-row :gutter="10" style="background-color: #ececec; padding: 10px; margin: -10px">
|
<a-row :gutter="10" style="background-color: #ececec; padding: 10px; margin: -10px">
|
||||||
<a-col :md="6" :sm="24">
|
<a-col :md="6" :sm="24">
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -82,16 +82,19 @@
|
||||||
if (this.$route.path != indexKey) {
|
if (this.$route.path != indexKey) {
|
||||||
this.addIndexToFirst()
|
this.addIndexToFirst()
|
||||||
}
|
}
|
||||||
|
// 复制一个route对象出来,不能影响原route
|
||||||
|
let currentRoute = Object.assign({}, this.$route)
|
||||||
|
currentRoute.meta = Object.assign({}, currentRoute.meta)
|
||||||
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
|
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
|
||||||
let storeKey = 'route:title:' + this.$route.fullPath
|
let storeKey = 'route:title:' + currentRoute.fullPath
|
||||||
let routeTitle = this.$ls.get(storeKey)
|
let routeTitle = this.$ls.get(storeKey)
|
||||||
if (routeTitle) {
|
if (routeTitle) {
|
||||||
this.$route.meta.title = routeTitle
|
currentRoute.meta.title = routeTitle
|
||||||
}
|
}
|
||||||
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
|
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
|
||||||
this.pageList.push(this.$route)
|
this.pageList.push(currentRoute)
|
||||||
this.linkList.push(this.$route.fullPath)
|
this.linkList.push(currentRoute.fullPath)
|
||||||
this.activePage = this.$route.fullPath
|
this.activePage = currentRoute.fullPath
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
|
@ -126,8 +129,11 @@
|
||||||
'activePage': function(key) {
|
'activePage': function(key) {
|
||||||
let index = this.linkList.lastIndexOf(key)
|
let index = this.linkList.lastIndexOf(key)
|
||||||
let waitRouter = this.pageList[index]
|
let waitRouter = this.pageList[index]
|
||||||
this.$router.push(Object.assign({},waitRouter));
|
// 【TESTA-523】修复:不允许重复跳转路由异常
|
||||||
|
if (waitRouter.fullPath !== this.$route.fullPath) {
|
||||||
|
this.$router.push(Object.assign({}, waitRouter))
|
||||||
this.changeTitle(waitRouter.meta.title)
|
this.changeTitle(waitRouter.meta.title)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'multipage': function(newVal) {
|
'multipage': function(newVal) {
|
||||||
if(this.reloadFlag){
|
if(this.reloadFlag){
|
||||||
|
@ -352,7 +358,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-tabs {
|
.tab-layout-tabs.ant-tabs {
|
||||||
|
|
||||||
&.ant-tabs-card .ant-tabs-tab {
|
&.ant-tabs-card .ant-tabs-tab {
|
||||||
|
|
||||||
|
@ -380,7 +386,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-tabs.ant-tabs-card > .ant-tabs-bar {
|
.tab-layout-tabs.ant-tabs.ant-tabs-card > .ant-tabs-bar {
|
||||||
.ant-tabs-tab {
|
.ant-tabs-tab {
|
||||||
border: none !important;
|
border: none !important;
|
||||||
border-bottom: 1px solid transparent !important;
|
border-bottom: 1px solid transparent !important;
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</a-layout-header>
|
</a-layout-header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -58,7 +59,7 @@
|
||||||
components: {
|
components: {
|
||||||
UserMenu,
|
UserMenu,
|
||||||
SMenu,
|
SMenu,
|
||||||
Logo
|
Logo,
|
||||||
},
|
},
|
||||||
mixins: [mixin],
|
mixins: [mixin],
|
||||||
props: {
|
props: {
|
||||||
|
@ -96,7 +97,8 @@
|
||||||
topNavHeader: {},
|
topNavHeader: {},
|
||||||
headerIndexRight: {},
|
headerIndexRight: {},
|
||||||
topSmenuStyle: {}
|
topSmenuStyle: {}
|
||||||
}
|
},
|
||||||
|
chatStatus: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -131,10 +131,10 @@
|
||||||
//this.menus = this.mainRouters.find((item) => item.path === '/').children;
|
//this.menus = this.mainRouters.find((item) => item.path === '/').children;
|
||||||
this.menus = this.permissionMenuList
|
this.menus = this.permissionMenuList
|
||||||
// 根据后台配置菜单,重新排序加载路由信息
|
// 根据后台配置菜单,重新排序加载路由信息
|
||||||
console.log('----加载菜单逻辑----')
|
//console.log('----加载菜单逻辑----')
|
||||||
console.log(this.mainRouters)
|
//console.log(this.mainRouters)
|
||||||
console.log(this.permissionMenuList)
|
//console.log(this.permissionMenuList)
|
||||||
console.log('----navTheme------'+this.navTheme)
|
//console.log('----navTheme------'+this.navTheme)
|
||||||
//--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
|
//--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -124,7 +124,7 @@
|
||||||
// this.heartCheckFun();
|
// this.heartCheckFun();
|
||||||
},
|
},
|
||||||
destroyed: function () { // 离开页面生命周期函数
|
destroyed: function () { // 离开页面生命周期函数
|
||||||
this.websocketclose();
|
this.websocketOnclose();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
timerFun() {
|
timerFun() {
|
||||||
|
@ -186,10 +186,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toMyAnnouncement(){
|
toMyAnnouncement(){
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/isps/userAnnouncement',
|
path: '/isps/userAnnouncement'
|
||||||
name: 'isps-userAnnouncement'
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
modalFormOk(){
|
modalFormOk(){
|
||||||
|
@ -202,7 +200,7 @@
|
||||||
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||||
var userId = store.getters.userInfo.id;
|
var userId = store.getters.userInfo.id;
|
||||||
var url = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
|
var url = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
|
||||||
console.log(url);
|
//console.log(url);
|
||||||
this.websock = new WebSocket(url);
|
this.websock = new WebSocket(url);
|
||||||
this.websock.onopen = this.websocketOnopen;
|
this.websock.onopen = this.websocketOnopen;
|
||||||
this.websock.onerror = this.websocketOnerror;
|
this.websock.onerror = this.websocketOnerror;
|
||||||
|
@ -232,7 +230,10 @@
|
||||||
//this.heartCheck.reset().start();
|
//this.heartCheck.reset().start();
|
||||||
},
|
},
|
||||||
websocketOnclose: function (e) {
|
websocketOnclose: function (e) {
|
||||||
|
console.log("connection closed (" + e + ")");
|
||||||
|
if(e){
|
||||||
console.log("connection closed (" + e.code + ")");
|
console.log("connection closed (" + e.code + ")");
|
||||||
|
}
|
||||||
this.reconnect();
|
this.reconnect();
|
||||||
},
|
},
|
||||||
websocketSend(text) { // 数据发送
|
websocketSend(text) { // 数据发送
|
||||||
|
|
|
@ -62,6 +62,10 @@
|
||||||
<a-icon type="cluster"/>
|
<a-icon type="cluster"/>
|
||||||
<span>切换部门</span>
|
<span>切换部门</span>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
|
<a-menu-item key="6" @click="clearCache">
|
||||||
|
<a-icon type="sync"/>
|
||||||
|
<span>清理缓存</span>
|
||||||
|
</a-menu-item>
|
||||||
<!-- <a-menu-item key="2" disabled>
|
<!-- <a-menu-item key="2" disabled>
|
||||||
<a-icon type="setting"/>
|
<a-icon type="setting"/>
|
||||||
<span>测试</span>
|
<span>测试</span>
|
||||||
|
@ -94,7 +98,9 @@
|
||||||
import DepartSelect from './DepartSelect'
|
import DepartSelect from './DepartSelect'
|
||||||
import { mapActions, mapGetters,mapState } from 'vuex'
|
import { mapActions, mapGetters,mapState } from 'vuex'
|
||||||
import { mixinDevice } from '@/utils/mixin.js'
|
import { mixinDevice } from '@/utils/mixin.js'
|
||||||
import { getFileAccessHttpUrl } from "@/api/manage"
|
import { getFileAccessHttpUrl,getAction } from "@/api/manage"
|
||||||
|
import Vue from 'vue'
|
||||||
|
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "UserMenu",
|
name: "UserMenu",
|
||||||
|
@ -168,7 +174,9 @@
|
||||||
content: '真的要注销登录吗 ?',
|
content: '真的要注销登录吗 ?',
|
||||||
onOk() {
|
onOk() {
|
||||||
return that.Logout({}).then(() => {
|
return that.Logout({}).then(() => {
|
||||||
window.location.href="/";
|
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||||
|
that.$router.push({ path: '/user/login' });
|
||||||
|
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||||
//window.location.reload()
|
//window.location.reload()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
that.$message.error({
|
that.$message.error({
|
||||||
|
@ -214,9 +222,28 @@
|
||||||
this.$router.push({ path: route.path })
|
this.$router.push({ path: route.path })
|
||||||
}
|
}
|
||||||
this.searchMenuVisible = false
|
this.searchMenuVisible = false
|
||||||
}
|
},
|
||||||
// update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
|
// update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
|
||||||
/*update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
/*update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||||
|
/*update_begin author:liushaoqian date:20200507 for: 刷新缓存*/
|
||||||
|
clearCache(){
|
||||||
|
getAction("sys/dict/refleshCache").then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
//重新加载缓存
|
||||||
|
getAction("sys/dict/queryAllDictItems").then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
|
||||||
|
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$message.success("刷新缓存完成!");
|
||||||
|
}
|
||||||
|
}).catch(e=>{
|
||||||
|
this.$message.warn("刷新缓存失败!");
|
||||||
|
console.log("刷新失败",e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/*update_end author:liushaoqian date:20200507 for: 刷新缓存*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -64,7 +64,7 @@ const updateTheme = primaryColor => {
|
||||||
const lessConfigNode = document.createElement('script');
|
const lessConfigNode = document.createElement('script');
|
||||||
const lessScriptNode = document.createElement('script');
|
const lessScriptNode = document.createElement('script');
|
||||||
lessStyleNode.setAttribute('rel', 'stylesheet/less');
|
lessStyleNode.setAttribute('rel', 'stylesheet/less');
|
||||||
lessStyleNode.setAttribute('href', '/color.less');
|
lessStyleNode.setAttribute('href', __webpack_public_path__ + 'color.less')
|
||||||
lessConfigNode.innerHTML = `
|
lessConfigNode.innerHTML = `
|
||||||
window.less = {
|
window.less = {
|
||||||
async: true,
|
async: true,
|
||||||
|
|
|
@ -17,8 +17,8 @@ import Print from 'vue-print-nb-jeecg'
|
||||||
import preview from 'vue-photo-preview'
|
import preview from 'vue-photo-preview'
|
||||||
import 'vue-photo-preview/dist/skin.css'
|
import 'vue-photo-preview/dist/skin.css'
|
||||||
|
|
||||||
require('@jeecg/antd-online-beta220')
|
require('@jeecg/antd-online-mini')
|
||||||
require('@jeecg/antd-online-beta220/dist/OnlineForm.css')
|
require('@jeecg/antd-online-mini/dist/OnlineForm.css')
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ACCESS_TOKEN,
|
ACCESS_TOKEN,
|
||||||
|
|
|
@ -297,7 +297,8 @@ export const JeecgListMixin = {
|
||||||
return getFileAccessHttpUrl(text)
|
return getFileAccessHttpUrl(text)
|
||||||
},
|
},
|
||||||
/* 文件下载 */
|
/* 文件下载 */
|
||||||
uploadFile(text){
|
// update--autor:lvdandan-----date:20200630------for:修改下载文件方法名uploadFile改为downloadFile------
|
||||||
|
downloadFile(text){
|
||||||
if(!text){
|
if(!text){
|
||||||
this.$message.warning("未知的文件")
|
this.$message.warning("未知的文件")
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
import store from '@/store/'
|
||||||
|
export const WebsocketMixin = {
|
||||||
|
mounted() {
|
||||||
|
this.initWebSocket();
|
||||||
|
},
|
||||||
|
destroyed: function () {
|
||||||
|
// 离开页面生命周期函数
|
||||||
|
this.websocketOnclose();
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
initWebSocket: function () {
|
||||||
|
console.log("------------WebSocket连接成功");
|
||||||
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||||
|
var userId = store.getters.userInfo.id;
|
||||||
|
if(!this.socketUrl.startsWith('/')){
|
||||||
|
this.socketUrl = '/' + this.socketUrl
|
||||||
|
}
|
||||||
|
if(!this.socketUrl.endsWith('/')){
|
||||||
|
this.socketUrl = this.socketUrl + '/'
|
||||||
|
}
|
||||||
|
var url = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://") + this.socketUrl + userId;
|
||||||
|
this.websock = new WebSocket(url);
|
||||||
|
this.websock.onopen = this.websocketOnopen;
|
||||||
|
this.websock.onerror = this.websocketOnerror;
|
||||||
|
this.websock.onmessage = this.websocketOnmessage;
|
||||||
|
this.websock.onclose = this.websocketOnclose;
|
||||||
|
},
|
||||||
|
websocketOnopen: function () {
|
||||||
|
console.log("WebSocket连接成功");
|
||||||
|
},
|
||||||
|
websocketOnerror: function (e) {
|
||||||
|
console.log("WebSocket连接发生错误");
|
||||||
|
this.reconnect();
|
||||||
|
},
|
||||||
|
websocketOnclose: function (e) {
|
||||||
|
this.reconnect();
|
||||||
|
},
|
||||||
|
websocketSend(text) {
|
||||||
|
// 数据发送
|
||||||
|
try {
|
||||||
|
this.websock.send(text);
|
||||||
|
} catch (err) {
|
||||||
|
console.log("send failed (" + err.code + ")");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reconnect() {
|
||||||
|
var that = this;
|
||||||
|
if(that.lockReconnect) return;
|
||||||
|
that.lockReconnect = true;
|
||||||
|
//没连接上会一直重连,设置延迟避免请求过多
|
||||||
|
setTimeout(function () {
|
||||||
|
console.info("尝试重连...");
|
||||||
|
that.initWebSocket();
|
||||||
|
that.lockReconnect = false;
|
||||||
|
}, 5000);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -23,7 +23,7 @@ router.beforeEach((to, from, next) => {
|
||||||
if (store.getters.permissionList.length === 0) {
|
if (store.getters.permissionList.length === 0) {
|
||||||
store.dispatch('GetPermissionList').then(res => {
|
store.dispatch('GetPermissionList').then(res => {
|
||||||
const menuData = res.result.menu;
|
const menuData = res.result.menu;
|
||||||
console.log(res.message)
|
//console.log(res.message)
|
||||||
if (menuData === null || menuData === "" || menuData === undefined) {
|
if (menuData === null || menuData === "" || menuData === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,16 +2,6 @@ import Vue from 'vue'
|
||||||
import Router from 'vue-router'
|
import Router from 'vue-router'
|
||||||
import { constantRouterMap } from '@/config/router.config'
|
import { constantRouterMap } from '@/config/router.config'
|
||||||
|
|
||||||
//update-begin-author:taoyan date:20191011 for:TASK #3214 【优化】访问online功能测试 浏览器控制台抛出异常
|
|
||||||
try {
|
|
||||||
const originalPush = Router.prototype.push
|
|
||||||
Router.prototype.push = function push(location) {
|
|
||||||
return originalPush.call(this, location).catch(err => err)
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
//update-end-author:taoyan date:20191011 for:TASK #3214 【优化】访问online功能测试 浏览器控制台抛出异常
|
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
|
|
|
@ -60,7 +60,7 @@ const permission = {
|
||||||
SET_ROUTERS: (state, data) => {
|
SET_ROUTERS: (state, data) => {
|
||||||
state.addRouters = data
|
state.addRouters = data
|
||||||
state.routers = constantRouterMap.concat(data)
|
state.routers = constantRouterMap.concat(data)
|
||||||
console.log('-----mutations---SET_ROUTERS----', data)
|
//console.log('-----mutations---SET_ROUTERS----', data)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { login, logout, phoneLogin, thirdLogin } from "@/api/login"
|
import { login, logout, phoneLogin, thirdLogin } from "@/api/login"
|
||||||
import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH,UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH,UI_CACHE_DB_DICT_DATA,TENANT_ID } from "@/store/mutation-types"
|
||||||
import { welcome } from "@/utils/util"
|
import { welcome } from "@/utils/util"
|
||||||
import { queryPermissionsByUser } from '@/api/api'
|
import { queryPermissionsByUser } from '@/api/api'
|
||||||
import { getAction } from '@/api/manage'
|
import { getAction } from '@/api/manage'
|
||||||
|
@ -10,6 +10,7 @@ const user = {
|
||||||
token: '',
|
token: '',
|
||||||
username: '',
|
username: '',
|
||||||
realname: '',
|
realname: '',
|
||||||
|
tenantid:'',
|
||||||
welcome: '',
|
welcome: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
permissionList: [],
|
permissionList: [],
|
||||||
|
@ -34,6 +35,9 @@ const user = {
|
||||||
SET_INFO: (state, info) => {
|
SET_INFO: (state, info) => {
|
||||||
state.info = info
|
state.info = info
|
||||||
},
|
},
|
||||||
|
SET_TENANT: (state, id) => {
|
||||||
|
state.tenantid = id
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -133,7 +137,7 @@ const user = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(" menu show json ", menuData)
|
//console.log(" menu show json ", menuData)
|
||||||
//update--end--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
|
//update--end--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
|
||||||
commit('SET_PERMISSIONLIST', menuData)
|
commit('SET_PERMISSIONLIST', menuData)
|
||||||
} else {
|
} else {
|
||||||
|
@ -188,6 +192,11 @@ const user = {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
saveTenant({ commit }, id){
|
||||||
|
Vue.ls.set(TENANT_ID, id, 7 * 24 * 60 * 60 * 1000)
|
||||||
|
commit('SET_TENANT', id)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ export const ENCRYPTED_STRING = 'ENCRYPTED_STRING'
|
||||||
export const ENHANCE_PRE = 'enhance_'
|
export const ENHANCE_PRE = 'enhance_'
|
||||||
export const UI_CACHE_DB_DICT_DATA = 'UI_CACHE_DB_DICT_DATA'
|
export const UI_CACHE_DB_DICT_DATA = 'UI_CACHE_DB_DICT_DATA'
|
||||||
export const INDEX_MAIN_PAGE_PATH = "/dashboard/analysis"
|
export const INDEX_MAIN_PAGE_PATH = "/dashboard/analysis"
|
||||||
|
export const TENANT_ID = 'TENANT_ID'
|
||||||
|
|
||||||
export const CONTENT_WIDTH_TYPE = {
|
export const CONTENT_WIDTH_TYPE = {
|
||||||
Fluid: 'Fluid',
|
Fluid: 'Fluid',
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { getVmParentByName } from '@/utils/util'
|
||||||
|
|
||||||
const FormTypes = {
|
const FormTypes = {
|
||||||
normal: 'normal',
|
normal: 'normal',
|
||||||
input: 'input',
|
input: 'input',
|
||||||
|
@ -88,7 +90,7 @@ export function validateTables(cases, deleteTempId) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let tables = []
|
let tables = []
|
||||||
let index = 0;
|
let index = 0;
|
||||||
if(!cases || cases.length==0){
|
if(!cases || cases.length === 0){
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
(function next() {
|
(function next() {
|
||||||
|
@ -104,7 +106,13 @@ export function validateTables(cases, deleteTempId) {
|
||||||
}, error => {
|
}, error => {
|
||||||
// 出现未验证通过的表单,不再进行下一步校验,直接返回失败并跳转到该表格
|
// 出现未验证通过的表单,不再进行下一步校验,直接返回失败并跳转到该表格
|
||||||
if (error === VALIDATE_NO_PASSED) {
|
if (error === VALIDATE_NO_PASSED) {
|
||||||
reject({ error: VALIDATE_NO_PASSED, index })
|
// 尝试获取tabKey,如果在ATab组件内即可获取
|
||||||
|
let paneKey;
|
||||||
|
let tabPane = getVmParentByName(vm, 'ATabPane')
|
||||||
|
if (tabPane) {
|
||||||
|
paneKey = tabPane.$vnode.key
|
||||||
|
}
|
||||||
|
reject({error: VALIDATE_NO_PASSED, index, paneKey})
|
||||||
}
|
}
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
//判断是否IE<11浏览器
|
||||||
|
export function isIE() {
|
||||||
|
return navigator.userAgent.indexOf('compatible') > -1 && navigator.userAgent.indexOf('MSIE') > -1
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isIE11() {
|
||||||
|
return navigator.userAgent.indexOf('Trident') > -1 && navigator.userAgent.indexOf('rv:11.0') > -1
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断是否IE的Edge浏览器
|
||||||
|
export function isEdge() {
|
||||||
|
return navigator.userAgent.indexOf('Edge') > -1 && !isIE()
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getIEVersion() {
|
||||||
|
let userAgent = navigator.userAgent //取得浏览器的userAgent字符串
|
||||||
|
let isIE = isIE()
|
||||||
|
let isIE11 = isIE11()
|
||||||
|
let isEdge = isEdge()
|
||||||
|
|
||||||
|
if (isIE) {
|
||||||
|
let reIE = new RegExp('MSIE (\\d+\\.\\d+);')
|
||||||
|
reIE.test(userAgent)
|
||||||
|
let fIEVersion = parseFloat(RegExp['$1'])
|
||||||
|
if (fIEVersion === 7 || fIEVersion === 8 || fIEVersion === 9 || fIEVersion === 10) {
|
||||||
|
return fIEVersion
|
||||||
|
} else {
|
||||||
|
return 6//IE版本<7
|
||||||
|
}
|
||||||
|
} else if (isEdge) {
|
||||||
|
return 'edge'
|
||||||
|
} else if (isIE11) {
|
||||||
|
return 11
|
||||||
|
} else {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@ import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"
|
||||||
|
|
||||||
const hasPermission = {
|
const hasPermission = {
|
||||||
install (Vue, options) {
|
install (Vue, options) {
|
||||||
console.log(options);
|
//console.log(options);
|
||||||
Vue.directive('has', {
|
Vue.directive('has', {
|
||||||
inserted: (el, binding, vnode)=>{
|
inserted: (el, binding, vnode)=>{
|
||||||
console.log("页面权限控制----");
|
console.log("页面权限控制----");
|
||||||
|
|
|
@ -3,7 +3,7 @@ import axios from 'axios'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { VueAxios } from './axios'
|
import { VueAxios } from './axios'
|
||||||
import {Modal, notification} from 'ant-design-vue'
|
import {Modal, notification} from 'ant-design-vue'
|
||||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【指定 axios的 baseURL】
|
* 【指定 axios的 baseURL】
|
||||||
|
@ -12,7 +12,7 @@ import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||||
* @type {*|string}
|
* @type {*|string}
|
||||||
*/
|
*/
|
||||||
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
|
let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot";
|
||||||
console.log("apiBaseUrl= ",apiBaseUrl)
|
//console.log("apiBaseUrl= ",apiBaseUrl)
|
||||||
// 创建 axios 实例
|
// 创建 axios 实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
//baseURL: '/jeecg-boot',
|
//baseURL: '/jeecg-boot',
|
||||||
|
@ -22,6 +22,7 @@ const service = axios.create({
|
||||||
|
|
||||||
const err = (error) => {
|
const err = (error) => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
|
let that=this;
|
||||||
let data = error.response.data
|
let data = error.response.data
|
||||||
const token = Vue.ls.get(ACCESS_TOKEN)
|
const token = Vue.ls.get(ACCESS_TOKEN)
|
||||||
console.log("------异常响应------",token)
|
console.log("------异常响应------",token)
|
||||||
|
@ -45,7 +46,14 @@ const err = (error) => {
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
store.dispatch('Logout').then(() => {
|
store.dispatch('Logout').then(() => {
|
||||||
Vue.ls.remove(ACCESS_TOKEN)
|
Vue.ls.remove(ACCESS_TOKEN)
|
||||||
|
try {
|
||||||
|
let path=that.$route.path;
|
||||||
|
if(path.indexOf('/user/login')==-1){
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -86,6 +94,13 @@ service.interceptors.request.use(config => {
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
|
config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
|
||||||
}
|
}
|
||||||
|
//update-begin-author:taoyan date:2020707 for:多租户
|
||||||
|
let tenantid = Vue.ls.get(TENANT_ID)
|
||||||
|
if (!tenantid) {
|
||||||
|
tenantid = 0;
|
||||||
|
}
|
||||||
|
config.headers[ 'tenant_id' ] = tenantid
|
||||||
|
//update-end-author:taoyan date:2020707 for:多租户
|
||||||
if(config.method=='get'){
|
if(config.method=='get'){
|
||||||
if(config.url.indexOf("sys/dict/getDictItems")<0){
|
if(config.url.indexOf("sys/dict/getDictItems")<0){
|
||||||
config.params = {
|
config.params = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as api from '@/api/api'
|
import * as api from '@/api/api'
|
||||||
import { isURL } from '@/utils/validate'
|
import { isURL } from '@/utils/validate'
|
||||||
import onlineCommons from '@jeecg/antd-online-beta220'
|
import onlineCommons from '@jeecg/antd-online-mini'
|
||||||
|
|
||||||
export function timeFix() {
|
export function timeFix() {
|
||||||
const time = new Date()
|
const time = new Date()
|
||||||
|
@ -115,7 +115,6 @@ function generateChildRouters (data) {
|
||||||
item.meta.url = URL;
|
item.meta.url = URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//online菜单路由加载逻辑
|
|
||||||
let componentPath
|
let componentPath
|
||||||
if(item.component=="modules/online/cgform/OnlCgformHeadList"){
|
if(item.component=="modules/online/cgform/OnlCgformHeadList"){
|
||||||
componentPath = onlineCommons.OnlCgformHeadList
|
componentPath = onlineCommons.OnlCgformHeadList
|
||||||
|
@ -137,6 +136,7 @@ function generateChildRouters (data) {
|
||||||
componentPath = resolve => require(['@/' + component+'.vue'], resolve)
|
componentPath = resolve => require(['@/' + component+'.vue'], resolve)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let menu = {
|
let menu = {
|
||||||
path: item.path,
|
path: item.path,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
@ -478,3 +478,53 @@ export function replaceAll(text, checker, replacer) {
|
||||||
}
|
}
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取事件冒泡路径,兼容 IE11,Edge,Chrome,Firefox,Safari
|
||||||
|
* 目前使用的地方:JEditableTable Span模式
|
||||||
|
*/
|
||||||
|
export function getEventPath(event) {
|
||||||
|
let target = event.target
|
||||||
|
let path = (event.composedPath && event.composedPath()) || event.path
|
||||||
|
|
||||||
|
if (path != null) {
|
||||||
|
return (path.indexOf(window) < 0) ? path.concat(window) : path
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target === window) {
|
||||||
|
return [window]
|
||||||
|
}
|
||||||
|
|
||||||
|
let getParents = (node, memo) => {
|
||||||
|
memo = memo || []
|
||||||
|
const parentNode = node.parentNode
|
||||||
|
|
||||||
|
if (!parentNode) {
|
||||||
|
return memo
|
||||||
|
} else {
|
||||||
|
return getParents(parentNode, memo.concat(parentNode))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [target].concat(getParents(target), window)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据组件名获取父级
|
||||||
|
* @param vm
|
||||||
|
* @param name
|
||||||
|
* @returns {Vue | null|null|Vue}
|
||||||
|
*/
|
||||||
|
export function getVmParentByName(vm, name) {
|
||||||
|
let parent = vm.$parent
|
||||||
|
if (parent && parent.$options) {
|
||||||
|
if (parent.$options.name === name) {
|
||||||
|
return parent
|
||||||
|
} else {
|
||||||
|
let res = getVmParentByName(parent, name)
|
||||||
|
if (res) {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
<a-icon type="info-circle-o" />
|
<a-icon type="info-circle-o" />
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<div>
|
<div>
|
||||||
<mini-area :datasource="chartData.sll" />
|
<mini-area :data-source="chartData.sll" />
|
||||||
</div>
|
</div>
|
||||||
<template slot="footer">今日受理量:<span>{{ todaySll }}</span></template>
|
<template slot="footer">今日受理量:<span>{{ todaySll }}</span></template>
|
||||||
</chart-card>
|
</chart-card>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<a-icon type="info-circle-o" />
|
<a-icon type="info-circle-o" />
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<div>
|
<div>
|
||||||
<mini-area :datasource="chartData.bjl"/>
|
<mini-area :data-source="chartData.bjl"/>
|
||||||
</div>
|
</div>
|
||||||
<template slot="footer">今日办结量:<span>{{ todayBjl }}</span></template>
|
<template slot="footer">今日办结量:<span>{{ todayBjl }}</span></template>
|
||||||
</chart-card>
|
</chart-card>
|
||||||
|
|
|
@ -209,7 +209,6 @@
|
||||||
})
|
})
|
||||||
getVisitInfo().then(res=>{
|
getVisitInfo().then(res=>{
|
||||||
if(res.success){
|
if(res.success){
|
||||||
console.log("aaaaaa",res.result)
|
|
||||||
this.visitInfo = res.result;
|
this.visitInfo = res.result;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,7 +7,7 @@ const types = {
|
||||||
404: {
|
404: {
|
||||||
img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg',
|
img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg',
|
||||||
title: '404',
|
title: '404',
|
||||||
desc: '抱歉,你访问的页面不存在或仍在开发中'
|
desc: '抱歉,你访问的页面不存在或无权访问'
|
||||||
},
|
},
|
||||||
500: {
|
500: {
|
||||||
img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg',
|
img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg',
|
||||||
|
|
|
@ -0,0 +1,613 @@
|
||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="model" v-show="model">
|
||||||
|
<div class="model-show" @click="model = false">
|
||||||
|
<img :src="modelSrc" alt="" @click="model = false">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<div class="show-info">
|
||||||
|
<div class="test test1">
|
||||||
|
<vueCropper
|
||||||
|
ref="cropper"
|
||||||
|
:img="option.img"
|
||||||
|
:outputSize="option.size"
|
||||||
|
:outputType="option.outputType"
|
||||||
|
:info="true"
|
||||||
|
:full="option.full"
|
||||||
|
:canMove="option.canMove"
|
||||||
|
:canMoveBox="option.canMoveBox"
|
||||||
|
:fixedBox="option.fixedBox"
|
||||||
|
:original="option.original"
|
||||||
|
:autoCrop="option.autoCrop"
|
||||||
|
:autoCropWidth="option.autoCropWidth"
|
||||||
|
:autoCropHeight="option.autoCropHeight"
|
||||||
|
:centerBox="option.centerBox"
|
||||||
|
:high="option.high"
|
||||||
|
:infoTrue="option.infoTrue"
|
||||||
|
:maxImgSize="option.maxImgSize"
|
||||||
|
@realTime="realTime"
|
||||||
|
@imgLoad="imgLoad"
|
||||||
|
@cropMoving="cropMoving"
|
||||||
|
:enlarge="option.enlarge"
|
||||||
|
:mode="option.mode"
|
||||||
|
:limitMinSize="option.limitMinSize"
|
||||||
|
></vueCropper>
|
||||||
|
</div>
|
||||||
|
<div class="test-button">
|
||||||
|
<button @click="changeImg" class="btn">changeImg</button>
|
||||||
|
<label class="btn" for="uploads">upload</label>
|
||||||
|
<input type="file" id="uploads" style="position:absolute; clip:rect(0 0 0 0);" accept="image/png, image/jpeg, image/gif, image/jpg" @change="uploadImg($event, 1)" ref="uploadImg">
|
||||||
|
<button @click="startCrop" v-if="!crap" class="btn">start</button>
|
||||||
|
<button @click="stopCrop" v-else class="btn">stop</button>
|
||||||
|
<button @click="clearCrop" class="btn">clear</button>
|
||||||
|
<button @click="refreshCrop" class="btn">refresh</button>
|
||||||
|
<button @click="changeScale(1)" class="btn">+</button>
|
||||||
|
<button @click="changeScale(-1)" class="btn">-</button>
|
||||||
|
<button @click="rotateLeft" class="btn">rotateLeft</button>
|
||||||
|
<button @click="rotateRight" class="btn">rotateRight</button>
|
||||||
|
<button @click="finish('base64')" class="btn">preview(base64)</button>
|
||||||
|
<button @click="finish('blob')" class="btn">preview(blob)</button>
|
||||||
|
<button @click="() => option.img = ''" class="btn">清除图片</button>
|
||||||
|
<a @click="down('base64')" class="btn">download(base64)</a>
|
||||||
|
<a @click="down('blob')" class="btn">download(blob)</a>
|
||||||
|
<a :href="downImg" download="demo.png" ref="downloadDom"></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pre">
|
||||||
|
<section class="pre-item">
|
||||||
|
<p>截图框大小</p>
|
||||||
|
<div class="show-preview" :style="{'width': previews.w + 'px', 'height': previews.h + 'px', 'overflow': 'hidden',
|
||||||
|
'margin': '5px'}">
|
||||||
|
<div :style="previews.div">
|
||||||
|
<img :src="previews.url" :style="previews.img">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="pre-item">
|
||||||
|
<p>中等大小</p>
|
||||||
|
<div :style="previewStyle1">
|
||||||
|
<div :style="previews.div">
|
||||||
|
<img :src="previews.url" :style="previews.img">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="pre-item">
|
||||||
|
<p>迷你大小</p>
|
||||||
|
<div :style="previewStyle2">
|
||||||
|
<div :style="previews.div">
|
||||||
|
<img :src="previews.url" :style="previews.img">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="pre-item" title="zoom: (100 / previews.w)">
|
||||||
|
<p>固定为100宽度</p>
|
||||||
|
<div :style="previewStyle3">
|
||||||
|
<div :style="previews.div">
|
||||||
|
<img :src="previews.url" :style="previews.img">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="pre-item" title="zoom: (100 / previews.h)">
|
||||||
|
<p>固定为100高度</p>
|
||||||
|
<div :style="previewStyle4">
|
||||||
|
<div :style="previews.div">
|
||||||
|
<img :src="previews.url" :style="previews.img">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display:block; width: 100%;">
|
||||||
|
<label class="c-item">
|
||||||
|
<span>图片默认渲染方式</span>
|
||||||
|
<select v-model="option.mode">
|
||||||
|
<option value="contain">contain</option>
|
||||||
|
<option value="cover">cover</option>
|
||||||
|
<option value="400px auto">400px auto</option>
|
||||||
|
<option value="auto 400px">auto 400px</option>
|
||||||
|
<option value="50%">50%</option>
|
||||||
|
<option value="auto 50%">auto 50%</option>
|
||||||
|
</select>
|
||||||
|
<section>
|
||||||
|
类似css background属性设置 设置不符合规范不生效, 参照文档说明
|
||||||
|
</section>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>上传时图片最大大小(默认会压缩尺寸到这个大小)</span>
|
||||||
|
<input type="nubmer" v-model="option.maxImgSize">
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>上传图片是否显示原始宽高 (针对大图 可以铺满)</span>
|
||||||
|
<input type="checkbox" v-model="option.original">
|
||||||
|
<span>original: {{ option.original}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>是否根据dpr生成适合屏幕的高清图片</span>
|
||||||
|
<input type="checkbox" v-model="option.high">
|
||||||
|
<span>high: {{ option.high}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>是否输出原图比例的截图</span>
|
||||||
|
<input type="checkbox" v-model="option.full">
|
||||||
|
<span>full: {{ option.full}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>截图信息展示是否是真实的输出宽高</span>
|
||||||
|
<input type="checkbox" v-model="option.infoTrue">
|
||||||
|
<span>infoTrue: {{ option.infoTrue}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>能否拖动图片</span>
|
||||||
|
<input type="checkbox" v-model="option.canMove">
|
||||||
|
<span>canMove: {{ option.canMove}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>能否拖动截图框</span>
|
||||||
|
<input type="checkbox" v-model="option.canMoveBox">
|
||||||
|
<span>canMoveBox: {{ option.canMoveBox}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>截图框固定大小</span>
|
||||||
|
<input type="checkbox" v-model="option.fixedBox">
|
||||||
|
<span>fixedBox: {{ option.fixedBox}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>是否自动生成截图框</span>
|
||||||
|
<input type="checkbox" v-model="option.autoCrop">
|
||||||
|
<span>autoCrop: {{ option.autoCrop}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>自动生成截图框的宽高</span>
|
||||||
|
<span>宽度: </span><input type="number" v-model="option.autoCropWidth">
|
||||||
|
<span>高度: </span><input type="number" v-model="option.autoCropHeight">
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>截图框是否限制在图片里(只有在自动生成截图框时才能生效)</span>
|
||||||
|
<input type="checkbox" v-model="option.centerBox">
|
||||||
|
<span>centerBox: {{ option.centerBox}}</span>
|
||||||
|
</label>
|
||||||
|
<label class="c-item">
|
||||||
|
<span>是否按照截图框比例输出 默认为1 </span>
|
||||||
|
<input type="number" v-model="option.enlarge">
|
||||||
|
</label>
|
||||||
|
<p>输出图片格式</p>
|
||||||
|
<label class="c-item">
|
||||||
|
<label>jpg <input type="radio" name="type" value="jpeg" v-model="option.outputType"></label>
|
||||||
|
<label>png <input type="radio" name="type" value="png" v-model="option.outputType"></label>
|
||||||
|
<label>webp <input type="radio" name="type" value="webp" v-model="option.outputType"></label>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { VueCropper } from 'vue-cropper'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ImagCropper',
|
||||||
|
components: {
|
||||||
|
VueCropper
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
model: false,
|
||||||
|
modelSrc: "",
|
||||||
|
crap: false,
|
||||||
|
previews: {},
|
||||||
|
lists: [
|
||||||
|
{img: "https://avatars2.githubusercontent.com/u/15681693?s=460&v=4"},
|
||||||
|
{img: "http://cdn.xyxiao.cn/Landscape_1.jpg"},
|
||||||
|
{img: "http://cdn.xyxiao.cn/Landscape_2.jpg"},
|
||||||
|
{img: "http://cdn.xyxiao.cn/Landscape_3.jpg"},
|
||||||
|
{img: "http://cdn.xyxiao.cn/Landscape_4.jpg"},
|
||||||
|
{img: "http://cdn.xyxiao.cn/Portrait_1.jpg"},
|
||||||
|
{img: "http://cdn.xyxiao.cn/Portrait_2.jpg"}
|
||||||
|
],
|
||||||
|
option: {
|
||||||
|
img: "",
|
||||||
|
size: 1,
|
||||||
|
full: false,
|
||||||
|
outputType: "png",
|
||||||
|
canMove: true,
|
||||||
|
fixedBox: false,
|
||||||
|
original: false,
|
||||||
|
canMoveBox: true,
|
||||||
|
autoCrop: true,
|
||||||
|
// 只有自动截图开启 宽度高度才生效
|
||||||
|
autoCropWidth: 200,
|
||||||
|
autoCropHeight: 150,
|
||||||
|
centerBox: false,
|
||||||
|
high: false,
|
||||||
|
cropData: {},
|
||||||
|
enlarge: 1,
|
||||||
|
mode: 'contain',
|
||||||
|
maxImgSize: 3000,
|
||||||
|
limitMinSize: [100, 120]
|
||||||
|
},
|
||||||
|
example2: {
|
||||||
|
img: "http://cdn.xyxiao.cn/Landscape_2.jpg",
|
||||||
|
info: true,
|
||||||
|
size: 1,
|
||||||
|
outputType: "jpeg",
|
||||||
|
canScale: true,
|
||||||
|
autoCrop: true,
|
||||||
|
// 只有自动截图开启 宽度高度才生效
|
||||||
|
autoCropWidth: 300,
|
||||||
|
autoCropHeight: 250,
|
||||||
|
fixed: true,
|
||||||
|
// 真实的输出宽高
|
||||||
|
infoTrue: true,
|
||||||
|
fixedNumber: [4, 3]
|
||||||
|
},
|
||||||
|
example3: {
|
||||||
|
img: "http://cdn.xyxiao.cn/Landscape_1.jpg",
|
||||||
|
autoCrop: true,
|
||||||
|
autoCropWidth: 200,
|
||||||
|
autoCropHeight: 200,
|
||||||
|
fixedBox: true
|
||||||
|
},
|
||||||
|
downImg: "#",
|
||||||
|
previewStyle1: {},
|
||||||
|
previewStyle2: {},
|
||||||
|
previewStyle3: {},
|
||||||
|
previewStyle4: {},
|
||||||
|
code0: '',
|
||||||
|
code1: '',
|
||||||
|
code2: '',
|
||||||
|
code3: '',
|
||||||
|
preview3: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeImg() {
|
||||||
|
this.option.img = this.lists[~~(Math.random() * this.lists.length)].img;
|
||||||
|
},
|
||||||
|
startCrop() {
|
||||||
|
// start
|
||||||
|
this.crap = true;
|
||||||
|
this.$refs.cropper.startCrop();
|
||||||
|
},
|
||||||
|
stopCrop() {
|
||||||
|
// stop
|
||||||
|
this.crap = false;
|
||||||
|
this.$refs.cropper.stopCrop();
|
||||||
|
},
|
||||||
|
clearCrop() {
|
||||||
|
// clear
|
||||||
|
this.$refs.cropper.clearCrop();
|
||||||
|
},
|
||||||
|
refreshCrop() {
|
||||||
|
// clear
|
||||||
|
this.$refs.cropper.refresh();
|
||||||
|
},
|
||||||
|
changeScale(num) {
|
||||||
|
num = num || 1;
|
||||||
|
this.$refs.cropper.changeScale(num);
|
||||||
|
},
|
||||||
|
rotateLeft() {
|
||||||
|
this.$refs.cropper.rotateLeft();
|
||||||
|
},
|
||||||
|
rotateRight() {
|
||||||
|
this.$refs.cropper.rotateRight();
|
||||||
|
},
|
||||||
|
finish(type) {
|
||||||
|
if (type === "blob") {
|
||||||
|
this.$refs.cropper.getCropBlob(data => {
|
||||||
|
var img = window.URL.createObjectURL(data);
|
||||||
|
this.model = true;
|
||||||
|
this.modelSrc = img;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$refs.cropper.getCropData(data => {
|
||||||
|
this.model = true;
|
||||||
|
this.modelSrc = data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 实时预览函数
|
||||||
|
realTime(data) {
|
||||||
|
var previews = data;
|
||||||
|
var h = 0.5;
|
||||||
|
var w = 0.2;
|
||||||
|
|
||||||
|
this.previewStyle1 = {
|
||||||
|
width: previews.w + "px",
|
||||||
|
height: previews.h + "px",
|
||||||
|
overflow: "hidden",
|
||||||
|
margin: "0",
|
||||||
|
zoom: h
|
||||||
|
};
|
||||||
|
|
||||||
|
this.previewStyle2 = {
|
||||||
|
width: previews.w + "px",
|
||||||
|
height: previews.h + "px",
|
||||||
|
overflow: "hidden",
|
||||||
|
margin: "0",
|
||||||
|
zoom: w
|
||||||
|
};
|
||||||
|
|
||||||
|
this.previewStyle3 = {
|
||||||
|
width: previews.w + "px",
|
||||||
|
height: previews.h + "px",
|
||||||
|
overflow: "hidden",
|
||||||
|
margin: "0",
|
||||||
|
zoom: (100 / previews.w)
|
||||||
|
};
|
||||||
|
|
||||||
|
this.previewStyle4 = {
|
||||||
|
width: previews.w + "px",
|
||||||
|
height: previews.h + "px",
|
||||||
|
overflow: "hidden",
|
||||||
|
margin: "0",
|
||||||
|
zoom: (100 / previews.h)
|
||||||
|
};
|
||||||
|
|
||||||
|
this.previews = data;
|
||||||
|
},
|
||||||
|
|
||||||
|
finish2(type) {
|
||||||
|
this.$refs.cropper2.getCropData(data => {
|
||||||
|
this.model = true;
|
||||||
|
this.modelSrc = data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
finish3(type) {
|
||||||
|
this.$refs.cropper3.getCropData(data => {
|
||||||
|
this.model = true;
|
||||||
|
this.modelSrc = data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
down(type) {
|
||||||
|
// 输出
|
||||||
|
if (type === "blob") {
|
||||||
|
this.$refs.cropper.getCropBlob(data => {
|
||||||
|
this.downImg = window.URL.createObjectURL(data);
|
||||||
|
if (window.navigator.msSaveBlob) {
|
||||||
|
var blobObject = new Blob([data]);
|
||||||
|
window.navigator.msSaveBlob(blobObject, "demo.png");
|
||||||
|
} else {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.downloadDom.click();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$refs.cropper.getCropData(data => {
|
||||||
|
this.downImg = data;
|
||||||
|
if (window.navigator.msSaveBlob) {
|
||||||
|
var blobObject = new Blob([data]);
|
||||||
|
window.navigator.msSaveBlob(blobObject, "demo.png");
|
||||||
|
} else {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.downloadDom.click();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadImg(e, num) {
|
||||||
|
//上传图片
|
||||||
|
// this.option.img
|
||||||
|
var file = e.target.files[0];
|
||||||
|
if (!/\.(gif|jpg|jpeg|png|bmp|GIF|JPG|PNG)$/.test(e.target.value)) {
|
||||||
|
alert("图片类型必须是.gif,jpeg,jpg,png,bmp中的一种");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = e => {
|
||||||
|
let data;
|
||||||
|
if (typeof e.target.result === "object") {
|
||||||
|
// 把Array Buffer转化为blob 如果是base64不需要
|
||||||
|
data = window.URL.createObjectURL(new Blob([e.target.result]));
|
||||||
|
} else {
|
||||||
|
data = e.target.result;
|
||||||
|
}
|
||||||
|
if (num === 1) {
|
||||||
|
this.option.img = data;
|
||||||
|
} else if (num === 2) {
|
||||||
|
this.example2.img = data;
|
||||||
|
}
|
||||||
|
this.$refs.uploadImg.value = ''
|
||||||
|
};
|
||||||
|
// 转化为blob
|
||||||
|
reader.readAsArrayBuffer(file);
|
||||||
|
},
|
||||||
|
imgLoad(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
},
|
||||||
|
|
||||||
|
cropMoving(data) {
|
||||||
|
this.option.cropData = data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
VueCropper
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.changeImg();
|
||||||
|
var list = [].slice.call(document.querySelectorAll("pre code"));
|
||||||
|
list.forEach((val, index) => {
|
||||||
|
hljs.highlightBlock(val);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
margin: auto;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin-bottom: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.test-button {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #c0ccda;
|
||||||
|
color: #1f2d3d;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
outline: none;
|
||||||
|
margin: 20px 10px 0px 0px;
|
||||||
|
padding: 9px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #50bfff;
|
||||||
|
border-color: #50bfff;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
text-decoration: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.des {
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
code.language-html {
|
||||||
|
padding: 10px 20px;
|
||||||
|
margin: 10px 0px;
|
||||||
|
display: block;
|
||||||
|
background-color: #333;
|
||||||
|
color: #fff;
|
||||||
|
overflow-x: auto;
|
||||||
|
font-family: Consolas, Monaco, Droid, Sans, Mono, Source, Code, Pro, Menlo,
|
||||||
|
Lucida, Sans, Type, Writer, Ubuntu, Mono;
|
||||||
|
border-radius: 5px;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
.show-info {
|
||||||
|
margin-bottom: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.show-info h2 {
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
display: block;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1.5;
|
||||||
|
margin: 20px 0px;
|
||||||
|
background-image: -webkit-linear-gradient(
|
||||||
|
left,
|
||||||
|
#3498db,
|
||||||
|
#f47920 10%,
|
||||||
|
#d71345 20%,
|
||||||
|
#f7acbc 30%,
|
||||||
|
#ffd400 40%,
|
||||||
|
#3498db 50%,
|
||||||
|
#f47920 60%,
|
||||||
|
#d71345 70%,
|
||||||
|
#f7acbc 80%,
|
||||||
|
#ffd400 90%,
|
||||||
|
#3498db
|
||||||
|
);
|
||||||
|
color: transparent;
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
background-size: 200% 100%;
|
||||||
|
animation: slide 5s infinite linear;
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.test {
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.model {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 10;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: auto;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.model-show {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.model img {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
max-width: 80%;
|
||||||
|
width: auto;
|
||||||
|
user-select: none;
|
||||||
|
background-position: 0px 0px, 10px 10px;
|
||||||
|
background-size: 20px 20px;
|
||||||
|
background-image: linear-gradient(
|
||||||
|
45deg,
|
||||||
|
#eee 25%,
|
||||||
|
transparent 25%,
|
||||||
|
transparent 75%,
|
||||||
|
#eee 75%,
|
||||||
|
#eee 100%
|
||||||
|
),
|
||||||
|
linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.c-item {
|
||||||
|
display: block;
|
||||||
|
padding: 10px 0;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pre {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pre-item {
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slide {
|
||||||
|
0% {
|
||||||
|
background-position: 0 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: -100% 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1000px) {
|
||||||
|
.content {
|
||||||
|
max-width: 90%;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.test {
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -374,7 +374,7 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">输入的值(v-model):{{ formData.jInput }}</a-col>
|
<a-col :span="12">输入的值(v-model):{{ formData.jInput }}</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<!-- <a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :span="15">
|
<a-col :span="15">
|
||||||
<a-form-item label="MarkdownEditor" style="min-height: 300px">
|
<a-form-item label="MarkdownEditor" style="min-height: 300px">
|
||||||
<j-markdown-editor v-model="content"></j-markdown-editor>
|
<j-markdown-editor v-model="content"></j-markdown-editor>
|
||||||
|
@ -383,7 +383,7 @@
|
||||||
<a-col :span="9">
|
<a-col :span="9">
|
||||||
输入的值(v-model):{{ content }}
|
输入的值(v-model):{{ content }}
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>-->
|
</a-row>
|
||||||
|
|
||||||
<!-- 省市县级联 -->
|
<!-- 省市县级联 -->
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
|
@ -456,12 +456,14 @@
|
||||||
import JMultiSelectTag from '@comp/dict/JMultiSelectTag'
|
import JMultiSelectTag from '@comp/dict/JMultiSelectTag'
|
||||||
import JInput from '@comp/jeecg/JInput'
|
import JInput from '@comp/jeecg/JInput'
|
||||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||||
|
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SelectDemo',
|
name: 'SelectDemo',
|
||||||
inject:['closeCurrent'],
|
inject:['closeCurrent'],
|
||||||
components: {
|
components: {
|
||||||
|
JMarkdownEditor,
|
||||||
JAreaLinkage,
|
JAreaLinkage,
|
||||||
JInput,
|
JInput,
|
||||||
JCategorySelect,
|
JCategorySelect,
|
||||||
|
|
|
@ -268,6 +268,9 @@
|
||||||
},
|
},
|
||||||
delRowCustom (index) {
|
delRowCustom (index) {
|
||||||
console.log(index)
|
console.log(index)
|
||||||
|
let all = this.form.getFieldsValue()
|
||||||
|
all['jeecgOrderCustomerList'].splice(index,1);
|
||||||
|
this.form.setFieldsValue(all)
|
||||||
this.orderMainModel.jeecgOrderCustomerList.splice(index,1);
|
this.orderMainModel.jeecgOrderCustomerList.splice(index,1);
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
|
@ -278,6 +281,9 @@
|
||||||
},
|
},
|
||||||
delRowTicket (index) {
|
delRowTicket (index) {
|
||||||
console.log(index)
|
console.log(index)
|
||||||
|
let all = this.form.getFieldsValue()
|
||||||
|
all['jeecgOrderTicketList'].splice(index,1);
|
||||||
|
this.form.setFieldsValue(all)
|
||||||
this.orderMainModel.jeecgOrderTicketList.splice(index,1);
|
this.orderMainModel.jeecgOrderTicketList.splice(index,1);
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
:closable="true"
|
:closable="true"
|
||||||
@close="close"
|
@close="close"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
style="overflow: auto;padding-bottom: 53px;">
|
||||||
|
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<a-form :form="form">
|
<a-form :form="form">
|
||||||
|
|
|
@ -83,6 +83,7 @@
|
||||||
<a-dropdown>
|
<a-dropdown>
|
||||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
||||||
<a-menu slot="overlay">
|
<a-menu slot="overlay">
|
||||||
|
<a-menu-item><a @click="executeImmediately(record)">立即执行</a></a-menu-item>
|
||||||
<a-menu-item><a @click="handleEdit(record)">编辑</a></a-menu-item>
|
<a-menu-item><a @click="handleEdit(record)">编辑</a></a-menu-item>
|
||||||
<a-menu-item>
|
<a-menu-item>
|
||||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||||
|
@ -192,6 +193,7 @@
|
||||||
resume: "/sys/quartzJob/resume",
|
resume: "/sys/quartzJob/resume",
|
||||||
exportXlsUrl: "sys/quartzJob/exportXls",
|
exportXlsUrl: "sys/quartzJob/exportXls",
|
||||||
importExcelUrl: "sys/quartzJob/importExcel",
|
importExcelUrl: "sys/quartzJob/importExcel",
|
||||||
|
execute: "sys/quartzJob/execute"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -255,6 +257,25 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
executeImmediately(record){
|
||||||
|
var that = this;
|
||||||
|
//立即执行定时任务
|
||||||
|
this.$confirm({
|
||||||
|
title:"确认提示",
|
||||||
|
content:"是否立即执行任务?",
|
||||||
|
onOk: function(){
|
||||||
|
getAction(that.url.execute,{id:record.id}).then((res)=>{
|
||||||
|
if(res.success){
|
||||||
|
that.$message.success(res.message);
|
||||||
|
that.loadData();
|
||||||
|
that.onClearSelected();
|
||||||
|
}else{
|
||||||
|
that.$message.warning(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -63,7 +63,6 @@
|
||||||
<a @click="handleOpen(record)">用户</a>
|
<a @click="handleOpen(record)">用户</a>
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
|
||||||
|
|
||||||
<a-dropdown>
|
<a-dropdown>
|
||||||
<a class="ant-dropdown-link">
|
<a class="ant-dropdown-link">
|
||||||
更多 <a-icon type="down"/>
|
更多 <a-icon type="down"/>
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
<!-- 操作按钮区域 -->
|
<!-- 操作按钮区域 -->
|
||||||
<div class="table-operator">
|
<div class="table-operator">
|
||||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||||
<!--<a-button type="primary" icon="download" @click="handleExportXls('分类字典')">导出</a-button>
|
<a-button type="primary" icon="download" @click="handleExportXls('分类字典')">导出</a-button>
|
||||||
<a-upload name="file" :showUploadList="false" :multiple="false" :action="importExcelUrl" @change="handleImportExcel">
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||||
<a-button type="primary" icon="import">导入</a-button>
|
<a-button type="primary" icon="import">导入</a-button>
|
||||||
</a-upload>-->
|
</a-upload>
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
<a-menu slot="overlay">
|
<a-menu slot="overlay">
|
||||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
<template>
|
||||||
|
<a-card :bordered="false" style="height: 100%">
|
||||||
|
<div style="padding-bottom: 2px">
|
||||||
|
<a-alert type="warning" show-icon>
|
||||||
|
<div slot="message" style="width: 100%">
|
||||||
|
<span>路由配置请慎重</span>
|
||||||
|
<span style="display:inline-block;float:right;padding-right: 5px">
|
||||||
|
<a @click="clearRedis"><a-icon type="reload" />清除缓存</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a-alert>
|
||||||
|
</div>
|
||||||
|
<div :id="eleId" :style="{ height: editorHeight + 'px', width: '100%' }"></div>
|
||||||
|
<div style="text-align: center;padding-top:10px">
|
||||||
|
<a-button type="primary" @click="submitForm" style="width:160px">保存</a-button>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import JsonEditor from 'jsoneditor'
|
||||||
|
import 'jsoneditor/dist/jsoneditor.min.css'
|
||||||
|
import { getAction, postAction } from '@/api/manage'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "SysGatewayRouteList",
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
eleId:'jsoneditor',
|
||||||
|
description: 'gateway路由管理管理页面',
|
||||||
|
editor: null,
|
||||||
|
editorWidth:400,
|
||||||
|
editorHeight:500,
|
||||||
|
url:{
|
||||||
|
list: '/sys/gatewayRoute/list',
|
||||||
|
update: '/sys/gatewayRoute/updateAll',
|
||||||
|
clear: '/sys/gatewayRoute/clearRedis'
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
let winWidth = window.innerWidth;
|
||||||
|
console.log("页面宽度",winWidth)
|
||||||
|
this.editorWidth = winWidth
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.initJsonEditor();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initJsonEditor() {
|
||||||
|
let container = document.getElementById(this.eleId);
|
||||||
|
let options = {
|
||||||
|
modes: ['text', 'code', 'tree', 'form', 'view'],
|
||||||
|
mode: 'tree',
|
||||||
|
ace: ace,
|
||||||
|
sortObjectKeys: 'code',
|
||||||
|
mainMenuBar:['format']
|
||||||
|
};
|
||||||
|
this.editor = new JsonEditor(container, options);
|
||||||
|
this.initRouteData();
|
||||||
|
},
|
||||||
|
initRouteData(){
|
||||||
|
getAction(this.url.list).then(res=>{
|
||||||
|
if(res.success){
|
||||||
|
let array = res.result
|
||||||
|
console.log('当前路由配置信息为', array)
|
||||||
|
this.editor.set(array)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取json
|
||||||
|
submitForm() {
|
||||||
|
let text = this.editor.getText()
|
||||||
|
console.log("保存的json数据",text)
|
||||||
|
if(!text || text.length<=0 || text=='{}' || text=='[]'){
|
||||||
|
this.$message.warning('未录入任何信息')
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
postAction(this.url.update,{
|
||||||
|
routes:text
|
||||||
|
}).then(res=>{
|
||||||
|
if(res.success){
|
||||||
|
this.$message.success(res.message)
|
||||||
|
}else{
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clearRedis(){
|
||||||
|
getAction(this.url.clear).then(res=>{
|
||||||
|
if(res.success){
|
||||||
|
this.$message.success(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,165 @@
|
||||||
|
<template>
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 查询区域 -->
|
||||||
|
<div class="table-page-search-wrapper">
|
||||||
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!-- 查询区域-END -->
|
||||||
|
|
||||||
|
<!-- 操作按钮区域 -->
|
||||||
|
<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> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
||||||
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a-table
|
||||||
|
ref="table"
|
||||||
|
size="middle"
|
||||||
|
:scroll="{x:true}"
|
||||||
|
bordered
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:dataSource="dataSource"
|
||||||
|
:pagination="ipagination"
|
||||||
|
:loading="loading"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
|
class="j-table-force-nowrap"
|
||||||
|
@change="handleTableChange">
|
||||||
|
|
||||||
|
<template slot="htmlSlot" slot-scope="text">
|
||||||
|
<div v-html="text"></div>
|
||||||
|
</template>
|
||||||
|
<template slot="imgSlot" slot-scope="text">
|
||||||
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||||
|
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
||||||
|
</template>
|
||||||
|
<template slot="fileSlot" slot-scope="text">
|
||||||
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||||
|
<a-button
|
||||||
|
v-else
|
||||||
|
:ghost="true"
|
||||||
|
type="primary"
|
||||||
|
icon="download"
|
||||||
|
size="small"
|
||||||
|
@click="uploadFile(text)">
|
||||||
|
下载
|
||||||
|
</a-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<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 @click="handleDetail(record)">详情</a>
|
||||||
|
</a-menu-item>
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<tenant-modal ref="modalForm" @ok="modalFormOk"></tenant-modal>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import '@/assets/less/TableExpand.less'
|
||||||
|
import { mixinDevice } from '@/utils/mixin'
|
||||||
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||||
|
import TenantModal from './modules/TenantModal'
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TenantList",
|
||||||
|
mixins:[JeecgListMixin, mixinDevice],
|
||||||
|
components: {
|
||||||
|
TenantModal
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
description: 'adad管理页面',
|
||||||
|
// 表头
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title:'租户名称',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'name'
|
||||||
|
},{
|
||||||
|
title:'租户编号',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'id'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title:'开始时间',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'beginDate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title:'结束时间',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'endDate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title:'状态',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'status_dictText'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
align:"center",
|
||||||
|
fixed:"right",
|
||||||
|
width:147,
|
||||||
|
scopedSlots: { customRender: 'action' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
url: {
|
||||||
|
list: "/sys/tenant/list",
|
||||||
|
delete: "/sys/tenant/delete",
|
||||||
|
deleteBatch: "/sys/tenant/deleteBatch"
|
||||||
|
},
|
||||||
|
dictOptions:{},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
importExcelUrl: function(){
|
||||||
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initDictConfig(){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
</style>
|
|
@ -119,7 +119,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<!-- <a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>-->
|
|
||||||
<a @click="handleEdit(record)" >编辑</a>
|
<a @click="handleEdit(record)" >编辑</a>
|
||||||
|
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
|
@ -260,13 +259,7 @@
|
||||||
title: '部门',
|
title: '部门',
|
||||||
align: "center",
|
align: "center",
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex: 'orgCode'
|
dataIndex: 'orgCodeTxt'
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '负责部门',
|
|
||||||
align: "center",
|
|
||||||
width: 180,
|
|
||||||
dataIndex: 'departIds_dictText'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<template v-if="this.departId">
|
<template v-if="this.departId">
|
||||||
|
<a-spin :spinning="loading">
|
||||||
<a-form>
|
<a-form>
|
||||||
<a-form-item label='所拥有的权限'>
|
<a-form-item label='所拥有的权限'>
|
||||||
<a-tree
|
<a-tree
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
</a-tree>
|
</a-tree>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
<div class="anty-form-btn">
|
<div class="anty-form-btn">
|
||||||
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
|
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
|
||||||
<a-menu slot="overlay">
|
<a-menu slot="overlay">
|
||||||
|
@ -156,6 +158,7 @@
|
||||||
this.form.resetFields()
|
this.form.resetFields()
|
||||||
},
|
},
|
||||||
loadData(){
|
loadData(){
|
||||||
|
this.loading = true;
|
||||||
queryTreeListForRole().then((res) => {
|
queryTreeListForRole().then((res) => {
|
||||||
this.treeData = res.result.treeList
|
this.treeData = res.result.treeList
|
||||||
this.allTreeKeys = res.result.ids
|
this.allTreeKeys = res.result.ids
|
||||||
|
@ -176,6 +179,7 @@
|
||||||
this.halfCheckedKeys = [...halfCheckedKeys]
|
this.halfCheckedKeys = [...halfCheckedKeys]
|
||||||
this.defaultCheckedKeys = [...halfCheckedKeys, ...checkedKeys];
|
this.defaultCheckedKeys = [...halfCheckedKeys, ...checkedKeys];
|
||||||
this.expandedKeysss = this.allTreeKeys;
|
this.expandedKeysss = this.allTreeKeys;
|
||||||
|
this.loading = false;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
:closable="true"
|
:closable="true"
|
||||||
@close="close"
|
@close="close"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
style="overflow: auto;padding-bottom: 53px;">
|
||||||
|
|
||||||
<a-form>
|
<a-form>
|
||||||
<a-form-item label='所拥有的部门权限'>
|
<a-form-item label='所拥有的部门权限'>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
:closable="true"
|
:closable="true"
|
||||||
@close="close"
|
@close="close"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
style="overflow: auto;padding-bottom: 53px;">
|
||||||
|
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
this.form.resetFields();
|
this.form.resetFields();
|
||||||
this.model = Object.assign({}, record);
|
this.model = Object.assign({}, record);
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
getAction(this.url.getDeptRoleByUserId,{userId:this.userId}).then((res) => {
|
getAction(this.url.getDeptRoleByUserId,{userId:this.userId,departId:this.currentDeptId}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
var designName = [];
|
var designName = [];
|
||||||
for (let value of res.result) {
|
for (let value of res.result) {
|
||||||
|
|
|
@ -183,7 +183,7 @@
|
||||||
that.selectionRows=[];
|
that.selectionRows=[];
|
||||||
selectUser.forEach(function(record,index){
|
selectUser.forEach(function(record,index){
|
||||||
console.log(record)
|
console.log(record)
|
||||||
that.selectionRows.push({id: that.selectedRowKeys[index],realname:record})
|
that.selectionRows.push({id: that.selectedRowKeys[index],realname:record.label})
|
||||||
})
|
})
|
||||||
// this.selectionRows = selectUser;
|
// this.selectionRows = selectUser;
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,8 +108,10 @@
|
||||||
<a-select
|
<a-select
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
placeholder="请选择用户"
|
placeholder="请选择用户"
|
||||||
|
:labelInValue=true
|
||||||
v-model="selectedUser"
|
v-model="selectedUser"
|
||||||
@dropdownVisibleChange="selectUserIds"
|
@dropdownVisibleChange="selectUserIds"
|
||||||
|
@change="handleChange"
|
||||||
>
|
>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -166,7 +168,6 @@
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 21 },
|
sm: { span: 21 },
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
validatorRules:{
|
validatorRules:{
|
||||||
|
@ -187,6 +188,7 @@
|
||||||
selectedUser:[],
|
selectedUser:[],
|
||||||
disabled:false,
|
disabled:false,
|
||||||
msgContent:"",
|
msgContent:"",
|
||||||
|
userList:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
@ -210,15 +212,22 @@
|
||||||
this.userIds = record.userIds;
|
this.userIds = record.userIds;
|
||||||
getAction(this.url.queryByIds,{userIds:this.userIds}).then((res)=>{
|
getAction(this.url.queryByIds,{userIds:this.userIds}).then((res)=>{
|
||||||
if(res.success){
|
if(res.success){
|
||||||
|
//update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||||
|
var userList=[];
|
||||||
for(var i=0;i<res.result.length;i++){
|
for(var i=0;i<res.result.length;i++){
|
||||||
this.selectedUser.push(res.result[i].realname);
|
var user={};
|
||||||
|
user.label =res.result[i].realname;
|
||||||
|
user.key=res.result[i].id;
|
||||||
|
userList.push(user);
|
||||||
}
|
}
|
||||||
|
this.selectedUser=userList;
|
||||||
|
//update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||||
this.$refs.UserListModal.edit(res.result,this.userIds);
|
this.$refs.UserListModal.edit(res.result,this.userIds);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','sender','priority','msgCategory','msgType','sendStatus','delFlag','msgAbstract'))
|
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','priority','msgCategory','msgType','sendStatus','msgAbstract'))
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
close () {
|
close () {
|
||||||
|
@ -298,7 +307,12 @@
|
||||||
this.selectedUser = [];
|
this.selectedUser = [];
|
||||||
this.userIds = [];
|
this.userIds = [];
|
||||||
for(var i=0;i<userList.length;i++){
|
for(var i=0;i<userList.length;i++){
|
||||||
this.selectedUser.push(userList[i].realname);
|
//update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||||
|
var user={};
|
||||||
|
user.label =userList[i].realname;
|
||||||
|
user.key=userList[i].id;
|
||||||
|
this.selectedUser.push(user);
|
||||||
|
//update--end--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||||
this.userIds += userList[i].id+","
|
this.userIds += userList[i].id+","
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -321,8 +335,21 @@
|
||||||
}else{
|
}else{
|
||||||
callback("结束时间需大于开始时间")
|
callback("结束时间需大于开始时间")
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleChange(userList) {
|
||||||
|
if (userList) {
|
||||||
|
this.userIds = [];
|
||||||
|
var users=[];
|
||||||
|
for (var i = 0; i < userList.length; i++) {
|
||||||
|
var user={};
|
||||||
|
user.id=userList[i].key;
|
||||||
|
user.realname=userList[i].label;
|
||||||
|
this.userIds += userList[i].key + ',';
|
||||||
|
users.push(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$refs.UserListModal.edit(users,this.userIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
import { validateCheckRule } from '@/utils/util'
|
import { validateCheckRule } from '@/utils/util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SysCheckRuleModal',
|
name: 'SysCheckRuleTestModal',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
|
|
@ -0,0 +1,184 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<j-form-container :disabled="formDisabled">
|
||||||
|
<a-form :form="form" slot="detail">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="租户名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input v-decorator="['name']" placeholder="请输入租户名称"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="租户编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input-number style="width: 100%" :min="1" v-decorator="['id',{rules: [{ required: true, message: '请输入租户编号'}]}]" placeholder="请输入租户编号"></a-input-number>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-date placeholder="请选择开始时间" v-decorator="['beginDate']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-date placeholder="请选择结束时间" v-decorator="['endDate']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-radio-group name="tenantStatus" v-decorator="[ 'status', {initialValue:1}]">
|
||||||
|
<a-radio :value="1">正常</a-radio>
|
||||||
|
<a-radio :value="0">冻结</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
|
||||||
|
<a-button @click="submitForm">提 交</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</j-form-container>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { httpAction, getAction } from '@/api/manage'
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import { validateDuplicateValue } from '@/utils/util'
|
||||||
|
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||||
|
import JDate from '@/components/jeecg/JDate'
|
||||||
|
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TenantForm",
|
||||||
|
components: {
|
||||||
|
JFormContainer,
|
||||||
|
JDate,
|
||||||
|
JDictSelectTag,
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
formData: {
|
||||||
|
type: Object,
|
||||||
|
default: ()=>{},
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
normal: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
required: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 5 },
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 },
|
||||||
|
},
|
||||||
|
confirmLoading: false,
|
||||||
|
validatorRules: {
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
add: "/sys/tenant/add",
|
||||||
|
edit: "/sys/tenant/edit",
|
||||||
|
queryById: "/sys/tenant/queryById"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
formDisabled(){
|
||||||
|
if(this.normal===false){
|
||||||
|
if(this.formData.disabled===false){
|
||||||
|
return false
|
||||||
|
}else{
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.disabled
|
||||||
|
},
|
||||||
|
showFlowSubmitButton(){
|
||||||
|
if(this.normal===false){
|
||||||
|
if(this.formData.disabled===false){
|
||||||
|
return true
|
||||||
|
}else{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.showFlowData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add () {
|
||||||
|
this.edit({});
|
||||||
|
},
|
||||||
|
edit (record) {
|
||||||
|
this.form.resetFields();
|
||||||
|
this.model = Object.assign({}, record);
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model,'id','name','beginDate','endDate','status'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showFlowData(){
|
||||||
|
if(this.normal === false){
|
||||||
|
let params = {id:this.formData.dataId};
|
||||||
|
getAction(this.url.queryById,params).then((res)=>{
|
||||||
|
if(res.success){
|
||||||
|
this.edit (res.result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitForm () {
|
||||||
|
const that = this;
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
that.confirmLoading = true;
|
||||||
|
let httpurl = '';
|
||||||
|
let method = '';
|
||||||
|
if(!this.model.id){
|
||||||
|
httpurl+=this.url.add;
|
||||||
|
method = 'post';
|
||||||
|
}else{
|
||||||
|
httpurl+=this.url.edit;
|
||||||
|
method = 'put';
|
||||||
|
}
|
||||||
|
let formData = Object.assign(this.model, values);
|
||||||
|
console.log("表单提交数据",formData)
|
||||||
|
httpAction(httpurl,formData,method).then((res)=>{
|
||||||
|
if(res.success){
|
||||||
|
that.$message.success(res.message);
|
||||||
|
that.$emit('ok');
|
||||||
|
}else{
|
||||||
|
that.$message.warning(res.message);
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
that.confirmLoading = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
popupCallback(row){
|
||||||
|
this.form.setFieldsValue(pick(row, 'id', 'name','beginDate','endDate','status'))
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,60 @@
|
||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<tenant-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tenant-form>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import TenantForm from './TenantForm'
|
||||||
|
export default {
|
||||||
|
name: "TenantModal",
|
||||||
|
components: {
|
||||||
|
TenantForm
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
title:'',
|
||||||
|
width:800,
|
||||||
|
visible: false,
|
||||||
|
disableSubmit: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add () {
|
||||||
|
this.visible=true
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.realForm.add();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit (record) {
|
||||||
|
this.visible=true
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.realForm.edit(record);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.$emit('close');
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
handleOk () {
|
||||||
|
this.$refs.realForm.submitForm();
|
||||||
|
},
|
||||||
|
submitCallback(){
|
||||||
|
this.$emit('ok');
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
handleCancel () {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -7,7 +7,7 @@
|
||||||
:closable="true"
|
:closable="true"
|
||||||
@close="handleCancel"
|
@close="handleCancel"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||||
|
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<div style="width: 100%;">
|
<div style="width: 100%;">
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
<template v-if="!model.id">
|
<template v-if="!model.id">
|
||||||
<a-form-item label="登陆密码" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
<a-form-item label="登陆密码" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
||||||
<a-input type="password" placeholder="请输入登陆密码" v-decorator="[ 'password', validatorRules.password]" />
|
<a-input type="password" placeholder="请输入登陆密码" v-decorator="[ 'password']" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
<a-form-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
||||||
|
@ -72,6 +72,22 @@
|
||||||
<a-button slot="enterButton" icon="search">选择</a-button>
|
<a-button slot="enterButton" icon="search">选择</a-button>
|
||||||
</a-input-search>
|
</a-input-search>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
|
<!--租户分配-->
|
||||||
|
<a-form-item label="租户分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
|
||||||
|
|
||||||
|
<a-select
|
||||||
|
mode="multiple"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="请选择租户分配"
|
||||||
|
:disabled="disableSubmit"
|
||||||
|
v-model="currentTenant">
|
||||||
|
<a-select-option v-for="(item, index) in tenantList" :key="index" :value="item.id">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
<!-- update--begin--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ -->
|
<!-- update--begin--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ -->
|
||||||
<a-form-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
|
@ -253,14 +269,18 @@
|
||||||
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
|
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
|
||||||
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
|
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
|
||||||
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
|
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
|
||||||
|
queryTenantList: '/sys/tenant/queryList'
|
||||||
},
|
},
|
||||||
identity:"1",
|
identity:"1",
|
||||||
fileList:[],
|
fileList:[],
|
||||||
|
tenantList: [],
|
||||||
|
currentTenant:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
const token = Vue.ls.get(ACCESS_TOKEN);
|
const token = Vue.ls.get(ACCESS_TOKEN);
|
||||||
this.headers = {"X-Access-Token":token}
|
this.headers = {"X-Access-Token":token}
|
||||||
|
this.initTenantList()
|
||||||
|
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
|
@ -272,6 +292,13 @@
|
||||||
isDisabledAuth(code){
|
isDisabledAuth(code){
|
||||||
return disabledAuthFilter(code);
|
return disabledAuthFilter(code);
|
||||||
},
|
},
|
||||||
|
initTenantList(){
|
||||||
|
getAction(this.url.queryTenantList).then(res=>{
|
||||||
|
if(res.success){
|
||||||
|
this.tenantList = res.result
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//窗口最大化切换
|
//窗口最大化切换
|
||||||
toggleScreen(){
|
toggleScreen(){
|
||||||
if(this.modaltoggleFlag){
|
if(this.modaltoggleFlag){
|
||||||
|
@ -308,6 +335,7 @@
|
||||||
this.resultDepartOptions=[];
|
this.resultDepartOptions=[];
|
||||||
this.departId=[];
|
this.departId=[];
|
||||||
this.departIdShow=false;
|
this.departIdShow=false;
|
||||||
|
this.currentTenant = []
|
||||||
},
|
},
|
||||||
add () {
|
add () {
|
||||||
this.picUrl = "";
|
this.picUrl = "";
|
||||||
|
@ -343,6 +371,14 @@
|
||||||
// 调用查询用户对应的部门信息的方法
|
// 调用查询用户对应的部门信息的方法
|
||||||
that.checkedDepartKeys = [];
|
that.checkedDepartKeys = [];
|
||||||
that.loadCheckedDeparts();
|
that.loadCheckedDeparts();
|
||||||
|
|
||||||
|
//update-begin-author:taoyan date:2020710 for:多租户配置
|
||||||
|
if(!record.relTenantIds || record.relTenantIds.length==0){
|
||||||
|
this.currentTenant = []
|
||||||
|
}else{
|
||||||
|
this.currentTenant = record.relTenantIds.split(',').map(Number);
|
||||||
|
}
|
||||||
|
//update-end-author:taoyan date:2020710 for:多租户配置
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
loadCheckedDeparts(){
|
loadCheckedDeparts(){
|
||||||
|
@ -412,6 +448,9 @@
|
||||||
}else{
|
}else{
|
||||||
formData.avatar = null;
|
formData.avatar = null;
|
||||||
}
|
}
|
||||||
|
//update-begin-author:taoyan date:2020710 for:多租户配置
|
||||||
|
formData.relTenantIds = this.currentTenant.length>0?this.currentTenant.join(','):''
|
||||||
|
//update-end-author:taoyan date:2020710 for:多租户配置
|
||||||
formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
|
formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
|
||||||
formData.selecteddeparts = this.userDepartModel.departIdList.length>0?this.userDepartModel.departIdList.join(","):'';
|
formData.selecteddeparts = this.userDepartModel.departIdList.length>0?this.userDepartModel.departIdList.join(","):'';
|
||||||
formData.userIdentity=this.identity;
|
formData.userIdentity=this.identity;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
:closable="true"
|
:closable="true"
|
||||||
@close="close"
|
@close="close"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
style="overflow: auto;padding-bottom: 53px;">
|
||||||
|
|
||||||
<a-form>
|
<a-form>
|
||||||
<a-form-item label='所拥有的权限'>
|
<a-form-item label='所拥有的权限'>
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" style="width: 130%;text-align: center;margin-left:-10%">
|
<a-card :bordered="false" style="width: 130%;text-align: center;margin-left:-10%">
|
||||||
<a-steps class="steps" :current="currentTab">
|
<a-steps class="steps" :current="currentTab">
|
||||||
<a-step title="用户账户"/>
|
|
||||||
<a-step title="手机验证"/>
|
<a-step title="手机验证"/>
|
||||||
<a-step title="密码"/>
|
<a-step title="密码"/>
|
||||||
<a-step title="完成"/>
|
<a-step title="完成"/>
|
||||||
</a-steps>
|
</a-steps>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<step1 v-if="currentTab === 0" @nextStep="nextStep"/>
|
<step2 v-if="currentTab === 0" @nextStep="nextStep"/>
|
||||||
<step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
|
<step3 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
|
||||||
<step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
|
<step4 v-if="currentTab === 2" @prevStep="prevStep" @finish="finish" :userList="userList"/>
|
||||||
<step4 v-if="currentTab === 3" @prevStep="prevStep" @finish="finish" :userList="userList"/>
|
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -9,16 +9,16 @@
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
size="large"
|
size="large"
|
||||||
v-decorator="['username',{initialValue:'admin', rules: validatorRules.username.rules}]"
|
v-decorator="['username',validatorRules.username,{ validator: this.handleUsernameOrEmail }]"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="请输入帐户名 / admin">
|
placeholder="请输入帐户名 / jeecg">
|
||||||
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
v-decorator="['password',{initialValue:'123456', rules: validatorRules.password.rules}]"
|
v-decorator="['password',validatorRules.password]"
|
||||||
size="large"
|
size="large"
|
||||||
type="password"
|
type="password"
|
||||||
autocomplete="false"
|
autocomplete="false"
|
||||||
|
@ -118,46 +118,7 @@
|
||||||
:visible="stepCaptchaVisible"
|
:visible="stepCaptchaVisible"
|
||||||
@success="stepCaptchaSuccess"
|
@success="stepCaptchaSuccess"
|
||||||
@cancel="stepCaptchaCancel"></two-step-captcha>
|
@cancel="stepCaptchaCancel"></two-step-captcha>
|
||||||
|
<login-select-modal ref="loginSelect" @success="loginSelectOk"></login-select-modal>
|
||||||
<a-modal
|
|
||||||
title="登录部门选择"
|
|
||||||
:width="450"
|
|
||||||
:visible="departVisible"
|
|
||||||
:closable="false"
|
|
||||||
:maskClosable="false">
|
|
||||||
|
|
||||||
<template slot="footer">
|
|
||||||
<a-button type="primary" @click="departOk">确认</a-button>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<a-form>
|
|
||||||
<a-form-item
|
|
||||||
:labelCol="{span:4}"
|
|
||||||
:wrapperCol="{span:20}"
|
|
||||||
style="margin-bottom:10px"
|
|
||||||
:validate-status="validate_status">
|
|
||||||
<a-tooltip placement="topLeft" >
|
|
||||||
<template slot="title">
|
|
||||||
<span>您隶属于多部门,请选择登录部门</span>
|
|
||||||
</template>
|
|
||||||
<a-avatar style="backgroundColor:#87d068" icon="gold" />
|
|
||||||
</a-tooltip>
|
|
||||||
<a-select @change="departChange" :class="{'valid-error':validate_status=='error'}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
|
|
||||||
<a-icon slot="suffixIcon" type="gold" />
|
|
||||||
<a-select-option
|
|
||||||
v-for="d in departList"
|
|
||||||
:key="d.id"
|
|
||||||
:value="d.orgCode">
|
|
||||||
{{ d.departName }}
|
|
||||||
</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a-modal>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -173,10 +134,12 @@
|
||||||
import { encryption , getEncryptedString } from '@/utils/encryption/aesEncrypt'
|
import { encryption , getEncryptedString } from '@/utils/encryption/aesEncrypt'
|
||||||
import store from '@/store/'
|
import store from '@/store/'
|
||||||
import { USER_INFO } from "@/store/mutation-types"
|
import { USER_INFO } from "@/store/mutation-types"
|
||||||
|
import LoginSelectModal from './LoginSelectModal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
TwoStepCaptcha
|
TwoStepCaptcha,
|
||||||
|
LoginSelectModal
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
@ -205,12 +168,7 @@
|
||||||
verifiedCode:"",
|
verifiedCode:"",
|
||||||
inputCodeContent:"",
|
inputCodeContent:"",
|
||||||
inputCodeNull:true,
|
inputCodeNull:true,
|
||||||
|
|
||||||
departList:[],
|
|
||||||
departVisible:false,
|
|
||||||
departSelected:"",
|
|
||||||
currentUsername:"",
|
currentUsername:"",
|
||||||
validate_status:"",
|
|
||||||
currdatetime:'',
|
currdatetime:'',
|
||||||
randCodeImage:'',
|
randCodeImage:'',
|
||||||
requestCodeSuccess:false
|
requestCodeSuccess:false
|
||||||
|
@ -281,7 +239,7 @@
|
||||||
loginParams.checkKey = that.currdatetime
|
loginParams.checkKey = that.currdatetime
|
||||||
console.log("登录参数",loginParams)
|
console.log("登录参数",loginParams)
|
||||||
that.Login(loginParams).then((res) => {
|
that.Login(loginParams).then((res) => {
|
||||||
this.departConfirm(res)
|
this.$refs.loginSelect.show(res.result)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
that.requestFailed(err);
|
that.requestFailed(err);
|
||||||
});
|
});
|
||||||
|
@ -300,7 +258,7 @@
|
||||||
loginParams.remember_me = values.rememberMe
|
loginParams.remember_me = values.rememberMe
|
||||||
that.PhoneLogin(loginParams).then((res) => {
|
that.PhoneLogin(loginParams).then((res) => {
|
||||||
console.log(res.result);
|
console.log(res.result);
|
||||||
this.departConfirm(res)
|
this.$refs.loginSelect.show(res.result)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
that.requestFailed(err);
|
that.requestFailed(err);
|
||||||
})
|
})
|
||||||
|
@ -376,7 +334,9 @@
|
||||||
// update-begin- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
// update-begin- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||||
// this.loginBtn = false
|
// this.loginBtn = false
|
||||||
// update-end- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
// update-end- author:sunjianlei --- date:20190812 --- for: 登录成功后不解除禁用按钮,防止多次点击
|
||||||
this.$router.push({ path: "/dashboard/analysis" })
|
this.$router.push({ path: "/dashboard/analysis" }).catch(()=>{
|
||||||
|
console.log('登录跳转首页出错,这个错误从哪里来的')
|
||||||
|
})
|
||||||
this.$notification.success({
|
this.$notification.success({
|
||||||
message: '欢迎',
|
message: '欢迎',
|
||||||
description: `${timeFix()},欢迎回来`,
|
description: `${timeFix()},欢迎回来`,
|
||||||
|
@ -418,64 +378,8 @@
|
||||||
inputCodeChange(e){
|
inputCodeChange(e){
|
||||||
this.inputCodeContent = e.target.value
|
this.inputCodeContent = e.target.value
|
||||||
},
|
},
|
||||||
departConfirm(res){
|
loginSelectOk(){
|
||||||
if(res.success){
|
|
||||||
let multi_depart = res.result.multi_depart
|
|
||||||
//0:无部门 1:一个部门 2:多个部门
|
|
||||||
if(multi_depart==0){
|
|
||||||
this.loginSuccess()
|
this.loginSuccess()
|
||||||
this.$notification.warn({
|
|
||||||
message: '提示',
|
|
||||||
description: `您尚未归属部门,请确认账号信息`,
|
|
||||||
duration:3
|
|
||||||
});
|
|
||||||
}else if(multi_depart==2){
|
|
||||||
this.departVisible=true
|
|
||||||
this.currentUsername=this.form.getFieldValue("username")
|
|
||||||
this.departList = res.result.departs
|
|
||||||
}else {
|
|
||||||
this.loginSuccess()
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
this.requestFailed(res)
|
|
||||||
this.Logout();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
departOk(){
|
|
||||||
if(!this.departSelected){
|
|
||||||
this.validate_status='error'
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
let obj = {
|
|
||||||
orgCode:this.departSelected,
|
|
||||||
username:this.form.getFieldValue("username")
|
|
||||||
}
|
|
||||||
putAction("/sys/selectDepart",obj).then(res=>{
|
|
||||||
if(res.success){
|
|
||||||
const userInfo = res.result.userInfo;
|
|
||||||
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000);
|
|
||||||
store.commit('SET_INFO', userInfo);
|
|
||||||
//console.log("---切换组织机构---userInfo-------",store.getters.userInfo.orgCode);
|
|
||||||
this.departClear()
|
|
||||||
this.loginSuccess()
|
|
||||||
}else{
|
|
||||||
this.requestFailed(res)
|
|
||||||
this.Logout().then(()=>{
|
|
||||||
this.departClear()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
departClear(){
|
|
||||||
this.departList=[]
|
|
||||||
this.departSelected=""
|
|
||||||
this.currentUsername=""
|
|
||||||
this.departVisible=false
|
|
||||||
this.validate_status=''
|
|
||||||
},
|
|
||||||
departChange(value){
|
|
||||||
this.validate_status='success'
|
|
||||||
this.departSelected = value
|
|
||||||
},
|
},
|
||||||
getRouterData(){
|
getRouterData(){
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|
|
@ -0,0 +1,210 @@
|
||||||
|
<template>
|
||||||
|
<a-modal
|
||||||
|
:title="title"
|
||||||
|
:width="450"
|
||||||
|
:visible="visible"
|
||||||
|
:closable="false"
|
||||||
|
:maskClosable="false">
|
||||||
|
|
||||||
|
<template slot="footer">
|
||||||
|
<a-button type="primary" @click="selectOk">确认</a-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<a-form>
|
||||||
|
<a-form-item v-if="isMultiTenant" :labelCol="{span:4}" :wrapperCol="{span:20}" style="margin-bottom:10px" :validate-status="validate_status1">
|
||||||
|
<a-tooltip placement="topLeft" >
|
||||||
|
<template slot="title">
|
||||||
|
<span>您有多个租户,请选择登录租户</span>
|
||||||
|
</template>
|
||||||
|
<a-avatar style="backgroundColor:#87d068" icon="gold" />
|
||||||
|
</a-tooltip>
|
||||||
|
|
||||||
|
<a-select @change="handleTenantChange" :class="{'valid-error':validate_status1=='error'}" placeholder="请选择登录租户" style="margin-left:10px;width: 80%">
|
||||||
|
<a-icon slot="suffixIcon" type="gold" />
|
||||||
|
<a-select-option v-for="d in tenantList" :key="d.id" :value="d.id">
|
||||||
|
{{ d.name }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<a-form-item v-if="isMultiDepart" :labelCol="{span:4}" :wrapperCol="{span:20}" style="margin-bottom:10px" :validate-status="validate_status2">
|
||||||
|
<a-tooltip placement="topLeft" >
|
||||||
|
<template slot="title">
|
||||||
|
<span>您有多个部门,请选择登录部门</span>
|
||||||
|
</template>
|
||||||
|
<a-avatar style="backgroundColor:rgb(104, 208, 203);" icon="gold" />
|
||||||
|
</a-tooltip>
|
||||||
|
|
||||||
|
<a-select @change="handleDepartChange" :class="{'valid-error':validate_status2=='error'}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
|
||||||
|
<a-icon slot="suffixIcon" type="gold" />
|
||||||
|
<a-select-option v-for="d in departList" :key="d.id" :value="d.orgCode">
|
||||||
|
{{ d.departName }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
</a-form>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import Vue from 'vue'
|
||||||
|
import { getAction,putAction } from '@/api/manage'
|
||||||
|
import { USER_INFO } from "@/store/mutation-types"
|
||||||
|
import store from './Login'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LoginSelectModal',
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
isMultiDepart:false,
|
||||||
|
departList:[],
|
||||||
|
|
||||||
|
isMultiTenant:false,
|
||||||
|
tenantList:[],
|
||||||
|
|
||||||
|
username:'',
|
||||||
|
orgCode:'',
|
||||||
|
tenant_id:'',
|
||||||
|
|
||||||
|
validate_status1: "",
|
||||||
|
validate_status2: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
title(){
|
||||||
|
if(this.isMultiDepart && this.isMultiTenant){
|
||||||
|
return '请选择租户和部门'
|
||||||
|
}else if(this.isMultiDepart && !this.isMultiTenant){
|
||||||
|
return '请选择部门'
|
||||||
|
}else if(!this.isMultiDepart && this.isMultiTenant){
|
||||||
|
return '请选择租户'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
clear(){
|
||||||
|
this.departList = []
|
||||||
|
this.tenantList = []
|
||||||
|
this.visible=false
|
||||||
|
this.validate_status1=''
|
||||||
|
this.validate_status2=''
|
||||||
|
},
|
||||||
|
bizDepart(loginResult){
|
||||||
|
let multi_depart = loginResult.multi_depart
|
||||||
|
//0:无部门 1:一个部门 2:多个部门
|
||||||
|
if(multi_depart==0){
|
||||||
|
this.$notification.warn({
|
||||||
|
message: '提示',
|
||||||
|
description: `您尚未归属部门,请确认账号信息`,
|
||||||
|
duration:3
|
||||||
|
});
|
||||||
|
this.isMultiDepart = false
|
||||||
|
}else if(multi_depart==2){
|
||||||
|
this.visible=true
|
||||||
|
this.isMultiDepart = true
|
||||||
|
this.departList = loginResult.departs
|
||||||
|
}else {
|
||||||
|
this.isMultiDepart = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bizTenant(ids){
|
||||||
|
if(!ids || ids.length==0){
|
||||||
|
this.isMultiTenant = false
|
||||||
|
} else if(ids.indexOf(',')<0){
|
||||||
|
this.tenant_id = ids;
|
||||||
|
this.isMultiTenant = false
|
||||||
|
}else{
|
||||||
|
this.visible = true
|
||||||
|
this.isMultiTenant = true
|
||||||
|
getAction('/sys/tenant/queryList', {ids: ids}).then(res=>{
|
||||||
|
this.tenantList = res.result
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
show(loginResult){
|
||||||
|
this.clear();
|
||||||
|
this.bizDepart(loginResult);
|
||||||
|
|
||||||
|
let user = Vue.ls.get(USER_INFO)
|
||||||
|
this.username = user.username
|
||||||
|
let ids = user.relTenantIds
|
||||||
|
this.bizTenant(ids);
|
||||||
|
|
||||||
|
if(this.visible===false){
|
||||||
|
this.$store.dispatch('saveTenant', this.tenant_id);
|
||||||
|
this.$emit('success')
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
requestFailed (err) {
|
||||||
|
this.$notification[ 'error' ]({
|
||||||
|
message: '登录失败',
|
||||||
|
description: ((err.response || {}).data || {}).message || err.message || "请求出现错误,请稍后再试",
|
||||||
|
duration: 4,
|
||||||
|
});
|
||||||
|
this.loginBtn = false;
|
||||||
|
},
|
||||||
|
departResolve(){
|
||||||
|
return new Promise((resolve, reject)=>{
|
||||||
|
if(this.isMultiDepart===false){
|
||||||
|
resolve();
|
||||||
|
}else{
|
||||||
|
let obj = {
|
||||||
|
orgCode:this.orgCode,
|
||||||
|
username:this.username
|
||||||
|
}
|
||||||
|
putAction("/sys/selectDepart",obj).then(res=>{
|
||||||
|
if(res.success){
|
||||||
|
const userInfo = res.result.userInfo;
|
||||||
|
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000);
|
||||||
|
this.$store.commit('SET_INFO', userInfo);
|
||||||
|
//console.log("---切换组织机构---userInfo-------",store.getters.userInfo.orgCode);
|
||||||
|
resolve();
|
||||||
|
}else{
|
||||||
|
this.requestFailed(res)
|
||||||
|
this.$store.dispatch('Logout');
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectOk(){
|
||||||
|
if(this.isMultiTenant && !this.tenant_id){
|
||||||
|
this.validate_status1='error'
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if(this.isMultiDepart && !this.orgCode){
|
||||||
|
this.validate_status2='error'
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.departResolve().then(()=>{
|
||||||
|
if(this.isMultiTenant){
|
||||||
|
this.$store.dispatch('saveTenant', this.tenant_id);
|
||||||
|
this.$emit('success')
|
||||||
|
}else{
|
||||||
|
this.$emit('success')
|
||||||
|
}
|
||||||
|
}).catch(()=>{
|
||||||
|
console.log('登录选择出问题')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleTenantChange(e){
|
||||||
|
this.validate_status1 = ''
|
||||||
|
this.tenant_id = e
|
||||||
|
},
|
||||||
|
handleDepartChange(e){
|
||||||
|
this.validate_status2 = ''
|
||||||
|
this.orgCode = e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,19 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-form :form="form" style="max-width: 500px; margin: 40px auto 0;" @keyup.enter.native="nextStep">
|
<a-form :form="form" style="max-width: 500px; margin: 40px auto 0;" @keyup.enter.native="nextStep">
|
||||||
<a-form-item
|
|
||||||
label="账号名"
|
|
||||||
:labelCol="{span: 5}"
|
|
||||||
:wrapperCol="{span: 19}"
|
|
||||||
>
|
|
||||||
<a-input
|
|
||||||
type="text"
|
|
||||||
autocomplete="false"
|
|
||||||
:style="{width:'310px'}"
|
|
||||||
:value="accountName"
|
|
||||||
disabled>
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="手机"
|
label="手机"
|
||||||
:labelCol="{span: 5}"
|
:labelCol="{span: 5}"
|
||||||
|
@ -22,8 +9,8 @@
|
||||||
<a-input
|
<a-input
|
||||||
type="text"
|
type="text"
|
||||||
autocomplete="false"
|
autocomplete="false"
|
||||||
:style="{width:'310px'}"
|
style="width:310px;margin-left:-10px"
|
||||||
v-decorator="['phone',{initialValue: defaultPhone, rules: validatorRules.phone.rule}]"
|
v-decorator="['phone',{ rules: validatorRules.phone.rule}]"
|
||||||
placeholder="请输入手机号">
|
placeholder="请输入手机号">
|
||||||
<a-icon slot="prefix" type="phone" :style="{ color: 'rgba(0,0,0,.25)'}"/>
|
<a-icon slot="prefix" type="phone" :style="{ color: 'rgba(0,0,0,.25)'}"/>
|
||||||
</a-input>
|
</a-input>
|
||||||
|
@ -52,10 +39,9 @@
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
||||||
<a-button style="margin-left: 8px" @click="prevStep">上一步</a-button>
|
<router-link style="float: left;line-height: 40px;" :to="{ name: 'login' }">使用已有账户登录</router-link>
|
||||||
<a-button type="primary" @click="nextStep" style="margin-left: 20px">下一步</a-button>
|
<a-button type="primary" @click="nextStep" style="margin-left: 20px">下一步</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -70,7 +56,7 @@
|
||||||
return {
|
return {
|
||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
loading: false,
|
loading: false,
|
||||||
accountName: this.userList.username,
|
// accountName: this.userList.username,
|
||||||
dropList: "0",
|
dropList: "0",
|
||||||
captcha: "",
|
captcha: "",
|
||||||
show: true,
|
show: true,
|
||||||
|
@ -84,17 +70,11 @@
|
||||||
},
|
},
|
||||||
validatorRules: {
|
validatorRules: {
|
||||||
captcha: {rule: [{required: true, message: '请输入短信验证码!'}, {validator: this.validateCaptcha}]},
|
captcha: {rule: [{required: true, message: '请输入短信验证码!'}, {validator: this.validateCaptcha}]},
|
||||||
phone: {rule: [{required: true, message: '请输入手机号码!'}]},
|
phone: {rule: [{required: true, message: '请输入手机号码!'}, {validator: this.validatePhone}]},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
defaultPhone: function(){
|
|
||||||
if(this.userList.isPhone){
|
|
||||||
return this.userList.phone
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
nextStep() {
|
nextStep() {
|
||||||
|
@ -108,15 +88,15 @@
|
||||||
this.cmsFailed("请输入短信验证码!");
|
this.cmsFailed("请输入短信验证码!");
|
||||||
} else {
|
} else {
|
||||||
var params = {}
|
var params = {}
|
||||||
params.phone = this.userList.phone;
|
params.phone = values.phone;
|
||||||
params.smscode = values.captcha;
|
params.smscode = values.captcha;
|
||||||
postAction("/sys/user/phoneVerification", params).then((res) => {
|
postAction("/sys/user/phoneVerification", params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
var userList = {
|
var userList = {
|
||||||
username: this.userList.username,
|
username: res.result.username,
|
||||||
phone: this.userList.phone,
|
phone: values.phone,
|
||||||
smscode: res.result
|
smscode: res.result.smscode
|
||||||
};
|
};
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
that.$emit('nextStep', userList)
|
that.$emit('nextStep', userList)
|
||||||
|
@ -133,12 +113,14 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
prevStep() {
|
|
||||||
this.$emit('prevStep', this.userList);
|
|
||||||
},
|
|
||||||
getCaptcha(e) {
|
getCaptcha(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let that = this;
|
let that = this;
|
||||||
|
let phone=that.form.getFieldValue("phone")
|
||||||
|
if(!phone){
|
||||||
|
this.cmsFailed("手机号不能为空!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.state.smsSendBtn = true;
|
this.state.smsSendBtn = true;
|
||||||
let interval = window.setInterval(() => {
|
let interval = window.setInterval(() => {
|
||||||
if (that.state.time-- <= 0) {
|
if (that.state.time-- <= 0) {
|
||||||
|
@ -150,7 +132,7 @@
|
||||||
|
|
||||||
const hide = this.$message.loading('验证码发送中..', 0);
|
const hide = this.$message.loading('验证码发送中..', 0);
|
||||||
let smsParams = {
|
let smsParams = {
|
||||||
mobile: this.userList.phone,
|
mobile: phone,
|
||||||
smsmode: "2"
|
smsmode: "2"
|
||||||
};
|
};
|
||||||
postAction("/sys/sms", smsParams).then(res => {
|
postAction("/sys/sms", smsParams).then(res => {
|
||||||
|
@ -179,6 +161,18 @@
|
||||||
that.show = false;
|
that.show = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
validatePhone(rule,value,callback){
|
||||||
|
if(value){
|
||||||
|
var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
|
||||||
|
if(!myreg.test(value)){
|
||||||
|
callback("请输入正确的手机号")
|
||||||
|
}else{
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +0,0 @@
|
||||||
*.js linguist-language=Java
|
|
||||||
*.css linguist-language=Java
|
|
||||||
*.html linguist-language=Java
|
|
||||||
*.vue linguist-language=Java
|
|
|
@ -1,5 +0,0 @@
|
||||||
/target/
|
|
||||||
/.idea/
|
|
||||||
*.iml
|
|
||||||
jeecg-boot-module-demo
|
|
||||||
rebel.xml
|
|
|
@ -1,61 +0,0 @@
|
||||||
#https://blog.csdn.net/sinat_19528249/article/details/99994464
|
|
||||||
# Version 0.1
|
|
||||||
# 基础镜像
|
|
||||||
FROM centos:7
|
|
||||||
# 维护者信息
|
|
||||||
MAINTAINER kangxiaolin ksf@zgykkj.com
|
|
||||||
VOLUME /tmp
|
|
||||||
#自动安装依赖
|
|
||||||
RUN cd /etc/yum.repos.d/ \
|
|
||||||
&& yum -y install wget \
|
|
||||||
&& wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo \
|
|
||||||
&& yum clean all \
|
|
||||||
&& yum makecache \
|
|
||||||
&& yum update -y \
|
|
||||||
&& yum -y install nginx \
|
|
||||||
&& yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel \
|
|
||||||
&& yum -y install redis \
|
|
||||||
#这里可以设置 域名
|
|
||||||
# 可以送本地加载 使用ADD 也可以直接写
|
|
||||||
&& echo "server { \
|
|
||||||
listen 81; \
|
|
||||||
location ^~ /jeecg-boot { \
|
|
||||||
proxy_pass http://127.0.0.1:8080/jeecg-boot/; \
|
|
||||||
proxy_set_header Host 127.0.0.1; \
|
|
||||||
proxy_set_header X-Real-IP \$remote_addr; \
|
|
||||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
|
|
||||||
} \
|
|
||||||
#解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 \
|
|
||||||
location / { \
|
|
||||||
root /var/www/html/; \
|
|
||||||
index index.html index.htm; \
|
|
||||||
if (!-e \$request_filename) { \
|
|
||||||
rewrite ^(.*)\$ /index.html?s=\$1 last; \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
access_log /var/log/nginx/access.log ; \
|
|
||||||
} " > /etc/nginx/conf.d/default.conf \
|
|
||||||
|
|
||||||
# 设置启动脚本
|
|
||||||
&& touch /etc/init.d/start.sh \
|
|
||||||
&& touch jeecgboot.log \
|
|
||||||
&& chmod +x /etc/init.d/start.sh \
|
|
||||||
&& echo "#!/bin/bash " >> /etc/init.d/start.sh \
|
|
||||||
&& echo "/usr/bin/redis-server & " >> /etc/init.d/start.sh \
|
|
||||||
&& echo "/usr/sbin/nginx -c /etc/nginx/nginx.conf" >> /etc/init.d/start.sh \
|
|
||||||
&& echo " java -jar /jeecgboot.jar " >> /etc/init.d/start.sh \
|
|
||||||
&& mkdir -p /var/www \
|
|
||||||
&& mkdir -p /var/www/html
|
|
||||||
# 前端迁移到系统文件中 默认是80端口 同级目录下的html地址
|
|
||||||
ADD ant-design-vue-jeecg/dist/ /var/www/html/
|
|
||||||
# 拷贝相关的jar包
|
|
||||||
ADD jeecg-boot/jeecg-boot-module-system/target/jeecg-boot-module-system-2.2.0.jar jeecgboot.jar
|
|
||||||
EXPOSE 80 8080 81
|
|
||||||
ENTRYPOINT /bin/sh -c /etc/init.d/start.sh
|
|
||||||
|
|
||||||
#启动脚本
|
|
||||||
#docker rmi $(docker images | grep "^<none>" | awk "{print $3}") 删除<none>
|
|
||||||
|
|
||||||
#docker build -t jeecgboot:centos .
|
|
||||||
#docker run --privileged=true -itd --name test -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 81:81 -p 8080:8080 -p 82:80 jeecgboot:centos
|
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 jeecg-boot
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
|
@ -1,2 +0,0 @@
|
||||||
-- 创建mysql库
|
|
||||||
create database `jeecg-boot` default character set utf8mb4 collate utf8mb4_general_ci;
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
FROM mysql:8.0.19
|
||||||
|
|
||||||
|
MAINTAINER jeecgos@163.com
|
||||||
|
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
COPY ./jeecgboot-mysql-5.7.sql /docker-entrypoint-initdb.d
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,143 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE `onl_cgform_field`
|
|
||||||
MODIFY COLUMN `dict_table` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字典表' AFTER `dict_field`;
|
|
||||||
|
|
||||||
ALTER TABLE `onl_cgform_field`
|
|
||||||
ADD COLUMN `converter` varchar(255) NULL COMMENT '自定义值转换器' AFTER `create_by`;
|
|
||||||
|
|
||||||
INSERT INTO `onl_cgform_head`(`id`, `table_name`, `table_type`, `table_version`, `table_txt`, `is_checkbox`, `is_db_synch`, `is_page`, `is_tree`, `id_sequence`, `id_type`, `query_mode`, `relation_type`, `sub_table_str`, `tab_order_num`, `tree_parent_id_field`, `tree_id_field`, `tree_fieldname`, `form_category`, `form_template`, `form_template_mobile`, `scroll`, `copy_version`, `copy_type`, `physic_id`, `update_by`, `update_time`, `create_by`, `create_time`, `theme_template`) VALUES ('3d447fa919b64f6883a834036c14aa67', 'test_enhance_select', 1, 5, 'js增强实现下拉联动效果', 'N', 'Y', 'Y', 'N', NULL, 'UUID', 'single', NULL, NULL, NULL, NULL, NULL, NULL, 'bdfl_include', '1', NULL, 0, NULL, 0, NULL, 'admin', '2020-02-21 17:58:46', 'admin', '2020-02-20 16:19:00', 'normal');
|
|
||||||
INSERT INTO `onl_cgform_field`(`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_value_rule_code`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`) VALUES ('209ddb923d8dab9f454d56d82c0cc725', '3d447fa919b64f6883a834036c14aa67', 'create_by', '创建人', NULL, 0, 1, 'string', 50, 0, '', '', '', '', 'text', '', 120, NULL, '0', '', '', 0, 0, 0, 0, 'single', '', '', 6, 'admin', '2020-02-21 17:58:46', '2020-02-20 16:19:00', 'admin', NULL);
|
|
||||||
INSERT INTO `onl_cgform_field`(`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_value_rule_code`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`) VALUES ('37462a4d78968d0e432d746423603b81', '3d447fa919b64f6883a834036c14aa67', 'province', '省份', NULL, 0, 1, 'String', 100, 0, '', '', '{table:\'sys_category\',txt:\'name\',key:\'id\',linkField:\'city,area\',idField:\'id\',pidField:\'pid\', condition:\" pid = \'1230769196661510146\' \" }', '', 'link_down', '', 120, NULL, '0', '', '', 0, 1, 1, 0, 'single', '', '', 2, 'admin', '2020-02-21 17:58:46', '2020-02-20 16:19:00', 'admin', NULL);
|
|
||||||
INSERT INTO `onl_cgform_field`(`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_value_rule_code`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`) VALUES ('7cdbe0d563e15f3fb1fb32d996fe4ba7', '3d447fa919b64f6883a834036c14aa67', 'area', '区', NULL, 0, 1, 'String', 100, 0, '', '', '', '', 'text', '', 120, NULL, '0', '', '', 0, 1, 1, 0, 'single', '', '', 4, 'admin', '2020-02-21 17:58:46', '2020-02-20 16:19:00', 'admin', NULL);
|
|
||||||
INSERT INTO `onl_cgform_field`(`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_value_rule_code`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`) VALUES ('91f7cd9b59c0da033363f8a09b02ec96', '3d447fa919b64f6883a834036c14aa67', 'create_time', '创建日期', NULL, 0, 1, 'Date', 20, 0, '', '', '', '', 'datetime', '', 120, NULL, '0', '', '', 0, 0, 0, 0, 'single', '', '', 5, 'admin', '2020-02-21 17:58:46', '2020-02-20 16:19:00', 'admin', NULL);
|
|
||||||
INSERT INTO `onl_cgform_field`(`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_value_rule_code`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`) VALUES ('9bd056786694d67666f6924cc225b1a0', '3d447fa919b64f6883a834036c14aa67', 'id', '主键', NULL, 1, 0, 'string', 36, 0, '', '', '', '', 'text', '', 120, NULL, '0', '', '', 0, 0, 0, 0, 'single', '', '', 1, 'admin', '2020-02-21 17:58:46', '2020-02-20 16:19:00', 'admin', NULL);
|
|
||||||
INSERT INTO `onl_cgform_field`(`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_value_rule_code`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`) VALUES ('c988bd2b6125c01ceb3579a207dd8784', '3d447fa919b64f6883a834036c14aa67', 'city', '市', NULL, 0, 1, 'String', 100, 0, '', '', '', '', 'text', '', 120, NULL, '0', '', '', 0, 1, 1, 0, 'single', '', '', 3, 'admin', '2020-02-21 17:58:46', '2020-02-20 16:19:00', 'admin', NULL);
|
|
||||||
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769855347593217', '1230769769930592257', 'C区', NULL, 'admin', '2020-02-21 16:22:54', NULL, NULL, 'A01A03', NULL);
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769769930592257', '1230769253267836929', '淮南市', NULL, 'admin', '2020-02-21 16:22:34', 'admin', '2020-02-21 16:22:54', 'A01A03', '1');
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769620021972993', '1230769470889299970', 'B区', NULL, 'admin', '2020-02-21 16:21:58', NULL, NULL, 'A01A03', NULL);
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769547519234050', '1230769470889299970', 'A区', NULL, 'admin', '2020-02-21 16:21:41', NULL, NULL, 'A01A03', NULL);
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769470889299970', '1230769290609725441', '济南市', NULL, 'admin', '2020-02-21 16:21:23', 'admin', '2020-02-21 16:21:41', 'A01A03', '1');
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769407907631106', '1230769347157331969', '包河区', NULL, 'admin', '2020-02-21 16:21:08', NULL, NULL, 'A01A03', NULL);
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769347157331969', '1230769253267836929', '合肥市', NULL, 'admin', '2020-02-21 16:20:53', 'admin', '2020-02-21 16:21:08', 'A01A03', '1');
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769290609725441', '1230769196661510146', '山东省', NULL, 'admin', '2020-02-21 16:20:40', 'admin', '2020-02-21 16:21:23', 'A01A03', '1');
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769253267836929', '1230769196661510146', '安徽省', NULL, 'admin', '2020-02-21 16:20:31', 'admin', '2020-02-21 16:20:53', 'A01A03', '1');
|
|
||||||
INSERT INTO `sys_category`(`id`, `pid`, `name`, `code`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `has_child`) VALUES ('1230769196661510146', '0', '省', NULL, 'admin', '2020-02-21 16:20:16', 'admin', '2020-02-21 16:20:31', 'A01A03', '1');
|
|
||||||
|
|
||||||
INSERT INTO `sys_dict`(`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`) VALUES ('1232913193820581889', 'Online表单业务分类', 'ol_form_biz_type', '', 0, 'admin', '2020-02-27 14:19:46', 'admin', '2020-02-27 14:20:23', 0);
|
|
||||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1232913424813486081', '1232913193820581889', '官方示例', 'demo', '', 1, 1, 'admin', '2020-02-27 14:20:42', 'admin', '2020-02-27 14:21:37');
|
|
||||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1232913493717512194', '1232913193820581889', '流程表单', 'bpm', '', 2, 1, 'admin', '2020-02-27 14:20:58', 'admin', '2020-02-27 14:22:20');
|
|
||||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1232913605382467585', '1232913193820581889', '测试表单', 'temp', '', 4, 1, 'admin', '2020-02-27 14:21:25', 'admin', '2020-02-27 14:22:16');
|
|
||||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1232914232372195330', '1232913193820581889', '导入表单', 'bdfl_include', '', 5, 1, 'admin', '2020-02-27 14:23:54', NULL, NULL);
|
|
||||||
|
|
||||||
INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `is_route`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`) VALUES ('1235823781053313025', 'e41b69c57a941a3bbcce45032fe57605', 'AUTO在线内嵌子表', '/online/cgformInnerTableList/:code', 'modules/online/cgform/auto/innerTable/OnlCgformInnerTableList', '1', NULL, NULL, '1', NULL, '1', '999', '0', NULL, '1', '0', '1', NULL, 'admin', '2020-03-06 15:05:24', 'admin', '2020-03-06 15:07:42', '0', '0', '1', '0');
|
|
||||||
|
|
||||||
DELETE from onl_cgreport_item where cgrhead_id not in (select id from onl_cgreport_head);
|
|
||||||
DELETE from onl_cgreport_param where cgrhead_id not in (select id from onl_cgreport_head);
|
|
||||||
|
|
||||||
ALTER TABLE `onl_cgform_field`
|
|
||||||
ADD COLUMN `query_def_val` varchar(50) NULL COMMENT '查询默认值' AFTER `converter`,
|
|
||||||
ADD COLUMN `query_dict_text` varchar(100) NULL COMMENT '查询配置字典text' AFTER `query_def_val`,
|
|
||||||
ADD COLUMN `query_dict_field` varchar(100) NULL COMMENT '查询配置字典code' AFTER `query_dict_text`,
|
|
||||||
ADD COLUMN `query_dict_table` varchar(500) NULL COMMENT '查询配置字典table' AFTER `query_dict_field`,
|
|
||||||
ADD COLUMN `query_show_type` varchar(50) NULL COMMENT '查询显示控件' AFTER `query_dict_table`,
|
|
||||||
ADD COLUMN `query_config_flag` varchar(3) NULL COMMENT '是否启用查询配置1是0否' AFTER `query_show_type`,
|
|
||||||
ADD COLUMN `query_valid_type` varchar(50) NULL COMMENT '查询字段校验类型' AFTER `query_config_flag`,
|
|
||||||
ADD COLUMN `query_must_input` varchar(3) NULL COMMENT '查询字段是否必填1是0否' AFTER `query_valid_type`,
|
|
||||||
ADD COLUMN `sort_flag` varchar(3) NULL COMMENT '是否支持排序1是0否' AFTER `query_must_input`;
|
|
||||||
|
|
||||||
|
|
||||||
UPDATE `onl_cgform_field` SET `field_value_rule_code` = CONCAT('${', field_value_rule_code, '}') WHERE field_value_rule_code IS NOT NULL AND field_value_rule_code != '';
|
|
||||||
ALTER TABLE `onl_cgform_field`
|
|
||||||
CHANGE COLUMN `field_value_rule_code` `field_default_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '控件默认值,不同的表达式展示不同的结果。\r\n1. 纯字符串直接赋给默认值;\r\n2. #{普通变量};\r\n3. {{ 动态JS表达式 }};\r\n4. ${填值规则编码};\r\n填值规则表达式只允许存在一个,且不能和其他规则混用。' AFTER `field_extend_json`;
|
|
||||||
|
|
||||||
INSERT INTO `onl_cgform_head` (`id`, `table_name`, `table_type`, `table_version`, `table_txt`, `is_checkbox`, `is_db_synch`, `is_page`, `is_tree`, `id_sequence`, `id_type`, `query_mode`, `relation_type`, `sub_table_str`, `tab_order_num`, `tree_parent_id_field`, `tree_id_field`, `tree_fieldname`, `form_category`, `form_template`, `form_template_mobile`, `scroll`, `copy_version`, `copy_type`, `physic_id`, `update_by`, `update_time`, `create_by`, `create_time`, `theme_template`) VALUES ('4adec929a6594108bef5b35ee9966e9f', 'demo_field_def_val_main', '2', '1', '示例:控件默认值(主表)', 'Y', 'N', 'Y', 'N', NULL, 'UUID', 'single', NULL, 'demo_field_def_val_sub', NULL, NULL, NULL, NULL, 'demo', '1', NULL, '1', NULL, '0', NULL, 'admin', '2020-04-10 19:51:27', 'admin', '2020-04-10 19:35:57', 'normal');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('101a73df0aa5199ac05c4ce92a4f0e3e', '4adec929a6594108bef5b35ee9966e9f', 'name', '姓名', NULL, '0', '1', 'String', '200', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '#{sysUserCode}', '0', '1', '1', '0', 'single', '', '', '3', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('4c4f4067fa31737f3ff9e088130ef793', '4adec929a6594108bef5b35ee9966e9f', 'sex', '性别', NULL, '0', '1', 'String', '200', '0', '', 'sex', '', '', 'list', '', '120', NULL, '0', '', '{{ 2 }}', '0', '1', '1', '0', 'single', '', '', '4', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('5f5ac4d37fd1a3a09e2b19f0d4d99c0f', '4adec929a6594108bef5b35ee9966e9f', 'code', '编码', NULL, '0', '1', 'String', '200', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '${order_num_rule_param}', '0', '1', '1', '0', 'single', '', '', '2', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('7b4c181e4ebd76022f75535ed6fd9de3', '4adec929a6594108bef5b35ee9966e9f', 'update_time', '更新日期', NULL, '0', '1', 'Date', '20', '0', '', '', '', '', 'datetime', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '10', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('8e080f4ded1e3b2a1daa5b11eca4a0ff', '4adec929a6594108bef5b35ee9966e9f', 'create_by', '创建人', NULL, '0', '1', 'string', '50', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '7', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('951c51699d728072d88196d30f7aad10', '4adec929a6594108bef5b35ee9966e9f', 'address', '地址', NULL, '0', '1', 'String', '200', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '{{ demoFieldDefVal_getAddress() }}', '0', '1', '1', '0', 'single', '', '', '5', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('9ceff249ef81ca6fa145456667c89051', '4adec929a6594108bef5b35ee9966e9f', 'create_time', '创建日期', NULL, '0', '1', 'Date', '20', '0', '', '', '', '', 'datetime', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '8', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('c0c80f370e1d400fe670d8702c3b84da', '4adec929a6594108bef5b35ee9966e9f', 'address_param', '地址(传参)', NULL, '0', '1', 'String', '32', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '{{ demoFieldDefVal_getAddress(\"昌平区\") }}', '0', '1', '1', '0', 'single', '', '', '6', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:40:53', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('c2b9eae184afe56d59ea7940d77cfced', '4adec929a6594108bef5b35ee9966e9f', 'id', '主键', NULL, '1', '0', 'string', '36', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '1', 'single', '', '', '1', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:57', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('df58a7b1c3ed8f58a1994c0c0855db16', '4adec929a6594108bef5b35ee9966e9f', 'sys_org_code', '所属部门', NULL, '0', '1', 'string', '64', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '11', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('fed133a00f57245d4cfb02dd3c3ce7c1', '4adec929a6594108bef5b35ee9966e9f', 'update_by', '更新人', NULL, '0', '1', 'string', '50', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '9', 'admin', '2020-04-10 19:43:38', '2020-04-10 19:35:58', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
-- 主表JS增强
|
|
||||||
INSERT INTO `onl_cgform_enhance_js` (`ID`, `CG_JS`, `CG_JS_TYPE`, `CONTENT`, `CGFORM_HEAD_ID`) VALUES ('44cad4eec436328ed3cc134855f8d1d5', ' onlChange(){\n return {\n name(that, event) {\n that.executeMainFillRule()\n }\n }\n }', 'form', NULL, '4adec929a6594108bef5b35ee9966e9f');
|
|
||||||
-- 控件默认值示例:子表
|
|
||||||
INSERT INTO `onl_cgform_head` (`id`, `table_name`, `table_type`, `table_version`, `table_txt`, `is_checkbox`, `is_db_synch`, `is_page`, `is_tree`, `id_sequence`, `id_type`, `query_mode`, `relation_type`, `sub_table_str`, `tab_order_num`, `tree_parent_id_field`, `tree_id_field`, `tree_fieldname`, `form_category`, `form_template`, `form_template_mobile`, `scroll`, `copy_version`, `copy_type`, `physic_id`, `update_by`, `update_time`, `create_by`, `create_time`, `theme_template`) VALUES ('4fb8e12a697f4d5bbe9b9fb1e9009486', 'demo_field_def_val_sub', '3', '1', '示例:控件默认值(子表)', 'Y', 'N', 'Y', 'N', NULL, 'UUID', 'single', '0', NULL, '1', NULL, NULL, NULL, 'demo', '1', NULL, '1', NULL, '0', NULL, 'admin', '2020-04-10 19:51:31', 'admin', '2020-04-10 19:47:01', 'normal');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('0a453a63e33654aa1b9ee2affa854a6d', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'create_by', '创建人', NULL, '0', '1', 'string', '50', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '6', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('1d95bdf1120c5a1776df022d0a571f21', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'create_time', '创建日期', NULL, '0', '1', 'Date', '20', '0', '', '', '', '', 'datetime', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '7', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('2e6f741fa96a49a0adccc7b4682c1cef', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'name', '名称', NULL, '0', '1', 'String', '200', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '#{sysUserName}', '0', '1', '1', '0', 'single', '', '', '3', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('6a0082c8ffbae092e99689520f1c83f7', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'update_time', '更新日期', NULL, '0', '1', 'Date', '20', '0', '', '', '', '', 'datetime', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '9', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('6e5c9d8e8b7eb6980ec246cb813b180b', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'sys_org_code', '所属部门', NULL, '0', '1', 'string', '64', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '10', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('9341a3b2a734d8c73455c136e1cac8ad', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'update_by', '更新人', NULL, '0', '1', 'string', '50', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', '', '', '8', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('bef85fd2846dd7ffc42d747095557d14', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'date', '日期', NULL, '0', '1', 'string', '200', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '#{date}', '0', '1', '1', '0', 'single', '', '', '4', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('c382877700a9987f4bcc2deea9ee9daf', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'id', '主键', NULL, '1', '0', 'string', '36', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '1', 'single', '', '', '1', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('d44b89cc5f1828f7ceb9be196d549665', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'code', '编码', NULL, '0', '1', 'String', '200', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '${order_num_rule_param}', '0', '1', '1', '0', 'single', '', '', '2', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:01', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
INSERT INTO `onl_cgform_field` (`id`, `cgform_head_id`, `db_field_name`, `db_field_txt`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `order_num`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`) VALUES ('faaaca21b7b2b16089c885f3224e4dc5', '4fb8e12a697f4d5bbe9b9fb1e9009486', 'main_id', '主表ID', NULL, '0', '1', 'String', '200', '0', '', '', '', '', 'text', '', '120', NULL, '0', '', '', '0', '0', '0', '0', 'single', 'demo_field_def_val_main', 'id', '5', 'admin', '2020-04-10 19:51:27', '2020-04-10 19:47:55', 'admin', '', '', '', '', '', NULL, '0', NULL, NULL, '0');
|
|
||||||
|
|
||||||
ALTER TABLE `onl_cgform_index`
|
|
||||||
ADD COLUMN `is_db_synch` varchar(2) NULL DEFAULT 'N' COMMENT '是否同步数据库 N未同步 Y已同步' AFTER `update_time`,
|
|
||||||
ADD COLUMN `del_flag` int(1) NULL DEFAULT 0 COMMENT '是否删除 0未删除 1删除' AFTER `is_db_synch`;
|
|
||||||
|
|
||||||
ALTER TABLE `onl_cgform_button`
|
|
||||||
ADD COLUMN `OPT_POSITION` varchar(3) NULL COMMENT '按钮位置1侧面 2底部' AFTER `ORDER_NUM`;
|
|
||||||
update ONL_CGFORM_BUTTON SET OPT_POSITION = '2';
|
|
||||||
|
|
||||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1234371726545010689', '4e4602b3e3686f0911384e188dc7efb4', '左模糊', 'LEFT_LIKE', '左模糊', 7.00, 1, 'admin', '2020-03-02 14:55:27', NULL, NULL);
|
|
||||||
INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1234371809495760898', '4e4602b3e3686f0911384e188dc7efb4', '右模糊', 'RIGHT_LIKE', '右模糊', 7.00, 1, 'admin', '2020-03-02 14:55:47', NULL, NULL);
|
|
||||||
|
|
||||||
-- 将空字符串改为null
|
|
||||||
UPDATE sys_user SET phone = NULL WHERE phone = '';
|
|
||||||
UPDATE sys_user SET email = NULL WHERE email = '';
|
|
||||||
|
|
||||||
ALTER TABLE `sys_user`
|
|
||||||
ADD UNIQUE INDEX `uniq_sys_user_username` (`username`) USING BTREE,
|
|
||||||
ADD UNIQUE INDEX `uniq_sys_user_phone` (`phone`) USING BTREE,
|
|
||||||
ADD UNIQUE INDEX `uniq_sys_user_email` (`email`) USING BTREE;
|
|
||||||
|
|
||||||
ALTER TABLE `sys_user`
|
|
||||||
ADD COLUMN `third_id` varchar(100) NULL COMMENT '第三方登录的唯一标识' AFTER `del_flag`;
|
|
||||||
ALTER TABLE `sys_user`
|
|
||||||
ADD COLUMN `third_type` varchar(100) NULL COMMENT '第三方类型' AFTER `third_id`;
|
|
||||||
INSERT INTO `sys_role` (`id`, `role_name`, `role_code`, `description`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1169504891467464705', '第三方登录角色', 'third_role', '第三方登录角色', 'admin', '2019-09-05 14:57:49', 'admin', '2019-09-05 14:57:56');
|
|
||||||
|
|
||||||
ALTER TABLE `sys_category`
|
|
||||||
ADD UNIQUE INDEX `index_code`(`code`);
|
|
||||||
|
|
||||||
ALTER TABLE `sys_announcement`
|
|
||||||
ADD COLUMN `msg_abstract` text COMMENT '摘要' AFTER `user_ids`;
|
|
||||||
|
|
||||||
ALTER TABLE `sys_user`
|
|
||||||
CHANGE COLUMN `identity` `user_identity` tinyint(1) DEFAULT NULL COMMENT '身份(1普通成员 2上级)' AFTER `update_time`;
|
|
||||||
|
|
||||||
ALTER TABLE `sys_quartz_job`
|
|
||||||
ADD UNIQUE INDEX `uniq_job_class_name` USING BTREE (`job_class_name`) ;
|
|
||||||
|
|
||||||
ALTER TABLE `sys_position`
|
|
||||||
ADD UNIQUE INDEX `uniq_code` USING BTREE (`code`) ;
|
|
||||||
|
|
||||||
ALTER TABLE `sys_depart`
|
|
||||||
ADD UNIQUE INDEX `uniq_depart_org_code` USING BTREE (`org_code`) ;
|
|
||||||
|
|
||||||
ALTER TABLE `sys_depart`
|
|
||||||
MODIFY COLUMN `description` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述' AFTER `depart_order`;
|
|
||||||
|
|
||||||
INSERT INTO `sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`) VALUES ('1250687930947620866', '定时任务状态', 'quartz_status', '', '0', 'admin', '2020-04-16 15:30:14', '', NULL, NULL);
|
|
||||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1250688147579228161', '1250687930947620866', '正常', '0', '', '1', '1', 'admin', '2020-04-16 15:31:05', '', NULL);
|
|
||||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1250688201064992770', '1250687930947620866', '停止', '-1', '', '1', '1', 'admin', '2020-04-16 15:31:18', '', NULL);
|
|
||||||
|
|
||||||
UPDATE `sys_dict` SET `id`='1174511106530525185', `dict_name`='机构类型', `dict_code`='org_category', `description`='机构类型 1公司,2部门 3岗位', `del_flag`='0', `create_by`='admin', `create_time`='2019-09-19 10:30:43', `update_by`=NULL, `update_time`=NULL, `type`='0' WHERE (`id`='1174511106530525185');
|
|
||||||
UPDATE `sys_dict_item` SET `id`='1174511197735665665', `dict_id`='1174511106530525185', `item_text`='公司', `item_value`='1', `description`='公司', `sort_order`='1', `status`='1', `create_by`='admin', `create_time`='2019-09-19 10:31:05', `update_by`=NULL, `update_time`=NULL WHERE (`id`='1174511197735665665');
|
|
||||||
UPDATE `sys_dict_item` SET `id`='1174511244036587521', `dict_id`='1174511106530525185', `item_text`='部门', `item_value`='2', `description`='部门', `sort_order`='1', `status`='1', `create_by`='admin', `create_time`='2019-09-19 10:31:16', `update_by`=NULL, `update_time`=NULL WHERE (`id`='1174511244036587521');
|
|
||||||
INSERT INTO `sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ('1174509082208395266', '1174511106530525185', '岗位', '3', '岗位', '1', '1', 'admin', '2019-09-19 10:31:16', '', NULL);
|
|
||||||
|
|
||||||
update SYS_PERMISSION set URL = '/account/settings/BaseSetting',COMPONENT_NAME='account-settings-base' where id = '1367a93f2c410b169faa7abcbad2f77c';
|
|
||||||
update SYS_PERMISSION set URL = '/account/settings/Index' where id = '6e73eb3c26099c191bf03852ee1310a1';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
版本升级方法?
|
|
||||||
|
|
||||||
JeecgBoot属于平台级产品,每次升级改动内容较多,目前做不到平滑升级。
|
|
||||||
|
|
||||||
这里给用户的升级建议是这样的:
|
|
||||||
1.代码升级 => 本地版本通过svn或者git做好主干,在分支上做业务开发,jeecg每次版本发布,可以手工覆盖主干的代码,对比代码进行提交;
|
|
||||||
2.数据库升级 => 针对数据库我们每次发布会提供增量升级SQL,可以通过增量SQL实现数据库的升级。
|
|
||||||
3.兼容问题 => 每次版本发布会针对不兼容地方标注说明,需要手工修改不兼容的代码。
|
|
||||||
|
|
||||||
注意: 升级sql目前只提供mysql版本,执行完脚步后,新菜单需要手工进行角色授权,刷新首页才会出现。
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
jeecg-boot-mysql:
|
||||||
|
build:
|
||||||
|
context: ./db
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
restart: always
|
||||||
|
container_name: jeecg-boot-mysql
|
||||||
|
image: jeecg-boot-mysql
|
||||||
|
command:
|
||||||
|
--character-set-server=utf8mb4
|
||||||
|
--collation-server=utf8mb4_general_ci
|
||||||
|
--explicit_defaults_for_timestamp=true
|
||||||
|
--lower_case_table_names=1
|
||||||
|
--max_allowed_packet=128M
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
|
||||||
|
jeecg-boot-redis:
|
||||||
|
image: redis:5.0
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
restart: always
|
||||||
|
container_name: jeecg-boot-redis
|
||||||
|
|
||||||
|
|
||||||
|
jeecg-boot-system:
|
||||||
|
build:
|
||||||
|
context: ./jeecg-boot-module-system
|
||||||
|
restart: always
|
||||||
|
container_name: jeecg-boot-system
|
||||||
|
image: jeecg-boot-system
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
<artifactId>jeecg-boot-parent</artifactId>
|
<artifactId>jeecg-boot-parent</artifactId>
|
||||||
<version>2.2.0</version>
|
<version>2.2.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue