Commit 34f3d1cf by xinla

表单饼图,地图统计等问题

1 parent 5bb8b21a
...@@ -501,8 +501,10 @@ export default { ...@@ -501,8 +501,10 @@ export default {
if (q == 0) { if (q == 0) {
cloneCurItem.defaultValue = defaultValue[q] + '' cloneCurItem.defaultValue = defaultValue[q] + ''
} else { } else {
answer.push(that.deepCopy(cloneCurItem)) let _cloneCurItem = that.deepCopy(cloneCurItem)
answer[answer.length - 1].defaultValue = defaultValue[q] + '' _cloneCurItem.defaultValue = defaultValue[q] + ''
answer.push(_cloneCurItem)
btData.push(_cloneCurItem)
} }
} }
} }
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
import * as echarts from 'echarts' import * as echarts from 'echarts'
import chinaJson from './jsonData/china.json' import chinaJson from './jsonData/china.json'
export default { export default {
render: function (createElement) { render: function () {
return createElement('div', { return h('div', {
id: 'main', ref: 'chart',
style: { style: {
height: '550px', 'min-height': '500px',
width: '800px', 'min-width': '200px',
margin: 'auto', margin: 'auto',
}, },
}) })
...@@ -65,8 +65,8 @@ export default { ...@@ -65,8 +65,8 @@ export default {
methods: { methods: {
initEchart() { initEchart() {
let that = this let that = this
console.log('this.Datas', this.Datas.data) // console.log('this.Datas', this.Datas.data)
console.log('this.dataList', this.dataList) // console.log('this.dataList', this.dataList)
let dataList = this.dataList let dataList = this.dataList
let max = 0 let max = 0
for (let i = 0; i < dataList.length; i++) { for (let i = 0; i < dataList.length; i++) {
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
} }
max = max + 5 max = max + 5
const _this = this const _this = this
var myChart = echarts.init(document.getElementById('main')) var myChart = echarts.init(this.$refs.chart)
echarts.registerMap('china', chinaJson) echarts.registerMap('china', chinaJson)
var option = { var option = {
tooltip: { tooltip: {
...@@ -139,6 +139,11 @@ export default { ...@@ -139,6 +139,11 @@ export default {
], ],
} }
myChart.setOption(option) myChart.setOption(option)
new ResizeObserver((entries) => {
myChart.resize()
}).observe(this.$refs.chart)
myChart.on('click', function (params) { myChart.on('click', function (params) {
if (!params.data.ename) { if (!params.data.ename) {
alert('暂无' + params.name + '地图数据') alert('暂无' + params.name + '地图数据')
......
...@@ -66,13 +66,11 @@ ...@@ -66,13 +66,11 @@
<el-table-column label="收集量" align="center" prop="CollectionQuantity" min-width="100" show-overflow-tooltip></el-table-column> <el-table-column label="收集量" align="center" prop="CollectionQuantity" min-width="100" show-overflow-tooltip></el-table-column>
<el-table-column label="平均完成时间" align="center" prop="average" min-width="100" show-overflow-tooltip></el-table-column> --> <el-table-column label="平均完成时间" align="center" prop="average" min-width="100" show-overflow-tooltip></el-table-column> -->
</el-table> </el-table>
<div class="bottom"> <pagination
<pagination :total="total"
:total="total" v-model:page="query.pageNum"
v-model:page="query.pageNum" v-model:limit="query.pageSize"
v-model:limit="query.pageSize" @pagination="getTableChangeSize(query.pageNum, query.pageSize)" />
@pagination="getTableChangeSize(query.pageNum, query.pageSize)" />
</div>
</template> </template>
</div> </div>
...@@ -274,15 +272,26 @@ export default { ...@@ -274,15 +272,26 @@ export default {
}, },
// 地图 // 地图
areaStatisticF(data) { areaStatisticF(data) {
let that = this
console.log('123')
areaStatistic(data).then((res) => { areaStatistic(data).then((res) => {
console.log('地图统计图返回值', res) // console.log('地图统计图返回值', res)
that.baseListMap = res.data // res =[{data:[{name,value}],label:''},{data:[{name,value}],label:''}
for (let i = 0; i < that.baseListMap.length; i++) { let _data = res.data[0].data
that.baseListMap[i].hidden = 1 let cities = res.data.map((e) => e.data.find((e2) => e2.value))
} cities.forEach((element) => {
// that.baseList= res.data; let city = _data.find((e) => element.name === e.name)
Object.assign(city, element)
})
this.baseListMap = [
{
data: _data,
label: res.data[0].label,
hidden: 1,
},
]
// for (let i = 0; i < this.baseListMap.length; i++) {
// this.baseListMap[i].hidden = 1
// }
// this.baseList= res.data;
}) })
}, },
// transDefaultValueToView(data) { // transDefaultValueToView(data) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!