Merge pull request 'dj' (#822) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/822
This commit is contained in:
2024-10-11 07:00:58 +00:00
3 changed files with 97 additions and 48 deletions

View File

@@ -13,3 +13,11 @@ export const getDoneTaskInfo = () => {
method: "get" method: "get"
}); });
}; };
//获取专项资金饼图数据
export const getSpecialFundChart = () => {
return request({
url: '/workflow/home/page/statistic',
method: "get"
});
};

View File

@@ -29,7 +29,7 @@
<el-icon size="20" color="#F55815"> <el-icon size="20" color="#F55815">
<BellFilled/> <BellFilled/>
</el-icon> </el-icon>
<span>您有{{ todoList?.length ||0}}条待办需要处理</span> <span>您有{{ todoList?.length || 0 }}条待办需要处理</span>
</div> </div>
<div class="todo-more"> <div class="todo-more">
<span>查看更多</span> <span>查看更多</span>
@@ -54,7 +54,10 @@
<Tag dictType="todo_type" :value="item.targetState"/> <Tag dictType="todo_type" :value="item.targetState"/>
</div> </div>
<div v-else></div> <div v-else></div>
<div class="target-name">{{item.targetState=='00'?'征集名称':'项目名称'}}{{ item.targetName }}</div> <div class="target-name">{{ item.targetState == '00' ? '征集名称' : '项目名称' }}{{
item.targetName
}}
</div>
<div class="black-text">发起人{{ item.initiatorName }}</div> <div class="black-text">发起人{{ item.initiatorName }}</div>
<div class="black-text">当前节点{{ item.taskName }}</div> <div class="black-text">当前节点{{ item.taskName }}</div>
<div class="gray-time"> <div class="gray-time">
@@ -64,7 +67,7 @@
<span>提交时间</span> <span>提交时间</span>
</div> </div>
<div class="time"> {{ item.submitTime }}</div> <div class="time"> {{ item.submitTime }}</div>
<!-- <div class="time">时间要求 {{ item.totalTime }}</div>--> <!-- <div class="time">时间要求 {{ item.totalTime }}</div>-->
</div> </div>
<div class="view" @click="handleView(item)">查看</div> <div class="view" @click="handleView(item)">查看</div>
</div> </div>
@@ -106,9 +109,12 @@
<Tag dictType="todo_type" :value="item.targetState"/> <Tag dictType="todo_type" :value="item.targetState"/>
</div> </div>
<div v-else></div> <div v-else></div>
<div class="target-name">{{item.targetState=='00'?'征集名称':'项目名称'}}{{ item.targetName }}</div> <div class="target-name">{{ item.targetState == '00' ? '征集名称' : '项目名称' }}{{
item.targetName
}}
</div>
<div class="black-text">发起人{{ item.initiatorName }}</div> <div class="black-text">发起人{{ item.initiatorName }}</div>
<!-- <div class="black-text">当前节点{{ item.taskName }}</div>--> <!-- <div class="black-text">当前节点{{ item.taskName }}</div>-->
<div class="gray-time"> <div class="gray-time">
<div> <div>
<div class="title"> <div class="title">
@@ -116,7 +122,7 @@
<span>提交时间</span> <span>提交时间</span>
</div> </div>
<div class="time"> {{ item.submitTime }}</div> <div class="time"> {{ item.submitTime }}</div>
<!-- <div class="time">时间要求 {{ item.totalTime }}</div>--> <!-- <div class="time">时间要求 {{ item.totalTime }}</div>-->
</div> </div>
<div class="view" @click="handleView(item)">查看</div> <div class="view" @click="handleView(item)">查看</div>
</div> </div>
@@ -229,7 +235,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="fund-pie" v-if="totalMoney" style="text-align: left;margin-left: 70px;margin-top: 10px">研发投入资金统计图</div> <div class="fund-pie" v-if="totalMoney" style="text-align: left;margin-left: 70px;margin-top: 10px">
研发投入资金统计图
</div>
</div> </div>
</div> </div>
</el-col> </el-col>
@@ -309,14 +317,15 @@ import {useAuthStore} from '@/stores/userstore.js'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import {toThousands} from "@/utils/changePrice.js"; import {toThousands} from "@/utils/changePrice.js";
import {ElNotification} from "element-plus"; import {ElNotification} from "element-plus";
import {getHomeTaskInfo,getDoneTaskInfo} from "@/api/home"; import {getHomeTaskInfo, getDoneTaskInfo} from "@/api/home";
import {getResearchFundChart} from "@/api/research-fund"; import {getResearchFundChart} from "@/api/research-fund";
import {getArticle} from "@/api/article"; import {getArticle} from "@/api/article";
import {getSpecialFundChart} from "../../api/home";
const AuthStore = useAuthStore() const AuthStore = useAuthStore()
const router = useRouter() const router = useRouter()
const topLeftHeight = ref('') const topLeftHeight = ref('')
const researchFundYear = ref(new Date().getFullYear()+'') const researchFundYear = ref(new Date().getFullYear() + '')
const activeName = ref('first') const activeName = ref('first')
const docActiveTab = ref('first') const docActiveTab = ref('first')
const totalMoney = ref('45000') const totalMoney = ref('45000')
@@ -422,7 +431,7 @@ const fundPieOption = ref({
}, },
left: 'center', left: 'center',
right: 'center', right: 'center',
top: '42%', top: '42%'
}] }]
}, },
series: [ series: [
@@ -542,6 +551,7 @@ const moneyPieOption = ref({
onMounted(async () => { onMounted(async () => {
getTodoList() getTodoList()
getDoneList() getDoneList()
await getFundChart()
await getResearchChart() await getResearchChart()
// nextTick(() => { // nextTick(() => {
// let topLeft=document.getElementById('topLeft') // let topLeft=document.getElementById('topLeft')
@@ -552,7 +562,7 @@ onMounted(async () => {
rulesList.value = await getArticleList(1) rulesList.value = await getArticleList(1)
helpDocList.value = await getArticleList(2) helpDocList.value = await getArticleList(2)
problemList.value = await getArticleList(3) problemList.value = await getArticleList(3)
await initFundCharts() // await initFundCharts()
}) })
const handleGoToArticleDetail = (row) => { const handleGoToArticleDetail = (row) => {
router.push({ router.push({
@@ -591,7 +601,7 @@ const initMoneyCharts = () => {
const getTodoList = () => { const getTodoList = () => {
getHomeTaskInfo().then(res => { getHomeTaskInfo().then(res => {
if (res.code === 1000) { if (res.code === 1000) {
todoList.value=res.data.rows todoList.value = res.data.rows
// todoNum.value=res.data.total // todoNum.value=res.data.total
} else { } else {
ElNotification({ ElNotification({
@@ -605,7 +615,7 @@ const getTodoList = () => {
const getDoneList = () => { const getDoneList = () => {
getDoneTaskInfo().then(res => { getDoneTaskInfo().then(res => {
if (res.code === 1000) { if (res.code === 1000) {
doneList.value=res.data.rows doneList.value = res.data.rows
// todoNum.value=res.data.total // todoNum.value=res.data.total
} else { } else {
ElNotification({ ElNotification({
@@ -616,25 +626,48 @@ const getDoneList = () => {
} }
}) })
} }
const changeResearchFundDataByYear=(year)=>{ const changeResearchFundDataByYear = (year) => {
if(year){ if (year) {
getResearchChart(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) => { const getResearchChart = (year) => {
getResearchFundChart(year).then(res => { getResearchFundChart(year).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
totalMoney.value = res.data.totalAmount totalMoney.value = res.data.totalAmount
moneyData.value = res.data.rdCompanyList 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) { if (moneyPieOption.value.series && moneyPieOption.value.series?.length > 0) {
moneyPieOption.value.series[0].data = res.data.rdCompanyList moneyPieOption.value.series[0].data = res.data.rdCompanyList
nextTick(() => { nextTick(() => {
initMoneyCharts() initMoneyCharts()
}) })
} }
} else { } else {
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -803,6 +836,7 @@ const handleView = (row) => {
} }
} }
@media only screen and (max-width: 1720px) { @media only screen and (max-width: 1720px) {
.statistics { .statistics {
.block { .block {
@@ -817,6 +851,7 @@ const handleView = (row) => {
// height: 624px !important; // height: 624px !important;
//} //}
} }
@media only screen and (max-width: 1620px) { @media only screen and (max-width: 1620px) {
.statistics { .statistics {
.block { .block {
@@ -825,6 +860,7 @@ const handleView = (row) => {
} }
} }
@media only screen and (max-width: 1500px) { @media only screen and (max-width: 1500px) {
.statistics { .statistics {
.block { .block {
@@ -943,28 +979,31 @@ const handleView = (row) => {
color: #000000; color: #000000;
line-height: 18px; line-height: 18px;
} }
.legend-block{
height: 240px; .legend-block {
overflow-y: auto; height: 240px;
display: flex; overflow-y: auto;
flex-direction: column; display: flex;
&::-webkit-scrollbar { flex-direction: column;
width: 6px;
height: 6px; &::-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 { .legend {
margin-top: 14px; margin-top: 14px;
display: flex; display: flex;
@@ -990,7 +1029,7 @@ const handleView = (row) => {
.money-dot { .money-dot {
width: 16px; width: 16px;
height: 16px; height: 16px;
flex-shrink:0; flex-shrink: 0;
border-radius: 50%; border-radius: 50%;
} }
} }
@@ -1236,7 +1275,8 @@ const handleView = (row) => {
margin-bottom: 7px; margin-bottom: 7px;
font-size: 12px; font-size: 12px;
} }
.target-name{
.target-name {
width: 140px; width: 140px;
color: #000000; color: #000000;
margin-bottom: 7px; margin-bottom: 7px;
@@ -1246,6 +1286,7 @@ const handleView = (row) => {
white-space: nowrap; white-space: nowrap;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
} }
.process-type { .process-type {
white-space: nowrap; white-space: nowrap;
margin-top: 13px; margin-top: 13px;

View File

@@ -98,14 +98,14 @@ const researchFundTableConfig = reactive({
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
let btn = [] let btn = []
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'}) btn.push({label: '编辑', prem: ['rd:fund:update'], func: () => handleEdit(row), type: 'primary'})
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
{ {
btn.map(item => ( btn.map(item => (
<el-button <el-button
type={item.type} type={item.type}
// v-perm={item.prem} v-perm={item.prem}
onClick={() => item.func()} onClick={() => item.func()}
link link
> >
@@ -114,7 +114,7 @@ const researchFundTableConfig = reactive({
)) ))
} }
{ {
<popover-delete name={row.rdCompany} type={'研发投入资金'} btnType={'danger'} <popover-delete name={row.rdCompany} type={'研发投入资金'} btnType={'danger'} perm={['rd:fund:remove']}
onDelete={() => handleDelete(row)}/> onDelete={() => handleDelete(row)}/>
} }
@@ -125,7 +125,7 @@ const researchFundTableConfig = reactive({
], ],
api: '/workflow/mosr/rd/list', api: '/workflow/mosr/rd/list',
btns: [ btns: [
{name: '新增', key: 'add', color: '#DED0B2'} {name: '新增', key: 'add', color: '#DED0B2', auth: ['rd:fund:add']}
], ],
params: {} params: {}
}) })