| | |
| | | }) |
| | | } |
| | | |
| | | 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', |
| | |
| | | </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"> |
| | |
| | | |
| | | <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> |
| | |
| | | <script> |
| | | import { |
| | | getList, |
| | | getLabelCommunityStatistics, |
| | | getLabelStatistics, |
| | | remove, |
| | | add, |
| | | update, |
| | |
| | | } |
| | | |
| | | return { |
| | | labelCommunity: [], |
| | | labelData: [], |
| | | labelForm: {}, |
| | | userHouseLabelVOList: [], |
| | |
| | | } |
| | | }, |
| | | mounted () { |
| | | this.getLabelCount() |
| | | // this.getLabelCount() |
| | | this.setBarEchartsOption() |
| | | }, |
| | | methods: { |
| | |
| | | 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, |
| | |
| | | // length2: 0, |
| | | // maxSurfaceAngle: 80 |
| | | // }, |
| | | series: [ |
| | | { |
| | | series: [{ |
| | | type: 'pie', |
| | | center: ['36%', '50%'], |
| | | radius: '80%', //修改大小 |
| | |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }] |
| | | } |
| | | let myEchart = document.getElementById('echarts') //获取类名 |
| | | let myCharts = echarts.init(myEchart) |
| | |
| | | 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 |
| | |
| | | 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) |
| | | }) |
| | | |
| | | |
| | | } |