feat : 文章管理crud功能完成

This commit is contained in:
2024-09-21 21:59:12 +08:00
parent 090e9a1ea8
commit 4f594b0bfd
7 changed files with 362 additions and 228 deletions

View File

@@ -281,14 +281,13 @@ import * as echarts from 'echarts'
import {toThousands} from "@/utils/changePrice.js";
import {ElNotification} from "element-plus";
import {getHomeInfo} from "@/api/home";
import {getResearchFundChart} from "@/api/research-fund";
const AuthStore = useAuthStore()
const router = useRouter()
const activeName = ref('first')
const docActiveTab = ref('first')
const totalMoney = ref('45000')
const tableConfigBacklogRef = ref()
const tableConfigReportRef = ref()
const moneyData = ref([
{
companyName: '智汇未来科技公司',
@@ -483,174 +482,7 @@ const problemList = ref([
])
const doneList = ref([])
const todoNum = ref(0)
const reportNum = ref(0)
const auths = {
edit: ['mosr:requirement:resubmit'],
detail: ['mosr:requirement:info'],
add: ['mosr:requirement:add'],
del: ['mosr:requirement:del'],
report: ['mosr:collect:reported'],
}
const tableConfigBacklog = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: 85,
index: index => {
return (tableConfigBacklogRef.value.getQuery().pageNum - 1) * tableConfigBacklogRef.value.getQuery().pageSize + index + 1
}
},
{
prop: 'targetName',
label: '流程名称',
align: 'center',
},
{
prop: 'initiatorName',
label: '发起人',
align: 'center',
},
{
prop: 'targetState',
label: '流程类型',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
if (row.targetState !== null || row.targetState !== undefined) {
return (<Tag dictType={'todo_type'} value={row.targetState}/>)
} else {
return '--'
}
}
},
{
prop: 'submitTime',
label: '提交时间',
align: 'center',
},
{
prop: 'taskName',
label: '当前节点',
align: 'center',
},
{
prop: 'oper',
label: '操作',
fixed: 'right',
width: '150',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={() => handleView(row)}>查看</el-button>
</div>
)
}
}
],
api: '/workflow/mosr/process/task',
params: {},
})
const tableConfigReport = reactive({
columns: [
// {
// type: 'selection',
// prop: 'selection'
// },
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: 85,
index: index => {
return (tableConfigReportRef.value.getQuery().pageNum - 1) * tableConfigReportRef.value.getQuery().pageSize + index + 1
}
},
{
prop: 'requirementName',
label: '征集名称',
align: 'center'
},
{
prop: 'collectType',
label: '征集类型',
align: 'center'
},
{
prop: 'companyName',
label: '征集公司',
align: 'center',
// currentRender: ({row, index}) => (
// <div style={{width: '300px', textOverflow: 'ellipsis',textAlign:'center'}}>{row.companyName}</div>)
},
// {
// prop: 'approveName',
// label: '审批人',
// align: 'center'
// },
{
prop: 'deadline',
label: '截止时间',
align: 'center'
},
// {
// prop: 'taskNode',
// label: '当前节点',
// align: 'center'
// },
{
prop: 'state',
label: '状态',
align: 'center',
width: 200,
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'demand_collection'} value={row.state}/>)
},
{
prop: 'oper',
label: '操作',
align: 'center',
fixed: 'right',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = []
let buttons = new Set(Array.from(row.buttons))
if (buttons.has("details")) {
btn.push({label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary'})
}
if (buttons.has("report")) {
btn.push({label: '需求上报', prem: auths.report, func: () => handleReport(row), type: 'primary'})
}
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
v-perm={item.prem}
onClick={() => item.func()}
link
>
{item.label}
</el-button>
))
}
</div>
)
}
}
],
api: '/workflow/mosr/requirement',
params: {
state: "4"
}
})
const data = reactive({
fundPieCharts: null,
@@ -804,6 +636,12 @@ const moneyPieOption = ref({
},
]
})
onMounted(() => {
// getTodoList()
// getResearchChart()
init()
})
const init = () => {
data.fundPieCharts = echarts.init(document.getElementById('fundPie')).setOption(fundPieOption.value)
data.moneyPieCharts = echarts.init(document.getElementById('moneyPie')).setOption(moneyPieOption.value)
@@ -811,6 +649,7 @@ const init = () => {
const getTodoList=()=>{
getHomeInfo().then(res => {
if (res.code === 1000) {
// todoList.value=res.data.rows
// todoNum.value=res.data.total
}else{
@@ -822,11 +661,23 @@ const getTodoList=()=>{
}
})
}
onMounted(() => {
// getTodoList()
init()
})
const getResearchChart=()=>{
getResearchFundChart().then(res => {
if (res.code === 1000) {
console.info("🚀 ~method:res -----", res.data,res.data.rdCompanyList)
if(moneyPieOption.value.series&&moneyPieOption.value.series?.length>0){
moneyPieOption.value.series[0].data=res.data.rdCompanyList
}
init()
}else{
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
}
})
}
window.addEventListener('resize', () => {
data.fundPieCharts = null
data.moneyPieCharts = null