linwei
2024-01-25 722dbd941f60279d0b27e32ccf26df6f9ade0842
住房监管
2 files modified
94 ■■■■ changed files
src/api/userHouse/list/house.js 20 ●●●●● patch | view | raw | blame | history
src/views/propertySupervision/houseHoldSupervision.vue 74 ●●●●● patch | view | raw | blame | history
src/api/userHouse/list/house.js
@@ -12,6 +12,26 @@
  })
}
export const getLabelCommunityStatistics = (params) => {
  return request({
    url: '/api/blade-house/house/labelCommunityStatistics',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const getLabelStatistics = (params) => {
  return request({
    url: '/api/blade-house/house/labelStatistics',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const getPageList = (current, size, params) => {
  return request({
    url: '/api/blade-house/house/page',
src/views/propertySupervision/houseHoldSupervision.vue
@@ -13,8 +13,8 @@
        </div>
        <div class="cur-from-box">
            <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
                v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
      <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" v-model="form"
        :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
                :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
                @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
                @refresh-change="refreshChange" @on-load="onLoad">
@@ -53,8 +53,8 @@
        <el-dialog title="标签管理" append-to-body :visible.sync="labelFlag" center width="600px">
            <div id="" class="grid-container2">
                <div class="grid-item" :style="{ backgroundColor: item.color }" v-for="(item, index) in labelData"
                    :key="index" @click="changLabel(item)">
        <div class="grid-item" :style="{ backgroundColor: item.color }" v-for="(item, index) in labelData" :key="index"
          @click="changLabel(item)">
                    {{ item.name }}
                </div>
            </div>
@@ -92,6 +92,8 @@
<script>
import {
    getList,
    getLabelCommunityStatistics,
    getLabelStatistics,
    remove,
    add,
    update,
@@ -152,6 +154,7 @@
        }
        return {
        labelCommunity: [],
            labelData: [],
            labelForm: {},
            userHouseLabelVOList: [],
@@ -518,7 +521,7 @@
        }
    },
    mounted () {
        this.getLabelCount()
      // this.getLabelCount()
        this.setBarEchartsOption()
    },
    methods: {
@@ -774,6 +777,18 @@
        onLoad (page, params = {}) {
            this.loading = true
            this.query.parentId = 1001
        getLabelCommunityStatistics(Object.assign(params, this.query)).then(res => {
          this.labelCommunity = res.data.data
          this.$nextTick(() => {
            this.setBarEchartsOption(res.data.data)
          })
        })
        getLabelStatistics(Object.assign(params, this.query)).then(res => {
          this.labelCommunity = res.data.data
          this.$nextTick(() => {
            this.setEchartsOption(res.data.data)
          })
        })
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = {
                    ...res.data.data,
@@ -836,8 +851,7 @@
                //   length2: 0,
                //   maxSurfaceAngle: 80
                // },
                series: [
                    {
          series: [{
                        type: 'pie',
                        center: ['36%', '50%'],
                        radius: '80%',  //修改大小
@@ -849,8 +863,7 @@
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
          }]
            }
            let myEchart = document.getElementById('echarts') //获取类名
            let myCharts = echarts.init(myEchart)
@@ -861,16 +874,16 @@
                    id: data[i].id
                })
                option && myCharts.setOption(option)
        }
                myCharts.on('click', (params) => {
                    console.log(params)
                    this.query.labelId = params.data.id
                    this.onLoad(this.page, this.query)
                })
            }
        },
        setBarEchartsOption () {
      setBarEchartsOption(data) {
        console.log(JSON.stringify(data))
            var chartDom = document.getElementById('bar-echarts')
            var myChart = echarts.init(chartDom)
            var option
@@ -888,31 +901,36 @@
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: [
                    {
          xAxis: [{
                        type: 'category',
                        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
            data: [],
                        axisTick: {
                            alignWithLabel: true
                        }
                    }
                ],
                yAxis: [
                    {
          }],
          yAxis: [{
                        type: 'value'
                    }
                ],
                series: [
                    {
                        name: 'Direct',
          }],
          series: [{
            name: '数量',
                        type: 'bar',
                        barWidth: '60%',
                        data: [10, 52, 200, 334, 390, 330, 220]
                    }
                ]
            barWidth: '50%',
            data: []
          }]
            }
        // option && myChart.setOption(option)
        for (let i = 0, ii = data.length; i < ii; i++) {
          option.xAxis[0].data.push(data[i].name)
          option.series[0].data.push(data[i].counts)
            option && myChart.setOption(option)
        }
        myChart.on('click', (params) => {
          console.log(params)
          this.query.neiName = params.data.name
          this.onLoad(this.page, this.query)
        })
        }