|
@@ -38,23 +38,41 @@
|
|
|
<div class="appUserOperateitem">
|
|
|
<a-button @click="clearConditionAndData">重 置</a-button>
|
|
|
</div>
|
|
|
- <div class="appUserOperateitem" style="margin-left: 15%">
|
|
|
+ <div>
|
|
|
+ <!-- 作为编辑页面时显示 -->
|
|
|
+ <a-button type="primary"
|
|
|
+ :disabled="adduserCount===0"
|
|
|
+ @click="removeUserInfo('edit')"
|
|
|
+ v-if="!tag" v-show="!uncheckTag">移 除</a-button>
|
|
|
+ </div>
|
|
|
+ <!-- 作为编辑页面时显示 -->
|
|
|
+ <div class="appUserOperateitem" style="margin-left: 10%">
|
|
|
+ <span v-if="!tag" style="padding-right: 5%; white-space: nowrap"> <b>新增用户:{{(newlyUserData as any).length}}</b> </span>
|
|
|
<a-button type="primary" :disabled="uncheckTag" @click="handleOpen" v-if="!uncheckTag&&!tag">添加用户</a-button>
|
|
|
<AppUserSelectByDepModal ref="addNewUser" :rowKey="rowKey" v-if="!uncheckTag&&!tag"
|
|
|
:appid="appid" :appuserids="appUserids" @register="regModal"
|
|
|
@getSelectResult="setValue" v-bind="getBindValue"/>
|
|
|
- </div>
|
|
|
+ <a-popconfirm
|
|
|
+ title="你确定要移除全部信息吗?"
|
|
|
+ ok-text="是"
|
|
|
+ cancel-text="否"
|
|
|
+ @confirm="removeAllUserInfo('editForm_newlyUserData')"
|
|
|
+ @cancel="cancel">
|
|
|
+ <a-button v-if="!tag" style="padding-right: 10%" v-show="(newlyUserData as any).length>0">全部移除</a-button>
|
|
|
+ </a-popconfirm>
|
|
|
|
|
|
- <div class="appUserOperateitem">
|
|
|
<!-- 作为添加页面时显示 -->
|
|
|
- <a-button type="primary" :disabled="adduserCount===0"
|
|
|
- @click="removeUserInfo('add')"
|
|
|
- v-if="tag" >添 加</a-button>
|
|
|
- <!-- 作为编辑页面时显示 -->
|
|
|
- <a-button type="primary"
|
|
|
- :disabled="adduserCount===0"
|
|
|
- @click="removeUserInfo('edit')"
|
|
|
- v-if="!tag" v-show="!uncheckTag">移 除</a-button>
|
|
|
+ <span v-if="tag" style="padding-right: 5%; white-space: nowrap"><b>已添加应用用户:{{(addForm_newlyUserData as any).length}}</b></span>
|
|
|
+ <a-button v-if="tag" type="primary" :disabled="adduserCount===0" @click="removeUserInfo('add')">添 加</a-button>
|
|
|
+ <a-popconfirm
|
|
|
+ title="你确定要移除全部信息吗?"
|
|
|
+ ok-text="是"
|
|
|
+ cancel-text="否"
|
|
|
+ @confirm="removeAllUserInfo('addForm_newlyUserData')"
|
|
|
+ @cancel="cancel">
|
|
|
+ <a-button v-if="tag" style="padding-right: 10%" v-show="(addForm_newlyUserData as any).length>0">全部移除</a-button>
|
|
|
+ </a-popconfirm>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -69,13 +87,8 @@
|
|
|
<a-table :row-selection="rowSelection" :columns="columns"
|
|
|
:data-source="data" v-show="!uncheckTag||tag" size="small"
|
|
|
class="userTableClass" :pagination="pagination" @change="handleTableChange">
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
- <template v-if="column.dataIndex === 'editform_action'">
|
|
|
- <a-button type="link" @click="openPermissionModal">授 权</a-button>
|
|
|
- <a-modal :open="permissionTag">
|
|
|
- <AppPermissionTree app-list=""/>
|
|
|
- </a-modal>
|
|
|
- </template>
|
|
|
+ <template #title>
|
|
|
+ <b>平台用户</b>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</div>
|
|
@@ -86,11 +99,11 @@
|
|
|
<div class="table_right" v-if="tag">
|
|
|
<!-- 新增用户列表 -->
|
|
|
<div class="table_top">
|
|
|
- <div style="margin-bottom: 5px">
|
|
|
- <b>已添加应用用户:{{(addForm_newlyUserData as any).length}}</b>
|
|
|
- <a-button style="margin-left: 40%" v-show="(addForm_newlyUserData as any).length>0">全部移除</a-button>
|
|
|
- </div>
|
|
|
- <a-table :columns="addForm_newlyUsercolumns" :data-source="addForm_newlyUserData" :scroll="{y: 500}" :pagination="false" size="small">
|
|
|
+ <a-table :columns="addForm_newlyUsercolumns" :data-source="addForm_newlyUserData" :scroll="{y: 500}"
|
|
|
+ :pagination="false" size="small" class="rightuserTableClass">
|
|
|
+ <template #title>
|
|
|
+ <b>将要加入该应用的用户</b>
|
|
|
+ </template>
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.dataIndex === 'action'">
|
|
|
<a-button type="link" @click="recoverNewlyOneUserInfo(record.key, 'add')">移 出</a-button>
|
|
@@ -104,10 +117,6 @@
|
|
|
<div class="table_right" v-if="!tag&&!uncheckTag">
|
|
|
<!-- 新增用户列表 -->
|
|
|
<div class="table_top">
|
|
|
- <div style="margin-bottom: 5px">
|
|
|
- <span> <b>新增用户:{{(newlyUserData as any).length}}</b> </span>
|
|
|
- <a-button style="margin-left: 40%" v-show="(newlyUserData as any).length>0">全部移除</a-button>
|
|
|
- </div>
|
|
|
<a-table :columns="newlyUsercolumns" :data-source="newlyUserData"
|
|
|
:scroll="{y: 230}" :pagination="false" size="small"
|
|
|
class="rightuserTableClass">
|
|
@@ -128,7 +137,14 @@
|
|
|
class="rightuserTableClass">
|
|
|
<template #title>
|
|
|
<b>移除用户:{{(removeUserData as any).length}}</b>
|
|
|
+ <a-popconfirm
|
|
|
+ title="你确定要移除全部信息吗?"
|
|
|
+ ok-text="是"
|
|
|
+ cancel-text="否"
|
|
|
+ @confirm="removeAllUserInfo('editForm_removeUserData')"
|
|
|
+ @cancel="cancel">
|
|
|
<a-button style="margin-left: 40%" v-show="(removeUserData as any).length>0">全部移除</a-button>
|
|
|
+ </a-popconfirm>
|
|
|
</template>
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.dataIndex === 'action'">
|
|
@@ -157,17 +173,9 @@
|
|
|
<a-button v-if="tag" type="primary" @click="addCheck">
|
|
|
提交审核
|
|
|
</a-button>
|
|
|
-<!-- <a-popconfirm-->
|
|
|
-<!-- v-if="removeUserData.length>0"-->
|
|
|
-<!-- title="注意!移除用户将同时移除该用户在该应用下的所有权限,是否继续?"-->
|
|
|
-<!-- ok-text="是"-->
|
|
|
-<!-- cancel-text="否"-->
|
|
|
-<!-- @confirm=""-->
|
|
|
-<!-- @cancel="">-->
|
|
|
<a-button v-if="!tag&&isEdit" type="primary" @click="save" :disabled="uncheckTag">
|
|
|
保 存
|
|
|
</a-button>
|
|
|
-<!-- </a-popconfirm>-->
|
|
|
</div>
|
|
|
|
|
|
<!-- 提交审核事件二次确认 -->
|
|
@@ -365,48 +373,6 @@ export default defineComponent({
|
|
|
await this.queryAppUserMethod(1)
|
|
|
},
|
|
|
|
|
|
- // 作为添加表单时使用,根据表单一所选用户的角色,将用户加入新增用户列表及授予相应的角色
|
|
|
- async step1Tostep4DataRelationDeal(step1FormData){
|
|
|
- console.log("表单四拿到表单一数据")
|
|
|
- console.dir(step1FormData)
|
|
|
- let step1userData = []
|
|
|
- // 将右列表用户数据添加至
|
|
|
- if (step1FormData.admin!=undefined) step1userData.push(step1FormData.admin)
|
|
|
- if (step1FormData.businessUser!=undefined) step1userData.push(step1FormData.businessUser)
|
|
|
- if (step1FormData.developUser!=undefined) step1userData.push(step1FormData.developUser)
|
|
|
- if (step1FormData.operationUser!=undefined) step1userData.push(step1FormData.operationUser)
|
|
|
- if (step1FormData.requirementUser!=undefined) step1userData.push(step1FormData.requirementUser)
|
|
|
- const params = {
|
|
|
- userids: step1userData
|
|
|
- }
|
|
|
- await queryAppUser(params).then(res=>{
|
|
|
- console.log("表单四查询表单一填写的用户数据")
|
|
|
- console.dir(res)
|
|
|
- // 根据表单一所选用户,初始化表单四添加用户列表数据
|
|
|
- addForm_newlyUserData.value.length = 0
|
|
|
- res.userinfos.forEach(item=>{
|
|
|
- const itemObj = {
|
|
|
- key: item.id,
|
|
|
- name: item.realname,
|
|
|
- username: item.username,
|
|
|
- sex: item.sex,
|
|
|
- depart: item.dept.deptName,
|
|
|
- roles: ''
|
|
|
- }
|
|
|
- addForm_newlyUserData.value.push(itemObj)
|
|
|
- })
|
|
|
- })
|
|
|
- selectedRowKeys.value = step1userData
|
|
|
- userData.value = step1userData
|
|
|
- addForm_newlyUserData.value.forEach( item =>{
|
|
|
- if (item.key === step1FormData.admin) item.roles = '应用管理员'
|
|
|
- if (item.key === step1FormData.businessUser) item.roles = '业务对接人'
|
|
|
- if (item.key === step1FormData.developUser) item.roles = '开发负责人'
|
|
|
- if (item.key === step1FormData.operationUser) item.roles = '运维负责人'
|
|
|
- if (item.key === step1FormData.requirementUser) item.roles = '需求对接人'
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
transformTreeData(data) {
|
|
|
return data.map(item => {
|
|
|
const transformedItem = {
|
|
@@ -422,19 +388,19 @@ export default defineComponent({
|
|
|
},
|
|
|
|
|
|
// 初始化表单样式,判断是添加表单还是编辑表单
|
|
|
- async initUserInfo(value, step1Values){
|
|
|
+ async initUserInfo(value){
|
|
|
// 获取部门信息
|
|
|
console.log("先看看这个value吧")
|
|
|
+ console.dir(value)
|
|
|
const deptInfo = await queryTreeList()
|
|
|
treeData.value = this.transformTreeData(deptInfo);
|
|
|
tag.value = this.formType === 'isAdd'
|
|
|
if (tag.value){ // 作为添加表单的初始化
|
|
|
console.log("表单四:作为添加表单的初始化")
|
|
|
// 由于分页限制了data的大小,故需自己去查询表单一所添加的用户的信息
|
|
|
- await this.step1Tostep4DataRelationDeal(step1Values)
|
|
|
+ // if (step1Values!=undefined) await this.step1Tostep4DataRelationDeal(step1Values)
|
|
|
// 将左用户信息栏角色列去除
|
|
|
columns.value = userTableSchemas.filter(item => item.dataIndex !== 'roles');// 应用用户表列配置
|
|
|
- console.dir(value)
|
|
|
try {
|
|
|
if (value.value!==undefined) addForm_newlyUserData.value = value
|
|
|
}catch (e){
|
|
@@ -455,7 +421,18 @@ export default defineComponent({
|
|
|
modalVisible.value=false
|
|
|
},
|
|
|
|
|
|
- // 移除用户信息
|
|
|
+ // 全部移除 新增(添加)用户信息
|
|
|
+ removeAllUserInfo(tag){
|
|
|
+ console.log("执行了全部移除:"+tag)
|
|
|
+ // 全部移除新增表单将要加入该应用的用户列表数据
|
|
|
+ if (tag==='addForm_newlyUserData') addForm_newlyUserData.value.length = 0
|
|
|
+ if (tag==='editForm_newlyUserData') newlyUserData.value.length = 0
|
|
|
+ if (tag==='editForm_removeUserData') removeUserData.value.length = 0
|
|
|
+ this.queryAppUserMethod(this.pagination.current)
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ // 移除右列表信息
|
|
|
removeUserInfo(isType){
|
|
|
console.log("移除用户信息执行了");
|
|
|
console.dir(userData);
|
|
@@ -469,6 +446,7 @@ export default defineComponent({
|
|
|
isType==='edit'? removeUserData.value.push(dataObject) : addForm_newlyUserData.value.push(dataObject)
|
|
|
}
|
|
|
})
|
|
|
+ this.clearConditionAndData()
|
|
|
console.dir(addForm_newlyUsercolumns)
|
|
|
selectedRowKeys.value = []
|
|
|
this.adduserCount = 0
|
|
@@ -532,7 +510,7 @@ export default defineComponent({
|
|
|
if (this.formType === 'isAdd'){ // 处于添加表单下的关闭事件,需收集表单已填数据进行存储
|
|
|
console.log("表单四添加状态下关闭")
|
|
|
const obj = {
|
|
|
- data: addForm_newlyUserData,
|
|
|
+ data: addForm_newlyUserData.value,
|
|
|
info: 'user',
|
|
|
type: 'isAdd'
|
|
|
}
|
|
@@ -591,6 +569,9 @@ export default defineComponent({
|
|
|
},
|
|
|
|
|
|
setup(props, { emit }) {
|
|
|
+ const cancel = (e: MouseEvent) => {
|
|
|
+ message.error('取消移除');
|
|
|
+ };
|
|
|
|
|
|
watch(deptInfovalue, () => {
|
|
|
realnameSearchvalue.value = ''
|
|
@@ -711,7 +692,8 @@ export default defineComponent({
|
|
|
setValue,
|
|
|
getBindValue,
|
|
|
deptInfovalue,
|
|
|
- searchValue
|
|
|
+ searchValue,
|
|
|
+ cancel
|
|
|
};
|
|
|
},
|
|
|
});
|
|
@@ -752,6 +734,7 @@ export default defineComponent({
|
|
|
align-items: center; /* 垂直居中对齐 */
|
|
|
justify-content: center; /* 水平居中对齐 */
|
|
|
margin-right: 10px; /* 为每个 .item 添加右边距 */
|
|
|
+ gap: 10px;
|
|
|
}
|
|
|
|
|
|
.item:last-child {
|
|
@@ -792,7 +775,7 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
.userTableClass{
|
|
|
- border-right: 1px solid #d9d9d9;
|
|
|
+ border: 1px solid #d9d9d9;
|
|
|
}
|
|
|
|
|
|
.rightuserTableClass{
|