Browse Source

24小时出入馆

master
xuhuajiao 2 years ago
parent
commit
0664439ca7
  1. 9
      src/api/library.js
  2. 6
      src/assets/styles/style.scss
  3. 25
      src/components/echart/lineChartService.vue
  4. 4
      src/views/accessToLibrary/index.vue
  5. 21
      src/views/notice/index.vue
  6. 25
      src/views/todayBorrowed/index.vue

9
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 { export default {
FetchHalfYearBorrowNum, FetchHalfYearBorrowNum,
FetchBorrowRank, FetchBorrowRank,

6
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 { ::-webkit-scrollbar {
width: 4px; width: 4px;

25
src/components/echart/lineChartService.vue

@ -60,6 +60,7 @@ export default {
this.setOptions(this.chartData) this.setOptions(this.chartData)
}, },
setOptions({ returnData, borrowedData } = {}) { 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({ this.chart.setOption({
backgroundColor: '#010326', backgroundColor: '#010326',
tooltip: { tooltip: {
@ -86,25 +87,35 @@ export default {
grid: { grid: {
left: '2%', left: '2%',
right: '4%', right: '4%',
bottom: '0',
bottom: '4%',
containLabel: true containLabel: true
}, },
xAxis: [{ xAxis: [{
type: 'category', type: 'category',
boundaryGap: false,
// 线
data: time.map(function(item) {
return item
}),
axisLabel: {
interval: 5,
formatter: function(value, idx) {
return value
},
color: '#fff'
},
axisLine: { axisLine: {
show: true,
lineStyle: { lineStyle: {
width: '1', width: '1',
color: '#113D72', color: '#113D72',
type: 'solid' 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: [ yAxis: [
{ {

4
src/views/accessToLibrary/index.vue

@ -14,7 +14,7 @@
</div> </div>
<div v-if="isSelfService" class="accessToLib-item"> <div v-if="isSelfService" class="accessToLib-item">
<span>今日出馆人数</span> <span>今日出馆人数</span>
<count-to :start-val="0" :end-val="dayNum" :duration="3200" class="panel-num" />
<count-to :start-val="0" :end-val="dayOutNum" :duration="3200" class="panel-num" />
</div> </div>
</div> </div>
</template> </template>
@ -40,6 +40,7 @@ export default {
return { return {
timer: null, timer: null,
dayNum: 0, dayNum: 0,
dayOutNum: 0,
monthNum: 0, monthNum: 0,
totalNum: 0 totalNum: 0
} }
@ -67,6 +68,7 @@ export default {
this.dayNum = res.data.dayPeopleNum this.dayNum = res.data.dayPeopleNum
this.monthNum = res.data.monthPeopleNum this.monthNum = res.data.monthPeopleNum
this.totalNum = res.data.historyPeopleNum this.totalNum = res.data.historyPeopleNum
this.dayOutNum = res.data.dayOutNUm
} else { } else {
this.$message.error('接口错误') this.$message.error('接口错误')
} }

21
src/views/notice/index.vue

@ -21,7 +21,7 @@ export default {
data() { data() {
return { return {
noticeData: [], noticeData: [],
content: null
content: ''
} }
}, },
computed: { computed: {
@ -41,13 +41,23 @@ export default {
this.getInitNotice() this.getInitNotice()
}, },
methods: { 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() { getInitNotice() {
FetchInitNotice().then((res) => { FetchInitNotice().then((res) => {
if (res.errCode === 0) { 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 { } else {
this.$message.error('接口错误') this.$message.error('接口错误')
} }
@ -59,4 +69,5 @@ export default {
<style lang="scss"> <style lang="scss">
@import "~@/assets/styles/index.scss"; @import "~@/assets/styles/index.scss";
</style> </style>

25
src/views/todayBorrowed/index.vue

@ -12,7 +12,7 @@
<script> <script>
import LineChartService from '@/components/echart/lineChartService' import LineChartService from '@/components/echart/lineChartService'
import { FetchHalfYearBorrowNum } from '@/api/library'
import { FetchHalfYearBRNum } from '@/api/library'
export default { export default {
name: 'TodayBorrowed', name: 'TodayBorrowed',
components: { components: {
@ -21,31 +21,22 @@ export default {
data() { data() {
return { return {
chartData: { chartData: {
returnData: [0, 232, 101, 264, 90, 500, 250],
borrowedData: [130, 60, 400, 234, 120, 340, 600]
returnData: [],
borrowedData: []
} }
} }
}, },
created() { created() {
}, },
mounted() { mounted() {
// this.getHalfYearBorrowNum()
this.getHalfYearBRNum()
}, },
methods: { methods: {
getHalfYearBorrowNum() {
const params = {
ip: '111' // -便
}
FetchHalfYearBorrowNum(params).then(res => {
getHalfYearBRNum() {
FetchHalfYearBRNum().then(res => {
if (res.errCode === 0) { if (res.errCode === 0) {
// this.totalLendData = res.data.total
// this.chartData.totalLendMonth = res.data.list.map(item => {
// return item.date
// })
// this.chartData.totalLendData = res.data.list.map(item => {
// return item.total
// })
this.chartData.borrowedData = res.data.borrow
this.chartData.returnData = res.data.return
} else { } else {
this.$message.error('接口错误') this.$message.error('接口错误')
} }

Loading…
Cancel
Save