修改委托招聘服务协议图片展示处理
This commit is contained in:
@ -5,9 +5,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
// Vue 3 Composition API 的 setup 语法糖
|
// Vue 3 Composition API 的 setup 语法糖
|
||||||
// 在这里直接编写响应式数据和方法,无需返回
|
// 在这里直接编写响应式数据和方法,无需返回
|
||||||
import { ref, reactive, computed, onMounted } 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
|
||||||
const option = {
|
const option = {
|
||||||
// 添加标题
|
// 添加标题
|
||||||
title: {
|
title: {
|
||||||
@ -92,14 +93,29 @@ const option = {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 处理图表重绘
|
||||||
|
function handleChartResize() {
|
||||||
|
if (chart) {
|
||||||
|
// 先重置图表尺寸
|
||||||
|
chart.resize()
|
||||||
|
|
||||||
|
chart.setOption(option, { notMerge: false, lazyUpdate: true })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (enterpriseTwoRef.value) {
|
if (enterpriseTwoRef.value) {
|
||||||
const chart = echarts.init(enterpriseTwoRef.value);
|
chart = echarts.init(enterpriseTwoRef.value);
|
||||||
// 设置option
|
// 设置option
|
||||||
chart.setOption(option);
|
chart.setOption(option);
|
||||||
}
|
}
|
||||||
|
window.addEventListener('resize', handleChartResize)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener('resize', handleChartResize);
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, computed, onMounted } from "vue";
|
import { ref, reactive, computed, onMounted, onUnmounted } from "vue";
|
||||||
// 引入Echarts
|
// 引入Echarts
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import 'echarts-gl';
|
import 'echarts-gl';
|
||||||
@ -16,6 +16,7 @@ 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元素
|
// 获取地图DOM元素
|
||||||
let map = ref();
|
let map = ref();
|
||||||
|
let myMap = null;
|
||||||
// 注册崇州地图
|
// 注册崇州地图
|
||||||
echarts.registerMap("sichuan", sichuanJSON);
|
echarts.registerMap("sichuan", sichuanJSON);
|
||||||
const initialPoints = [
|
const initialPoints = [
|
||||||
@ -94,12 +95,28 @@ let option = {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 处理图表重绘
|
||||||
|
function handleChartResize() {
|
||||||
|
if (myMap) {
|
||||||
|
// 先重置图表尺寸
|
||||||
|
myMap.resize()
|
||||||
|
|
||||||
|
myMap.setOption(option, { notMerge: false, lazyUpdate: true })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let myMap = echarts.init(map.value);
|
myMap = echarts.init(map.value);
|
||||||
// 设置配置项
|
// 设置配置项
|
||||||
myMap.setOption(option);
|
myMap.setOption(option);
|
||||||
|
|
||||||
|
window.addEventListener('resize', handleChartResize)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener('resize', handleChartResize);
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
:autoplay="true"
|
:autoplay="true"
|
||||||
>
|
>
|
||||||
<!-- <el-carousel-item><LaborSystemOne /></el-carousel-item> -->
|
<!-- <el-carousel-item><LaborSystemOne /></el-carousel-item> -->
|
||||||
<el-carousel-item><LaborSystemTwo /></el-carousel-item>
|
<el-carousel-item class="isVisibleImg"><LaborSystemTwo /></el-carousel-item>
|
||||||
<!-- <el-carousel-item><LaborSystemThree /></el-carousel-item> -->
|
<!-- <el-carousel-item><LaborSystemThree /></el-carousel-item> -->
|
||||||
<!-- <el-carousel-item><LaborSystemFour /></el-carousel-item> -->
|
<!-- <el-carousel-item><LaborSystemFour /></el-carousel-item> -->
|
||||||
</el-carousel>
|
</el-carousel>
|
||||||
@ -234,6 +234,11 @@ function getWebSocketData() {
|
|||||||
.transition {
|
.transition {
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.isVisibleImg.el-carousel__item {
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.el-carousel {
|
.el-carousel {
|
||||||
margin-top: 0.5vw;
|
margin-top: 0.5vw;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user