|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <m-search class="mb-3" :items="searchItems" v-model="searchValues"></m-search>
|
|
|
+ <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
<AnalysisChart shadow="always" :option="option" height="800" v-loading="loading"></AnalysisChart>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -39,17 +39,25 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- async created () {
|
|
|
- this.loading = true
|
|
|
- try {
|
|
|
- const { data } = await this.api({
|
|
|
- ...this.searchValues
|
|
|
- })
|
|
|
- this.option = data
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- } finally {
|
|
|
- this.loading = false
|
|
|
+ created () {
|
|
|
+ this.onInit()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async onInit () {
|
|
|
+ this.loading = true
|
|
|
+ try {
|
|
|
+ const { data } = await this.api({
|
|
|
+ ...this.searchValues
|
|
|
+ })
|
|
|
+ this.option = data
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSearch () {
|
|
|
+ this.onInit()
|
|
|
}
|
|
|
}
|
|
|
}
|