mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-03 20:35:29 +08:00
Jeecg Boot 2.2.1 版本发布,低代码平台
This commit is contained in:
@ -83,6 +83,7 @@
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item><a @click="executeImmediately(record)">立即执行</a></a-menu-item>
|
||||
<a-menu-item><a @click="handleEdit(record)">编辑</a></a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
@ -192,6 +193,7 @@
|
||||
resume: "/sys/quartzJob/resume",
|
||||
exportXlsUrl: "sys/quartzJob/exportXls",
|
||||
importExcelUrl: "sys/quartzJob/importExcel",
|
||||
execute: "sys/quartzJob/execute"
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -255,6 +257,25 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
executeImmediately(record){
|
||||
var that = this;
|
||||
//立即执行定时任务
|
||||
this.$confirm({
|
||||
title:"确认提示",
|
||||
content:"是否立即执行任务?",
|
||||
onOk: function(){
|
||||
getAction(that.url.execute,{id:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -63,7 +63,6 @@
|
||||
<a @click="handleOpen(record)">用户</a>
|
||||
<a-divider type="vertical"/>
|
||||
|
||||
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
更多 <a-icon type="down"/>
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
<!-- 操作按钮区域 -->
|
||||
<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-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>
|
||||
|
||||
101
ant-design-vue-jeecg/src/views/system/SysGatewayRouteList.vue
Normal file
101
ant-design-vue-jeecg/src/views/system/SysGatewayRouteList.vue
Normal file
@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<a-card :bordered="false" style="height: 100%">
|
||||
<div style="padding-bottom: 2px">
|
||||
<a-alert type="warning" show-icon>
|
||||
<div slot="message" style="width: 100%">
|
||||
<span>路由配置请慎重</span>
|
||||
<span style="display:inline-block;float:right;padding-right: 5px">
|
||||
<a @click="clearRedis"><a-icon type="reload" />清除缓存</a>
|
||||
</span>
|
||||
</div>
|
||||
</a-alert>
|
||||
</div>
|
||||
<div :id="eleId" :style="{ height: editorHeight + 'px', width: '100%' }"></div>
|
||||
<div style="text-align: center;padding-top:10px">
|
||||
<a-button type="primary" @click="submitForm" style="width:160px">保存</a-button>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JsonEditor from 'jsoneditor'
|
||||
import 'jsoneditor/dist/jsoneditor.min.css'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: "SysGatewayRouteList",
|
||||
data () {
|
||||
return {
|
||||
eleId:'jsoneditor',
|
||||
description: 'gateway路由管理管理页面',
|
||||
editor: null,
|
||||
editorWidth:400,
|
||||
editorHeight:500,
|
||||
url:{
|
||||
list: '/sys/gatewayRoute/list',
|
||||
update: '/sys/gatewayRoute/updateAll',
|
||||
clear: '/sys/gatewayRoute/clearRedis'
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let winWidth = window.innerWidth;
|
||||
console.log("页面宽度",winWidth)
|
||||
this.editorWidth = winWidth
|
||||
|
||||
},
|
||||
mounted(){
|
||||
this.initJsonEditor();
|
||||
},
|
||||
methods: {
|
||||
initJsonEditor() {
|
||||
let container = document.getElementById(this.eleId);
|
||||
let options = {
|
||||
modes: ['text', 'code', 'tree', 'form', 'view'],
|
||||
mode: 'tree',
|
||||
ace: ace,
|
||||
sortObjectKeys: 'code',
|
||||
mainMenuBar:['format']
|
||||
};
|
||||
this.editor = new JsonEditor(container, options);
|
||||
this.initRouteData();
|
||||
},
|
||||
initRouteData(){
|
||||
getAction(this.url.list).then(res=>{
|
||||
if(res.success){
|
||||
let array = res.result
|
||||
console.log('当前路由配置信息为', array)
|
||||
this.editor.set(array)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取json
|
||||
submitForm() {
|
||||
let text = this.editor.getText()
|
||||
console.log("保存的json数据",text)
|
||||
if(!text || text.length<=0 || text=='{}' || text=='[]'){
|
||||
this.$message.warning('未录入任何信息')
|
||||
return ;
|
||||
}
|
||||
postAction(this.url.update,{
|
||||
routes:text
|
||||
}).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
}else{
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
clearRedis(){
|
||||
getAction(this.url.clear).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
165
ant-design-vue-jeecg/src/views/system/TenantList.vue
Normal file
165
ant-design-vue-jeecg/src/views/system/TenantList.vue
Normal file
@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 查询区域-END -->
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<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>
|
||||
<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"
|
||||
:scroll="{x:true}"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
class="j-table-force-nowrap"
|
||||
@change="handleTableChange">
|
||||
|
||||
<template slot="htmlSlot" slot-scope="text">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<template slot="imgSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
|
||||
</template>
|
||||
<template slot="fileSlot" slot-scope="text">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button
|
||||
v-else
|
||||
:ghost="true"
|
||||
type="primary"
|
||||
icon="download"
|
||||
size="small"
|
||||
@click="uploadFile(text)">
|
||||
下载
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<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 @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>
|
||||
|
||||
<tenant-modal ref="modalForm" @ok="modalFormOk"></tenant-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import '@/assets/less/TableExpand.less'
|
||||
import { mixinDevice } from '@/utils/mixin'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import TenantModal from './modules/TenantModal'
|
||||
|
||||
|
||||
export default {
|
||||
name: "TenantList",
|
||||
mixins:[JeecgListMixin, mixinDevice],
|
||||
components: {
|
||||
TenantModal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
description: 'adad管理页面',
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title:'租户名称',
|
||||
align:"center",
|
||||
dataIndex: 'name'
|
||||
},{
|
||||
title:'租户编号',
|
||||
align:"center",
|
||||
dataIndex: 'id'
|
||||
},
|
||||
{
|
||||
title:'开始时间',
|
||||
align:"center",
|
||||
dataIndex: 'beginDate'
|
||||
},
|
||||
{
|
||||
title:'结束时间',
|
||||
align:"center",
|
||||
dataIndex: 'endDate'
|
||||
},
|
||||
{
|
||||
title:'状态',
|
||||
align:"center",
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
fixed:"right",
|
||||
width:147,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/sys/tenant/list",
|
||||
delete: "/sys/tenant/delete",
|
||||
deleteBatch: "/sys/tenant/deleteBatch"
|
||||
},
|
||||
dictOptions:{},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function(){
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initDictConfig(){
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
@ -119,10 +119,9 @@
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<!-- <a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>-->
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a @click="handleEdit(record)" >编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
<a-divider type="vertical" />
|
||||
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
@ -260,13 +259,7 @@
|
||||
title: '部门',
|
||||
align: "center",
|
||||
width: 180,
|
||||
dataIndex: 'orgCode'
|
||||
},
|
||||
{
|
||||
title: '负责部门',
|
||||
align: "center",
|
||||
width: 180,
|
||||
dataIndex: 'departIds_dictText'
|
||||
dataIndex: 'orgCodeTxt'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
|
||||
@ -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