|
@@ -1,87 +1,31 @@
|
|
|
<template>
|
|
|
- <div class="pa-3 white">
|
|
|
- <m-search :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
- <m-card class="mt-3" v-loading="loading">
|
|
|
- <AccumulatePointsStatisticsTop class="mb-3" v-for="item in items" :key="item.key" :option="item.value"></AccumulatePointsStatisticsTop>
|
|
|
- </m-card>
|
|
|
- </div>
|
|
|
+ <AnalysisPage class="white pa-3" :search-api="getAccumulatePointStatisticsSummary" :drill-init="drillInit"></AnalysisPage>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapGetters } from 'vuex'
|
|
|
import {
|
|
|
- getAccumulatePointStatisticsSummary
|
|
|
+ getAccumulatePointStatisticsSummary,
|
|
|
+ getAccumulatePointStatisticsTop
|
|
|
} from '@/api/accumulatePoint'
|
|
|
-import AccumulatePointsStatisticsTop from './accumulatePointsStatisticsTop.vue'
|
|
|
+import AnalysisPage from '@/components/Analysis'
|
|
|
export default {
|
|
|
name: 'accumulatePointsStatistics',
|
|
|
components: {
|
|
|
- AccumulatePointsStatisticsTop
|
|
|
+ AnalysisPage
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- chart: {},
|
|
|
- loading: false,
|
|
|
- searchValues: {
|
|
|
- parentOrganizationNo: null
|
|
|
- },
|
|
|
- items: []
|
|
|
+ getAccumulatePointStatisticsSummary
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapGetters(['organizationTree']),
|
|
|
- searchItems () {
|
|
|
- return [
|
|
|
- {
|
|
|
- label: '机构',
|
|
|
- type: 'cascader',
|
|
|
- prop: 'parentOrganizationNo',
|
|
|
- options: {
|
|
|
- filterable: true,
|
|
|
- clearable: true,
|
|
|
- placeholder: '请选择机构',
|
|
|
- options: this.organizationTree,
|
|
|
- showAllLevels: false,
|
|
|
- props: {
|
|
|
- emitPath: false,
|
|
|
- checkStrictly: true,
|
|
|
- value: 'organizationNo',
|
|
|
- label: 'organizationName',
|
|
|
- children: 'child'
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- this.searchValues.parentOrganizationNo = this.organizationTree[0].organizationNo
|
|
|
- this.onInit()
|
|
|
- },
|
|
|
methods: {
|
|
|
- async onInit () {
|
|
|
- this.loading = true
|
|
|
- try {
|
|
|
- const { data } = await getAccumulatePointStatisticsSummary({
|
|
|
- ...this.searchValues
|
|
|
- })
|
|
|
- this.items = Object.keys(data).map(key => {
|
|
|
- return {
|
|
|
- key,
|
|
|
- value: data[key]
|
|
|
- }
|
|
|
- })
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- } finally {
|
|
|
- this.loading = false
|
|
|
- }
|
|
|
- },
|
|
|
- onSearch () {
|
|
|
- if (this.searchValues.parentOrganizationNo === null) {
|
|
|
- this.searchValues.parentOrganizationNo = this.organizationTree[0].organizationNo
|
|
|
- }
|
|
|
- this.onInit()
|
|
|
+ drillInit (e) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ console.log(e)
|
|
|
+ getAccumulatePointStatisticsTop({
|
|
|
+ organizationNo: e.data.organizationNo
|
|
|
+ }).then(resolve).catch(reject)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|