Compare commits

...

4 Commits

23 changed files with 155 additions and 251 deletions

View File

@ -18,4 +18,5 @@ const size = computed(() => SettingStore.themeConfig.globalComSize);
</script> </script>
<style lang="scss"> <style lang="scss">
@import './styles/style'; @import './styles/style';
@import './assets/fonts/font.css';
</style> </style>

Binary file not shown.

Binary file not shown.

15
src/assets/fonts/font.css Normal file
View File

@ -0,0 +1,15 @@
@font-face {
font-family: 'JinBuTi';
/* 自定义字体名称 */
src: url('./DingTalk JinBuTi.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Sans';
/* 自定义字体名称 */
src: url('./DingTalk Sans.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -3,55 +3,7 @@
<div class="data-warp" :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/screenbg.png') + ')' }"> <div class="data-warp" :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/screenbg.png') + ')' }">
<div class="chart-content"> <div class="chart-content">
<div class="top"> <div class="top">
<slot v-if="$slots.top" name="top"></slot> <custom-scroll-title :titles="titles" @change-title="handleChangeTitle" />
<!--:style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/hraderbg.png') + ')' }" -->
<div v-else class="top-content-warp">
<div class="top-left"></div>
<div class="top-content">
<div class="top-content-p">
<div class="b-nav-l">
<template v-for="(n, indexn) in navlist" :key="n.name">
<div
v-if="indexn <= 3"
class="b-nav-item"
:style="{
'background-image':
'url(' +
(currentName == n.name ? getAssetsFile('images/vsualized/home/nav-on.png') : getAssetsFile('images/vsualized/home/nav.png')) +
')',
}"
:class="currentName == n.name ? 'nav-act' : 'nav-normal'"
@click="itemAct(n.name)"
>
<span>{{ n.title }}</span>
</div>
</template>
</div>
<!-- <div class="title txt-ellipsis clamp1">{{ topTitle }}</div> -->
<div class="title txt-ellipsis clamp1">{{ '农业产业政务云平台' }}</div>
<div class="b-nav-r">
<template v-for="(m, indexm) in navlist" :key="m.name">
<div
v-if="indexm > 3"
class="b-nav-item"
:style="{
'background-image':
'url(' +
(currentName == m.name ? getAssetsFile('images/vsualized/home/nav-on.png') : getAssetsFile('images/vsualized/home/nav.png')) +
')',
}"
:class="currentName == m.name ? 'nav-act' : 'nav-normal'"
@click="itemAct(m.name)"
>
<span>{{ m.title }}</span>
</div>
</template>
</div>
</div>
</div>
<!-- <div class="top-right">{{ currentTime }}</div> -->
</div>
</div> </div>
<div class="content"> <div class="content">
<slot name="center"></slot> <slot name="center"></slot>
@ -60,10 +12,9 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { isEmpty, getAssetsFile } from '@/utils'; import { getAssetsFile } from '@/utils';
import { ref, reactive, onMounted, watch, onUnmounted } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useApp } from '@/hooks';
const router = useRouter(); const router = useRouter();
const props = defineProps({ const props = defineProps({
nameVal: { nameVal: {
@ -76,34 +27,19 @@ const props = defineProps({
}, },
}); });
const navlist = ref([ const titles = ref([
{ title: '首页', name: 'home' }, { label: '首页', value: 'home' },
{ title: '土地资源', name: 'land' }, { label: '土地资源', value: 'land' },
{ title: '投入品', name: 'inputs' }, { label: '投入品', value: 'inputs' },
{ title: '生产经营主体', name: 'entities' }, { label: '生产经营主体', value: 'entities' },
// { title: '', name: 'plant' }, // { label: '', value: 'plant' },
// { title: '', name: 'breed' }, // { label: '', value: 'breed' },
{ title: '全流程溯源', name: 'trace' }, { label: '全流程溯源', value: 'trace' },
{ title: '产业预警决策', name: 'early' }, { label: '产业预警决策', value: 'early' },
]); ]);
function handleChangeTitle(name) {
let currentName = ref('home');
watch(
() => props.nameVal,
() => {
currentName.value = props.nameVal;
},
{
deep: true,
immediate: true,
}
);
const itemAct = (name) => {
currentName.value = name;
router.push({ name: name }); router.push({ name: name });
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
div { div {
@ -121,7 +57,6 @@ div {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
.top,
.content, .content,
.bottom { .bottom {
width: 100%; width: 100%;
@ -132,7 +67,7 @@ div {
justify-content: center; justify-content: center;
} }
.top { .top {
height: 55px; height: 60px;
.top-content-warp { .top-content-warp {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -260,7 +195,7 @@ div {
} }
} }
.content { .content {
height: calc(100% - 60px); height: calc(100% - 70px);
} }
} }
} }

View File

@ -1,7 +1,9 @@
<template> <template>
<section class="header_title" :style="{ '--titleContentW': titleContentW + 'px', '--itemW': itemW + 'px', '--gap': gap + 'px' }"> <section class="header_title" :style="{ '--titleContentW': titleContentW + 'px', '--itemW': itemW + 'px', '--gap': gap + 'px' }">
<el-button icon="el-icon-arrow-left" class="left_btn" @click="handleTitleBtn(1)"></el-button> <el-icon v-if="props.titles.length > 6" icon="el-icon-arrow-left" class="left_btn" @click="handleTitleBtn(1)">
<el-button icon="el-icon-arrow-right" class="right_btn" @click="handleTitleBtn(-1)"></el-button> <ArrowLeftBold />
</el-icon>
<el-icon v-if="props.titles.length > 6" icon="el-icon-arrow-right" class="right_btn" @click="handleTitleBtn(-1)"><ArrowRightBold /></el-icon>
<section class="left_titles_container"> <section class="left_titles_container">
<section class="title_content" :style="{ left: `-${position}px` }"> <section class="title_content" :style="{ left: `-${position}px` }">
<section <section
@ -14,6 +16,7 @@
</section> </section>
</section> </section>
</section> </section>
<section class="sys_name">政务云数字农业智慧大屏</section>
<section class="right_titles_container"> <section class="right_titles_container">
<section class="title_content" :style="{ left: `${right ? right + 'px' : '-' + position + 'px'}` }"> <section class="title_content" :style="{ left: `${right ? right + 'px' : '-' + position + 'px'}` }">
<section <section
@ -31,7 +34,8 @@
<script setup> <script setup>
import { ref, watch, onMounted } from 'vue'; import { ref, watch, onMounted } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
onMounted(() => { onMounted(() => {
handleWidth(); handleWidth();
}); });
@ -41,25 +45,14 @@ const props = defineProps({
type: Array, type: Array,
default() { default() {
return [ return [
{ label: '标题1', value: '1' }, { label: '首页', value: 'home' },
{ label: '标题2', value: '2' }, { label: '土地资源', value: 'land' },
{ label: '标题3', value: '3' }, { label: '投入品', value: 'inputs' },
{ label: '标题4', value: '4' }, { label: '生产经营主体', value: 'entities' },
{ label: '标题5', value: '5' }, // { label: '', value: 'plant' },
{ label: '标题6', value: '6' }, // { label: '', value: 'breed' },
{ label: '标题7', value: '7' }, { label: '全流程溯源', value: 'trace' },
{ label: '标题8', value: '8' }, { label: '产业预警决策', value: 'early' },
{ label: '标题9', value: '9' },
{ label: '标题10', value: '10' },
{ label: '标题11', value: '11' },
{ label: '标题12', value: '12' },
{ label: '标题13', value: '13' },
{ label: '标题14', value: '14' },
{ label: '标题15', value: '15' },
{ label: '标题16', value: '16' },
{ label: '标题17', value: '17' },
{ label: '标题18', value: '18' },
{ label: '标题19', value: '19' },
]; ];
}, },
}, },
@ -78,6 +71,7 @@ watch(
() => props.titles, () => props.titles,
(val) => { (val) => {
if (val && val.length) { if (val && val.length) {
activeTitle.value = val[0].value;
let l = val.length; let l = val.length;
if (l > 6) { if (l > 6) {
leftTitles.value = val.slice(0, l - 3); leftTitles.value = val.slice(0, l - 3);
@ -116,6 +110,7 @@ function handleTitleBtn(t = -1) {
function handleTitleClick(val) { function handleTitleClick(val) {
activeTitle.value = val; activeTitle.value = val;
emit('changeTitle', val); emit('changeTitle', val);
router.push({ name: val });
} }
</script> </script>
@ -130,17 +125,27 @@ function handleTitleClick(val) {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 100vw; width: 100vw;
height: 60px; height: 100%;
// background: url('./headerBG.png') no-repeat center/cover; background: url('../../assets/images/basic/headerBG.png') no-repeat;
background-color: skyblue; background-size: 100% 100%;
.sys_name {
padding-bottom: 8px;
display: flex;
height: 100%;
align-items: center;
justify-content: center;
font-size: 32px;
color: #fff;
font-family: 'JinBuTi';
}
.left_btn, .left_btn,
.right_btn { .right_btn {
position: absolute; position: absolute;
top: 15px; top: 25px;
padding: 6px 6px; padding: 6px 6px;
width: 30px; width: 30px;
height: 30px; height: 30px;
background-color: rgb(39, 172, 255); background-color: rgb(6, 155, 118, 0.5);
border-radius: 8px; border-radius: 8px;
cursor: pointer; cursor: pointer;
z-index: 1; z-index: 1;
@ -158,8 +163,9 @@ function handleTitleClick(val) {
.right_titles_container { .right_titles_container {
position: relative; position: relative;
width: 30%; width: 30%;
height: 60px; height: 100%;
overflow: hidden; overflow: hidden;
line-height: 60px;
.title_content { .title_content {
position: absolute; position: absolute;
top: 10px; top: 10px;
@ -168,10 +174,10 @@ function handleTitleClick(val) {
transition: all 0.4s ease; transition: all 0.4s ease;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: #f5f5f5;
.active { .active {
color: #fff; color: #fff;
text-shadow: 1px 1px 2px red; opacity: 1 !important;
text-shadow: 0px 4px 10px #fff;
} }
.title_item { .title_item {
margin-right: var(--gap); margin-right: var(--gap);
@ -180,12 +186,23 @@ function handleTitleClick(val) {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
// background: url('./titleBG.png') no-repeat center/cover; color: #f5fffe;
background-color: aquamarine;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
background-size: 100% 100%;
opacity: 0.6;
} }
} }
} }
.left_titles_container {
.title_item {
background: url('../../assets/images/basic/leftTitleBG.png') no-repeat;
}
}
.right_titles_container {
.title_item {
background: url('../../assets/images/basic/rightTitleBG.png') no-repeat;
}
}
} }
</style> </style>

View File

@ -1,3 +1,23 @@
<template> <template>
<section class="_contaioner">
<custom-scroll-title class="header_titles" @change-title="handleChangeTitle" />
<section class="_content">
<router-view /> <router-view />
</section>
</section>
</template> </template>
<style lang="scss" scoped>
._contaioner {
box-sizing: border-box;
width: 100vw;
height: 100vh;
background: url('../assets/images/basic/containerBG.png') no-repeat center;
background-size: 100% 100%;
.header_titles {
height: 60px;
}
._content {
height: calc(100vh - 60px);
}
}
</style>

View File

@ -20,7 +20,7 @@ export const constantRoutes = [
path: '/', path: '/',
name: 'layout', name: 'layout',
component: Layout, component: Layout,
redirect: '/home', // redirect: '/home',
meta: { title: '首页', icon: 'House' }, meta: { title: '首页', icon: 'House' },
children: [ children: [
{ {

View File

@ -1,8 +1,5 @@
<template> <template>
<div class="data-home-index"> <div class="data-home-index">
<baseBg ref="homebase" :name-val="'home'" top-title=" ">
<!-- <template #top> </template> -->
<template #center>
<el-row style="width: 100%; height: 100%"> <el-row style="width: 100%; height: 100%">
<el-col :span="6" class="left-charts"> <el-col :span="6" class="left-charts">
<div class="left-charts-item"> <div class="left-charts-item">
@ -54,24 +51,6 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</template>
</baseBg>
<div class="home-index-top-warp">
<div class="home-index-top" :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/home/hometopbg.png') + ')' }">
<div class="home-data-p">
<!-- <h3 class="home-title">耿马县农产品销售情况</h3> -->
<div class="home-data-top">1284.624</div>
<div class="home-data-contrast">
<span class="tips">同比去年</span>
<span class="value">4684.629</span>
<el-icon style="vertical-align: middle" class="contrast-icon" color="#6beff9">
<TopRight />
</el-icon>
</div>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script setup> <script setup>
@ -95,89 +74,26 @@ let rollDataList = reactive([
// ... // ...
]); ]);
// const homebase = ref(null);
// onMounted(() => {
// homebase.value && homebase.value.startTime();
// });
// onUnmounted(() => {
// homebase.value && homebase.value.chearTime();
// }); // });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.data-home-index { .data-home-index {
.home-index-top-warp {
position: fixed;
top: 48px;
left: 0;
width: 100%;
height: 120px;
text-align: center;
padding-top: 24px;
.home-index-top {
margin: auto;
width: calc(100% - 400px);
height: 100%; height: 100%;
background-repeat: no-repeat;
background-position: center bottom;
background-size: contain;
position: relative;
.home-data-p {
position: absolute;
left: 0;
top: 13px;
width: 100%; width: 100%;
}
.home-title {
display: inline-block;
font-size: 18px;
font-weight: bold;
transform: skewX(-10deg);
background: linear-gradient(to bottom, '#ff7e5f', '#548fff');
-webkit-background-clip: text;
color: #fff;
letter-spacing: 4px;
text-shadow: -2px 0 0 1px #add8f1;
}
.home-data-top {
font-size: 18px;
font-weight: bold;
color: #fff;
letter-spacing: 8px;
margin-bottom: 10px;
}
.home-data-contrast {
.tips {
font-size: 10px;
color: #6beff9;
}
.value {
padding: 0 8px;
font-size: 12px;
font-weight: bold;
color: #fff;
}
}
}
}
.left-charts { .left-charts {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
width: 100%;
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
} }
.left-charts-item { .left-charts-item {
width: 100%; width: 100%;
height: calc((100% - 30px) / 3); height: calc((100% - 30px) / 3);
background: transparent;
} }
.right-charts { .right-charts {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
width: 100%;
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
} }