b8d7b673 by zhangmeng

看板

1 parent 2a95d8c5
......@@ -297,7 +297,8 @@ async function handelGetYS004() {
async function handelGetYS005() {
const res = await getYS005()
form.value = res.data
console.log(res)
console.log(form.value.leaderinfo)
}
......@@ -344,27 +345,25 @@ const handelBing1 = (arr1, arr2) => {
type: 'pie',
radius: ['99%', '100%'],
center: ['50%', '60%'],
label: {
show: false
},
emphasis: {
scale: false,
// label: {
// show: true,
// }
},
label: {
show: false,
emphasis: {
show: false
}
},
startAngle: 180,
endAngle: 360,
data: [
{value: 48},
{value: 1},
{value: 48}
],
data: [1],
itemStyle: {
color: 'rgba(1, 162, 237, 1)',
},
barWidth: 2
barWidth: 2,
tooltip: {
trigger: ''
}
},
{
name: '营业收入',
......
<template>
<div class="scrolling-container" @mouseenter="pauseScroll" @mouseleave="resumeScroll">
<div :style="{ transform: `translateY(${offset}px)` }" class="scrolling-content">
<div v-for="(item, index) in dataList" :key="index" class="scrolling-item">
<div v-for="(item, index) in list" :key="index" class="scrolling-item">
<span/> {{ item }}
</div>
<!-- 复制一份数据实现无缝滚动 -->
<div v-for="(item, index) in dataList" :key="`copy-${index}`" class="scrolling-item">
<div v-for="(item, index) in list" :key="`copy-${index}`" class="scrolling-item">
<span/> {{ item }}
</div>
</div>
......@@ -13,7 +13,7 @@
</template>
<script setup>
import {ref, onMounted, onUnmounted} from 'vue';
import {ref, onMounted, onUnmounted, computed} from 'vue';
const props = defineProps({
data: {
......@@ -30,7 +30,8 @@ const props = defineProps({
}
});
const dataList = ref([...props.data] || []);
const list = computed(() => props.data || [])
const offset = ref(0);
const scrollInterval = ref(null);
const isPaused = ref(false);
......@@ -46,7 +47,7 @@ const initScroll = () => {
}
// 重置位置到第一条数据
offset.value = 0;
// 设置定时器
scrollInterval.value = setInterval(() => {
if (!isPaused.value) {
......@@ -75,12 +76,12 @@ onMounted(() => {
const container = document.querySelector('.scrolling-container');
const content = document.querySelector('.scrolling-content');
const firstItem = document.querySelector('.scrolling-item');
if (container && content && firstItem) {
containerHeight.value = container.clientHeight;
contentHeight.value = content.clientHeight;
itemHeight.value = firstItem.clientHeight;
// 如果内容高度小于容器高度,不需要滚动
if (contentHeight.value > containerHeight.value) {
// 初始位置设置为显示第一条数据
......@@ -118,7 +119,7 @@ onUnmounted(() => {
color: #FFFFFF;
height: calc(40 * 100vh / 1920);
margin: calc(8 * 100vw / 1920) 0;
span {
display: inline-block;
width: calc(12 * 100vw / 1920);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!