Skip to content

Commit

Permalink
Merge pull request #35 from ENDsoft233/main
Browse files Browse the repository at this point in the history
modified lots of ui design
  • Loading branch information
ZKLlab authored Feb 15, 2023
2 parents a02416a + 80c3c89 commit 67a5ccf
Show file tree
Hide file tree
Showing 21 changed files with 13,919 additions and 9,609 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

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

steps:
Expand All @@ -25,5 +25,5 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn --ignore-engines
- run: yarn build
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,16 @@ yarn-error.log*
*.njsproj
*.sln
*.sw?

# Yarn 2
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Swap the comments on the following lines if you don't wish to use zero-installs
# Documentation here: https://yarnpkg.com/features/zero-installs
#!.yarn/cache
.pnp.*
51 changes: 26 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,41 @@
},
"homepage": "https://github.com/shuosc/shu-scheduling-helper#readme",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "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.6.5",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"crypto-js": "^3.1.9-1",
"file-saver": "^2.0.2",
"html2canvas": "^1.0.0-rc.7",
"localforage": "^1.9.0",
"mobile-detect": "^1.4.4",
"ant-design-vue": "^1.7.8",
"axios": "^0.27.2",
"core-js": "^3.27.2",
"crypto-js": "^3.3.0",
"file-saver": "^2.0.5",
"html2canvas": "^1.4.1",
"localforage": "^1.10.0",
"mobile-detect": "^1.4.5",
"murmurhash-js": "^1.0.0",
"pako": "^1.0.10",
"pako": "^1.0.11",
"promise-worker": "^2.0.1",
"v-viewer": "~1.5.1",
"vue": "^2.6.12",
"vue-clipboard2": "^0.3.1",
"vuex": "^3.5.1"
"v-viewer": "~1.7.0",
"vue": "^2.7.14",
"vue-clipboard2": "^0.3.3",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.4",
"@vue/cli-plugin-eslint": "^4.5.4",
"@vue/cli-service": "^4.5.4",
"acorn": "^7.4.0",
"@vue/cli-plugin-babel": "^4.5.19",
"@vue/cli-plugin-eslint": "^4.5.19",
"@vue/cli-service": "^4.5.19",
"acorn": "^7.4.1",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.12.2",
"cz-conventional-changelog": "3.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.0.0",
"minimist": "^1.2.2",
"eslint-plugin-vue": "^5.2.3",
"minimist": "^1.2.8",
"vue-cli-plugin-ant-design": "^1.0.1",
"vue-template-compiler": "^2.6.12",
"vue-template-compiler": "^2.7.14",
"worker-plugin": "^3.2.0"
},
"eslintConfig": {
Expand Down
36 changes: 30 additions & 6 deletions src/mixins/ScheduleTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,37 @@ export const ClassCardMixin = {
};
},
computed: {
style() {
style () {
return {
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)`,
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)`,
opacity: this.course.isPreview ? '0.5' : '1',
};
'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)`,
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)`,
opacity: this.course.isPreview ? '0.5' : '1',
padding: '4px 5px 5px',
'border-top-width': '3px',
'border-top-style': 'solid',
'border-radius': '2px',
},
{
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)`,
opacity: this.course.isPreview ? '0.5' : '1',
padding: '8px 6px 5px',
'border-radius': '8px',
margin: '1px',
},
{
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
28 changes: 28 additions & 0 deletions src/mixins/common/copyCourseId.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export const CopyCourseIdMixin = {
data () {
return {
copyCourseIdDisplayText: '复制',
copyCourseIdDisplayTimeout: -1
}
},
methods: {
handleCourseIdCopied () {
if (this.copyCourseIdDisplayTimeout !== -1)
clearTimeout(this.copyCourseIdDisplayTimeout)
this.$message.success('复制成功!');
this.copyCourseIdDisplayText = '已复制'
this.copyCourseIdDisplayTimeout = setTimeout(() => {
this.copyCourseIdDisplayText = '复制'
}, 1500);
},
handleCourseIdCopyError () {
if (this.copyCourseIdDisplayTimeout !== -1)
clearTimeout(this.copyCourseIdDisplayTimeout)
this.$message.error('复制失败,请手动复制!');
this.copyCourseIdDisplayText = '复制失败'
this.copyCourseIdDisplayTimeout = setTimeout(() => {
this.copyCourseIdDisplayText = '复制'
}, 1500);
},
}
}
33 changes: 33 additions & 0 deletions src/mixins/common/useScheduleTableTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export const UseScheduleTableThemeMixin = {
data () {
return {
ScheduleTableTheme: 'candy',
}
},
computed: {
ScheduleTableThemeText () {
const t = this.ScheduleTableTheme
switch (t) {
case 'candy':
return '糖果';
case 'classic':
return '经典';
default:
return '<unknown>'
}
}
},
created () {
let check = () => {
if (!this.$store.state.loaded) setTimeout(check, 500)
this.ScheduleTableTheme = this.$store.state.useScheduleTableTheme;
}
setTimeout(check, 500)
},
methods: {
handleChangeScheduleTableTheme () {
this.ScheduleTableTheme = this.ScheduleTableTheme === 'candy' ? 'classic' : 'candy'
this.$store.dispatch('setUseScheduleTableTheme', this.ScheduleTableTheme)
}
}
}
2 changes: 1 addition & 1 deletion src/pages/index/components/LookupPanel/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
rel="external nofollow" target="_blank">
<strong>{{ course.name }}</strong>
</a>
<a-badge :count="`${course.credit}学分`" class="credit-badge" />
<a-badge :count="`${course.credit} 学分`" class="credit-badge" />
<br />
<small class="id-info">{{ course.id }}</small>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
v-if="selectedClassKey !== null && expanded"
>
<a-list-item-meta>
<template slot="title">{{ course.classes[selectedClassKey].teacherName }}
<template slot="title">
<CourseColor :course-id="id" :course-name="course.courseName" />
{{ course.classes[selectedClassKey].teacherName }}
<small>({{
$store.getters.extra(`${id}-${selectedClassKey}`).teacher_title
? $store.getters.extra(`${id}-${selectedClassKey}`).teacher_title + ', '
Expand Down Expand Up @@ -38,7 +40,6 @@
{{ limitation }}
</a-tag>
</template>
<a-avatar class="selected-avatar" slot="avatar">已选</a-avatar>
</a-list-item-meta>
<NumberCapacity :class-key="`${id}-${selectedClassKey}`" class="number-capacity" slot="actions" />
<a-button @click="unselectClass" slot="actions">取消选择</a-button>
Expand All @@ -57,7 +58,7 @@
<a-button @click="conflictsSolving(key)" slot="actions" type="danger" v-else>
冲突
</a-button>
<a-button :disabled="storageBusy" @click="doRemoveReservedClass(key)" slot="actions" type="dashed">- 待选</a-button>
<a-button :disabled="storageBusy" @click="doRemoveReservedClass(key)" slot="actions" type="dashed">取消待选</a-button>
<a-list-item-meta>
<template slot="title">{{ course.classes[key].teacherName }}
<small>({{
Expand Down Expand Up @@ -101,11 +102,11 @@
import { conflictSolvingMixin } from '../../../../mixins/common/conflictsSolver';
import { CourseClassesListMixin } from '../../../../mixins/ReservedClassesList';
import NumberCapacity from './NumberCapacity';
import CourseColor from './CourseColor'
export default {
name: 'CourseClassesList',
components: { NumberCapacity },
components: { NumberCapacity, CourseColor },
props: {
course: {
type: Object,
Expand Down Expand Up @@ -139,6 +140,15 @@
margin: -12px 0;
}
.selected-class-list-item h4{
font-weight: bold;
color: rgba(0,0,0,0.85);
}
.selected-class-list-item div{
color: rgba(0,0,0,0.65);
}
/*noinspection CssUnusedSymbol*/
.selected-avatar >>> .ant-avatar-string {
transform: scale(0.857143) translateX(-50%) !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

<style scoped>
.course-color {
position: absolute;
top: 16px;
display: block;
display: inline-block;
margin: 0 4px 1px 2px;
width: 8px;
height: 15px;
height: 8px;
transition: all 0.2s;
border-radius: 8px;
}
</style>
Loading

0 comments on commit 67a5ccf

Please sign in to comment.