main
wwl 2024-05-08 13:41:28 +08:00
parent 21a629b4fb
commit d233857ce2
2 changed files with 85 additions and 74 deletions

View File

@ -543,9 +543,9 @@ const title = (tit) => {
</el-icon> </el-icon>
</div> </div>
<div class="bottomclom" v-if="showDropdown1"> <div class="bottomclom" v-if="showDropdown1">
<div v-if="dataLeft" v-for="item in dataLeft"> <div v-if="dataLeft" v-for="item in dataLeft[0].fileList">
<span class="container" @click="handleSelect(item)">{{ item.title }}</span> <span class="container" @click="down({ it: item })">{{ item.name }}</span>
<el-dropdown max-height="100px" @command="down"> <!-- <el-dropdown max-height="100px" @command="down">
<el-icon size="25"> <el-icon size="25">
<CaretBottom /> <CaretBottom />
</el-icon> </el-icon>
@ -560,7 +560,7 @@ const title = (tit) => {
> >
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown> -->
</div> </div>
</div> </div>
</AppBlock> </AppBlock>
@ -573,7 +573,7 @@ const title = (tit) => {
class="mt20px mx10px h60px flex items-center justify-center rd-30px text-24px text-#fff bg-#000/45" class="mt20px mx10px h60px flex items-center justify-center rd-30px text-24px text-#fff bg-#000/45"
> >
<p <p
:alt="form.lable1.title" :alt="form.lable2.title"
style="width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis" style="width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
> >
<n-popover trigger="hover" placement="top-start"> <n-popover trigger="hover" placement="top-start">
@ -585,7 +585,7 @@ const title = (tit) => {
class="!h-20px !w-auto mr-2" class="!h-20px !w-auto mr-2"
alt="" alt=""
/> />
<span>{{ form.lable1.title }}</span> <span>{{ form.lable2.title }}</span>
</div> </div>
<!-- {{ form.lable2.title }} --> <!-- {{ form.lable2.title }} -->
</template> </template>
@ -617,14 +617,14 @@ const title = (tit) => {
</el-icon> </el-icon>
</div> </div>
<div class="bottomclom" v-if="showDropdown2"> <div class="bottomclom" v-if="showDropdown2">
<div v-if="dataRight" v-for="item in dataRight"> <div v-if="dataRight" v-for="ite in dataRight[0].fileList">
<span class="container" @click="handleSelect2(item)">{{ item.title }}</span> <span class="container" @click="down({ it: ite })">{{ ite.name }}</span>
<el-dropdown max-height="100px" @command="down"> <!-- <el-dropdown max-height="100px" @command="down"> -->
<el-icon size="25"> <!-- <el-icon size="25">
<CaretBottom /> <CaretBottom />
</el-icon> </el-icon> -->
<template #dropdown> <!-- <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item <el-dropdown-item
v-if="item.fileList" v-if="item.fileList"
@ -633,8 +633,8 @@ const title = (tit) => {
>{{ it.name }}</el-dropdown-item >{{ it.name }}</el-dropdown-item
> >
</el-dropdown-menu> </el-dropdown-menu>
</template> </template> -->
</el-dropdown> <!-- </el-dropdown> -->
</div> </div>
</div> </div>
</AppBlock> </AppBlock>

View File

@ -1,65 +1,76 @@
import * as echarts from "echarts"; import * as echarts from 'echarts'
import {topStat} from '@/api/daikin/base' import { topStat } from '@/api/daikin/base'
import {getPreviousMonths} from '@/utils/format' import { getPreviousMonths } from '@/utils/format'
function formatDate(inputDate: string) { function formatDate(inputDate: string) {
const dateRegex = /^(\d{4})-(\d{2})$/ const dateRegex = /^(\d{4})-(\d{2})$/
const match = inputDate.match(dateRegex) const match = inputDate.match(dateRegex)
if (match) { if (match) {
const year = match[1] const year = match[1]
let month = match[2] let month = match[2]
if (month.startsWith('0')) { if (month.startsWith('0')) {
month = month.substring(1) month = month.substring(1)
} }
return `${year}${month}` return `${year}${month}`
} else { } else {
return inputDate return inputDate
} }
} }
export function useChart21() { export function useChart21() {
const chartRef = ref() const chartRef = ref()
const optionRef = ref() const optionRef = ref()
getData() getData()
async function getData() { async function getData() {
const { data } = await topStat() const { data } = await topStat()
const option = { const option = {
legend: {}, legend: {
title: { orient: 'vertical',
text: '件', right: 0,
textStyle: { fontSize: 14, fontWeight: 500 }, top: '40%',
subtext: '数', itemgrap: 10,
subtextStyle: { fontSize: 14, fontWeight: 500, color: '#000' }, textStyle: {
top: '45%' width: 50,
}, overflow: 'break'
tooltip: { },
trigger: 'axis', itemStyle: {}
axisPointer: { },
animation: false title: {
} text: '件',
}, textStyle: { fontSize: 14, fontWeight: 500 },
grid: { subtext: '数',
left: '6%', subtextStyle: { fontSize: 14, fontWeight: 500, color: '#000' },
right: '4%', top: '45%'
bottom: '5%', },
containLabel: true tooltip: {
}, trigger: 'axis',
yAxis: { axisPointer: {
type: 'value', animation: false
show: true }
}, },
xAxis: { grid: {
type: 'category', top: '5%',
data: data[0]?.month left: '6%',
? data[0].month.map((item: any) => { right: '24%',
return formatDate(item) bottom: '5%',
}) containLabel: true
: [] },
}, yAxis: {
series: data type: 'value',
} show: true
optionRef.value = option },
} xAxis: {
return { chartRef, option: optionRef } type: 'category',
} data: data[0]?.month
? data[0].month.map((item: any) => {
return formatDate(item)
})
: []
},
series: data
}
optionRef.value = option
}
return { chartRef, option: optionRef }
}