推送
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
<li class="center-item" v-for="(it,idx) in centerList" :key="idx">
|
<li class="center-item" v-for="(it,idx) in centerList" :key="idx">
|
||||||
<div class="label">{{it.label}}</div>
|
<div class="label">{{it.label}}</div>
|
||||||
<div class="count">
|
<div class="count">
|
||||||
<Statis :count="it.num" :height="86" :len="2" bg="countBg" />
|
<Statis :count="it.num" :height="86" :len="2" bg="countBg" />
|
||||||
<span class="num">( {{it.dw}} )</span>
|
<span class="num">( {{it.dw}} )</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -135,7 +135,7 @@ onMounted(()=>{
|
|||||||
font-size: 1.563vw;
|
font-size: 1.563vw;
|
||||||
width: 1.458vw;
|
width: 1.458vw;
|
||||||
height: 2.24vw;
|
height: 2.24vw;
|
||||||
line-height: 2.24vw;
|
line-height: 2.24vw;
|
||||||
background: url('~@/assets/images/bg_01.png') no-repeat center center;
|
background: url('~@/assets/images/bg_01.png') no-repeat center center;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
color: #0DE0FF;
|
color: #0DE0FF;
|
||||||
@ -345,4 +345,4 @@ onMounted(()=>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -3,34 +3,54 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
// Vue 3 Composition API 的 setup 语法糖
|
import { ref, onMounted, onUnmounted, nextTick } from "vue";
|
||||||
// 在这里直接编写响应式数据和方法,无需返回
|
|
||||||
import { ref, reactive, computed, onMounted, onUnmounted } from "vue";
|
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
|
|
||||||
const enterpriseTwoRef = ref(null);
|
const enterpriseTwoRef = ref(null);
|
||||||
let chart = null
|
let chart = null;
|
||||||
const option = {
|
|
||||||
// 添加标题
|
// 响应式设计稿配置
|
||||||
|
const designConfig = {
|
||||||
|
designWidth: 1920,
|
||||||
|
designHeight: 1080
|
||||||
|
};
|
||||||
|
|
||||||
|
// 计算实际的像素值(基于设计稿比例)
|
||||||
|
function calcResponsivePX(pxValue) {
|
||||||
|
const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
||||||
|
return (pxValue / designConfig.designWidth) * screenWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算 vw 单位值(真正的 vw)
|
||||||
|
function calcVW(pxValue) {
|
||||||
|
return (pxValue / designConfig.designWidth) * 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算 vh 单位值
|
||||||
|
function calcVH(pxValue) {
|
||||||
|
return (pxValue / designConfig.designHeight) * 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 图表配置
|
||||||
|
const getChartOption = () => ({
|
||||||
title: {
|
title: {
|
||||||
text: '重点保供企业分布',
|
text: '重点保供企业分布',
|
||||||
left: 'center',
|
left: 'center',
|
||||||
top: '5%',
|
top: '5%',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#30DCFF',
|
color: '#30DCFF',
|
||||||
fontSize: 16,
|
fontSize: calcResponsivePX(16),
|
||||||
fontWeight: 'normal'
|
fontWeight: 'normal'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 设置图形位置
|
|
||||||
grid: {
|
grid: {
|
||||||
top: '20%',
|
top: `${calcVH(210)}%`, // 使用 vh 确保垂直方向也响应式
|
||||||
left: '15%',
|
left: `${calcVW(130)}%`,
|
||||||
right: '5%',
|
right: `${calcVW(120)}%`,
|
||||||
bottom: '25%'
|
bottom: `${calcVH(170)}%`
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
show: true,
|
show: true,
|
||||||
|
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
@ -38,17 +58,19 @@ const option = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: 14,
|
fontSize: calcResponsivePX(12),
|
||||||
color: '#CBF2FA',
|
color: '#CBF2FA',
|
||||||
rotate: 0,
|
rotate: 0,
|
||||||
margin: 15
|
show: true,
|
||||||
|
interval: 0,
|
||||||
|
hideOverlap: false,
|
||||||
|
margin: calcResponsivePX(14)
|
||||||
},
|
},
|
||||||
type: "category",
|
type: "category",
|
||||||
data: ["第一产业", "第二产业", "第三产业"]
|
data: ["第一产业", "第二产业", "第三产业"]
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
interval: 50, // 设置刻度间隔
|
interval: 50,
|
||||||
//显示网格线
|
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
@ -73,49 +95,54 @@ const option = {
|
|||||||
name: "企业数",
|
name: "企业数",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
showBackground: false,
|
showBackground: false,
|
||||||
barWidth: 25,
|
barWidth: calcResponsivePX(25), // 柱状图宽度也要响应式
|
||||||
data: [6, 581, 41],
|
data: [6, 581, 41],
|
||||||
// 设置柱状图的数值
|
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: "top",
|
position: "top",
|
||||||
color: '#30DCFF',
|
color: '#30DCFF',
|
||||||
fontSize: 14,
|
fontSize: calcResponsivePX(14),
|
||||||
formatter: function(params) {
|
formatter: function(params) {
|
||||||
return params.value + '家';
|
return params.value + '家';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
//纯色
|
|
||||||
color: '#30DCFF'
|
color: '#30DCFF'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
});
|
||||||
|
|
||||||
// 处理图表重绘
|
// 处理图表重绘
|
||||||
function handleChartResize() {
|
const handleChartResize = () => {
|
||||||
if (chart) {
|
if (chart) {
|
||||||
// 先重置图表尺寸
|
chart.resize();
|
||||||
chart.resize()
|
// 重新设置选项以更新所有响应式尺寸
|
||||||
|
chart.setOption(getChartOption(), true); // true 表示不合并,完全替换
|
||||||
chart.setOption(option, { notMerge: false, lazyUpdate: true })
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
// 初始化图表
|
||||||
|
const initChart = () => {
|
||||||
|
if (!enterpriseTwoRef.value) return;
|
||||||
|
|
||||||
|
chart = echarts.init(enterpriseTwoRef.value);
|
||||||
|
chart.setOption(getChartOption());
|
||||||
|
};
|
||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (enterpriseTwoRef.value) {
|
nextTick(() => {
|
||||||
chart = echarts.init(enterpriseTwoRef.value);
|
initChart();
|
||||||
// 设置option
|
});
|
||||||
chart.setOption(option);
|
window.addEventListener('resize', handleChartResize);
|
||||||
}
|
|
||||||
window.addEventListener('resize', handleChartResize)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
window.removeEventListener('resize', handleChartResize);
|
window.removeEventListener('resize', handleChartResize);
|
||||||
})
|
if (chart) {
|
||||||
|
chart.dispose();
|
||||||
|
chart = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
|
|||||||
@ -6,19 +6,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, computed, onMounted, onUnmounted } from "vue";
|
import { ref, onMounted, onUnmounted, nextTick } from "vue";
|
||||||
// 引入Echarts
|
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import 'echarts-gl';
|
import 'echarts-gl';
|
||||||
// 引入崇州市地图json数据
|
import { debounce } from 'lodash';
|
||||||
|
|
||||||
|
// 引入地图数据
|
||||||
import sichuanJSON from "@/assets/json/sichuan.json";
|
import sichuanJSON from "@/assets/json/sichuan.json";
|
||||||
// 引入本地撒点图片
|
|
||||||
import pointImage from "@/assets/images/recruitment/map-point1.png";
|
import pointImage from "@/assets/images/recruitment/map-point1.png";
|
||||||
// 获取地图DOM元素
|
|
||||||
let map = ref();
|
// DOM 引用
|
||||||
|
const map = ref();
|
||||||
let myMap = null;
|
let myMap = null;
|
||||||
// 注册崇州地图
|
|
||||||
|
// 注册地图
|
||||||
echarts.registerMap("sichuan", sichuanJSON);
|
echarts.registerMap("sichuan", sichuanJSON);
|
||||||
|
|
||||||
|
// 响应式设计配置
|
||||||
|
const designConfig = {
|
||||||
|
designWidth: 1920,
|
||||||
|
designHeight: 1080
|
||||||
|
};
|
||||||
|
|
||||||
|
// 计算响应式尺寸
|
||||||
|
const calcResponsivePX = (pxValue) => {
|
||||||
|
const screenWidth = window.innerWidth || document.documentElement.clientWidth;
|
||||||
|
return (pxValue / designConfig.designWidth) * screenWidth;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 初始点位数据
|
||||||
const initialPoints = [
|
const initialPoints = [
|
||||||
{ name: "攀枝花", value: [101.718, 26.582, 0], count: 0 },
|
{ name: "攀枝花", value: [101.718, 26.582, 0], count: 0 },
|
||||||
{ name: "雅安", value: [103.009, 29.988, 0], count: 0 },
|
{ name: "雅安", value: [103.009, 29.988, 0], count: 0 },
|
||||||
@ -35,11 +51,12 @@ const initialPoints = [
|
|||||||
{ name: "达州", value: [107.467, 31.209, 0], count: 0 },
|
{ name: "达州", value: [107.467, 31.209, 0], count: 0 },
|
||||||
{ name: "南充", value: [106.110, 30.837, 0], count: 0 }
|
{ name: "南充", value: [106.110, 30.837, 0], count: 0 }
|
||||||
];
|
];
|
||||||
// 地图参数设置
|
|
||||||
let option = {
|
// 获取动态配置
|
||||||
|
const getChartOption = () => ({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "item",
|
trigger: "item",
|
||||||
formatter: function (params) {
|
formatter: (params) => {
|
||||||
if (params.seriesType === "scatter3D") {
|
if (params.seriesType === "scatter3D") {
|
||||||
return `${params.name}<br/>合作社数量:${params.data.count || 0}`;
|
return `${params.name}<br/>合作社数量:${params.data.count || 0}`;
|
||||||
}
|
}
|
||||||
@ -55,27 +72,37 @@ let option = {
|
|||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
color: "#CBF2FA",
|
color: "#CBF2FA",
|
||||||
fontSize: 12,
|
fontSize: calcResponsivePX(10),
|
||||||
fontWeight: "bold"
|
fontWeight: "bold"
|
||||||
},
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: "rgba(27, 129, 150, 0.4)",
|
color: "rgba(27, 129, 150, 0.4)",
|
||||||
borderColor: "#61cfff",
|
borderColor: "#61cfff",
|
||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
opacity: 0.75
|
opacity: 0.75
|
||||||
},
|
},
|
||||||
emphasis: {
|
emphasis: {
|
||||||
itemStyle: { color: "rgba(27, 129, 150, 0.65)", opacity: 0.85 },
|
itemStyle: { color: "rgba(27, 129, 150, 0.65)", opacity: 0.85 },
|
||||||
label: { color: "#ffff00" }
|
label: { color: "#ffff00" }
|
||||||
},
|
},
|
||||||
light: {
|
light: {
|
||||||
main: { intensity: 1.6, shadow: true, shadowQuality: "high", alpha: 35, beta: 15 },
|
main: { intensity: 1.6, shadow: true, shadowQuality: "high", alpha: 35, beta: 15 },
|
||||||
ambient: { intensity: 0.35 }
|
ambient: { intensity: 0.35 }
|
||||||
},
|
},
|
||||||
shading: "lambert",
|
shading: "lambert",
|
||||||
viewControl: { distance: 110, alpha: 45, beta: 10 },
|
viewControl: {
|
||||||
|
distance: 110,
|
||||||
|
alpha: 45,
|
||||||
|
beta: 10,
|
||||||
|
},
|
||||||
groundPlane: { show: false },
|
groundPlane: { show: false },
|
||||||
postEffect: { enable: true, bloom: { enable: true, bloomIntensity: 0.25 } }
|
postEffect: {
|
||||||
|
enable: true,
|
||||||
|
bloom: {
|
||||||
|
enable: true,
|
||||||
|
bloomIntensity: 0.25
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
@ -88,35 +115,54 @@ let option = {
|
|||||||
count: p.count
|
count: p.count
|
||||||
})),
|
})),
|
||||||
symbol: "triangle",
|
symbol: "triangle",
|
||||||
symbolSize: 12,
|
symbolSize: calcResponsivePX(12),
|
||||||
itemStyle: { color: "#FFBE34" },
|
itemStyle: { color: "#FFBE34" },
|
||||||
label: { show: false }
|
label: { show: false }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
});
|
||||||
|
|
||||||
// 处理图表重绘
|
// 处理图表重绘(防抖优化)
|
||||||
function handleChartResize() {
|
const handleChartResize = debounce(() => {
|
||||||
if (myMap) {
|
if (myMap) {
|
||||||
// 先重置图表尺寸
|
myMap.resize();
|
||||||
myMap.resize()
|
// 重新设置配置以更新响应式尺寸
|
||||||
|
myMap.setOption(getChartOption(), true);
|
||||||
myMap.setOption(option, { notMerge: false, lazyUpdate: true })
|
|
||||||
}
|
}
|
||||||
}
|
}, 300);
|
||||||
|
|
||||||
|
// 初始化图表
|
||||||
|
const initChart = () => {
|
||||||
|
if (!map.value) return;
|
||||||
|
|
||||||
|
myMap = echarts.init(map.value);
|
||||||
|
myMap.setOption(getChartOption());
|
||||||
|
|
||||||
|
// 添加点击事件(可选)
|
||||||
|
myMap.on('click', (params) => {
|
||||||
|
if (params.componentType === 'series' && params.seriesType === 'scatter3D') {
|
||||||
|
console.log('点击了城市:', params.name);
|
||||||
|
// 可以在这里添加点击后的业务逻辑
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
myMap = echarts.init(map.value);
|
nextTick(() => {
|
||||||
// 设置配置项
|
initChart();
|
||||||
myMap.setOption(option);
|
});
|
||||||
|
|
||||||
window.addEventListener('resize', handleChartResize)
|
window.addEventListener('resize', handleChartResize);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
window.removeEventListener('resize', handleChartResize);
|
window.removeEventListener('resize', handleChartResize);
|
||||||
})
|
if (myMap) {
|
||||||
|
myMap.dispose();
|
||||||
|
myMap = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -79,6 +79,9 @@
|
|||||||
:type1="cardThreeInfo.type1"
|
:type1="cardThreeInfo.type1"
|
||||||
:type2="cardThreeInfo.type2"
|
:type2="cardThreeInfo.type2"
|
||||||
>
|
>
|
||||||
|
<template v-slot:header>
|
||||||
|
<div class="header_bg" style="margin-top:1vw">近2个月保供比亚迪入职人员分析</div>
|
||||||
|
</template>
|
||||||
<ListView/>
|
<ListView/>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -281,7 +281,7 @@ const modelSets = {
|
|||||||
{ num: "628个", label: "服务企业" },
|
{ num: "628个", label: "服务企业" },
|
||||||
{ num: "36所", label: "合作学校" },
|
{ num: "36所", label: "合作学校" },
|
||||||
{ num: "19个", label: "合作区县" },
|
{ num: "19个", label: "合作区县" },
|
||||||
{ num: "17期", label: "培训课程" },
|
{ num: "9000+", label: "培训人次" },
|
||||||
{ num: "870人", label: "领证人数" }
|
{ num: "870人", label: "领证人数" }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@ -308,19 +308,19 @@ const statisticData = ref([
|
|||||||
{
|
{
|
||||||
imgURL: tongjiPxjg,
|
imgURL: tongjiPxjg,
|
||||||
title: "博士",
|
title: "博士",
|
||||||
count: "133",
|
count: "40",
|
||||||
unit: "人"
|
unit: "人"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgURL: tongjiPxjg,
|
imgURL: tongjiPxjg,
|
||||||
title: "硕士",
|
title: "硕士",
|
||||||
count: "1012",
|
count: "1213",
|
||||||
unit: "人"
|
unit: "人"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imgURL: tongjiPxjg,
|
imgURL: tongjiPxjg,
|
||||||
title: "本科",
|
title: "本科",
|
||||||
count: "20792",
|
count: "21788",
|
||||||
unit: "人"
|
unit: "人"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user