Commit 4a4f2367 by zhangdaiscott

Jeecg-Boot 2.1.4 版本发布 | 重构较大,较多新功能

parent 06847cd8
Ant Design Jeecg Vue Ant Design Jeecg Vue
==== ====
当前最新版本: 2.1.3(发布日期:20191226 当前最新版本: 2.0.4(发布日期:20200224
Overview Overview
---- ----
基于 [Ant Design of Vue](https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/) 实现的 Ant Design Pro Vue 版 基于 [Ant Design of Vue](https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/) 实现的 Ant Design Pro Vue 版
Jeecg-boot 的前端UI框架,采用前后端分离框架,提供强大代码生成器的快速开发平台。 Jeecg-boot 的前段UI框架,采用前后端分离方案,提供强大代码生成器的快速开发平台。
前端页面代码和后端功能代码一键生成,不需要写任何代码,保持jeecg一贯的强大!! 前端页面代码和后端功能代码一键生成,不需要写任何代码,保持jeecg一贯的强大!!
......
{ {
"name": "vue-antd-jeecg", "name": "vue-antd-jeecg",
"version": "2.1.3", "version": "2.1.4",
"private": true, "private": true,
"scripts": { "scripts": {
"pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || 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 ",
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.10.2", "@antv/data-set": "^0.10.2",
"@jeecg/antd-online-re": "2.1.3", "@jeecg/antd-online-214": "^2.1.4",
"@tinymce/tinymce-vue": "^2.0.0", "@tinymce/tinymce-vue": "^2.0.0",
"ant-design-vue": "^1.4.0", "ant-design-vue": "^1.4.0",
"apexcharts": "^3.6.5", "apexcharts": "^3.6.5",
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"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.0.2", "tinymce": "^5.1.4",
"viser-vue": "^2.4.4", "viser-vue": "^2.4.4",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-apexcharts": "^1.3.2", "vue-apexcharts": "^1.3.2",
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.1.0", "eslint-plugin-vue": "^5.1.0",
"html-webpack-plugin": "^4.0.0-beta.11",
"less": "^3.9.0", "less": "^3.9.0",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"node-sass": "^4.11.0", "node-sass": "^4.11.0",
"sass-loader": "^7.0.1", "sass-loader": "^7.0.1",
"vue-template-compiler": "^2.6.10", "vue-template-compiler": "^2.6.10"
"html-webpack-plugin": "^4.0.0-beta.11"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Jeecg-Boot 快速开发平台</title> <title>Jeecg-Boot 企业级快速开发平台</title>
<link rel="icon" href="<%= BASE_URL %>logo.png"> <link rel="icon" href="<%= BASE_URL %>logo.png">
<script src="https://cdn.bootcss.com/babel-polyfill/7.6.0/polyfill.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.2.5/polyfill.js"></script>
<style> <style>
html, html,
body, body,
...@@ -244,8 +244,8 @@ ...@@ -244,8 +244,8 @@
window._CONFIG = {}; window._CONFIG = {};
window._CONFIG['domianURL'] = 'http://127.0.0.1:8080/jeecg-boot'; window._CONFIG['domianURL'] = 'http://127.0.0.1:8080/jeecg-boot';
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas'; window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
window._CONFIG['imgDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/view'; window._CONFIG['onlinePreviewDomainURL'] = 'http://fileview.jeecg.com/onlinePreview'
window._CONFIG['downloadUrl'] = window._CONFIG['domianURL'] + '/sys/common/download'; window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/static';
window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe'; window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe';
</script> </script>
</head> </head>
......
...@@ -25,7 +25,7 @@ const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params); ...@@ -25,7 +25,7 @@ const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
//验证用户是否存在 //验证用户是否存在
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params); const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
//改变密码 //改变密码
const changPassword = (params)=>putAction("/sys/user/changPassword",params); const changePassword = (params)=>putAction("/sys/user/changePassword",params);
//权限管理 //权限管理
const addPermission= (params)=>postAction("/sys/permission/add",params); const addPermission= (params)=>postAction("/sys/permission/add",params);
...@@ -34,6 +34,7 @@ const getPermissionList = (params)=>getAction("/sys/permission/list",params); ...@@ -34,6 +34,7 @@ const getPermissionList = (params)=>getAction("/sys/permission/list",params);
/*update_begin author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */ /*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)
/*update_end author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */ /*update_end author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */
// const deletePermission = (params)=>deleteAction("/sys/permission/delete",params); // const deletePermission = (params)=>deleteAction("/sys/permission/delete",params);
...@@ -56,6 +57,14 @@ const queryParentName = (params)=>getAction("/sys/sysDepart/queryParentName",p ...@@ -56,6 +57,14 @@ const queryParentName = (params)=>getAction("/sys/sysDepart/queryParentName",p
const searchByKeywords = (params)=>getAction("/sys/sysDepart/searchBy",params); const searchByKeywords = (params)=>getAction("/sys/sysDepart/searchBy",params);
const deleteByDepartId = (params)=>deleteAction("/sys/sysDepart/delete",params); const deleteByDepartId = (params)=>deleteAction("/sys/sysDepart/delete",params);
//二级部门管理
const queryDepartPermission = (params)=>getAction("/sys/permission/queryDepartPermission",params);
const saveDepartPermission = (params)=>postAction("/sys/permission/saveDepartPermission",params);
const queryTreeListForDeptRole = (params)=>getAction("/sys/sysDepartPermission/queryTreeListForDeptRole",params);
const queryDeptRolePermission = (params)=>getAction("/sys/sysDepartPermission/queryDeptRolePermission",params);
const saveDeptRolePermission = (params)=>postAction("/sys/sysDepartPermission/saveDeptRolePermission",params);
const queryMyDepartTreeList = (params)=>getAction("/sys/sysDepart/queryMyDeptTreeList",params);
//日志管理 //日志管理
//const getLogList = (params)=>getAction("/sys/log/list",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);
...@@ -94,6 +103,7 @@ const queryUserRoleMap = (params)=>getAction("/sys/user/queryUserRoleMap",params ...@@ -94,6 +103,7 @@ 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)
export { export {
// imgView, // imgView,
...@@ -108,7 +118,7 @@ export { ...@@ -108,7 +118,7 @@ export {
queryall, queryall,
frozenBatch, frozenBatch,
checkOnlyUser, checkOnlyUser,
changPassword, changePassword,
getPermissionList, getPermissionList,
addPermission, addPermission,
editPermission, editPermission,
...@@ -142,7 +152,15 @@ export { ...@@ -142,7 +152,15 @@ export {
queryTreeListForRole, queryTreeListForRole,
getSystemMenuList, getSystemMenuList,
getSystemSubmenu, getSystemSubmenu,
loadCategoryData getSystemSubmenuBatch,
loadCategoryData,
checkRuleByCode,
queryDepartPermission,
saveDepartPermission,
queryTreeListForDeptRole,
queryDeptRolePermission,
saveDeptRolePermission,
queryMyDepartTreeList
} }
......
...@@ -112,3 +112,17 @@ export function downFile(url,parameter){ ...@@ -112,3 +112,17 @@ export function downFile(url,parameter){
}) })
} }
/**
* 获取文件访问路径
* @param avatar
* @param imgerver
* @param str
* @returns {*}
*/
export function getFileAccessHttpUrl(avatar,imgerver,subStr) {
if(avatar && avatar.indexOf(subStr) != -1 ){
return avatar;
}else{
return imgerver + "/" + avatar;
}
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
} }
/** Button按钮间距 */ /** Button按钮间距 */
.table-operator .ant-btn { .table-operator .ant-btn {
margin-right: 6px margin: 8px 8px 0 0;
} }
/*列表td的padding设置 可以控制列表大小*/ /*列表td的padding设置 可以控制列表大小*/
.ant-table-tbody .ant-table-row td { .ant-table-tbody .ant-table-row td {
......
<template> <template>
<div :style="{ padding: '0 50px 32px 0' }"> <div :style="{ padding: '0 50px 32px 0' }">
<h4 :style="{ marginBottom: '20px' }">{{ title }}</h4> <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
<v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :padding=" padding"> <v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :padding=" padding" :onClick="handleClick">
<v-tooltip/> <v-tooltip/>
<v-legend/> <v-legend/>
<v-axis/> <v-axis/>
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
</template> </template>
<script> <script>
import { ChartEventMixins } from './mixins/ChartMixins'
export default { export default {
name: 'BarMultid', name: 'BarAndLine',
mixins: [ChartEventMixins],
props: { props: {
title: { title: {
type: String, type: String,
......
<template> <template>
<div :style="{ padding: '0 0 32px 32px' }"> <div :style="{ padding: '0 0 32px 32px' }">
<h4 :style="{ marginBottom: '20px' }">{{ title }}</h4> <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
<v-chart :forceFit="true" :height="254" :data="chartData" :padding="['auto', 'auto', '40', '50']"> <v-chart :data="data" :height="height" :force-fit="true" :onClick="handleClick">
<v-tooltip /> <v-tooltip/>
<v-axis /> <v-axis/>
<v-legend /> <v-legend/>
<v-bar position="x*y" color="type" :adjust="adjust" /> <v-bar position="x*y" color="type" :adjust="adjust"/>
</v-chart> </v-chart>
</div> </div>
</template> </template>
<script> <script>
import { DataSet } from '@antv/data-set' import { DataSet } from '@antv/data-set'
import { ChartEventMixins } from './mixins/ChartMixins'
const sourceDataConst = [
{ type: 'Jeecg', 'Jan.': 18.9, 'Feb.': 28.8, 'Mar.': 39.3, 'Apr.': 81.4, 'May': 47, 'Jun.': 20.3, 'Jul.': 24, 'Aug.': 35.6 },
{ type: 'Jeebt', 'Jan.': 12.4, 'Feb.': 23.2, 'Mar.': 34.5, 'Apr.': 99.7, 'May': 52.6, 'Jun.': 35.5, 'Jul.': 37.4, 'Aug.': 42.4 },
];
const fieldsConst = ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May', 'Jun.', 'Jul.', 'Aug.'];
export default { export default {
name: 'BarMultid', name: 'BarMultid',
mixins: [ChartEventMixins],
props: { props: {
title: { title: {
type: String, type: String,
default: '' default: ''
}, },
sourceData:{ dataSource: {
type:Array, type: Array,
default:()=>[] default: () => [
{ type: 'Jeecg', 'Jan.': 18.9, 'Feb.': 28.8, 'Mar.': 39.3, 'Apr.': 81.4, 'May': 47, 'Jun.': 20.3, 'Jul.': 24, 'Aug.': 35.6 },
{ type: 'Jeebt', 'Jan.': 12.4, 'Feb.': 23.2, 'Mar.': 34.5, 'Apr.': 99.7, 'May': 52.6, 'Jun.': 35.5, 'Jul.': 37.4, 'Aug.': 42.4 }
]
}, },
fields:{ fields: {
type:Array, type: Array,
default:()=>[] default: () => ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May', 'Jun.', 'Jul.', 'Aug.']
},
// 别名,需要的格式:[{field:'name',alias:'姓名'}, {field:'sex',alias:'性别'}]
aliases: {
type: Array,
default: () => []
},
height: {
type: Number,
default: 254
} }
}, },
data() { data() {
return { return {
chartData:"",
height: 400,
adjust: [{ adjust: [{
type: 'dodge', type: 'dodge',
marginRatio: 1 / 32, marginRatio: 1 / 32
}], }]
};
},
watch: {
'sourceData': function () {
this.drawChart();
} }
}, },
mounted(){ computed: {
this.drawChart() data() {
}, const dv = new DataSet.View().source(this.dataSource)
methods:{
drawChart(){
let temp = sourceDataConst;
if(this.sourceData && this.sourceData.length>0){
temp = this.sourceData
}
const dv = new DataSet.View().source(temp);
dv.transform({ dv.transform({
type: 'fold', type: 'fold',
fields:(!this.fields||this.fields.length==0)?fieldsConst:this.fields, fields: this.fields,
key: 'x', key: 'x',
value: 'y', value: 'y'
}); })
this.chartData=dv.rows;
// bar 使用不了 - 和 / 所以替换下
let rows = dv.rows.map(row => {
if (typeof row.x === 'string') {
row.x = row.x.replace(/[-/]/g, '_')
}
return row
})
// 替换别名
rows.forEach(row => {
for (let item of this.aliases) {
if (item.field === row.type) {
row.type = item.alias
break
}
}
})
return rows
} }
} }
} }
......
<template> <template>
<div :style="{ padding: '0 0 32px 32px' }"> <div :style="{ padding: '0 0 32px 32px' }">
<h4 :style="{ marginBottom: '20px' }">{{ title }}</h4> <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
<v-chart :force-fit="true" :height="height" :data="data" :scale="scale"> <v-chart :force-fit="true" :height="height" :data="data" :scale="scale" :onClick="handleClick">
<v-tooltip/> <v-tooltip/>
<v-axis/> <v-axis/>
<v-legend/> <v-legend/>
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
<script> <script>
import { DataSet } from '@antv/data-set' import { DataSet } from '@antv/data-set'
import { ChartEventMixins } from './mixins/ChartMixins'
export default { export default {
name: 'LineChartMultid', name: 'LineChartMultid',
mixins: [ChartEventMixins],
props: { props: {
title: { title: {
type: String, type: String,
......
<template> <template>
<v-chart :forceFit="true" :height="height" :data="data" :scale="scale"> <v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :onClick="handleClick">
<v-tooltip :showTitle="false" dataKey="item*percent"/> <v-tooltip :showTitle="false" dataKey="item*percent"/>
<v-axis/> <v-axis/>
<v-legend dataKey="item"/> <v-legend dataKey="item"/>
...@@ -10,8 +10,11 @@ ...@@ -10,8 +10,11 @@
<script> <script>
const DataSet = require('@antv/data-set') const DataSet = require('@antv/data-set')
import { ChartEventMixins } from './mixins/ChartMixins'
export default { export default {
name: 'Pie',
mixins: [ChartEventMixins],
props: { props: {
title: { title: {
type: String, type: String,
......
export const ChartEventMixins = {
methods: {
handleClick(event, chart) {
this.handleEvent('click', event, chart)
},
handleEvent(eventName, event, chart) {
this.$emit(eventName, event, chart)
},
}
}
\ No newline at end of file
<template> <template>
<a-radio-group v-if="tagType=='radio'" @change="handleInput" :value="value" :disabled="disabled"> <a-radio-group v-if="tagType=='radio'" @change="handleInput" :value="getValueSting" :disabled="disabled">
<a-radio v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio> <a-radio v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio>
</a-radio-group> </a-radio-group>
<a-select v-else-if="tagType=='select'" :getPopupContainer = "(target) => target.parentNode" :placeholder="placeholder" :disabled="disabled" :value="value" @change="handleInput"> <a-select v-else-if="tagType=='select'" :getPopupContainer = "(target) => target.parentNode" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
<a-select-option value="">请选择</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 ">
{{ item.text || item.label }} {{ item.text || item.label }}
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
placeholder: String, placeholder: String,
triggerChange: Boolean, triggerChange: Boolean,
disabled: Boolean, disabled: Boolean,
value: String, value: [String, Number],
type: String type: String
}, },
data() { data() {
...@@ -50,6 +50,11 @@ ...@@ -50,6 +50,11 @@
//获取字典数据 //获取字典数据
// this.initDictData(); // this.initDictData();
}, },
computed: {
getValueSting(){
return this.value ? this.value.toString() : null;
},
},
methods: { methods: {
initDictData() { initDictData() {
//根据字典Code, 初始化字典数组 //根据字典Code, 初始化字典数组
......
...@@ -47,10 +47,20 @@ export function filterDictText(dictOptions, text) { ...@@ -47,10 +47,20 @@ export function filterDictText(dictOptions, text) {
* @return String * @return String
*/ */
export function filterMultiDictText(dictOptions, text) { export function filterMultiDictText(dictOptions, text) {
//js “!text” 认为0为空,所以做提前处理
if(text === 0 || text === '0'){
for (let dictItem of dictOptions) {
if (text == dictItem.value) {
return dictItem.text
}
}
}
if(!text || !dictOptions || dictOptions.length==0){ if(!text || !dictOptions || dictOptions.length==0){
return "" return ""
} }
let re = ""; let re = "";
text = text.toString()
let arr = text.split(",") let arr = text.split(",")
dictOptions.forEach(function (option) { dictOptions.forEach(function (option) {
for(let i=0;i<arr.length;i++){ for(let i=0;i<arr.length;i++){
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
console.log("aaaaa",res) console.log("aaaaa",res)
if(res.success){ if(res.success){
this.checkKey = res.result.key this.checkKey = res.result.key
this.code = res.result.code this.code = window.atob(res.result.code)
resolve(); resolve();
}else{ }else{
this.$message.error("生成验证码错误,请联系系统管理员") this.$message.error("生成验证码错误,请联系系统管理员")
......
<template>
<a-upload
name="file"
listType="picture-card"
:multiple="isMultiple"
:action="uploadAction"
:headers="headers"
:data="{biz:bizPath}"
:fileList="fileList"
:beforeUpload="beforeUpload"
:disabled="disabled"
:isMultiple="isMultiple"
:showUploadList="isMultiple"
@change="handleChange"
@preview="handlePreview">
<img v-if="!isMultiple && picUrl" :src="getAvatarView()" style="height:104px;max-width:300px"/>
<div v-else >
<a-icon :type="uploadLoading ? 'loading' : 'plus'" />
<div class="ant-upload-text">{{ text }}</div>
</div>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel()">
<img alt="example" style="width: 100%" :src="previewImage"/>
</a-modal>
</a-upload>
</template>
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getFileAccessHttpUrl } from '@/api/manage'
const uidGenerator=()=>{
return '-'+parseInt(Math.random()*10000+1,10);
}
const getFileName=(path)=>{
if(path.lastIndexOf("\\")>=0){
let reg=new RegExp("\\\\","g");
path = path.replace(reg,"/");
}
return path.substring(path.lastIndexOf("/")+1);
}
export default {
name: 'JImageUpload',
data(){
return {
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
urlView:window._CONFIG['staticDomainURL'],
uploadLoading:false,
picUrl:false,
headers:{},
fileList: [],
previewImage:"",
previewVisible: false,
}
},
props:{
text:{
type:String,
required:false,
default:"上传"
},
/*这个属性用于控制文件上传的业务路径*/
bizPath:{
type:String,
required:false,
default:"temp"
},
value:{
type:[String,Array],
required:false
},
disabled:{
type:Boolean,
required:false,
default: false
},
isMultiple:{
type:Boolean,
required:false,
default: false
}
},
watch:{
value(val){
if (val instanceof Array) {
this.initFileList(val.join(','))
} else {
this.initFileList(val)
}
}
},
created(){
const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token}
},
methods:{
initFileList(paths){
if(!paths || paths.length==0){
this.fileList = [];
return;
}
this.picUrl = true;
let fileList = [];
let arr = paths.split(",")
for(var a=0;a<arr.length;a++){
let url = getFileAccessHttpUrl(arr[a],this.urlView,"http");
fileList.push({
uid: uidGenerator(),
name: getFileName(arr[a]),
status: 'done',
url: url,
response:{
status:"history",
message:arr[a]
}
})
}
this.fileList = fileList
},
beforeUpload: function(file){
var fileType = file.type;
if(fileType.indexOf('image')<0){
this.$message.warning('请上传图片');
return false;
}
},
handleChange(info) {
this.picUrl = false;
let fileList = info.fileList
if(info.file.status==='done'){
if(info.file.response.success){
this.picUrl = true;
fileList = fileList.map((file) => {
if (file.response) {
file.url = file.response.message;
}
return file;
});
}
//this.$message.success(`${info.file.name} 上传成功!`);
}else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`);
}else if(info.file.status === 'removed'){
this.handleDelete(info.file)
}
this.fileList = fileList
if(info.file.status==='done' || info.file.status === 'removed'){
this.handlePathChange()
}
},
// 预览
handlePreview (file) {
this.previewImage = file.url || file.thumbUrl
this.previewVisible = true
},
getAvatarView(){
if(this.fileList.length>0){
let url = this.fileList[0].url
return getFileAccessHttpUrl(url,this.urlView,"http")
}
},
handlePathChange(){
let uploadFiles = this.fileList
let path = ''
if(!uploadFiles || uploadFiles.length==0){
path = ''
}
let arr = [];
if(!this.isMultiple){
arr.push(uploadFiles[uploadFiles.length-1].response.message)
}else{
for(var a=0;a<uploadFiles.length;a++){
arr.push(uploadFiles[a].response.message)
}
}
if(arr.length>0){
path = arr.join(",")
}
this.$emit('change', path);
},
handleDelete(file){
//如有需要新增 删除逻辑
console.log(file)
},
handleCancel() {
this.close();
this.previewVisible = false;
},
close () {
},
},
model: {
prop: 'value',
event: 'change'
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
type: String, type: String,
default: '', default: '',
required: false required: false
},
biz:{
type: String,
default: '',
required: false
} }
}, },
data(){ data(){
...@@ -49,7 +54,8 @@ ...@@ -49,7 +54,8 @@
visible:false, visible:false,
uploading:false, uploading:false,
fileList:[], fileList:[],
uploadAction:'' uploadAction:'',
foreignKeys:''
} }
}, },
watch: { watch: {
...@@ -67,10 +73,11 @@ ...@@ -67,10 +73,11 @@
handleClose(){ handleClose(){
this.visible=false this.visible=false
}, },
show(){ show(arg){
this.fileList = [] this.fileList = []
this.uploading = false this.uploading = false
this.visible = true this.visible = true
this.foreignKeys = arg;
}, },
handleRemove(file) { handleRemove(file) {
const index = this.fileList.indexOf(file); const index = this.fileList.indexOf(file);
...@@ -85,6 +92,12 @@ ...@@ -85,6 +92,12 @@
handleImport() { handleImport() {
const { fileList } = this; const { fileList } = this;
const formData = new FormData(); const formData = new FormData();
if(this.biz){
formData.append('isSingleTableImport',this.biz);
}
if(this.foreignKeys && this.foreignKeys.length>0){
formData.append('foreignKeys',this.foreignKeys);
}
fileList.forEach((file) => { fileList.forEach((file) => {
formData.append('files[]', file); formData.append('files[]', file);
}); });
......
<template>
<a-modal
ref="modal"
class="j-modal-box"
:class="{'fullscreen':innerFullscreen,'no-title':isNoTitle,'no-footer':isNoFooter,}"
:visible="visible"
v-bind="_attrs"
v-on="$listeners"
@ok="handleOk"
@cancel="handleCancel"
>
<slot></slot>
<template v-if="!isNoTitle" slot="title">
<a-row class="j-modal-title-row" type="flex">
<a-col class="left">
<slot name="title">{{ title }}</slot>
</a-col>
<a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen">
<a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/>
</a-col>
</a-row>
</template>
<!-- 处理 scopedSlots -->
<template v-for="slotName of scopedSlotsKeys" :slot="slotName">
<slot :name="slotName"></slot>
</template>
<!-- 处理 slots -->
<template v-for="slotName of slotsKeys" v-slot:[slotName]>
<slot :name="slotName"></slot>
</template>
</a-modal>
</template>
<script>
import ACol from 'ant-design-vue/es/grid/Col'
export default {
name: 'JModal',
components: { ACol },
props: {
title: String,
// 可使用 .sync 修饰符
visible: Boolean,
// 是否在弹出时禁止 body 滚动
lockScroll: {
type: Boolean,
default: true
},
// 是否全屏弹窗,当全屏时无论如何都会禁止 body 滚动。可使用 .sync 修饰符
fullscreen: {
type: Boolean,
default: true
},
// 是否允许切换全屏(允许后右上角会出现一个按钮)
switchFullscreen: {
type: Boolean,
default: false
},
},
data() {
return {
// 内部使用的 slots ,不再处理
usedSlots: ['title'],
// 缓存 body 的 overflow
bodyOverflowCache: '',
innerFullscreen: this.fullscreen,
fullscreenButtonIcon: 'fullscreen-exit',
}
},
computed: {
// 一些未处理的参数或特殊处理的参数绑定到 a-modal 上
_attrs() {
let attrs = { ...this.$attrs }
// 如果全屏就将宽度设为 100%
if (this.innerFullscreen) {
attrs['width'] = '100%'
}
return attrs
},
isNoTitle() {
return !this.title && !this.allSlotsKeys.includes('title')
},
isNoFooter() {
return this._attrs['footer'] === null
},
slotsKeys() {
return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key))
},
scopedSlotsKeys() {
return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key))
},
allSlotsKeys() {
return this.slotsKeys.concat(this.scopedSlotsKeys)
},
// 是否锁定body滚动
lockBodyScroll() {
return this.lockScroll || this.innerFullscreen
}
},
watch: {
visible() {
if (this.visible) {
this.innerFullscreen = this.fullscreen
}
if (this.lockBodyScroll) {
if (this.visible) {
this.bodyOverflowCache = document.body.style.overflow
document.body.style.overflow = 'hidden'
} else {
document.body.style.overflow = this.bodyOverflowCache
}
}
},
innerFullscreen(val) {
this.$emit('update:fullscreen', val)
},
},
methods: {
close() {
this.$emit('update:visible', false)
},
handleOk() {
this.close()
},
handleCancel() {
this.close()
},
toggleFullscreen() {
if (this.innerFullscreen) {
this.fullscreenButtonIcon = 'fullscreen'
} else {
this.fullscreenButtonIcon = 'fullscreen-exit'
}
this.innerFullscreen = !this.innerFullscreen
},
}
}
</script>
<style lang="scss">
.j-modal-box {
&.fullscreen {
top: 0;
left: 0;
padding: 0;
height: 100vh;
& .ant-modal-content {
height: 100vh;
border-radius: 0;
& .ant-modal-body {
/* title 和 footer 各占 55px */
height: calc(100% - 55px - 55px);
overflow: auto;
}
}
&.no-title, &.no-footer {
.ant-modal-body {
height: calc(100% - 55px);
}
}
&.no-title.no-footer {
.ant-modal-body {
height: 100%;
}
}
}
.j-modal-title-row {
.left {
width: calc(100% - 56px - 56px);
}
.right {
width: 56px;
.ant-modal-close {
right: 56px;
color: rgba(0, 0, 0, 0.45);
&:hover {
color: rgba(0, 0, 0, 0.75);
}
}
}
}
/deep/ {
}
}
</style>
\ No newline at end of file
<template> <template>
<div class="j-super-query-box"> <div class="j-super-query-box">
<slot> <div @click="visible=true">
<a-tooltip v-if="superQueryFlag" title="已有高级查询条件生效"> <slot>
<a-button type="primary" @click="visible=true"> <a-tooltip v-if="superQueryFlag" :mouseLeaveDelay="0.2">
<a-icon type="appstore" theme="twoTone" :spin="true"></a-icon> <template slot="title">
<span>高级查询</span> <span>已有高级查询条件生效</span>
</a-button> <a-divider type="vertical"/>
</a-tooltip> <a @click="handleReset">清空</a>
<a-button v-else type="primary" icon="filter" @click="visible=true">高级查询</a-button> </template>
</slot> <a-button type="primary">
<a-icon type="appstore" theme="twoTone" :spin="true"></a-icon>
<span>高级查询</span>
</a-button>
</a-tooltip>
<a-button v-else type="primary" icon="filter" @click="visible=true">高级查询</a-button>
</slot>
</div>
<a-modal <a-modal
title="高级查询构造器" title="高级查询构造器"
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
:multiple="true" :multiple="true"
:action="uploadAction" :action="uploadAction"
:headers="headers" :headers="headers"
:data="{'isup':1,'bizPath':bizPath}" :data="{'biz':bizPath}"
:fileList="fileList" :fileList="fileList"
:beforeUpload="beforeUpload" :beforeUpload="beforeUpload"
@change="handleChange" @change="handleChange"
:disabled="disabled"> :disabled="disabled"
:returnUrl="returnUrl">
<a-button> <a-button>
<a-icon type="upload" />{{ text }} <a-icon type="upload" />{{ text }}
</a-button> </a-button>
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getFileAccessHttpUrl } from '@/api/manage';
const FILE_TYPE_ALL = "all" const FILE_TYPE_ALL = "all"
const FILE_TYPE_IMG = "image" const FILE_TYPE_IMG = "image"
...@@ -38,9 +40,10 @@ ...@@ -38,9 +40,10 @@
data(){ data(){
return { return {
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload", uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
urlDownload:window._CONFIG['domianURL'] + "/sys/common/download/", urlDownload:window._CONFIG['staticDomainURL'],
headers:{}, headers:{},
fileList: [] fileList: [],
newFileList: [],
} }
}, },
props:{ props:{
...@@ -77,11 +80,25 @@ ...@@ -77,11 +80,25 @@
required: false, required: false,
default: false default: false
}, },
/**
* update -- author:lvdandan -- date:20190219 -- for:Jupload组件增加是否返回url,
* true:仅返回url
* false:返回fileName filePath fileSize
*/
returnUrl:{
type:Boolean,
required:false,
default: true
},
}, },
watch:{ watch:{
value(val){ value(val){
if (val instanceof Array) { if (val instanceof Array) {
this.initFileList(val.join(',')) if(this.returnUrl){
this.initFileList(val.join(','))
}else{
this.initFileListArr(val);
}
} else { } else {
this.initFileList(val) this.initFileList(val)
} }
...@@ -93,6 +110,26 @@ ...@@ -93,6 +110,26 @@
}, },
methods:{ methods:{
initFileListArr(val){
if(!val || val.length==0){
this.fileList = [];
return;
}
let fileList = [];
for(var a=0;a<val.length;a++){
fileList.push({
uid:uidGenerator(),
name:val[a].fileName,
status: 'done',
url: val[a].filePath,
response:{
status:"history",
message:val[a].filePath
}
})
}
this.fileList = fileList
},
initFileList(paths){ initFileList(paths){
if(!paths || paths.length==0){ if(!paths || paths.length==0){
//return []; //return [];
...@@ -104,11 +141,12 @@ ...@@ -104,11 +141,12 @@
let fileList = []; let fileList = [];
let arr = paths.split(",") let arr = paths.split(",")
for(var a=0;a<arr.length;a++){ for(var a=0;a<arr.length;a++){
let url = getFileAccessHttpUrl(arr[a],this.urlDownload,"http");
fileList.push({ fileList.push({
uid:uidGenerator(), uid:uidGenerator(),
name:getFileName(arr[a]), name:getFileName(arr[a]),
status: 'done', status: 'done',
url: this.urlDownload+arr[a], url: url,
response:{ response:{
status:"history", status:"history",
message:arr[a] message:arr[a]
...@@ -156,12 +194,13 @@ ...@@ -156,12 +194,13 @@
if(info.file.response.success){ if(info.file.response.success){
fileList = fileList.map((file) => { fileList = fileList.map((file) => {
if (file.response) { if (file.response) {
file.url = this.urlDownload+file.response.message; let reUrl = file.response.message;
file.url = getFileAccessHttpUrl(reUrl,this.urlDownload,"http");
} }
return file; return file;
}); });
} }
this.$message.success(`${info.file.name} 上传成功!`); //this.$message.success(`${info.file.name} 上传成功!`);
}else if (info.file.status === 'error') { }else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`); this.$message.error(`${info.file.name} 上传失败.`);
}else if(info.file.status === 'removed'){ }else if(info.file.status === 'removed'){
...@@ -169,7 +208,26 @@ ...@@ -169,7 +208,26 @@
} }
this.fileList = fileList this.fileList = fileList
if(info.file.status==='done' || info.file.status === 'removed'){ if(info.file.status==='done' || info.file.status === 'removed'){
this.handlePathChange() //returnUrl为true时仅返回文件路径
if(this.returnUrl){
this.handlePathChange()
}else{
//returnUrl为false时返回文件名称、文件路径及文件大小
fileList = fileList.filter((file) => {
if (file.response) {
return file.response.success === true;
}
return false;
}).map((file) => {
var fileJson = {
fileName:file.name,
filePath:file.url,
fileSize:file.size
};
this.newFileList.push(fileJson);
this.$emit('change', this.newFileList);
});
}
} }
}, },
handleDelete(file){ handleDelete(file){
......
import T from './JFormContainer.vue' import JModal from './JModal'
let install = function (Vue) { import JFormContainer from './JFormContainer.vue'
Vue.component('JFormContainer',T);
} export default {
export default { install }; install(Vue) {
\ No newline at end of file Vue.component('JFormContainer', JFormContainer)
Vue.component(JModal.name, JModal)
}
}
\ No newline at end of file
...@@ -17,9 +17,11 @@ ...@@ -17,9 +17,11 @@
selectable selectable
:selectedKeys="selectedDepIds" :selectedKeys="selectedDepIds"
:checkStrictly="true" :checkStrictly="true"
@select="onDepSelect"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree" :treeData="departTree"
:expandAction="false"
:expandedKeys.sync="expandedKeys"
@select="onDepSelect"
/> />
</a-card> </a-card>
</a-col> </a-col>
...@@ -28,7 +30,7 @@ ...@@ -28,7 +30,7 @@
用户账号: 用户账号:
<a-input-search <a-input-search
:style="{width:'150px',marginBottom:'15px'}" :style="{width:'150px',marginBottom:'15px'}"
placeholder="请输入用户账号" placeholder="请输入账号"
v-model="queryParam.username" v-model="queryParam.username"
@search="onSearch" @search="onSearch"
></a-input-search> ></a-input-search>
...@@ -43,6 +45,7 @@ ...@@ -43,6 +45,7 @@
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
:loading="loading"
@change="handleTableChange"> @change="handleTableChange">
</a-table> </a-table>
</a-card> </a-card>
...@@ -71,7 +74,7 @@ ...@@ -71,7 +74,7 @@
dataIndex: 'username' dataIndex: 'username'
}, },
{ {
title: '真实姓名', title: '用户姓名',
align: 'center', align: 'center',
dataIndex: 'realname' dataIndex: 'realname'
}, },
...@@ -90,14 +93,14 @@ ...@@ -90,14 +93,14 @@
} }
}, },
{ {
title: '手机号码', title: '手机',
align: 'center', align: 'center',
dataIndex: 'phone' dataIndex: 'phone'
}, },
{ {
title: '邮箱', title: '部门',
align: 'center', align: 'center',
dataIndex: 'email' dataIndex: 'orgCode'
} }
], ],
scrollTrigger: {}, scrollTrigger: {},
...@@ -124,60 +127,74 @@ ...@@ -124,60 +127,74 @@
selectedDepIds: [], selectedDepIds: [],
departTree: [], departTree: [],
visible: false, visible: false,
form: this.$form.createForm(this) form: this.$form.createForm(this),
loading: false,
expandedKeys: [],
} }
}, },
computed: { computed: {
// 计算属性的 getter // 计算属性的 getter
getType: function () { getType: function () {
console.log("multi: ", this.multi);
return this.multi == true ? 'checkbox' : 'radio'; return this.multi == true ? 'checkbox' : 'radio';
} }
}, },
watch: { watch: {
userIds() { userIds: {
this.initUserNames() immediate: true,
} handler() {
this.initUserNames()
}
},
}, },
created() { created() {
// 该方法触发屏幕自适应 // 该方法触发屏幕自适应
this.resetScreenSize(); this.resetScreenSize();
this.loadData().then((res) => { this.loadData()
this.initUserNames();
})
}, },
methods: { methods: {
initUserNames() { initUserNames() {
let names = ''
console.log("props userIds: ", this.userIds)
if (this.userIds) { if (this.userIds) {
let currUserIds = this.userIds // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
let userIdsArr = currUserIds.split(','); let values = this.userIds.split(',') + ','
for (let item of this.dataSource) { getUserList({
if (userIdsArr.includes(item.username)) { username: values,
names += "," + item.realname pageNo: 1,
pageSize: values.length
}).then((res) => {
if (res.success) {
let selectedRowKeys = []
let realNames = []
res.result.records.forEach(user => {
realNames.push(user['realname'])
selectedRowKeys.push(user['id'])
})
this.selectedRowKeys = selectedRowKeys
this.$emit('initComp', realNames.join(','))
} }
} })
if (names) { } else {
names = names.substring(1)
}
this.$emit("initComp", names)
}else{
// JSelectUserByDep组件bug issues/I16634 // JSelectUserByDep组件bug issues/I16634
this.$emit("initComp", "") this.$emit('initComp', '')
} }
}, },
async loadData(arg) { async loadData(arg) {
if (arg === 1) { if (arg === 1) {
this.ipagination.current = 1; this.ipagination.current = 1;
} }
let params = this.getQueryParams();//查询条件 if (this.selectedDepIds && this.selectedDepIds.length > 0) {
await getUserList(params).then((res) => { await this.initQueryUserByDepId(this.selectedDepIds)
if (res.success) { } else {
this.dataSource = res.result.records; this.loading = true
this.ipagination.total = res.result.total; let params = this.getQueryParams()//查询条件
} await getUserList(params).then((res) => {
}) if (res.success) {
this.dataSource = res.result.records
this.ipagination.total = res.result.total
}
}).finally(() => {
this.loading = false
})
}
}, },
// 触发屏幕自适应 // 触发屏幕自适应
resetScreenSize() { resetScreenSize() {
...@@ -191,6 +208,7 @@ ...@@ -191,6 +208,7 @@
showModal() { showModal() {
this.visible = true; this.visible = true;
this.queryDepartTree(); this.queryDepartTree();
this.initUserNames()
this.loadData(); this.loadData();
this.form.resetFields(); this.form.resetFields();
}, },
...@@ -234,7 +252,6 @@ ...@@ -234,7 +252,6 @@
handleSubmit() { handleSubmit() {
let that = this; let that = this;
this.getSelectUserRows(); this.getSelectUserRows();
console.log(that.selectUserRows)
that.$emit('ok', that.selectUserRows, that.selectUserIds); that.$emit('ok', that.selectUserRows, that.selectUserIds);
that.searchReset(0) that.searchReset(0)
that.close(); that.close();
...@@ -270,17 +287,22 @@ ...@@ -270,17 +287,22 @@
}, },
// 根据选择的id来查询用户信息 // 根据选择的id来查询用户信息
initQueryUserByDepId(selectedDepIds) { initQueryUserByDepId(selectedDepIds) {
queryUserByDepId({id: selectedDepIds.toString()}).then((res) => { this.loading = true
return queryUserByDepId({id: selectedDepIds.toString()}).then((res) => {
if (res.success) { if (res.success) {
this.dataSource = res.result; this.dataSource = res.result;
this.ipagination.total = res.result.length; this.ipagination.total = res.result.length;
} }
}).finally(() => {
this.loading = false
}) })
}, },
queryDepartTree() { queryDepartTree() {
queryDepartTreeList().then((res) => { queryDepartTreeList().then((res) => {
if (res.success) { if (res.success) {
this.departTree = res.result; this.departTree = res.result;
// 默认展开父节点
this.expandedKeys = this.departTree.map(item => item.id)
} }
}) })
}, },
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
width: 200 width: 200
}, },
{ {
title: '用户真实姓名', title: '用户姓名',
align: "center", align: "center",
dataIndex: 'realname', dataIndex: 'realname',
}, },
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
</template> </template>
<script> <script>
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import PageLayout from '../page/PageLayout' import PageLayout from '../page/PageLayout'
import RouteView from './RouteView' import RouteView from './RouteView'
...@@ -40,6 +42,12 @@ ...@@ -40,6 +42,12 @@
/*update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */ /*update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){ if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){
this.closeCurrent(); this.closeCurrent();
//外部url加入token
let tokenStr = "${token}";
if(url.indexOf(tokenStr)!=-1){
let token = Vue.ls.get(ACCESS_TOKEN);
this.url = url.replace(tokenStr,token);
}
window.open(this.url); window.open(this.url);
} }
/*update_end author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */ /*update_end author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
......
...@@ -80,30 +80,41 @@ ...@@ -80,30 +80,41 @@
}, },
created() { created() {
if (this.$route.path != indexKey) { if (this.$route.path != indexKey) {
this.pageList.push({ this.addIndexToFirst()
name: 'dashboard-analysis',
path: indexKey,
fullPath: indexKey,
meta: {
icon: 'dashboard',
title: '首页'
}
})
this.linkList.push(indexKey)
} }
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
let storeKey = 'route:title:' + this.$route.fullPath
let routeTitle = this.$ls.get(storeKey)
if (routeTitle) {
this.$route.meta.title = routeTitle
}
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
this.pageList.push(this.$route) this.pageList.push(this.$route)
this.linkList.push(this.$route.fullPath) this.linkList.push(this.$route.fullPath)
this.activePage = this.$route.fullPath this.activePage = this.$route.fullPath
}, },
watch: { watch: {
'$route': function(newRoute) { '$route': function(newRoute) {
//console.log("新的路由",newRoute)
this.activePage = newRoute.fullPath this.activePage = newRoute.fullPath
if (!this.multipage) { if (!this.multipage) {
this.linkList = [newRoute.fullPath] this.linkList = [newRoute.fullPath]
this.pageList = [Object.assign({},newRoute)] this.pageList = [Object.assign({},newRoute)]
} else if (this.linkList.indexOf(newRoute.fullPath) < 0) { // update-begin-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
} else if(indexKey==newRoute.fullPath) {
//首页时 判断是否缓存 没有缓存 刷新之
if (newRoute.meta.keepAlive === false) {
this.routeReload()
}
// update-end-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
}else if (this.linkList.indexOf(newRoute.fullPath) < 0) {
this.linkList.push(newRoute.fullPath) this.linkList.push(newRoute.fullPath)
this.pageList.push(Object.assign({},newRoute)) this.pageList.push(Object.assign({},newRoute))
// update-begin-author:sunjianlei date:20200103 for: 如果新增的页面配置了缓存路由,那么就强制刷新一遍
if (newRoute.meta.keepAlive) {
this.routeReload()
}
// update-end-author:sunjianlei date:20200103 for: 如果新增的页面配置了缓存路由,那么就强制刷新一遍
} else if (this.linkList.indexOf(newRoute.fullPath) >= 0) { } else if (this.linkList.indexOf(newRoute.fullPath) >= 0) {
let oldIndex = this.linkList.indexOf(newRoute.fullPath) let oldIndex = this.linkList.indexOf(newRoute.fullPath)
let oldPositionRoute = this.pageList[oldIndex] let oldPositionRoute = this.pageList[oldIndex]
...@@ -114,6 +125,7 @@ ...@@ -114,6 +125,7 @@
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)); this.$router.push(Object.assign({},waitRouter));
this.changeTitle(waitRouter.meta.title)
}, },
'multipage': function(newVal) { 'multipage': function(newVal) {
if(this.reloadFlag){ if(this.reloadFlag){
...@@ -122,9 +134,44 @@ ...@@ -122,9 +134,44 @@
this.pageList = [this.$route] this.pageList = [this.$route]
} }
} }
} },
// update-begin-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG
device() {
if (this.multipage && this.linkList.indexOf(indexKey) === -1) {
this.addIndexToFirst()
}
},
// update-end-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG
}, },
methods: { methods: {
// update-begin-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG
// 将首页添加到第一位
addIndexToFirst() {
this.pageList.splice(0, 0, {
name: 'dashboard-analysis',
path: indexKey,
fullPath: indexKey,
meta: {
icon: 'dashboard',
title: '首页'
}
})
this.linkList.splice(0, 0, indexKey)
},
// update-end-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG
// update-begin-author:sunjianlei date:20200120 for: 动态更改页面标题
changeTitle(title) {
let projectTitle = "Jeecg-Boot 企业级快速开发平台"
// 首页特殊处理
if (this.$route.path === indexKey) {
document.title = projectTitle
} else {
document.title = title + ' · ' + projectTitle
}
},
// update-end-author:sunjianlei date:20200120 for: 动态更改页面标题
changePage(key) { changePage(key) {
this.activePage = key this.activePage = key
}, },
...@@ -236,6 +283,9 @@ ...@@ -236,6 +283,9 @@
let currRouter = this.pageList[keyIndex] let currRouter = this.pageList[keyIndex]
let meta = Object.assign({},currRouter.meta,{title:title}) let meta = Object.assign({},currRouter.meta,{title:title})
this.pageList.splice(keyIndex, 1, Object.assign({},currRouter,{meta:meta})) this.pageList.splice(keyIndex, 1, Object.assign({},currRouter,{meta:meta}))
if (key === this.activePage) {
this.changeTitle(title)
}
} }
}, },
//update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title //update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
<div class="footer"> <div class="footer">
<div class="links"> <div class="links">
<a href="http://jeecg-boot.mydoc.io" target="_blank">帮助</a> <a href="http://doc.jeecg.com" target="_blank">帮助</a>
<a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">隐私</a> <a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">隐私</a>
<a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">条款</a> <a href="https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE" target="_blank">条款</a>
</div> </div>
<div class="copyright"> <div class="copyright">
Copyright &copy; 2019 <a href="http://www.jeecg.org" target="_blank">JEECG开源社区</a> 出品 Copyright &copy; 2019 <a href="http://www.jeecg.com" target="_blank">JEECG开源社区</a> 出品
</div> </div>
</div> </div>
</div> </div>
......
<template> <template>
<div class="footer"> <div class="footer">
<div class="links"> <div class="links">
<a href="http://www.jeecg.org" target="_blank">JEECG 首页</a> <a href="http://www.jeecg.com" target="_blank">JEECG 首页</a>
<a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank"> <a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">
<a-icon type="github"/> <a-icon type="github"/>
</a> </a>
......
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
&.dark { &.dark {
color: #000000; color: #000000;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
background-color: @primary-color; background-color: white !important;
} }
} }
......
...@@ -154,6 +154,10 @@ ...@@ -154,6 +154,10 @@
//此处触发动态路由被点击事件 //此处触发动态路由被点击事件
this.findMenuBykey(this.menus,value.key) this.findMenuBykey(this.menus,value.key)
this.$emit("dynamicRouterShow",value.key,this.activeMenu.meta.title) this.$emit("dynamicRouterShow",value.key,this.activeMenu.meta.title)
// update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
let storeKey = 'route:title:' + this.activeMenu.path
this.$ls.set(storeKey, this.activeMenu.meta.title)
// update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
}, },
findMenuBykey(menus,key){ findMenuBykey(menus,key){
for(let i of menus){ for(let i of menus){
...@@ -337,6 +341,10 @@ ...@@ -337,6 +341,10 @@
font-size: 16px; font-size: 16px;
padding: 4px; padding: 4px;
} }
.anticon {
color: white;
}
} }
} }
...@@ -349,6 +357,10 @@ ...@@ -349,6 +357,10 @@
&:hover { &:hover {
background: rgba(0, 0, 0, 0.05); background: rgba(0, 0, 0, 0.05);
} }
.anticon {
color: black;
}
} }
} }
} }
......
<template>
<component
:is="comp"
:formData="formData"
ref="compModel"
v-if="comp">
</component>
</template>
<script>
export default {
name: 'DynamicNotice',
data () {
return {
compName: this.path
}
},
computed: {
comp: function () {
if(!this.path){
return null;
}
return () => import(`@/views/${this.path}.vue`)
}
},
props: ['path','formData'],
methods: {
detail () {
setTimeout(() => {
if(this.path){
this.$refs.compModel.view(this.formData);
}
}, 200)
},
}
}
</script>
\ No newline at end of file
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
</a-badge> </a-badge>
</span> </span>
<show-announcement ref="ShowAnnouncement" @ok="modalFormOk"></show-announcement> <show-announcement ref="ShowAnnouncement" @ok="modalFormOk"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
</a-popover> </a-popover>
</template> </template>
...@@ -79,11 +80,13 @@ ...@@ -79,11 +80,13 @@
import { getAction,putAction } from '@/api/manage' import { getAction,putAction } from '@/api/manage'
import ShowAnnouncement from './ShowAnnouncement' import ShowAnnouncement from './ShowAnnouncement'
import store from '@/store/' import store from '@/store/'
import DynamicNotice from './DynamicNotice'
export default { export default {
name: "HeaderNotice", name: "HeaderNotice",
components: { components: {
DynamicNotice,
ShowAnnouncement, ShowAnnouncement,
}, },
data () { data () {
...@@ -105,6 +108,8 @@ ...@@ -105,6 +108,8 @@
websock: null, websock: null,
lockReconnect:false, lockReconnect:false,
heartCheck:null, heartCheck:null,
formData:{},
openPath:''
} }
}, },
computed:{ computed:{
...@@ -172,7 +177,13 @@ ...@@ -172,7 +177,13 @@
} }
}); });
this.hovered = false; this.hovered = false;
this.$refs.ShowAnnouncement.detail(record); if(record.openType==='component'){
this.openPath = record.openPage;
this.formData = {id:record.busId};
this.$refs.showDynamNotice.detail(record.openPage);
}else{
this.$refs.ShowAnnouncement.detail(record);
}
}, },
toMyAnnouncement(){ toMyAnnouncement(){
......
...@@ -5,11 +5,14 @@ ...@@ -5,11 +5,14 @@
:visible="visible" :visible="visible"
:bodyStyle ="bodyStyle" :bodyStyle ="bodyStyle"
@cancel="handleCancel" @cancel="handleCancel"
destroyOnClose destroyOnClose>
:footer="null">
<template slot="title"> <template slot="title">
<a-button icon="fullscreen" class="custom-btn" @click="handleClickToggleFullScreen"/> <a-button icon="fullscreen" class="custom-btn" @click="handleClickToggleFullScreen"/>
</template> </template>
<template slot="footer">
<a-button key="back" @click="handleCancel">关闭</a-button>
<a-button v-if="record.openType==='url'&&record.readFlag!=='1'" type="primary" @click="toHandle">去处理</a-button>
</template>
<a-card class="daily-article" :loading="loading"> <a-card class="daily-article" :loading="loading">
<a-card-meta <a-card-meta
:title="record.titile" :title="record.titile"
...@@ -74,7 +77,14 @@ ...@@ -74,7 +77,14 @@
this.modelStyle.style.top = '50px' this.modelStyle.style.top = '50px'
} }
this.modelStyle.fullScreen = mode this.modelStyle.fullScreen = mode
} },
toHandle(){
if(this.record.openType==='url'&&this.record.readFlag!== '1'){
this.visible = false;
//链接跳转
this.$router.push({path: this.record.openPage})
}
},
} }
} }
</script> </script>
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<span class="action" @click="showClick"> <span class="action" @click="showClick">
<a-icon type="search"></a-icon> <a-icon type="search"></a-icon>
</span> </span>
<span v-show="shows" class="borders"> <!-- update-begin author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框 -->
<component :is="searchMenuComp" v-show="searchMenuVisible || isMobile()" class="borders" :visible="searchMenuVisible" title="搜索菜单" :footer="null" @cancel="searchMenuVisible=false">
<a-select <a-select
class="search-input" class="search-input"
showSearch showSearch
...@@ -13,16 +14,20 @@ ...@@ -13,16 +14,20 @@
placeholder="搜索菜单" placeholder="搜索菜单"
optionFilterProp="children" optionFilterProp="children"
:filterOption="filterOption" :filterOption="filterOption"
:open="isMobile()?true:null"
:getPopupContainer="(node) => node.parentNode"
:style="isMobile()?{width: '100%',marginBottom:'50px'}:{}"
@change="searchMethods" @change="searchMethods"
@blur="hiddenClick" @blur="hiddenClick"
> >
<a-select-option v-for="site in search " :value="site.id">{{site.meta.title}}</a-select-option> <a-select-option v-for="site in searchMenuOptions" :value="site.id">{{site.meta.title}}</a-select-option>
</a-select> </a-select>
</span> </component>
<!-- update-end author:sunjianlei date:20191@20 for: 解决全局样式冲突的问题 --> <!-- update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框 -->
<!-- update-end author:sunjianlei date:20191220 for: 解决全局样式冲突的问题 -->
<!-- update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航 --> <!-- update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航 -->
<span class="action"> <span class="action">
<a class="logout_title" target="_blank" href="http://jeecg-boot.mydoc.io"> <a class="logout_title" target="_blank" href="http://doc.jeecg.com">
<a-icon type="question-circle-o"></a-icon> <a-icon type="question-circle-o"></a-icon>
</a> </a>
</span> </span>
...@@ -95,9 +100,11 @@ ...@@ -95,9 +100,11 @@
mixins: [mixinDevice], mixins: [mixinDevice],
data(){ data(){
return{ return{
//菜单搜索 // update-begin author:sunjianlei date:20200219 for: 头部菜单搜索规范命名 --------------
search:[], searchMenuOptions:[],
shows:false searchMenuComp: 'span',
searchMenuVisible: false,
// update-begin author:sunjianlei date:20200219 for: 头部菜单搜索规范命名 --------------
} }
}, },
components: { components: {
...@@ -116,10 +123,8 @@ ...@@ -116,10 +123,8 @@
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/ /* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
created() { created() {
let lists = [] let lists = []
console.log("permissionMenuList: ",this.permissionMenuList)
this.searchMenus(lists,this.permissionMenuList) this.searchMenus(lists,this.permissionMenuList)
this.search=[...lists] this.searchMenuOptions=[...lists]
console.log(this.search)
}, },
computed: { computed: {
...mapState({ ...mapState({
...@@ -129,10 +134,21 @@ ...@@ -129,10 +134,21 @@
}) })
}, },
/* update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/ /* update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
watch: {
// update-begin author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框
device: {
immediate: true,
handler() {
this.searchMenuVisible = false
this.searchMenuComp = this.isMobile() ? 'a-modal' : 'span'
},
},
// update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框
},
methods: { methods: {
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/ /* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
showClick(){ showClick() {
this.shows = !this.shows this.searchMenuVisible = true
}, },
hiddenClick(){ hiddenClick(){
this.shows = false this.shows = false
...@@ -141,8 +157,8 @@ ...@@ -141,8 +157,8 @@
...mapActions(["Logout"]), ...mapActions(["Logout"]),
...mapGetters(["nickname", "avatar","userInfo"]), ...mapGetters(["nickname", "avatar","userInfo"]),
getAvatar(){ getAvatar(){
console.log('url = '+ window._CONFIG['imgDomainURL']+"/"+this.avatar()) console.log('url = '+ window._CONFIG['staticDomainURL']+"/"+this.avatar())
return window._CONFIG['imgDomainURL']+"/"+this.avatar() return window._CONFIG['staticDomainURL']+"/"+this.avatar()
}, },
handleLogout() { handleLogout() {
const that = this const that = this
...@@ -189,10 +205,17 @@ ...@@ -189,10 +205,17 @@
filterOption(input, option) { filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
searchMethods(value){ // update_begin author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
let jump = this.search.filter(item=>item.id==value) searchMethods(value) {
this.$router.push({ path:jump[0].path}) let route = this.searchMenuOptions.filter(item => item.id === value)[0]
if (route.meta.internalOrExternal === true || route.component.includes('layouts/IframePageView')) {
window.open(route.meta.url, '_blank')
} else {
this.$router.push({ path: route.path })
}
this.searchMenuVisible = false
} }
// update_end author:sunjianlei date:20191230 for: 解决外部链接打开失败的问题
/*update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/ /*update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
} }
} }
...@@ -203,7 +226,7 @@ ...@@ -203,7 +226,7 @@
/* update-begin author:sunjianlei date:20191220 for: 解决全局样式冲突问题 */ /* update-begin author:sunjianlei date:20191220 for: 解决全局样式冲突问题 */
.user-wrapper .search-input { .user-wrapper .search-input {
width: 180px; width: 180px;
color: white; color: inherit;
/deep/ { /deep/ {
.ant-select-selection { .ant-select-selection {
......
...@@ -18,8 +18,8 @@ import VueApexCharts from 'vue-apexcharts' ...@@ -18,8 +18,8 @@ import VueApexCharts from 'vue-apexcharts'
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'
import "@jeecg/antd-online-re" import "@jeecg/antd-online-214"
import '@jeecg/antd-online-re/dist/OnlineForm.css' import '@jeecg/antd-online-214/dist/OnlineForm.css'
import { import {
ACCESS_TOKEN, ACCESS_TOKEN,
......
...@@ -236,9 +236,9 @@ export const JeecgListMixin = { ...@@ -236,9 +236,9 @@ export const JeecgListMixin = {
return return
} }
if (typeof window.navigator.msSaveBlob !== 'undefined') { if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName+'.xls') window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
}else{ }else{
let url = window.URL.createObjectURL(new Blob([data])) let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
let link = document.createElement('a') let link = document.createElement('a')
link.style.display = 'none' link.style.display = 'none'
link.href = url link.href = url
...@@ -286,7 +286,7 @@ export const JeecgListMixin = { ...@@ -286,7 +286,7 @@ export const JeecgListMixin = {
if(text && text.indexOf(",")>0){ if(text && text.indexOf(",")>0){
text = text.substring(0,text.indexOf(",")) text = text.substring(0,text.indexOf(","))
} }
return window._CONFIG['imgDomainURL']+"/"+text return window._CONFIG['staticDomainURL']+"/"+text
}, },
/* 文件下载 */ /* 文件下载 */
uploadFile(text){ uploadFile(text){
...@@ -297,7 +297,7 @@ export const JeecgListMixin = { ...@@ -297,7 +297,7 @@ export const JeecgListMixin = {
if(text.indexOf(",")>0){ if(text.indexOf(",")>0){
text = text.substring(0,text.indexOf(",")) text = text.substring(0,text.indexOf(","))
} }
window.open(window._CONFIG['domianURL'] + "/sys/common/download/"+text); window.open(window._CONFIG['staticDomainURL']+ "/"+text);
}, },
} }
......
export const HrefJump = {
data() {
return {
fieldHrefSlots: [],
hrefComponent: {
model: {
title: '',
width: '100%',
visible: false,
destroyOnClose: true,
style: {
top: 0,
left: 0,
height: '100%',
margin: 0,
padding: 0
},
bodyStyle: { padding: '8px', height: 'calc(100vh - 108px)', overflow: 'auto', overflowX: 'hidden' },
// 隐藏掉取消按钮
cancelButtonProps: { style: { display: 'none' } },
afterClose: () => {
// 恢复body的滚动
document.body.style.overflow = null
}
},
on: {
ok: () => this.hrefComponent.model.visible = false,
cancel: () => this.hrefComponent.model.visible = false
},
is: null,
params: {},
}
}
},
methods: {
//支持链接href跳转
handleClickFieldHref(field, record) {
let href = field.href
let urlPattern = /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?/
let compPattern = /\.vue(\?.*)?$/
if (typeof href === 'string') {
href = href.trim().replace(/\${([^}]+)?}/g, (s1, s2) => record[s2])
if (urlPattern.test(href)) {
window.open(href, '_blank')
} else if (compPattern.test(href)) {
this.openHrefCompModal(href)
} else {
this.$router.push(href)
}
}
},
openHrefCompModal(href) {
// 解析 href 参数
let index = href.indexOf('?')
let path = href
if (index !== -1) {
path = href.substring(0, index)
let paramString = href.substring(index + 1, href.length)
let paramArray = paramString.split('&')
let params = {}
paramArray.forEach(paramObject => {
let paramItem = paramObject.split('=')
params[paramItem[0]] = paramItem[1]
})
this.hrefComponent.params = params
} else {
this.hrefComponent.params = {}
}
this.hrefComponent.model.visible = true
this.hrefComponent.model.title = '@/views/' + path
this.hrefComponent.is = () => import('@/views/' + (path.startsWith('/')?path.slice(1):path))
// 禁止body滚动,防止滚动穿透
setTimeout(() => {
document.body.style.overflow = 'hidden'
}, 300)
},
}
}
\ No newline at end of file
...@@ -120,6 +120,19 @@ const user = { ...@@ -120,6 +120,19 @@ const user = {
sessionStorage.setItem(USER_AUTH,JSON.stringify(authData)); sessionStorage.setItem(USER_AUTH,JSON.stringify(authData));
sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData)); sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData));
if (menuData && menuData.length > 0) { if (menuData && menuData.length > 0) {
//update--begin--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
menuData.forEach((item, index) => {
if (item["children"]) {
let hasChildrenMenu = item["children"].filter((i) => {
return !i.hidden || i.hidden == false
})
if (hasChildrenMenu == null || hasChildrenMenu.length == 0) {
item["hidden"] = true
}
}
})
console.log(" menu show json ", menuData)
//update--end--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
commit('SET_PERMISSIONLIST', menuData) commit('SET_PERMISSIONLIST', menuData)
} else { } else {
reject('getPermissionList: permissions must be a non-null array !') reject('getPermissionList: permissions must be a non-null array !')
......
import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types" import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"
export function disabledAuthFilter(code,formData) { export function disabledAuthFilter(code,formData) {
...@@ -10,27 +9,30 @@ export function disabledAuthFilter(code,formData) { ...@@ -10,27 +9,30 @@ export function disabledAuthFilter(code,formData) {
} }
function nodeDisabledAuth(code,formData){ function nodeDisabledAuth(code,formData){
console.log("页面权限禁用--NODE--开始"); let permissionList = [];
var permissionList = [];
try { try {
var obj = formData;
//console.log("页面权限禁用--NODE--开始",obj); //console.log("页面权限禁用--NODE--开始",obj);
if (obj) { if (formData) {
let bpmList = obj.permissionList; let bpmList = formData.permissionList;
for (var bpm of bpmList) { permissionList = bpmList.filter(item=>item.type=='2')
if(bpm.type == '2') { // for (let bpm of bpmList) {
permissionList.push(bpm); // if(bpm.type == '2') {
} // permissionList.push(bpm);
} // }
// }
}else{
return false;
} }
} catch (e) { } catch (e) {
//console.log("页面权限异常----", e); //console.log("页面权限异常----", e);
} }
if (permissionList === null || permissionList === "" || permissionList === undefined||permissionList.length<=0) { if (permissionList.length == 0) {
return false; return false;
} }
console.log("流程节点页面权限禁用--NODE--开始");
let permissions = []; let permissions = [];
for (var item of permissionList) { for (let item of permissionList) {
if(item.type == '2') { if(item.type == '2') {
permissions.push(item.action); permissions.push(item.action);
} }
...@@ -39,9 +41,9 @@ function nodeDisabledAuth(code,formData){ ...@@ -39,9 +41,9 @@ function nodeDisabledAuth(code,formData){
if (!permissions.includes(code)) { if (!permissions.includes(code)) {
return false; return false;
}else{ }else{
for (var item2 of permissionList) { for (let item2 of permissionList) {
if(code === item2.action){ if(code === item2.action){
console.log("页面权限禁用--NODE--生效"); console.log("流程节点页面权限禁用--NODE--生效");
return true; return true;
} }
} }
...@@ -50,21 +52,21 @@ function nodeDisabledAuth(code,formData){ ...@@ -50,21 +52,21 @@ function nodeDisabledAuth(code,formData){
} }
function globalDisabledAuth(code){ function globalDisabledAuth(code){
console.log("页面禁用权限--Global--开始"); //console.log("全局页面禁用权限--Global--开始");
var permissionList = []; var permissionList = [];
var allPermissionList = []; var allPermissionList = [];
//let authList = Vue.ls.get(USER_AUTH); //let authList = Vue.ls.get(USER_AUTH);
let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]"); let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
for (var auth of authList) { for (let auth of authList) {
if(auth.type == '2') { if(auth.type == '2') {
permissionList.push(auth); permissionList.push(auth);
} }
} }
//console.log("页面禁用权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH)); //console.log("页面禁用权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]"); let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]");
for (var gauth of allAuthList) { for (let gauth of allAuthList) {
if(gauth.type == '2') { if(gauth.type == '2') {
allPermissionList.push(gauth); allPermissionList.push(gauth);
} }
...@@ -73,7 +75,7 @@ function globalDisabledAuth(code){ ...@@ -73,7 +75,7 @@ function globalDisabledAuth(code){
var gFlag = false;//禁用命中 var gFlag = false;//禁用命中
var invalidFlag = false;//无效命中 var invalidFlag = false;//无效命中
if(allPermissionList != null && allPermissionList != "" && allPermissionList != undefined && allPermissionList.length > 0){ if(allPermissionList != null && allPermissionList != "" && allPermissionList != undefined && allPermissionList.length > 0){
for (var itemG of allPermissionList) { for (let itemG of allPermissionList) {
if(code === itemG.action){ if(code === itemG.action){
if(itemG.status == '0'){ if(itemG.status == '0'){
invalidFlag = true; invalidFlag = true;
...@@ -92,7 +94,7 @@ function globalDisabledAuth(code){ ...@@ -92,7 +94,7 @@ function globalDisabledAuth(code){
return gFlag; return gFlag;
} }
let permissions = []; let permissions = [];
for (var item of permissionList) { for (let item of permissionList) {
if(item.type == '2') { if(item.type == '2') {
permissions.push(item.action); permissions.push(item.action);
} }
...@@ -101,9 +103,9 @@ function globalDisabledAuth(code){ ...@@ -101,9 +103,9 @@ function globalDisabledAuth(code){
if (!permissions.includes(code)) { if (!permissions.includes(code)) {
return gFlag; return gFlag;
}else{ }else{
for (var item2 of permissionList) { for (let item2 of permissionList) {
if(code === item2.action){ if(code === item2.action){
console.log("页面权限解除禁用--Global--生效"); console.log("全局页面权限解除禁用--Global--生效");
gFlag = false; gFlag = false;
} }
} }
...@@ -134,12 +136,12 @@ function hasColoum(item,authList){ ...@@ -134,12 +136,12 @@ function hasColoum(item,authList){
//权限无效时不做控制,有效时控制,只能控制 显示不显示 //权限无效时不做控制,有效时控制,只能控制 显示不显示
//根据授权码前缀获取未授权的列信息 //根据授权码前缀获取未授权的列信息
function getNoAuthCols(pre){ function getNoAuthCols(pre){
var permissionList = []; let permissionList = [];
var allPermissionList = []; let allPermissionList = [];
//let authList = Vue.ls.get(USER_AUTH); //let authList = Vue.ls.get(USER_AUTH);
let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]"); let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
for (var auth of authList) { for (let auth of authList) {
//显示策略,有效状态 //显示策略,有效状态
if(auth.type == '1'&&startWith(auth.action,pre)) { if(auth.type == '1'&&startWith(auth.action,pre)) {
permissionList.push(substrPre(auth.action,pre)); permissionList.push(substrPre(auth.action,pre));
...@@ -147,7 +149,7 @@ function getNoAuthCols(pre){ ...@@ -147,7 +149,7 @@ function getNoAuthCols(pre){
} }
//console.log("页面禁用权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH)); //console.log("页面禁用权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]"); let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]");
for (var gauth of allAuthList) { for (let gauth of allAuthList) {
//显示策略,有效状态 //显示策略,有效状态
if(gauth.type == '1'&&gauth.status == '1'&&startWith(gauth.action,pre)) { if(gauth.type == '1'&&gauth.status == '1'&&startWith(gauth.action,pre)) {
allPermissionList.push(substrPre(gauth.action,pre)); allPermissionList.push(substrPre(gauth.action,pre));
......
...@@ -38,7 +38,7 @@ const getUploadFileList=(paths)=>{ ...@@ -38,7 +38,7 @@ const getUploadFileList=(paths)=>{
uid:uidGenerator(), uid:uidGenerator(),
name:getFileName(arr[a]), name:getFileName(arr[a]),
status: 'done', status: 'done',
url: window._CONFIG['domianURL']+"/sys/common/view/"+arr[a], url: window._CONFIG['staticDomainURL']+"/"+arr[a],
response:{ response:{
status:"history", status:"history",
message:arr[a] message:arr[a]
......
...@@ -2,35 +2,37 @@ import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types" ...@@ -2,35 +2,37 @@ 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("页面权限控制----");
console.time()
//节点权限处理,如果命中则不进行全局权限处理 //节点权限处理,如果命中则不进行全局权限处理
if(!filterNodePermission(el, binding, vnode)){ if(!filterNodePermission(el, binding, vnode)){
filterGlobalPermission(el, binding, vnode); filterGlobalPermission(el, binding, vnode);
} }
console.timeEnd() //计时结束并输出时长
} }
}); });
} }
}; };
/** /**
* 全局权限控制 * 流程节点权限控制
*/ */
export function filterNodePermission(el, binding, vnode) { export function filterNodePermission(el, binding, vnode) {
console.log("页面权限--NODE--"); let permissionList = [];
var permissionList = [];
try { try {
var obj = vnode.context.$props.formData; let obj = vnode.context.$props.formData;
if (obj) { if (obj) {
let bpmList = obj.permissionList; let bpmList = obj.permissionList;
for (var bpm of bpmList) { for (let bpm of bpmList) {
if(bpm.type != '2') { if(bpm.type != '2') {
permissionList.push(bpm); permissionList.push(bpm);
} }
} }
}else{
return false;
} }
} catch (e) { } catch (e) {
//console.log("页面权限异常----", e); //console.log("页面权限异常----", e);
...@@ -39,8 +41,10 @@ export function filterNodePermission(el, binding, vnode) { ...@@ -39,8 +41,10 @@ export function filterNodePermission(el, binding, vnode) {
//el.parentNode.removeChild(el) //el.parentNode.removeChild(el)
return false; return false;
} }
console.log("流程节点页面权限--NODE--");
let permissions = []; let permissions = [];
for (var item of permissionList) { for (let item of permissionList) {
if(item.type != '2') { if(item.type != '2') {
permissions.push(item.action); permissions.push(item.action);
} }
...@@ -51,7 +55,7 @@ export function filterNodePermission(el, binding, vnode) { ...@@ -51,7 +55,7 @@ export function filterNodePermission(el, binding, vnode) {
//el.parentNode.removeChild(el) //el.parentNode.removeChild(el)
return false; return false;
}else{ }else{
for (var item2 of permissionList) { for (let item2 of permissionList) {
if(binding.value === item2.action){ if(binding.value === item2.action){
return true; return true;
} }
...@@ -64,29 +68,29 @@ export function filterNodePermission(el, binding, vnode) { ...@@ -64,29 +68,29 @@ export function filterNodePermission(el, binding, vnode) {
* 全局权限控制 * 全局权限控制
*/ */
export function filterGlobalPermission(el, binding, vnode) { export function filterGlobalPermission(el, binding, vnode) {
console.log("页面权限--Global--"); console.log("全局页面权限--Global--");
var permissionList = []; let permissionList = [];
var allPermissionList = []; let allPermissionList = [];
//let authList = Vue.ls.get(USER_AUTH); //let authList = Vue.ls.get(USER_AUTH);
let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]"); let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
for (var auth of authList) { for (let auth of authList) {
if(auth.type != '2') { if(auth.type != '2') {
permissionList.push(auth); permissionList.push(auth);
} }
} }
//console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH)); //console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]"); let allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || "[]");
for (var gauth of allAuthList) { for (let gauth of allAuthList) {
if(gauth.type != '2') { if(gauth.type != '2') {
allPermissionList.push(gauth); allPermissionList.push(gauth);
} }
} }
//设置全局配置是否有命中 //设置全局配置是否有命中
var invalidFlag = false;//无效命中 let invalidFlag = false;//无效命中
if(allPermissionList != null && allPermissionList != "" && allPermissionList != undefined && allPermissionList.length > 0){ if(allPermissionList != null && allPermissionList != "" && allPermissionList != undefined && allPermissionList.length > 0){
for (var itemG of allPermissionList) { for (let itemG of allPermissionList) {
if(binding.value === itemG.action){ if(binding.value === itemG.action){
if(itemG.status == '0'){ if(itemG.status == '0'){
invalidFlag = true; invalidFlag = true;
...@@ -103,7 +107,7 @@ export function filterGlobalPermission(el, binding, vnode) { ...@@ -103,7 +107,7 @@ export function filterGlobalPermission(el, binding, vnode) {
return; return;
} }
let permissions = []; let permissions = [];
for (var item of permissionList) { for (let item of permissionList) {
if(item.type != '2'){ if(item.type != '2'){
permissions.push(item.action); permissions.push(item.action);
} }
......
...@@ -5,9 +5,16 @@ import { VueAxios } from './axios' ...@@ -5,9 +5,16 @@ 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 } from "@/store/mutation-types"
//自动设置后台服务 baseURL (也可以手工指定写死项目名字)
let baseDomain = window._CONFIG['domianURL'];
let baseProject = baseDomain.substring(baseDomain.lastIndexOf("/"));
console.log("baseDomain= ",baseDomain)
console.log("baseProject= ",baseProject)
// 创建 axios 实例 // 创建 axios 实例
const service = axios.create({ const service = axios.create({
baseURL: '/jeecg-boot', // api base_url //baseURL: '/jeecg-boot',
baseURL: baseProject, // api base_url
timeout: 9000 // 请求超时时间 timeout: 9000 // 请求超时时间
}) })
......
...@@ -257,6 +257,62 @@ export function cssExpand(css, id) { ...@@ -257,6 +257,62 @@ export function cssExpand(css, id) {
document.head.appendChild(style) document.head.appendChild(style)
} }
/** 用于js增强事件,运行JS代码,可以传参 */
// options 所需参数:
// 参数名 类型 说明
// vm VueComponent vue实例
// event Object event对象
// jsCode String 待执行的js代码
// errorMessage String 执行出错后的提示(控制台)
export function jsExpand(options = {}) {
// 绑定到window上的keyName
let windowKeyName = 'J_CLICK_EVENT_OPTIONS'
if (typeof window[windowKeyName] != 'object') {
window[windowKeyName] = {}
}
// 随机生成JS增强的执行id,防止冲突
let id = randomString(16, 'qwertyuioplkjhgfdsazxcvbnm'.toUpperCase())
// 封装按钮点击事件
let code = `
(function (o_${id}) {
try {
(function (globalEvent, vm) {
${options.jsCode}
})(o_${id}.event, o_${id}.vm)
} catch (e) {
o_${id}.error(e)
}
o_${id}.done()
})(window['${windowKeyName}']['EVENT_${id}'])
`
// 创建script标签
const script = document.createElement('script')
// 将需要传递的参数挂载到window对象上
window[windowKeyName]['EVENT_' + id] = {
vm: options.vm,
event: options.event,
// 当执行完成时,无论如何都会调用的回调事件
done() {
// 执行完后删除新增的 script 标签不会撤销执行结果(已产生的结果不会被撤销)
script.outerHTML = ''
delete window[windowKeyName]['EVENT_' + id]
},
// 当js运行出错的时候调用的事件
error(e) {
console.group(`${options.errorMessage || '用户自定义JS增强代码运行出错'}${new Date()})`)
console.error(e)
console.groupEnd()
}
}
// 将事件挂载到document中
script.innerHTML = code
document.body.appendChild(script)
}
/** /**
* 重复值验证工具方法 * 重复值验证工具方法
* *
...@@ -270,12 +326,39 @@ export function cssExpand(css, id) { ...@@ -270,12 +326,39 @@ export function cssExpand(css, id) {
* @param callback * @param callback
*/ */
export function validateDuplicateValue(tableName, fieldName, fieldVal, dataId, callback) { export function validateDuplicateValue(tableName, fieldName, fieldVal, dataId, callback) {
let params = { tableName, fieldName, fieldVal, dataId } if (fieldVal) {
api.duplicateCheck(params).then(res => { let params = { tableName, fieldName, fieldVal, dataId }
res['success'] ? callback() : callback(res['message']) api.duplicateCheck(params).then(res => {
}).catch(err => { res['success'] ? callback() : callback(res['message'])
callback(err.message || err) }).catch(err => {
}) callback(err.message || err)
})
} else {
callback()
}
}
/**
* 根据编码校验规则code,校验传入的值是否合法
*
* 使用示例:
* { validator: (rule, value, callback) => validateCheckRule('common', value, callback) }
*
* @param ruleCode 编码校验规则 code
* @param value 被验证的值
* @param callback
*/
export function validateCheckRule(ruleCode, value, callback) {
if (ruleCode && value) {
value = encodeURIComponent(value)
api.checkRuleByCode({ ruleCode, value }).then(res => {
res['success'] ? callback() : callback(res['message'])
}).catch(err => {
callback(err.message || err)
})
} else {
callback()
}
} }
/** /**
...@@ -295,4 +378,40 @@ export function pushIfNotExist(array, value, key) { ...@@ -295,4 +378,40 @@ export function pushIfNotExist(array, value, key) {
} }
array.push(value) array.push(value)
return true return true
}
/**
* 可用于判断是否成功
* @type {symbol}
*/
export const succeedSymbol = Symbol()
/**
* 可用于判断是否失败
* @type {symbol}
*/
export const failedSymbol = Symbol()
/**
* 使 promise 无论如何都会 resolve,除非传入的参数不是一个Promise对象或返回Promise对象的方法
* 一般用在 Promise.all 中
*
* @param promise 可传Promise对象或返回Promise对象的方法
* @returns {Promise<any>}
*/
export function alwaysResolve(promise) {
return new Promise((resolve, reject) => {
let p = promise
if (typeof promise === 'function') {
p = promise()
}
if (p instanceof Promise) {
p.then(data => {
resolve({ type: succeedSymbol, data })
}).catch(error => {
resolve({ type: failedSymbol, error })
})
} else {
reject('alwaysResolve: 传入的参数不是一个Promise对象或返回Promise对象的方法')
}
})
} }
\ No newline at end of file
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
methods: { methods: {
...mapGetters(["nickname", "avatar"]), ...mapGetters(["nickname", "avatar"]),
getAvatar(){ getAvatar(){
return window._CONFIG['imgDomainURL']+"/"+this.avatar(); return window._CONFIG['staticDomainURL']+"/"+this.avatar();
}, },
getTeams() { getTeams() {
this.$http.get('/api/workplace/teams') this.$http.get('/api/workplace/teams')
......
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
</chart-card> </chart-card>
</a-col> </a-col>
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
<chart-card :loading="loading" title="访问量" :total="8846 | NumberFormat"> <chart-card :loading="loading" title="订单量" :total="8846 | NumberFormat">
<a-tooltip title="指标说明" slot="action"> <a-tooltip title="指标说明" slot="action">
<a-icon type="info-circle-o" /> <a-icon type="info-circle-o" />
</a-tooltip> </a-tooltip>
<div> <div>
<mini-area /> <mini-area />
</div> </div>
<template slot="footer">访问<span> {{ '1234' | NumberFormat }}</span></template> <template slot="footer">订单<span> {{ '1234' | NumberFormat }}</span></template>
</chart-card> </chart-card>
</a-col> </a-col>
<a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</a-col> </a-col>
</a-row> </a-row>
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="访问量" key="2"> <a-tab-pane tab="销售趋势" key="2">
<a-row> <a-row>
<a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
<bar title="销售额趋势" :dataSource="barData"/> <bar title="销售额趋势" :dataSource="barData"/>
...@@ -101,10 +101,10 @@ ...@@ -101,10 +101,10 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-card :loading="loading" :bordered="false" title="最近一周访问次数统计" :style="{ marginTop: '24px' }"> <a-card :loading="loading" :bordered="false" title="最近一周访问统计" :style="{ marginTop: '24px' }">
<a-row> <a-row>
<a-col :span="6"> <a-col :span="6">
<head-info title="今日访问IP数" :content="loginfo.todayIp"></head-info> <head-info title="今日IP" :content="loginfo.todayIp"></head-info>
</a-col> </a-col>
<a-col :span="2"> <a-col :span="2">
<a-spin class='circle-cust'> <a-spin class='circle-cust'>
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
</a-spin> </a-spin>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<head-info title="今日访问次数" :content="loginfo.todayVisitCount"></head-info> <head-info title="今日访问" :content="loginfo.todayVisitCount"></head-info>
</a-col> </a-col>
<a-col :span="2"> <a-col :span="2">
<a-spin class='circle-cust'> <a-spin class='circle-cust'>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
</a-spin> </a-spin>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<head-info title="访问总次数" :content="loginfo.totalVisitCount"></head-info> <head-info title="总访问量" :content="loginfo.totalVisitCount"></head-info>
</a-col> </a-col>
<a-col :span="2"> <a-col :span="2">
<a-spin class='circle-cust'> <a-spin class='circle-cust'>
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
}, },
created() { created() {
this.user = this.userInfo this.user = this.userInfo
this.avatar = window._CONFIG['imgDomainURL'] +"/"+ this.userInfo.avatar this.avatar = window._CONFIG['staticDomainURL'] +"/"+ this.userInfo.avatar
console.log('this.avatar :'+ this.avatar) console.log('this.avatar :'+ this.avatar)
getRoleList().then(res => { getRoleList().then(res => {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="性别"> <a-form-item label="性别">
<j-dict-select-tag v-model="formData.sex" title="性别" dictCode="sex"/> <j-dict-select-tag v-model="formData.sex" title="性别" dictCode="sex" placeholder="请选择性别"/>
<!-- <j-dict-select-tag title="性别" dictCode="sex" disabled/>--> <!-- <j-dict-select-tag title="性别" dictCode="sex" disabled/>-->
</a-form-item> </a-form-item>
</a-col> </a-col>
...@@ -176,34 +176,28 @@ ...@@ -176,34 +176,28 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col> <a-col>
<a-form-item label="最大化弹窗"> <a-form-item label="JModal弹窗">
<a-button @click="()=>modal.visible=true">最大化弹窗</a-button> <a-button style="margin-right: 8px;" @click="()=>modal.visible=true">点击弹出JModal</a-button>
<span style="margin-right: 8px;">全屏化:<a-switch v-model="modal.fullscreen"/></span>
<span style="margin-right: 8px;">允许切换全屏:<a-switch v-model="modal.switchFullscreen"/></span>
<span>锁定Body滚动:<a-switch v-model="modal.lockScroll"/></span>
</a-form-item> </a-form-item>
<a-modal <j-modal
:visible="modal.visible" :visible.sync="modal.visible"
:width="modal.width" :width="1200"
:style="modal.style" :title="modal.title"
@ok="()=>modal.visible=false" :lockScroll="modal.lockScroll"
@cancel="()=>modal.visible=false"> :fullscreen.sync="modal.fullscreen"
:switchFullscreen="modal.switchFullscreen"
<template slot="title"> >
<div style="width: 100%;height:20px;padding-right:32px;">
<div style="float: left;">{{ modal.title }}</div>
<div style="float: right;">
<a-button
icon="fullscreen"
style="width:56px;height:100%;border:0"
@click="handleClickToggleFullScreen"/>
</div>
</div>
</template>
<template v-for="(i,k) of 30"> <template v-for="(i,k) of 30">
<p :key="k">这是主体内容,高度是自适应的</p> <p :key="k">这是主体内容,高度是自适应的</p>
</template> </template>
</a-modal> </j-modal>
</a-col> </a-col>
</a-row> </a-row>
...@@ -217,10 +211,10 @@ ...@@ -217,10 +211,10 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="树字典"> <a-form-item label="树字典">
<j-tree-dict parentCode="B01" /> <j-tree-dict v-model="formData.treeDict" placeholder="请选择树字典" parentCode="A01" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"></a-col> <a-col :span="12">选中的值(v-model):{{ formData.treeDict }}</a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
...@@ -262,6 +256,45 @@ ...@@ -262,6 +256,45 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="高级查询">
<j-super-query :fieldList="superQuery.fieldList" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="高级查询(自定义按钮)">
<j-super-query :fieldList="superQuery.fieldList">
<!-- 直接在内部写一个按钮即可,点击事件自动添加 -->
<a-button type="primary" ghost icon="clock-circle">高级查询</a-button>
</j-super-query>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="图片上传">
<j-image-upload v-model="imgList"></j-image-upload>
</a-form-item>
</a-col>
<a-col :spapn="12">选中的值(v-model):{{ imgList }}</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 65px;margin-bottom:50px;">
<a-col :span="12">
<a-form-item label="文件上传">
<j-upload v-model="fileList"></j-upload>
</a-form-item>
</a-col>
<a-col :spapn="12">
选中的值(v-model):
<j-ellipsis :value="fileList" :length="30" v-if="fileList.length>0"/>
</a-col>
</a-row>
</a-form> </a-form>
</div> </div>
...@@ -286,10 +319,15 @@ ...@@ -286,10 +319,15 @@
import JTreeDict from "../../components/jeecg/JTreeDict.vue"; import JTreeDict from "../../components/jeecg/JTreeDict.vue";
import JCron from "@/components/jeecg/JCron.vue"; import JCron from "@/components/jeecg/JCron.vue";
import JTreeSelect from '@/components/jeecg/JTreeSelect' import JTreeSelect from '@/components/jeecg/JTreeSelect'
import JSuperQuery from '@/components/jeecg/JSuperQuery'
import JUpload from '@/components/jeecg/JUpload'
import JImageUpload from '@/components/jeecg/JImageUpload'
export default { export default {
name: 'SelectDemo', name: 'SelectDemo',
components: { components: {
JImageUpload,
JUpload,
JTreeDict, JTreeDict,
JDictSelectTag, JDictSelectTag,
JSelectDepart, JSelectDepart,
...@@ -299,7 +337,7 @@ ...@@ -299,7 +337,7 @@
JCheckbox, JCheckbox,
JCodeEditor, JCodeEditor,
JDate, JEditor, JEllipsis, JGraphicCode, JSlider, JSelectMultiple, JDate, JEditor, JEllipsis, JGraphicCode, JSlider, JSelectMultiple,
JCron, JTreeSelect JCron, JTreeSelect, JSuperQuery
}, },
data() { data() {
return { return {
...@@ -352,11 +390,20 @@ sayHi('hello, world!')` ...@@ -352,11 +390,20 @@ sayHi('hello, world!')`
modal: { modal: {
title: '这里是标题', title: '这里是标题',
visible: false, visible: false,
width: '100%', lockScroll: true,
style: { top: '20px' }, fullscreen: true,
fullScreen: true switchFullscreen: true,
}, },
cron: '', cron: '',
superQuery: {
fieldList: [
{ type: 'input', value: 'name', text: '姓名', },
{ type: 'select', value: 'sex', text: '性别', dictCode: 'sex' },
{ type: 'number', value: 'age', text: '年龄', }
]
},
fileList:[],
imgList:[],
} }
}, },
computed: { computed: {
...@@ -399,18 +446,6 @@ sayHi('hello, world!')` ...@@ -399,18 +446,6 @@ sayHi('hello, world!')`
handleJSliderSuccess(value) { handleJSliderSuccess(value) {
this.jslider.value = value this.jslider.value = value
}, },
/** 切换全屏显示 */
handleClickToggleFullScreen() {
let mode = !this.modal.fullScreen
if (mode) {
this.modal.width = '100%'
this.modal.style.top = '20px'
} else {
this.modal.width = '1200px'
this.modal.style.top = '50px'
}
this.modal.fullScreen = mode
},
setCorn(data){ setCorn(data){
this.$nextTick(() => { this.$nextTick(() => {
this.form.cronExpression = data; this.form.cronExpression = data;
......
...@@ -19,11 +19,13 @@ ...@@ -19,11 +19,13 @@
<a-cascader :options="areaOptions" @change="onChange" :showSearch="{filter}" placeholder="Please select" /> <a-cascader :options="areaOptions" @change="onChange" :showSearch="{filter}" placeholder="Please select" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="24" :sm="24"> <a-form-item :wrapperCol="{ span: 12, offset: 5 }">
<a-form-item :wrapperCol="{ span: 12, offset: 5 }"> <a-col :md="24" :sm="24">
<a-button type="primary" htmlType="submit">Submit</a-button> <a-form-item :wrapperCol="{ span: 12, offset: 5 }">
</a-form-item> <a-button type="primary" htmlType="submit">Submit</a-button>
</a-col> </a-form-item>
</a-col>
</a-form-item>
</a-form> </a-form>
</a-card> </a-card>
</template> </template>
...@@ -68,4 +70,4 @@ ...@@ -68,4 +70,4 @@
}) })
} }
} }
</script> </script>
\ No newline at end of file
...@@ -35,12 +35,13 @@ ...@@ -35,12 +35,13 @@
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="sex"> label="性别">
<a-select v-decorator="['sex', {}]" placeholder="请选择性别"> <!-- <a-select v-decorator="['sex', {}]" placeholder="请选择性别">
<a-select-option value="">请选择性别</a-select-option> <a-select-option value="">请选择</a-select-option>
<a-select-option value="1">男性</a-select-option> <a-select-option value="1"></a-select-option>
<a-select-option value="2">女性</a-select-option> <a-select-option value="2"></a-select-option>
</a-select> </a-select>-->
<j-dict-select-tag type="radio" v-decorator="['sex', {}]" :trigger-change="true" dictCode="sex"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<a-card :bordered="false"> <a-card :bordered="false">
<a-tabs defaultActiveKey="1" @change="callback"> <a-tabs defaultActiveKey="1" @change="callback">
<a-tab-pane tab="柱状图" key="1"> <a-tab-pane tab="柱状图" key="1">
<a-row :gutter="24"> <a-row>
<a-col :span="10"> <a-col :span="10">
<a-radio-group :value="barType" @change="statisticst"> <a-radio-group :value="barType" @change="statisticst">
<a-radio-button value="year">按年统计</a-radio-button> <a-radio-button value="year">按年统计</a-radio-button>
......
...@@ -43,24 +43,7 @@ ...@@ -43,24 +43,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="身份证扫描件" label="身份证扫描件"
hasFeedback> hasFeedback>
<a-upload <j-image-upload text="上传" v-model="fileList" :isMultiple="true"></j-image-upload>
:action="uploadAction"
listType="picture-card"
:headers="headers"
:fileList="fileList"
@change="handleChange"
@preview="handlePreview"
>
<a-button>
<a-icon type="upload"/>
upload
</a-button>
</a-upload>
<a-modal :visible="previewVisible" :footer="null" @cancel="handlePicCancel">
<img alt="example" style="width: 100%" :src="previewImage"/>
</a-modal>
<br/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
...@@ -88,11 +71,11 @@ ...@@ -88,11 +71,11 @@
import pick from 'lodash.pick' import pick from 'lodash.pick'
import Vue from 'vue' import Vue from 'vue'
import {ACCESS_TOKEN} from "@/store/mutation-types" import {ACCESS_TOKEN} from "@/store/mutation-types"
import JImageUpload from '../../../../components/jeecg/JImageUpload'
import { getUploadFileList,getFilePaths } from '@/utils/commonUploadFile.js'
export default { export default {
name: "JeecgOrderCustomerModal", name: "JeecgOrderCustomerModal",
components: { JImageUpload },
data() { data() {
return { return {
title: "操作", title: "操作",
...@@ -177,7 +160,7 @@ ...@@ -177,7 +160,7 @@
add: "/test/order/addCustomer", add: "/test/order/addCustomer",
edit: "/test/order/editCustomer", edit: "/test/order/editCustomer",
fileUpload: window._CONFIG['domianURL'] + "/sys/common/upload", fileUpload: window._CONFIG['domianURL'] + "/sys/common/upload",
imgerver: window._CONFIG['domianURL'] + "/sys/common/view", imgerver: window._CONFIG['staticDomainURL'],
getOrderCustomerList: "/test/order/listOrderCustomerByMainId", getOrderCustomerList: "/test/order/listOrderCustomerByMainId",
}, },
validatorRules: { validatorRules: {
...@@ -222,8 +205,6 @@ ...@@ -222,8 +205,6 @@
this.form.resetFields(); this.form.resetFields();
this.orderId = record.orderId; this.orderId = record.orderId;
let currFileList = getUploadFileList(record.idcardPic)
this.fileList = [...currFileList]
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
if (record.id) { if (record.id) {
this.hiding = false; this.hiding = false;
...@@ -232,6 +213,9 @@ ...@@ -232,6 +213,9 @@
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'id', 'name', 'sex', 'idcard','telphone', 'orderId', 'createBy', 'createTime', 'updateBy', 'updateTime')) this.form.setFieldsValue(pick(this.model, 'id', 'name', 'sex', 'idcard','telphone', 'orderId', 'createBy', 'createTime', 'updateBy', 'updateTime'))
}); });
setTimeout(() => {
this.fileList = record.idcardPic
}, 5)
} else { } else {
this.addStatus = false; this.addStatus = false;
this.editStatus = true; this.editStatus = true;
...@@ -262,7 +246,7 @@ ...@@ -262,7 +246,7 @@
let formData = Object.assign(this.model, values); let formData = Object.assign(this.model, values);
console.log(formData); console.log(formData);
formData.orderId = this.orderId; formData.orderId = this.orderId;
formData.idcardPic = getFilePaths(this.fileList) formData.idcardPic = this.fileList;
httpAction(httpurl, formData, method).then((res) => { httpAction(httpurl, formData, method).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message); that.$message.success(res.message);
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="表名"> <a-form-item label="表名">
<a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input> <a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="doCgformButton" type="primary" icon="highlight" style="margin-left:8px">自定义按钮</a-button> <a-button @click="doCgformButton" type="primary" icon="highlight">自定义按钮</a-button>
<a-button @click="doEnhanceJs" type="primary" icon="strikethrough" style="margin-left:8px">JS增强</a-button> <a-button @click="doEnhanceJs" type="primary" icon="strikethrough">JS增强</a-button>
<a-button @click="doEnhanceSql" type="primary" icon="filter" style="margin-left:8px">SQL增强</a-button> <a-button @click="doEnhanceSql" type="primary" icon="filter">SQL增强</a-button>
<a-button @click="doEnhanceJava" type="primary" icon="tool" style="margin-left:8px">Java增强</a-button> <a-button @click="doEnhanceJava" type="primary" icon="tool">Java增强</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
删除 删除
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-button> 批量操作
<a-icon type="down"/> <a-icon type="down"/>
</a-button> </a-button>
</a-dropdown> </a-dropdown>
...@@ -348,6 +348,9 @@ ...@@ -348,6 +348,9 @@
} }
} }
</script> </script>
<style scoped>
@import '~@assets/less/common.less';
</style>
<style lang="less"> <style lang="less">
.ant-card-body .table-operator { .ant-card-body .table-operator {
margin-bottom: 18px; margin-bottom: 18px;
......
...@@ -6,18 +6,22 @@ ...@@ -6,18 +6,22 @@
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="表名"> <a-form-item label="表名">
<a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input> <a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="表类型"> <a-form-item label="表类型">
<j-dict-select-tag dictCode="cgform_table_type" v-model="queryParam.tableType"/> <j-dict-select-tag dictCode="cgform_table_type" v-model="queryParam.tableType"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-col :md="6" :sm="24"> <a-form-item label="表描述">
<a-input placeholder="请输入表描述" v-model="queryParam.tableTxt"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
...@@ -31,12 +35,12 @@ ...@@ -31,12 +35,12 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<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 @click="doCgformButton" type="primary" icon="highlight" style="margin-left:8px">自定义按钮</a-button> <a-button @click="doCgformButton" type="primary" icon="highlight">自定义按钮</a-button>
<a-button @click="doEnhanceJs" type="primary" icon="strikethrough" style="margin-left:8px">JS增强</a-button> <a-button @click="doEnhanceJs" type="primary" icon="strikethrough">JS增强</a-button>
<a-button @click="doEnhanceSql" type="primary" icon="filter" v-has="'online:sql'" style="margin-left:8px">SQL增强</a-button> <a-button @click="doEnhanceSql" type="primary" icon="filter">SQL增强</a-button>
<a-button @click="doEnhanceJava" type="primary" icon="tool" style="margin-left:8px">Java增强</a-button> <a-button @click="doEnhanceJava" type="primary" icon="tool">Java增强</a-button>
<a-button @click="importOnlineForm" type="primary" icon="database" style="margin-left:8px">从数据库导入表单</a-button> <a-button @click="importOnlineForm" type="primary" icon="database">从数据库导入表单</a-button>
<a-button @click="goGenerateCode" v-has="'online:goGenerateCode'" type="primary" icon="database" style="margin-left:8px">代码生成</a-button> <a-button @click="goGenerateCode" type="primary" icon="database">代码生成</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay"> <a-menu slot="overlay">
...@@ -45,7 +49,7 @@ ...@@ -45,7 +49,7 @@
删除 删除
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-button> 批量操作
<a-icon type="down"/> <a-icon type="down"/>
</a-button> </a-button>
</a-dropdown> </a-dropdown>
...@@ -204,8 +208,12 @@ ...@@ -204,8 +208,12 @@
title: '表类型', title: '表类型',
align: 'center', align: 'center',
dataIndex: 'tableType', dataIndex: 'tableType',
customRender: (text) => { customRender: (text, record) => {
return filterDictText(this.tableTypeDictOptions, `${text}`) let tbTypeText = filterDictText(this.tableTypeDictOptions, `${text}`)
if(record.isTree === 'Y'){
tbTypeText+='(树)'
}
return tbTypeText;
} }
}, },
{ {
...@@ -316,10 +324,14 @@ ...@@ -316,10 +324,14 @@
this.syncFormId = id this.syncFormId = id
}, },
goPageOnline(rd) { goPageOnline(rd) {
if(rd.isTree=='Y'){ if(rd.themeTemplate === 'erp'){
this.$router.push({ path: '/online/cgformTreeList/' + rd.id }) this.$router.push({ path: '/online/cgformErpList/' + rd.id })
}else{ }else{
this.$router.push({ path: '/online/cgformList/' + rd.id }) if(rd.isTree=='Y'){
this.$router.push({ path: '/online/cgformTreeList/' + rd.id })
}else{
this.$router.push({ path: '/online/cgformList/' + rd.id })
}
} }
}, },
handleOnlineUrlClose() { handleOnlineUrlClose() {
...@@ -438,6 +450,9 @@ ...@@ -438,6 +450,9 @@
} }
} }
</script> </script>
<style scoped>
@import '~@assets/less/common.less';
</style>
<style lang="less"> <style lang="less">
.ant-card-body .table-operator { .ant-card-body .table-operator {
margin-bottom: 18px; margin-bottom: 18px;
......
...@@ -98,15 +98,6 @@ ...@@ -98,15 +98,6 @@
<a-menu-item > <a-menu-item >
<a @click="handleDetail(record)">详情</a> <a @click="handleDetail(record)">详情</a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="showSubmitFlowButton(record)">
<a @click="startProcess(record)">提交流程</a>
</a-menu-item>
<template v-if="showViewFlowButton(record)">
<a-menu-item @click="handlePreviewPic(record)">审批进度</a-menu-item>
</template>
<a-menu-item v-if="showOptButton('delete',record)"> <a-menu-item v-if="showOptButton('delete',record)">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteOne(record)">
<a>删除</a> <a>删除</a>
...@@ -146,7 +137,7 @@ ...@@ -146,7 +137,7 @@
export default { export default {
name: 'OnlCgformTreeList', name: 'OnlCgformTreeList',
components: { components: {
JImportModal JImportModal,
}, },
data() { data() {
return { return {
...@@ -183,7 +174,6 @@ ...@@ -183,7 +174,6 @@
optPre:"/online/cgform/api/form/", optPre:"/online/cgform/api/form/",
exportXls:'/online/cgform/api/exportXls/', exportXls:'/online/cgform/api/exportXls/',
buttonAction:'/online/cgform/api/doButton', buttonAction:'/online/cgform/api/doButton',
startProcess: "/process/extActProcess/startMutilProcess"
}, },
isorter:{ isorter:{
column: 'create_time', column: 'create_time',
...@@ -482,7 +472,7 @@ ...@@ -482,7 +472,7 @@
if(text && text.indexOf(",")>0){ if(text && text.indexOf(",")>0){
text = text.substring(0,text.indexOf(",")) text = text.substring(0,text.indexOf(","))
} }
return window._CONFIG['imgDomainURL']+"/"+text return window._CONFIG['staticDomainURL']+"/"+text
}, },
downloadRowFile(text){ downloadRowFile(text){
if(!text){ if(!text){
...@@ -492,7 +482,7 @@ ...@@ -492,7 +482,7 @@
if(text.indexOf(",")>0){ if(text.indexOf(",")>0){
text = text.substring(0,text.indexOf(",")) text = text.substring(0,text.indexOf(","))
} }
window.open(window._CONFIG['downloadUrl']+"/"+text); window.open(window._CONFIG['staticDomainURL']+"/"+text);
}, },
/*-------数据格式化-end----------*/ /*-------数据格式化-end----------*/
...@@ -651,14 +641,6 @@ ...@@ -651,14 +641,6 @@
} }
return true return true
}, },
showSubmitFlowButton(record){
if(this.hasBpmStatus){
if(record.bpm_status ==null || record.bpm_status =='' || record.bpm_status == '1'){
return true
}
}
return false
},
showViewFlowButton(record){ showViewFlowButton(record){
if(this.hasBpmStatus){ if(this.hasBpmStatus){
if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){ if(record.bpm_status !=null && record.bpm_status !='' && record.bpm_status != '1'){
...@@ -691,6 +673,7 @@ ...@@ -691,6 +673,7 @@
} }
}); });
}, },
} }
} }
</script> </script>
......
<template>
<a-card :bordered="false" style="height: 100%">
<online-common-list
:ref="'onl_'+mainModel.currentTableName"
:code="code"
:model="mainModel"
@seleted="onSelected">
</online-common-list>
<a-tabs defaultActiveKey="0">
<a-tab-pane v-for="(item,index) in subList" :tab="item.description" :key="index+''" :forceRender="true" >
<online-common-list
:ref="item.currentTableName"
:code="item.code"
:model="item"
:main="selectedRow">
</online-common-list>
</a-tab-pane>
</a-tabs>
</a-card>
</template>
<script>
import { getAction } from '@/api/manage'
export default {
name: 'OnlCgformErpList',
components:{
},
data(){
return {
code:'',
url: {
getColumns: '/online/cgform/api/getErpColumns/',
},
mainModel:{},
subList:[],
mainId:'',
selectedRow:{}
}
},
watch: {
'$route'() {
// 刷新参数放到这里去触发,就可以刷新相同界面了
this.initColumnConfig()
}
},
created() {
this.initColumnConfig();
},
methods:{
getSubIndex(index){
return index+1 + ''
},
getSubRef(item){
let ref = item.currentTableName
console.log("ref string",ref)
return ref;
},
initColumnConfig(){
if(!this.$route.params.code){
return false
}
this.code = this.$route.params.code
getAction(`${this.url.getColumns}${this.code}`).then((res)=>{
console.log("erp表单配置",res)
if(res.success){
this.mainModel = res.result.main
this.subList = res.result.subList
this.$nextTick(()=>{
this.$refs['onl_'+this.mainModel.currentTableName].initListByModel();
if(this.subList && this.subList.length>0){
for(let item of this.subList){
this.$refs[item.currentTableName][0].initListByModel();
}
}
});
}
})
},
onSelected(row){
console.log("onSelected",row)
this.selectedRow = row;
}
}
}
</script>
<style>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td{
padding-top:15px;
padding-bottom:15px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.anty-img-wrap{height:25px;position: relative;}
.anty-img-wrap > img{max-height:100%;}
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
</style>
\ No newline at end of file
...@@ -109,6 +109,7 @@ export function getMasterTableInitialData() { ...@@ -109,6 +109,7 @@ export function getMasterTableInitialData() {
// table2 // table2
isShowForm: '0', isShowForm: '0',
isShowList: '0', isShowList: '0',
isReadOnly: '1',
fieldShowType: 'text', fieldShowType: 'text',
fieldLength: '120', fieldLength: '120',
queryMode: 'single', queryMode: 'single',
......
...@@ -31,7 +31,21 @@ ...@@ -31,7 +31,21 @@
@change="handleChange"> @change="handleChange">
<a-button> <a-button>
<a-icon type="upload"/> <a-icon type="upload"/>
文件上传 OSS文件上传
</a-button>
</a-upload>
<a-upload
name="file"
:multiple="false"
:action="minioUploadAction"
:headers="tokenHeader"
:showUploadList="false"
:beforeUpload="beforeUpload"
@change="handleChange">
<a-button>
<a-icon type="upload"/>
MINIO文件上传
</a-button> </a-button>
</a-upload> </a-upload>
</div> </div>
...@@ -58,7 +72,9 @@ ...@@ -58,7 +72,9 @@
@change="handleTableChange"> @change="handleTableChange">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="ossDelete(record.id)">删除</a> <a @click="handlePreview(record)">预览</a>
<a-divider type="vertical"/>
<a @click="ossDelete(record.id)">删除</a>
</span> </span>
</a-table> </a-table>
...@@ -108,14 +124,18 @@ ...@@ -108,14 +124,18 @@
url: { url: {
upload: "/oss/file/upload", upload: "/oss/file/upload",
list: "/oss/file/list", list: "/oss/file/list",
delete: "/oss/file/delete" delete: "/oss/file/delete",
minioUpload: "/sys/upload/uploadMinio"
} }
} }
}, },
computed: { computed: {
uploadAction() { uploadAction() {
return window._CONFIG['domianURL'] + this.url.upload; return window._CONFIG['domianURL'] + this.url.upload;
} },
minioUploadAction() {
return window._CONFIG['domianURL'] + this.url.minioUpload;
},
}, },
methods: { methods: {
beforeUpload(file) { beforeUpload(file) {
...@@ -139,10 +159,10 @@ ...@@ -139,10 +159,10 @@
this.loadData() this.loadData()
this.$message.success(`${info.file.name} 上传成功!`); this.$message.success(`${info.file.name} 上传成功!`);
} else { } else {
this.$message.error(`${info.file.name} 上传失败.`); this.$message.error(`${info.file.response.message}`);
} }
} else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`); this.$message.error(`${info.file.response.message}`);
} }
}, },
ossDelete(id) { ossDelete(id) {
...@@ -154,11 +174,17 @@ ...@@ -154,11 +174,17 @@
that.handleDelete(id) that.handleDelete(id)
} }
}); });
},
handlePreview(record) {
if (record && record.url) {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(record.url)
window.open(url, '_blank')
}
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
</style> </style>
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px"> <div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a-alert type="info" :showIcon="true"> <a-alert type="info" :showIcon="true">
<div slot="message"> <div slot="message">
当前选择: 当前选择:<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
<a v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</a>
<a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a> <a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a>
</div> </div>
</a-alert> </a-alert>
...@@ -72,82 +71,90 @@ ...@@ -72,82 +71,90 @@
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-card :bordered="false"> <a-tabs defaultActiveKey="1">
<a-form :form="form"> <a-tab-pane tab="基本信息" key="1" >
<a-form-item <a-card :bordered="false">
:labelCol="labelCol" <a-form :form="form">
:wrapperCol="wrapperCol" <a-form-item
label="机构名称"> :labelCol="labelCol"
<a-input placeholder="请输入机构/部门名称" v-decorator="['departName', validatorRules.departName ]"/> :wrapperCol="wrapperCol"
</a-form-item> label="机构名称">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门"> <a-input placeholder="请输入机构/部门名称" v-decorator="['departName', validatorRules.departName ]"/>
<a-tree-select </a-form-item>
style="width:100%" <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" <a-tree-select
:treeData="treeData" style="width:100%"
:disabled="disable" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
v-model="model.parentId" :treeData="treeData"
placeholder="无"> :disabled="disable"
</a-tree-select> v-model="model.parentId"
</a-form-item> placeholder="无">
<a-form-item </a-tree-select>
:labelCol="labelCol" </a-form-item>
:wrapperCol="wrapperCol" <a-form-item
label="机构编码"> :labelCol="labelCol"
<a-input disabled placeholder="请输入机构编码" v-decorator="['orgCode', validatorRules.orgCode ]"/> :wrapperCol="wrapperCol"
</a-form-item> label="机构编码">
<a-form-item <a-input disabled placeholder="请输入机构编码" v-decorator="['orgCode', validatorRules.orgCode ]"/>
:labelCol="labelCol" </a-form-item>
:wrapperCol="wrapperCol" <a-form-item
label="机构类型"> :labelCol="labelCol"
<template v-if="orgCategoryDisabled"> :wrapperCol="wrapperCol"
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型"> label="机构类型">
<a-radio value="1"> <template v-if="orgCategoryDisabled">
公司 <a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
</a-radio> <a-radio value="1">
</a-radio-group> 公司
</template> </a-radio>
<template v-else> </a-radio-group>
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型"> </template>
<a-radio value="2"> <template v-else>
部门 <a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
</a-radio> <a-radio value="2">
<a-radio value="3"> 部门
岗位 </a-radio>
</a-radio> <a-radio value="3">
</a-radio-group> 岗位
</template> </a-radio>
</a-form-item> </a-radio-group>
<a-form-item </template>
:labelCol="labelCol" </a-form-item>
:wrapperCol="wrapperCol" <a-form-item
label="排序"> :labelCol="labelCol"
<a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/> :wrapperCol="wrapperCol"
</a-form-item> label="排序">
<a-form-item <a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/>
:labelCol="labelCol" </a-form-item>
:wrapperCol="wrapperCol" <a-form-item
label="手机号"> :labelCol="labelCol"
<a-input placeholder="请输入手机号" v-decorator="['mobile', {'initialValue':''}]"/> :wrapperCol="wrapperCol"
</a-form-item> label="手机号">
<a-form-item <a-input placeholder="请输入手机号" v-decorator="['mobile', {'initialValue':''}]"/>
:labelCol="labelCol" </a-form-item>
:wrapperCol="wrapperCol" <a-form-item
label="地址"> :labelCol="labelCol"
<a-input placeholder="请输入地址" v-decorator="['address', {'initialValue':''}]"/> :wrapperCol="wrapperCol"
</a-form-item> label="地址">
<a-form-item <a-input placeholder="请输入地址" v-decorator="['address', {'initialValue':''}]"/>
:labelCol="labelCol" </a-form-item>
:wrapperCol="wrapperCol" <a-form-item
label="备注"> :labelCol="labelCol"
<a-textarea placeholder="请输入备注" v-decorator="['memo', {'initialValue':''}]"/> :wrapperCol="wrapperCol"
</a-form-item> label="备注">
</a-form> <a-textarea placeholder="请输入备注" v-decorator="['memo', {'initialValue':''}]"/>
<div class="anty-form-btn"> </a-form-item>
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button> </a-form>
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">修改并保存</a-button> <div class="anty-form-btn">
</div> <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
</a-card> <a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">修改并保存</a-button>
</div>
</a-card>
</a-tab-pane>
<a-tab-pane tab="部门权限" key="2" forceRender>
<depart-auth-modal ref="departAuth"/>
</a-tab-pane>
</a-tabs>
</a-col> </a-col>
<depart-modal ref="departModal" @ok="loadTree"></depart-modal> <depart-modal ref="departModal" @ok="loadTree"></depart-modal>
</a-row> </a-row>
...@@ -158,6 +165,7 @@ ...@@ -158,6 +165,7 @@
import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api' import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api'
import {httpAction, deleteAction} from '@/api/manage' import {httpAction, deleteAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import DepartAuthModal from './modules/DepartAuthModal'
// 表头 // 表头
const columns = [ const columns = [
{ {
...@@ -201,6 +209,7 @@ ...@@ -201,6 +209,7 @@
name: 'DepartList', name: 'DepartList',
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
components: { components: {
DepartAuthModal,
DepartModal DepartModal
}, },
data() { data() {
...@@ -403,7 +412,7 @@ ...@@ -403,7 +412,7 @@
this.selectedKeys = [record.key] this.selectedKeys = [record.key]
this.model.parentId = record.parentId this.model.parentId = record.parentId
this.setValuesToForm(record) this.setValuesToForm(record)
this.$refs.departAuth.show(record.id);
}, },
// 触发onSelect事件时,为部门树右侧的form表单赋值 // 触发onSelect事件时,为部门树右侧的form表单赋值
...@@ -425,6 +434,7 @@ ...@@ -425,6 +434,7 @@
this.currSelected = {} this.currSelected = {}
this.form.resetFields() this.form.resetFields()
this.selectedKeys = [] this.selectedKeys = []
this.$refs.departAuth.departId = ''
}, },
handleNodeTypeChange(val) { handleNodeTypeChange(val) {
this.currSelected.nodeType = val this.currSelected.nodeType = val
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/> <a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/>
<!-- 树--> <!-- 树-->
<template> <template v-if="userIdentity === '2' && departTree.length>0">
<!--组织机构--> <!--组织机构-->
<a-tree <a-tree
...@@ -16,10 +16,14 @@ ...@@ -16,10 +16,14 @@
@select="onSelect" @select="onSelect"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree" :treeData="departTree"
:autoExpandParent="autoExpandParent"
/> />
</template> </template>
<div style="margin-top: 24px;" v-else-if="userIdentity === '2' && departTree.length==0">
<h3><span>您的部门下暂无有效部门信息</span></h3>
</div>
<div style="margin-top: 24px;" v-else><h3>普通员工暂此权限</h3></div>
</div> </div>
</a-card> </a-card>
</a-col> </a-col>
...@@ -30,7 +34,10 @@ ...@@ -30,7 +34,10 @@
<Dept-Base-Info ref="DeptBaseInfo"></Dept-Base-Info> <Dept-Base-Info ref="DeptBaseInfo"></Dept-Base-Info>
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="用户信息" key="2"> <a-tab-pane tab="用户信息" key="2">
<Dept-User-Info ref="DeptUserInfo"></Dept-User-Info> <Dept-User-Info ref="DeptUserInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"></Dept-User-Info>
</a-tab-pane>
<a-tab-pane tab="部门角色" key="3" forceRender>
<dept-role-info ref="DeptRoleInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"/>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
...@@ -40,13 +47,15 @@ ...@@ -40,13 +47,15 @@
<script> <script>
import DeptBaseInfo from './modules/DeptBaseInfo' import DeptBaseInfo from './modules/DeptBaseInfo'
import DeptUserInfo from './modules/DeptUserInfo' import DeptUserInfo from './modules/DeptUserInfo'
import {queryDepartTreeList, searchByKeywords} from '@/api/api' import {queryMyDepartTreeList, searchByKeywords} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import DeptRoleInfo from './modules/DeptRoleInfo'
export default { export default {
name: 'DepartUserList', name: 'DepartUserList',
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
components: { components: {
DeptRoleInfo,
DeptBaseInfo, DeptBaseInfo,
DeptUserInfo, DeptUserInfo,
}, },
...@@ -85,6 +94,7 @@ ...@@ -85,6 +94,7 @@
nodes: [], nodes: [],
edges: [] edges: []
}, },
userIdentity:"",
} }
}, },
methods: { methods: {
...@@ -94,12 +104,19 @@ ...@@ -94,12 +104,19 @@
loadData() { loadData() {
this.refresh(); this.refresh();
}, },
clearSelectedDepartKeys() {
this.checkedKeys = [];
this.selectedKeys = [];
this.currentDeptId = '';
this.$refs.DeptUserInfo.currentDeptId='';
this.$refs.DeptRoleInfo.currentDeptId='';
},
loadTree() { loadTree() {
var that = this var that = this
that.treeData = [] that.treeData = []
that.departTree = [] that.departTree = []
queryDepartTreeList().then((res) => { queryMyDepartTreeList().then((res) => {
if (res.success) { if (res.success && res.result ) {
for (let i = 0; i < res.result.length; i++) { for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i] let temp = res.result[i]
that.treeData.push(temp) that.treeData.push(temp)
...@@ -109,6 +126,7 @@ ...@@ -109,6 +126,7 @@
} }
this.loading = false this.loading = false
} }
that.userIdentity = res.message
}) })
}, },
setThisExpandedKeys(node) { setThisExpandedKeys(node) {
...@@ -161,6 +179,7 @@ ...@@ -161,6 +179,7 @@
this.$refs.DeptBaseInfo.open(record); this.$refs.DeptBaseInfo.open(record);
this.$refs.DeptUserInfo.open(record); this.$refs.DeptUserInfo.open(record);
this.$refs.DeptRoleInfo.open(record);
// } // }
// else { // else {
// this.checkedKeys = []; // this.checkedKeys = [];
...@@ -180,6 +199,8 @@ ...@@ -180,6 +199,8 @@
this.$refs.DeptBaseInfo.open(record); this.$refs.DeptBaseInfo.open(record);
this.$refs.DeptUserInfo.onClearSelected(); this.$refs.DeptUserInfo.onClearSelected();
this.$refs.DeptUserInfo.open(record); this.$refs.DeptUserInfo.open(record);
this.$refs.DeptRoleInfo.onClearSelected();
this.$refs.DeptRoleInfo.open(record);
}, },
}, },
created() { created() {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :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-button type="primary" icon="sync" @click="refleshCache()">刷新缓存</a-button>
<a-button type="primary" icon="hdd" @click="openDeleteList">回收站</a-button> <a-button type="primary" icon="hdd" @click="openDeleteList">回收站</a-button>
</div> </div>
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
import DictModal from './modules/DictModal' import DictModal from './modules/DictModal'
import DictItemList from './DictItemList' import DictItemList from './DictItemList'
import DictDeleteList from './DictDeleteList' import DictDeleteList from './DictDeleteList'
import { getAction } from '@/api/manage'
export default { export default {
name: "DictList", name: "DictList",
...@@ -132,6 +134,7 @@ ...@@ -132,6 +134,7 @@
delete: "/sys/dict/delete", delete: "/sys/dict/delete",
exportXlsUrl: "sys/dict/exportXls", exportXlsUrl: "sys/dict/exportXls",
importExcelUrl: "sys/dict/importExcel", importExcelUrl: "sys/dict/importExcel",
refleshCache: "sys/dict/refleshCache",
}, },
} }
}, },
...@@ -165,9 +168,18 @@ ...@@ -165,9 +168,18 @@
that.queryParam.dictCode = ""; that.queryParam.dictCode = "";
that.loadData(this.ipagination.current); that.loadData(this.ipagination.current);
}, },
openDeleteList(){ openDeleteList(){
this.$refs.dictDeleteList.show() this.$refs.dictDeleteList.show()
},
refleshCache(){
getAction(this.url.refleshCache).then((res) => {
if (res.success) {
this.$message.success("刷新缓存完成!");
}
}).catch(e=>{
this.$message.warn("刷新缓存失败!");
console.log("刷新失败",e)
})
} }
}, },
watch: { watch: {
......
...@@ -29,7 +29,9 @@ ...@@ -29,7 +29,9 @@
:dataSource="dataSource" :dataSource="dataSource"
:loading="loading" :loading="loading"
@expand="expandSubmenu" @expand="expandSubmenu"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"> :expandedRowKeys="expandedRowKeys"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@expandedRowsChange="handleExpandedRowsChange">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
...@@ -79,7 +81,7 @@ ...@@ -79,7 +81,7 @@
<script> <script>
import PermissionModal from './modules/PermissionModal' import PermissionModal from './modules/PermissionModal'
import { getSystemMenuList,getSystemSubmenu } from '@/api/api' import { getSystemMenuList, getSystemSubmenu, getSystemSubmenuBatch } from '@/api/api'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PermissionDataRuleList from './PermissionDataRuleList' import PermissionDataRuleList from './PermissionDataRuleList'
import JEllipsis from '@/components/jeecg/JEllipsis' import JEllipsis from '@/components/jeecg/JEllipsis'
...@@ -140,7 +142,7 @@ ...@@ -140,7 +142,7 @@
] ]
export default { export default {
name: 'PermissionList', name: 'PermissionListAsync',
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
components: { components: {
PermissionDataRuleList, PermissionDataRuleList,
...@@ -153,6 +155,8 @@ ...@@ -153,6 +155,8 @@
// 表头 // 表头
columns: columns, columns: columns,
loading: false, loading: false,
// 展开的行,受控属性
expandedRowKeys: [],
url: { url: {
list: '/sys/permission/list', list: '/sys/permission/list',
delete: '/sys/permission/delete', delete: '/sys/permission/delete',
...@@ -162,23 +166,45 @@ ...@@ -162,23 +166,45 @@
}, },
methods: { methods: {
loadData() { loadData() {
this.dataSource = [] this.loading = true
getSystemMenuList().then((res) => { getSystemMenuList().then((res) => {
if (res.success) { if (res.success) {
console.log(res.result)
this.dataSource = res.result this.dataSource = res.result
return this.loadDataByExpandedRows(this.dataSource)
} }
}).finally(()=>{
this.loading = false
}) })
}, },
expandSubmenu(expanded, record){ expandSubmenu(expanded, record){
if(expanded){ if (expanded && (!record.children || record.children.length === 0)) {
getSystemSubmenu({parentId:record.id}).then((res) => { getSystemSubmenu({parentId:record.id}).then((res) => {
if (res.success) { if (res.success) {
record.children = res.result record.children = res.result
} }
}) })
} }
},
// 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据)
loadDataByExpandedRows(dataList) {
if (this.expandedRowKeys.length > 0) {
return getSystemSubmenuBatch({ parentIds: this.expandedRowKeys.join(',') }).then((res) => {
if (res.success) {
let childrenMap = res.result
let fn = (list) => {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = childrenMap[data.id]
fn(data.children)
}
})
}
fn(dataList)
}
})
} else {
return Promise.resolve()
}
}, },
// 打开数据规则编辑 // 打开数据规则编辑
handleDataRule(record) { handleDataRule(record) {
...@@ -189,10 +215,13 @@ ...@@ -189,10 +215,13 @@
this.$refs.modalForm.localMenuType = 1; this.$refs.modalForm.localMenuType = 1;
this.$refs.modalForm.disableSubmit = false; this.$refs.modalForm.disableSubmit = false;
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id}); this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
} },
handleExpandedRowsChange(expandedRows) {
this.expandedRowKeys = expandedRows
},
} }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
</style> </style>
\ No newline at end of file
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
:pagination="false" :pagination="false"
:dataSource="dataSource" :dataSource="dataSource"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"> :expandedRowKeys="expandedRowKeys"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@expandedRowsChange="handleExpandedRowsChange">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
...@@ -152,6 +154,8 @@ ...@@ -152,6 +154,8 @@
// 表头 // 表头
columns: columns, columns: columns,
loading: false, loading: false,
// 展开的行,受控属性
expandedRowKeys: [],
url: { url: {
list: '/sys/permission/list', list: '/sys/permission/list',
delete: '/sys/permission/delete', delete: '/sys/permission/delete',
...@@ -178,10 +182,13 @@ ...@@ -178,10 +182,13 @@
this.$refs.modalForm.localMenuType = 1; this.$refs.modalForm.localMenuType = 1;
this.$refs.modalForm.disableSubmit = false; this.$refs.modalForm.disableSubmit = false;
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id}); this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
} },
handleExpandedRowsChange(expandedRows) {
this.expandedRowKeys = expandedRows
},
} }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
</style> </style>
\ No newline at end of file
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(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" />
......
...@@ -60,26 +60,27 @@ ...@@ -60,26 +60,27 @@
:rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}" :rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
@change="handleTableChange"> @change="handleTableChange">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleOpen(record)">用户</a> <a @click="handleOpen(record)">用户</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link"> <a-dropdown>
更多 <a-icon type="down"/> <a class="ant-dropdown-link">
</a> 更多 <a-icon type="down"/>
<a-menu slot="overlay"> </a>
<a-menu-item> <a-menu slot="overlay">
<a @click="handlePerssion(record.id)">授权</a> <a-menu-item>
</a-menu-item> <a @click="handlePerssion(record.id)">授权</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-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)"> <a-menu-item>
<a>删除</a> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)">
</a-popconfirm> <a>删除</a>
</a-menu-item> </a-popconfirm>
</a-menu> </a-menu-item>
</a-dropdown> </a-menu>
</a-dropdown>
</span> </span>
</a-table> </a-table>
</div> </div>
...@@ -530,7 +531,7 @@ ...@@ -530,7 +531,7 @@
}, },
handlePerssion(roleId){ handlePerssion(roleId){
this.$refs.modalUserRole.show(roleId); this.$refs.modalUserRole.show(roleId);
} },
} }
} }
</script> </script>
......
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="规则名称">
<a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="规则Code">
<a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"/>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
</template>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<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="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('编码校验规则')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<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 -->
<a-alert type="info" showIcon style="margin-bottom: 16px;">
<template slot="message">
<span>已选择</span>
<a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
<span></span>
<template v-if="selectedRowKeys.length>0">
<a-divider type="vertical"/>
<a @click="onClearSelected">清空</a>
</template>
</template>
</a-alert>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<template slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a @click="handleTest(record)">功能测试</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
<span>更多</span>
<a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="handleDelete(record.id)">删除</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
</a-table>
<!-- table区域-end -->
<!-- 表单区域 -->
<sys-check-rule-modal ref="modalForm" @ok="modalFormOk"/>
<sys-check-rule-test-modal ref="testModal"/>
</a-card>
</template>
<script>
import JEllipsis from '@/components/jeecg/JEllipsis'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import SysCheckRuleModal from './modules/SysCheckRuleModal'
import SysCheckRuleTestModal from './modules/SysCheckRuleTestModal'
export default {
name: 'SysCheckRuleList',
mixins: [JeecgListMixin],
components: { SysCheckRuleModal, SysCheckRuleTestModal, JEllipsis },
data() {
return {
description: '编码校验规则管理页面',
// 表头
columns: [
{
title: '#',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: (t, r, i) => i + 1
},
{
title: '规则名称',
align: 'center',
dataIndex: 'ruleName'
},
{
title: '规则Code',
align: 'center',
dataIndex: 'ruleCode'
},
{
title: '规则描述',
align: 'center',
dataIndex: 'ruleDescription',
customRender: (t) => (<j-ellipsis value={t} length={48}/>)
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' },
}
],
url: {
list: '/sys/checkRule/list',
delete: '/sys/checkRule/delete',
deleteBatch: '/sys/checkRule/deleteBatch',
exportXlsUrl: 'sys/checkRule/exportXls',
importExcelUrl: 'sys/checkRule/importExcel',
},
}
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
},
methods: {
handleTest(record) {
this.$refs.testModal.open(record.ruleCode)
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="数据源名称">
<a-input placeholder="请输入数据源名称" v-model="queryParam.name"/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="数据库类型">
<j-dict-select-tag v-model="queryParam.dbType" placeholder="请选择数据库类型" dict-code="database_type"/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('多数据源管理')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<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>
<a-alert type="info" showIcon style="margin-bottom: 16px;">
<template slot="message">
<span>已选择</span>
<a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
<span></span>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</template>
</a-alert>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sys-data-source-modal ref="modalForm" @ok="modalFormOk"/>
</a-card>
</template>
<script>
import JEllipsis from '@/components/jeecg/JEllipsis'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import SysDataSourceModal from './modules/SysDataSourceModal'
export default {
name: 'SysDataSourceList',
mixins: [JeecgListMixin],
components: { JEllipsis, SysDataSourceModal },
data() {
let ellipsis = (v, l = 20) => (<j-ellipsis value={v} length={l}/>)
return {
description: '多数据源管理管理页面',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: (t, r, index) => index + 1
},
{
title: '数据源名称',
align: 'center',
dataIndex: 'name'
},
{
title: '数据源编码',
align: 'center',
dataIndex: 'code'
},
{
title: '备注',
align: 'center',
dataIndex: 'remark',
customRender: (t) => ellipsis(t)
},
{
title: '数据库类型',
align: 'center',
dataIndex: 'dbType_dictText'
},
{
title: '驱动类',
align: 'center',
dataIndex: 'dbDriver',
customRender: (t) => ellipsis(t)
},
{
title: '数据源地址',
align: 'center',
dataIndex: 'dbUrl',
customRender: (t) => ellipsis(t)
},
{
title: '数据库名称',
align: 'center',
dataIndex: 'dbName'
},
{
title: '用户名',
align: 'center',
dataIndex: 'dbUsername'
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' },
}
],
url: {
list: '/sys/dataSource/list',
delete: '/sys/dataSource/delete',
deleteBatch: '/sys/dataSource/deleteBatch',
exportXlsUrl: 'sys/dataSource/exportXls',
importExcelUrl: 'sys/dataSource/importExcel',
},
}
},
computed: {
importExcelUrl() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
},
methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
</span> </span>
</a-table> </a-table>
<show-announcement ref="ShowAnnouncement"></show-announcement> <show-announcement ref="ShowAnnouncement"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
</a-card> </a-card>
</template> </template>
...@@ -54,11 +55,13 @@ ...@@ -54,11 +55,13 @@
import { getAction,putAction } from '@/api/manage' import { getAction,putAction } from '@/api/manage'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement' import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import DynamicNotice from '../../components/tools/DynamicNotice'
export default { export default {
name: "UserAnnouncementList", name: "UserAnnouncementList",
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
components: { components: {
DynamicNotice,
ShowAnnouncement ShowAnnouncement
}, },
data () { data () {
...@@ -130,6 +133,7 @@ ...@@ -130,6 +133,7 @@
readAllMsg:"sys/sysAnnouncementSend/readAll", readAllMsg:"sys/sysAnnouncementSend/readAll",
}, },
loading:false, loading:false,
openPath:''
} }
}, },
methods: { methods: {
...@@ -143,7 +147,13 @@ ...@@ -143,7 +147,13 @@
this.loadData(); this.loadData();
} }
}); });
this.$refs.ShowAnnouncement.detail(record); if(record.openType==='component'){
this.openPath = record.openPage;
this.formData = {id:record.busId};
this.$refs.showDynamNotice.detail();
}else{
this.$refs.ShowAnnouncement.detail(record);
}
}, },
readAll(){ readAll(){
var that = this; var that = this;
......
...@@ -66,10 +66,12 @@ ...@@ -66,10 +66,12 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus">添加用户</a-button> <a-button @click="handleAdd" type="primary" icon="plus">添加用户</a-button>
<a-button @click="handleSyncUser" v-has="'user:syncbpm'" 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" :headers="tokenHeader" :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-button type="primary" icon="hdd" @click="recycleBinVisible=true">回收站</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay" @click="handleMenuClick"> <a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="1"> <a-menu-item key="1">
...@@ -171,17 +173,22 @@ ...@@ -171,17 +173,22 @@
<password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal> <password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal>
<sys-user-agent-modal ref="sysUserAgentModal"></sys-user-agent-modal> <sys-user-agent-modal ref="sysUserAgentModal"></sys-user-agent-modal>
<!-- 用户回收站 -->
<user-recycle-bin-modal :visible.sync="recycleBinVisible" @ok="modalFormOk"/>
</a-card> </a-card>
</template> </template>
<script> <script>
import UserModal from './modules/UserModal' import UserModal from './modules/UserModal'
import PasswordModal from './modules/PasswordModal' import PasswordModal from './modules/PasswordModal'
import {putAction} from '@/api/manage'; import {putAction,getFileAccessHttpUrl} from '@/api/manage';
import {frozenBatch} from '@/api/api' import {frozenBatch} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import SysUserAgentModal from "./modules/SysUserAgentModal"; import SysUserAgentModal from "./modules/SysUserAgentModal";
import JInput from '@/components/jeecg/JInput' import JInput from '@/components/jeecg/JInput'
import UserRecycleBinModal from './modules/UserRecycleBinModal'
export default { export default {
name: "UserList", name: "UserList",
...@@ -190,12 +197,14 @@ ...@@ -190,12 +197,14 @@
SysUserAgentModal, SysUserAgentModal,
UserModal, UserModal,
PasswordModal, PasswordModal,
JInput JInput,
UserRecycleBinModal
}, },
data() { data() {
return { return {
description: '这是用户管理页面', description: '这是用户管理页面',
queryParam: {}, queryParam: {},
recycleBinVisible: false,
columns: [ columns: [
/*{ /*{
title: '#', title: '#',
...@@ -214,7 +223,7 @@ ...@@ -214,7 +223,7 @@
width: 120 width: 120
}, },
{ {
title: '真实姓名', title: '用户姓名',
align: "center", align: "center",
width: 100, width: 100,
dataIndex: 'realname', dataIndex: 'realname',
...@@ -237,7 +246,7 @@ ...@@ -237,7 +246,7 @@
{ {
title: '生日', title: '生日',
align: "center", align: "center",
width: 180, width: 100,
dataIndex: 'birthday' dataIndex: 'birthday'
}, },
{ {
...@@ -247,9 +256,10 @@ ...@@ -247,9 +256,10 @@
dataIndex: 'phone' dataIndex: 'phone'
}, },
{ {
title: '邮箱', title: '部门',
align: "center", align: "center",
dataIndex: 'email' width: 180,
dataIndex: 'orgCode'
}, },
{ {
title: '状态', title: '状态',
...@@ -257,13 +267,6 @@ ...@@ -257,13 +267,6 @@
width: 80, width: 80,
dataIndex: 'status_dictText' dataIndex: 'status_dictText'
}, },
/* {
title: '创建时间',
align: "center",
width: 150,
dataIndex: 'createTime',
sorter: true
},*/
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
...@@ -274,7 +277,7 @@ ...@@ -274,7 +277,7 @@
], ],
url: { url: {
imgerver: window._CONFIG['domianURL'] + "/sys/common/view", imgerver: window._CONFIG['staticDomainURL'],
syncUser: "/process/extActProcess/doSyncUser", syncUser: "/process/extActProcess/doSyncUser",
list: "/sys/user/list", list: "/sys/user/list",
delete: "/sys/user/delete", delete: "/sys/user/delete",
...@@ -291,7 +294,7 @@ ...@@ -291,7 +294,7 @@
}, },
methods: { methods: {
getAvatarView: function (avatar) { getAvatarView: function (avatar) {
return this.url.imgerver + "/" + avatar; return getFileAccessHttpUrl(avatar,this.url.imgerver,"http")
}, },
batchFrozen: function (status) { batchFrozen: function (status) {
...@@ -363,6 +366,8 @@ ...@@ -363,6 +366,8 @@
this.$refs.sysUserAgentModal.agentSettings(username); this.$refs.sysUserAgentModal.agentSettings(username);
this.$refs.sysUserAgentModal.title = "用户代理人设置"; this.$refs.sysUserAgentModal.title = "用户代理人设置";
}, },
handleSyncUser() {
},
passwordModalOk() { passwordModalOk() {
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下 //TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
} }
...@@ -372,4 +377,4 @@ ...@@ -372,4 +377,4 @@
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less'
</style> </style>
\ No newline at end of file
<template> <template>
<a-card :loading="cardLoading" :bordered="false" style="height: 100%;"> <a-card :loading="cardLoading" :bordered="false" style="height: 100%;">
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="输入组织机构名称进行查询..."/> <a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="输入机构名称查询..." allowClear enterButton />
<a-tree <a-tree
showLine showLine
...@@ -67,20 +67,21 @@ ...@@ -67,20 +67,21 @@
promise.then(res => { promise.then(res => {
if (res.success) { if (res.success) {
this.treeDataSource = res.result this.treeDataSource = res.result
// update-begin- --- author:wangshuai ------ date:20200102 ---- for:去除默认选中第一条数据、默认展开所有第一级
// 默认选中第一条数据、默认展开所有第一级 // 默认选中第一条数据、默认展开所有第一级
if (res.result.length > 0) { // if (res.result.length > 0) {
this.expandedKeys = [] // this.expandedKeys = []
res.result.forEach((item, index) => { // res.result.forEach((item, index) => {
if (index === 0) { // if (index === 0) {
this.selectedKeys = [item.id] // this.selectedKeys = [item.id]
this.emitInput(item.orgCode) // this.emitInput(item.orgCode)
} // }
this.expandedKeys.push(item.id) // this.expandedKeys.push(item.id)
}) // })
} // }
// update-end- --- author:wangshuai ------ date:20200102 ---- for:去除默认选中第一条数据、默认展开所有第一级
} else { } else {
this.$message.warn('组织机构查询失败:' + res.message) this.$message.warn(res.message)
console.error('组织机构查询失败:', res) console.error('组织机构查询失败:', res)
} }
}).finally(() => { }).finally(() => {
......
...@@ -66,12 +66,6 @@ ...@@ -66,12 +66,6 @@
customRender: (t, r, i) => parseInt(i) + 1 customRender: (t, r, i) => parseInt(i) + 1
}, },
{ {
title: '部门',
width: '20%',
align: 'center',
dataIndex: 'departName'
},
{
title: '姓名', title: '姓名',
width: '15%', width: '15%',
align: 'center', align: 'center',
...@@ -84,6 +78,12 @@ ...@@ -84,6 +78,12 @@
dataIndex: 'workNo' dataIndex: 'workNo'
}, },
{ {
title: '部门',
width: '20%',
align: 'center',
dataIndex: 'departName'
},
{
title: '职务', title: '职务',
width: '15%', width: '15%',
align: 'center', align: 'center',
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
customRender: (text) => (text || '').split(',').map(t => this.positionInfo[t] ? this.positionInfo[t] : t).join(',') customRender: (text) => (text || '').split(',').map(t => this.positionInfo[t] ? this.positionInfo[t] : t).join(',')
}, },
{ {
title: '机', title: '机',
width: '15%', width: '15%',
align: 'center', align: 'center',
dataIndex: 'telephone' dataIndex: 'telephone'
...@@ -130,14 +130,26 @@ ...@@ -130,14 +130,26 @@
methods: { methods: {
loadData(pageNum, orgCode) { loadData(pageNum, orgCode) {
if (!orgCode) { this.loading = true
return
}
//加载数据 若传入参数1则加载第一页的内容
if (pageNum === 1) { if (pageNum === 1) {
this.ipagination.current = 1 this.ipagination.current = 1
} }
this.loading = true // update-begin- --- author:wangshuai ------ date:20200102 ---- for:传过来的部门编码为空全查
if (!orgCode) {
getAction(this.url.list, {
...this.getQueryParams()
}).then((res) => {
if (res.success) {
this.dataSource = res.result.records
this.ipagination.total = res.result.total
}
}).finally(() => {
this.loading = false
this.cardLoading = false
})
// update-end- --- author:wangshuai ------ date:20200102 ---- for:传过来的部门编码为空全查
}else{
//加载数据 若传入参数1则加载第一页的内容
getAction(this.url.list, { getAction(this.url.list, {
orgCode, orgCode,
...this.getQueryParams() ...this.getQueryParams()
...@@ -150,6 +162,7 @@ ...@@ -150,6 +162,7 @@
this.loading = false this.loading = false
this.cardLoading = false this.cardLoading = false
}) })
}
}, },
searchQuery() { searchQuery() {
......
<template>
<a-card :bordered="false">
<template v-if="this.departId">
<a-form>
<a-form-item label='所拥有的权限'>
<a-tree
checkable
@check="onCheck"
:checkedKeys="checkedKeys"
:treeData="treeData"
@expand="onExpand"
@select="onTreeNodeSelect"
:selectedKeys="selectedKeys"
:expandedKeys="expandedKeysss"
:checkStrictly="checkStrictly"
style="height:500px;overflow: auto;">
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
{{ slotTitle }}
<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
</span>
</a-tree>
</a-form-item>
</a-form>
<div class="anty-form-btn">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<!-- 简化Tree逻辑,使用默认checkStrictly为false的行为,即默认父子关联
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
-->
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
<a-button style="float: right" @click="handleSubmit" type="primary" htmlType="button" icon="form">保存</a-button>
</div>
</template>
<div v-else style="height:330px;"><h3>请先选择一个部门!</h3></div>
<depart-datarule-modal ref="datarule"/>
</a-card>
</template>
<script>
import {queryTreeListForRole,queryDepartPermission,saveDepartPermission} from '@/api/api'
import DepartDataruleModal from './DepartDataruleModal'
export default {
name: 'DepartAuthModal',
components: { DepartDataruleModal },
data(){
return {
departId:"",
treeData: [],
defaultCheckedKeys:[],
checkedKeys:[],
halfCheckedKeys:[],
expandedKeysss:[],
allTreeKeys:[],
autoExpandParent: true,
checkStrictly: false,
title:"部门权限配置",
visible: false,
loading: false,
selectedKeys:[]
}
},
methods: {
onTreeNodeSelect(id){
if(id && id.length>0){
this.selectedKeys = id
}
this.$refs.datarule.show(this.selectedKeys[0],this.departId)
},
onCheck (checkedKeys, { halfCheckedKeys }) {
// 保存选中的和半选中的,后面保存的时候合并提交
this.checkedKeys = checkedKeys
this.halfCheckedKeys = halfCheckedKeys
},
show(departId){
this.departId=departId
this.loadData();
},
close () {
this.reset()
this.$emit('close');
this.visible = false;
},
onExpand(expandedKeys){
this.expandedKeysss = expandedKeys;
this.autoExpandParent = false
},
reset () {
this.expandedKeysss = []
this.checkedKeys = []
this.defaultCheckedKeys = []
this.loading = false
},
expandAll () {
this.expandedKeysss = this.allTreeKeys
},
closeAll () {
this.expandedKeysss = []
},
checkALL () {
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
this.checkedKeys = []
},
handleCancel () {
this.close()
},
handleSubmit() {
let that = this;
if(!that.departId){
this.$message.warning('请点击选择一个部门!')
}
let checkedKeys = [...that.checkedKeys, ...that.halfCheckedKeys]
const permissionIds = checkedKeys.join(",")
let params = {
departId:that.departId,
permissionIds,
lastpermissionIds:that.defaultCheckedKeys.join(","),
};
that.loading = true;
saveDepartPermission(params).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loading = false;
that.loadData();
}else {
that.$message.error(res.message);
that.loading = false;
}
})
},
convertTreeListToKeyLeafPairs(treeList, keyLeafPair = []) {
for(const {key, isLeaf, children} of treeList) {
keyLeafPair.push({key, isLeaf})
if(children && children.length > 0) {
this.convertTreeListToKeyLeafPairs(children, keyLeafPair)
}
}
return keyLeafPair;
},
emptyCurrForm() {
this.form.resetFields()
},
loadData(){
queryTreeListForRole().then((res) => {
this.treeData = res.result.treeList
this.allTreeKeys = res.result.ids
const keyLeafPairs = this.convertTreeListToKeyLeafPairs(this.treeData)
queryDepartPermission({departId:this.departId}).then((res)=>{
// 过滤出 leaf node 即可,即选中的
// Tree组件中checkStrictly默认为false的时候,选中子节点,父节点会自动设置选中或半选中
// 保存 checkedKeys 以及 halfCheckedKeys 以便于未做任何操作时提交表单数据
const checkedKeys = [...res.result].filter(key => {
const keyLeafPair = keyLeafPairs.filter(item => item.key === key)[0]
return keyLeafPair && keyLeafPair.isLeaf
})
const halfCheckedKeys = [...res.result].filter(key => {
const keyLeafPair = keyLeafPairs.filter(item => item.key === key)[0]
return keyLeafPair && !keyLeafPair.isLeaf
})
this.checkedKeys = [...checkedKeys];
this.halfCheckedKeys = [...halfCheckedKeys]
this.defaultCheckedKeys = [...halfCheckedKeys, ...checkedKeys];
this.expandedKeysss = this.allTreeKeys;
})
})
}
},
}
</script>
<style scoped>
</style>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment