mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-04 04:45:28 +08:00
Jeecg Boot 2.2.1 版本发布,低代码平台
This commit is contained in:
@ -1,26 +1,28 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<template v-if="this.departId">
|
||||
<a-form>
|
||||
<a-form-item label='所拥有的权限'>
|
||||
<a-tree
|
||||
checkable
|
||||
@check="onCheck"
|
||||
:checkedKeys="checkedKeys"
|
||||
:treeData="treeData"
|
||||
@expand="onExpand"
|
||||
@select="onTreeNodeSelect"
|
||||
:selectedKeys="selectedKeys"
|
||||
:expandedKeys="expandedKeysss"
|
||||
:checkStrictly="checkStrictly"
|
||||
style="height:500px;overflow: auto;">
|
||||
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
|
||||
{{ slotTitle }}
|
||||
<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
|
||||
</span>
|
||||
</a-tree>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<a-spin :spinning="loading">
|
||||
<a-form>
|
||||
<a-form-item label='所拥有的权限'>
|
||||
<a-tree
|
||||
checkable
|
||||
@check="onCheck"
|
||||
:checkedKeys="checkedKeys"
|
||||
:treeData="treeData"
|
||||
@expand="onExpand"
|
||||
@select="onTreeNodeSelect"
|
||||
:selectedKeys="selectedKeys"
|
||||
:expandedKeys="expandedKeysss"
|
||||
:checkStrictly="checkStrictly"
|
||||
style="height:500px;overflow: auto;">
|
||||
<span slot="hasDatarule" slot-scope="{slotTitle,ruleFlag}">
|
||||
{{ slotTitle }}
|
||||
<a-icon v-if="ruleFlag" type="align-left" style="margin-left:5px;color: red;"></a-icon>
|
||||
</span>
|
||||
</a-tree>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<div class="anty-form-btn">
|
||||
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
@ -156,6 +158,7 @@
|
||||
this.form.resetFields()
|
||||
},
|
||||
loadData(){
|
||||
this.loading = true;
|
||||
queryTreeListForRole().then((res) => {
|
||||
this.treeData = res.result.treeList
|
||||
this.allTreeKeys = res.result.ids
|
||||
@ -176,6 +179,7 @@
|
||||
this.halfCheckedKeys = [...halfCheckedKeys]
|
||||
this.defaultCheckedKeys = [...halfCheckedKeys, ...checkedKeys];
|
||||
this.expandedKeysss = this.allTreeKeys;
|
||||
this.loading = false;
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
:closable="true"
|
||||
@close="close"
|
||||
:visible="visible"
|
||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
||||
style="overflow: auto;padding-bottom: 53px;">
|
||||
|
||||
<a-form>
|
||||
<a-form-item label='所拥有的部门权限'>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
:closable="true"
|
||||
@close="close"
|
||||
:visible="visible"
|
||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
||||
style="overflow: auto;padding-bottom: 53px;">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
getAction(this.url.getDeptRoleByUserId,{userId:this.userId}).then((res) => {
|
||||
getAction(this.url.getDeptRoleByUserId,{userId:this.userId,departId:this.currentDeptId}).then((res) => {
|
||||
if (res.success) {
|
||||
var designName = [];
|
||||
for (let value of res.result) {
|
||||
|
||||
@ -183,7 +183,7 @@
|
||||
that.selectionRows=[];
|
||||
selectUser.forEach(function(record,index){
|
||||
console.log(record)
|
||||
that.selectionRows.push({id: that.selectedRowKeys[index],realname:record})
|
||||
that.selectionRows.push({id: that.selectedRowKeys[index],realname:record.label})
|
||||
})
|
||||
// this.selectionRows = selectUser;
|
||||
}
|
||||
|
||||
@ -108,8 +108,10 @@
|
||||
<a-select
|
||||
mode="multiple"
|
||||
placeholder="请选择用户"
|
||||
:labelInValue=true
|
||||
v-model="selectedUser"
|
||||
@dropdownVisibleChange="selectUserIds"
|
||||
@change="handleChange"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@ -166,7 +168,6 @@
|
||||
xs: { span: 24 },
|
||||
sm: { span: 21 },
|
||||
},
|
||||
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
@ -187,6 +188,7 @@
|
||||
selectedUser:[],
|
||||
disabled:false,
|
||||
msgContent:"",
|
||||
userList:[]
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@ -210,15 +212,22 @@
|
||||
this.userIds = record.userIds;
|
||||
getAction(this.url.queryByIds,{userIds:this.userIds}).then((res)=>{
|
||||
if(res.success){
|
||||
//update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||
var userList=[];
|
||||
for(var i=0;i<res.result.length;i++){
|
||||
this.selectedUser.push(res.result[i].realname);
|
||||
var user={};
|
||||
user.label =res.result[i].realname;
|
||||
user.key=res.result[i].id;
|
||||
userList.push(user);
|
||||
}
|
||||
this.selectedUser=userList;
|
||||
//update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||
this.$refs.UserListModal.edit(res.result,this.userIds);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','sender','priority','msgCategory','msgType','sendStatus','delFlag','msgAbstract'))
|
||||
this.form.setFieldsValue(pick(this.model,'endTime','startTime','titile','msgContent','priority','msgCategory','msgType','sendStatus','msgAbstract'))
|
||||
});
|
||||
},
|
||||
close () {
|
||||
@ -298,7 +307,12 @@
|
||||
this.selectedUser = [];
|
||||
this.userIds = [];
|
||||
for(var i=0;i<userList.length;i++){
|
||||
this.selectedUser.push(userList[i].realname);
|
||||
//update--begin--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||
var user={};
|
||||
user.label =userList[i].realname;
|
||||
user.key=userList[i].id;
|
||||
this.selectedUser.push(user);
|
||||
//update--end--autor:wangshuai-----date:20200601------for:系统公告选人后,不能删除------
|
||||
this.userIds += userList[i].id+","
|
||||
}
|
||||
},
|
||||
@ -321,8 +335,21 @@
|
||||
}else{
|
||||
callback("结束时间需大于开始时间")
|
||||
}
|
||||
},
|
||||
handleChange(userList) {
|
||||
if (userList) {
|
||||
this.userIds = [];
|
||||
var users=[];
|
||||
for (var i = 0; i < userList.length; i++) {
|
||||
var user={};
|
||||
user.id=userList[i].key;
|
||||
user.realname=userList[i].label;
|
||||
this.userIds += userList[i].key + ',';
|
||||
users.push(user);
|
||||
}
|
||||
}
|
||||
this.$refs.UserListModal.edit(users,this.userIds);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
import { validateCheckRule } from '@/utils/util'
|
||||
|
||||
export default {
|
||||
name: 'SysCheckRuleModal',
|
||||
name: 'SysCheckRuleTestModal',
|
||||
data() {
|
||||
return {
|
||||
title: '操作',
|
||||
|
||||
184
ant-design-vue-jeecg/src/views/system/modules/TenantForm.vue
Normal file
184
ant-design-vue-jeecg/src/views/system/modules/TenantForm.vue
Normal file
@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<j-form-container :disabled="formDisabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="租户名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="['name']" placeholder="请输入租户名称"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-item label="租户编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input-number style="width: 100%" :min="1" v-decorator="['id',{rules: [{ required: true, message: '请输入租户编号'}]}]" placeholder="请输入租户编号"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择开始时间" v-decorator="['beginDate']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择结束时间" v-decorator="['endDate']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-radio-group name="tenantStatus" v-decorator="[ 'status', {initialValue:1}]">
|
||||
<a-radio :value="1">正常</a-radio>
|
||||
<a-radio :value="0">冻结</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
|
||||
<a-button @click="submitForm">提 交</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</j-form-container>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { httpAction, getAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
|
||||
export default {
|
||||
name: "TenantForm",
|
||||
components: {
|
||||
JFormContainer,
|
||||
JDate,
|
||||
JDictSelectTag,
|
||||
},
|
||||
props: {
|
||||
formData: {
|
||||
type: Object,
|
||||
default: ()=>{},
|
||||
required: false
|
||||
},
|
||||
normal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
validatorRules: {
|
||||
},
|
||||
url: {
|
||||
add: "/sys/tenant/add",
|
||||
edit: "/sys/tenant/edit",
|
||||
queryById: "/sys/tenant/queryById"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
formDisabled(){
|
||||
if(this.normal===false){
|
||||
if(this.formData.disabled===false){
|
||||
return false
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
}
|
||||
return this.disabled
|
||||
},
|
||||
showFlowSubmitButton(){
|
||||
if(this.normal===false){
|
||||
if(this.formData.disabled===false){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.showFlowData();
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'id','name','beginDate','endDate','status'))
|
||||
})
|
||||
},
|
||||
showFlowData(){
|
||||
if(this.normal === false){
|
||||
let params = {id:this.formData.dataId};
|
||||
getAction(this.url.queryById,params).then((res)=>{
|
||||
if(res.success){
|
||||
this.edit (res.result);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
submitForm () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
let method = '';
|
||||
if(!this.model.id){
|
||||
httpurl+=this.url.add;
|
||||
method = 'post';
|
||||
}else{
|
||||
httpurl+=this.url.edit;
|
||||
method = 'put';
|
||||
}
|
||||
let formData = Object.assign(this.model, values);
|
||||
console.log("表单提交数据",formData)
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row, 'id', 'name','beginDate','endDate','status'))
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<tenant-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tenant-form>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import TenantForm from './TenantForm'
|
||||
export default {
|
||||
name: "TenantModal",
|
||||
components: {
|
||||
TenantForm
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:'',
|
||||
width:800,
|
||||
visible: false,
|
||||
disableSubmit: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.add();
|
||||
})
|
||||
},
|
||||
edit (record) {
|
||||
this.visible=true
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.realForm.edit(record);
|
||||
})
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
this.$refs.realForm.submitForm();
|
||||
},
|
||||
submitCallback(){
|
||||
this.$emit('ok');
|
||||
this.visible = false;
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -7,7 +7,7 @@
|
||||
:closable="true"
|
||||
@close="handleCancel"
|
||||
:visible="visible"
|
||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
|
||||
<template slot="title">
|
||||
<div style="width: 100%;">
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
<template v-if="!model.id">
|
||||
<a-form-item label="登陆密码" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
||||
<a-input type="password" placeholder="请输入登陆密码" v-decorator="[ 'password', validatorRules.password]" />
|
||||
<a-input type="password" placeholder="请输入登陆密码" v-decorator="[ 'password']" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
||||
@ -72,6 +72,22 @@
|
||||
<a-button slot="enterButton" icon="search">选择</a-button>
|
||||
</a-input-search>
|
||||
</a-form-item>
|
||||
|
||||
<!--租户分配-->
|
||||
<a-form-item label="租户分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
|
||||
|
||||
<a-select
|
||||
mode="multiple"
|
||||
style="width: 100%"
|
||||
placeholder="请选择租户分配"
|
||||
:disabled="disableSubmit"
|
||||
v-model="currentTenant">
|
||||
<a-select-option v-for="(item, index) in tenantList" :key="index" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<!-- update--begin--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ -->
|
||||
<a-form-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-radio-group
|
||||
@ -253,14 +269,18 @@
|
||||
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
|
||||
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url
|
||||
syncUserByUserName:"/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
|
||||
queryTenantList: '/sys/tenant/queryList'
|
||||
},
|
||||
identity:"1",
|
||||
fileList:[],
|
||||
tenantList: [],
|
||||
currentTenant:[]
|
||||
}
|
||||
},
|
||||
created () {
|
||||
const token = Vue.ls.get(ACCESS_TOKEN);
|
||||
this.headers = {"X-Access-Token":token}
|
||||
this.initTenantList()
|
||||
|
||||
},
|
||||
computed:{
|
||||
@ -272,6 +292,13 @@
|
||||
isDisabledAuth(code){
|
||||
return disabledAuthFilter(code);
|
||||
},
|
||||
initTenantList(){
|
||||
getAction(this.url.queryTenantList).then(res=>{
|
||||
if(res.success){
|
||||
this.tenantList = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
//窗口最大化切换
|
||||
toggleScreen(){
|
||||
if(this.modaltoggleFlag){
|
||||
@ -308,6 +335,7 @@
|
||||
this.resultDepartOptions=[];
|
||||
this.departId=[];
|
||||
this.departIdShow=false;
|
||||
this.currentTenant = []
|
||||
},
|
||||
add () {
|
||||
this.picUrl = "";
|
||||
@ -343,6 +371,14 @@
|
||||
// 调用查询用户对应的部门信息的方法
|
||||
that.checkedDepartKeys = [];
|
||||
that.loadCheckedDeparts();
|
||||
|
||||
//update-begin-author:taoyan date:2020710 for:多租户配置
|
||||
if(!record.relTenantIds || record.relTenantIds.length==0){
|
||||
this.currentTenant = []
|
||||
}else{
|
||||
this.currentTenant = record.relTenantIds.split(',').map(Number);
|
||||
}
|
||||
//update-end-author:taoyan date:2020710 for:多租户配置
|
||||
},
|
||||
//
|
||||
loadCheckedDeparts(){
|
||||
@ -412,6 +448,9 @@
|
||||
}else{
|
||||
formData.avatar = null;
|
||||
}
|
||||
//update-begin-author:taoyan date:2020710 for:多租户配置
|
||||
formData.relTenantIds = this.currentTenant.length>0?this.currentTenant.join(','):''
|
||||
//update-end-author:taoyan date:2020710 for:多租户配置
|
||||
formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
|
||||
formData.selecteddeparts = this.userDepartModel.departIdList.length>0?this.userDepartModel.departIdList.join(","):'';
|
||||
formData.userIdentity=this.identity;
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
:closable="true"
|
||||
@close="close"
|
||||
:visible="visible"
|
||||
style="height: calc(100% - 55px);overflow: auto;padding-bottom: 53px;">
|
||||
style="overflow: auto;padding-bottom: 53px;">
|
||||
|
||||
<a-form>
|
||||
<a-form-item label='所拥有的权限'>
|
||||
|
||||
Reference in New Issue
Block a user