Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
CS-Tao committed Dec 25, 2019
2 parents e1d7185 + 7d7a797 commit c914175
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

### 最新版本下载

[![Windows 版本下载链接 v1.9.1](https://img.shields.io/badge/v1.9.1-Windows-limegreen.svg)](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.1/whu-library-seat-setup-1.9.1.exe)
[![Mac OS 版本下载链接 v1.9.1](https://img.shields.io/badge/v1.9.1-Mac%20OS-limegreen.svg)](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.1/whu-library-seat-1.9.1.dmg)
[![Linux 版本下载链接 v1.9.1](https://img.shields.io/badge/v1.9.1-Linux-limegreen.svg)](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.1/whu-library-seat-1.9.1-x86_64.AppImage)
[![Windows 版本下载链接 v1.9.2](https://img.shields.io/badge/v1.9.2-Windows-limegreen.svg)](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.2/whu-library-seat-setup-1.9.2.exe)
[![Mac OS 版本下载链接 v1.9.2](https://img.shields.io/badge/v1.9.2-Mac%20OS-limegreen.svg)](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.2/whu-library-seat-1.9.2.dmg)
[![Linux 版本下载链接 v1.9.2](https://img.shields.io/badge/v1.9.2-Linux-limegreen.svg)](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.2/whu-library-seat-1.9.2-x86_64.AppImage)

### 安装软件

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whu-library-seat",
"version": "1.9.1",
"version": "1.9.2",
"author": "CS-Tao <[email protected]>",
"description": "武汉大学图书馆抢座软件",
"license": null,
Expand Down
8 changes: 5 additions & 3 deletions src/renderer/components/Body/Monitor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ import { monitorStatuses } from './mixin'
const sparkLength = 300
const defaultInterval = 1500
export default {
name: 'monitor-form',
props: {
Expand Down Expand Up @@ -136,7 +138,7 @@ export default {
},
data () {
return {
interval: 1500,
interval: defaultInterval,
last: 60,
intervalTooLowWarned: false,
spark: {
Expand Down Expand Up @@ -192,7 +194,7 @@ export default {
},
warnIntervalTooLow () {
if (!this.intervalTooLowWarned) {
if (this.interval < 1500) {
if (this.interval < defaultInterval) {
this.$message({
type: 'warning',
duration: '0',
Expand All @@ -210,7 +212,7 @@ export default {
case monitorStatuses.starting:
return 20
case monitorStatuses.checking:
return Math.random() > 0.5 ? 40 : -40
return 40
case monitorStatuses.checkFailed:
return -20
case monitorStatuses.checkSuccessfulYes:
Expand Down
27 changes: 12 additions & 15 deletions src/renderer/components/Body/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,43 +278,40 @@ export default {
for (var key in response.data.data.layout) {
this.seats.push(response.data.data.layout[key])
}
this.filterSeats(true)
this.filterSeats()
} else {
this.$message({
type: 'error',
duration: '2000',
showClose: true,
message: response.data.message ? response.data.message : emptyMessage
})
this.filterSeats(true)
this.filterSeats()
}
}).catch(() => {
this.filterSeats(true)
this.filterSeats()
})
},
chargerButtonClicked () {
this.form.battery = !this.form.battery
this.filterSeats(true)
this.filterSeats()
},
sunButtonClicked () {
this.form.sun = !this.form.sun
this.filterSeats(true)
this.filterSeats()
},
filterSeats (disableCache = false) {
filterSeats () {
this.seatsForSelect = this.seats.filter((item) => {
return item.type === 'seat' && (this.form.battery ? item.power : true) && (this.form.sun ? item.window : true)
}).sort((x, y) => {
return parseInt(x.name) - parseInt(y.name)
})
if (!disableCache) {
let cachedSeatExist = this.seatsForSelect.findIndex((item) => {
return item.id === this.seatInfo.seatNum
}) !== -1
if (this.form.library && this.form.library === this.seatInfo.library && this.form.room && this.form.room === this.seatInfo.room && cachedSeatExist) {
this.form.seatNum = this.seatInfo.seatNum
} else {
this.form.seatNum = null
}
let clearSeatSelect = this.form.seatNum >= 0 &&
(this.seatsForSelect.findIndex((item) => {
return item.id === this.form.seatNum
}) === -1)
if (clearSeatSelect) {
this.form.seatNum = null
}
},
showWarning (message) {
Expand Down

0 comments on commit c914175

Please sign in to comment.