From 693782e774d2ad9019f94e0f1ba578938d0e2a6c Mon Sep 17 00:00:00 2001
From: xuhuajiao <13476289682@163.com>
Date: Mon, 19 Sep 2022 17:49:15 +0800
Subject: [PATCH] =?UTF-8?q?24=E5=B0=8F=E6=97=B6/api=E8=AF=B7=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 10 +-
package.json | 2 +-
src/api/library.js | 25 +++
src/assets/styles/index.scss | 6 +-
src/components/echart/lineChart.vue | 32 +--
src/components/echart/lineChartService.vue | 202 ++++++++++++++++++
src/main.js | 10 +-
src/router/index.js | 24 ++-
src/utils/request.js | 12 +-
.../index.vue} | 0
src/views/header/index.vue | 14 +-
src/views/index.vue | 20 +-
src/views/indexSelfService.vue | 63 ++++++
.../index.vue} | 28 ++-
.../index.vue} | 2 +-
src/views/{notice.vue => notice/index.vue} | 0
.../{readStar.vue => readStar/index.vue} | 2 +-
src/views/todayBorrowed/index.vue | 61 ++++++
.../index.vue} | 55 +++--
vue.config.js | 8 +-
20 files changed, 482 insertions(+), 94 deletions(-)
create mode 100644 src/api/library.js
create mode 100644 src/components/echart/lineChartService.vue
rename src/views/{accessToLibrary.vue => accessToLibrary/index.vue} (100%)
create mode 100644 src/views/indexSelfService.vue
rename src/views/{lengingRanking.vue => lengingRanking/index.vue} (69%)
rename src/views/{newBookRecommend.vue => newBookRecommend/index.vue} (99%)
rename src/views/{notice.vue => notice/index.vue} (100%)
rename src/views/{readStar.vue => readStar/index.vue} (98%)
create mode 100644 src/views/todayBorrowed/index.vue
rename src/views/{totalLending.vue => totalLending/index.vue} (58%)
diff --git a/.env.development b/.env.development
index 6740be0..652f2ca 100644
--- a/.env.development
+++ b/.env.development
@@ -3,17 +3,17 @@ ENV = 'development'
# 接口地址
#内网服务地址
-VUE_APP_BASE_API = 'http://192.168.99.107:7070'
-VUE_APP_WS_API = 'ws://192.168.99.107:7071'
-VUE_APP_CAMERA_API = '192.168.99.107'
+#VUE_APP_BASE_API = 'http://192.168.99.107:7070'
+#VUE_APP_WS_API = 'ws://192.168.99.107:7071'
+#VUE_APP_CAMERA_API = '192.168.99.107'
# 刘力-本地服地址
#VUE_APP_BASE_API = 'http://192.168.99.65:7070'
#VUE_APP_WS_API = 'ws://192.168.99.65:7071'
# 许镇-本地服地址
-#VUE_APP_BASE_API = 'http://192.168.99.84:7070'
-#VUE_APP_WS_API = 'ws://192.168.99.84:7070'
+VUE_APP_BASE_API = 'http://192.168.99.84:8080'
+VUE_APP_WS_API = 'ws://192.168.99.84:8081'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/package.json b/package.json
index 8d3ec8c..7bec381 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
"axios": "^0.27.2",
"core-js": "^3.6.4",
"echarts": "^4.6.0",
- "element-ui": "^2.15.9",
+ "element-ui": "^2.15.10",
"vue": "^2.6.11",
"vue-awesome": "^4.0.2",
"vue-count-to": "^1.0.13",
diff --git a/src/api/library.js b/src/api/library.js
new file mode 100644
index 0000000..224fb39
--- /dev/null
+++ b/src/api/library.js
@@ -0,0 +1,25 @@
+import request from '@/utils/request'
+// import qs from 'qs'
+
+// 总借阅量
+export function FetchHalfYearBorrowNum(params) {
+ return request({
+ url: '/txhtsg/getHalfYearBorrowNum',
+ method: 'get',
+ params: params
+ })
+}
+
+// 借阅排行榜
+export function FetchBorrowRank(params) {
+ return request({
+ url: '/txhtsg/borrowRank',
+ method: 'get',
+ params: params
+ })
+}
+
+export default {
+ FetchHalfYearBorrowNum,
+ FetchBorrowRank
+}
diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss
index ca4180c..36e7bef 100644
--- a/src/assets/styles/index.scss
+++ b/src/assets/styles/index.scss
@@ -149,8 +149,8 @@
height: 4.125rem;
}
.big-module{
- height: 6.675rem;
- margin:0.1625rem 0;
+ height: 6.8125rem;
+ // margin:0.1625rem 0;
}
//排行榜-推荐 - list
@@ -221,7 +221,7 @@
// 视频
.video-box{
width: 100%;
- height: 5.225rem;
+ height: 5.2125rem;
}
// 阅读之星
diff --git a/src/components/echart/lineChart.vue b/src/components/echart/lineChart.vue
index d960504..e3caac9 100644
--- a/src/components/echart/lineChart.vue
+++ b/src/components/echart/lineChart.vue
@@ -10,7 +10,7 @@ export default {
name: 'AcrossEcharts',
mixins: [resize],
props: {
- addArcivesData: {
+ chartData: {
type: Object,
require: true,
default: function() {
@@ -32,7 +32,7 @@ export default {
}
},
watch: {
- 'addArcivesData': {
+ 'chartData': {
handler(val) {
setTimeout(() => {
this.drawChart()
@@ -67,22 +67,10 @@ export default {
backgroundColor: '#339cff'
}
}
- // formatter: function(params) {
- // var res = "
" + echarts.format.formatTime('yyyy年M月', new Date(params[0].name)) + '
'
- // for (var i = 0; i < params.length; i++) {
- // res += `
- //
- // ${params[i].seriesName}
- // ${params[i].data}
- //
`
- // }
- // return res
- // }
},
xAxis: {
type: 'category',
- // data: this.addArcivesData.addArcivesMonth,
- data: ['2022-01', '2022-02', '2022-03', '2022-04', '2022-05', '2022-06'],
+ data: this.chartData.totalLendMonth,
axisLine: { // 轴线的颜色以及宽度
lineStyle: {
color: 'rgba(17, 61, 114,0.5)'
@@ -94,9 +82,6 @@ export default {
textStyle: {
color: '#fff'
}
- // formatter: function(value) {
- // return echarts.format.formatTime('M月', new Date(value))
- // }
}
},
yAxis: {
@@ -104,10 +89,7 @@ export default {
min: 0,
max: 1000,
splitNumber: 5,
- axisLine: { // 轴线的颜色以及宽度
- // lineStyle: {
- // color: '#113D72'
- // }
+ axisLine: {
show: false
},
axisLabel: { // x轴文字的配置
@@ -128,9 +110,8 @@ export default {
},
series: [
{
- name: '新增档案',
- // data: this.addArcivesData.addArcivesNum,
- data: [100, 200, 300, 500, 600, 800],
+ name: '借阅量',
+ data: this.chartData.totalLendData,
type: 'line',
areaStyle: {
normal: {
@@ -157,7 +138,6 @@ export default {
color: 'rgba(26, 201, 255, 0.1)' // 100% 处的颜色
}
]
- // globalCoord: false // 缺省为 false
}
}
},
diff --git a/src/components/echart/lineChartService.vue b/src/components/echart/lineChartService.vue
new file mode 100644
index 0000000..2ed52fa
--- /dev/null
+++ b/src/components/echart/lineChartService.vue
@@ -0,0 +1,202 @@
+
+
+
+
+
diff --git a/src/main.js b/src/main.js
index ff320ee..f34912d 100644
--- a/src/main.js
+++ b/src/main.js
@@ -3,6 +3,10 @@ import App from './App.vue'
import router from './router'
import store from './store'
+import ElementUI from 'element-ui'
+import 'element-ui/lib/theme-chalk/index.css'
+Vue.use(ElementUI)
+
// 适配flex
import '@/common/flexible.js'
@@ -11,6 +15,10 @@ import './assets/styles/style.scss'
import './assets/iconfont/iconfont.js'
import './assets/fonts/fonts.css'
+// 按需引入然后注册在vue原型上
+import { Message } from 'element-ui'
+Vue.prototype.$message = Message
+
import axios from 'axios'
Vue.prototype.$axios = axios
@@ -22,7 +30,7 @@ import scroll from 'vue-seamless-scroll'
Vue.use(scroll)
Vue.config.productionTip = false
-
+Vue.component(Message.name, Message)
new Vue({
router,
store,
diff --git a/src/router/index.js b/src/router/index.js
index f9ef8a9..294c91c 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -3,14 +3,24 @@ import VueRouter from 'vue-router'
Vue.use(VueRouter)
-const routes = [{
- path: '/',
- name: 'index',
- component: () => import('../views/index.vue'),
- meta: {
- title: '智慧大屏'
+const routes = [
+ {
+ path: '/',
+ name: 'index',
+ component: () => import('../views/index.vue'),
+ meta: {
+ title: '智慧大屏'
+ }
+ },
+ {
+ path: '/selfServiceLibrary',
+ name: 'selfServiceLibrary',
+ component: () => import('../views/indexSelfService.vue'),
+ meta: {
+ title: '24小时自助图书馆'
+ }
}
-}]
+]
const router = new VueRouter({
mode: 'history',
diff --git a/src/utils/request.js b/src/utils/request.js
index 99f050b..57cdf36 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -1,5 +1,5 @@
import axios from 'axios'
-import { Message } from 'element-ui'
+// import { Message } from 'element-ui'
// 创建axios实例
const service = axios.create({
@@ -29,15 +29,7 @@ service.interceptors.request.use(
// response 拦截器
service.interceptors.response.use(
response => {
- const errorMsg = response.data.message
- if (response.data.code === 200) {
- return response.data.data
- } else {
- Message.error({
- message: errorMsg,
- duration: 5000
- })
- }
+ return response.data
},
error => {
return Promise.reject(error)
diff --git a/src/views/accessToLibrary.vue b/src/views/accessToLibrary/index.vue
similarity index 100%
rename from src/views/accessToLibrary.vue
rename to src/views/accessToLibrary/index.vue
diff --git a/src/views/header/index.vue b/src/views/header/index.vue
index af2f2f2..a15c84f 100644
--- a/src/views/header/index.vue
+++ b/src/views/header/index.vue
@@ -10,7 +10,7 @@
- 东西湖区图书馆
+ {{ headerTitle }}
@@ -33,11 +33,23 @@
import { getCurrentTime } from '@/utils/index'
export default {
name: 'Header',
+ props: {
+ headerTitle: {
+ type: String,
+ default: function() {
+ return ''
+ }
+ }
+ },
data() {
return {
nowDate: ''
}
},
+ watch: {
+ headerTitle: function() {
+ }
+ },
created() {
this.timer = setInterval(() => {
this.nowDate = getCurrentTime()
diff --git a/src/views/index.vue b/src/views/index.vue
index 3db95b6..aaaf21e 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -25,12 +25,12 @@
+
+
diff --git a/src/views/lengingRanking.vue b/src/views/lengingRanking/index.vue
similarity index 69%
rename from src/views/lengingRanking.vue
rename to src/views/lengingRanking/index.vue
index 00b279c..0e2a875 100644
--- a/src/views/lengingRanking.vue
+++ b/src/views/lengingRanking/index.vue
@@ -4,22 +4,22 @@
借阅排行榜
-
![]()
+
-
{{ item.title }}
+
{{ item.bookName }}
{{ item.author }}
-
@@ -27,7 +27,8 @@
+
+
diff --git a/src/views/totalLending.vue b/src/views/totalLending/index.vue
similarity index 58%
rename from src/views/totalLending.vue
rename to src/views/totalLending/index.vue
index 4608916..df8b61e 100644
--- a/src/views/totalLending.vue
+++ b/src/views/totalLending/index.vue
@@ -9,7 +9,7 @@
-
+
@@ -17,6 +17,7 @@