Commit 95429c71 authored by 罗林杰's avatar 罗林杰

完善控制台

parent bf406b33
......@@ -94,6 +94,6 @@ export function getArticle(query) {
return request({
url: '/memInfo/getArticle',
method: 'get',
params: { date: query.date}
params: { date: query.date }
})
}
......@@ -155,64 +155,24 @@ export default {
name: 'Control',
data() {
return {
isShow: true,
isShow2: false,
dateLists: ['2023-07-20', '2023-07-21', '2023-07-22', '2023-07-23', '2023-07-24', '2023-07-25', '2023-07-26'],
commitLists: ['7', '16', '4', '11', '13', '19', '12'],
passLists: ['3', '2', '0', '2', '7', '3', '1'],
caseType: 1,
dateLists: [],
commitLists: [],
passLists: [],
articleExamStatusDayNo: [],
articleExamStatusDayYes: [],
articleExamStatusMonthNo: [],
articleExamStatusMonthYes: [],
range: 0,
JudgeMessageForm: {
gx: '',
gx_reploy: '',
jy: '',
jy_reploy: '',
qz: '',
qz_reploy: '',
ts: '',
ts_reploy: '',
zx: '',
zx_reploy: ''
},
causeForm: {
sum: '',
percent: '',
direction: ''
},
visitorDate: {
inCount: '',
nowInCount: '',
outCount: ''
},
userForm: {
authChangeNum: '',
authChange: '',
authCount: '',
lawyerChangeNum: '',
lawyerChange: '',
lawyerCount: '',
registerChangeNum: '',
registerChange: '',
registerCount: ''
},
number: '-50.00',
tableList: [],
peopleNumber: [],
activityNumber: [],
visitCount: [],
options: [
{ value: 1, label: '审判立案' },
{ value: 2, label: '执行立案' },
{ value: 3, label: '保全立案' },
{ value: 4, label: '调解立案' },
{ value: 5, label: '信访立案' }
]
visitCount: []
}
},
mounted() {
this.getList()
this.getPeopleNumber()
this.handleGetStatisticsData()
this.getArticle()
// 通过监听内容部分的宽度让图表resize
var elementResizeDetectorMaker = require('element-resize-detector')
var erd = elementResizeDetectorMaker()
......@@ -252,33 +212,6 @@ export default {
})
},
methods: {
handleClick(row) {
this.$router.push({
path: '/sf/message/messageBack',
query: {
form: JSON.parse(JSON.stringify(row)),
businessId: row.businessId,
leaveStatus: row.leaveStatus
}
})
},
/** 法官留言删除接口*/
del(row) {
this.$confirm(`您确定要删除“${row.leaveTitle}”司法案件?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
judgeLeaveMessage.del(row.businessId).then(res => {
if (res.code === 200) {
this.$message.success('删除成功')
this.handleGetJudgeMessage()
} else {
this.$message.error(res.msg || '网络异常,请稍后重试')
}
})
})
},
getList() {
const queryParams = {
page: 1,
......@@ -308,8 +241,7 @@ export default {
this.dataChartsLeaveMessage()
})
},
/** 获取统计数据图*/
handleGetStatisticsData() {
getArticle() {
// 格式化日期
const date = this.$parseDate(new Date(), 'YYYY-MM-DD')
......@@ -317,10 +249,88 @@ export default {
date: date
}
getArticle(queryParams).then(res => {
this.articleExamStatusDayNo = res.data.articleExamStatusDayNo
this.articleExamStatusDayYes = res.data.articleExamStatusDayYes
this.articleExamStatusMonthNo = res.data.articleExamStatusMonthNo
this.articleExamStatusMonthYes = res.data.articleExamStatusMonthYes
this.handleGetStatisticsData()
})
},
/** 获取统计数据图*/
handleGetStatisticsData() {
if (this.range === 0) {
// 获取从今天到7天前的日期
const date = this.getDateList(7, 'day')
this.dateLists = date.map(item => item.date)
this.commitLists = date.map(dateItem => {
const statusItem = this.articleExamStatusDayYes.find(statusItem => statusItem.date === dateItem.date)
return {
data: statusItem ? statusItem.articleNum : 0,
date: dateItem.date
}
})
this.passLists = date.map(dateItem => {
const statusItem = this.articleExamStatusDayNo.find(statusItem => statusItem.date === dateItem.date)
return {
data: statusItem ? statusItem.articleNum : 0,
date: dateItem.date
}
})
} else if (this.range === 1) {
// 获取从今天到7个月前的月份
const date = this.getDateList(7, 'month')
this.dateLists = date.map(item => item.date)
this.commitLists = date.map(dateItem => {
const statusItem = this.articleExamStatusMonthYes.find(statusItem => statusItem.date === dateItem.date)
return {
data: statusItem ? statusItem.articleNum : 0,
date: dateItem.date
}
})
this.passLists = date.map(dateItem => {
const statusItem = this.articleExamStatusMonthNo.find(statusItem => statusItem.date === dateItem.date)
return {
data: statusItem ? statusItem.articleNum : 0,
date: dateItem.date
}
})
}
this.getRegistrationTime()
},
/** 数据统计*/
getDateList(range, unit) {
const dateList = []
const today = new Date() // 获取今天的日期
for (let i = 0; i < range; i++) {
let date
if (unit === 'day') {
// 如果单位是天,则从今天开始往前推算,直到range天前
date = new Date(today)
date.setDate(today.getDate() - i)
} else if (unit === 'month') {
// 创建一个新的日期对象,避免修改原始的 today 对象,并且确保每月都是第一天
date = new Date(today)
date.setDate(1) // 设置为每月的第一天
date.setMonth(date.getMonth() - i) // 使用新创建的对象进行修改
}
// 将日期格式化为字符串并添加到列表中
dateList.push({
date: this.formatDate(date, unit)
})
}
return dateList.reverse() // 确保日期是从最早到最近排列
},
formatDate(date, unit) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,所以要加1
const day = String(date.getDate()).padStart(2, '0')
if (unit === 'day') {
// 格式化为 YYYY-MM-DD 的形式
return `${year}-${month}-${day}`
} else if (unit === 'month') {
// 格式化为 YYYY-MM 的形式
return `${year}-${month}`
}
},
getRegistrationTime() {
const myChartRegistrationTime = echarts.init(document.getElementById('dataCharts_data'))
var optionRegistrationTime = {
......@@ -349,15 +359,14 @@ export default {
},
series: [{
name: '通过数',
data: this.commitLists,
data: this.commitLists.map(item => item.data),
type: 'line'
},
{
name: '未通过数',
data: this.passLists,
data: this.passLists.map(item => item.data),
type: 'line'
}
]
}]
}
myChartRegistrationTime.setOption(optionRegistrationTime)
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment