Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1846ba15
authored
Mar 19, 2023
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重新dept模块
parent
15ac1d9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
21 deletions
+13
-21
src/views/system/dept/form.vue
+4
-9
src/views/system/dept/index.vue
+9
-12
No files found.
src/views/system/dept/form.vue
View file @
1846ba15
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
style=
"width: 100%"
style=
"width: 100%"
>
>
<el-option
<el-option
v-for=
"item in
props.userOption
"
v-for=
"item in
userList
"
:key=
"item.id"
:key=
"item.id"
:label=
"item.nickname"
:label=
"item.nickname"
:value=
"item.id"
:value=
"item.id"
...
@@ -88,6 +88,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
...
@@ -88,6 +88,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const
formType
=
ref
(
''
)
// 表单的类型:create - 新增;update - 修改
const
formType
=
ref
(
''
)
// 表单的类型:create - 新增;update - 修改
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
const
deptOptions
=
ref
()
// 树形结构
const
deptOptions
=
ref
()
// 树形结构
const
userList
=
ref
()
// 负责人列表选项结构
const
formData
=
ref
({
const
formData
=
ref
({
id
:
undefined
,
id
:
undefined
,
...
@@ -100,12 +101,6 @@ const formData = ref({
...
@@ -100,12 +101,6 @@ const formData = ref({
email
:
undefined
,
email
:
undefined
,
status
:
undefined
status
:
undefined
})
})
const
props
=
defineProps
({
userOption
:
{
type
:
Array
,
default
:
()
=>
[]
as
UserVO
[]
}
})
const
formRules
=
reactive
({
const
formRules
=
reactive
({
parentId
:
[{
required
:
true
,
message
:
'上级部门不能为空'
,
trigger
:
'blur'
}],
parentId
:
[{
required
:
true
,
message
:
'上级部门不能为空'
,
trigger
:
'blur'
}],
...
@@ -118,12 +113,12 @@ const formRules = reactive({
...
@@ -118,12 +113,12 @@ const formRules = reactive({
})
})
/** 打开弹窗 */
/** 打开弹窗 */
const
openModal
=
async
(
type
:
string
,
id
?:
number
)
=>
{
const
openModal
=
async
(
type
:
string
,
id
?:
number
,
userOption
?:
UserVO
[])
=>
{
userList
.
value
=
userOption
modelVisible
.
value
=
true
modelVisible
.
value
=
true
modelTitle
.
value
=
t
(
'action.'
+
type
)
modelTitle
.
value
=
t
(
'action.'
+
type
)
formType
.
value
=
type
formType
.
value
=
type
resetForm
()
resetForm
()
console
.
log
(
id
)
// 修改时,设置数据
// 修改时,设置数据
if
(
id
)
{
if
(
id
)
{
formLoading
.
value
=
true
formLoading
.
value
=
true
...
...
src/views/system/dept/index.vue
View file @
1846ba15
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
</ContentWrap>
</ContentWrap>
<!-- 添加或修改部门对话框 -->
<!-- 添加或修改部门对话框 -->
<dept-form
ref=
"modalRef"
@
success=
"getList"
:userOption=
"userOption"
/>
<dept-form
ref=
"modalRef"
@
success=
"getList"
/>
</template>
</template>
<
script
setup
lang=
"ts"
name=
"Dept"
>
<
script
setup
lang=
"ts"
name=
"Dept"
>
import
{
handleTree
}
from
'@/utils/tree'
import
{
handleTree
}
from
'@/utils/tree'
...
@@ -105,17 +105,14 @@ const queryParams = reactive({
...
@@ -105,17 +105,14 @@ const queryParams = reactive({
pageSize
:
100
pageSize
:
100
})
})
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
const
deptDatas
=
ref
()
// 数据变量
// 数据变量
const
deptDatas
=
ref
()
const
userOption
=
ref
<
UserVO
[]
>
([])
const
userOption
=
ref
<
UserVO
[]
>
([])
// 是否展开,默认全部展开
const
isExpandAll
=
ref
(
true
)
const
isExpandAll
=
ref
(
true
)
// 是否展开,默认全部展开
// 重新渲染表格状态
const
refreshTable
=
ref
(
true
)
// 重新渲染表格状态
const
refreshTable
=
ref
(
true
)
const
loading
=
ref
(
true
)
// 列表的加载中
// 列表的加载中
const
loading
=
ref
(
true
)
//获取用户列表
//获取用户列表
const
getUserList
=
async
()
=>
{
const
getUserList
=
async
()
=>
{
const
res
=
await
getListSimpleUsersApi
()
const
res
=
await
getListSimpleUsersApi
()
...
@@ -172,7 +169,7 @@ const resetQuery = () => {
...
@@ -172,7 +169,7 @@ const resetQuery = () => {
/** 添加/修改操作 */
/** 添加/修改操作 */
const
modalRef
=
ref
()
const
modalRef
=
ref
()
const
openModal
=
(
type
:
string
,
id
?:
number
)
=>
{
const
openModal
=
(
type
:
string
,
id
?:
number
)
=>
{
modalRef
.
value
.
openModal
(
type
,
id
)
modalRef
.
value
.
openModal
(
type
,
id
,
userOption
.
value
)
}
}
const
userNicknameFormat
=
(
row
)
=>
{
const
userNicknameFormat
=
(
row
)
=>
{
...
...
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