Jeecg-Boot 2.2.0 版本发布 | 重磅升级

This commit is contained in:
zhangdaiscott
2020-05-03 12:43:53 +08:00
parent c4ac8d716b
commit b87ac50420
335 changed files with 12894 additions and 27387 deletions

View File

@ -79,26 +79,30 @@
{
title: '表名',
align: 'center',
dataIndex: 'dataTable'
dataIndex: 'dataTable',
width: "120"
}, {
title: '数据ID',
align: 'center',
dataIndex: 'dataId'
dataIndex: 'dataId',
width: "120"
}, {
title: '版本号',
align: 'center',
dataIndex: 'dataVersion'
dataIndex: 'dataVersion',
width: "50"
}, {
title: '数据内容',
align: 'center',
dataIndex: 'dataContent',
width: "120px",
width: "150",
scopedSlots: {customRender: 'dataContent'},
}, {
title: '创建人',
align: 'center',
dataIndex: 'createBy'
}
dataIndex: 'createBy',
width: "100"
},
],
url: {
list: "/sys/dataLog/list",

View File

@ -5,8 +5,8 @@
<!-- 按钮操作区域 -->
<a-row style="margin-left: 14px">
<a-button @click="handleAdd(2)" type="primary">添加部门</a-button>
<a-button @click="handleAdd(1)" type="primary">添加一级部门</a-button>
<a-button @click="handleAdd(1)" type="primary">添加部门</a-button>
<a-button @click="handleAdd(2)" type="primary">添加下级</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
@ -73,7 +73,7 @@
<a-col :md="12" :sm="24">
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="基本信息" key="1" >
<a-card :bordered="false">
<a-card :bordered="false" v-if="selectedKeys.length>0">
<a-form :form="form">
<a-form-item
:labelCol="labelCol"
@ -146,9 +146,14 @@
</a-form>
<div class="anty-form-btn">
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">修改并保存</a-button>
<a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
</div>
</a-card>
<a-card v-else >
<a-empty>
<span slot="description"> 请先选择一个部门! </span>
</a-empty>
</a-card>
</a-tab-pane>
<a-tab-pane tab="部门权限" key="2" forceRender>
<depart-auth-modal ref="departAuth"/>
@ -224,6 +229,7 @@
visible: false,
departTree: [],
rightClickSelectedKey: '',
rightClickSelectedOrgCode: '',
hiding: true,
model: {},
dropTrigger: '',
@ -282,6 +288,8 @@
that.departTree = []
queryDepartTreeList().then((res) => {
if (res.success) {
//部门全选后,再添加部门,选中数量增多
this.allTreeKeys = [];
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
that.treeData.push(temp)
@ -311,6 +319,7 @@
this.dropTrigger = 'contextmenu'
console.log(node.node.eventKey)
this.rightClickSelectedKey = node.node.eventKey
this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
},
onExpand(expandedKeys) {
console.log('onExpand', expandedKeys)
@ -422,8 +431,10 @@
}else{
this.orgCategoryDisabled = false;
}
this.form.getFieldDecorator('fax', {initialValue: ''})
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
this.$nextTick(() => {
this.form.getFieldDecorator('fax', {initialValue: ''})
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
})
},
getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title
@ -486,7 +497,7 @@
} else if (num == 2) {
let key = this.currSelected.key
if (!key) {
this.$message.warning('请先选中一条记录!')
this.$message.warning('请先点击选中上级部门!')
return false
}
this.$refs.departModal.add(this.selectedKeys)
@ -497,12 +508,26 @@
}
},
handleDelete() {
deleteByDepartId({id: this.rightClickSelectedKey}).then((resp) => {
if (resp.success) {
this.$message.success('删除成功!')
this.loadTree()
} else {
this.$message.warning('删除失败!')
var that = this
this.$confirm({
title: '确认删除',
content: '确定要删除此部门以及子节点数据吗?',
onOk: function () {
deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => {
if (resp.success) {
//删除成功后,去除已选中中的数据
that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1);
that.$message.success('删除成功!')
that.loadTree()
//删除后同步清空右侧基本信息内容
let orgCode=that.form.getFieldValue("orgCode");
if(orgCode && orgCode === that.rightClickSelectedOrgCode){
that.onClearSelected()
}
} else {
that.$message.warning('删除失败!')
}
})
}
})
},

View File

@ -17,6 +17,8 @@
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree"
:autoExpandParent="autoExpandParent"
:expandedKeys="iExpandedKeys"
@expand="onExpand"
/>
</template>
@ -99,7 +101,7 @@
},
methods: {
callback(key) {
console.log(key)
//console.log(key)
},
loadData() {
this.refresh();
@ -130,11 +132,15 @@
})
},
setThisExpandedKeys(node) {
//只展开一级目录
if (node.children && node.children.length > 0) {
this.iExpandedKeys.push(node.key)
//下方代码放开注释则默认展开所有节点
/**
for (let a = 0; a < node.children.length; a++) {
this.setThisExpandedKeys(node.children[a])
}
*/
}
},
refresh() {
@ -153,7 +159,7 @@
onSearch(value) {
let that = this
if (value) {
searchByKeywords({keyWord: value}).then((res) => {
searchByKeywords({keyWord: value,myDeptSearch:'1'}).then((res) => {
if (res.success) {
that.departTree = []
for (let i = 0; i < res.result.length; i++) {

View File

@ -79,6 +79,8 @@
methods: {
handleCancel(){
this.visible = false
//回收站字典列表刷新
this.$emit("refresh")
},
show(){
this.visible = true
@ -106,14 +108,25 @@
})
},
handleDelete(id){
deleteAction("/sys/dict/deletePhysic/"+id).then(res=>{
if(res.success){
this.$message.success(res.message)
this.loadData();
}else{
this.$message.warning(res.message)
}
})
this.$confirm({
title: '彻底删除字典',
content: (<div>
<p>您确定要彻底删除这个字典项吗</p>
<p style="color:red;">注意彻底删除后将无法恢复请谨慎操作</p>
</div>),
centered: false,
onOk: () => {
var that = this;
deleteAction("/sys/dict/deletePhysic/"+id).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.loadData();
} else {
that.$message.warning(res.message);
}
});
},
})
}
}

View File

@ -171,6 +171,10 @@
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
if (this.superQueryParams) {
param['superQueryParams'] = encodeURI(this.superQueryParams)
param['superQueryMatchType'] = this.superQueryMatchType
}
return filterObj(param);
},

View File

@ -61,7 +61,7 @@
</div>
<dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 -->
<dict-item-list ref="dictItemList"></dict-item-list>
<dict-delete-list ref="dictDeleteList"></dict-delete-list>
<dict-delete-list ref="dictDeleteList" @refresh="() =>loadData()"></dict-delete-list>
</a-card>
</template>
@ -72,6 +72,8 @@
import DictItemList from './DictItemList'
import DictDeleteList from './DictDeleteList'
import { getAction } from '@/api/manage'
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
import Vue from 'vue'
export default {
name: "DictList",
@ -135,6 +137,7 @@
exportXlsUrl: "sys/dict/exportXls",
importExcelUrl: "sys/dict/importExcel",
refleshCache: "sys/dict/refleshCache",
queryAllDictItems: "sys/dict/queryAllDictItems",
},
}
},
@ -149,6 +152,10 @@
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
if (this.superQueryParams) {
param['superQueryParams'] = encodeURI(this.superQueryParams)
param['superQueryMatchType'] = this.superQueryMatchType
}
return filterObj(param);
},
//取消选择
@ -174,6 +181,13 @@
refleshCache(){
getAction(this.url.refleshCache).then((res) => {
if (res.success) {
//重新加载缓存
getAction(this.url.queryAllDictItems).then((res) => {
if (res.success) {
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
}
})
this.$message.success("刷新缓存完成");
}
}).catch(e=>{

View File

@ -178,12 +178,15 @@
},
methods: {
getQueryParams(){
console.log(this.queryParam.createTimeRange)
var param = Object.assign({}, this.queryParam,this.isorter);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
delete param.createTimeRange; // 时间参数不传递后台
if (this.superQueryParams) {
param['superQueryParams'] = encodeURI(this.superQueryParams)
param['superQueryMatchType'] = this.superQueryMatchType
}
return filterObj(param);
},

View File

@ -46,7 +46,7 @@
<a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleAddSub(record)">添加子菜单</a>
<a href="javascript:;" @click="handleAddSub(record)">添加下级</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDataRule(record)">数据规则</a>

View File

@ -3,9 +3,8 @@
title="数据权限规则"
:width="drawerWidth"
@close="onClose"
:visible="visible"
:wrapStyle="{height: 'calc(100% - 108px)',overflow: 'auto',paddingBottom: '108px'}"
>
:visible="visible">
<!-- 抽屉内容的border -->
<div
:style="{

View File

@ -24,6 +24,7 @@
<a-table
:columns="columns"
:scroll="{x: 1500}"
size="middle"
:pagination="false"
:dataSource="dataSource"
@ -45,7 +46,7 @@
<a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleAddSub(record)">添加子菜单</a>
<a href="javascript:;" @click="handleAddSub(record)">添加下级</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDataRule(record)">数据规则</a>
@ -134,6 +135,7 @@
{
title: '操作',
dataIndex: 'action',
fixed: 'right',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 150

View File

@ -32,12 +32,12 @@
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin: 5px 0 10px 2px">
<a-button @click="handleAdd" type="primary" icon="plus">角色录入</a-button>
<a-button @click="handleAdd" type="primary" icon="plus">新建角色</a-button>
<!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</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-button type="primary" icon="download" @click="handleExportXls">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('角色管理')">导出</a-button>
</div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
@ -63,6 +63,7 @@
<a @click="handleOpen(record)">用户</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down"/>
@ -115,10 +116,10 @@
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" :md="24" :sm="24" style="margin: -25px 0px 10px 2px">
<a-button @click="handleAdd2" type="primary" icon="plus" style="margin-top: 16px">用户录入</a-button>
<div class="table-operator" :md="24" :sm="24">
<a-button @click="handleAdd2" type="primary" icon="plus" style="margin-top: 16px">新增用户</a-button>
<!--<a-button @click="handleEdit2" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
<a-button @click="handleAddUserRole" type="primary" icon="plus" style="margin-top: 16px">添加已有用户</a-button>
<a-button @click="handleAddUserRole" type="primary" icon="plus" style="margin-top: 16px">已有用户</a-button>
<a-dropdown v-if="selectedRowKeys2.length > 0">
<a-menu slot="overlay">
@ -301,7 +302,10 @@
width: 120
}],
// 高级查询参数
superQueryParams2: '',
// 高级查询拼接条件
superQueryMatchType2: 'and',
url: {
list: '/sys/role/list',
delete: '/sys/role/delete',
@ -355,6 +359,7 @@
let sqp = {}
if (this.superQueryParams2) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
sqp['superQueryMatchType'] = this.superQueryMatchType2
}
var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
param.field = this.getQueryField2()

View File

@ -108,6 +108,7 @@
<script>
import SysAnnouncementModal from './modules/SysAnnouncementModal'
import {doReleaseData, doReovkeData} from '@/api/api'
import {getAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default {
@ -273,11 +274,15 @@
if (res.success) {
that.$message.success(res.message);
that.loadData(1);
this.syncHeadNotic(id)
} else {
that.$message.warning(res.message);
}
});
},
syncHeadNotic(anntId){
getAction("sys/annountCement/syncNotic",{anntId:anntId})
},
}
}
</script>

View File

@ -39,9 +39,11 @@
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
<a @click="handleAddSub(record)">添加下级</a>
</span>
</a-table>
@ -56,6 +58,7 @@
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import SysCategoryModal from './modules/SysCategoryModal'
import { deleteAction } from '@/api/manage'
export default {
name: "SysCategoryList",
@ -69,12 +72,12 @@
// 表头
columns: [
{
title:'类名称',
title:'类名称',
align:"left",
dataIndex: 'name'
},
{
title:'类编码',
title:'类编码',
align:"left",
dataIndex: 'code'
},
@ -97,7 +100,8 @@
hasChildrenField:"hasChild",
pidField:"pid",
dictOptions:{
}
},
subExpandedKeys:[],
}
},
computed: {
@ -228,6 +232,8 @@
this.dataSource = [...this.dataSource]
resolve()
}else{
row.children=''
row.hasChildrenField='0'
reject()
}
}else{
@ -247,6 +253,45 @@
}
}
},
handleAddSub(record){
this.subExpandedKeys = [];
this.getExpandKeysByPid(record.id,this.dataSource,this.dataSource)
this.$refs.modalForm.subExpandedKeys = this.subExpandedKeys;
this.$refs.modalForm.title = "添加子分类";
this.$refs.modalForm.edit({'pid':record.id});
this.$refs.modalForm.disableSubmit = false;
},
handleDelete: function (record) {
let that = this;
deleteAction(that.url.delete, {id: record.id}).then((res) => {
if (res.success) {
if (record.pid && record.pid!='0') {
let formData = {pid: record.pid};
that.$message.success(res.message);
that.subExpandedKeys = [];
that.getExpandKeysByPid(record.pid, this.dataSource, this.dataSource)
that.addOk(formData, this.subExpandedKeys.reverse())
} else {
that.loadData();
}
} else {
that.$message.warning(res.message);
}
});
},
// 添加子分类时获取所有父级id
getExpandKeysByPid(pid,arr,all){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].id==pid){
this.subExpandedKeys.push(arr[i].id)
this.getExpandKeysByPid(arr[i]['pid'],all,all)
}else{
this.getExpandKeysByPid(pid,arr[i].children,all)
}
}
}
},
}

View File

@ -122,21 +122,15 @@
align: 'center',
customRender: (t, r, index) => index + 1
},
{
title: '数据源名称',
align: 'center',
dataIndex: 'name'
},
{
title: '数据源编码',
align: 'center',
dataIndex: 'code'
},
{
title: '备注',
title: '数据源名称',
align: 'center',
dataIndex: 'remark',
customRender: (t) => ellipsis(t)
dataIndex: 'name'
},
{
title: '数据库类型',

View File

@ -133,7 +133,8 @@
readAllMsg:"sys/sysAnnouncementSend/readAll",
},
loading:false,
openPath:''
openPath:'',
formData:''
}
},
methods: {
@ -145,6 +146,7 @@
putAction(this.url.editCementSend,{anntId:record.anntId}).then((res)=>{
if(res.success){
this.loadData();
this.syncHeadNotic(record.anntId)
}
});
if(record.openType==='component'){
@ -155,6 +157,9 @@
this.$refs.ShowAnnouncement.detail(record);
}
},
syncHeadNotic(anntId){
getAction("sys/annountCement/syncNotic",{anntId:anntId})
},
readAll(){
var that = this;
that.$confirm({
@ -165,6 +170,7 @@
if(res.success){
that.$message.success(res.message);
that.loadData();
that.syncHeadNotic();
}
});
}

View File

@ -66,7 +66,6 @@
<!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px">
<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-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
@ -120,6 +119,7 @@
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>-->
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
@ -220,7 +220,8 @@
title: '用户账号',
align: "center",
dataIndex: 'username',
width: 120
width: 120,
sorter: true
},
{
title: '用户姓名',
@ -261,6 +262,12 @@
width: 180,
dataIndex: 'orgCode'
},
{
title: '负责部门',
align: "center",
width: 180,
dataIndex: 'departIds_dictText'
},
{
title: '状态',
align: "center",
@ -277,7 +284,6 @@
],
url: {
imgerver: window._CONFIG['staticDomainURL'],
syncUser: "/process/extActProcess/doSyncUser",
list: "/sys/user/list",
delete: "/sys/user/delete",
@ -294,7 +300,7 @@
},
methods: {
getAvatarView: function (avatar) {
return getFileAccessHttpUrl(avatar,this.url.imgerver,"http")
return getFileAccessHttpUrl(avatar)
},
batchFrozen: function (status) {
@ -366,8 +372,6 @@
this.$refs.sysUserAgentModal.agentSettings(username);
this.$refs.sysUserAgentModal.title = "用户代理人设置";
},
handleSyncUser() {
},
passwordModalOk() {
//TODO 密码修改完成 不需要刷新页面可以把datasource中的数据更新一下
}

View File

@ -1,7 +1,7 @@
<template>
<a-card :loading="cardLoading" :bordered="false" style="height: 100%;">
<a-spin :spinning="loading">
<a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="输入机构名称查询..." allowClear enterButton />
<a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="输入机构名称查询..." enterButton />
<a-tree
showLine

View File

@ -40,7 +40,11 @@
<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>
<a-card v-else :bordered="false" style="height:200px">
<a-empty>
<span slot="description"> 请先选择一个部门! </span>
</a-empty>
</a-card>
<depart-datarule-modal ref="datarule"/>
</a-card>
</template>

View File

@ -17,6 +17,8 @@
multiple
treeCheckable="tree"
checkable
@expand="onExpand"
:expandedKeys="expandedKeysss"
:checkedKeys="checkedKeys"
allowClear="true"
:checkStrictly="true"
@ -45,6 +47,7 @@
data () {
return {
checkedKeys:[], // 存储选中的部门id
expandedKeysss:[],//展开的节点
userId:"", // 存储用户id
model:{}, // 存储SysUserDepartsVO表
userDepartModel:{userId:'',departIdList:[]}, // 存储用户id一对多部门信息的对象
@ -146,9 +149,27 @@
queryIdTree().then((res)=>{
if(res.success){
this.departTree = res.result;
if(this.checkedKeys&&this.checkedKeys.length >0){
let treekey=[];
let arr=res.result;
if(arr&&arr.length>0){
arr.forEach(item => {
treekey.push(item.key);
/* if(item.children&&item.children.length>0){
item.children.forEach(item1 => {
treekey.push(item1.key);
})
}*/
})
this.expandedKeysss = treekey
}
}
}
})
},
onExpand(expandedKeys){
this.expandedKeysss = expandedKeys;
},
modalFormOk(){
}

View File

@ -34,6 +34,8 @@
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
@ -75,7 +77,7 @@
expandedKeysss:[],
allTreeKeys:[],
autoExpandParent: true,
checkStrictly: false,
checkStrictly: true,
title:"部门角色权限配置",
visible: false,
loading: false,
@ -83,16 +85,25 @@
}
},
methods: {
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
onTreeNodeSelect(id){
if(id && id.length>0){
this.selectedKeys = id
}
this.$refs.datarule.show(this.selectedKeys[0],this.departId,this.roleId)
},
onCheck (checkedKeys, { halfCheckedKeys }) {
// 保存选中的和半选中的,后面保存的时候合并提交
this.checkedKeys = checkedKeys
this.halfCheckedKeys = halfCheckedKeys
onCheck (o) {
if(this.checkStrictly){
this.checkedKeys = o.checked;
}else{
this.checkedKeys = o
}
},
show(roleId,departId){
this.departId = departId
@ -131,11 +142,9 @@
},
handleSubmit(exit) {
let that = this;
let checkedKeys = [...that.checkedKeys, ...that.halfCheckedKeys]
const permissionIds = checkedKeys.join(",")
let params = {
roleId:that.roleId,
permissionIds,
permissionIds:that.checkedKeys.join(","),
lastpermissionIds:that.defaultCheckedKeys.join(","),
};
that.loading = true;
@ -170,22 +179,9 @@
queryTreeListForDeptRole({departId:this.departId}).then((res) => {
this.treeData = res.result.treeList
this.allTreeKeys = res.result.ids
const keyLeafPairs = this.convertTreeListToKeyLeafPairs(this.treeData)
queryDeptRolePermission({roleId:this.roleId}).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.checkedKeys = [...res.result];
this.defaultCheckedKeys = [...res.result];
this.expandedKeysss = this.allTreeKeys;
})
})

View File

@ -21,7 +21,7 @@
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" :md="24" :sm="24">
<a-button @click="handleAdd" type="primary" icon="plus">部门角色录入</a-button>
<a-button @click="handleAdd" type="primary" icon="plus">新建部门角色</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
@ -55,18 +55,15 @@
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handlePerssion(record)">授权</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a @click="handlePerssion(record)">授权</a>
</a-menu-item>
</a-menu>
</a-menu>
</a-dropdown>
</span>
</a-table>
@ -132,9 +129,7 @@
methods: {
searchReset() {
this.queryParam = {}
this.currentDeptId = '';
this.loadData(1);
this.$emit('clearSelectedDepartKeys')
},
loadData(arg) {
if (!this.url.list) {

View File

@ -166,7 +166,7 @@
},
/** 加载desform */
loadDesformList() {
getAction(this.url.getDeptRoleList, { departId: this.currentDeptId }).then((res) => {
getAction(this.url.getDeptRoleList, { departId: this.currentDeptId, userId:this.userId }).then((res) => {
if (res.success) {
this.desformList = res.result
var designName = [];

View File

@ -26,9 +26,9 @@
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" :md="24" :sm="24" style="margin-top: -15px">
<a-button @click="handleAdd" type="primary" icon="plus" style="margin-top: 16px">用户录入</a-button>
<!--<a-button @click="handleEdit" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
<a-button @click="handleAddUserDepart" type="primary" icon="plus">添加已有用户</a-button>
<a-button @click="handleAdd" type="primary" icon="plus" style="margin-top: 16px">新建用户</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
@ -75,8 +75,12 @@
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;" @click="handleDeptRole(record)">分配部门角色</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a>
<a href="javascript:;" @click="handleDetail(record)">用户详情</a>
</a-menu-item>
<a-menu-item>
@ -84,9 +88,6 @@
<a>取消关联</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDeptRole(record)">分配部门角色</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
@ -124,15 +125,20 @@
currentDeptId: '',
// 表头
columns: [{
title: '用户账号',
align: "center",
dataIndex: 'username'
},
title: '用户账号',
align: "center",
dataIndex: 'username'
},
{
title: '用户名称',
align: "center",
dataIndex: 'realname'
},
{
title: '部门',
align: "center",
dataIndex: 'orgCode'
},
{
title: '性别',
align: "center",
@ -143,17 +149,12 @@
align: "center",
dataIndex: 'phone'
},
{
title: '部门',
align: "center",
dataIndex: 'orgCode'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 170
width: 150
}],
url: {
list: "/sys/user/departUserList",
@ -169,9 +170,7 @@
methods: {
searchReset() {
this.queryParam = {}
this.currentDeptId = '';
this.loadData(1);
this.$emit('clearSelectedDepartKeys')
},
loadData(arg) {
if (!this.url.list) {
@ -315,8 +314,12 @@
})
},
handleDeptRole(record){
this.$refs.deptRoleUser.add(record,this.currentDeptId);
this.$refs.deptRoleUser.title = "部门角色分配";
if(this.currentDeptId != ''){
this.$refs.deptRoleUser.add(record,this.currentDeptId);
this.$refs.deptRoleUser.title = "部门角色分配";
}else{
this.$message.warning("请先选择一个部门!");
}
}
}
}

View File

@ -15,14 +15,14 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="名称">
<a-input placeholder="请输入名称" v-decorator="['itemText', validatorRules.itemText]"/>
<a-input placeholder="请输入名称" v-decorator.trim="['itemText', validatorRules.itemText]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="数据值">
<a-input placeholder="请输入数据值" v-decorator="['itemValue', validatorRules.itemValue]"/>
<a-input placeholder="请输入数据值" v-decorator.trim="['itemValue', validatorRules.itemValue]"/>
</a-form-item>
<a-form-item

View File

@ -15,14 +15,14 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="字典名称">
<a-input placeholder="请输入字典名称" v-decorator="[ 'dictName', validatorRules.dictName]"/>
<a-input placeholder="请输入字典名称" v-decorator.trim="[ 'dictName', validatorRules.dictName]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="字典编码">
<a-input placeholder="请输入字典编码" v-decorator="[ 'dictCode', validatorRules.dictCode]"/>
<a-input placeholder="请输入字典编码" v-decorator.trim="[ 'dictCode', validatorRules.dictCode]"/>
</a-form-item>
<a-form-item

View File

@ -4,9 +4,8 @@
:width="drawerWidth"
@close="handleCancel"
:visible="visible"
:confirmLoading="confirmLoading"
:wrapStyle="{height: 'calc(100% - 108px)',overflow: 'auto',paddingBottom: '108px'}"
>
:confirmLoading="confirmLoading">
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
@ -76,7 +75,7 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="授权标识">
<a-input placeholder="多个用逗号分隔, 如: user:list,user:create" v-decorator="[ 'perms', {}]" :readOnly="disableSubmit"/>
<a-input placeholder="多个用逗号分隔, 如: user:list,user:create" v-decorator="[ 'perms', {rules:[{ required: false, message: '请输入授权标识!' },{validator: this.validatePerms }]}]" :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item
@ -102,7 +101,7 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="菜单图标">
<a-input placeholder="点击右侧按钮选择图标" v-model="model.icon" :readOnly="disableSubmit">
<a-input placeholder="点击选择图标" v-model="model.icon" :readOnly="disableSubmit">
<a-icon slot="addonAfter" type="setting" @click="selectIcons" />
</a-input>
</a-form-item>
@ -175,11 +174,10 @@
</template>
<script>
import {addPermission,editPermission,queryTreeList} from '@/api/api'
import {addPermission,editPermission,queryTreeList, duplicateCheck} from '@/api/api'
import Icons from './icon/Icons'
import pick from 'lodash.pick'
export default {
name: "PermissionModal",
components: {Icons},
@ -359,6 +357,26 @@
callback("请输入正整数!");
}
},
validatePerms(rule, value, callback){
if(value && value.length>0){
//校验授权标识是否存在
var params = {
tableName: 'sys_permission',
fieldName: 'perms',
fieldVal: value,
dataId: this.model.id
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("授权标识已存在!")
}
})
}else{
callback()
}
},
onChangeMenuType(e) {
//console.log('localMenuType checked', e.target.value)
this.localMenuType=e.target.value

View File

@ -47,12 +47,8 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="状态">
<a-radio-group buttonStyle="solid" v-decorator="[ 'status', {'initialValue':0}]">
<a-radio-button :value="0">正常</a-radio-button>
<a-radio-button :value="-1">停止</a-radio-button>
</a-radio-group>
<j-dict-select-tag type="radioButton" v-decorator="[ 'status', {'initialValue':0}]" :trigger-change="true" dictCode="quartz_status"/>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
@ -72,6 +68,7 @@
data () {
return {
title:"操作",
buttonStyle: 'solid',
visible: false,
model: {},
labelCol: {

View File

@ -17,14 +17,14 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="角色名称">
<a-input placeholder="请输入角色名称" v-decorator="[ 'roleName', validatorRules.roleName]" />
<a-input placeholder="请输入角色名称" v-decorator.trim="[ 'roleName', validatorRules.roleName]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="角色编码">
<a-input placeholder="请输入角色编码" :disabled="roleDisabled" v-decorator="[ 'roleCode', validatorRules.roleCode]" />
<a-input placeholder="请输入角色编码" :disabled="roleDisabled" v-decorator.trim="[ 'roleCode', validatorRules.roleCode]" />
</a-form-item>
<a-form-item

View File

@ -170,10 +170,11 @@
this.edit(selectUser,userIds);
},
edit(selectUser,userIds){
if(!userIds){
this.selectedRowKeys = []
}else{
//控制台报错
if(userIds&&userIds.length>0){
this.selectedRowKeys = userIds.split(',');
}else{
this.selectedRowKeys = []
}
if(!selectUser){
this.selectionRows=[]

View File

@ -91,6 +91,14 @@
</a-col>
</a-row>
<a-row style="width: 100%;">
<a-col :span="24/2">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="摘要">
<a-textarea placeholder="请输入摘要" v-decorator="['msgAbstract',validatorRules.msgAbstract]" />
</a-form-item>
</a-col>
<a-col :span="24/2">
<a-form-item
:labelCol="labelCol"
@ -165,8 +173,9 @@
title:{rules: [{ required: true, message: '请输入标题!' }]},
msgCategory:{rules: [{ required: true, message: '请选择消息类型!' }]},
msgType:{rules: [{ required: true, message: '请选择通告对象类型!' }]},
endTime:{rules:[{validator: this.endTimeValidate}]},
startTime:{rules:[{validator: this.startTimeValidate}]}
endTime:{rules:[{ required: true, message: '请选择结束时间!'} ,{validator: this.endTimeValidate}]},
startTime:{rules:[{required: true, message: '请选择开始时间!'},{validator: this.startTimeValidate}]},
msgAbstract:{rules: [{ required: true, message: '请输入摘要!' }]},
},
url: {
queryByIds: "/sys/user/queryByIds",
@ -209,7 +218,7 @@
});
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','sender','priority','msgCategory','msgType','sendStatus','delFlag'))
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','sender','priority','msgCategory','msgType','sendStatus','delFlag','msgAbstract'))
});
},
close () {
@ -219,6 +228,11 @@
},
handleOk () {
const that = this;
//当设置指定用户类型,但用户为空时,后台报错
if(this.userType &&!(this.userIds!=null && this.userIds.length >0)){
this.$message.warning('指定用户不能为空!')
return;
}
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
@ -241,6 +255,7 @@
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
that.resetUser();
}else{
that.$message.warning(res.message);
}

View File

@ -22,8 +22,8 @@
</j-tree-select>
</a-form-item>
<a-form-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="[ 'name', validatorRules.name]" placeholder="请输入类名称"></a-input>
<a-form-item label="类名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="[ 'name', validatorRules.name]" placeholder="请输入类名称"></a-input>
</a-form-item>
<!--<a-form-item label="类型编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
@ -80,15 +80,16 @@
}]
},
pid:{},
name:{}
name:{rules: [{ required: true, message: '请输入类型名称!' }]}
},
url: {
add: "/sys/category/add",
edit: "/sys/category/edit",
checkCode:"/sys/category/checkCode"
checkCode:"/sys/category/checkCode",
},
expandedRowKeys:[],
pidField:"pid"
pidField:"pid",
subExpandedKeys:[]
}
},
@ -153,10 +154,13 @@
let treeData = this.$refs.treeSelect.getCurrTreeData()
this.expandedRowKeys=[]
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
if(formData.pid && this.expandedRowKeys.length==0){
this.expandedRowKeys = this.subExpandedKeys;
}
this.$emit('ok',formData,this.expandedRowKeys.reverse());
}else{
this.$emit('ok',formData);
}
}
},
getExpandKeysByPid(pid,arr,all){
if(pid && arr && arr.length>0){

View File

@ -14,14 +14,14 @@
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="数据源名称">
<a-input placeholder="请输入数据源名称" v-decorator="['name', validatorRules.name]"/>
label="数据源编码">
<a-input placeholder="请输入数据源编码" :disabled="!!model.id" v-decorator="['code', validatorRules.code]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="数据源编码">
<a-input placeholder="请输入数据源编码" :disabled="!!model.id" v-decorator="['code', validatorRules.code]"/>
label="数据源名称">
<a-input placeholder="请输入数据源名称" v-decorator="['name', validatorRules.name]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
@ -137,6 +137,14 @@
'2': { dbDriver: 'oracle.jdbc.OracleDriver' },
// SQLServer 数据库
'3': { dbDriver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver' },
},
dbUrlMap: {
// MySQL 数据库
'1': { dbUrl: 'jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false' },
// Oracle
'2': { dbUrl: 'jdbc:oracle:thin:@127.0.0.1:1521:ORCL' },
// SQLServer 数据库
'3': { dbUrl: 'jdbc:sqlserver://127.0.0.1:1433;SelectMethod=cursor;DatabaseName=jeecgboot' }
}
}
},
@ -216,9 +224,13 @@
// 数据库类型更改时,联动更改数据库驱动
handleDbTypeChange(val) {
let dbDriver = this.dbDriverMap[val]
let dbUrl = this.dbUrlMap[val]
if (dbDriver) {
this.form.setFieldsValue(dbDriver)
}
if (dbUrl) {
this.form.setFieldsValue(dbUrl)
}
},
}
}

View File

@ -23,7 +23,7 @@
<a-form :form="form">
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入用户账号" v-decorator="[ 'username', validatorRules.username]" :readOnly="!!model.id"/>
<a-input placeholder="请输入用户账号" v-decorator.trim="[ 'username', validatorRules.username]" :readOnly="!!model.id"/>
</a-form-item>
<template v-if="!model.id">
@ -37,11 +37,11 @@
</template>
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<a-input placeholder="请输入用户姓名" v-decorator="[ 'realname', validatorRules.realname]" />
<a-input placeholder="请输入用户姓名" v-decorator.trim="[ 'realname', validatorRules.realname]" />
</a-form-item>
<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入工号" v-decorator="[ 'workNo', validatorRules.workNo]" />
<a-input placeholder="请输入工号" v-decorator.trim="[ 'workNo', validatorRules.workNo]" />
</a-form-item>
<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
@ -54,7 +54,8 @@
style="width: 100%"
placeholder="请选择用户角色"
optionFilterProp = "children"
v-model="selectedRole">
v-model="selectedRole"
:getPopupContainer= "(target) => target.parentNode">
<a-select-option v-for="(role,roleindex) in roleList" :key="roleindex.toString()" :value="role.id">
{{ role.roleName }}
</a-select-option>
@ -64,9 +65,9 @@
<!--部门分配-->
<a-form-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<a-input-search
placeholder="点击右侧按钮选择部门"
placeholder="点击选择部门"
v-model="checkedDepartNameString"
disabled
readOnly
@search="onSearch">
<a-button slot="enterButton" icon="search">选择</a-button>
</a-input-search>
@ -104,11 +105,12 @@
<a-date-picker
style="width: 100%"
placeholder="请选择生日"
v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"/>
v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"
:getCalendarContainer="node => node.parentNode"/>
</a-form-item>
<a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-decorator="[ 'sex', {}]" placeholder="请选择性别">
<a-select v-decorator="[ 'sex', {}]" placeholder="请选择性别" :getPopupContainer= "(target) => target.parentNode">
<a-select-option :value="1">男</a-select-option>
<a-select-option :value="2">女</a-select-option>
</a-select>
@ -248,7 +250,6 @@
picUrl: "",
url: {
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
imgerver: window._CONFIG['staticDomainURL'],
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
@ -332,7 +333,7 @@
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync','workNo','telephone','post'))
});
//身份为上级显示负责部门,否则不显示
if(this.model.identity=="2"){
if(this.model.userIdentity=="2"){
this.identity="2";
this.departIdShow=true;
}else{
@ -406,10 +407,14 @@
values.birthday = values.birthday.format(this.dateFormat);
}
let formData = Object.assign(this.model, values);
formData.avatar = that.fileList;
if(that.fileList != ''){
formData.avatar = that.fileList;
}else{
formData.avatar = null;
}
formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
formData.selecteddeparts = this.userDepartModel.departIdList.length>0?this.userDepartModel.departIdList.join(","):'';
formData.identity=this.identity;
formData.userIdentity=this.identity;
//如果是上级择传入departIds,否则为空
if(this.identity==="2"){
formData.departIds=this.departIds.join(",");

View File

@ -53,6 +53,7 @@
</template>
<script>
import { putAction,deleteAction,getFileAccessHttpUrl } from "@/api/manage"
// 高度封装的请求,请务必使用 superRequest.call(this,{}) 的方式调用
function superRequest(options) {
@ -95,9 +96,11 @@
{ title: '操作', align: 'center', dataIndex: 'action', width: 200, scopedSlots: { customRender: 'action' } }
],
url: {
getAvatar: (path) => `window._CONFIG['staticDomainURL']/${path}`,
getAvatar: (path) => getFileAccessHttpUrl(`${path}`),
// 回收站操作get = 获取列表put = 取回delete = 彻底删除
recycleBin: '/sys/user/recycleBin',
putRecycleBin: '/sys/user/putRecycleBin',
deleteRecycleBin: '/sys/user/deleteRecycleBin',
},
}
},
@ -137,10 +140,8 @@
content: `您确定要恢复这 ${userIds.length} 个用户吗?`,
centered: true,
onOk: () => {
superRequest.call(this, {
loading: true,
promise: this.$http.put(this.url.recycleBin, userIds),
success: () => {
putAction(this.url.putRecycleBin,{userIds:userIds.join(',')}).then((res)=>{
if(res.success){
this.handleOk()
this.handleClearSelection()
this.$message.success(`还原 ${userIds.length} 个用户成功!`)
@ -159,15 +160,16 @@
</div>),
centered: true,
onOk: () => {
superRequest.call(this, {
loading: true,
promise: this.$http.delete(this.url.recycleBin + `?userIds=${userIds.join(',')}`),
success: () => {
var that = this;
deleteAction(that.url.deleteRecycleBin, {userIds: userIds.join(',')}).then((res) => {
if (res.success) {
this.loadData()
this.handleClearSelection()
this.$message.success(`彻底删除 ${userIds.length} 个用户成功!`)
} else {
that.$message.warning(res.message);
}
})
});
},
})
},

View File

@ -169,7 +169,7 @@
this.checkedKeys = [...res.result];
this.defaultCheckedKeys = [...res.result];
this.expandedKeysss = this.allTreeKeys;
//console.log(this.defaultCheckedKeys)
console.log(this.defaultCheckedKeys)
})
})
}