提交 edaa6a3f authored 作者: coderBryanFu's avatar coderBryanFu

feat:新增通用组件SiderTabs

上级 0bdfab07
<svg viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="8.000000" height="8.000000" fill="none" customFrame="#000000">
<path id="多边形 2" d="M7.4641 6L0.535898 6L4 0L7.4641 6Z" fill="rgb(255,255,255)" fill-rule="evenodd" transform="matrix(0,1,-1,0,8,0)" />
</svg>
<template>
<div class="sider-tabs-wrapper">
<div class="sider-item"
:class="{'sider-item-active': sider.active}"
v-for="sider, index in siderList" :key="index"
@click="handleClickSiderItem(sider)"
>
<div
class="sider-item-text text-primary-65-clor text-tip-1"
:class="{'sider-item-text-active': sider.active}">{{ sider.name }}</div>
<div class="sider-item-icon" v-show="sider.active">
<img src="./active-icon.svg" alt="">
</div>
</div>
</div>
</template>
<script setup>
const props = defineProps({
siderList: {
type: Array,
default: [
{
name: '分析内容1',
active: true
},
{
name: '分析内容2',
active: false
},
{
name: '分析内容3',
active: false
},
]
},
})
const emits = defineEmits(['clickSiderItem'])
const handleClickSiderItem = (sider) => {
emits('clickSiderItem', sider)
}
</script>
<style lang="scss" scoped>
.sider-tabs-wrapper {
display: flex;
flex-direction: column;
gap: 16px;
.sider-item {
padding: 4px 28px;
border-radius: 16px;
position: relative;
cursor: pointer;
display: flex;
justify-content: center;
.sider-item-icon{
position: absolute;
top: 6px;
right: 16px;
width: 8px;
height: 8px;
img{
width: 100%;
height: 100%;
}
}
}
}
.sider-item-active{
background: var(--color-main-active);
}
.sider-item-text-active {
color: rgb(255,255,255)
}
</style>
\ No newline at end of file
<template> <template>
<div class="wrap"> <div class="wrap">
<!-- <div class="sider-tab-box">
<SiderTabs :siderList="siderTabList" @clickSiderItem="handleClickTabItem" />
</div> -->
<div class="top"> <div class="top">
<div class="box1 box" v-loading="box1Loading"> <div class="box1 box" v-loading="box1Loading">
<div class="box-header"> <div class="box-header">
...@@ -140,6 +143,28 @@ import getSankeyChart from "./utils/sankey"; ...@@ -140,6 +143,28 @@ import getSankeyChart from "./utils/sankey";
import getPieChart from "./utils/piechart"; import getPieChart from "./utils/piechart";
import getbarChart from "@/views/bill/utils/barchart"; import getbarChart from "@/views/bill/utils/barchart";
import { getSearchCountry, getStatArea, getStatNum, getSearchDirection } from "@/api/marketAccessRestrictions"; import { getSearchCountry, getStatArea, getStatNum, getSearchDirection } from "@/api/marketAccessRestrictions";
import SiderTabs from "@/components/base/SiderTabs/index.vue"
// const siderTabList = ref([
// {
// name: '分析内11111',
// active: false
// },
// {
// name: '分析内2',
// active: true
// },
// {
// name: '分析内3',
// active: false
// },
// ])
// const handleClickTabItem = (value) => {
// console.log('val',value);
// }
const selectYear = ref("2025"); const selectYear = ref("2025");
...@@ -315,6 +340,14 @@ onMounted(() => { ...@@ -315,6 +340,14 @@ onMounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.wrap { .wrap {
overflow: hidden; overflow: hidden;
position: relative;
.sider-tab-box{
position: absolute;
left: 20px;
top: 20px;
}
.box { .box {
width: 792px; width: 792px;
height: 410px; height: 410px;
...@@ -323,10 +356,12 @@ onMounted(() => { ...@@ -323,10 +356,12 @@ onMounted(() => {
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1); box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
} }
.box-header { .box-header {
height: 46px; height: 46px;
display: flex; display: flex;
position: relative; position: relative;
.header-left { .header-left {
margin-top: 18px; margin-top: 18px;
width: 8px; width: 8px;
...@@ -334,6 +369,7 @@ onMounted(() => { ...@@ -334,6 +369,7 @@ onMounted(() => {
border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;
background: var(--color-main-active); background: var(--color-main-active);
} }
.title { .title {
margin-left: 14px; margin-left: 14px;
margin-top: 14px; margin-top: 14px;
...@@ -344,6 +380,7 @@ onMounted(() => { ...@@ -344,6 +380,7 @@ onMounted(() => {
font-weight: 700; font-weight: 700;
line-height: 26px; line-height: 26px;
} }
.warning-text { .warning-text {
position: absolute; position: absolute;
top: 16px; top: 16px;
...@@ -357,11 +394,13 @@ onMounted(() => { ...@@ -357,11 +394,13 @@ onMounted(() => {
letter-spacing: 0px; letter-spacing: 0px;
text-align: center; text-align: center;
} }
.header-select-box { .header-select-box {
position: absolute; position: absolute;
top: 13px; top: 13px;
right: 121px; right: 121px;
} }
.header-right { .header-right {
position: absolute; position: absolute;
top: 14px; top: 14px;
...@@ -369,9 +408,11 @@ onMounted(() => { ...@@ -369,9 +408,11 @@ onMounted(() => {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 4px; gap: 4px;
.icon { .icon {
width: 28px; width: 28px;
height: 28px; height: 28px;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -379,6 +420,7 @@ onMounted(() => { ...@@ -379,6 +420,7 @@ onMounted(() => {
} }
} }
} }
.box-footer { .box-footer {
margin: 5px auto; margin: 5px auto;
width: 759px; width: 759px;
...@@ -393,14 +435,17 @@ onMounted(() => { ...@@ -393,14 +435,17 @@ onMounted(() => {
border: 1px solid rgba(231, 243, 255, 1); border: 1px solid rgba(231, 243, 255, 1);
border-radius: 4px; border-radius: 4px;
background: rgba(246, 250, 255, 1); background: rgba(246, 250, 255, 1);
.box-footer-left { .box-footer-left {
width: 19px; width: 19px;
height: 20px; height: 20px;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.box-footer-center { .box-footer-center {
width: 666px; width: 666px;
height: 24px; height: 24px;
...@@ -412,26 +457,31 @@ onMounted(() => { ...@@ -412,26 +457,31 @@ onMounted(() => {
letter-spacing: 0px; letter-spacing: 0px;
text-align: justify; text-align: justify;
} }
.box-footer-right { .box-footer-right {
width: 24px; width: 24px;
height: 24px; height: 24px;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
} }
.top { .top {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 16px; gap: 16px;
margin: 16px auto; margin: 16px auto;
.box1 { .box1 {
.box1-main { .box1-main {
height: 304px; height: 304px;
// background: orange; // background: orange;
} }
} }
.box2 { .box2 {
.box2-main { .box2-main {
height: 304px; height: 304px;
...@@ -439,18 +489,21 @@ onMounted(() => { ...@@ -439,18 +489,21 @@ onMounted(() => {
} }
} }
} }
.bottom { .bottom {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 16px; gap: 16px;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16px; margin-bottom: 16px;
.box3 { .box3 {
.box3-main { .box3-main {
height: 304px; height: 304px;
// background: orange; // background: orange;
} }
} }
.box4 { .box4 {
.box4-main { .box4-main {
height: 304px; height: 304px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论