update
parent
0599685ab7
commit
4ce47123c8
|
|
@ -57,8 +57,13 @@ const getStatListlBar = async ([startYear, endYear] = [2020, 2023]) => {
|
||||||
const year = Number(startYear) + i
|
const year = Number(startYear) + i
|
||||||
arr.push(year)
|
arr.push(year)
|
||||||
const item = data.find((it:any) => +it.year === year)
|
const item = data.find((it:any) => +it.year === year)
|
||||||
serieOne.push(item ? item.dis : 0)
|
serieOne.push({value:item ? item.dis : 0,itemStyle:{}})
|
||||||
serieTwo.push(item ? item.dsz : 0)
|
serieTwo.push({value:item ? item.dsz : 0,itemStyle:{}})
|
||||||
|
}
|
||||||
|
serieOne[0].itemStyle = {
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
shadowOffsetY: 10,
|
||||||
|
shadowBlur: 20
|
||||||
}
|
}
|
||||||
option.value.xAxis.data = arr
|
option.value.xAxis.data = arr
|
||||||
option.value.series[0].data = serieOne
|
option.value.series[0].data = serieOne
|
||||||
|
|
@ -66,11 +71,15 @@ const getStatListlBar = async ([startYear, endYear] = [2020, 2023]) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const statListlPieData = ref([])
|
const statListlPieData = ref([])
|
||||||
const getStatListlPie = async ( year = '2020', channel = 'DIS') => {
|
const pieUseTotalData = ref(0)
|
||||||
|
const pieDischargeTotal = ref(0)
|
||||||
|
const getStatListlPie = async ( year = option.value.xAxis.data || '2020', channel = 'DIS') => {
|
||||||
numberList.forEach((item) => {
|
numberList.forEach((item) => {
|
||||||
pieDecObj.value[item + 1] = 0
|
pieDecObj.value[item + 1] = 0
|
||||||
pieDecObj.value[item + 2] = 0
|
pieDecObj.value[item + 2] = 0
|
||||||
})
|
})
|
||||||
|
pieUseTotalData.value = 0
|
||||||
|
pieDischargeTotal.value = 0
|
||||||
const { data = [] } = await fetchStatListlPie({
|
const { data = [] } = await fetchStatListlPie({
|
||||||
year,
|
year,
|
||||||
channel
|
channel
|
||||||
|
|
@ -87,10 +96,12 @@ const getStatListlPie = async ( year = '2020', channel = 'DIS') => {
|
||||||
name: numberObj[item],
|
name: numberObj[item],
|
||||||
value: pieDecObj.value[item + 1] || '-'
|
value: pieDecObj.value[item + 1] || '-'
|
||||||
})
|
})
|
||||||
|
pieUseTotalData.value += pieDecObj.value[item + 1] || 0
|
||||||
optionP1.value.series[1].data.push({
|
optionP1.value.series[1].data.push({
|
||||||
name: numberObj[item],
|
name: numberObj[item],
|
||||||
value: pieDecObj.value[item + 2] || '-'
|
value: pieDecObj.value[item + 2] || '-'
|
||||||
})
|
})
|
||||||
|
pieDischargeTotal.value += pieDecObj.value[item + 2] || 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,7 +109,6 @@ const getStatListlPie = async ( year = '2020', channel = 'DIS') => {
|
||||||
onMounted( () => {
|
onMounted( () => {
|
||||||
const char = charData()
|
const char = charData()
|
||||||
option.value = char.option.value
|
option.value = char.option.value
|
||||||
console.log("🚀 ~ file: CSRContent22.vue:36 ~ option:", option)
|
|
||||||
// chartRef.value = char.chartRef.value
|
// chartRef.value = char.chartRef.value
|
||||||
const char1 = charData2()
|
const char1 = charData2()
|
||||||
option1.value = char1.option.value
|
option1.value = char1.option.value
|
||||||
|
|
@ -111,6 +121,16 @@ onMounted( () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const chartClick = (it:any) => {
|
const chartClick = (it:any) => {
|
||||||
|
option.value.series.forEach((item:any) => {
|
||||||
|
item.data.forEach((i:any) => {
|
||||||
|
i.itemStyle = {}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
option.value.series[it.seriesIndex].data[it.dataIndex].itemStyle = {
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
shadowOffsetY: 10,
|
||||||
|
shadowBlur: 20
|
||||||
|
};
|
||||||
getStatListlPie(it.name, it.seriesName)
|
getStatListlPie(it.name, it.seriesName)
|
||||||
pieYear.value = (+it.name).toString().substring(2)
|
pieYear.value = (+it.name).toString().substring(2)
|
||||||
}
|
}
|
||||||
|
|
@ -230,11 +250,17 @@ const handleDateChange = (val:any) => {
|
||||||
style="align-content: space-between"
|
style="align-content: space-between"
|
||||||
>
|
>
|
||||||
<div class="w-full h-70% bg-#fff" style="border-radius: 25px 25px 0 0">
|
<div class="w-full h-70% bg-#fff" style="border-radius: 25px 25px 0 0">
|
||||||
<div class="text-center text-#265DD5 text-22px py20px font-extrabold">
|
<div class="text-center text-#265DD5 text-22px pt20px pb-10px font-extrabold">
|
||||||
原材料用量及碳排放量占比图<br />
|
原材料用量及碳排放量占比图<br />
|
||||||
<span class="text-16px mt10px"> (FY{{pieYear}}BASE基准)</span>
|
<!-- <span class="text-16px mt10px"> (FY{{pieYear}}BASE基准)</span> -->
|
||||||
|
<!-- <div class="h-10px mt10px"> </div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full h-400px">
|
<div class="relative w-full h-430px">
|
||||||
|
<div class="w-130px h-26px absolute left-0 top-0 bg-white z-10"></div>
|
||||||
|
<div class="absolute top-7 right-6 text-14px leading-20px opacity-90">
|
||||||
|
<p class="text-right">原材料使用量合计:{{ pieUseTotalData }}千克</p>
|
||||||
|
<p class="text-right">原材料碳排放量合计:{{ pieDischargeTotal }}吨</p>
|
||||||
|
</div>
|
||||||
<VChart ref="chartRefP1" :option="optionP1" autoresize />
|
<VChart ref="chartRefP1" :option="optionP1" autoresize />
|
||||||
</div>
|
</div>
|
||||||
<div class="box-border pr-20px mx-20px h-130px bg-#F5F8FF p10px">
|
<div class="box-border pr-20px mx-20px h-130px bg-#F5F8FF p10px">
|
||||||
|
|
@ -243,7 +269,7 @@ const handleDateChange = (val:any) => {
|
||||||
<span class="text-18px font-bold text-#3164BF">{{ numberObj[n] }}</span
|
<span class="text-18px font-bold text-#3164BF">{{ numberObj[n] }}</span
|
||||||
>
|
>
|
||||||
<span class="ml5px">使用量
|
<span class="ml5px">使用量
|
||||||
<n-number-animation show-separator :from="0" :duration="300" :to="pieDecObj[`${n}1`]"/>吨,碳排放量
|
<n-number-animation show-separator :from="0" :duration="300" :to="pieDecObj[`${n}1`]"/>千克,碳排放量
|
||||||
<n-number-animation show-separator :from="0" :duration="300" :to="pieDecObj[`${n}2`]"/>吨
|
<n-number-animation show-separator :from="0" :duration="300" :to="pieDecObj[`${n}2`]"/>吨
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -402,6 +402,12 @@ export function charData() {
|
||||||
label: {
|
label: {
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
|
// emphasis: {
|
||||||
|
// // 高亮样式
|
||||||
|
// itemStyle: {
|
||||||
|
// color: 'red'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'DSZ',
|
name: 'DSZ',
|
||||||
|
|
@ -594,7 +600,7 @@ export function pieData1() {
|
||||||
orient: 'vertical',
|
orient: 'vertical',
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
name: '原材料使用量(吨)',
|
name: '原材料使用量(千克)',
|
||||||
itemStyle: { color: '#f8cbad', borderWidth: 0 }
|
itemStyle: { color: '#f8cbad', borderWidth: 0 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -630,7 +636,7 @@ export function pieData1() {
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
center: ['50%', '56%'],
|
center: ['50%', '56%'],
|
||||||
name: '原材料使用量(吨)',
|
name: '原材料使用量(千克)',
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
selectedMode: 'single',
|
selectedMode: 'single',
|
||||||
radius: [0, '50%'],
|
radius: [0, '50%'],
|
||||||
|
|
@ -668,7 +674,7 @@ export function pieData1() {
|
||||||
center: ['50%', '56%'],
|
center: ['50%', '56%'],
|
||||||
name: '原材料碳排放量(吨)',
|
name: '原材料碳排放量(吨)',
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: ['50%', '80%'],
|
radius: ['50%', '76%'],
|
||||||
avoidLabelOverlap: false,
|
avoidLabelOverlap: false,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
// borderRadius: 10,
|
// borderRadius: 10,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import DataBaseHead from "@/views/home/components/DataBaseHead.vue";
|
import DataBaseHead from "@/views/home/components/DataBaseHead.vue";
|
||||||
import { cateAdd, cateUpdate, treeDbList, cateInfo, cateDel, cateFileUpdate, cateFileDel, cateFileList, download } from '@/api/daikin/base'
|
import { cateAdd, cateUpdate, treeDbList, cateInfo, cateDel, cateFileUpdate, cateFileDel, cateFileList, download,fetchdbAuthGetInfo } from '@/api/daikin/base'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
import { useMessage,NModal } from 'naive-ui'
|
import { useMessage,NModal } from 'naive-ui'
|
||||||
const store = useUserStore()
|
const store = useUserStore()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const userCode = ['admin','database_dandang','tech_service'].includes(store.user.roleCode) || !!store.user?.isDbUpload || !!store.user?.isDbReview
|
const userCode = ['admin','database_dandang'].includes(store.user.roleCode)
|
||||||
|
const user: any = store.user
|
||||||
|
|
||||||
const { push } = useRouter();
|
const { push } = useRouter();
|
||||||
const title = ref("大金集团经营理念")
|
const title = ref("大金集团经营理念")
|
||||||
|
|
@ -23,7 +24,8 @@ watchEffect(()=>{
|
||||||
prop.cateId
|
prop.cateId
|
||||||
prop.title
|
prop.title
|
||||||
title.value = prop.title
|
title.value = prop.title
|
||||||
getTree()
|
getTree()
|
||||||
|
getAuth()
|
||||||
})
|
})
|
||||||
const tableData = ref()
|
const tableData = ref()
|
||||||
async function getTree() {
|
async function getTree() {
|
||||||
|
|
@ -149,6 +151,22 @@ function getFileNameFromUrl(url: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取该目录下是否设置过权限
|
||||||
|
const hasUpload = ref(false)
|
||||||
|
const hasReview = ref(false)
|
||||||
|
async function getAuth() {
|
||||||
|
if (!prop.cateId) return
|
||||||
|
const { data: uploadUser = [] } = await fetchdbAuthGetInfo({
|
||||||
|
cateId: prop.cateId,
|
||||||
|
type: 1
|
||||||
|
})
|
||||||
|
hasUpload.value = uploadUser.findIndex((x:any) => x.userId === user?.id) > -1
|
||||||
|
const { data: reviewUser = [] } = await fetchdbAuthGetInfo({
|
||||||
|
cateId: prop.cateId,
|
||||||
|
type: 2
|
||||||
|
})
|
||||||
|
hasReview.value = reviewUser.findIndex((x:any) => x.userId === user?.id) > -1
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -179,7 +197,7 @@ function getFileNameFromUrl(url: string) {
|
||||||
<div class="h80px rd-t-15px bg-#4877FB leading-80px text-#fff text-20px">
|
<div class="h80px rd-t-15px bg-#4877FB leading-80px text-#fff text-20px">
|
||||||
<img src="@/assets/images/Shape7@2x.png" class="w50px ml-30px mr10px mt--20px" />
|
<img src="@/assets/images/Shape7@2x.png" class="w50px ml-30px mr10px mt--20px" />
|
||||||
{{ title }}
|
{{ title }}
|
||||||
<el-button v-if="userCode" class="float-right top-25px right-30px" type="primary" @click="push('/DataBase/Modify')">内容管理</el-button>
|
<el-button v-if=" userCode || hasUpload || hasReview" class="float-right top-25px right-30px" type="primary" @click="push('/DataBase/Modify')">内容管理</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="p30px relative h790px">
|
<div class="p30px relative h790px">
|
||||||
<!-- lujinli -->
|
<!-- lujinli -->
|
||||||
|
|
@ -206,9 +224,10 @@ function getFileNameFromUrl(url: string) {
|
||||||
<td class="w20% h50px">{{it.deptName}}</td>
|
<td class="w20% h50px">{{it.deptName}}</td>
|
||||||
<td class="w20% h50px">{{it.parentDeptName}}</td>
|
<td class="w20% h50px">{{it.parentDeptName}}</td>
|
||||||
<td class="w20% h50px">{{it.createTime}}</td>
|
<td class="w20% h50px">{{it.createTime}}</td>
|
||||||
<td class="w16% h50px">
|
<td class="w16% h50px text-center">
|
||||||
<el-button style="color: #000;" @click="openUrl(it)">预览</el-button>
|
<!-- <el-button style="color: #000;" @click="openUrl(it)">预览</el-button> -->
|
||||||
<el-button style="color: #000;" @click="downloads(it)">下载</el-button>
|
<!-- <el-button style="color: #000;" @click="downloads(it)">下载</el-button> -->
|
||||||
|
<el-button style="color: #000;" @click="downloads(it)">查看</el-button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
</div>
|
</div>
|
||||||
<el-tab-pane label="分类管理" name="first">
|
<el-tab-pane label="分类管理" name="first">
|
||||||
<div class="h-52px ">
|
<div class="h-52px ">
|
||||||
<el-button type="primary" @click="editClickA('add')" class="mb-20px">
|
<el-button v-if="userCode" type="primary" @click="editClickA('add')" class="mb-20px">
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -720,6 +720,7 @@ const hasUpload = ref(false)
|
||||||
const setReview = ref(false)
|
const setReview = ref(false)
|
||||||
const hasReview = ref(false)
|
const hasReview = ref(false)
|
||||||
async function getAuth() {
|
async function getAuth() {
|
||||||
|
if (!cateIds.value) return
|
||||||
const { data: uploadUser = [] } = await fetchdbAuthGetInfo({
|
const { data: uploadUser = [] } = await fetchdbAuthGetInfo({
|
||||||
cateId: cateIds.value,
|
cateId: cateIds.value,
|
||||||
type: 1
|
type: 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue