Skip to content

Commit 67a5ccf

Browse files
authored
Merge pull request #35 from ENDsoft233/main
modified lots of ui design
2 parents a02416a + 80c3c89 commit 67a5ccf

File tree

21 files changed

+13919
-9609
lines changed

21 files changed

+13919
-9609
lines changed

.github/workflows/node.js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [10.x, 12.x, 14.x, 15.x]
19+
node-version: [18.x]
2020
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2121

2222
steps:
@@ -25,5 +25,5 @@ jobs:
2525
uses: actions/setup-node@v1
2626
with:
2727
node-version: ${{ matrix.node-version }}
28-
- run: yarn
28+
- run: yarn --ignore-engines
2929
- run: yarn build

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,16 @@ yarn-error.log*
1919
*.njsproj
2020
*.sln
2121
*.sw?
22+
23+
# Yarn 2
24+
.yarn/*
25+
!.yarn/patches
26+
!.yarn/plugins
27+
!.yarn/releases
28+
!.yarn/sdks
29+
!.yarn/versions
30+
31+
# Swap the comments on the following lines if you don't wish to use zero-installs
32+
# Documentation here: https://yarnpkg.com/features/zero-installs
33+
#!.yarn/cache
34+
.pnp.*

package.json

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,41 @@
1313
},
1414
"homepage": "https://github.com/shuosc/shu-scheduling-helper#readme",
1515
"scripts": {
16-
"serve": "vue-cli-service serve",
17-
"build": "vue-cli-service build",
18-
"lint": "vue-cli-service lint"
16+
"serve": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
17+
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
18+
"lint": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service lint"
1919
},
2020
"dependencies": {
21-
"ant-design-vue": "^1.6.5",
22-
"axios": "^0.21.1",
23-
"core-js": "^3.6.5",
24-
"crypto-js": "^3.1.9-1",
25-
"file-saver": "^2.0.2",
26-
"html2canvas": "^1.0.0-rc.7",
27-
"localforage": "^1.9.0",
28-
"mobile-detect": "^1.4.4",
21+
"ant-design-vue": "^1.7.8",
22+
"axios": "^0.27.2",
23+
"core-js": "^3.27.2",
24+
"crypto-js": "^3.3.0",
25+
"file-saver": "^2.0.5",
26+
"html2canvas": "^1.4.1",
27+
"localforage": "^1.10.0",
28+
"mobile-detect": "^1.4.5",
2929
"murmurhash-js": "^1.0.0",
30-
"pako": "^1.0.10",
30+
"pako": "^1.0.11",
3131
"promise-worker": "^2.0.1",
32-
"v-viewer": "~1.5.1",
33-
"vue": "^2.6.12",
34-
"vue-clipboard2": "^0.3.1",
35-
"vuex": "^3.5.1"
32+
"v-viewer": "~1.7.0",
33+
"vue": "^2.7.14",
34+
"vue-clipboard2": "^0.3.3",
35+
"vuex": "^3.6.2"
3636
},
3737
"devDependencies": {
38-
"@vue/cli-plugin-babel": "^4.5.4",
39-
"@vue/cli-plugin-eslint": "^4.5.4",
40-
"@vue/cli-service": "^4.5.4",
41-
"acorn": "^7.4.0",
38+
"@vue/cli-plugin-babel": "^4.5.19",
39+
"@vue/cli-plugin-eslint": "^4.5.19",
40+
"@vue/cli-service": "^4.5.19",
41+
"acorn": "^7.4.1",
4242
"babel-eslint": "^10.1.0",
43-
"babel-plugin-import": "^1.12.2",
44-
"cz-conventional-changelog": "3.1.0",
43+
"babel-plugin-import": "^1.13.6",
44+
"cross-env": "^7.0.3",
45+
"cz-conventional-changelog": "3.3.0",
4546
"eslint": "^5.16.0",
46-
"eslint-plugin-vue": "^5.0.0",
47-
"minimist": "^1.2.2",
47+
"eslint-plugin-vue": "^5.2.3",
48+
"minimist": "^1.2.8",
4849
"vue-cli-plugin-ant-design": "^1.0.1",
49-
"vue-template-compiler": "^2.6.12",
50+
"vue-template-compiler": "^2.7.14",
5051
"worker-plugin": "^3.2.0"
5152
},
5253
"eslintConfig": {

src/mixins/ScheduleTable.js

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,37 @@ export const ClassCardMixin = {
114114
};
115115
},
116116
computed: {
117-
style() {
117+
style () {
118118
return {
119-
color: 'rgba(255, 255, 255, 0.95)',
120-
borderColor: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 1.0)`,
121-
background: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 0.75)`,
122-
opacity: this.course.isPreview ? '0.5' : '1',
123-
};
119+
'classic': [
120+
{
121+
color: 'rgba(255, 255, 255, 0.95)',
122+
borderColor: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 1.0)`,
123+
background: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 0.75)`,
124+
opacity: this.course.isPreview ? '0.5' : '1',
125+
padding: '4px 5px 5px',
126+
'border-top-width': '3px',
127+
'border-top-style': 'solid',
128+
'border-radius': '2px',
129+
},
130+
{
131+
color: 'rgba(255, 255, 255, 0.85)',
132+
},
133+
],
134+
'candy': [
135+
{
136+
color: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 1.0)`,
137+
background: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 0.3)`,
138+
opacity: this.course.isPreview ? '0.5' : '1',
139+
padding: '8px 6px 5px',
140+
'border-radius': '8px',
141+
margin: '1px',
142+
},
143+
{
144+
color: `rgba(${parseInt(this.course.color.substr(1, 2), 16)}, ${parseInt(this.course.color.substr(3, 2), 16)}, ${parseInt(this.course.color.substr(5, 2), 16)}, 0.8)`,
145+
},
146+
]
147+
}
124148
},
125149
_class() {
126150
return {

src/mixins/common/copyCourseId.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export const CopyCourseIdMixin = {
2+
data () {
3+
return {
4+
copyCourseIdDisplayText: '复制',
5+
copyCourseIdDisplayTimeout: -1
6+
}
7+
},
8+
methods: {
9+
handleCourseIdCopied () {
10+
if (this.copyCourseIdDisplayTimeout !== -1)
11+
clearTimeout(this.copyCourseIdDisplayTimeout)
12+
this.$message.success('复制成功!');
13+
this.copyCourseIdDisplayText = '已复制'
14+
this.copyCourseIdDisplayTimeout = setTimeout(() => {
15+
this.copyCourseIdDisplayText = '复制'
16+
}, 1500);
17+
},
18+
handleCourseIdCopyError () {
19+
if (this.copyCourseIdDisplayTimeout !== -1)
20+
clearTimeout(this.copyCourseIdDisplayTimeout)
21+
this.$message.error('复制失败,请手动复制!');
22+
this.copyCourseIdDisplayText = '复制失败'
23+
this.copyCourseIdDisplayTimeout = setTimeout(() => {
24+
this.copyCourseIdDisplayText = '复制'
25+
}, 1500);
26+
},
27+
}
28+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export const UseScheduleTableThemeMixin = {
2+
data () {
3+
return {
4+
ScheduleTableTheme: 'candy',
5+
}
6+
},
7+
computed: {
8+
ScheduleTableThemeText () {
9+
const t = this.ScheduleTableTheme
10+
switch (t) {
11+
case 'candy':
12+
return '糖果';
13+
case 'classic':
14+
return '经典';
15+
default:
16+
return '<unknown>'
17+
}
18+
}
19+
},
20+
created () {
21+
let check = () => {
22+
if (!this.$store.state.loaded) setTimeout(check, 500)
23+
this.ScheduleTableTheme = this.$store.state.useScheduleTableTheme;
24+
}
25+
setTimeout(check, 500)
26+
},
27+
methods: {
28+
handleChangeScheduleTableTheme () {
29+
this.ScheduleTableTheme = this.ScheduleTableTheme === 'candy' ? 'classic' : 'candy'
30+
this.$store.dispatch('setUseScheduleTableTheme', this.ScheduleTableTheme)
31+
}
32+
}
33+
}

src/pages/index/components/LookupPanel/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
rel="external nofollow" target="_blank">
2323
<strong>{{ course.name }}</strong>
2424
</a>
25-
<a-badge :count="`${course.credit}学分`" class="credit-badge" />
25+
<a-badge :count="`${course.credit} 学分`" class="credit-badge" />
2626
<br />
2727
<small class="id-info">{{ course.id }}</small>
2828
</template>

src/pages/index/components/ReservedClassesList/CourseClassesList.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
v-if="selectedClassKey !== null && expanded"
77
>
88
<a-list-item-meta>
9-
<template slot="title">{{ course.classes[selectedClassKey].teacherName }}
9+
<template slot="title">
10+
<CourseColor :course-id="id" :course-name="course.courseName" />
11+
{{ course.classes[selectedClassKey].teacherName }}
1012
<small>({{
1113
$store.getters.extra(`${id}-${selectedClassKey}`).teacher_title
1214
? $store.getters.extra(`${id}-${selectedClassKey}`).teacher_title + ', '
@@ -38,7 +40,6 @@
3840
{{ limitation }}
3941
</a-tag>
4042
</template>
41-
<a-avatar class="selected-avatar" slot="avatar">已选</a-avatar>
4243
</a-list-item-meta>
4344
<NumberCapacity :class-key="`${id}-${selectedClassKey}`" class="number-capacity" slot="actions" />
4445
<a-button @click="unselectClass" slot="actions">取消选择</a-button>
@@ -57,7 +58,7 @@
5758
<a-button @click="conflictsSolving(key)" slot="actions" type="danger" v-else>
5859
冲突
5960
</a-button>
60-
<a-button :disabled="storageBusy" @click="doRemoveReservedClass(key)" slot="actions" type="dashed">- 待选</a-button>
61+
<a-button :disabled="storageBusy" @click="doRemoveReservedClass(key)" slot="actions" type="dashed">取消待选</a-button>
6162
<a-list-item-meta>
6263
<template slot="title">{{ course.classes[key].teacherName }}
6364
<small>({{
@@ -101,11 +102,11 @@
101102
import { conflictSolvingMixin } from '../../../../mixins/common/conflictsSolver';
102103
import { CourseClassesListMixin } from '../../../../mixins/ReservedClassesList';
103104
import NumberCapacity from './NumberCapacity';
104-
105+
import CourseColor from './CourseColor'
105106
106107
export default {
107108
name: 'CourseClassesList',
108-
components: { NumberCapacity },
109+
components: { NumberCapacity, CourseColor },
109110
props: {
110111
course: {
111112
type: Object,
@@ -139,6 +140,15 @@
139140
margin: -12px 0;
140141
}
141142
143+
.selected-class-list-item h4{
144+
font-weight: bold;
145+
color: rgba(0,0,0,0.85);
146+
}
147+
148+
.selected-class-list-item div{
149+
color: rgba(0,0,0,0.65);
150+
}
151+
142152
/*noinspection CssUnusedSymbol*/
143153
.selected-avatar >>> .ant-avatar-string {
144154
transform: scale(0.857143) translateX(-50%) !important;

src/pages/index/components/ReservedClassesList/CourseColor.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525

2626
<style scoped>
2727
.course-color {
28-
position: absolute;
29-
top: 16px;
30-
display: block;
28+
display: inline-block;
29+
margin: 0 4px 1px 2px;
3130
width: 8px;
32-
height: 15px;
31+
height: 8px;
3332
transition: all 0.2s;
33+
border-radius: 8px;
3434
}
3535
</style>

0 commit comments

Comments
 (0)