Skip to content

Commit 4f69fb6

Browse files
committed
add limitaion of problems and add hidden tag
Signed-off-by: zhangtianli2006 <49156174+zhangtianli2006@users.noreply.github.com>
1 parent 21a6acf commit 4f69fb6

File tree

3 files changed

+43
-9
lines changed

3 files changed

+43
-9
lines changed

src/assets/css/basic.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,5 @@ body {
151151
}
152152

153153
* {
154-
border-radius: 0 !important;
154+
border-radius: 0px !important;
155155
}

src/components/problem/content.vue

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
Fold
1111
<i class="el-icon-arrow-left"></i>
1212
</div>
13-
<div style="display: flex;">
13+
<div class="flex-header">
14+
<el-tag v-if="hidden" type="warning" id="hidden-problem" effect="dark">Hidden</el-tag>
1415
<h1 id="title" class="header">#{{pid}}. {{ title }}</h1>
1516
</div>
1617
<MarkdownContainer v-if="description" :content="description" :allowHTML="this.allowHTML"/>
@@ -53,9 +54,14 @@
5354
<el-divider class="divider">Name</el-divider>
5455
<div class="tool-content">{{title}}</div>
5556
<el-divider class="divider">PID</el-divider>
56-
<div class="tool-content">#. {{pid}}</div>
57-
<el-divider class="divider">Enabled</el-divider>
58-
<div class="tool-content">{{enable}}</div>
57+
<div class="tool-content">#{{pid}}</div>
58+
</el-card>
59+
<el-card shadow="never" class="margin-top">
60+
<div><i class="el-icon-menu" /> Limitation </div>
61+
<el-divider class="divider">Time</el-divider>
62+
<div class="tool-content">{{time}} MS</div>
63+
<el-divider class="divider">Memery</el-divider>
64+
<div class="tool-content">{{memery}} MB</div>
5965
</el-card>
6066
</div>
6167
</div>
@@ -76,7 +82,10 @@ export default {
7682
pid: this.$route.params.id,
7783
allowHTML: false,
7884
isWider: false,
79-
enable: true
85+
enable: true,
86+
hidden: false,
87+
time: 1000,
88+
memery: 128
8089
};
8190
},
8291
methods: {
@@ -85,11 +94,14 @@ export default {
8594
.get(apiurl('/problem/' + String(this.$route.params.id)))
8695
.then(res => {
8796
let data = res.data.res;
97+
console.log(data);
8898
this.title = data.title;
8999
this.pid = data.pid;
90100
this.allowHTML = data.allow_html;
91101
this.description = data.description;
92-
this.enable = data.enabled;
102+
this.memery = data.memory_limit / 1000;
103+
this.time = data.time_limit;
104+
this.hidden = !data.enabled;
93105
})
94106
.catch(err => {
95107
if(err.request.status === 404) {
@@ -115,6 +127,19 @@ export default {
115127
</script>
116128

117129
<style scoped>
130+
#hidden-problem {
131+
margin: 30px 0;
132+
margin-right: 10px;
133+
}
134+
135+
.flex-header {
136+
display: flex;
137+
}
138+
139+
.margin-top {
140+
margin-top: 20px;
141+
}
142+
118143
@media only screen and (max-width: 700px) {
119144
#pannel {
120145
z-index: 1000;
@@ -172,7 +197,7 @@ export default {
172197
}
173198
174199
#info {
175-
margin-top: 30px;
200+
margin-top: 20px;
176201
}
177202
178203
.divider {

src/components/problem/list.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ export default {
4242
} else {
4343
color += 'color-regular-text';
4444
}
45-
x.title = (<router-link to={'/problem/' + String(x.pid)} class={color + ' text-normal'}>{ x.title }</router-link>);
45+
if (!x.enabled) {
46+
x.title = (
47+
<div>
48+
<el-tag effect="dark" type="warning">Hidden</el-tag>
49+
<router-link to={'/problem/' + String(x.pid)} class={color + ' text-normal'}> { x.title }</router-link>
50+
</div>
51+
);
52+
} else {
53+
x.title = (<router-link to={'/problem/' + String(x.pid)} class={color + ' text-normal'}>{ x.title }</router-link>);
54+
}
4655
x.score = (<div class={color + ' text-extra-bold'}>{x.score >= 0 ? x.score : '-'}</div>);
4756
return x;
4857
}

0 commit comments

Comments
 (0)