Commit c41da077 by xinla

删除智能表单-统计-省的市区统计图(直辖市问题)

修复智能表单-统计-饼图数据、省地图数据,用户统计问题
1 parent 66b315dd
...@@ -30,7 +30,7 @@ export function insertInfoToSurvey(data) { ...@@ -30,7 +30,7 @@ export function insertInfoToSurvey(data) {
return request({ return request({
url: service + '/survey/add', url: service + '/survey/add',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -39,7 +39,7 @@ export function surveyList(data) { ...@@ -39,7 +39,7 @@ export function surveyList(data) {
return request({ return request({
url: service + '/survey/list', url: service + '/survey/list',
method: 'GET', method: 'GET',
params: data params: data,
}) })
} }
...@@ -47,7 +47,7 @@ export function surveyList(data) { ...@@ -47,7 +47,7 @@ export function surveyList(data) {
export function deleteInfoToSurvey(ids) { export function deleteInfoToSurvey(ids) {
return request({ return request({
url: service + '/survey/delete/' + ids, url: service + '/survey/delete/' + ids,
method: 'DELETE' method: 'DELETE',
}) })
} }
...@@ -55,7 +55,7 @@ export function deleteInfoToSurvey(ids) { ...@@ -55,7 +55,7 @@ export function deleteInfoToSurvey(ids) {
export function selectInfoToSurvey(id) { export function selectInfoToSurvey(id) {
return request({ return request({
url: service + '/survey/getInfo/' + id, url: service + '/survey/getInfo/' + id,
method: 'GET' method: 'GET',
}) })
} }
...@@ -64,7 +64,7 @@ export function submitForm(data) { ...@@ -64,7 +64,7 @@ export function submitForm(data) {
return request({ return request({
url: service + '/answer/add', url: service + '/answer/add',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -73,7 +73,7 @@ export function isCompleteSurvey(data) { ...@@ -73,7 +73,7 @@ export function isCompleteSurvey(data) {
return request({ return request({
url: service + '/answer/isCompleteSurvey', url: service + '/answer/isCompleteSurvey',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -82,7 +82,7 @@ export function insertPieValue(data) { ...@@ -82,7 +82,7 @@ export function insertPieValue(data) {
return request({ return request({
url: service + '/statistic/insertPieValue', url: service + '/statistic/insertPieValue',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -91,7 +91,7 @@ export function updateSurveyStatus(data) { ...@@ -91,7 +91,7 @@ export function updateSurveyStatus(data) {
return request({ return request({
url: service + '/survey/updateStatus', url: service + '/survey/updateStatus',
method: 'put', method: 'put',
data data,
}) })
} }
...@@ -100,7 +100,7 @@ export function getAccessToken(data) { ...@@ -100,7 +100,7 @@ export function getAccessToken(data) {
return request({ return request({
url: service + '/Statistics/getAccessToken' + data, url: service + '/Statistics/getAccessToken' + data,
method: 'get', method: 'get',
data data,
}) })
} }
...@@ -109,7 +109,7 @@ export function updateSurveyGroup(data) { ...@@ -109,7 +109,7 @@ export function updateSurveyGroup(data) {
return request({ return request({
url: service + '/updateSurveyGroup', url: service + '/updateSurveyGroup',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -120,7 +120,7 @@ export function selectStatistics(data) { ...@@ -120,7 +120,7 @@ export function selectStatistics(data) {
return request({ return request({
url: service + '/statistic/getStatistics', url: service + '/statistic/getStatistics',
method: 'get', method: 'get',
params: data params: data,
}) })
} }
...@@ -129,7 +129,7 @@ export function lineChart(data) { ...@@ -129,7 +129,7 @@ export function lineChart(data) {
return request({ return request({
url: service + '/statistic/lineChart', url: service + '/statistic/lineChart',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -138,7 +138,7 @@ export function StatisticsDataList(data) { ...@@ -138,7 +138,7 @@ export function StatisticsDataList(data) {
return request({ return request({
url: service + '/statistic/dataList', url: service + '/statistic/dataList',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -147,7 +147,7 @@ export function updateInfoToSurvey(data) { ...@@ -147,7 +147,7 @@ export function updateInfoToSurvey(data) {
return request({ return request({
url: service + '/survey/update', url: service + '/survey/update',
method: 'put', method: 'put',
data data,
}) })
} }
...@@ -156,7 +156,7 @@ export function selectAnswerInfo(data) { ...@@ -156,7 +156,7 @@ export function selectAnswerInfo(data) {
return request({ return request({
url: service + '/answer/getAnswerList', url: service + '/answer/getAnswerList',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -165,7 +165,7 @@ export function pieChart(data) { ...@@ -165,7 +165,7 @@ export function pieChart(data) {
return request({ return request({
url: service + '/statistic/pieChart', url: service + '/statistic/pieChart',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -186,7 +186,7 @@ export function overviewExport(data) { ...@@ -186,7 +186,7 @@ export function overviewExport(data) {
url: service + '/statistic/data/export', url: service + '/statistic/data/export',
method: 'post', method: 'post',
data, data,
responseType: 'blob' responseType: 'blob',
}) })
} }
...@@ -196,7 +196,7 @@ export function answerExport(data) { ...@@ -196,7 +196,7 @@ export function answerExport(data) {
url: service + '/statistic/answer/export', url: service + '/statistic/answer/export',
method: 'get', method: 'get',
params: data, params: data,
responseType: 'blob' responseType: 'blob',
}) })
} }
...@@ -206,7 +206,7 @@ export function userExport(data) { ...@@ -206,7 +206,7 @@ export function userExport(data) {
url: service + '/statistic/user/export', url: service + '/statistic/user/export',
method: 'post', method: 'post',
data, data,
responseType: 'blob' responseType: 'blob',
}) })
} }
...@@ -215,7 +215,7 @@ export function statisticsCustomer(data) { ...@@ -215,7 +215,7 @@ export function statisticsCustomer(data) {
return request({ return request({
url: service + '/statistic/customer', url: service + '/statistic/customer',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -224,7 +224,7 @@ export function areaStatistic(data) { ...@@ -224,7 +224,7 @@ export function areaStatistic(data) {
return request({ return request({
url: service + '/statistic/areaStatistic', url: service + '/statistic/areaStatistic',
method: 'post', method: 'post',
data data,
}) })
} }
...@@ -241,6 +241,14 @@ export function siteStas(data) { ...@@ -241,6 +241,14 @@ export function siteStas(data) {
return request({ return request({
url: service + '/statistic/siteStas', url: service + '/statistic/siteStas',
method: 'post', method: 'post',
data data,
})
}
export function statisticAdd(data) {
return request({
url: service + '/statistic/add',
method: 'post',
data,
}) })
} }
...@@ -204,6 +204,7 @@ import { ...@@ -204,6 +204,7 @@ import {
insertPieValue, insertPieValue,
isCompleteSurvey, isCompleteSurvey,
siteStas, siteStas,
statisticAdd,
} from '@/api/drainageCode/smartForms.js' } from '@/api/drainageCode/smartForms.js'
import { getProvinceCityTree } from '@/utils/index' import { getProvinceCityTree } from '@/utils/index'
// import render from './generator/render' // import render from './generator/render'
...@@ -321,7 +322,6 @@ export default { ...@@ -321,7 +322,6 @@ export default {
}, },
index: { index: {
handler(val) { handler(val) {
console.log('indexxxxxxxxxxxxxxxxxx', val)
if (val == 1) { if (val == 1) {
this.fromList.visibility = 0 this.fromList.visibility = 0
} else { } else {
...@@ -872,6 +872,10 @@ export default { ...@@ -872,6 +872,10 @@ export default {
}, },
async siteStas() { async siteStas() {
if (!['y', 'q'].includes(this.style)) { if (!['y', 'q'].includes(this.style)) {
statisticAdd({
belongId: this.formId,
dataSource: this.dataSource,
})
//智能表单站点统计 PV //智能表单站点统计 PV
try { try {
this.userIp = this.userIp || (await getIP()) this.userIp = this.userIp || (await getIP())
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
</el-table-column> </el-table-column>
<el-table-column label="二维码" align="center" prop="createTime" show-overflow-tooltip> <el-table-column label="二维码" align="center" prop="createTime" show-overflow-tooltip>
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<el-popover placement="bottom" trigger="hover" v-if="eImgList[$index]"> <el-image :src="eImgList[$index]" class="code-image"></el-image>
<!-- <el-popover placement="bottom" trigger="hover" v-if="eImgList[$index]">
<template #reference><el-image :src="eImgList[$index]" class="code-image--small"></el-image></template> <template #reference><el-image :src="eImgList[$index]" class="code-image--small"></el-image></template>
<el-image :src="eImgList[$index]" class="code-image"></el-image> <el-image :src="eImgList[$index]" class="code-image"></el-image>
</el-popover> </el-popover> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="渠道标识" align="center" prop="createTime" show-overflow-tooltip> <el-table-column label="渠道标识" align="center" prop="createTime" show-overflow-tooltip>
...@@ -108,7 +109,7 @@ export default { ...@@ -108,7 +109,7 @@ export default {
console.log('二维码转换内容', that.baseFormUrl4 + '&dataSource=' + that.channelsPathList[w]) console.log('二维码转换内容', that.baseFormUrl4 + '&dataSource=' + that.channelsPathList[w])
QRCode.toDataURL( QRCode.toDataURL(
this.baseFormUrl4 + '&dataSource=' + that.channelsPathList[w], // 需要转换为二维码的内容 this.baseFormUrl4 + '&dataSource=' + that.channelsPathList[w], // 需要转换为二维码的内容
{ width: 150, margin: 4, errorCorrectionLevel: 'H' }, { width: 150, margin: 2, errorCorrectionLevel: 'H' },
).then((url) => (this.eImgList[i] = url)) ).then((url) => (this.eImgList[i] = url))
} }
} }
...@@ -122,11 +123,11 @@ export default { ...@@ -122,11 +123,11 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.code-image { .code-image {
width: 200px; width: 180px;
height: 200px; height: 180px;
}
.code-image--small {
width: 80px;
height: 80px;
} }
// .code-image--small {
// width: 200px;
// height: 200px;
// }
</style> </style>
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
for (let q = 0; q < this.Datas.data.length; q++) { for (let q = 0; q < this.Datas.data.length; q++) {
if (this.Datas.data[q].name.substring(0, 2) == dataList[i].name.substring(0, 2)) { if (this.Datas.data[q].name.substring(0, 2) == dataList[i].name.substring(0, 2)) {
dataList[i].value = this.Datas.data[q].value dataList[i].value = this.Datas.data[q].value
console.log(' dataList[i].value', dataList[i].value) // console.log(' dataList[i].value', dataList[i].value)
if (dataList[i].value > max) { if (dataList[i].value > max) {
max = dataList[i].value max = dataList[i].value
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
</template> </template>
<script> <script>
import * as echarts from 'echarts'
import { areaStatistic } from '@/api/drainageCode/smartForms.js' import { areaStatistic } from '@/api/drainageCode/smartForms.js'
export default { export default {
name: 'province', name: 'province',
...@@ -144,16 +145,16 @@ export default { ...@@ -144,16 +145,16 @@ export default {
// that.baseList= res.data; // that.baseList= res.data;
}) })
}, },
initDate() { async initDate() {
console.log('this.params', this.params) console.log('this.params', this.params)
const provinceName = this.params.ename const provinceName = this.params.ename
const province = this.params.name const province = this.params.name
this.provinceName = provinceName this.provinceName = provinceName
this.provinceJSON = import(`./jsonData/${provinceName}.json`) this.provinceJSON = (await import(`./jsonData/${provinceName}.json`)).default
this.option.title.text = province this.option.title.text = province
this.option.geo.map = province this.option.geo.map = province
this.echartObj = this.$echarts.init(document.getElementById(this.id)) this.echartObj = echarts.init(document.getElementById(this.id))
this.$echarts.registerMap(province, this.provinceJSON) echarts.registerMap(province, this.provinceJSON)
this.echartObj.setOption(this.option) this.echartObj.setOption(this.option)
// this.echartObj.on("click", (params) => { // this.echartObj.on("click", (params) => {
// this.$router.push({ // this.$router.push({
......
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.chart { .chart {
position: relative; position: relative;
height: 100%; max-height: 100%;
min-width: 400px; min-width: 400px;
min-height: 400px; min-height: 400px;
} }
......
...@@ -75,11 +75,11 @@ ...@@ -75,11 +75,11 @@
</div> </div>
<div class="dataStatistics_optionGraph_ul"> <div class="dataStatistics_optionGraph_ul">
<div class="dataStatistics_optionGraph_li" v-for="(item, index) in baseList" :key="index"> <div class="g-card mt0" v-for="(item, index) in baseList" :key="index">
<div style="font-size: 20xp; font-weight: 700">{{ item.label }}</div> <div class="g-card-title">{{ item.label }}</div>
<PieChart style="height: 300px" :Data="item"></PieChart> <PieChart :Data="item"></PieChart>
</div> </div>
<div class="dataStatistics_optionGraph_li" v-for="(item, index) in baseListMap" :key="index"> <!-- <div class="" v-for="(item, index) in baseListMap" :key="index">
<div style="font-size: 20xp; font-weight: 700">{{ item.label }}</div> <div style="font-size: 20xp; font-weight: 700">{{ item.label }}</div>
<div <div
style="margin-left: 30%; font-weight: 700; font-size: 22px; cursor: pointer" style="margin-left: 30%; font-weight: 700; font-size: 22px; cursor: pointer"
...@@ -93,7 +93,11 @@ ...@@ -93,7 +93,11 @@
<div v-if="item.hidden == 2" @click="btnFparams(item, index)"> <div v-if="item.hidden == 2" @click="btnFparams(item, index)">
<MarketMap :params="item.params"></MarketMap> <MarketMap :params="item.params"></MarketMap>
</div> </div>
</div> </div> -->
</div>
<div class="g-card" v-if="baseListMap.label">
<div class="g-card-title">{{ baseListMap.label }}</div>
<ChinaMap style="height: 600px" :Datas="baseListMap"></ChinaMap>
</div> </div>
</div> </div>
</template> </template>
...@@ -101,8 +105,8 @@ ...@@ -101,8 +105,8 @@
<script> <script>
import PieChart from '../components/PieChart.vue' import PieChart from '../components/PieChart.vue'
import ChinaMap from '../components/ChinaMap.vue' import ChinaMap from '../components/ChinaMap.vue'
import MarketMap from '../components/MarketMap.vue' // import MarketMap from '../components/MarketMap.vue'
import { getProvinceCityTree } from '@/utils/index' // import { getProvinceCityTree } from '@/utils/index'
import { selectAnswerInfo, areaStatistic, pieChart, answerExport } from '@/api/drainageCode/smartForms.js' import { selectAnswerInfo, areaStatistic, pieChart, answerExport } from '@/api/drainageCode/smartForms.js'
import SearchTitle from '../components/SearchTitle.vue' import SearchTitle from '../components/SearchTitle.vue'
...@@ -112,7 +116,7 @@ export default { ...@@ -112,7 +116,7 @@ export default {
SearchTitle, SearchTitle,
PieChart, PieChart,
ChinaMap, ChinaMap,
MarketMap, // MarketMap,
}, },
data() { data() {
return { return {
...@@ -124,7 +128,7 @@ export default { ...@@ -124,7 +128,7 @@ export default {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
}, },
baseListMap: [], baseListMap: {},
tableList: [], tableList: [],
exportLoading: false, exportLoading: false,
} }
...@@ -134,26 +138,25 @@ export default { ...@@ -134,26 +138,25 @@ export default {
item.hidden = 1 item.hidden = 1
// this.$forceUpdate() // this.$forceUpdate()
}, },
async btnFparams(item, index) { // async btnFparams(item, index) {
console.log('item', item, index) // if (this.params) {
if (this.params) { // item.params = this.params
item.hidden = 2 // item.params.formId = this.formId
item.params = this.params // let regionalLinkage = await getProvinceCityTree()
item.params.formId = this.formId // for (let i = 0; i < regionalLinkage.length; i++) {
let regionalLinkage = await getProvinceCityTree() // if (regionalLinkage[i].name.substring(0, 2) == item.params.name.substring(0, 2)) {
for (let i = 0; i < regionalLinkage.length; i++) { // item.params.parentCode = regionalLinkage[i].id
if (regionalLinkage[i].label.substring(0, 2) == item.params.name.substring(0, 2)) { // }
item.params.parentCode = regionalLinkage[i].id // }
} // item.hidden = 2
} // this.params = ''
this.params = '' // // this.$forceUpdate()
// this.$forceUpdate() // }
} // },
}, // Fparams(data) {
Fparams(data) { // this.params = data.data
this.params = data.data // console.log('点击返回值', data.data)
console.log('点击返回值', data.data) // },
},
exportFn() { exportFn() {
this.$confirm('确认导出吗?', '提示', { this.$confirm('确认导出吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -192,8 +195,7 @@ export default { ...@@ -192,8 +195,7 @@ export default {
formId: this.formId, formId: this.formId,
} }
pieChart(data).then((res) => { pieChart(data).then((res) => {
console.log('扇形统计图返回值', res) // console.log('扇形统计图返回值', res)
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
let optionss = [] let optionss = []
for (let q = 0; q < res.data[i].data.length; q++) { for (let q = 0; q < res.data[i].data.length; q++) {
...@@ -274,20 +276,23 @@ export default { ...@@ -274,20 +276,23 @@ export default {
areaStatisticF(data) { areaStatisticF(data) {
areaStatistic(data).then((res) => { areaStatistic(data).then((res) => {
// console.log('地图统计图返回值', res) // console.log('地图统计图返回值', res)
// res =[{data:[{name,value}],label:''},{data:[{name,value}],label:''} // res = [{data:[{name,value}],label:''},{data:[{name,value}],label:''}
let _data = res.data[0].data let _data = res.data[0].data
let cities = res.data.map((e) => e.data.find((e2) => e2.value)) let cities = res.data.map((e) => e.data.find((e2) => e2.value))
cities.forEach((element) => { cities.forEach((element) => {
let city = _data.find((e) => element.name === e.name) let city = _data.find((e) => element.name === e.name)
Object.assign(city, element) Object.assign(city, element)
}) })
this.baseListMap = [ this.baseListMap = {
{ data: _data,
data: _data, label: res.data[0].label,
label: res.data[0].label, hidden: 1,
hidden: 1, }
}, // this.baseListMap = [{
] // data: _data,
// label: res.data[0].label,
// hidden: 1,
// }]
// for (let i = 0; i < this.baseListMap.length; i++) { // for (let i = 0; i < this.baseListMap.length; i++) {
// this.baseListMap[i].hidden = 1 // this.baseListMap[i].hidden = 1
// } // }
...@@ -326,15 +331,9 @@ export default { ...@@ -326,15 +331,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.dataStatistics_optionGraph_ul { .dataStatistics_optionGraph_ul {
margin-top: 30px; margin-top: var(--card-margin);
display: flex; display: grid;
justify-content: space-between; grid: auto/1fr 1fr;
flex-wrap: wrap; gap: var(--card-margin);
.dataStatistics_optionGraph_li {
margin-bottom: 10px;
width: 49.6%;
background: var(--bg-white);
padding: 30px;
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!