Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
bigDataSystem
Commits
25a03f72
Commit
25a03f72
authored
Nov 05, 2024
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了机构管理页面
parent
9212ce32
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
216 additions
and
2 deletions
+216
-2
AddUserModal.vue
src/views/system/institution/AddUserModal.vue
+95
-0
index.vue
src/views/system/institution/index.vue
+16
-2
institutionData.ts
src/views/system/institution/institutionData.ts
+105
-0
No files found.
src/views/system/institution/AddUserModal.vue
0 → 100644
View file @
25a03f72
<
template
>
<BasicModal
width=
"50%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicTable
@
register=
"registerTable"
></BasicTable>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
reactive
,
unref
,
onDeactivated
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
addUserData
,
columns
,
searchFormSchema
,
TreeData
}
from
'./institutionData'
;
import
{
useGo
}
from
'@/hooks/web/usePage'
;
import
{
downloadByData
}
from
'@/utils/file/download'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData'
;
import
{
useUserStore
}
from
"@/store/modules/user"
;
import
{
userData
}
from
"@/views/system/institution/institutionData"
;
defineOptions
({
name
:
'AccountManagement'
});
const
{
createMessage
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
go
=
useGo
();
const
[
registerMoveUser
,
{
openModal
:
openMoveUserModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
tableData
=
ref
([])
const
isAdd
=
ref
(
true
)
const
[
registerTable
,
{
reload
,
updateTableDataRecord
,
getSearchInfo
,
getForm
,
getRowSelection
}]
=
useTable
({
title
:
'添加用户'
,
api
:
async
(
params
)
=>
{
const
response
=
{
pageNu
:
"1"
,
pageSize
:
"10"
,
pages
:
"1"
,
total
:
tableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
[],
};
var
data
=
[]
data
=
tableData
.
value
if
(
params
.
name
!=
undefined
&&
params
.
name
!=
''
&&
params
.
name
!=
null
){
//过滤出名字包含params.name的数据
data
=
data
.
filter
((
item
)
=>
item
.
name
.
includes
(
params
.
name
));
}
if
(
params
.
username
!=
undefined
&&
params
.
username
!=
''
&&
params
.
username
!=
null
){
data
=
data
.
filter
((
item
)
=>
item
.
username
.
includes
(
params
.
username
));
}
return
{
...
response
,
data
:
data
};
},
rowKey
:
'businessId'
,
columns
,
rowSelection
:
true
,
formConfig
:
{
labelWidth
:
100
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
},
useSearchForm
:
true
,
showTableSetting
:
false
,
bordered
:
true
,
handleSearchInfoFn
(
info
)
{
return
info
;
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
setModalProps
({
confirmLoading
:
false
});
isAdd
.
value
=
!!
data
?.
isAdd
;
});
/** 新增成功*/
function
handleSubmit
()
{
const
rowSelection
=
getRowSelection
().
selectedRowKeys
;
if
(
rowSelection
.
length
>
0
){
//已选中
//根据选中的查询用户 然后进行添加
let
data
=
[]
data
=
tableData
.
value
.
filter
((
item
)
=>
rowSelection
.
includes
(
item
.
businessId
));
emit
(
'success'
,
{
isAdd
:
unref
(
isAdd
),
values
:
{
...
data
},
length
:
rowSelection
.
length
});
closeModal
();
}
}
onMounted
(()
=>
{
tableData
.
value
=
addUserData
});
</
script
>
src/views/system/institution/index.vue
View file @
25a03f72
...
...
@@ -36,6 +36,7 @@
</BasicTable>
<AccountModal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<MoveUser
@
register=
"registerMoveUser"
@
success=
"handleMoveSuccess"
/>
<AddUserModal
@
register=
"registerAddUserModal"
@
success=
"handleAddSuccess"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
...
...
@@ -57,6 +58,7 @@
import
{
useUserStore
}
from
"@/store/modules/user"
;
import
{
getMenuListByPage
}
from
"@/api/system/menu/menu"
;
import
{
userData
}
from
"@/views/system/institution/institutionData"
;
import
AddUserModal
from
'./AddUserModal.vue'
;
import
user
from
"../../../../mock/sys/user"
;
import
{
forEach
}
from
"lodash-es"
;
...
...
@@ -66,6 +68,7 @@
const
route
=
useRoute
();
const
go
=
useGo
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerAddUserModal
,
{
openModal
:
addUserModal
}]
=
useModal
();
const
[
registerMoveUser
,
{
openModal
:
openMoveUserModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tableData
=
ref
([])
...
...
@@ -125,8 +128,8 @@
/** 新增按钮*/
function
handleCreate
()
{
open
Modal
(
true
,
{
is
Update
:
fals
e
,
addUser
Modal
(
true
,
{
is
Add
:
tru
e
,
});
}
...
...
@@ -212,6 +215,17 @@
reload
();
}
/** 添加用户*/
function
handleAddSuccess
({
isAdd
,
values
,
length
})
{
if
(
length
>
0
){
//批量添加
for
(
let
i
=
0
;
i
<
length
;
i
++
){
tableData
.
value
.
push
(
values
[
i
])
}
}
reload
();
}
/** 部门树的select*/
function
handleSelect
(
institutionId
=
''
)
{
searchInfo
.
institutionId
=
institutionId
;
...
...
src/views/system/institution/institutionData.ts
View file @
25a03f72
...
...
@@ -7,6 +7,49 @@ import {useMessage} from "@/hooks/web/useMessage";
import
{
changeFlagApi
}
from
"@/api/system/user/user"
;
// 引入开关组件
type
CheckedType
=
boolean
|
string
|
number
;
export
const
columns
:
BasicColumn
[]
=
[
{
title
:
'姓名'
,
dataIndex
:
'name'
,
width
:
150
,
},
{
title
:
'登录名'
,
dataIndex
:
'username'
,
width
:
150
,
},
{
title
:
'用户角色'
,
dataIndex
:
'roleName'
,
width
:
150
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createDate'
,
width
:
150
,
},
];
export
const
searchFormSchema
:
FormSchema
[]
=
[
{
field
:
'name'
,
label
:
'姓名'
,
component
:
'Input'
,
componentProps
:
{
placeholder
:
'请输入姓名'
,
},
colProps
:
{
span
:
7
},
},
{
field
:
'username'
,
label
:
'登录名'
,
component
:
'Input'
,
componentProps
:
{
placeholder
:
'请输入登录名'
,
},
colProps
:
{
span
:
7
},
},
];
export
const
TreeData
:
any
[]
=
[
{
...
...
@@ -228,6 +271,68 @@ export const userData: any[] = [
}
];
export
const
addUserData
:
any
[]
=
[
{
"delFlag"
:
"0"
,
"flag"
:
"1"
,
"businessId"
:
400
,
"username"
:
"tianjia1"
,
"nickName"
:
"添加用户1"
,
"userType"
:
"1"
,
"name"
:
"添加用户1"
,
"roleName"
:
"工作区访客"
,
"createDate"
:
"2024-10-24 10:04:04"
,
"institutionId"
:
null
,
"institutionName"
:
""
,
"code"
:
"123f"
,
"identity"
:
"1"
,
"roleIds"
:
null
,
"roleNames"
:
"三级用户"
,
"roleList"
:
null
,
"menuList"
:
[
]
},
{
"delFlag"
:
"0"
,
"flag"
:
"1"
,
"businessId"
:
402
,
"username"
:
"tianjia2"
,
"nickName"
:
"添加用户2"
,
"userType"
:
"1"
,
"name"
:
"添加用户2"
,
"roleName"
:
"工作区访客"
,
"createDate"
:
"2024-10-25 10:05:05"
,
"sex"
:
"0"
,
"institutionId"
:
null
,
"institutionName"
:
""
,
"code"
:
"123a"
,
"identity"
:
"1"
,
"roleIds"
:
null
,
"roleNames"
:
null
,
"roleList"
:
null
,
"menuList"
:
[
]
},
{
"delFlag"
:
"0"
,
"flag"
:
"1"
,
"businessId"
:
403
,
"username"
:
"tianjia3"
,
"nickName"
:
"添加用户3"
,
"userType"
:
"1"
,
"name"
:
"添加用户3"
,
"roleName"
:
"工作区访客"
,
"createDate"
:
"2024-10-26 10:06:06"
,
"sex"
:
"1"
,
"institutionId"
:
null
,
"institutionName"
:
""
,
"code"
:
"123c"
,
"identity"
:
"1"
,
"roleIds"
:
null
,
"roleNames"
:
"超级管理员"
,
"roleList"
:
null
,
"menuList"
:
[]
},
];
export
const
accountFormSchema
:
any
[]
=
[
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment