From 5c1a1d507aa839632ec763802e61a107874e0c7e Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Fri, 11 Oct 2024 14:49:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat=20:=20=E9=A6=96=E9=A1=B5=E4=B8=93?= =?UTF-8?q?=E9=A1=B9=E8=B5=84=E9=87=91=E9=A1=B9=E7=9B=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home/index.js | 8 +++ src/views/home/index.vue | 129 ++++++++++++++++++++++++++------------- 2 files changed, 93 insertions(+), 44 deletions(-) diff --git a/src/api/home/index.js b/src/api/home/index.js index 34068e8..caed0b7 100644 --- a/src/api/home/index.js +++ b/src/api/home/index.js @@ -13,3 +13,11 @@ export const getDoneTaskInfo = () => { method: "get" }); }; + +//获取专项资金饼图数据 +export const getSpecialFundChart = () => { + return request({ + url: '/workflow/home/page/statistic', + method: "get" + }); +}; diff --git a/src/views/home/index.vue b/src/views/home/index.vue index cc84890..23b7cbb 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -29,7 +29,7 @@ - 您有{{ todoList?.length ||0}}条待办需要处理 + 您有{{ todoList?.length || 0 }}条待办需要处理
查看更多 @@ -54,7 +54,10 @@
-
{{item.targetState=='00'?'征集名称':'项目名称'}}:{{ item.targetName }}
+
{{ item.targetState == '00' ? '征集名称' : '项目名称' }}:{{ + item.targetName + }} +
发起人:{{ item.initiatorName }}
当前节点:{{ item.taskName }}
@@ -64,7 +67,7 @@ 提交时间:
{{ item.submitTime }}
- +
查看
@@ -106,9 +109,12 @@
-
{{item.targetState=='00'?'征集名称':'项目名称'}}:{{ item.targetName }}
+
{{ item.targetState == '00' ? '征集名称' : '项目名称' }}:{{ + item.targetName + }} +
发起人:{{ item.initiatorName }}
- +
@@ -116,7 +122,7 @@ 提交时间:
{{ item.submitTime }}
- +
查看
@@ -229,7 +235,9 @@ -
研发投入资金统计图
+
+ 研发投入资金统计图 +
@@ -309,14 +317,15 @@ import {useAuthStore} from '@/stores/userstore.js' import * as echarts from 'echarts' import {toThousands} from "@/utils/changePrice.js"; import {ElNotification} from "element-plus"; -import {getHomeTaskInfo,getDoneTaskInfo} from "@/api/home"; +import {getHomeTaskInfo, getDoneTaskInfo} from "@/api/home"; import {getResearchFundChart} from "@/api/research-fund"; import {getArticle} from "@/api/article"; +import {getSpecialFundChart} from "../../api/home"; const AuthStore = useAuthStore() const router = useRouter() const topLeftHeight = ref('') -const researchFundYear = ref(new Date().getFullYear()+'') +const researchFundYear = ref(new Date().getFullYear() + '') const activeName = ref('first') const docActiveTab = ref('first') const totalMoney = ref('45000') @@ -422,7 +431,7 @@ const fundPieOption = ref({ }, left: 'center', right: 'center', - top: '42%', + top: '42%' }] }, series: [ @@ -542,6 +551,7 @@ const moneyPieOption = ref({ onMounted(async () => { getTodoList() getDoneList() + await getFundChart() await getResearchChart() // nextTick(() => { // let topLeft=document.getElementById('topLeft') @@ -552,7 +562,7 @@ onMounted(async () => { rulesList.value = await getArticleList(1) helpDocList.value = await getArticleList(2) problemList.value = await getArticleList(3) - await initFundCharts() + // await initFundCharts() }) const handleGoToArticleDetail = (row) => { router.push({ @@ -591,7 +601,7 @@ const initMoneyCharts = () => { const getTodoList = () => { getHomeTaskInfo().then(res => { if (res.code === 1000) { - todoList.value=res.data.rows + todoList.value = res.data.rows // todoNum.value=res.data.total } else { ElNotification({ @@ -605,7 +615,7 @@ const getTodoList = () => { const getDoneList = () => { getDoneTaskInfo().then(res => { if (res.code === 1000) { - doneList.value=res.data.rows + doneList.value = res.data.rows // todoNum.value=res.data.total } else { ElNotification({ @@ -616,25 +626,48 @@ const getDoneList = () => { } }) } -const changeResearchFundDataByYear=(year)=>{ - if(year){ +const changeResearchFundDataByYear = (year) => { + if (year) { getResearchChart(year) } } +const getFundChart = () => { + getSpecialFundChart().then(res => { + if (res.code === 1000) { + moneyData.value = res.data + if (res.data?.length == 0) return; + if (fundPieOption.value.series && fundPieOption.value.series?.length > 0) { + fundPieOption.value.series[0].data[0].value = res.data[0].value + fundPieOption.value.series[0].data[0].name = res.data[0].name + fundPieOption.value.series[0].data[1].value = res.data[1].value + fundPieOption.value.series[0].data[1].name = res.data[1].name + nextTick(() => { + initFundCharts() + }) + } + } else { + ElNotification({ + title: '提示', + message: res.msg, + type: 'error' + }) + } + }) +} const getResearchChart = (year) => { getResearchFundChart(year).then(res => { if (res.code === 1000) { totalMoney.value = res.data.totalAmount moneyData.value = res.data.rdCompanyList - if(res.data.rdCompanyList?.length ==0)return; + if (res.data.rdCompanyList?.length == 0) return; - if (moneyPieOption.value.series && moneyPieOption.value.series?.length > 0) { - moneyPieOption.value.series[0].data = res.data.rdCompanyList - nextTick(() => { - initMoneyCharts() - }) - } + if (moneyPieOption.value.series && moneyPieOption.value.series?.length > 0) { + moneyPieOption.value.series[0].data = res.data.rdCompanyList + nextTick(() => { + initMoneyCharts() + }) + } } else { ElNotification({ title: '提示', @@ -803,6 +836,7 @@ const handleView = (row) => { } } + @media only screen and (max-width: 1720px) { .statistics { .block { @@ -817,6 +851,7 @@ const handleView = (row) => { // height: 624px !important; //} } + @media only screen and (max-width: 1620px) { .statistics { .block { @@ -825,6 +860,7 @@ const handleView = (row) => { } } + @media only screen and (max-width: 1500px) { .statistics { .block { @@ -943,28 +979,31 @@ const handleView = (row) => { color: #000000; line-height: 18px; } -.legend-block{ - height: 240px; - overflow-y: auto; - display: flex; - flex-direction: column; - &::-webkit-scrollbar { - width: 6px; - height: 6px; + + .legend-block { + height: 240px; + overflow-y: auto; + display: flex; + flex-direction: column; + + &::-webkit-scrollbar { + width: 6px; + height: 6px; + } + + // 滚动条轨道 + &::-webkit-scrollbar-track { + background: rgb(239, 239, 239); + border-radius: 2px; + } + + // 小滑块 + &::-webkit-scrollbar-thumb { + background: rgba(80, 81, 82, 0.29); + border-radius: 10px; + } } - // 滚动条轨道 - &::-webkit-scrollbar-track { - background: rgb(239, 239, 239); - border-radius: 2px; - } - - // 小滑块 - &::-webkit-scrollbar-thumb { - background: rgba(80, 81, 82, 0.29); - border-radius: 10px; - } -} .legend { margin-top: 14px; display: flex; @@ -990,7 +1029,7 @@ const handleView = (row) => { .money-dot { width: 16px; height: 16px; - flex-shrink:0; + flex-shrink: 0; border-radius: 50%; } } @@ -1236,7 +1275,8 @@ const handleView = (row) => { margin-bottom: 7px; font-size: 12px; } - .target-name{ + + .target-name { width: 140px; color: #000000; margin-bottom: 7px; @@ -1246,6 +1286,7 @@ const handleView = (row) => { white-space: nowrap; -webkit-line-clamp: 1; } + .process-type { white-space: nowrap; margin-top: 13px; From 7fbc2037d3ebc929c34c1a99a573e8393faaa93e Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Fri, 11 Oct 2024 15:00:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat=20:=20=E7=A0=94=E5=8F=91=E6=8A=95?= =?UTF-8?q?=E5=85=A5=E8=B5=84=E9=87=91=E7=AE=A1=E7=90=86=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/research-fund/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/research-fund/index.vue b/src/views/research-fund/index.vue index 0e86846..284b63f 100644 --- a/src/views/research-fund/index.vue +++ b/src/views/research-fund/index.vue @@ -98,14 +98,14 @@ const researchFundTableConfig = reactive({ showOverflowTooltip: false, currentRender: ({row, index}) => { let btn = [] - btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'}) + btn.push({label: '编辑', prem: ['rd:fund:update'], func: () => handleEdit(row), type: 'primary'}) return (
{ btn.map(item => ( item.func()} link > @@ -114,7 +114,7 @@ const researchFundTableConfig = reactive({ )) } { - handleDelete(row)}/> } @@ -125,7 +125,7 @@ const researchFundTableConfig = reactive({ ], api: '/workflow/mosr/rd/list', btns: [ - {name: '新增', key: 'add', color: '#DED0B2'} + {name: '新增', key: 'add', color: '#DED0B2', auth: ['rd:fund:add']} ], params: {} })