Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
6e1733ea
Commit
6e1733ea
authored
Feb 25, 2019
by
kokoroli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix Edit.vue bug
parent
67c4eebf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
18 deletions
+32
-18
Edit.vue
src/views/list/table/Edit.vue
+32
-18
No files found.
src/views/list/table/Edit.vue
View file @
6e1733ea
...
...
@@ -15,6 +15,7 @@
'no',
{rules: [{ required: true, message: '请输入规则编号' }]}
]"
:disabled="true"
>
</a-input>
</a-form-item>
...
...
@@ -35,7 +36,7 @@
hasFeedback
validateStatus=
"warning"
>
<a-select
defaultValue=
"1"
v-decorator=
"['status',
{rules: [{ required: true, message: '请选择状态' }]
}]">
<a-select
v-decorator=
"['status',
{rules: [{ required: true, message: '请选择状态' }], initialValue: '1'
}]">
<a-select-option
value=
"1"
>
Option 1
</a-select-option>
<a-select-option
value=
"2"
>
Option 2
</a-select-option>
<a-select-option
value=
"3"
>
Option 3
</a-select-option>
...
...
@@ -67,6 +68,19 @@
/>
</a-form-item>
<a-form-item
v-bind=
"buttonCol"
>
<a-row>
<a-col
span=
"6"
>
<a-button
type=
"primary"
html-type=
"submit"
>
提交
</a-button>
</a-col>
<a-col
span=
"10"
>
<a-button
@
click=
"handleGoBack"
>
返回
</a-button>
</a-col>
<a-col
span=
"8"
></a-col>
</a-row>
</a-form-item>
</a-form>
</div>
</
template
>
...
...
@@ -84,19 +98,25 @@ export default {
xs
:
{
span
:
24
},
sm
:
{
span
:
12
}
},
form
:
null
,
buttonCol
:
{
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
12
,
offset
:
5
}
}
},
form
:
this
.
$form
.
createForm
(
this
),
id
:
0
}
},
beforeCreate
()
{
this
.
form
=
this
.
$form
.
createForm
(
this
)
},
created
()
{
if
(
this
.
$route
.
params
.
id
)
{
this
.
id
=
this
.
$route
.
params
.
id
}
mounted
()
{
this
.
loadEditInfo
()
},
methods
:
{
handleGoBack
()
{
// TODO
// 改为动态组件时应该把这个方法派发出去,交由父组件处理
this
.
$router
.
back
()
},
handleSubmit
()
{
const
{
form
:
{
validateFields
}
}
=
this
validateFields
((
err
,
values
)
=>
{
...
...
@@ -106,22 +126,16 @@ export default {
}
})
},
loadEditInfo
()
{
const
{
f
ro
m
}
=
this
loadEditInfo
(
data
)
{
const
{
f
or
m
}
=
this
// ajax
console
.
log
(
`将加载
${
this
.
id
}
信息到表单`
)
new
Promise
((
resolve
)
=>
{
setTimeout
(
resolve
,
1500
)
}).
then
(()
=>
{
f
ro
m
.
setFieldsValue
({
no
:
'1'
,
callNo
:
'999'
})
f
or
m
.
setFieldsValue
({
no
:
'1'
,
callNo
:
'999'
})
})
}
},
watch
:
{
id
(
val
,
oldVal
)
{
console
.
log
(
'val'
,
val
,
'oldVal'
,
oldVal
)
this
.
loadEditInfo
()
}
}
}
</
script
>
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