Skip to content

Commit 5093868

Browse files
committed
feat(Loading): 现在的 loading 不再覆盖全屏
1 parent b091c67 commit 5093868

File tree

9 files changed

+15
-14
lines changed

9 files changed

+15
-14
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
- [x] 本地渲染题面(0.2.0)
1717
- [x] 缓存题面(0.3.0)
1818
- [ ] 查看某次提交记录
19-
- [ ] 缓存管理系统
19+
- [x] 缓存管理系统
2020
- [ ] css 自定义页面
21-
- [ ] 解除加载锁定
22-
- [ ] 加快获取 XCsrfToken
21+
- [x] 解除加载锁定
22+
- [x] 加快获取 XCsrfToken
2323

2424
## 本地编译使用方法
2525
**由于同源策略,本地使用时会出现同源策略问题**

src/components/Contest.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default {
101101
let loading = this.$loading({
102102
lock: true,
103103
text: '正在拉取题目',
104-
spinner: 'el-icon-loading',
104+
target: document.getElementById('main'),
105105
background: 'rgba(0, 0, 0, 0.7)'
106106
})
107107
contest.getContestProblem(this.myCid, (e, p) => {

src/components/ContestList.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
</el-button>
7878
</el-button-group>
7979
</template>
80-
8180
</div>
8281
</template>
8382

@@ -104,7 +103,7 @@ export default {
104103
let loading = this.$loading({
105104
lock: true,
106105
text: '正在拉取比赛列表',
107-
spinner: 'el-icon-loading',
106+
target: document.getElementById('main'),
108107
background: 'rgba(0, 0, 0, 0.7)'
109108
})
110109
fetch('https://codeforces.com/api/contest.list').then(response => response.json()).then(json => {

src/components/Home.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</el-menu-item>
4848
</el-menu>
4949
</el-aside>
50-
<el-main>
50+
<el-main id="main">
5151
<Login v-if="status===1" :user="user" :logout="logout" v-on:login="login"></Login>
5252
<Submit v-if="status===2" :user="user" :contestId="contestId" :problemId="problemId"
5353
v-on:submitOver="submitOver"></Submit>

src/components/LocalManager.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
删除账号信息
66
</el-button>
77
<el-table :data="problems"
8-
style="width: 100%">
8+
style="width: 100%"
9+
v-loading="loading">
910
<el-table-column
1011
prop="id"
1112
label="问题编号"
@@ -40,11 +41,13 @@ export default {
4041
data() {
4142
return {
4243
account: false,
43-
problems: []
44+
problems: [],
45+
loading: false
4446
}
4547
},
4648
4749
created() {
50+
this.loading = true
4851
if (window.localStorage.getItem('email') != null)
4952
this.account = true
5053
if (window.localStorage.savedProblem != null) {
@@ -58,6 +61,7 @@ export default {
5861
this.problems.push(pro)
5962
}
6063
}
64+
this.loading = false
6165
},
6266
6367
methods: {

src/components/Login.vue

-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export default {
6565
let loading = this.$loading({
6666
lock: true,
6767
text: '正在登录',
68-
spinner: 'el-icon-loading',
6968
background: 'rgba(0, 0, 0, 0.7)'
7069
})
7170
@@ -98,7 +97,6 @@ export default {
9897
let loading = this.$loading({
9998
lock: true,
10099
text: '正在退出登录',
101-
spinner: 'el-icon-loading',
102100
background: 'rgba(0, 0, 0, 0.7)'
103101
})
104102
common.logout(this.logout, (e) => {

src/components/Problem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default {
160160
let loading = this.$loading({
161161
lock: true,
162162
text: '正在拉取题面',
163-
spinner: 'el-icon-loading',
163+
target: document.getElementById('main'),
164164
background: 'rgba(0, 0, 0, 0.7)'
165165
})
166166
problem.getProblem(this.myCid, this.myPid, (e, d) => {

src/components/Submit.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default {
144144
let loading = this.$loading({
145145
lock: true,
146146
text: '正在提交',
147-
spinner: 'el-icon-loading',
147+
target: document.getElementById('main'),
148148
background: 'rgba(0, 0, 0, 0.7)'
149149
})
150150
common.getXCsrfToken((e, x) => {

src/static/crawler/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let cheerio = require('cheerio')
55
module.exports = {
66
getXCsrfToken: function (callback) {
77
let opts = {
8-
url: basic.url,
8+
url: 'https://codeforces.com/contest/1/problem/A',
99
method: 'GET',
1010
headers: {
1111
'User-Agent': basic.userAgent

0 commit comments

Comments
 (0)