修改console
This commit is contained in:
parent
8631f01c84
commit
d442499c51
@ -263,19 +263,11 @@ const updateMemberLineOptions = () => {
|
||||
|
||||
// 更新地图配置
|
||||
const updateMapOptions = () => {
|
||||
console.log('更新地图配置,当前数据:', mapData)
|
||||
|
||||
const maxValue = mapData.mapData.length > 0
|
||||
? Math.max(...mapData.mapData.map(d => d.value), 10)
|
||||
: 10
|
||||
|
||||
console.log('地图数据:', mapData.mapData)
|
||||
console.log('散点数据:', mapData.scatterData)
|
||||
console.log('最大值:', maxValue)
|
||||
|
||||
// 处理散点数据,确保格式正确
|
||||
const processedScatterData = mapData.scatterData.map(item => {
|
||||
console.log('处理散点数据项:', item)
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.value,
|
||||
@ -283,8 +275,6 @@ const updateMapOptions = () => {
|
||||
}
|
||||
})
|
||||
|
||||
console.log('处理后的散点数据:', processedScatterData)
|
||||
|
||||
mapOptions.value = {
|
||||
geo: {
|
||||
map: 'china',
|
||||
@ -379,7 +369,6 @@ const updateMapOptions = () => {
|
||||
]
|
||||
}
|
||||
|
||||
console.log('地图配置已更新:', mapOptions.value)
|
||||
}
|
||||
|
||||
// 地图点击事件(弹窗显示设备数)
|
||||
@ -424,30 +413,20 @@ onMounted(async () => {
|
||||
// 注册中国地图
|
||||
// @ts-ignore
|
||||
echarts.registerMap('china', chinaJson)
|
||||
|
||||
// 初始化所有数据
|
||||
await initAllData()
|
||||
|
||||
// 绑定地图点击事件
|
||||
setTimeout(() => {
|
||||
// 查找所有ECharts实例,第一个应该是地图(因为它在模板中的位置)
|
||||
const allCharts = document.querySelectorAll('.v-echart')
|
||||
console.log('找到的ECharts元素数量:', allCharts.length)
|
||||
|
||||
if (allCharts.length > 0) {
|
||||
// 第一个ECharts实例应该是设备分布地图
|
||||
const mapChart = allCharts[0]
|
||||
console.log('地图DOM元素:', mapChart)
|
||||
|
||||
// @ts-ignore
|
||||
const chart = echarts.getInstanceByDom(mapChart)
|
||||
console.log('ECharts实例:', chart)
|
||||
if (chart) {
|
||||
chart.on('click', handleMapClick)
|
||||
console.log('地图点击事件已绑定')
|
||||
}
|
||||
} else {
|
||||
console.log('未找到任何ECharts实例')
|
||||
}
|
||||
}, 1000) // 增加延迟时间,确保地图已渲染
|
||||
})
|
||||
|
@ -72,6 +72,9 @@
|
||||
@action="handleDeviceAction"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="deviceList.length === 0" style="text-align:center; width:100%; padding:40px 0; color:#999;">
|
||||
<el-empty description="暂无设备" />
|
||||
</div>
|
||||
<!-- 分页组件 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
|
@ -150,7 +150,6 @@ const getList = async () => {
|
||||
queryParams.orgid = userProfile.value.dept.orgid
|
||||
}
|
||||
const data = await PersonApi.getPersonPage(queryParams)
|
||||
console.log(data.list)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
@ -121,7 +121,6 @@ const renderChart = () => {
|
||||
// 获取会员注册数量数据(调用PersonApi)
|
||||
const fetchData = async () => {
|
||||
if (!dateRange.value || !dateRange.value[0] || !dateRange.value[1]) return
|
||||
|
||||
const res = await PersonApi.getMemberRegisterCount(dateRange.value[0], dateRange.value[1],userinfo.value.dept.orgid)
|
||||
chartData.value = Array.isArray(res) ? res : []
|
||||
}
|
||||
@ -140,10 +139,8 @@ watch([chartData, chartType], () => {
|
||||
})
|
||||
|
||||
// 默认一周,首次渲染
|
||||
onMounted(() => {
|
||||
getUserProfile().then(res => {
|
||||
userinfo.value = res
|
||||
})
|
||||
onMounted(async () => {
|
||||
userinfo.value = await getUserProfile()
|
||||
fetchData()
|
||||
nextTick(() => {
|
||||
renderChart()
|
||||
|
@ -325,7 +325,6 @@ const fetchData = async () => {
|
||||
params.value.startTime,
|
||||
params.value.endTime
|
||||
)
|
||||
console.log(res)
|
||||
// 处理返回的数据格式
|
||||
if (res && Array.isArray(res)) {
|
||||
chartData.value = res.map((item: any) => {
|
||||
@ -358,8 +357,6 @@ const fetchData = async () => {
|
||||
} else {
|
||||
chartData.value = []
|
||||
}
|
||||
|
||||
console.log('处理后的图表数据:', chartData.value)
|
||||
} catch (error) {
|
||||
console.error('获取回访统计数据失败:', error)
|
||||
chartData.value = []
|
||||
|
Loading…
Reference in New Issue
Block a user