main
王文龙 2023-11-15 18:29:19 +08:00
parent b839cba70a
commit 520b119525
9 changed files with 426 additions and 345 deletions

View File

@ -23,6 +23,7 @@ import {
NRadioGroup,
useMessage,
treeDark,
NTag
} from "naive-ui";
import { useUserStore } from "@/stores/modules/user";
import HomeHead from "@/views/home/components/HomeHead.vue";
@ -194,9 +195,9 @@ const CloseThis = (data: boolean) => {
};
const handleChild1 = (data: any) => {
const { showModal: show, multipleSelection } = data;
console.log(show);
showModal.value = unref(show);
dataList.value = unref(multipleSelection);
console.log("🚀 ~ file: index.vue:197 ~ data:", data)
// showModal.value = unref(show);
// dataList.value = unref(multipleSelection);
};
</script>
@ -252,13 +253,13 @@ const handleChild1 = (data: any) => {
</span> -->
<el-dropdown>
<span
class="truncate flex-1 w0 text-#142142 hover:underline w400px max-w400px"
class="truncate flex-1 text-#142142 hover:underline w400px max-w400px"
:title="i.title"
@click="clickTo(i)"
@click="handleChild1(i)"
>
{{ i.title }}
</span>
<template #dropdown v-if="flg && i.firstReviewName">
<template #dropdown v-if="i.firstReviewName">
<el-dropdown-menu>
<el-dropdown-item v-if="i.firstReviewName">
<div class="ml20px text-#808696 !text-12px flex">

View File

@ -51,7 +51,6 @@ onMounted(async () => {
const { data: { ailist, culist, lastUTime },data } = await homePageMarket() //
const { data: { itemList, lastUTime: _lastUTime } } = await homePageRate() //
const { data: _disList } = await getHomeList({number: "DIS"}) //
console.log("🚀 ~ file: Home.vue:53 ~ _disList: updateTime", _disList)
const { data: _dszList } = await getHomeList({number: "DSZ"}) //
const { data: _dishList } = await getHomeList({number: "DISH"}) //
const { data:fazhu} = await amountList()
@ -81,38 +80,74 @@ onMounted(async () => {
const sum =parseFloat (currentValue.budget) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_disList[0].budget == _disList[1].budget && addDIS1.value >0){
addDIS1.value -= _disList[0].budget
addDIS1.value >0? addDIS1.value = addDIS1.value.toFixed(2):0
}
addDSZ1.value = _dszList.reduce((previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_dszList[0].budget == _dszList[1].budget && addDSZ1.value >0){
addDSZ1.value -= _dszList[0].budget
addDSZ1.value >0? addDSZ1.value = addDSZ1.value.toFixed(2):0
}
addDISH1.value = _dishList.reduce((previousValue: any, currentValue: { budget: any }) => {
const sum = parseFloat(currentValue.budget) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_dishList[0].budget == _dishList[1].budget && addDISH1.value >0){
addDISH1.value -= _dishList[0].budget
addDISH1.value >0? addDISH1.value = addDISH1.value.toFixed(2):0
}
addDIS2.value = _disList.reduce((previousValue: any, currentValue: { monthOne: any }) => {
const sum = parseFloat(currentValue.monthOne) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_disList[0].monthOne == _disList[1].monthOne && addDIS2.value >0){
addDIS2.value -= _disList[0].monthOne
addDIS2.value >0 ? addDIS2.value = addDIS2.value.toFixed(2):0
}
addDSZ2.value = _dszList.reduce((previousValue: any, currentValue: { monthOne: any }) => {
const sum = parseFloat(currentValue.monthOne) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_dszList[0].monthOne == _dszList[1].monthOne && addDSZ2.value >0){
addDSZ2.value -= _dszList[0].monthOne
addDSZ2.value >0? addDSZ2.value = addDSZ2.value.toFixed(2):0
}
addDISH2.value = _dishList.reduce((previousValue: any, currentValue: { monthOne: any }) => {
const sum = parseFloat(currentValue.monthOne) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_dishList[0].monthOne == _dishList[1].monthOne && addDISH2.value >0){
addDISH2.value -= _dishList[0].monthOne
addDISH2.value >0? addDISH2.value = addDISH2.value.toFixed(2):0
}
addDIS3.value = _disList.reduce((previousValue: any, currentValue: { monthTwo: any }) => {
const sum = parseFloat(currentValue.monthTwo) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_disList[0].monthTwo == _disList[1].monthTwo && addDIS3.value >0){
addDIS3.value -= _disList[0].monthTwo
addDIS3.value >0? addDIS3.value = addDIS3.value.toFixed(2):0
}
addDSZ3.value = _dszList.reduce((previousValue: any, currentValue: { monthTwo: any }) => {
const sum = parseFloat(currentValue.monthTwo) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_dszList[0].monthTwo == _dszList[1].monthTwo && addDSZ3.value >0){
addDSZ3.value -= _dszList[0].monthTwo
addDSZ3.value >0? addDSZ3.value = addDSZ3.value.toFixed(2):0
}
addDISH3.value = _dishList.reduce((previousValue: any, currentValue: { monthTwo: any }) => {
const sum = parseFloat(currentValue.monthTwo) +parseFloat(previousValue)
return sum>0 ? sum.toFixed(2):0
}, 0)
if(_dishList[0].monthTwo == _dishList[1].monthTwo && addDISH3.value >0){
addDISH3.value -= _dishList[0].monthTwo
addDISH3.value >0? addDISH3.value = addDISH3.value.toFixed(2):0
}
if(isUpPwds.value){
ElMessageBox.alert('为了您的帐号安全,首次登录必须更改初始密码', '重要提醒',
{
@ -330,7 +365,7 @@ const thisSelect = (e) => {
<tr>
<th rowspan="2">C/D</th>
<th>交涉</th>
<td :rowspan="disList[0].budget ==disList[1].budget?'2':''">{{disList[0].budget}}%</td>
<td :rowspan="disList[0].budget ==disList[1].budget?'2':''">{{disList[0].budget}}%</td>
<td :rowspan="disList[0].monthOne ==disList[1].monthOne?'2':''">{{disList[0].monthOne}}%</td>
<td :rowspan="disList[0].budget ==disList[1].budget?'2':''">{{disList[0].monthTwo}}%</td>
</tr>

View File

@ -68,13 +68,15 @@ function computedTreeNode(item: any) {
}
async function getData() {
// const {data} = await getBPCActList({moduleId: 1})
const {rows:datacArr} = await getBPCActList({moduleId: 2})
const { rows: dataArr } = await getBPCActList({ moduleId: 1 })
const { rows: dataBrr } = await getBPCActList({ moduleId: 4 })
// const { rows: dataCrr } = await getBPCActList({ moduleId: 3 });
const { data: dataDrr } = await getCateTreeList({ moduleId: 4 })
const { rows: dataErr } = await getBPCActList({ moduleId: 5 })
dataC.value = datacArr
dataA.value = dataArr.map((item) => {
return {
...item,
@ -82,7 +84,6 @@ async function getData() {
breifName: getFileName(item.briefingPath)
}
})
console.log('🚀 ~ file: BCP.vue:84 ~ dataA:', dataA)
dataB.value = dataBrr
// dataC.value = dataCrr;
@ -111,14 +112,27 @@ async function getData() {
]
}
function getFile(arr:any[]):any[] {
let file:any = []
arr.forEach((item) => {
item.fileList && file.push(...item.fileList)
if (item.childList?.length) {
file.push(...getFile(item.childList))
}
})
return file
}
function addIsShow(obj) {
if (obj) {
obj.isShow = true // isShow
obj.fileList ? obj.fileLists = [...obj.fileList ] : obj.fileLists = []
if (obj.childList && obj.childList.length > 0) {
obj.fileLists.push(...getFile(obj.childList))
// addIsShow
obj.childList.forEach((child) => {
addIsShow(child)
})
// obj.childList.forEach((child) => {
// addIsShow(child)
// })
}
}
}
@ -145,26 +159,25 @@ const jumpContentHandler = (title, type) => {
push({ name: 'contentList', query: { title, type } })
}
const download = async (row) => {
// console.log(row)
if (!row) return
if (row.isSelect === 2) {
message.error('没有访问权限')
return
}
let { briefingPath } = row
console.log(row, 'xiaolu')
let { briefingPath ,filePath } = row
console.log("🚀 ~ file: BCP.vue:169 ~ briefingPath ,filePath:", briefingPath ,filePath)
if (!briefingPath) {
if (!briefingPath && !filePath) {
message.info('没有可预览文件!')
return
}
srcType.value = getLastSubstring(briefingPath)
srcType.value = getLastSubstring(briefingPath || filePath)
if (
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
// src.value = filePath
// pdfShow.value = true
briefingPath = briefingPath
briefingPath = briefingPath || filePath
const screenWidth = window.screen.width
const screenHeight = window.screen.height
window.open(
@ -338,7 +351,7 @@ const isChart = (content) => {
<div class="w-[20%] pl-6px">
{{ i.createTime.substring(5, 10) }}
</div>
<div class="truncate w-[50%]">
<div class="truncate w-[50%] pr-6px">
{{ unescapeHTML(i.content) }}
</div>
<div class="truncate w-[30%]">
@ -425,7 +438,7 @@ const isChart = (content) => {
<div
class="rounded-2xl summary-content overflow-hidden"
id="summaryContent"
v-if="dataA.length > 0"
v-if="dataC.length > 0"
>
<swiper
:autoplay="{ delay: 1000, disableOnInteraction: false }"
@ -460,13 +473,13 @@ const isChart = (content) => {
{{ it.breifName }}
</div>
</div> -->
<swiper-slide v-for="i in dataA" :key="i.id">
<swiper-slide v-for="i in dataC" :key="i.id">
<div class="py22px item-row items-center flex">
<div
class="inline-flex cur_p file-icon text-16px"
@click="download(i, 1)"
@click="download(i)"
>
{{ i.breifName }}
{{ i.title }}
</div>
</div>
</swiper-slide>

View File

@ -14,6 +14,8 @@ const activeMenuKey = ref();
const route = useRoute()
let idx = ref(0);
const onClic = ref(false);
const titles = ref();
const rowData = ref();
const srcType = ref()
@ -27,16 +29,14 @@ function getLastSubstring(str: string): string {
}
function menuHandler(menu: any, index: number) {
activeMenuKey.value = menu.id;
titles.value = menu.name;
idx.value = index;
activeItem.value = menu.id;
console.log(menu,menu.id);
if (menu.childList && menu.childList.length > 0) {
activeItem.value = menu.childList[0].id;
console.log(activeItem.value );
}
getId(menu.id);
@ -44,7 +44,6 @@ function menuHandler(menu: any, index: number) {
}
const getId = async (id) => {
const { rows } = await getActCateFileList({ cateId: id })
console.log(rows);
rowData.value = rows
}
const download = async (row)=>{
@ -95,7 +94,10 @@ async function getTree(id) {
activeItem.value = data[index].childList[0].id;
activeMenuKey.value = data[index].childList[0].id;
}
getId(activeMenuKey.value);
setTimeout(() => {
menuHandler(data[index], id)
getId(activeMenuKey.value);
}, 200);
}
}
function getFileName(url) {
@ -108,7 +110,6 @@ onMounted(() => {
getTree(route.query.id);
});
var activeItem = ref();
const onClic = ref(false);
</script>
<template>

View File

@ -166,7 +166,7 @@ function unescapeHTML(html: string) {
<td class="wrap h50px text-left !w-1250px">
<div :title="unescapeHTML(it.content )" class="download" @click="download(it, 'filePath')">{{unescapeHTML(it.content )}}</div>
</td>
<td class="h50px text-left"><span class="download" @click="download(it, 'briefingPath')">{{it.riskEstimation}}</span></td>
<td class="h50px text-center"><span class="download" @click="download(it, 'briefingPath')">{{it.riskEstimation}}</span></td>
<td
>
<!-- <span > {{ it.createTime }}</span> -->

View File

@ -1,258 +1,266 @@
<template>
<div class="tree-node">
<div v-for="(it, index) in data" :key="index" class="tree-item expand">
<div class="sub-title" @click="clickSubTitle(it, index)">
<span v-if="isCount" class="index-content">{{ index + 1 }})</span>
{{ it.name }}
<span class="icon-arrow" @click="toggleHandler(it)" v-if="!isCount">
更多
</span>
</div>
<!-- BCP历年速报 -->
<div class="file-container" v-if="it.isShow">
<div class="file-content" v-if="it.fileList&&it.fileList.length > 0" >
<!-- <div class="file-title">
<div class="tree-node">
<div v-for="(it, ind) in data" :key="ind" class="tree-item expand">
<div class="sub-title" @click="clickSubTitle(it, ind)">
<span v-if="isCount" class="index-content">{{ ind + 1 }})</span>
{{ it.name }}
<span class="icon-arrow" @click="toggleHandler(it)" v-if="!isCount">
更多
</span>
</div>
<!-- BCP历年速报 -->
<div class="file-container">
<div class="file-content" v-if="it.fileLists?.length > 0">
<!-- <div class="file-title">
<span>{{idx + 1}})</span>
{{file.title}}
</div> -->
<!-- lujinli -->
<!-- <div class="file-icon" @click="clickFileHandler(it.fileList[0])">
<!-- lujinli -->
<!-- <div class="file-icon" @click="clickFileHandler(it.fileList[0])">
{{ computedFileName(it.fileList[0].filePath) }}
</div> -->
<div v-for="(item, index) in it.fileList.slice(0, 3)" >
<div v-if="index < 2" class="file-icon" @click="clickFileHandler(it.fileList[0])">
<p >{{ item.title }}</p>
</div>
</div>
</div>
</div>
<!-- 供方健康诊断 -->
<div v-for="(item, index) in it.childList.slice(0, 3)" >
<div v-for="(ite, inde) in item.fileList">
<div class="file-icon" v-if="index < 2" @click="clickFileHandler(item.fileList[0])" >
<p >{{ ite.title }}</p>
</div>
</div>
</div>
<!-- <div v-if="it.isShow">
<div v-for="(item, index) in it.fileLists">
<div
v-if="ind == 3? index < 1 : index < 2"
class="file-icon"
@click="clickFileHandler(it.fileLists[0])"
>
<p>{{ item.title }}</p>
</div>
</div>
</div>
</div>
<!-- 供方健康诊断 先禁掉 -->
<!-- <div v-for="(item, inde) in it.childList">
<div v-for="(ite) in item.fileLists">
<div
class="file-icon"
v-if="ind == 3 ? inde < 0 : inde < 2"
@click="clickFileHandler(item.fileLists[0])"
>
<p>{{ ite.title }}</p>
</div>
</div>
</div> -->
<!-- <div v-if="it.isShow">
<s-tree :isCount="true" class="second-tree" v-if="it.childList.length > 0" @clickFile="receiveClickFileHandler"
@clickMore="receiveClickMoreHandler" :data="it.childList"></s-tree>
</div> -->
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import sTree from "./sTree.vue";
const emit = defineEmits(["clickFile", "clickMore", "changeIsShow"]);
import sTree from './sTree.vue'
const emit = defineEmits(['clickFile', 'clickMore', 'changeIsShow'])
type Props = {
data?: [];
isCount?: false;
};
const isShow = ref(false);
data?: []
isCount?: false
}
const isShow = ref(false)
defineProps<Props>();
defineProps<Props>()
const computedFileName = (name) => {
let s = name.lastIndexOf("/");
let e = name.lastIndexOf(".");
return name.slice(s + 1, e);
};
let s = name.lastIndexOf('/')
let e = name.lastIndexOf('.')
return name.slice(s + 1, e)
}
const toggleHandler = (item) => {
// ev.target.parentNode.parentNode.classList.toggle("expand");
emit("clickMore", item);
};
// ev.target.parentNode.parentNode.classList.toggle("expand");
emit('clickMore', item)
}
function clickFileHandler(obj) {
console.log(obj)
emit("clickFile", obj);
console.log(obj)
emit('clickFile', obj)
}
function receiveClickFileHandler(obj) {
emit("clickFile", obj);
emit('clickFile', obj)
}
function receiveClickMoreHandler(item) {
emit("clickMore", item);
emit('clickMore', item)
}
const clickSubTitle = (item: any, index: number) => {
emit("changeIsShow", index);
};
emit('changeIsShow', index)
}
</script>
<script lang="ts">
export default {
name: "sTree",
};
name: 'sTree'
}
</script>
<style scoped lang="less">
.file-icon {
display: flex;
align-items: center;
height: 20px;
background-image: url("./images/biq2.png");
background-size: 24px 20px;
background-repeat: no-repeat;
background-size: left center;
padding-left: 28px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
line-height: 24px;
cursor: pointer;
display: flex;
align-items: center;
height: 20px;
background-image: url('./images/biq2.png');
background-size: 24px 20px;
background-repeat: no-repeat;
background-size: left center;
padding-left: 28px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
line-height: 24px;
cursor: pointer;
}
.second-tree {
margin-left: 28px;
margin-left: 28px;
}
.tree-item {
margin-bottom: 4px;
margin-bottom: 4px;
.file-content {
margin-bottom: 2px;
}
.file-content {
margin-bottom: 2px;
}
}
.tree-item.expand {
.icon-arrow {
// background-image: url("./images/san22.png");
}
.icon-arrow {
// background-image: url("./images/san22.png");
}
.file-content {
display: block;
}
.file-content {
display: block;
}
}
.file-content {
padding-left: 14px;
margin-right: 16px;
line-height: 24px;
display: none;
padding-left: 14px;
margin-right: 16px;
line-height: 24px;
display: none;
.file-title {
display: block;
align-items: center;
white-space: nowrap;
overflow: hidden;
padding-left: 28px;
position: relative;
text-overflow: ellipsis;
.file-title {
display: block;
align-items: center;
white-space: nowrap;
overflow: hidden;
padding-left: 28px;
position: relative;
text-overflow: ellipsis;
span {
position: absolute;
left: 0;
top: 0;
display: block;
width: 24px;
margin-right: 4px;
text-align: center;
}
}
span {
position: absolute;
left: 0;
top: 0;
display: block;
width: 24px;
margin-right: 4px;
text-align: center;
}
}
>div:not(:last-child) {
margin-bottom: 2px;
}
> div:not(:last-child) {
margin-bottom: 2px;
}
}
.tree-item .tree-item .sub-title::before {
content: unset;
content: unset;
}
.sub-title {
display: flex;
line-height: 28px;
font-size: 1.1em;
align-items: center;
display: flex;
line-height: 28px;
font-size: 1.1em;
align-items: center;
&::before {
content: "";
display: block;
width: 6px;
height: 6px;
background: white;
border-radius: 50%;
margin-right: 6px;
}
&::before {
content: '';
display: block;
width: 6px;
height: 6px;
background: white;
border-radius: 50%;
margin-right: 6px;
}
.file-icon {
display: flex;
align-items: center;
height: 20px;
background-image: url("./images/biq2.png");
background-size: 24px 20px;
background-repeat: no-repeat;
background-size: left center;
padding-left: 28px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
line-height: 24px;
}
.file-icon {
display: flex;
align-items: center;
height: 20px;
background-image: url('./images/biq2.png');
background-size: 24px 20px;
background-repeat: no-repeat;
background-size: left center;
padding-left: 28px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
line-height: 24px;
}
.icon-arrow {
display: block;
background-image: url("./images/gdd2.png");
background-repeat: no-repeat;
.icon-arrow {
display: block;
background-image: url('./images/gdd2.png');
background-repeat: no-repeat;
background-size: 12px 11px;
background-position: right center;
// width: 12px;
// height: 9px;
padding: 4px;
line-height: 24px;
padding-right: 12px;
font-size: 14px;
color: #00e4ff;
margin-left: auto;
box-sizing: content-box;
// background-origin: content-box;
// background-repeat: no-repeat;
cursor: pointer;
}
background-size: 12px 11px;
background-position: right center;
// width: 12px;
// height: 9px;
padding: 4px;
line-height: 24px;
padding-right: 12px;
font-size: 14px;
color: #00e4ff;
margin-left: auto;
box-sizing: content-box;
// background-origin: content-box;
// background-repeat: no-repeat;
cursor: pointer;
}
}
.tree-node {}
.tree-node {
}
.file-icon:hover {
color: #00e4ff;
color: #00e4ff;
}
.tree-item {
padding-bottom: 8px;
margin-bottom: 8px;
position: relative;
padding-bottom: 8px;
margin-bottom: 8px;
position: relative;
}
.tree-item .tree-item {
margin-bottom: 0;
padding-bottom: 0;
margin-bottom: 0;
padding-bottom: 0;
}
.tree-item:not(:last-child)::after {
content: "";
position: absolute;
left: 0;
right: 0;
height: 0.5px;
background: white;
bottom: -2px;
background: rgba(12, 25, 180, 0.8);
content: '';
position: absolute;
left: 0;
right: 0;
height: 0.5px;
background: white;
bottom: -2px;
background: rgba(12, 25, 180, 0.8);
}
.second-tree .tree-item::after {
content: unset;
content: unset;
}
.sub-title {
position: relative;
position: relative;
}
.sub-title .index-content {
// position: absolute;
// left: -24px;
// top: 0;
display: block;
width: 24px;
margin-left: -16px;
margin-right: 4px;
text-align: center;
}</style>
// position: absolute;
// left: -24px;
// top: 0;
display: block;
width: 24px;
margin-left: -16px;
margin-right: 4px;
text-align: center;
}
</style>

View File

@ -208,7 +208,8 @@ const handleVisitsScoll = () => {
<div class="text-#142142 text-20px font-extrabold flex p20px">
<!-- <div class=""></div> -->
<div class="w-70% text-24px font-bold p20px pb-0px">
空调节能solution活动
<!-- 空调节能solution活动 -->
PLUS活动
</div>
<div class="w-30%" style="text-align: -webkit-right">
@ -344,7 +345,8 @@ const handleVisitsScoll = () => {
</div>
<div class="w-40% h-375px float-left bg-#fff">
<div class="text-24px font-bold p20px" @click="push({ name: 'CSRList' })">
碳足迹报告
<!-- 碳足迹报告 -->
相关活动报告
</div>
<!-- <div title="查看更多" class="absolute right-25px top-5px w80px h50px flex justify-center items-center cursor-pointer" style="background: #0539A3;line-height: 50px;color: #00C2EE;text-align: center;" @click="jumpContentHandler('BCP简报', 2)"> -->
<!-- <div

View File

@ -84,7 +84,6 @@ const cardsClick = (it) => {
<el-date-picker
v-model="YearTime2"
:style="{ width: '100px' }"
type="year"
/>
@ -98,7 +97,7 @@ const cardsClick = (it) => {
<div class="w-full h-340px">
<VChart ref="chartRef1" :option="option1" />
</div>
<div class="absolute top-16px left-2 flex items-center">
<div class="absolute top-16px left-2 flex items-center">
<el-config-provider :locale="locale">
<el-date-picker
v-model="YearTime1"
@ -131,15 +130,15 @@ const cardsClick = (it) => {
<div class="m20px h-100px bg-#F5F8FF p10px">
<div class="py5px">
<span class="text-18px font-bold text-#3164BF"></span
><span class="ml5px">使用量10,700碳排放量159,158</span>
><span class="ml5px">使用量0.000碳排放量0.000</span>
</div>
<div class="py5px">
<span class="text-18px font-bold text-#3164BF"></span
><span class="ml5px">使用量10,700碳排放量159,158</span>
><span class="ml5px">使用量0.000碳排放量0.000</span>
</div>
<div class="py5px">
<span class="text-18px font-bold text-#3164BF"></span
><span class="ml5px">使用量10,700碳排放量159,158</span>
><span class="ml5px">使用量0.000碳排放量0.000</span>
</div>
</div>
</div>
@ -150,22 +149,26 @@ const cardsClick = (it) => {
<div class="px20px py10px bg-#F5F8FF rd-5px">
<span class="text-#000 text-16px font-extrabold"> 现行铝</span
><span class="text-22px text-#265DD5 font-extrabold">12,000</span
><span> /</span>
>
<!-- <span class="text-22px text-#265DD5 font-extrabold">0.000</span
><span> /</span> -->
</div>
<div class="px20px py10px bg-#F5F8FF rd-5px mt5px">
<span class="text-#000 text-16px font-extrabold"> 现行铝</span
><span class="text-22px text-#265DD5 font-extrabold">12,000</span
><span> /</span>
>
<!-- <span class="text-22px text-#265DD5 font-extrabold">0.000</span
><span> /</span> -->
</div>
<div class="px20px py10px bg-#F5F8FF rd-5px mt5px">
<span class="text-#000 text-16px font-extrabold"> 现行铝</span
><span class="text-22px text-#265DD5 font-extrabold">12,000</span
><span> /</span>
>
<!-- <span class="text-22px text-#265DD5 font-extrabold">0.000</span
><span> /</span> -->
</div>
<div class="px20px py10px bg-#F5F8FF rd-5px mt5px">
<span class="text-#000 text-16px font-extrabold"> 数据来源</span
><span class="text-#265DD5">行情展示 (cneeex.com)</span> <br />
>
<span class="text-#265DD5">行情展示 (cneeex.com)</span> <br />
SMM网站
</div>
</div>

View File

@ -325,126 +325,144 @@ export function charData2() {
export function pieData1() {
const chartRef = ref()
const option = ref<EChartsOption>({
title: {
text: form.value.lable8.name,
// subtext: 'Fake Data',
left: 'center',
textStyle: { color: '#4075E1', }
},
tooltip: {
trigger: 'item'
},
grid: { left: '20', top: '30', right: '70', bottom: '10', containLabel: true },
// legend: {
// orient: 'vertical',
// left: 'left'
// },
series: [
{
name: 'Access From',
type: 'pie',
selectedMode: 'single',
radius: [0, '30%'],
label: {
position: 'inner',
fontSize: 14
},
labelLine: {
show: false
},
data: [
{ value: 1548, name: '铝',label:{color:'#fff',fontSize:'16px',fontWeight:'bold'} },
{ value: 775, name: '铁',label:{color:'#fff',fontSize:'16px',fontWeight:'bold'} },
{ value: 679, name: '铜', selected: true ,label:{color:'#fff',fontSize:'16px',fontWeight:'bold'}}
],
// 自定义颜色
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
normal: {
// 自定义每个扇形的颜色
color: function (params) {
const colorList = ['#3EC22B', '#3EC22B', '#3EC22B',];
return colorList[params.dataIndex];
},
},
},
},
{
name: 'Access From',
type: 'pie',
radius: ['45%', '60%'],
avoidLabelOverlap: false,
itemStyle: {
// borderRadius: 10,
borderColor: '#fff',
borderWidth: 4
},
labelLine: {
length: 30
},
label: {
formatter: ' {b|{b}}{c}吨 ',
backgroundColor: '#F6F8FC',
borderColor: '#8C8D8E',
borderWidth: 1,
borderRadius: 4,
rich: {
a: {
color: '#6E7079',
lineHeight: 22,
align: 'center'
},
hr: {
borderColor: '#8C8D8E',
width: '100%',
borderWidth: 1,
height: 0
},
b: {
color: '#4C5058',
fontSize: 14,
fontWeight: 'bold',
lineHeight: 33
},
per: {
color: '#fff',
backgroundColor: '#4C5058',
padding: [3, 4],
borderRadius: 4
}
}
},
data: [
{ value: 335, name: '铝' },
{ value: 310, name: '铁' },
{ value: 135, name: '铜' },
],
// 自定义颜色
// itemStyle: {
// borderColor: '#fff',
// borderWidth: 2,
// emphasis: {
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: 'rgba(0, 0, 0, 0.5)',
// },
// normal: {
// // 自定义每个扇形的颜色
// color: function (params) {
// const colorList = ['#337EE6', '#337EE6', '#337EE6',];
// return colorList[params.dataIndex];
// },
// },
// },
}
]
title: {
text: form.value.lable8.name,
// subtext: 'Fake Data',
left: 'center',
textStyle: { color: '#4075E1' }
},
tooltip: {
trigger: 'item'
},
grid: {
left: '20',
top: '30',
right: '70',
bottom: '10',
containLabel: true
},
// legend: {
// orient: 'vertical',
// left: 'left'
// },
series: [
{
name: 'Access From',
type: 'pie',
selectedMode: 'single',
radius: [0, '30%'],
label: {
position: 'inner',
fontSize: 14
},
labelLine: {
show: false
},
data: [
{
value: 1548,
name: '铝',
label: { color: '#fff', fontSize: '16px', fontWeight: 'bold' }
},
{
value: 775,
name: '铁',
label: { color: '#fff', fontSize: '16px', fontWeight: 'bold' }
},
{
value: 679,
name: '铜',
selected: true,
label: { color: '#fff', fontSize: '16px', fontWeight: 'bold' }
}
],
// 自定义颜色
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
},
normal: {
// 自定义每个扇形的颜色
color: function (params) {
const colorList = ['#3EC22B', '#3EC22B', '#3EC22B']
return colorList[params.dataIndex]
}
}
}
},
{
name: 'Access From',
type: 'pie',
radius: ['45%', '60%'],
avoidLabelOverlap: false,
itemStyle: {
// borderRadius: 10,
borderColor: '#fff',
borderWidth: 4
},
labelLine: {
length: 30
},
label: {
formatter: ' {b|{b}}{c}吨 ',
backgroundColor: '#F6F8FC',
borderColor: '#8C8D8E',
borderWidth: 1,
borderRadius: 4,
})
rich: {
a: {
color: '#6E7079',
lineHeight: 22,
align: 'center'
},
hr: {
borderColor: '#8C8D8E',
width: '100%',
borderWidth: 1,
height: 0
},
b: {
color: '#4C5058',
fontSize: 14,
fontWeight: 'bold',
lineHeight: 33
},
per: {
color: '#fff',
backgroundColor: '#4C5058',
padding: [3, 4],
borderRadius: 4
}
}
},
data: [
{ value: 0.0, name: '铝' },
{ value: 0.0, name: '铁' },
{ value: 0.0, name: '铜' }
]
// 自定义颜色
// itemStyle: {
// borderColor: '#fff',
// borderWidth: 2,
// emphasis: {
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: 'rgba(0, 0, 0, 0.5)',
// },
// normal: {
// // 自定义每个扇形的颜色
// color: function (params) {
// const colorList = ['#337EE6', '#337EE6', '#337EE6',];
// return colorList[params.dataIndex];
// },
// },
// },
}
]
})
return { chartRef, option }
}