Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 77c17659
authored
Nov 12, 2020
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改字典数据路由和禁用提示
1 parent
64d9ec70
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
src/components/rule-form/index.vue
src/routes/index.js
src/views/user/index.vue
src/components/rule-form/index.vue
View file @
77c1765
...
@@ -44,6 +44,24 @@
...
@@ -44,6 +44,24 @@
</
template
>
</
template
>
<
template
v-else-if=
"item.type == 'select'"
>
<
template
v-else-if=
"item.type == 'select'"
>
<el-select
<el-select
v-if=
"item.visibleFunc"
v-model=
"ruleForm[item.prop]"
:placeholder=
"item.placeholder || '请选择'"
:filterable=
"item.filterable || false"
@
change=
"selectChange"
@
visible-change=
"item.visibleFunc"
>
<el-option
v-for=
"i in item.options"
:key=
"i[item.value] || i.value"
:label=
"i[item.key] || i.label"
:value=
"i[item.value] || i.value"
:disabled=
"i.disabled"
>
</el-option>
</el-select>
<el-select
v-else
v-model=
"ruleForm[item.prop]"
v-model=
"ruleForm[item.prop]"
:placeholder=
"item.placeholder || '请选择'"
:placeholder=
"item.placeholder || '请选择'"
:filterable=
"item.filterable || false"
:filterable=
"item.filterable || false"
...
@@ -163,6 +181,9 @@ export default {
...
@@ -163,6 +181,9 @@ export default {
},
},
update
(
e
)
{
update
(
e
)
{
this
.
$forceUpdate
()
this
.
$forceUpdate
()
},
visibleChange
(
e
)
{
console
.
log
(
1212
)
}
}
}
}
}
}
...
...
src/routes/index.js
View file @
77c1765
...
@@ -36,7 +36,7 @@ const routes = [
...
@@ -36,7 +36,7 @@ const routes = [
component
:
()
=>
import
(
'../views/dictionaryManage/index.vue'
)
component
:
()
=>
import
(
'../views/dictionaryManage/index.vue'
)
},
},
{
{
path
:
'/dictionaryData'
,
path
:
'/dictionary
Manage/dictionary
Data'
,
name
:
'dictionaryData'
,
name
:
'dictionaryData'
,
component
:
()
=>
import
(
'../views/dictionaryManage/dictionaryData/index.vue'
)
component
:
()
=>
import
(
'../views/dictionaryManage/dictionaryData/index.vue'
)
},
},
...
...
src/views/user/index.vue
View file @
77c1765
...
@@ -228,9 +228,9 @@ export default {
...
@@ -228,9 +228,9 @@ export default {
{
label
:
'角色:'
,
prop
:
'roleId'
,
type
:
'select'
,
options
:
[],
key
:
'roleName'
,
value
:
'roleId'
,
filterable
:
true
},
{
label
:
'角色:'
,
prop
:
'roleId'
,
type
:
'select'
,
options
:
[],
key
:
'roleName'
,
value
:
'roleId'
,
filterable
:
true
},
{
label
:
'邮箱:'
,
prop
:
'email'
,
type
:
'input'
},
{
label
:
'邮箱:'
,
prop
:
'email'
,
type
:
'input'
},
{
label
:
'手机:'
,
prop
:
'phoneNumber'
,
type
:
'input'
,
maxlength
:
11
},
{
label
:
'手机:'
,
prop
:
'phoneNumber'
,
type
:
'input'
,
maxlength
:
11
},
{
label
:
'性别:'
,
prop
:
'gender'
,
type
:
'select'
,
options
:
[],
key
:
'dictLabel'
,
value
:
'dictValue'
},
{
label
:
'性别:'
,
prop
:
'gender'
,
type
:
'select'
,
options
:
[],
key
:
'dictLabel'
,
value
:
'dictValue'
,
visibleFunc
:
this
.
genderChange
},
{
label
:
'状态:'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'状态:'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'岗位:'
,
prop
:
'position'
,
type
:
'select'
,
options
:
[],
key
:
'dictLabel'
,
value
:
'dictValue'
}
{
label
:
'岗位:'
,
prop
:
'position'
,
type
:
'select'
,
options
:
[],
key
:
'dictLabel'
,
value
:
'dictValue'
,
visibleFunc
:
this
.
positionChange
}
],
],
userRules
:
{
userRules
:
{
account
:
[{
required
:
true
,
message
:
'请输入登录名称'
,
trigger
:
'blur'
},
account
:
[{
required
:
true
,
message
:
'请输入登录名称'
,
trigger
:
'blur'
},
...
@@ -516,18 +516,37 @@ export default {
...
@@ -516,18 +516,37 @@ export default {
this
.
userData
[
this
.
userData
.
length
-
1
].
options
=
res
.
data
this
.
userData
[
this
.
userData
.
length
-
1
].
options
=
res
.
data
})
})
},
},
// 获取性别列表
getSex
()
{
getSex
()
{
dictInfo
(
'sys_user_sex'
).
then
(
res
=>
{
dictInfo
(
'sys_user_sex'
).
then
(
res
=>
{
res
.
data
.
map
(
item
=>
{
res
.
data
.
map
(
item
=>
{
if
(
!
item
.
disabled
)
this
.
sexList
.
push
(
item
)
if
(
!
item
.
disabled
)
this
.
sexList
.
push
(
item
)
})
})
console
.
log
(
this
.
sexList
)
this
.
userData
.
map
(
item
=>
{
this
.
userData
.
map
(
item
=>
{
if
(
item
.
prop
==
'gender'
)
{
if
(
item
.
prop
==
'gender'
)
{
item
.
options
=
res
.
data
item
.
options
=
res
.
data
}
}
})
})
})
})
},
// 字典禁用处理
disabledDict
(
name
,
text
)
{
this
.
userData
.
map
(
item
=>
{
if
(
item
.
prop
==
name
)
{
if
(
item
.
options
[
0
].
typeDisabled
)
this
.
$message
({
type
:
'error'
,
message
:
`
${
text
}
已停用,请联系管理员解决`
})
}
})
},
// 性别下拉框出现/隐藏回调
genderChange
(
e
)
{
if
(
e
)
this
.
disabledDict
(
'gender'
,
'性别'
)
},
// 岗位下拉框出现/隐藏回调
positionChange
(
e
)
{
if
(
e
)
this
.
disabledDict
(
'position'
,
'岗位'
)
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment