JeecgBoot 2.1.1 代码生成器AI版本发布

This commit is contained in:
zhangdaihao
2019-10-18 18:37:41 +08:00
parent 5b67b76b98
commit 6dbc37c410
267 changed files with 16761 additions and 26860 deletions

View File

@ -0,0 +1,31 @@
<template>
<a-row type="flex" :gutter="16">
<a-col :md="5" :sm="24">
<address-list-left v-model="currentOrgCode"/>
</a-col>
<a-col :md="24-5" :sm="24">
<address-list-right v-model="currentOrgCode"/>
</a-col>
</a-row>
</template>
<script>
import AddressListLeft from './modules/AddressListLeft'
import AddressListRight from './modules/AddressListRight'
export default {
name: 'AddressList',
components: { AddressListLeft, AddressListRight },
data() {
return {
description: '通讯录页面',
currentOrgCode: ''
}
},
methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -2,7 +2,7 @@
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="表名">

View File

@ -37,7 +37,7 @@
:selectedKeys="selectedKeys"
:checkedKeys="checkedKeys"
:treeData="departTree"
:checkStrictly="true"
:checkStrictly="checkStrictly"
:expandedKeys="iExpandedKeys"
:autoExpandParent="autoExpandParent"
@expand="onExpand"/>
@ -53,6 +53,23 @@
</a-col>
</div>
</a-card>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<div class="drawer-bootom-button">
<a-dropdown :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
</div>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col>
<a-col :md="12" :sm="24">
<a-card :bordered="false">
@ -79,6 +96,28 @@
label="机构编码">
<a-input disabled placeholder="请输入机构编码" v-decorator="['orgCode', validatorRules.orgCode ]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构类型">
<template v-if="orgCategoryDisabled">
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="1">
公司
</a-radio>
</a-radio-group>
</template>
<template v-else>
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="2">
部门
</a-radio>
<a-radio value="3">
岗位
</a-radio>
</a-radio-group>
</template>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
@ -186,6 +225,10 @@
selectedKeys: [],
autoIncr: 1,
currSelected: {},
allTreeKeys:[],
checkStrictly: true,
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
@ -202,6 +245,7 @@
validatorRules: {
departName: {rules: [{required: true, message: '请输入机构/部门名称!'}]},
orgCode: {rules: [{required: true, message: '请输入机构编码!'}]},
orgCategory: {rules: [{required: true, message: '请输入机构类型!'}]},
mobile: {rules: [{validator: this.validateMobile}]}
},
url: {
@ -211,6 +255,7 @@
exportXlsUrl: "sys/sysDepart/exportXls",
importExcelUrl: "sys/sysDepart/importExcel",
},
orgCategoryDisabled:false,
}
},
computed: {
@ -233,7 +278,8 @@
that.treeData.push(temp)
that.departTree.push(temp)
that.setThisExpandedKeys(temp)
console.log(temp.id)
that.getAllKeys(temp);
// console.log(temp.id)
}
this.loading = false
}
@ -338,7 +384,14 @@
onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info)
this.hiding = false
this.checkedKeys = checkedKeys.checked
//this.checkedKeys = checkedKeys.checked
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
if(this.checkStrictly){
this.checkedKeys = checkedKeys.checked;
}else{
this.checkedKeys = checkedKeys
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
},
onSelect(selectedKeys, e) {
console.log('selected', selectedKeys, e)
@ -355,8 +408,13 @@
},
// 触发onSelect事件时,为部门树右侧的form表单赋值
setValuesToForm(record) {
if(record.orgCategory == '1'){
this.orgCategoryDisabled = true;
}else{
this.orgCategoryDisabled = false;
}
this.form.getFieldDecorator('fax', {initialValue: ''})
this.form.setFieldsValue(pick(record, 'departName', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
},
getCurrSelectedTitle() {
return !this.currSelected.title ? '' : this.currSelected.title
@ -459,6 +517,39 @@
}
}
},
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
expandAll () {
this.iExpandedKeys = this.allTreeKeys
},
closeAll () {
this.iExpandedKeys = []
},
checkALL () {
this.checkStriccheckStrictlytly = false
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
getAllKeys(node) {
// console.log('node',node);
this.allTreeKeys.push(node.key)
if (node.children && node.children.length > 0) {
for (let a = 0; a < node.children.length; a++) {
this.getAllKeys(node.children[a])
}
}
}
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
},
created() {
this.currFlowId = this.$route.params.id
@ -516,4 +607,16 @@
.ant-btn {
margin-left: 3px
}
.drawer-bootom-button {
/*position: absolute;*/
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: left;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

View File

@ -9,8 +9,8 @@
<template>
<!--组织机构-->
<a-directory-tree
selectable
<a-tree
showLine
:selectedKeys="selectedKeys"
:checkStrictly="true"
@select="onSelect"

View File

@ -0,0 +1,125 @@
<template>
<a-modal
:width="modalWidth"
:style="modalStyle"
:visible="visible"
:maskClosable="false"
@cancel="handleCancel">
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
</template>
<a-table
ref="table"
rowKey="id"
size="middle"
:columns="columns"
:loading="loading"
:dataSource="dataSource"
:pagination="false">
<span slot="action" slot-scope="text, record">
<a @click="handleBack(record.id)"><a-icon type="redo"/>字典取回</a>
<a-divider type="vertical"/>
<a @click="handleDelete(record.id)"><a-icon type="scissor"/>彻底删除</a>
</span>
</a-table>
</a-modal>
</template>
<script>
import { getAction,deleteAction,putAction } from '@/api/manage'
export default {
name: "DictDeleteList",
data () {
return {
modalWidth: '90%',
modalStyle: { 'top': '20px'},
title: '操作',
visible: false,
loading: false,
dataSource:[],
columns:[
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 120,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '字典名称',
align: "left",
dataIndex: 'dictName'
},
{
title: '字典编号',
align: "left",
dataIndex: 'dictCode'
},
{
title: '描述',
align: "left",
dataIndex: 'description'
},
{
title: '操作',
dataIndex: 'action',
align: "center",
scopedSlots: {customRender: 'action'}
}
]
}
},
methods: {
handleCancel(){
this.visible = false
},
show(){
this.visible = true
this.loadData();
},
loadData(){
this.loading = true
getAction("/sys/dict/deleteList").then(res=>{
this.loading = false
if(res.success){
this.dataSource = res.result
}else{
this.$message.warning(res.message)
}
})
},
handleBack(id){
putAction("/sys/dict/back/"+id).then(res=>{
if(res.success){
this.$message.success(res.message)
this.loadData();
}else{
this.$message.warning(res.message)
}
})
},
handleDelete(id){
deleteAction("/sys/dict/deletePhysic/"+id).then(res=>{
if(res.success){
this.$message.success(res.message)
this.loadData();
}else{
this.$message.warning(res.message)
}
})
}
}
}
</script>
<style scoped>
</style>

View File

@ -16,7 +16,7 @@
}">
<div class="table-page-search-wrapper">
<a-form layout="inline" :form="form">
<a-form layout="inline" :form="form" @keyup.enter.native="searchQuery">
<a-row :gutter="10">
<a-col :md="8" :sm="12">
<a-form-item label="名称">

View File

@ -3,7 +3,7 @@
<!-- 左侧面板 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="12">
<a-col :md="7" :sm="8">
<a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
@ -30,6 +30,8 @@
<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="hdd" @click="openDeleteList">回收站</a-button>
</div>
<a-table
@ -58,6 +60,7 @@
</div>
<dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 -->
<dict-item-list ref="dictItemList"></dict-item-list>
<dict-delete-list ref="dictDeleteList"></dict-delete-list>
</a-card>
</template>
@ -66,11 +69,12 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DictModal from './modules/DictModal'
import DictItemList from './DictItemList'
import DictDeleteList from './DictDeleteList'
export default {
name: "DictList",
mixins:[JeecgListMixin],
components: {DictModal, DictItemList},
components: {DictModal, DictItemList,DictDeleteList},
data() {
return {
description: '这是数据字典页面',
@ -161,6 +165,10 @@
that.queryParam.dictCode = "";
that.loadData(this.ipagination.current);
},
openDeleteList(){
this.$refs.dictDeleteList.show()
}
},
watch: {
openKeys(val) {

View File

@ -10,7 +10,7 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">

View File

@ -0,0 +1,198 @@
<template>
<a-card :bordered="false">
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button
@click="batchDel"
v-if="selectedRowKeys.length > 0"
ghost
type="primary"
icon="delete">批量删除
</a-button>
</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>已选择&nbsp;<a style="font-weight: 600">{{
selectedRowKeys.length }}</a>项&nbsp;&nbsp;
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
:columns="columns"
size="middle"
:pagination="false"
:dataSource="dataSource"
:loading="loading"
@expand="expandSubmenu"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
<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 href="javascript:;" @click="handleAddSub(record)">添加子菜单</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="handleDataRule(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>
<!-- 字符串超长截取省略号显示 -->
<span slot="url" slot-scope="text">
<j-ellipsis :value="text" :length="25"/>
</span>
<!-- 字符串超长截取省略号显示-->
<span slot="component" slot-scope="text">
<j-ellipsis :value="text"/>
</span>
</a-table>
</div>
<!-- table区域-end -->
<permission-modal ref="modalForm" @ok="modalFormOk"></permission-modal>
<permission-data-rule-list ref="PermissionDataRuleList" @ok="modalFormOk"></permission-data-rule-list>
</a-card>
</template>
<script>
import PermissionModal from './modules/PermissionModal'
import { getSystemMenuList,getSystemSubmenu } from '@/api/api'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PermissionDataRuleList from './PermissionDataRuleList'
import JEllipsis from '@/components/jeecg/JEllipsis'
const columns = [
{
title: '菜单名称',
dataIndex: 'name',
key: 'name'
}, {
title: '菜单类型',
dataIndex: 'menuType',
key: 'menuType',
customRender: function(text) {
if (text == 0) {
return '菜单'
} else if (text == 1) {
return '菜单'
} else if (text == 2) {
return '按钮/权限'
} else {
return text
}
}
},/*{
title: '权限编码',
dataIndex: 'perms',
key: 'permissionCode',
},*/{
title: 'icon',
dataIndex: 'icon',
key: 'icon'
},
{
title: '组件',
dataIndex: 'component',
key: 'component',
scopedSlots: { customRender: 'component' }
},
{
title: '路径',
dataIndex: 'url',
key: 'url',
scopedSlots: { customRender: 'url' }
},
{
title: '排序',
dataIndex: 'sortNo',
key: 'sortNo'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 150
}
]
export default {
name: 'PermissionList',
mixins: [JeecgListMixin],
components: {
PermissionDataRuleList,
PermissionModal,
JEllipsis
},
data() {
return {
description: '这是菜单管理页面',
// 表头
columns: columns,
loading: false,
url: {
list: '/sys/permission/list',
delete: '/sys/permission/delete',
deleteBatch: '/sys/permission/deleteBatch'
}
}
},
methods: {
loadData() {
this.dataSource = []
getSystemMenuList().then((res) => {
if (res.success) {
console.log(res.result)
this.dataSource = res.result
}
})
},
expandSubmenu(expanded, record){
if(expanded){
getSystemSubmenu({parentId:record.id}).then((res) => {
if (res.success) {
record.children = res.result
}
})
}
},
// 打开数据规则编辑
handleDataRule(record) {
this.$refs.PermissionDataRuleList.edit(record)
},
handleAddSub(record) {
this.$refs.modalForm.title = "添加子菜单";
this.$refs.modalForm.localMenuType = 1;
this.$refs.modalForm.disableSubmit = false;
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id});
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@ -14,7 +14,7 @@
background: '#fff',
}">
<div class="table-page-search-wrapper">
<a-form>
<a-form @keyup.enter.native="searchQuery">
<a-row :gutter="12">
<a-col :md="8" :sm="8">
<a-form-item label="规则名称" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
@ -118,6 +118,10 @@
},
methods: {
loadData() {
//20190908 scott for: 首次进入菜单列表的时候,不加载权限列表
if(!this.permId){
return
}
let that = this
this.dataSource = []
var params = this.getQueryParams()//查询条件

View File

@ -3,7 +3,7 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="10">

View File

@ -4,7 +4,7 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">

View File

@ -5,7 +5,7 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="12" :sm="12">
<a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">

View File

@ -3,7 +3,7 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :span="6">
@ -89,6 +89,9 @@
<a>撤销</a>
</a-popconfirm>
</a-menu-item>
<a-menu-item>
<a @click="handleDetail(record)">查看</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>

View File

@ -0,0 +1,178 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item label="职务编码">
<a-input placeholder="请输入职务编码" v-model="queryParam.code"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="职务名称">
<a-input placeholder="请输入职务名称" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<a-form-item label="职级">
<j-dict-select-tag v-model="queryParam.rank" placeholder="请选择职级" dictCode="position_rank"/>
</a-form-item>
</a-col>
</template>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('职务表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<sysPosition-modal ref="modalForm" @ok="modalFormOk"></sysPosition-modal>
</a-card>
</template>
<script>
import SysPositionModal from './modules/SysPositionModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
export default {
name: 'SysPositionList',
mixins: [JeecgListMixin],
components: {
SysPositionModal,
JDictSelectTag
},
data() {
return {
description: '职务表管理页面',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: '职务编码',
align: 'center',
dataIndex: 'code'
},
{
title: '职务名称',
align: 'center',
dataIndex: 'name'
},
{
title: '职级',
align: 'center',
dataIndex: 'rank_dictText'
},
// {
// title: '公司id',
// align: 'center',
// dataIndex: 'companyId'
// },
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' },
}
],
url: {
list: '/sys/position/list',
delete: '/sys/position/delete',
deleteBatch: '/sys/position/deleteBatch',
exportXlsUrl: '/sys/position/exportXls',
importExcelUrl: '/sys/position/importExcel',
},
}
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>

View File

@ -2,7 +2,7 @@
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :span="6">
@ -132,11 +132,7 @@
loading:false,
}
},
created() {
this.loadData();
},
methods: {
handleDetail: function(record){
this.$refs.sysAnnouncementModal.detail(record);
this.$refs.sysAnnouncementModal.title="查看";

View File

@ -3,12 +3,13 @@
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @submit.prevent="searchQuery">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item label="账号">
<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>
<!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
<j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>
</a-form-item>
</a-col>
@ -117,9 +118,8 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
<a-divider type="vertical" v-has="'user:edit'"/>
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
@ -180,6 +180,7 @@
import {frozenBatch} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import SysUserAgentModal from "./modules/SysUserAgentModal";
import JInput from '@/components/jeecg/JInput'
export default {
name: "UserList",
@ -187,7 +188,8 @@
components: {
SysUserAgentModal,
UserModal,
PasswordModal
PasswordModal,
JInput
},
data() {
return {

View File

@ -0,0 +1,98 @@
<template>
<a-card :loading="cardLoading" :bordered="false" style="height: 100%;">
<a-spin :spinning="loading">
<a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="输入组织机构名称进行查询..."/>
<a-tree
showLine
checkStrictly
:expandedKeys.sync="expandedKeys"
:selectedKeys="selectedKeys"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="treeDataSource"
@select="handleTreeSelect"
/>
</a-spin>
</a-card>
</template>
<script>
import { queryDepartTreeList, searchByKeywords } from '@/api/api'
export default {
name: 'AddressListLeft',
props: ['value'],
data() {
return {
cardLoading: true,
loading: false,
treeDataSource: [],
selectedKeys: [],
expandedKeys: []
}
},
created() {
this.queryTreeData()
},
methods: {
queryTreeData(keyword) {
this.commonRequestThen(queryDepartTreeList({
departName: keyword ? keyword : undefined
}))
},
handleSearch(value) {
if (value) {
this.commonRequestThen(searchByKeywords({ keyWord: value }))
} else {
this.queryTreeData()
}
},
handleTreeSelect(selectedKeys, event) {
if (selectedKeys.length > 0 && this.selectedKeys[0] !== selectedKeys[0]) {
this.selectedKeys = [selectedKeys[0]]
let orgCode = event.node.dataRef.orgCode
this.emitInput(orgCode)
}
},
emitInput(orgCode) {
this.$emit('input', orgCode)
},
commonRequestThen(promise) {
this.loading = true
promise.then(res => {
if (res.success) {
this.treeDataSource = res.result
// 默认选中第一条数据、默认展开所有第一级
if (res.result.length > 0) {
this.expandedKeys = []
res.result.forEach((item, index) => {
if (index === 0) {
this.selectedKeys = [item.id]
this.emitInput(item.orgCode)
}
this.expandedKeys.push(item.id)
})
}
} else {
this.$message.warn('组织机构查询失败' + res.message)
console.error('组织机构查询失败:', res)
}
}).finally(() => {
this.loading = false
this.cardLoading = false
})
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,198 @@
<template>
<a-card class="j-address-list-right-card-box" :loading="cardLoading" :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="10">
<a-col :md="6" :sm="12">
<a-form-item label="姓名" style="margin-left:8px">
<a-input placeholder="请输入姓名查询" v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item label="工号" style="margin-left:8px">
<a-input placeholder="请输入工号查询" v-model="queryParam.workNo"></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>
<a-table
ref="table"
size="middle"
bordered
rowKey="userId"
:pagination="ipagination"
:columns="columns"
:dataSource="dataSource"
:loading="loading"
@change="handleTableChange">
</a-table>
</a-card>
</template>
<script>
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'AddressListRight',
mixins: [JeecgListMixin],
components: {},
props: ['value'],
data() {
return {
description: '用户信息',
cardLoading: true,
positionInfo: {},
columns: [
{
title: '#',
key: 'rowIndex',
dataIndex: '',
width: 60,
align: 'center',
customRender: (t, r, i) => parseInt(i) + 1
},
{
title: '部门',
width: '20%',
align: 'center',
dataIndex: 'departName'
},
{
title: '姓名',
width: '15%',
align: 'center',
dataIndex: 'realname'
},
{
title: '工号',
width: '15%',
align: 'center',
dataIndex: 'workNo'
},
{
title: '职务',
width: '15%',
align: 'center',
dataIndex: 'post',
customRender: (text) => (text || '').split(',').map(t => this.positionInfo[t] ? this.positionInfo[t] : t).join(',')
},
{
title: '座机',
width: '15%',
align: 'center',
dataIndex: 'telephone'
},
// {
// title: '手机号',
// width: '12%',
// align: 'center',
// dataIndex: 'phone'
// },
{
title: '公司邮箱',
width: '15%',
align: 'center',
dataIndex: 'email'
}
],
url: {
list: '/sys/user/queryByOrgCodeForAddressList',
listByPosition: '/sys/position/list'
}
}
},
watch: {
value: {
immediate: true,
handler(orgCode) {
this.dataSource = []
this.loadData(1, orgCode)
}
},
},
created() {
this.queryPositionInfo()
},
methods: {
loadData(pageNum, orgCode) {
if (!orgCode) {
return
}
//加载数据 若传入参数1则加载第一页的内容
if (pageNum === 1) {
this.ipagination.current = 1
}
this.loading = true
getAction(this.url.list, {
orgCode,
...this.getQueryParams()
}).then((res) => {
if (res.success) {
this.dataSource = res.result.records
this.ipagination.total = res.result.total
}
}).finally(() => {
this.loading = false
this.cardLoading = false
})
},
searchQuery() {
this.loadData(1, this.value)
},
searchReset() {
this.queryParam = {}
this.loadData(1, this.value)
},
handleTableChange(pagination, filters, sorter) {
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field
this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
}
this.ipagination = pagination
this.loadData(null, this.value)
},
// 查询职务信息
queryPositionInfo() {
getAction(this.url.listByPosition, { pageSize: 99999 }).then(res => {
if (res.success) {
let positionInfo = {}
res.result.records.forEach(record => {
positionInfo[record['code']] = record['name']
})
this.positionInfo = positionInfo
}
})
}
}
}
</script>
<style>
.j-address-list-right-card-box .ant-table-placeholder {
min-height: 46px;
}
</style>
<style scoped>
.j-address-list-right-card-box {
height: 100%;
min-height: 300px;
}
</style>

View File

@ -30,6 +30,28 @@
:disabled="condition">
</a-tree-select>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构类型">
<template v-if="seen">
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="1">
公司
</a-radio>
</a-radio-group>
</template>
<template v-else>
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="2">
部门
</a-radio>
<a-radio value="3">
岗位
</a-radio>
</a-radio-group>
</template>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
@ -107,6 +129,7 @@
url: {
add: "/sys/sysDepart/add",
},
dictDisabled:true,
}
},
created () {
@ -128,8 +151,10 @@
add (depart) {
if(depart){
this.seen = false;
this.dictDisabled = false;
}else{
this.seen = true;
this.dictDisabled = true;
}
this.edit(depart);
},
@ -139,8 +164,13 @@
this.visible = true;
this.loadTreeData();
this.model.parentId = record!=null?record.toString():null;
if(this.seen){
this.model.orgCategory = '1';
}else{
this.model.orgCategory = '2';
}
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'departName','departNameEn','departNameAbbr','departOrder','description','orgType','orgCode','mobile','fax','address','memo','status','delFlag'))
this.form.setFieldsValue(pick(this.model,'orgCategory','departName','departNameEn','departNameAbbr','departOrder','description','orgType','orgCode','mobile','fax','address','memo','status','delFlag'))
});
},
close () {

View File

@ -23,6 +23,22 @@
label="机构编码">
<a-input style="border:0px;" placeholder="" v-decorator="['orgCode', {}]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="机构类型">
<a-radio-group :disabled="true" v-decorator="['orgCategory',{}]" placeholder="请选择机构类型">
<a-radio value="1">
公司
</a-radio>
<a-radio value="2">
部门
</a-radio>
<a-radio value="3">
岗位
</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
@ -98,7 +114,7 @@
console.log("record:");
console.log(record);
this.$nextTick(() => {
this.form.setFieldsValue(pick(record, 'departName', 'parentId', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'));
this.form.setFieldsValue(pick(record, 'orgCategory','departName', 'parentId', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'));
});
},
clearForm() {

View File

@ -148,6 +148,16 @@
<a-switch checkedChildren="" unCheckedChildren="" v-model="alwaysShow"/>
</a-form-item>
<!--update_begin author:wuxianquan date:20190908 for:增加组件外链打开方式可选 -->
<a-form-item
v-show="show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="打开方式">
<a-switch checkedChildren="外部" unCheckedChildren="内部" v-model="internalOrExternal"/>
</a-form-item>
<!--update_end author:wuxianquan date:20190908 for:增加组件外链打开方式可选 -->
</a-form>
@ -186,6 +196,9 @@
alwaysShow:false,//表单元素-聚合路由
menuHidden:false,//表单元素-隐藏路由
routeSwitch:true, //是否路由菜单
/*update_begin author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
internalOrExternal:false,//菜单打开方式
/*update_end author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
isKeepalive:true, //是否缓存路由
show:true,//根据菜单类型,动态显示隐藏表单元素
menuLabel:'菜单名称',
@ -213,7 +226,7 @@
component:{rules: [{ required: this.show, message: '请输入前端组件!' }]},
url:{rules: [{ required: this.show, message: '请输入菜单路径!' }]},
permsType:{rules: [{ required: true, message: '请输入授权策略!' }]},
sortNo:{initialValue:1.0,rules: [{validator: this.validateNumber}]},
sortNo:{initialValue:1.0},
}
}
},
@ -254,13 +267,20 @@
if(record.route!=null){
this.routeSwitch = record.route?true:false;
}
if(record.keepAlive!=null){
this.isKeepalive = record.keepAlive?true:false;
}else{
this.isKeepalive = false; // 升级兼容 如果没有后台没有传过来、或者是新建默认为false
}
/*update_begin author:wuxianquan date:20190908 for:编辑初始化数据*/
if(record.internalOrExternal!=null){
this.internalOrExternal = record.internalOrExternal?true:false;
}else{
this.internalOrExternal = false;
}
/*update_end author:wuxianquan date:20190908 for:编辑初始化数据*/
//console.log('record.menuType', record.menuType);
@ -295,6 +315,10 @@
this.model.hidden = this.menuHidden;
this.model.route = this.routeSwitch;
this.model.keepAlive = this.isKeepalive;
/*update_begin author:wuxianquan date:20190908 for:获取值*/
this.model.internalOrExternal = this.internalOrExternal;
/*update_end author:wuxianquan date:20190908 for:获取值*/
let formData = Object.assign(this.model, values);
if ((formData.menuType == 1 || formData.menuType == 2) && !formData.parentId) {
that.validateStatus = 'error';

View File

@ -28,7 +28,8 @@
<!-- <a-icon type="share-alt" />-->
<!-- 在线cron表达式生成-->
<!-- </a>-->
<j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入cron表达式!' }]}]" @change="setCorn"></j-cron>
<!-- <j-cron ref="innerVueCron" v-decorator="['cronExpression', {'initialValue':'0/1 * * * * ?',rules: [{ required: true, message: '请输入cron表达式!' }]}]" @change="setCorn"></j-cron>-->
<j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron>
</a-form-item>
<a-form-item
:labelCol="labelCol"
@ -61,9 +62,9 @@
<script>
import { httpAction } from '@/api/manage'
import JCron from "@/components/jeecg/JCron.vue";
import JCron from "@/components/jeecg/JCron";
import pick from 'lodash.pick'
import moment from "moment"
// import moment from "moment"
export default {
name: "QuartzJobModal",
@ -109,6 +110,8 @@
this.edit({});
},
edit (record) {
let that = this;
that.form.resetFields();
this.model = Object.assign({},record);
console.log(this.model)
this.visible = true;
@ -127,10 +130,10 @@
this.form.validateFields((err, values) => {
console.log('values',values)
if (!err) {
// if (typeof values.cronExpression == "undefined" || Object.keys(values.cronExpression).length==0 ) {
// this.$message.warning('请输入cron表达式!');
// return false;
// }
if (typeof values.cronExpression == "undefined" || Object.keys(values.cronExpression).length==0 ) {
this.$message.warning('请输入cron表达式!');
return false;
}
that.confirmLoading = true;
let httpurl = '';
@ -171,9 +174,9 @@
})
// console.log(Object.keys(data).length==0);
// if (Object.keys(data).length==0) {
// this.$message.warning('请输入cron表达式!');
// }
if (Object.keys(data).length==0) {
this.$message.warning('请输入cron表达式!');
}
},
validateCron(rule, value, callback){
if(!value){

View File

@ -66,17 +66,17 @@
</a-row>
</a-form>
</div>
<!-- update-begin author:kangxiaolin date:20190921 for:系统发送通知 用户多选失败 #513 -->
<a-table
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect}"
@change="handleTableChange"
>
<!-- update-end author:kangxiaolin date:20190921 for:系统发送通知 用户多选失败 #513 -->
</a-table>
</a-modal>
</template>
@ -178,7 +178,13 @@
if(!selectUser){
this.selectionRows=[]
}else{
this.selectionRows = selectUser;
var that=this;
that.selectionRows=[];
selectUser.forEach(function(record,index){
console.log(record)
that.selectionRows.push({id: that.selectedRowKeys[index],realname:record})
})
// this.selectionRows = selectUser;
}
},
loadData (arg){
@ -211,11 +217,23 @@
}
return str;
},
onSelectChange (selectedRowKeys,selectionRows) {
//--update-begin----author:kangxiaolin---date:20190921------for:系统发送通知 用户多选失败 #513----
onSelectChange (selectedRowKeys) {
this.selectedRowKeys = selectedRowKeys;
console.log(this.selectedRowKeys);
this.selectionRows = selectionRows;
},
onSelect(record, selected){
if(selected == true ){
this.selectionRows.push(record);
}else {
this.selectionRows.forEach(function(item,index,arr){
if(item.id == record.id) {
arr.splice(index, 1);
}
})
}
//--update-end----author:kangxiaolin---date:20190921------for:系统发送通知 用户多选失败 #513----
},
searchReset(){
let that = this;
Object.keys(that.queryParam).forEach(function(key){

View File

@ -17,7 +17,8 @@
placeholder="请选择父级节点"
v-decorator="['pid', validatorRules.pid]"
dict="sys_category,name,id"
pidField="pid">
pidField="pid"
pidValue="0">
</j-tree-select>
</a-form-item>
@ -25,9 +26,16 @@
<a-input v-decorator="[ 'name', validatorRules.name]" placeholder="请输入类型名称"></a-input>
</a-form-item>
<a-form-item label="类型编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!--<a-form-item label="类型编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="[ 'code', validatorRules.code]" placeholder="请输入类型编码"></a-input>
</a-form-item>
</a-form-item>-->
<!--<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
<span style="font-size: 12px;color:red" slot="label">编码规则()</span>
<span style="font-size: 12px;color:red">
编码值前缀需和父节点保持一致,比如父级节点编码是A01则当前编码必须以A01开头
</span>
</a-form-item>-->
</a-form>
@ -37,7 +45,7 @@
<script>
import { httpAction } from '@/api/manage'
import { httpAction,getAction } from '@/api/manage'
import pick from 'lodash.pick'
import JTreeSelect from '@/components/jeecg/JTreeSelect'
@ -64,13 +72,20 @@
confirmLoading: false,
validatorRules:{
pid:{},
name:{},
code:{},
code:{
rules: [{
required: true, message: '请输入类型编码!'
},{
validator: this.validateMyCode
}]
},
pid:{},
name:{}
},
url: {
add: "/sys/category/add",
edit: "/sys/category/edit",
checkCode:"/sys/category/checkCode"
},
expandedRowKeys:[],
pidField:"pid"
@ -154,7 +169,20 @@
}
}
}
}
},
validateMyCode(rule, value, callback){
let params = {
pid: this.form.getFieldValue('pid'),
code: value
}
getAction(this.url.checkCode,params).then((res) => {
if (res.success) {
callback()
} else {
callback(res.message)
}
})
},
}

View File

@ -0,0 +1,180 @@
<template>
<a-modal
:title="title"
:width="800"
:visible="visible"
:maskClosable="false"
: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="['code', validatorRules.code]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="职务名称">
<a-input placeholder="请输入职务名称" v-decorator="['name', validatorRules.name]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="职级"
>
<j-dict-select-tag
placeholder="请选择职级"
:triggerChange="true"
dictCode="position_rank"
v-decorator="['rank', validatorRules.rank]"
/>
</a-form-item>
<!--<a-form-item-->
<!-- :labelCol="labelCol"-->
<!-- :wrapperCol="wrapperCol"-->
<!-- label="公司id">-->
<!-- <a-input placeholder="请输入公司id" v-decorator="['companyId', {}]"/>-->
<!--</a-form-item>-->
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { httpAction } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
let validatorCodeTimer = null
export default {
name: 'SysPositionModal',
components: { JDictSelectTag },
data() {
return {
title: '操作',
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
form: this.$form.createForm(this),
validatorRules: {
code: {
rules: [
{ required: true, message: '请输入职务编码' },
{
validator: (rule, value, callback) => {
// 函数消抖的简单实现,防止一段时间内发送多次请求
if (validatorCodeTimer) {
// 停止上次开启的定时器
clearTimeout(validatorCodeTimer)
}
validatorCodeTimer = setTimeout(() => {
duplicateCheck({
tableName: 'sys_position',
fieldName: 'code',
fieldVal: value,
dataId: this.model.id
}).then((res) => {
if (res.success) {
callback()
} else {
callback(res.message)
}
}).catch(console.error)
}, 300)
}
}
]
},
name: { rules: [{ required: true, message: '请输入职务名称' }] },
rank: { rules: [{ required: true, message: '请选择职级' }] },
},
url: {
add: '/sys/position/add',
edit: '/sys/position/edit',
},
}
},
created() {
},
methods: {
add() {
this.edit({})
},
edit(record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,
'code',
'name',
'rank',
// 'companyId'
))
})
},
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)
httpAction(httpurl, formData, method).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
that.close()
})
}
})
},
handleCancel() {
this.close()
},
}
}
</script>
<style lang="less" scoped>
</style>

View File

@ -40,6 +40,14 @@
<a-input placeholder="请输入用户名称" v-decorator="[ 'realname', validatorRules.realname]" />
</a-form-item>
<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入工号" v-decorator="[ 'workNo', validatorRules.workNo]" />
</a-form-item>
<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]"/>
</a-form-item>
<a-form-item label="角色分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled" >
<a-select
mode="multiple"
@ -104,6 +112,10 @@
<a-input placeholder="请输入手机号码" :disabled="isDisabledAuth('user:form:phone')" v-decorator="[ 'phone', validatorRules.phone]" />
</a-form-item>
<a-form-item label="座机" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入座机" v-decorator="[ 'telephone', validatorRules.telephone]"/>
</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>
@ -127,6 +139,7 @@
import Vue from 'vue'
// 引入搜索部门弹出框的组件
import departWindow from './DepartWindow'
import JSelectPosition from '@/components/jeecgbiz/JSelectPosition'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getAction } from '@/api/manage'
import {addUser,editUser,queryUserRole,queryall } from '@/api/api'
@ -134,9 +147,10 @@
import {duplicateCheck } from '@/api/api'
export default {
name: "RoleModal",
name: "UserModal",
components: {
departWindow,
JSelectPosition
},
data () {
return {
@ -185,8 +199,19 @@
validator: this.validateEmail
}],
},
roles:{}
roles:{},
// sex:{initialValue:((!this.model.sex)?"": (this.model.sex+""))}
workNo: {
rules: [
{ required: true, message: '请输入工号' },
{ validator: this.validateWorkNo }
]
},
telephone: {
rules: [
{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },
]
}
},
title:"操作",
visible: false,
@ -282,7 +307,7 @@
that.visible = true;
that.model = Object.assign({}, record);
that.$nextTick(() => {
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync'))
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync','workNo','telephone','post'))
});
// 调用查询用户对应的部门信息的方法
that.checkedDepartKeys = [];
@ -389,7 +414,10 @@
if(!value){
callback()
}else{
if(new RegExp(/^1[3|4|5|7|8][0-9]\d{8}$/).test(value)){
//update-begin--Author:kangxiaolin Date:20190826 for[05] 手机号不支持199号码段--------------------
if(new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)){
//update-end--Author:kangxiaolin Date:20190826 for[05] 手机号不支持199号码段--------------------
var params = {
tableName: 'sys_user',
fieldName: 'phone',
@ -447,6 +475,21 @@
}
})
},
validateWorkNo(rule, value, callback){
var params = {
tableName: 'sys_user',
fieldName: 'work_no',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("工号已存在!")
}
})
},
handleConfirmBlur (e) {
const value = e.target.value;
this.confirmDirty = this.confirmDirty || !!value

View File

@ -18,6 +18,7 @@
:treeData="treeData"
@expand="onExpand"
@select="onTreeNodeSelect"
:selectedKeys="selectedKeys"
:expandedKeys="expandedKeysss"
:checkStrictly="checkStrictly">
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
@ -30,8 +31,10 @@
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<!-- 简化Tree逻辑使用默认checkStrictly为false的行为即默认父子关联
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
-->
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
@ -67,25 +70,28 @@
treeData: [],
defaultCheckedKeys:[],
checkedKeys:[],
halfCheckedKeys:[],
expandedKeysss:[],
allTreeKeys:[],
autoExpandParent: true,
checkStrictly: true,
checkStrictly: false,
title:"角色权限配置",
visible: false,
loading: false,
selectedKeys:[]
}
},
methods: {
onTreeNodeSelect(id){
this.$refs.datarule.show(id[0],this.roleId)
},
onCheck (o) {
if(this.checkStrictly){
this.checkedKeys = o.checked;
}else{
this.checkedKeys = o
if(id && id.length>0){
this.selectedKeys = id
}
this.$refs.datarule.show(this.selectedKeys[0],this.roleId)
},
onCheck (checkedKeys, { halfCheckedKeys }) {
// 保存选中的和半选中的,后面保存的时候合并提交
this.checkedKeys = checkedKeys
this.halfCheckedKeys = halfCheckedKeys
},
show(roleId){
this.roleId=roleId
@ -116,24 +122,18 @@
this.checkedKeys = this.allTreeKeys
},
cancelCheckALL () {
//this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = []
},
switchCheckStrictly (v) {
if(v==1){
this.checkStrictly = false
}else if(v==2){
this.checkStrictly = true
}
},
handleCancel () {
this.close()
},
handleSubmit(){
let that = this;
let checkedKeys = [...that.checkedKeys, ...that.halfCheckedKeys]
const permissionIds = checkedKeys.join(",")
let params = {
roleId:that.roleId,
permissionIds:that.checkedKeys.join(","),
permissionIds,
lastpermissionIds:that.defaultCheckedKeys.join(","),
};
that.loading = true;
@ -150,6 +150,15 @@
}
})
},
convertTreeListToKeyLeafPairs(treeList, keyLeafPair = []) {
for(const {key, isLeaf, children} of treeList) {
keyLeafPair.push({key, isLeaf})
if(children && children.length > 0) {
this.convertTreeListToKeyLeafPairs(children, keyLeafPair)
}
}
return keyLeafPair;
},
},
watch: {
visible () {
@ -157,11 +166,23 @@
queryTreeListForRole().then((res) => {
this.treeData = res.result.treeList
this.allTreeKeys = res.result.ids
const keyLeafPairs = this.convertTreeListToKeyLeafPairs(this.treeData)
queryRolePermission({roleId:this.roleId}).then((res)=>{
this.checkedKeys = [...res.result];
this.defaultCheckedKeys = [...res.result];
this.expandedKeysss = this.allTreeKeys;
//console.log(this.defaultCheckedKeys)
// 过滤出 leaf node 即可,即选中的
// Tree组件中checkStrictly默认为false的时候选中子节点父节点会自动设置选中或半选中
// 保存 checkedKeys 以及 halfCheckedKeys 以便于未做任何操作时提交表单数据
const checkedKeys = [...res.result].filter(key => {
const keyLeafPair = keyLeafPairs.filter(item => item.key === key)[0]
return keyLeafPair && keyLeafPair.isLeaf
})
const halfCheckedKeys = [...res.result].filter(key => {
const keyLeafPair = keyLeafPairs.filter(item => item.key === key)[0]
return keyLeafPair && !keyLeafPair.isLeaf
})
this.checkedKeys = [...checkedKeys];
this.halfCheckedKeys = [...halfCheckedKeys]
this.defaultCheckedKeys = [...halfCheckedKeys, ...checkedKeys];
this.expandedKeysss = this.allTreeKeys;
})
})
}