Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
f0dea7db
Commit
f0dea7db
authored
Oct 15, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据字典
parent
8a3ea4fa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
311 additions
and
73 deletions
+311
-73
add.vue
pages/basicData/dic/components/add.vue
+113
-0
edit.vue
pages/basicData/dic/components/edit.vue
+13
-1
index.vue
pages/basicData/dic/index.vue
+185
-72
No files found.
pages/basicData/dic/components/add.vue
0 → 100644
View file @
f0dea7db
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"100"
>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"类别"
prop=
"typeId"
>
<RadioGroup
v-model=
"entity.typeId"
>
<Radio
:label=
"0"
disabled
>
系统
</Radio>
<Radio
:label=
"1"
disabled
>
分类
</Radio>
<Radio
:label=
"2"
disabled
>
字典
</Radio>
<Radio
:label=
"3"
disabled
>
字典项
</Radio>
</RadioGroup>
</FormItem>
</Row>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"名称"
prop=
"name"
>
<Input
v-model=
"entity.name"
>
<ColorPicker
v-model=
"entity.color"
slot=
"prepend"
transfer
size=
"small"
transfer
recommend
/>
</Input>
</FormItem>
</Row>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"编码"
prop=
"code"
>
<Input
v-model=
"entity.code"
/>
</FormItem>
</Row>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"图标"
prop=
"icon"
>
<InputIcon
v-model=
"entity.icon"
></InputIcon>
</FormItem>
</Row>
<FormItem
label=
"状态"
prop=
"number"
>
<RadioGroup
v-model=
"entity.status"
>
<Radio
:label=
"0"
>
启用
</Radio>
<Radio
:label=
"1"
>
禁用(名称和值可以启用或禁用,但不能删除)
</Radio>
</RadioGroup>
</FormItem>
<FormItem
label=
"锁定"
prop=
"number"
>
<RadioGroup
v-model=
"entity.isStatic"
>
<Radio
:label=
"0"
>
不锁定
</Radio>
<Radio
:label=
"1"
>
锁定(锁定后不可改变名称和值,不能删除)
</Radio>
</RadioGroup>
</FormItem>
<Row
class=
"rowTitle100"
>
<FormItem
label=
"描述"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
:rows=
"3"
></Input>
</FormItem>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
<div>
{{
v
}}
</div>
</FormItem>
</Form>
</
template
>
<
script
>
import
api
from
"../api.js"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
entity
:
{
upId
:
0
,
typeId
:
this
.
v
.
typeId
,
status
:
0
,
isStatic
:
0
,
priority
:
0
,
color
:
""
,
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
code
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
},
};
},
props
:
[
"v"
],
mounted
()
{
if
(
this
.
v
.
id
)
{
this
.
entity
.
typeId
=
this
.
v
.
typeId
+
1
;
this
.
entity
.
upId
=
this
.
v
.
id
;
}
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
api
.
save
(
this
.
entity
).
then
((
r
)
=>
{
console
.
warn
(
r
);
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"添加成功"
);
this
.
$emit
(
"on-ok"
);
}
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
},
watch
:
{
},
};
</
script
>
pages/basicData/dic/components/edit.vue
View file @
f0dea7db
...
...
@@ -55,7 +55,9 @@ export default {
name
:
'Edit'
,
data
()
{
return
{
entity
:
this
.
v
,
entity
:
{
color
:
""
},
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
code
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
...
...
@@ -65,6 +67,13 @@ export default {
props
:
{
v
:
Object
},
mounted
(){
this
.
entity
=
this
.
v
if
(
!
this
.
entity
.
color
){
this
.
entity
.
color
=
""
;
}
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
...
...
@@ -86,6 +95,9 @@ export default {
watch
:
{
v
(
v
)
{
this
.
entity
=
this
.
v
if
(
!
this
.
entity
.
color
){
this
.
entity
.
color
=
""
;
}
console
.
info
(
this
.
entity
)
}
}
...
...
pages/basicData/dic/index.vue
View file @
f0dea7db
This diff is collapsed.
Click to expand it.
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