Commit 351950a7 authored by huai.li's avatar huai.li

修复重置bug

parent f6c19666
...@@ -201,9 +201,12 @@ export default { ...@@ -201,9 +201,12 @@ export default {
// 3.2关键字后面的重置 // 3.2关键字后面的重置
searchClear () { searchClear () {
this.clearParams() this.$refs.searchHeader._resetParams()
this.$refs.timeSearchForm.resetForm() this.$refs.clientForm._resetForm()
this._reload()
// this.clearParams()
// this.$refs.timeSearchForm.resetForm()
// this._reload()
}, },
// 4.重新加载 // 4.重新加载
......
...@@ -211,6 +211,11 @@ export default { ...@@ -211,6 +211,11 @@ export default {
this.getFilter() this.getFilter()
}, },
searchClear () {
this.$refs.searchHeader._resetParams()
this.$refs.timeSearchForm.resetParams()
this.$refs.clientForm._resetForm()
},
// 1.查询条件 // 1.查询条件
getFilter () { getFilter () {
requestAPI(api.getCaseFilter).then(res => { requestAPI(api.getCaseFilter).then(res => {
...@@ -256,11 +261,11 @@ export default { ...@@ -256,11 +261,11 @@ export default {
}, },
// 3.2关键字后面的重置 // 3.2关键字后面的重置
searchClear () { // searchClear () {
this.clearParams() // this.clearParams()
this.$refs.timeSearchForm.resetForm() // this.$refs.timeSearchForm.resetForm()
this._reload() // this._reload()
}, // },
// 4.重新加载 // 4.重新加载
_reload () { _reload () {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</el-col> </el-col>
</el-form> </el-form>
<el-form ref="clientTimeRange" :model="clientTimeRange" size="mini"> <el-form ref="clientTimeRange" :model="clientTimeRange" size="mini">
<el-col :span="8" :offset="0" :xs="{span: 24, offset: 0}" class="form-content-time-range"> <el-col :span="9" :offset="0" :xs="{span: 24, offset: 0}" class="form-content-time-range">
<el-form-item label-width="0"> <el-form-item label-width="0">
<el-date-picker <el-date-picker
size="mini" size="mini"
...@@ -67,7 +67,13 @@ export default { ...@@ -67,7 +67,13 @@ export default {
this.$watch('clientTimeForm', (val) => { this.$watch('clientTimeForm', (val) => {
let perid = val[this.formSearchKey + '[period]'] let perid = val[this.formSearchKey + '[period]']
this.$emit('update:list', Object.assign({}, {[this.formSearchKey + '[period]']: perid})) this.$emit('update:list', Object.assign({}, {[this.formSearchKey + '[period]']: perid}))
}, {deep: true}) }, {deep: true, immediate: true})
},
resetParams () {
this.$set(this.clientTimeForm, this.formSearchKey + '[period]', 'all')
this.clientTimeRange.from = ''
this.clientTimeRange.to = ''
}, },
initParams () { initParams () {
......
...@@ -190,9 +190,11 @@ export default { ...@@ -190,9 +190,11 @@ export default {
// 3.2关键字后面的重置 // 3.2关键字后面的重置
searchClear () { searchClear () {
this.clearParams() this.$refs.searchHeader._resetParams()
this.$refs.timeSearchForm.resetForm() this.$refs.clientForm._resetForm()
this._reload() // this.clearParams()
// this.$refs.timeSearchForm.resetForm()
// this._reload()
}, },
// 4.重新加载 // 4.重新加载
......
...@@ -127,9 +127,12 @@ export default { ...@@ -127,9 +127,12 @@ export default {
// 3.2关键字后面的重置 // 3.2关键字后面的重置
searchClear () { searchClear () {
this.clearParams() this.$refs.searchHeader._resetParams()
this.$refs.timeSearchForm.resetForm() this.$refs.clientForm._resetForm()
this._reload()
// this.clearParams()
// this.$refs.timeSearchForm.resetForm()
// this._reload()
}, },
// 4.重新加载 // 4.重新加载
......
...@@ -199,9 +199,11 @@ export default { ...@@ -199,9 +199,11 @@ export default {
// 3.2关键字后面的重置 // 3.2关键字后面的重置
searchClear () { searchClear () {
this.clearParams() this.$refs.searchHeader._resetParams()
this.$refs.timeSearchForm.resetForm() this.$refs.clientForm._resetForm()
this._reload() // this.clearParams()
// this.$refs.timeSearchForm.resetForm()
// this._reload()
}, },
// 4.重新加载 // 4.重新加载
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
:search-key="'ClientSearch'" :search-key="'ClientSearch'"
:add-title="'新建项目'" :add-title="'新建项目'"
@update:headerSearch="search => searchKeyword(search)" @update:headerSearch="search => searchKeyword(search)"
@update:headerAdd="() => addSch()"> @update:headerAdd="() => addSch()"
@update:headerClear="() => _resetParams()">
</search-header> </search-header>
<search-form <search-form
ref="clientForm" ref="clientForm"
...@@ -175,6 +176,11 @@ export default { ...@@ -175,6 +176,11 @@ export default {
this.getFilter() this.getFilter()
}, },
_resetParams () {
this.$refs.searchHeader._resetParams()
this.$refs.clientForm._resetForm()
},
_reload () { _reload () {
let params = this.setParams({ let params = this.setParams({
...this.form, ...this.form,
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
:search-key="'ClientSearch'" :search-key="'ClientSearch'"
:add-title="'新建项目清单'" :add-title="'新建项目清单'"
@update:headerSearch="search => searchKeyword(search)" @update:headerSearch="search => searchKeyword(search)"
@update:headerAdd="() => addSch()"> @update:headerAdd="() => addSch()"
@update:headerClear="() => _resetParams()">
</search-header> </search-header>
<search-form <search-form
ref="clientForm" ref="clientForm"
...@@ -160,6 +161,11 @@ export default { ...@@ -160,6 +161,11 @@ export default {
this.getFilter() this.getFilter()
}, },
_resetParams () {
this.$refs.searchHeader._resetParams()
this.$refs.clientForm._resetForm()
},
_reload () { _reload () {
let params = this.setParams({ let params = this.setParams({
...this.form, ...this.form,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment