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 {
FetchHalfYearBorrowNum,
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 {
width: 4px;

25
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: [
{

4
src/views/accessToLibrary/index.vue

@ -14,7 +14,7 @@
</div>
<div v-if="isSelfService" class="accessToLib-item">
<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>
</template>
@ -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('接口错误')
}

21
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 {
<style lang="scss">
@import "~@/assets/styles/index.scss";
</style>

25
src/views/todayBorrowed/index.vue

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

Loading…
Cancel
Save