Skip to content

Commit

Permalink
🎉 make standard
Browse files Browse the repository at this point in the history
  • Loading branch information
BH4HPA committed Feb 15, 2023
1 parent 1dcc6b6 commit 80c3c89
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 33 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
},
"homepage": "https://github.com/shuosc/shu-scheduling-helper#readme",
"scripts": {
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
"lint": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service lint"
"serve": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
"lint": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service lint"
},
"dependencies": {
"ant-design-vue": "^1.7.8",
Expand All @@ -41,6 +41,7 @@
"acorn": "^7.4.1",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.6",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "3.3.0",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.2.3",
Expand Down
8 changes: 4 additions & 4 deletions src/mixins/ScheduleTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export const ClassCardMixin = {
},
computed: {
style () {
return [
[
return {
'classic': [
{
color: 'rgba(255, 255, 255, 0.95)',
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)`,
Expand All @@ -131,7 +131,7 @@ export const ClassCardMixin = {
color: 'rgba(255, 255, 255, 0.85)',
},
],
[
'candy': [
{
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)`,
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)`,
Expand All @@ -144,7 +144,7 @@ export const ClassCardMixin = {
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)`,
},
]
]
}
},
_class() {
return {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
export const UseScheduleTableThemeMixin = {
data () {
return {
ScheduleTableTheme: 1,
ScheduleTableThemeText: '糖果'
ScheduleTableTheme: 'candy',
}
},
computed: {
ScheduleTableThemeText () {
const t = this.ScheduleTableTheme
switch (t) {
case 'candy':
return '糖果';
case 'classic':
return '经典';
default:
return '<unknown>'
}
}
},
created () {
Expand All @@ -12,17 +24,9 @@ export const UseScheduleTableThemeMixin = {
}
setTimeout(check, 500)
},
watch: {
ScheduleTableTheme: {
handler (newVal) {
this.ScheduleTableThemeText = newVal === 1 ? '糖果' : '经典';
},
immediate: true
}
},
methods: {
handleChangeScheduleTableTheme () {
this.ScheduleTableTheme = (this.ScheduleTableTheme + 1) % 2
this.ScheduleTableTheme = this.ScheduleTableTheme === 'candy' ? 'classic' : 'candy'
this.$store.dispatch('setUseScheduleTableTheme', this.ScheduleTableTheme)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@
.selected-class-list-item h4{
font-weight: bold;
color: black;
color: rgba(0,0,0,0.85);
}
.selected-class-list-item div{
color: rgba(0,0,0,0.8);
color: rgba(0,0,0,0.65);
}
/*noinspection CssUnusedSymbol*/
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index/components/ReservedClassesList/CourseMeta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a :href="getLinkHref(id)" :title="getLinkTitle(course, id)"
@click.stop="showCourseIntroduction($event, getLinkHref(id))" class="course-link course-intro-link"
rel="external nofollow" target="_blank">简介</a>
<a :title="`复制该课程的课程号 (${id})`"
<a :title="`复制课程号 (${id})`"
v-clipboard:copy="id"
v-clipboard:success="handleCourseIdCopied"
@click.stop
Expand Down Expand Up @@ -60,7 +60,7 @@
<script>
import { introductionOpenerMixin } from '../../../../mixins/common/introductionOpener';
import { CourseMetaMixin } from '../../../../mixins/ReservedClassesList';
import { CopyCourseIdMixin } from '../../../../mixins/CopyCourseId'
import { CopyCourseIdMixin } from '../../../../mixins/common/copyCourseId'
import NumberCapacity from './NumberCapacity';
import CourseColor from './CourseColor'
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index/components/ScheduleTable/ClassCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@
}
.teacher-name-venue {
font-size: 11px;
font-size: 12px;
line-height: 16px;
overflow: hidden;
min-height: 16px;
}
.venue {
font-size: 11px;
font-size: 12px;
line-height: 1.25;
}
Expand All @@ -94,7 +94,7 @@
}
.extra {
font-size: 11px;
font-size: 12px;
line-height: 1.25;
}
</style>
2 changes: 1 addition & 1 deletion src/pages/index/components/ScheduleTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<script>
import { ScheduleTableMixin } from '../../../../mixins/ScheduleTable';
import { UseScheduleTableThemeMixin } from '../../../../mixins/UseScheduleTableTheme'
import { UseScheduleTableThemeMixin } from '../../../../mixins/common/useScheduleTableTheme'
import ClassCard from './ClassCard';
import NoPeriodClassCard from './NoPeriodClassCard';
// import QrCard from './QrCard';
Expand Down
6 changes: 3 additions & 3 deletions src/pages/m/components/ScheduleTable/ClassCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
}
.teacher-name-venue {
font-size: 11px;
font-size: 12px;
line-height: 16px;
overflow: hidden;
min-height: 16px;
}
.venue {
font-size: 11px;
font-size: 12px;
line-height: 1.25;
}
Expand All @@ -85,7 +85,7 @@
}
.extra {
font-size: 11px;
font-size: 12px;
line-height: 1.25;
}
</style>
2 changes: 1 addition & 1 deletion src/pages/m/components/ScheduleTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script>
import ClassCard from './ClassCard';
import { ScheduleTableMixin } from '../../../../mixins/ScheduleTable';
import { UseScheduleTableThemeMixin } from '../../../../mixins/UseScheduleTableTheme';
import { UseScheduleTableThemeMixin } from '../../../../mixins/common/useScheduleTableTheme';
export default {
name: 'ScheduleTable',
Expand Down
6 changes: 4 additions & 2 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default new Vuex.Store({
historyPos: 0,
historyHold: false,
showIntroductionNotification: true,
useScheduleTableTheme: 1,
useScheduleTableTheme: 'candy',
},
getters: {
scheduleTableRows(state) {
Expand Down Expand Up @@ -313,6 +313,8 @@ export default new Vuex.Store({
state.showIntroductionNotification = false;
},
SET_SCHEDULETABLE_THEME (state, value) {
if (value !== 'candy' && value !== 'classic')
value = 'candy' // 匹配不到主题需要恢复默认主题
state.useScheduleTableTheme = value;
}
},
Expand All @@ -330,7 +332,7 @@ export default new Vuex.Store({
Storage.get('trimester', null),
Storage.get('backend', null),
Storage.get('colorSeed', 2),
Storage.get('useScheduleTableTheme', 1)
Storage.get('useScheduleTableTheme', 'candy')
]).then((values) => {
context.commit('ALL_CLASSES', values[0]);
context.commit('ALL_CLASSES_HASH', values[1]);
Expand Down
15 changes: 14 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4537,6 +4537,18 @@ __metadata:
languageName: node
linkType: hard

"cross-env@npm:^7.0.3":
version: 7.0.3
resolution: "cross-env@npm:7.0.3"
dependencies:
cross-spawn: ^7.0.1
bin:
cross-env: src/bin/cross-env.js
cross-env-shell: src/bin/cross-env-shell.js
checksum: 26f2f3ea2ab32617f57effb70d329c2070d2f5630adc800985d8b30b56e8bf7f5f439dd3a0358b79cee6f930afc23cf8e23515f17ccfb30092c6b62c6b630a79
languageName: node
linkType: hard

"cross-spawn@npm:^5.0.1":
version: 5.1.0
resolution: "cross-spawn@npm:5.1.0"
Expand All @@ -4561,7 +4573,7 @@ __metadata:
languageName: node
linkType: hard

"cross-spawn@npm:^7.0.0":
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1":
version: 7.0.3
resolution: "cross-spawn@npm:7.0.3"
dependencies:
Expand Down Expand Up @@ -11574,6 +11586,7 @@ __metadata:
babel-eslint: ^10.1.0
babel-plugin-import: ^1.13.6
core-js: ^3.27.2
cross-env: ^7.0.3
crypto-js: ^3.3.0
cz-conventional-changelog: 3.3.0
eslint: ^5.16.0
Expand Down

0 comments on commit 80c3c89

Please sign in to comment.