From 0664439ca729a57e578d31061186363584f3174d Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Thu, 22 Sep 2022 10:27:59 +0800 Subject: [PATCH] =?UTF-8?q?24=E5=B0=8F=E6=97=B6=E5=87=BA=E5=85=A5=E9=A6=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/library.js | 9 ++++++++ src/assets/styles/style.scss | 6 ++++++ src/components/echart/lineChartService.vue | 25 ++++++++++++++++------ src/views/accessToLibrary/index.vue | 4 +++- src/views/notice/index.vue | 21 +++++++++++++----- src/views/todayBorrowed/index.vue | 25 +++++++--------------- 6 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/api/library.js b/src/api/library.js index 0726005..b8f144a 100644 --- a/src/api/library.js +++ b/src/api/library.js @@ -55,6 +55,15 @@ export function FetchInitIntoNum(params) { }) } +// 24小时借还量 +export function FetchHalfYearBRNum(params) { + return request({ + url: '/txhtsg/getHalfYearBRNum', + method: 'get', + params: params + }) +} + export default { FetchHalfYearBorrowNum, FetchBorrowRank, diff --git a/src/assets/styles/style.scss b/src/assets/styles/style.scss index 68f4955..aa548de 100644 --- a/src/assets/styles/style.scss +++ b/src/assets/styles/style.scss @@ -52,6 +52,12 @@ img[src=""],img:not([src]){ } } +pre{ + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; + word-wrap: break-word; + white-space: pre-wrap; +} + /**滚动条的宽度*/ ::-webkit-scrollbar { width: 4px; diff --git a/src/components/echart/lineChartService.vue b/src/components/echart/lineChartService.vue index b48fd39..ce5e747 100644 --- a/src/components/echart/lineChartService.vue +++ b/src/components/echart/lineChartService.vue @@ -60,6 +60,7 @@ export default { this.setOptions(this.chartData) }, setOptions({ returnData, borrowedData } = {}) { + const time = ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '24:00'] this.chart.setOption({ backgroundColor: '#010326', tooltip: { @@ -86,25 +87,35 @@ export default { grid: { left: '2%', right: '4%', - bottom: '0', + bottom: '4%', containLabel: true }, xAxis: [{ type: 'category', - boundaryGap: false, - // 坐标轴轴线相关设置 + data: time.map(function(item) { + return item + }), + axisLabel: { + interval: 5, + formatter: function(value, idx) { + return value + }, + color: '#fff' + }, axisLine: { - show: true, lineStyle: { width: '1', color: '#113D72', type: 'solid' } }, - axisLabel: { - color: '#fff' + splitLine: { + show: true, + lineStyle: { + color: '#333' + } }, - data: ['04:00', '08:00', '12:00', '16:00', '20:00', '24:00'] + boundaryGap: false }], yAxis: [ { diff --git a/src/views/accessToLibrary/index.vue b/src/views/accessToLibrary/index.vue index ed785c0..7011765 100644 --- a/src/views/accessToLibrary/index.vue +++ b/src/views/accessToLibrary/index.vue @@ -14,7 +14,7 @@
今日出馆人数 - +
@@ -40,6 +40,7 @@ export default { return { timer: null, dayNum: 0, + dayOutNum: 0, monthNum: 0, totalNum: 0 } @@ -67,6 +68,7 @@ export default { this.dayNum = res.data.dayPeopleNum this.monthNum = res.data.monthPeopleNum this.totalNum = res.data.historyPeopleNum + this.dayOutNum = res.data.dayOutNUm } else { this.$message.error('接口错误') } diff --git a/src/views/notice/index.vue b/src/views/notice/index.vue index 7076492..062f12b 100644 --- a/src/views/notice/index.vue +++ b/src/views/notice/index.vue @@ -21,7 +21,7 @@ export default { data() { return { noticeData: [], - content: null + content: '' } }, computed: { @@ -41,13 +41,23 @@ export default { this.getInitNotice() }, methods: { + // 处理方法 + escapeHtml(str) { + var arrEntities = { + 'lt': '<', + 'gt': '>', + 'nbsp': ' ', + 'amp': '&', + 'quot': '"' + } + return str.replace(/&(lt|gt|nbsp|amp|quot|pre);/ig, function(all, t) { + return arrEntities[t] + }) + }, getInitNotice() { FetchInitNotice().then((res) => { if (res.errCode === 0) { - const json = {} - json.des = res.data - this.noticeData.push(json) - this.content = res.data + this.content = this.escapeHtml(res.data) } else { this.$message.error('接口错误') } @@ -59,4 +69,5 @@ export default { diff --git a/src/views/todayBorrowed/index.vue b/src/views/todayBorrowed/index.vue index 7ed58a3..84e355e 100644 --- a/src/views/todayBorrowed/index.vue +++ b/src/views/todayBorrowed/index.vue @@ -12,7 +12,7 @@