Commit 8ec8b467 by wangchunyang

配置相关功能开发

parent 29b22942
...@@ -565,7 +565,7 @@ export default { ...@@ -565,7 +565,7 @@ export default {
const api = apiMap[tab] const api = apiMap[tab]
if (!api) return if (!api) return
this.loading[tab] = true this.loading[tab] = true
const payload = Object.assign({}, this.pagers[tab], { params: this.filters[tab] }) const payload = Object.assign({}, this.pagers[tab], this.filters[tab])
api(payload).then(ret => { api(payload).then(ret => {
if (ret.data && ret.data.errcode === 0) { if (ret.data && ret.data.errcode === 0) {
const data = ret.data.data || {} const data = ret.data.data || {}
...@@ -604,22 +604,16 @@ export default { ...@@ -604,22 +604,16 @@ export default {
const modal = this.modals[tab] const modal = this.modals[tab]
modal.visible = true modal.visible = true
modal.isEdit = false modal.isEdit = false
modal.form = this.getDefaultForm(tab)
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs[tab + 'Form']) { modal.form = this.getDefaultForm(tab)
this.$refs[tab + 'Form'].resetFields()
}
}) })
}, },
openEditModal (tab, row) { openEditModal (tab, row) {
const modal = this.modals[tab] const modal = this.modals[tab]
modal.visible = true modal.visible = true
modal.isEdit = true modal.isEdit = true
modal.form = Object.assign({}, this.getDefaultForm(tab), row)
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs[tab + 'Form']) { modal.form = Object.assign({}, this.getDefaultForm(tab), row)
this.$refs[tab + 'Form'].resetFields()
}
}) })
}, },
getDefaultForm (tab) { getDefaultForm (tab) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论