Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
front-backend
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
front-backend
Commits
5911e0c2
Commit
5911e0c2
authored
May 18, 2020
by
ZhengJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[代码完善](v2.5): v2.5 beta 代码优化
2.5 Beta 详情:
https://www.ydyno.com/archives/1225.html
parent
63492da9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/views/system/dept/index.vue
+9
-6
No files found.
src/views/system/dept/index.vue
View file @
5911e0c2
...
...
@@ -40,14 +40,14 @@
</el-form-item>
<el-form-item
label=
"顶级部门"
>
<el-radio-group
v-model=
"form.isTop"
style=
"width: 140px"
>
<el-radio
label=
"
0
"
>
是
</el-radio>
<el-radio
label=
"
1
"
>
否
</el-radio>
<el-radio
label=
"
1
"
>
是
</el-radio>
<el-radio
label=
"
0
"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"enabled"
>
<el-radio
v-for=
"item in dict.dept_status"
:key=
"item.id"
v-model=
"form.enabled"
:label=
"item.value"
>
{{
item
.
label
}}
</el-radio>
</el-form-item>
<el-form-item
v-if=
"form.isTop === '
1
'"
style=
"margin-bottom: 0;"
label=
"上级部门"
prop=
"pid"
>
<el-form-item
v-if=
"form.isTop === '
0
'"
style=
"margin-bottom: 0;"
label=
"上级部门"
prop=
"pid"
>
<treeselect
v-model=
"form.pid"
:load-options=
"loadDepts"
...
...
@@ -118,7 +118,7 @@ import rrOperation from '@crud/RR.operation'
import
crudOperation
from
'@crud/CRUD.operation'
import
udOperation
from
'@crud/UD.operation'
const
defaultForm
=
{
id
:
null
,
name
:
null
,
isTop
:
'1'
,
pid
:
null
,
deptSort
:
999
,
enabled
:
'true'
}
const
defaultForm
=
{
id
:
null
,
name
:
null
,
isTop
:
'1'
,
subCount
:
0
,
pid
:
null
,
deptSort
:
999
,
enabled
:
'true'
}
export
default
{
name
:
'Dept'
,
components
:
{
Treeselect
,
crudOperation
,
rrOperation
,
udOperation
},
...
...
@@ -162,9 +162,9 @@ export default {
// 新增与编辑前做的操作
[
CRUD
.
HOOK
.
afterToCU
](
crud
,
form
)
{
if
(
form
.
pid
!==
null
)
{
form
.
isTop
=
'1'
}
else
if
(
form
.
id
!==
null
)
{
form
.
isTop
=
'0'
}
else
if
(
form
.
id
!==
null
)
{
form
.
isTop
=
'1'
}
form
.
enabled
=
`
${
form
.
enabled
}
`
if
(
form
.
id
!=
null
)
{
...
...
@@ -218,6 +218,9 @@ export default {
})
return
false
}
if
(
this
.
form
.
isTop
===
'1'
)
{
this
.
form
.
pid
=
null
}
return
true
},
// 改变状态
...
...
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