jeecg-boot 2.0 模块开发版本发布

This commit is contained in:
zhangdaihao
2019-05-19 18:54:09 +08:00
parent 64fb100ea2
commit 4858af9f33
770 changed files with 85014 additions and 19508 deletions

View File

@ -129,45 +129,6 @@
}
</script>
<style scoped>
.ant-card-body .table-operator {
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td {
padding-top: 15px;
padding-bottom: 15px;
}
.anty-row-operator button {
margin: 0 5px
}
.ant-btn-danger {
background-color: #ffffff
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
.anty-img-wrap {
height: 25px;
position: relative;
}
.anty-img-wrap > img {
max-height: 100%;
}
@import '~@assets/less/common.less'
</style>

View File

@ -2,12 +2,17 @@
<a-row :gutter="10">
<a-col :md="12" :sm="24">
<a-card :bordered="false">
<!-- 按钮操作区域 -->
<a-row style="margin-left: 14px">
<a-button @click="handleAdd(2)" type="primary">添加子部门</a-button>
<a-button @click="handleAdd(1)" type="default">添加一级部门</a-button>
<!--<a-button @click="handleAdd(2)" type="primary">添加子部门</a-button>-->
<a-button @click="handleAdd(1)" type="primary">添加一级部门</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-button title="删除多条数据" @click="batchDel" type="default">批量删除</a-button>
<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>
<!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>-->
</a-row>
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a-alert type="info" :showIcon="true">
@ -68,6 +73,12 @@
placeholder="">
</a-tree-select>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构编码">
<a-input disabled placeholder="请输入机构编码" v-decorator="['orgCode', validatorRules.orgCode ]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
@ -105,8 +116,9 @@
<script>
import DepartModal from './modules/DepartModal'
import pick from 'lodash.pick'
import { queryDepartTreeList, searchByKeywords, deleteByDepartId } from '@/api/api'
import { httpAction, deleteAction } from '@/api/manage'
import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api'
import {httpAction, deleteAction} from '@/api/manage'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
// 表头
const columns = [
{
@ -120,7 +132,7 @@
},
{
title: '机构编码',
dataIndex: 'orgCode'
dataIndex: 'orgCode',
},
{
title: '手机号',
@ -143,11 +155,12 @@
title: '操作',
align: 'center',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
scopedSlots: {customRender: 'action'}
}
]
export default {
name: 'DepartList',
mixins: [JeecgListMixin],
components: {
DepartModal
},
@ -175,30 +188,40 @@
currSelected: {},
form: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
xs: {span: 24},
sm: {span: 16}
},
graphDatasource: {
nodes: [],
edges: []
},
validatorRules: {
departName: { rules: [{ required: true, message: '请输入机构/部门名称!' }] },
orgCode: { rules: [{ required: true, message: '请输入机构编码!' }] },
mobile: { rules: [{ validator: this.validateMobile }] }
departName: {rules: [{required: true, message: '请输入机构/部门名称!'}]},
orgCode: {rules: [{required: true, message: '请输入机构编码!'}]},
mobile: {rules: [{validator: this.validateMobile}]}
},
url: {
delete: '/sysdepart/sysDepart/delete',
edit: '/sysdepart/sysDepart/edit',
deleteBatch: '/sysdepart/sysDepart/deleteBatch'
}
deleteBatch: '/sysdepart/sysDepart/deleteBatch',
exportXlsUrl: "sysdepart/sysDepart/exportXls",
importExcelUrl: "sysdepart/sysDepart/importExcel",
},
}
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}
},
methods: {
loadData() {
this.refresh();
},
loadTree() {
var that = this
that.treeData = []
@ -257,7 +280,7 @@
addRootNode() {
this.$refs.nodeModal.add(this.currFlowId, '')
},
batchDel: function() {
batchDel: function () {
console.log(this.checkedKeys)
if (this.checkedKeys.length <= 0) {
this.$message.warning('请选择一条记录!')
@ -270,8 +293,8 @@
this.$confirm({
title: '确认删除',
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据?',
onOk: function() {
deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
onOk: function () {
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadTree()
@ -287,7 +310,7 @@
onSearch(value) {
let that = this
if (value) {
searchByKeywords({ keyWord: value }).then((res) => {
searchByKeywords({keyWord: value}).then((res) => {
if (res.success) {
that.departTree = []
for (let i = 0; i < res.result.length; i++) {
@ -332,8 +355,8 @@
},
// 触发onSelect事件时,为部门树右侧的form表单赋值
setValuesToForm(record) {
this.form.getFieldDecorator('fax', { initialValue: '' })
this.form.setFieldsValue(pick(record, 'departName', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
this.form.getFieldDecorator('fax', {initialValue: ''})
this.form.setFieldsValue(pick(record, 'departName', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
},
getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title
@ -368,6 +391,8 @@
if (res.success) {
this.$message.success('保存成功!')
this.loadTree()
} else {
this.$message.error(res.message)
}
})
}
@ -404,7 +429,7 @@
}
},
handleDelete() {
deleteByDepartId({ id: this.rightClickSelectedKey }).then((resp) => {
deleteByDepartId({id: this.rightClickSelectedKey}).then((resp) => {
if (resp.success) {
this.$message.success('删除成功!')
this.loadTree()
@ -415,7 +440,7 @@
},
selectDirectiveOk(record) {
console.log('选中指令数据', record)
this.nodeSettingForm.setFieldsValue({ directiveCode: record.directiveCode })
this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode})
this.currSelected.sysCode = record.sysCode
},
getFlowGraphData(node) {
@ -433,17 +458,21 @@
this.getFlowGraphData(temp)
}
}
}
},
},
created() {
this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name
this.loadTree()
}
// this.loadTree()
},
}
</script>
<style scoped>
.ant-card-body .table-operator {
margin: 15px;
}
.anty-form-btn {
width: 100%;
text-align: center;
@ -453,10 +482,6 @@
margin: 0 5px;
}
.anty-node-layout .ant-layout-content {
margin: 0 !important;
}
.anty-node-layout .ant-layout-header {
padding-right: 0
}

View File

@ -2,17 +2,22 @@
<a-card :bordered="false">
<!-- 查询区域 -->
<!--
-->
<!--
-->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-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-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
@ -37,9 +42,9 @@
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a>
@ -64,85 +69,85 @@
<script>
import SysDepartModal from './modules/DepartModal'
/* import { filterObj } from '@/utils/util'
, queryByFactories*/
import { queryDepartTreeList} from '@/api/api'
import { deleteAction } from '@/api/manage'
/* import { filterObj } from '@/utils/util'
, queryByFactories*/
import {queryDepartTreeList} from '@/api/api'
import {deleteAction} from '@/api/manage'
// 表头
const columns = [
{
title: '机构名称',
dataIndex: 'departName',
},
{
title: '机构类型',
align:"center",
dataIndex: 'orgType'
},
{
title: '机构编码',
dataIndex: 'orgCode'
},
{
title: '手机号',
dataIndex: 'mobile'
},
{
title: '传真',
dataIndex: 'fax'
},
{
title: '地址',
dataIndex: 'address'
},
{
title:'排序',
align:'center',
dataIndex:'departOrder'
},
{
title: '操作',
align:"center",
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
}
];
// 表头
const columns = [
{
title: '机构名称',
dataIndex: 'departName',
},
{
title: '机构类型',
align: "center",
dataIndex: 'orgType'
},
{
title: '机构编码',
dataIndex: 'orgCode'
},
{
title: '手机号',
dataIndex: 'mobile'
},
{
title: '传真',
dataIndex: 'fax'
},
{
title: '地址',
dataIndex: 'address'
},
{
title: '排序',
align: 'center',
dataIndex: 'departOrder'
},
{
title: '操作',
align: "center",
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
}
];
export default {
name: "DepartList2",
components: {
SysDepartModal
},
data () {
return {
description: 'jeecg 生成SysDepart代码管理页面',
// 查询条件
queryParam: {},
data() {
return {
description: 'jeecg 生成SysDepart代码管理页面',
// 查询条件
queryParam: {},
//数据集
factories:'',
dataSource:[],
columns:columns,
factories: '',
dataSource: [],
columns: columns,
// 分页参数
/* ipagination:{
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " " + total + ""
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},*/
isorter:{
/* ipagination:{
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " " + total + ""
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},*/
isorter: {
column: 'createTime',
order: 'desc',
},
loading:false,
loading: false,
selectedRowKeys: [],
selectedRows: [],
url: {
url: {
list: "/sysdepart/sysDepart/list",
delete: "/sysdepart/sysDepart/delete",
deleteBatch: "/sysdepart/sysDepart/deleteBatch",
@ -154,69 +159,69 @@
this.loadData();
},
methods: {
loadData (){
loadData() {
this.dataSource = [];
queryDepartTreeList().then((res)=>{
if(res.success){
this.dataSource = res.result;
}
})
queryDepartTreeList().then((res) => {
if (res.success) {
this.dataSource = res.result;
}
})
},
getQueryField(){
getQueryField() {
//TODO 字段权限控制
var str = "id,";
for(var a = 0;a<this.columns.length;a++){
str+=","+this.columns[a].dataIndex;
for (var a = 0; a < this.columns.length; a++) {
str += "," + this.columns[a].dataIndex;
}
return str;
},
onSelectChange (selectedRowKeys,selectionRows) {
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
},
onClearSelected(){
onClearSelected() {
this.selectedRowKeys = [];
this.selectionRows = [];
},
//TODO getQueryParams
handleDelete:function(id){
handleDelete: function (id) {
var that = this;
deleteAction(that.url.delete,{id: id}).then((res)=>{
if(res.success){
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
}else{
} else {
that.$message.warning(res.message);
}
});
},
handleDetail(record){
handleDetail(record) {
this.$refs.sysDepartModal.edit(record);
this.$refs.sysDepartModal.title="详情";
this.$refs.sysDepartModal.title = "详情";
this.$refs.sysDepartModal.disableSubmit = true;
},
batchDel: function(){
if(this.selectedRowKeys.length<=0){
batchDel: function () {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
return ;
}else{
return;
} else {
var ids = "";
for(var a =0;a<this.selectedRowKeys.length;a++){
ids+=this.selectedRowKeys[a]+",";
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
var that = this;
this.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
deleteAction(that.url.deleteBatch,{ids: ids}).then((res)=>{
if(res.success){
title: "确认删除",
content: "是否删除选中数据?",
onOk: function () {
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
}else{
} else {
that.$message.warning(res.message);
}
});
@ -224,26 +229,26 @@
});
}
},
handleEdit:function(record){
handleEdit: function (record) {
this.$refs.sysDepartModal.edit(record);
this.$refs.sysDepartModal.title="编辑";
this.$refs.sysDepartModal.title = "编辑";
},
handleAdd(){
handleAdd() {
this.$refs.sysDepartModal.add();
this.$refs.sysDepartModal.title="新增";
this.$refs.sysDepartModal.title = "新增";
},
handleTableChange(pagination, filters, sorter){
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
console.log(sorter);
//TODO 筛选
if (Object.keys(sorter).length>0){
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend"==sorter.order?"asc":"desc"
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
/*this.ipagination = pagination;*/
this.loadData();
},
modalFormOk () {
modalFormOk() {
// 新增/修改 成功时,重载列表
this.loadData();
}
@ -251,17 +256,5 @@
}
</script>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td{
padding-top:15px;
padding-bottom:15px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
@import '~@assets/less/common.less'
</style>

View File

@ -0,0 +1,194 @@
<template>
<a-row :gutter="10">
<a-col :md="8" :sm="24">
<a-card :bordered="false">
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/>
<!-- -->
<template>
<!--组织机构-->
<a-directory-tree
selectable
:selectedKeys="selectedKeys"
:checkStrictly="true"
@select="onSelect"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree"
/>
</template>
</div>
</a-card>
</a-col>
<a-col :md="16" :sm="24">
<a-card :bordered="false">
<a-tabs defaultActiveKey="2" @change="callback">
<a-tab-pane tab="基本信息" key="1" forceRender>
<Dept-Base-Info ref="DeptBaseInfo"></Dept-Base-Info>
</a-tab-pane>
<a-tab-pane tab="用户信息" key="2">
<Dept-User-Info ref="DeptUserInfo"></Dept-User-Info>
</a-tab-pane>
</a-tabs>
</a-card>
</a-col>
</a-row>
</template>
<script>
import DeptBaseInfo from './modules/DeptBaseInfo'
import DeptUserInfo from './modules/DeptUserInfo'
import {queryDepartTreeList, searchByKeywords} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default {
name: 'DepartUserList',
mixins: [JeecgListMixin],
components: {
DeptBaseInfo,
DeptUserInfo,
},
data() {
return {
currentDeptId: '',
iExpandedKeys: [],
loading: false,
autoExpandParent: true,
currFlowId: '',
currFlowName: '',
disable: true,
treeData: [],
visible: false,
departTree: [],
rightClickSelectedKey: '',
hiding: true,
model: {},
dropTrigger: '',
depart: {},
disableSubmit: false,
checkedKeys: [],
selectedKeys: [],
autoIncr: 1,
currSelected: {},
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16}
},
graphDatasource: {
nodes: [],
edges: []
},
}
},
methods: {
callback(key) {
console.log(key)
},
loadData() {
this.refresh();
},
loadTree() {
var that = this
that.treeData = []
that.departTree = []
queryDepartTreeList().then((res) => {
if (res.success) {
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
that.treeData.push(temp)
that.departTree.push(temp)
that.setThisExpandedKeys(temp)
// console.log(temp.id)
}
this.loading = false
}
})
},
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() {
this.loading = true
this.loadTree()
},
onExpand(expandedKeys) {
// console.log('onExpand', expandedKeys)
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.iExpandedKeys = expandedKeys
this.autoExpandParent = false
},
onSearch(value) {
let that = this
if (value) {
searchByKeywords({keyWord: value}).then((res) => {
if (res.success) {
that.departTree = []
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
that.departTree.push(temp)
}
} else {
that.$message.warning(res.message)
}
})
} else {
that.loadTree()
}
},
onCheck(checkedKeys, e) {
let record = e.node.dataRef;
// console.log('onCheck', checkedKeys, e);
this.checkedKeys = [];
// if (e.checked === true) {
this.currentDeptId = record.id;
this.checkedKeys.push(record.id);
this.$refs.DeptBaseInfo.open(record);
this.$refs.DeptUserInfo.open(record);
// }
// else {
// this.checkedKeys = [];
// this.$refs.DeptBaseInfo.clearForm();
// this.$refs.DeptUserInfo.clearList();
// }
this.hiding = false;
// this.checkedKeys = checkedKeys.checked
},
onSelect(selectedKeys, e) {
if (this.selectedKeys[0] !== selectedKeys[0]) {
this.selectedKeys = [selectedKeys[0]];
}
let record = e.node.dataRef;
this.checkedKeys.push(record.id);
this.$refs.DeptBaseInfo.open(record);
this.$refs.DeptUserInfo.onClearSelected();
this.$refs.DeptUserInfo.open(record);
},
},
created() {
this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name
// this.loadTree()
},
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@ -22,18 +22,16 @@
</span>
</a-col>
</a-row>
<a-row>
<a-col :md="24" :sm="24">
<a-button style="margin-bottom: 20px" @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" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
</a-col>
</a-row>
</a-form>
<div class="table-operator" style="border-top: 5px">
<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>
</div>
<a-table
ref="table"
rowKey="id"
@ -43,16 +41,18 @@
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">
<a-icon type="edit"/>
编辑
</a>
<a-divider type="vertical"/>
<a @click="editDictItem(record)"><a-icon type="setting"/> 字典配置</a>
<a-divider type="vertical"/>
<a @click="handleDelete(record.id)">删除</a>
</span>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">
<a-icon type="edit"/>
编辑
</a>
<a-divider type="vertical"/>
<a @click="editDictItem(record)"><a-icon type="setting"/> 字典配置</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() =>handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
@ -66,7 +66,6 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DictModal from './modules/DictModal'
import DictItemList from './DictItemList'
import {delDict} from '@/api/api'
export default {
name: "DictList",
@ -145,25 +144,6 @@
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
//删除字典类型
handleDel(record) {
let that = this;
that.$confirm({
title: "确认删除",
content: "您确定要删除 " + record.dictName + " 字典类型?",
onOk: function () {
delDict({id: record.id}).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
that.cancelDict();
} else {
that.$message.warning(res.message);
}
});
},
});
},
//取消选择
cancelDict() {
this.dict = "";
@ -189,18 +169,6 @@
},
}
</script>
<style scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.table-operator {
margin-bottom: 10px
}
.ant-tree li span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle {
width: 0px
}
@import '~@assets/less/common.less'
</style>

View File

@ -194,14 +194,5 @@
}
</script>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td{
padding-top:15px;
padding-bottom:15px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.ant-divider-horizontal{margin: 10px 0;}
@import '~@assets/less/common.less'
</style>

View File

@ -9,10 +9,10 @@
<!-- 抽屉内容的border -->
<div
:style="{
padding:'10px',
border: '1px solid #e9e9e9',
background: '#fff',
}">
padding:'10px',
border: '1px solid #e9e9e9',
background: '#fff',
}">
<div class="table-page-search-wrapper">
<a-form>
<a-row :gutter="12">
@ -27,10 +27,10 @@
</a-form-item>
</a-col>
<a-col :md="7" :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>
<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-row>
@ -46,14 +46,15 @@
size="middle"
:columns="columns"
:dataSource="dataSource"
:loading="loading">
:loading="loading"
:rowClassName="getRowClassname">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">
<a-icon type="edit"/>编辑
</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
@ -167,10 +168,18 @@
this.drawerWidth = 650
}
},
getRowClassname(record){
if(record.status!=1){
return "data-rule-invalid"
}
}
}
}
</script>
<style scoped>
<style>
.data-rule-invalid{
background: #f4f4f4;
color: #bababa;
}
</style>

View File

@ -6,7 +6,6 @@
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button
@click="batchDel"
style="margin-left:8px"
v-if="selectedRowKeys.length > 0"
ghost
type="primary"
@ -57,11 +56,11 @@
</a-dropdown>
</span>
<!-- 字符串超长截取省略号显示 -->
<span slot="url" slot-scope="text, record">
<span slot="url" slot-scope="text">
<j-ellipsis :value="text" :length="25"/>
</span>
<!-- 字符串超长截取省略号显示-->
<span slot="component" slot-scope="text, record">
<span slot="component" slot-scope="text">
<j-ellipsis :value="text"/>
</span>
</a-table>
@ -176,5 +175,5 @@
}
</script>
<style scoped>
@import '../../assets/less/common.css';
@import '~@assets/less/common.less'
</style>

View File

@ -35,9 +35,8 @@
<!-- 操作按钮区域 -->
<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" :action="importExcelUrl"
@change="handleImportExcel">
<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">
@ -92,7 +91,7 @@
</span>
<!-- 状态渲染模板 -->
<template slot="customRenderStatus" slot-scope="status, record">
<template slot="customRenderStatus" slot-scope="status">
<a-tag v-if="status==0" color="green">已启动</a-tag>
<a-tag v-if="status==-1" color="orange">已暂停</a-tag>
</template>
@ -107,7 +106,7 @@
<script>
import QuartzJobModal from './modules/QuartzJobModal'
import { postAction } from '@/api/manage'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from "@/components/jeecg/JEllipsis";
@ -219,7 +218,7 @@
title:"确认暂停",
content:"是否暂停选中任务?",
onOk: function(){
postAction(that.url.pause,record).then((res)=>{
getAction(that.url.pause,{jobClassName:record.jobClassName}).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
@ -239,7 +238,7 @@
title:"确认启动",
content:"是否启动选中任务?",
onOk: function(){
postAction(that.url.resume,record).then((res)=>{
getAction(that.url.resume,{jobClassName:record.jobClassName}).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
@ -255,22 +254,5 @@
}
</script>
<style scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.ant-card-body .table-operator {
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td{
padding-top:10px;
padding-bottom:10px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
@import '~@assets/less/common.less'
</style>

View File

@ -11,9 +11,11 @@
<a-input placeholder="请输入名称查询" v-model="queryParam.roleName"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-col :md="10" :sm="12">
<a-form-item label="创建时间" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-range-picker @change="onChangeDate" v-model="queryParam.createTimeIsRange"/>
<j-date v-model="queryParam.createTime_begin" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择开始时间" ></j-date>
<span style="width: 10px;">~</span>
<j-date v-model="queryParam.createTime_end" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择结束时间"></j-date>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@ -29,8 +31,8 @@
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin-top: 5px">
<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" :action="importExcelUrl" @change="handleImportExcel">
<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>
@ -99,20 +101,22 @@
import RoleModal from './modules/RoleModal'
import UserRoleModal from './modules/UserRoleModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDate from '@/components/jeecg/JDate'
export default {
name: "RoleList",
mixins:[JeecgListMixin],
components: {
RoleModal,
UserRoleModal
UserRoleModal,
JDate
},
data () {
return {
description: '角色管理页面',
// 查询条件
queryParam: {roleName:'',createTimeIsRange:[]},
queryParam: {roleName:'',},
// 表头
columns: [
{
@ -163,7 +167,7 @@
list: "/sys/role/list",
delete: "/sys/role/delete",
deleteBatch: "/sys/role/deleteBatch",
exportXlsUrl: "sys/role/exportXls",
exportXlsUrl: "/sys/role/exportXls",
importExcelUrl: "sys/role/importExcel",
},
}
@ -185,21 +189,5 @@
}
</script>
<style scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td{
padding-top:15px;
padding-bottom:15px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
@import '~@assets/less/common.less'
</style>

View File

@ -0,0 +1,497 @@
<template>
<a-row :gutter="10">
<a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px">
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="12" :sm="12">
<a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="" v-model="queryParam.roleName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin: -8px 0 10px 2px">
<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>
</div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon">
</i> 已选择 <a><b>{{ selectedRowKeys1.length }}</b></a>项
<a style="margin-left: 24px" @click="onClearSelected1">清空</a>
</div>
<div style="margin-top: 15px">
<a-table
style="height:500px"
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleOpen(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="() => handleDelete1(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
</a-card>
</a-col>
<a-col :md="rightColMd" :sm="24">
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="12" :sm="12">
<a-form-item label="用户账号">
<a-input placeholder="" v-model="queryParam2.username"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="9" :sm="24">
<a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
<a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-row>
</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>
<!--<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-dropdown v-if="selectedRowKeys2.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel2">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
selectedRowKeys2.length }}</a>项
<a style="margin-left: 24px" @click="onClearSelected2">清空</a>
</div>
<a-table
style="height:500px"
ref="table2"
bordered
size="middle"
rowKey="id"
:columns="columns2"
:dataSource="dataSource2"
:pagination="ipagination2"
:loading="loading2"
:rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
@change="handleTableChange2">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit2(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="() => handleDelete2(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- 表单区域 -->
<role-modal ref="modalForm" @ok="modalFormOk"></role-modal>
<user-modal ref="modalForm2" @ok="modalFormOk2"></user-modal>
<Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal>
</a-card>
</a-col>
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { deleteAction, postAction, getAction } from '@/api/manage'
import SelectUserModal from './modules/SelectUserModal'
import RoleModal from './modules/RoleModal'
import UserModal from './modules/UserModal'
import { filterObj } from '@/utils/util'
export default {
name: 'RoleUserList',
mixins: [JeecgListMixin],
components: {
SelectUserModal,
RoleModal,
UserModal
},
data() {
return {
model1: {},
model2: {},
currentRoleId: '',
queryParam1: {},
queryParam2: {},
dataSource1: [],
dataSource2: [],
ipagination1: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
ipagination2: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter1: {
column: 'createTime',
order: 'desc'
},
isorter2: {
column: 'createTime',
order: 'desc'
},
filters1: {},
filters2: {},
loading1: false,
loading2: false,
selectedRowKeys1: [],
selectedRowKeys2: [],
selectionRows1: [],
selectionRows2: [],
columns:
[
{
title: '角色编码',
align: 'center',
dataIndex: 'roleCode'
},
{
title: '角色名称',
align: 'center',
dataIndex: 'roleName'
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
}
],
columns2: [{
title: '用户账号',
align: 'center',
dataIndex: 'username',
width: 120
},
{
title: '用户名称',
align: 'center',
width: 100,
dataIndex: 'realname'
},
{
title: '状态',
align: 'center',
width: 80,
dataIndex: 'status_dictText'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 120
}],
url: {
list: '/sys/role/list',
delete: '/sys/role/delete',
list2: '/sys/user/userRoleList',
addUserRole: '/sys/user/addSysUserRole',
delete2: '/sys/user/deleteUserRole',
deleteBatch2: '/sys/user/deleteUserRoleBatch',
exportXlsUrl: 'sys/role/exportXls',
importExcelUrl: 'sys/role/importExcel'
}
}
},
computed: {
importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
leftColMd() {
return this.selectedRowKeys1.length === 0 ? 24 : 12
},
rightColMd() {
return this.selectedRowKeys1.length === 0 ? 0 : 12
}
},
methods: {
onSelectChange2(selectedRowKeys, selectionRows) {
this.selectedRowKeys2 = selectedRowKeys
this.selectionRows2 = selectionRows
},
onClearSelected2() {
this.selectedRowKeys2 = []
this.selectionRows2 = []
},
onClearSelected1() {
this.selectedRowKeys1 = []
this.selectionRows1 = []
},
onSelectChange1(selectedRowKeys, selectionRows) {
this.selectedRowKeys1 = selectedRowKeys
this.selectionRows1 = selectionRows
this.model1 = Object.assign({}, selectionRows[0])
console.log(this.model1)
this.currentRoleId = selectedRowKeys[0]
this.loadData2()
},
onClearSelected() {
},
getQueryParams2() {
//获取查询条件
let sqp = {}
if (this.superQueryParams2) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
}
var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
param.field = this.getQueryField2()
param.pageNo = this.ipagination2.current
param.pageSize = this.ipagination2.pageSize
return filterObj(param)
},
getQueryField2() {
//TODO 字段权限控制
var str = 'id,'
this.columns2.forEach(function(value) {
str += ',' + value.dataIndex
})
return str
},
handleEdit2: function(record) {
this.$refs.modalForm2.edit(record)
this.$refs.modalForm2.title = '编辑'
},
handleAdd2: function() {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.roleId = this.currentRoleId
this.$refs.modalForm2.add()
this.$refs.modalForm2.title = '新增'
}
},
modalFormOk2() {
// 新增/修改 成功时,重载列表
this.loadData2()
},
loadData2(arg) {
if (!this.url.list2) {
this.$message.error('请设置url.list2属性!')
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination2.current = 1
}
if (this.currentRoleId === '') return
let params = this.getQueryParams2()//查询条件
params.roleId = this.currentRoleId
this.loading2 = true
getAction(this.url.list2, params).then((res) => {
if (res.success) {
this.dataSource2 = res.result.records
this.ipagination2.total = res.result.total
}
this.loading2 = false
})
},
handleDelete1: function(id) {
this.handleDelete(id)
this.dataSource2 = []
this.currentRoleId = ''
},
handleDelete2: function(id) {
if (!this.url.delete2) {
this.$message.error('请设置url.delete2属性!')
return
}
var that = this
deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
} else {
that.$message.warning(res.message)
}
})
},
batchDel2: function() {
if (!this.url.deleteBatch2) {
this.$message.error('请设置url.deleteBatch2属性!')
return
}
if (this.selectedRowKeys2.length <= 0) {
this.$message.warning('请选择一条记录!')
return
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys2.length; a++) {
ids += this.selectedRowKeys2[a] + ','
}
var that = this
console.log(this.currentDeptId)
this.$confirm({
title: '确认删除',
content: '是否删除选中数据?',
onOk: function() {
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
})
}
})
}
},
selectOK(data) {
let params = {}
params.roleId = this.currentRoleId
params.userIdList = []
for (var a = 0; a < data.length; a++) {
params.userIdList.push(data[a])
}
console.log(params)
postAction(this.url.addUserRole, params).then((res) => {
if (res.success) {
this.loadData2()
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
handleAddUserRole() {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.selectUserModal.visible = true
}
},
handleOpen(record) {
this.selectedRowKeys1 = [record.id]
this.model1 = Object.assign({}, record)
this.currentRoleId = record.id
this.onClearSelected2()
this.loadData2()
},
handleEdit: function(record) {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = '编辑'
}
},
searchQuery2() {
this.loadData2(1)
},
searchReset2() {
this.queryParam2 = {}
this.loadData2(1)
},
handleTableChange2(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
if (Object.keys(sorter).length > 0) {
this.isorter2.column = sorter.field
this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
}
this.ipagination2 = pagination
this.loadData2()
}
}
}
</script>
<style scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 8px
}
</style>

View File

@ -11,11 +11,11 @@
<a-input placeholder="请输入标题" v-model="queryParam.titile"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<!--<a-col :span="6">
<a-form-item label="内容">
<a-input placeholder="请输入内容" v-model="queryParam.msgContent"></a-input>
</a-form-item>
</a-col>
</a-col>-->
<a-col :span="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@ -31,8 +31,8 @@
<!-- 操作按钮区域 -->
<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" :action="importExcelUrl" @change="handleImportExcel">
<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">
@ -136,12 +136,21 @@
align: "center",
dataIndex: 'titile'
},
/*{
title: '内容',
align:"center",
dataIndex: 'msgContent'
},*/
{
title: '消息类型',
align: "center",
dataIndex: 'msgCategory',
customRender: function (text) {
if (text == '1') {
return "通知公告";
} else if (text == "2") {
return "系统消息";
} else {
return text;
}
}
},
/*{
title: '开始时间',
align: "center",
dataIndex: 'startTime'
@ -150,7 +159,7 @@
title: '结束时间',
align: "center",
dataIndex: 'endTime'
},
},*/
{
title: '发布人',
align: "center",
@ -173,7 +182,7 @@
}
},
{
title: '通告对象类型',
title: '通告对象',
align: "center",
dataIndex: 'msgType',
customRender: function (text) {
@ -270,38 +279,5 @@
}
</script>
<style scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.ant-card-body .table-operator {
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td {
padding-top: 15px;
padding-bottom: 15px;
}
.anty-row-operator button {
margin: 0 5px
}
.ant-btn-danger {
background-color: #ffffff
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
@import '~@assets/less/common.less'
</style>

View File

@ -0,0 +1,180 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :span="6">
<a-form-item label="标题">
<a-input placeholder="请输入标题" v-model="queryParam.titile"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="发布人">
<a-input placeholder="请输入发布人" v-model="queryParam.sender"></a-input>
</a-form-item>
</a-col>
<a-col :span="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 type="primary" @click="readAll" icon="book">全部标注已读</a-button>
</div>
<a-table
ref="table"
size="default"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="showAnnouncement(record)">查看</a>
</span>
</a-table>
<show-announcement ref="ShowAnnouncement"></show-announcement>
</a-card>
</template>
<script>
import { filterObj } from '@/utils/util'
import { getAction,putAction } from '@/api/manage'
import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
export default {
name: "UserAnnouncementList",
mixins: [JeecgListMixin],
components: {
ShowAnnouncement
},
data () {
return {
description: '系统通告表管理页面',
queryParam: {},
columns: [{
title: '标题',
align:"center",
dataIndex: 'titile'
},{
title: '消息类型',
align: "center",
dataIndex: 'msgCategory',
customRender: function (text) {
if (text == '1') {
return "通知公告";
} else if (text == "2") {
return "系统消息";
} else {
return text;
}
}
},{
title: '发布人',
align:"center",
dataIndex: 'sender'
},{
title: '发布时间',
align:"center",
dataIndex: 'sendTime'
},{
title: '优先级',
align:"center",
dataIndex: 'priority',
customRender:function (text) {
if(text=='L'){
return "";
}else if(text=="M"){
return "";
}else if(text=="H"){
return "";
} else {
return text;
}
}
},{
title: '阅读状态',
align:"center",
dataIndex: 'readFlag',
customRender:function (text) {
if(text=='0'){
return "未读";
}else if(text=="1"){
return "已读";
} else {
return text;
}
}
},{
title: '操作',
dataIndex: 'action',
align:"center",
scopedSlots: { customRender: 'action' },
}],
url: {
list: "/system/sysAnnouncementSend/getMyAnnouncementSend",
editCementSend:"system/sysAnnouncementSend/editByAnntIdAndUserId",
readAllMsg:"system/sysAnnouncementSend/readAll",
},
loading:false,
}
},
created() {
this.loadData();
},
methods: {
handleDetail: function(record){
this.$refs.sysAnnouncementModal.detail(record);
this.$refs.sysAnnouncementModal.title="查看";
},
showAnnouncement(record){
putAction(this.url.editCementSend,{anntId:record.anntId}).then((res)=>{
if(res.success){
this.loadData();
}
});
this.$refs.ShowAnnouncement.detail(record);
},
readAll(){
var that = this;
that.$confirm({
title:"确认操作",
content:"是否全部标注已读?",
onOk: function(){
putAction(that.url.readAllMsg).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
}
});
}
});
},
}
}
</script>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}z
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
</style>

View File

@ -66,8 +66,8 @@
<div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" v-has="'user:add'" type="primary" icon="plus">添加用户</a-button>
<a-button @click="handleSyncUser" type="primary" icon="plus">重新同步流程用户</a-button>
<a-button type="primary" icon="download" @click="handleExportXls">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :action="importExcelUrl" @change="handleImportExcel">
<a-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">
@ -113,14 +113,14 @@
<template slot="avatarslot" slot-scope="text, record, index">
<div class="anty-img-wrap">
<img :src="getAvatarView(record.avatar)"/>
<a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>
</div>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
<a-divider type="vertical"/>
<a-divider type="vertical" v-has="'user:edit'"/>
<a-dropdown>
<a class="ant-dropdown-link">
@ -153,6 +153,10 @@
</a-popconfirm>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleAgentSettings(record.username)">代理人</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
@ -166,6 +170,7 @@
<password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal>
<sys-user-agent-modal ref="sysUserAgentModal"></sys-user-agent-modal>
</a-card>
</template>
@ -175,11 +180,13 @@
import {putAction} from '@/api/manage';
import {frozenBatch} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import SysUserAgentModal from "./modules/SysUserAgentModal";
export default {
name: "UserList",
mixins: [JeecgListMixin],
components: {
SysUserAgentModal,
UserModal,
PasswordModal
},
@ -269,7 +276,7 @@
list: "/sys/user/list",
delete: "/sys/user/delete",
deleteBatch: "/sys/user/deleteBatch",
exportXlsUrl: "sys/user/exportXls",
exportXlsUrl: "/sys/user/exportXls",
importExcelUrl: "sys/user/importExcel",
},
}
@ -334,6 +341,10 @@
handleChangePassword(username) {
this.$refs.passwordmodal.show(username);
},
handleAgentSettings(username){
this.$refs.sysUserAgentModal.agentSettings(username);
this.$refs.sysUserAgentModal.title = "用户代理人设置";
},
handleSyncUser() {
var that = this;
putAction(that.url.syncUser, {}).then((res) => {
@ -352,52 +363,5 @@
}
</script>
<style scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.ant-card-body {
margin-bottom: 18px;
}
.table-operator button {
margin-bottom: 18px;
margin-right: 5px;
}
.ant-table-tbody .ant-table-row td {
padding-top: 15px;
padding-bottom: 15px;
}
.anty-row-operator button {
margin: 0 5px
}
.ant-btn-danger {
background-color: #ffffff
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
.anty-img-wrap {
height: 25px;
position: relative;
}
.anty-img-wrap > img {
max-height: 100%;
}
@import '~@assets/less/common.less'
</style>

View File

@ -0,0 +1,113 @@
<template>
<a-card :visible="visible">
<a-form :form="form">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构名称">
<a-input style="border:0px;" placeholder="" v-decorator="['departName', {}]"/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
<a-tree-select
disabled
style="width:100%;border: 0px;border: none;outline:none;"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="treeData"
v-model="model.parentId"
placeholder="">
</a-tree-select>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构编码">
<a-input style="border:0px;" placeholder="" v-decorator="['orgCode', {}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="排序">
<a-input-number style="border:0px;" v-decorator="[ 'departOrder',{}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="手机号">
<a-input style="border:0px;" placeholder="" v-decorator="['mobile', {}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="地址">
<a-input style="border:0px;" placeholder="" v-decorator="['address', {}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="备注">
<a-textarea style="border:0px;" placeholder="" v-decorator="['memo', {}]"/>
</a-form-item>
</a-form>
</a-card>
</template>
<script>
import pick from 'lodash.pick'
import {queryIdTree} from '@/api/api'
export default {
name: 'DeptBaseInfo',
components: {},
data() {
return {
departTree: [],
id: '',
model: {},
visible: false,
disable: true,
treeData: [],
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 3}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16}
},
}
},
created() {
this.loadTreeData();
},
methods: {
loadTreeData() {
queryIdTree().then((res) => {
if (res.success) {
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i];
this.treeData.push(temp);
}
}
})
},
open(record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
console.log("record:");
console.log(record);
this.$nextTick(() => {
this.form.setFieldsValue(pick(record, 'departName', 'parentId', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'));
});
},
clearForm() {
this.form.resetFields();
this.treeData = [];
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@ -0,0 +1,285 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="10">
<a-col :md="10" :sm="12">
<a-form-item label="用户账号" style="margin-left:8px">
<a-input placeholder="请输入名称查询" v-model="queryParam.username"></a-input>
</a-form-item>
</a-col>
<!--<a-col :md="8" :sm="8">-->
<!--<a-form-item label="用户名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">-->
<!--<a-input placeholder="请输入名称查询" v-model="queryParam.realname"></a-input>-->
<!--</a-form-item>-->
<!--</a-col>-->
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 18px">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" :md="24" :sm="24" style="margin: -46px 0px 10px 2px">
<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-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除关系
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
selectedRowKeys.length }}</a>项
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
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 href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定要删除关系吗?" @confirm="() => handleDelete(record.id)">
<a>删除关系</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
<Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal>
</a-card>
</template>
<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction, postAction, deleteAction} from '@/api/manage'
import SelectUserModal from './SelectUserModal'
import UserModal from './UserModal'
export default {
name: "DeptUserInfo",
mixins: [JeecgListMixin],
components: {
SelectUserModal,
UserModal
},
data() {
return {
description: '用户信息',
currentDeptId: '',
// 表头
columns: [{
title: '用户账号',
align: "center",
dataIndex: 'username'
},
{
title: '用户名称',
align: "center",
dataIndex: 'realname'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 170
}],
url: {
list: "/sys/user/departUserList",
edit: "/sys/user/editSysDepartWithUser",
delete: "/sys/user/deleteUserInDepart",
deleteBatch: "/sys/user/deleteUserInDepartBatch",
}
}
},
created() {
},
methods: {
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
if (this.currentDeptId === '') return;
var params = this.getQueryParams();//查询条件
params.depId = this.currentDeptId;
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records;
this.ipagination.total = res.result.total;
}
})
},
batchDel: function () {
if (!this.url.deleteBatch) {
this.$message.error("请设置url.deleteBatch属性!")
return
}
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
return;
} else {
var ids = "";
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
var that = this;
console.log(this.currentDeptId);
this.$confirm({
title: "确认删除",
content: "是否删除选中数据?",
onOk: function () {
deleteAction(that.url.deleteBatch, {depId: that.currentDeptId, userIds: ids}).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
} else {
that.$message.warning(res.message);
}
});
}
});
}
},
handleDelete: function (id) {
if (!this.url.delete) {
this.$message.error("请设置url.delete属性!")
return
}
var that = this;
deleteAction(that.url.delete, {depId: this.currentDeptId, userId: id}).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
} else {
that.$message.warning(res.message);
}
});
},
open(record) {
//console.log(record);
this.currentDeptId = record.id;
this.loadData(1);
},
clearList() {
this.currentDeptId = '';
this.dataSource = [];
},
hasSelectDept() {
if (this.currentDeptId == null) {
this.$message.error("请选择一个部门!")
return false;
}
return true;
},
handleAddUserDepart() {
if (this.currentDeptId == '') {
this.$message.error("请选择一个部门!")
} else {
this.$refs.selectUserModal.visible = true;
}
},
handleAdd: function () {
if (this.currentDeptId == '') {
this.$message.error("请选择一个部门!")
} else {
this.$refs.modalForm.departDisabled = true;
this.$refs.modalForm.deptId = this.currentDeptId;
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
}
},
selectOK(data) {
let params = {};
params.depId = this.currentDeptId;
params.userIdList = [];
for (var a = 0; a < data.length; a++) {
params.userIdList.push(data[a]);
}
console.log(params);
postAction(this.url.edit, params).then((res) => {
if (res.success) {
this.$message.success(res.message);
this.loadData();
} else {
this.$message.warning(res.message);
}
})
}
}
}
</script>
<style scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 3px
}
.ant-card {
margin-left: -30px;
margin-right: -30px;
}
.table-page-search-wrapper {
margin-top: -16px;
margin-bottom: 16px;
}
</style>

View File

@ -55,7 +55,7 @@
<script>
import pick from 'lodash.pick'
import {addDictItem, editDictItem, getDictItemList} from '@/api/api'
import {addDictItem, editDictItem} from '@/api/api'
export default {
name: "DictItemModal",
@ -104,20 +104,6 @@
this.form.setFieldsValue(pick(this.model, 'itemText', 'itemValue', 'description', 'sortOrder'))
});
},
// 将查询字典对象数据的方法拆分出来,需要的时候再加载
getDictItemList() {
// 查询字典数据
var params = this.getQueryParams();//查询条件
getDictItemList(params).then((res) => {
if (res.success) {
this.dataSource = res.result.records;
console.log(this.dataSource)
this.ipagination.total = res.result.total;
this.loadrefresh = false;
this.loading = false;
}
})
},
onChose(checked) {
if (checked) {
this.status = 1;
@ -134,6 +120,9 @@
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
values.itemText = (values.itemText || '').trim()
values.itemValue = (values.itemValue || '').trim()
values.description = (values.description || '').trim()
let formData = Object.assign(this.model, values);
formData.status = this.status;
let obj;

View File

@ -39,33 +39,33 @@
<script>
import pick from 'lodash.pick'
import {addDict, editDict, duplicateCheck} from '@/api/api'
import { addDict, editDict, duplicateCheck } from '@/api/api'
export default {
name: "DictModal",
name: 'DictModal',
data() {
return {
value: 1,
title: "操作",
title: '操作',
visible: false,
model: {},
labelCol: {
xs: {span: 24},
sm: {span: 5},
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
xs: { span: 24 },
sm: { span: 16 }
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules: {
dictName: {rules: [{required: true, message: '请输入字典名称!'}]},
dictName: { rules: [{ required: true, message: '请输入字典名称!' }] },
dictCode: {
rules: [{required: true, message: '请输入字典编码!'},
{validator: this.validateDictCode,}]
},
},
rules: [{ required: true, message: '请输入字典编码!' },
{ validator: this.validateDictCode }]
}
}
}
},
created() {
@ -74,76 +74,79 @@
validateDictCode(rule, value, callback) {
// 重复校验
var params = {
tableName: "sys_dict",
fieldName: "dict_code",
tableName: 'sys_dict',
fieldName: 'dict_code',
fieldVal: value,
dataId: this.model.id,
};
dataId: this.model.id
}
duplicateCheck(params).then((res) => {
if (res.success) {
callback();
callback()
} else {
callback(res.message);
callback(res.message)
}
});
})
},
handleChange(value) {
this.model.status = value;
this.model.status = value
},
add() {
this.edit({});
this.edit({})
},
edit(record) {
if (record.id) {
this.visiblekey = true;
this.visiblekey = true
} else {
this.visiblekey = false;
this.visiblekey = false
}
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'dictName', 'dictCode', 'description'))
});
})
},
// 确定
handleOk() {
const that = this;
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let formData = Object.assign(this.model, values);
let obj;
that.confirmLoading = true
values.dictName = (values.dictName || '').trim()
values.dictCode = (values.dictCode || '').trim()
values.description = (values.description || '').trim()
let formData = Object.assign(this.model, values)
let obj
console.log(formData)
if (!this.model.id) {
formData.delFlag = "1";
obj = addDict(formData);
formData.delFlag = '1'
obj = addDict(formData)
} else {
obj = editDict(formData);
obj = editDict(formData)
}
obj.then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message);
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false;
that.close();
that.confirmLoading = false
that.close()
})
}
})
},
// 关闭
handleCancel() {
this.close();
this.close()
},
close() {
this.$emit('close');
this.visible = false;
},
this.$emit('close')
this.visible = false
}
}
}
</script>

View File

@ -113,6 +113,11 @@
},
validateToNextPassword (rule, value, callback) {
const form = this.form;
const confirmpassword=form.getFieldValue('confirmpassword');
console.log("confirmpassword==>",confirmpassword);
if (value && confirmpassword && value !== confirmpassword) {
callback('两次输入的密码不一样');
}
if (value && this.confirmDirty) {
form.validateFields(['confirm'], { force: true })
}
@ -130,7 +135,6 @@
const value = e.target.value
this.confirmDirty = this.confirmDirty || !!value
}
}
}
</script>

View File

@ -36,12 +36,23 @@
label="规则值">
<a-input placeholder="请输入规则值" v-decorator="['ruleValue', validatorRules.ruleValue]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="状态">
<a-radio-group buttonStyle="solid" v-decorator="['status',{initialValue:'1'}]">
<a-radio-button value="1">有效</a-radio-button>
<a-radio-button value="0">无效</a-radio-button>
</a-radio-group>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import {httpAction, getAction} from '@/api/manage'
import { httpAction } from '@/api/manage'
import pick from 'lodash.pick'
export default {
@ -96,7 +107,7 @@
this.visible = true
this.initRuleCondition()
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'ruleName', 'ruleColumn', 'ruleConditions', 'ruleValue'))
this.form.setFieldsValue(pick(this.model, 'status','ruleName', 'ruleColumn', 'ruleConditions', 'ruleValue'))
})
},
close() {
@ -119,6 +130,12 @@
method = 'put'
}
let formData = Object.assign(this.model, values)
if(formData.ruleColumn && formData.ruleColumn.length>0){
formData.ruleColumn = formData.ruleColumn.trim()
}
if(formData.ruleValue && formData.ruleValue.length>0){
formData.ruleValue = formData.ruleValue.trim()
}
httpAction(httpurl, formData, method).then((res) => {
if (res.success) {
that.$message.success(res.message)

View File

@ -15,7 +15,7 @@
<a-radio-group @change="onChangeMenuType" v-decorator="['menuType',{'initialValue':0}]">
<a-radio :value="0">一级菜单</a-radio>
<a-radio :value="1">子菜单</a-radio>
<a-radio :value="2">按钮/数据权限</a-radio>
<a-radio :value="2">按钮/权限</a-radio>
</a-radio-group>
</a-form-item>
@ -74,6 +74,24 @@
<a-input placeholder="多个用逗号分隔, 如: user:list,user:create" v-decorator="[ 'perms', {}]" :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item
v-show="!show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="授权策略">
<j-dict-select-tag v-decorator="['permsType', {}]" placeholder="请选择授权策略" :type="'radio'" :triggerChange="true" dictCode="global_perms_type"/>
</a-form-item>
<a-form-item
v-show="!show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="状态">
<j-dict-select-tag v-decorator="['status', {}]" placeholder="请选择状态" :type="'radio'" :triggerChange="true" dictCode="valid_status"/>
</a-form-item>
<a-form-item
v-show="show"
:labelCol="labelCol"
@ -136,6 +154,7 @@
import {addPermission,editPermission,queryTreeList} from '@/api/api'
import Icons from './icon/Icons'
import pick from 'lodash.pick'
import { initDictOptions } from '@/components/dict/JDictSelectUtil'
export default {
name: "PermissionModal",
@ -168,12 +187,14 @@
form: this.$form.createForm(this),
validatorRules:{
name:{rules: [{ required: true, message: '请输入菜单标题!' }]},
permsType:{rules: [{ required: true, message: '请输入授权策略!' }]},
sortNo:{rules: [{validator: this.validateNumber}]},
},
iconChooseVisible: false,
}
},
created () {
this.initDictConfig();
},
methods: {
loadTree(){
@ -193,7 +214,7 @@
});
},
add () {
this.edit();
this.edit({status:'1',permsType:'1'});
},
edit (record) {
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
@ -224,12 +245,13 @@
}
this.show = true;
this.menuLabel = '菜单名称';
this.routeSwitch = true;
}
//----------------------------------------------------------------------------------------------
this.visible = true;
this.loadTree();
let fieldsVal = pick(this.model,'name','perms','component','url','sortNo','menuType');
let fieldsVal = pick(this.model,'name','perms','permsType','component','url','sortNo','menuType','status');
this.$nextTick(() => {
this.form.setFieldsValue(fieldsVal)
});
@ -312,6 +334,8 @@
this.drawerWidth = 700;
}
},
initDictConfig() {
},
}
}
</script>

View File

@ -1,7 +1,7 @@
<template>
<a-drawer
title="数据规则/按钮权限配置"
width=365
width="365"
:closable="false"
@close="onClose"
:visible="visible"
@ -75,8 +75,7 @@
},
saveDataruleForRole(){
if(!this.dataruleChecked || this.dataruleChecked.length==0){
this.$message.warning("现勾选数据权限然后保存!")
return false;
this.$message.warning("注意,现未勾选任何数据权限!")
}
let params = {
permissionId:this.functionId,

View File

@ -41,7 +41,7 @@
<script>
import pick from 'lodash.pick'
import {addRole,editRole,checkRoleCode } from '@/api/api'
import {addRole,editRole,duplicateCheck } from '@/api/api'
export default {
name: "RoleModal",
@ -133,14 +133,16 @@
callback("角色编码不可输入汉字!");
}else{
var params = {
id:this.model.id,
roleCode:value
tableName: "sys_role",
fieldName: "role_code",
fieldVal: value,
dataId: this.model.id,
};
checkRoleCode(params).then((res)=>{
duplicateCheck(params).then((res)=>{
if(res.success){
callback();
}else{
callback("角色编码已存在!");
callback(res.message);
}
});
}

View File

@ -0,0 +1,266 @@
<template>
<a-modal
:title="title"
:width="1200"
:visible="visible"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :span="6">
<a-form-item label="账号">
<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="性别">
<a-select v-model="queryParam.sex" placeholder="请选择性别查询">
<a-select-option value="">请选择性别查询</a-select-option>
<a-select-option value="1">男性</a-select-option>
<a-select-option value="2">女性</a-select-option>
</a-select>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :span="6">
<a-form-item label="邮箱">
<a-input placeholder="请输入邮箱查询" v-model="queryParam.email"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="手机号码">
<a-input placeholder="请输入手机号码查询" v-model="queryParam.phone"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="状态">
<a-select v-model="queryParam.status" placeholder="请选择用户状态查询">
<a-select-option value="">请选择用户状态</a-select-option>
<a-select-option value="1">正常</a-select-option>
<a-select-option value="2">解冻</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<a-col :span="6" >
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchByquery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-table
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"
>
</a-table>
</a-modal>
</template>
<script>
import { filterObj } from '@/utils/util';
import { getUserList } from '@/api/api'
export default {
name: "SelectUserListModal",
components: {
},
data () {
return {
title:"选择用户",
queryParam: {},
columns: [{
title: '用户账号',
align:"center",
dataIndex: 'username',
fixed:'left',
width:200
},{
title: '真实姓名',
align:"center",
dataIndex: 'realname',
},{
title: '性别',
align:"center",
dataIndex: 'sex',
customRender:function (text) {
if(text==1){
return "";
}else if(text==2){
return "";
}else{
return text;
}
}
},{
title: '手机号码',
align:"center",
dataIndex: 'phone'
},{
title: '邮箱',
align:"center",
dataIndex: 'email'
},{
title: '状态',
align:"center",
dataIndex: 'status',
customRender:function (text) {
if(text==1){
return "正常";
}else if(text==2){
return "冻结";
}else{
return text;
}
}
}],
dataSource:[],
ipagination:{
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " " + total + ""
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter:{
column: 'createTime',
order: 'desc',
},
selectedRowKeys: [],
selectionRows: [],
visible:false,
toggleSearchStatus:false,
}
},
created() {
this.loadData();
},
methods: {
add (selectUser,userIds) {
this.visible = true;
this.edit(selectUser,userIds);
},
edit(selectUser,userIds){
this.selectionRows = selectUser;
this.selectedRowKeys = userIds.split(',');
},
loadData (arg){
if(arg===1){
this.ipagination.current = 1;
}
let params = this.getQueryParams();//查询条件
getUserList(params).then((res)=>{
if(res.success){
this.dataSource = res.result.records;
this.ipagination.total = res.result.total;
}
})
},
getQueryParams(){
let param = Object.assign({}, this.queryParam,this.isorter);
param.field = this.getQueryField();
param.current = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
getQueryField(){
let str = "id,";
for(let a = 0;a<this.columns.length;a++){
str+=","+this.columns[a].dataIndex;
}
return str;
},
onSelectChange (selectedRowKeys,selectionRows) {
this.selectedRowKeys = selectedRowKeys;
console.log(this.selectedRowKeys);
this.selectionRows = selectionRows;
},
searchReset(){
let that = this;
Object.keys(that.queryParam).forEach(function(key){
that.queryParam[key] = '';
});
that.loadData(1);
},
handleTableChange(pagination, filters, sorter){
//TODO 筛选
if (Object.keys(sorter).length>0){
this.isorter.column = sorter.field;
this.isorter.order = "ascend"==sorter.order?"asc":"desc"
}
this.ipagination = pagination;
this.loadData();
},
handleCancel () {
this.selectionRows = [];
this.selectedRowKeys = [];
this.visible = false;
},
handleOk () {
this.$emit("choseUser",this.selectionRows);
this.handleCancel();
},
searchByquery(){
this.loadData(1);
},
searchReset(){
let that = this;
Object.keys(that.queryParam).forEach(function(key){
that.queryParam[key] = '';
});
that.loadData(1);
},
handleToggleSearch(){
this.toggleSearchStatus = !this.toggleSearchStatus;
},
}
}
</script>
<style scoped>
.ant-card-body .table-operator{
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td{
padding-top:15px;
padding-bottom:15px;
}
.anty-row-operator button{margin: 0 5px}
.ant-btn-danger{background-color: #ffffff}
.ant-modal-cust-warp{height: 100%}
.ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
.ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
.anty-img-wrap{height:25px;position: relative;}
.anty-img-wrap > img{max-height:100%;}
</style>

View File

@ -0,0 +1,275 @@
<template>
<div>
<a-modal
centered
:title="title"
:width="1000"
:visible="visible"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :span="10">
<a-form-item label="姓名">
<a-input placeholder="请输入姓名" v-model="queryParam.username"></a-input>
</a-form-item>
</a-col>
<a-col :span="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>
<!-- table区域-begin -->
<div>
<a-table
size="small"
bordered
rowKey="id"
:columns="columns1"
:dataSource="dataSource1"
:pagination="ipagination"
:loading="loading"
:scroll="{ y: 240 }"
:rowSelection="{selectedRowKeys: selectedRowKeys,onSelectAll:onSelectAll,onSelect:onSelect,onChange: onSelectChange}"
@change="handleTableChange">
</a-table>
</div>
<!-- table区域-end -->
</a-modal>
</div>
</template>
<script>
import {filterObj} from '@/utils/util'
import {getAction} from '@/api/manage'
export default {
name: "SelectUserModal",
data() {
return {
title: "添加已有用户",
names: [],
visible: false,
placement: 'right',
description: '',
// 查询条件
queryParam: {},
// 表头
columns1: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 50,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '用户账号',
align: "center",
width: 113,
dataIndex: 'username'
},
{
title: '用户名称',
align: "center",
width: 100,
dataIndex: 'realname'
},
{
title: '状态',
align: "center",
width: 100,
dataIndex: 'status'
}
],
columns2: [
{
title: '用户账号',
align: "center",
dataIndex: 'username',
},
{
title: '用户名称',
align: "center",
dataIndex: 'realname',
},
{
title: '操作',
dataIndex: 'action',
align: "center",
width: 100,
scopedSlots: {customRender: 'action'},
}
],
//数据集
dataSource1: [],
dataSource2: [],
// 分页参数
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " " + total + ""
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter: {
column: 'createTime',
order: 'desc',
},
loading: false,
selectedRowKeys: [],
selectedRows: [],
url: {
list: "/sys/user/list",
}
}
},
created() {
this.loadData();
},
methods: {
searchQuery() {
this.loadData(1);
},
searchReset() {
this.queryParam = {};
this.loadData(1);
},
handleCancel() {
this.visible = false;
},
handleOk() {
this.dataSource2 = this.selectedRowKeys;
console.log("data:" + this.dataSource2);
this.$emit("selectFinished", this.dataSource2);
this.visible = false;
},
add() {
this.visible = true;
},
loadData(arg) {
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
var params = this.getQueryParams();//查询条件
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource1 = res.result.records;
this.ipagination.total = res.result.total;
}
})
},
getQueryParams() {
var param = Object.assign({}, this.queryParam, this.isorter);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
getQueryField() {
//TODO 字段权限控制
},
onSelectAll(selected, selectedRows, changeRows) {
if (selected === true) {
for (var a = 0; a < changeRows.length; a++) {
this.dataSource2.push(changeRows[a]);
}
} else {
for (var b = 0; b < changeRows.length; b++) {
this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1);
}
}
// console.log(selected, selectedRows, changeRows);
},
onSelect(record, selected) {
if (selected === true) {
this.dataSource2.push(record);
} else {
var index = this.dataSource2.indexOf(record);
//console.log();
if (index >= 0) {
this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
}
}
},
onSelectChange(selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectedRows;
},
onClearSelected() {
this.selectedRowKeys = [];
this.selectionRows = [];
},
handleDelete: function (record) {
this.dataSource2.splice(this.dataSource2.indexOf(record), 1);
},
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
console.log(sorter);
//TODO 筛选
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
this.ipagination = pagination;
this.loadData();
}
}
}
</script>
<style lang="less" scoped>
.ant-card-body .table-operator {
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td {
padding-top: 15px;
padding-bottom: 15px;
}
.anty-row-operator button {
margin: 0 5px
}
.ant-btn-danger {
background-color: #ffffff
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
</style>

View File

@ -6,6 +6,7 @@
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
:okButtonProps="{ props: {disabled: disabled} }"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
@ -17,6 +18,18 @@
label="标题">
<a-input placeholder="请输入标题" v-decorator="['titile', validatorRules.title]" :readOnly="disableSubmit" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="消息类型">
<a-select
v-decorator="[ 'msgCategory', validatorRules.msgCategory]"
placeholder="请选择消息类型"
:disabled="disableSubmit">
<a-select-option value="1">通知公告</a-select-option>
<a-select-option value="2">系统消息</a-select-option>
</a-select>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
@ -54,7 +67,7 @@
:wrapperCol="wrapperCol"
label="通告对象类型">
<a-select
v-decorator="[ 'msgType', {}]"
v-decorator="[ 'msgType', validatorRules.msgType]"
placeholder="请选择通告对象类型"
:disabled="disableSubmit"
@change="chooseMsgType">
@ -67,24 +80,17 @@
:wrapperCol="wrapperCol"
label="指定用户"
v-if="userType">
<a-input placeholder="请选择用户" v-decorator="['userIds',{}]" @click="selectUserIds" disabled="true" />
<a-select
mode="multiple"
style="width: 100%"
placeholder="请选择用户"
v-model="selectedUser"
@dropdownVisibleChange="selectUserIds">
</a-select>
</a-form-item>
<!--<a-modal
:title="用户选择"
:width="800"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
cancelText="关闭"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 95%;overflow-y: hidden" ref="modelSelectUser"
>
123
</a-modal>-->
</a-form>
</a-spin>
<select-user-list-modal ref="UserListModal" @choseUser="choseUser"></select-user-list-modal>
</a-modal>
</template>
@ -92,8 +98,12 @@
import { httpAction } from '@/api/manage'
import pick from 'lodash.pick'
import moment from "moment"
import { getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import SelectUserListModal from "./SelectUserListModal";
export default {
components: {SelectUserListModal},
name: "SysAnnouncementModal",
data () {
return {
@ -114,14 +124,19 @@
form: this.$form.createForm(this),
validatorRules:{
title:{rules: [{ required: true, message: '请输入标题!' }]},
msgCategory:{rules: [{ required: true, message: '请选择消息类型!' }]},
msgType:{rules: [{ required: true, message: '请选择通告对象类型!' }]},
},
url: {
queryByIds: "/sys/user/queryByIds",
add: "/sys/annountCement/add",
edit: "/sys/annountCement/edit",
},
userType:false,
visible: false,
confirmLoading: false,
userIds:[],
selectedUser:[],
disabled:false,
msgContent:"",
}
},
created () {
@ -132,18 +147,38 @@
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.disable = false;
this.visible = true;
this.getUser(record);
},
getUser(record){
this.model = Object.assign({}, record);
//this.model.msgContent.replace("<br/>","\n");
console.log(this.model.msgContent);
// 指定用户
if(record&&record.msgType === "USER"){
this.userType = true;
this.userIds = record.userIds;
getAction(this.url.queryByIds,{userIds:this.userIds}).then((res)=>{
if(res.success){
for(var i=0;i<res.result.length;i++){
this.selectedUser.push(res.result[i].realname);
}
this.$refs.UserListModal.edit(res.result,this.userIds);
}
});
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'titile','msgContent','priority','msgType'))
//时间格式化
this.form.setFieldsValue(pick(this.model,'titile','msgContent','sender','priority','msgCategory','msgType','sendStatus','delFlag'))
this.form.setFieldsValue({startTime:this.model.startTime?moment(this.model.startTime):null})
this.form.setFieldsValue({endTime:this.model.endTime?moment(this.model.endTime):null})
this.form.setFieldsValue({sendTime:this.model.sendTime?moment(this.model.sendTime):null})
this.form.setFieldsValue({cancelTime:this.model.cancelTime?moment(this.model.cancelTime):null})
});
},
close () {
this.$emit('close');
this.selectedUser = [];
this.visible = false;
},
handleOk () {
@ -162,6 +197,9 @@
method = 'put';
}
let formData = Object.assign(this.model, values);
if(this.userType){
formData.userIds = this.userIds;
}
//时间格式化
formData.startTime = formData.startTime?formData.startTime.format('YYYY-MM-DD HH:mm:ss'):null;
formData.endTime = formData.endTime?formData.endTime.format('YYYY-MM-DD HH:mm:ss'):null;
@ -185,18 +223,37 @@
})
},
handleCancel () {
this.close()
this.visible = false;
this.$emit('close');
this.resetUser();
},
resetUser (){
this.userType = false;
this.userIds = [];
this.selectedUser = [];
this.disabled = false;
this.$refs.UserListModal.edit(null,null);
},
selectUserIds() {
this.$refs.UserListModal.add(this.selectedUser,this.userIds);
},
chooseMsgType(value) {
if("USER" == value) {
this.userType = true;
} else {
this.userType = false;
this.selectedUser = [];
this.userIds = [];
}
},
selectUserIds() {
console.log(1);
this.$refs.modalSelectUser.show();
// 子modal回调
choseUser:function(userList){
this.selectedUser = [];
this.userIds = [];
for(var i=0;i<userList.length;i++){
this.selectedUser.push(userList[i].realname);
this.userIds += userList[i].id+","
}
}
}

View File

@ -0,0 +1,194 @@
<template>
<a-modal
:title="title"
:width="800"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="用户名">
<a-input placeholder="请输入用户名" v-decorator="['userName', {}]" readOnly="true"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="代理人用户名">
<a-input-search
placeholder="请输入代理人用户名"
v-decorator="['agentUserName', validatorRules.agentUserName]"
readOnly="true"
@search="onSearchDepUser"
size="large">
<a-button slot="enterButton">选择用户</a-button>
</a-input-search>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="代理开始时间">
<a-date-picker showTime format='YYYY-MM-DD HH:mm:ss' v-decorator="[ 'startTime', validatorRules.startTime]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="代理结束时间">
<a-date-picker showTime format='YYYY-MM-DD HH:mm:ss' v-decorator="[ 'endTime', validatorRules.endTime]" />
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="状态">
<a-radio-group class="fontiframe" name="radioGroup" v-decorator="[ 'status', {}]">
<a-radio class="radioGroup" value="1">有效</a-radio>
<a-radio class="radioGroup" value="0">无效</a-radio>
</a-radio-group>
</a-form-item>
</a-form>
<!-- 通过部门筛选,选择人 -->
<j-search-user-by-dep ref="JSearchUserByDep" @ok="onSearchDepUserCallBack"></j-search-user-by-dep>
</a-spin>
</a-modal>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import pick from 'lodash.pick'
import moment from "moment"
import JSearchUserByDep from '@/components/jeecgbiz/JSearchUserByDep'
export default {
name: "SysUserAgentModal",
components: {
JSearchUserByDep
},
data () {
return {
title:"操作",
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
username:"",
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules:{
agentUserName:{rules: [{ required: true, message: '请输入代理人用户名!' }]},
startTime:{rules: [{ required: true, message: '请输入代理开始时间!' }]},
endTime:{rules: [{ required: true, message: '请输入代理结束时间!' }]},
},
url: {
add: "/system/sysUserAgent/add",
edit: "/system/sysUserAgent/edit",
queryByUserName:"/system/sysUserAgent/queryByUserName",
},
}
},
created () {
},
methods: {
agentSettings(username){
this.username = username;
this.init();
},
init () {
var params = {userName:this.username};//查询条件
getAction(this.url.queryByUserName,params).then((res)=>{
if(res.success){
console.log("获取流程节点信息",res);
this.edit (res.result);
}else{
this.edit({userName:this.username,status:"0"});
}
})
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'userName','agentUserName','status'))
//时间格式化
this.form.setFieldsValue({startTime:this.model.startTime?moment(this.model.startTime):null})
this.form.setFieldsValue({endTime:this.model.endTime?moment(this.model.endTime):null})
});
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
//时间格式化
formData.startTime = formData.startTime?formData.startTime.format('YYYY-MM-DD HH:mm:ss'):null;
formData.endTime = formData.endTime?formData.endTime.format('YYYY-MM-DD HH:mm:ss'):null;
console.log(formData)
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
//this.init();
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
},
//通过组织机构筛选选择用户
onSearchDepUser() {
this.$refs.JSearchUserByDep.showModal();
this.$refs.JSearchUserByDep.title = '根据部门查询用户';
this.$refs.JSearchUserByDep.type = 'radio'
},
onSearchDepUserCallBack(selectedDepUsers) {
this.form.setFieldsValue({agentUserName:selectedDepUsers});
}
}
}
</script>
<style scoped>
</style>

View File

@ -39,7 +39,7 @@
<a-form-item label="用户名字" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<a-input placeholder="请输入用户名称" v-decorator="[ 'realname', validatorRules.realname]" />
</a-form-item>
<template v-show="!roleDisabled">
<a-form-item label="角色分配" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<a-select
mode="multiple"
@ -51,8 +51,10 @@
</a-select-option>
</a-select>
</a-form-item>
</template>
<!--部门分配-->
<a-form-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<template v-show="!departDisabled">
<a-form-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<a-input-search
placeholder="点击右侧按钮选择部门"
v-model="checkedDepartNameString"
@ -61,7 +63,7 @@
<a-button slot="enterButton" icon="search">选择</a-button>
</a-input-search>
</a-form-item>
</template>
<a-form-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-upload
listType="picture-card"
@ -73,7 +75,7 @@
:beforeUpload="beforeUpload"
@change="handleChange"
>
<img v-if="model.avatar" :src="getAvatarView()" alt="头像" style="height:104px;max-width:300px"/>
<img v-if="picUrl" :src="getAvatarView()" alt="头像" style="height:104px;max-width:300px"/>
<div v-else>
<a-icon :type="uploadLoading ? 'loading' : 'plus'" />
<div class="ant-upload-text">上传</div>
@ -100,7 +102,11 @@
</a-form-item>
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入手机号码" v-decorator="[ 'phone', validatorRules.phone]" />
<a-input placeholder="请输入手机号码" :disabled="disabledAuth('user:form:phone')" v-decorator="[ 'phone', validatorRules.phone]" />
</a-form-item>
<a-form-item label="工作流引擎" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-decorator="['activitiSync', {}]" placeholder="请选择是否同步工作流引擎" :type="'radio'" :triggerChange="true" dictCode="activiti_sync"/>
</a-form-item>
</a-form>
@ -123,8 +129,10 @@
// 引入搜索部门弹出框的组件
import departWindow from './DepartWindow'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getAction, httpAction } from '@/api/manage'
import { getAction, httpAction,putAction } from '@/api/manage'
import {addUser,editUser,queryUserRole,queryall,checkUsername } from '@/api/api'
import { disabledAuthFilter } from "@/utils/authFilter"
export default {
name: "RoleModal",
components: {
@ -132,6 +140,10 @@
},
data () {
return {
departDisabled: false, //是否是我的部门调用该页面
deptId: '',
roleDisabled: false, //是否是角色维护调用该页面
roleId: '',
modalWidth:800,
drawerWidth:700,
modaltoggleFlag:true,
@ -170,7 +182,7 @@
phone:{rules: [{validator: this.validatePhone}]},
email:{rules: [{type: 'email', message: '请输入正确格式的电子邮箱!',}]},
roles:{}
// sex:{initialValue:((!this.model.sex)?"": (this.model.sex+""))}
// sex:{initialValue:((!this.model.sex)?"": (this.model.sex+""))}
},
title:"操作",
visible: false,
@ -189,12 +201,15 @@
confirmLoading: false,
headers:{},
form:this.$form.createForm(this),
picUrl: "",
url: {
addUDepartIds:"/sys/user/addUDepartIds", // 引入为用户添加部门信息需要的url
editUDepartIds:"/sys/user/editUDepartIds", // 引入为用户更新部门信息需要的url
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
imgerver: window._CONFIG['domianURL']+"/sys/common/view",
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
},
}
},
@ -209,6 +224,9 @@
}
},
methods: {
disabledAuth(code){
return disabledAuthFilter(code);
},
//窗口最大化切换
toggleScreen(){
if(this.modaltoggleFlag){
@ -244,8 +262,9 @@
this.userId=""
},
add () {
this.picUrl = "";
this.refresh()
this.edit({});
this.edit({activitiSync:'1'});
},
edit (record) {
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
@ -255,12 +274,13 @@
that.form.resetFields();
if(record.hasOwnProperty("id")){
that.loadUserRoles(record.id);
this.picUrl = "Has no pic url yet";
}
that.userId = record.id;
that.visible = true;
that.model = Object.assign({}, record);
that.$nextTick(() => {
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone'))
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync'))
});
// 调用查询用户对应的部门信息的方法
that.checkedDepartKeys = [];
@ -292,6 +312,13 @@
},
moment,
handleSubmit () {
if(this.departDisabled===true){
this.handleSubmitDepart();
return
}else if(this.roleDisabled===true){
this.handleSubmitRole()
return
}
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
@ -319,6 +346,97 @@
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
//同步用户到工作流
this.handleSyncUser(this.model.username);
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.checkedDepartNames = [];
that.close();
})
}
})
},
// 提交表单(我的部门调用)
handleSubmitDepart(){
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let avatar = that.model.avatar;
if (!values.birthday) {
values.birthday = '';
} else {
values.birthday = values.birthday.format(this.dateFormat);
}
let formData = Object.assign(this.model, values);
formData.avatar = avatar;
formData.selectedroles = this.roleId;
//生成userId
getAction(this.url.userId).then((res) => {
if (res.success) {
this.userId = res.result;
console.log("generateUserId:" + this.userId)
formData.id = that.userId;
console.log("formData.id:" + formData.id)
this.addDepartsToUser1(that, formData); // 调用根据当前用户添加部门信息的方法
addUser(formData).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
//同步用户到工作流
this.handleSyncUser(this.model.username);
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.checkedDepartNames = [];
that.close();
})
}
})
}
})
},
//提交表单(角色维护调用)
handleSubmitRole(){
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let avatar = that.model.avatar;
if(!values.birthday){
values.birthday = '';
}else{
values.birthday = values.birthday.format(this.dateFormat);
}
let formData = Object.assign(this.model, values);
formData.avatar = avatar;
formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
if(this.roleId!=''){
formData.selectedroles = this.roleId;
}
that.addDepartsToUser(that,formData); // 调用根据当前用户添加部门信息的方法
let obj;
if(!this.model.id){
formData.id = this.userId;
obj=addUser(formData);
}else{
obj=editUser(formData);
}
obj.then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
//同步用户到工作流
this.handleSyncUser(this.model.username);
}else{
that.$message.warning(res.message);
}
@ -334,7 +452,6 @@
handleCancel () {
this.close()
},
// 根据当前用户添加部门信息的方法
addDepartsToUser(that,formData){
let httpurl = '';
@ -354,8 +471,30 @@
}
})
},
// 根据当前用户添加部门信息的方法(我的部门调用)
addDepartsToUser1: function() {
let httpurl = ''
let method = ''
httpurl += this.url.addUDepartIds
method = 'post';
let departIdList = [];
departIdList.push(this.deptId);
httpAction(httpurl, { userId: this.userId, departIdList: departIdList }, method).then((res) => {
if (res.success) {
this.userId = ''
this.deptId = ''
this.departIdList = []
} else {
this.$message.warning(res.message)
}
})
},
validateToNextPassword (rule, value, callback) {
const form = this.form;
const confirmpassword=form.getFieldValue('confirmpassword');
if (value && confirmpassword && value !== confirmpassword) {
callback('两次输入的密码不一样!');
}
if (value && this.confirmDirty) {
form.validateFields(['confirm'], { force: true })
}
@ -410,6 +549,7 @@
//TODO 验证文件大小
},
handleChange (info) {
this.picUrl = "";
if (info.file.status === 'uploading') {
this.uploadLoading = true
return
@ -420,6 +560,7 @@
console.log(response);
if(response.success){
this.model.avatar = response.message;
this.picUrl = "Has no pic url yet";
}else{
this.$message.warning(response.message);
}
@ -455,6 +596,18 @@
this.drawerWidth = 700;
}
},
handleSyncUser(userName) {
try{
var that = this;
putAction(that.url.syncUserByUserName, {userName:userName}).then((res) => {
//if (res.success) {
//that.$message.success(res.message);
// } else {
//that.$message.warning(res.message);
//}
})
}catch (e){}
},
}
}
</script>

View File

@ -20,8 +20,8 @@
@select="onTreeNodeSelect"
:expandedKeys="expandedKeysss"
:checkStrictly="checkStrictly">
<span slot="hasDatarule" slot-scope="{slotTitle,icon}">
{{ slotTitle }}<a-icon v-if="icon" type="align-left" style="margin-left:5px;color: red;"></a-icon>
<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>
@ -132,8 +132,9 @@
handleSubmit(){
let that = this;
let params = {
roleId:that.roleId,
permissionIds:that.checkedKeys.join(","),
roleId:that.roleId
lastpermissionIds:that.defaultCheckedKeys.join(","),
};
that.loading = true;
console.log("请求参数",params);