增加help组件
This commit is contained in:
@@ -45,6 +45,7 @@
|
|||||||
"vue-loader": "^8.3.0",
|
"vue-loader": "^8.3.0",
|
||||||
"vue-resource": "^0.9.3",
|
"vue-resource": "^0.9.3",
|
||||||
"vue-router": "^0.7.13",
|
"vue-router": "^0.7.13",
|
||||||
|
"vue-strap": "^1.0.11",
|
||||||
"vue-style-loader": "^1.0.0",
|
"vue-style-loader": "^1.0.0",
|
||||||
"webpack": "^1.12.2",
|
"webpack": "^1.12.2",
|
||||||
"webpack-dev-middleware": "^1.4.0",
|
"webpack-dev-middleware": "^1.4.0",
|
||||||
|
|||||||
@@ -15,11 +15,14 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>{{ $t("problem.timeLimit") }}</label>
|
<label>{{ $t("problem.timeLimit") }}</label>
|
||||||
|
<help name="timeLimit"></help>
|
||||||
<input type="number" class="form-control" required>
|
<input type="number" class="form-control" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group"><label>{{ $t("problem.memoryLimit") }}</label>
|
<div class="form-group">
|
||||||
|
<label>{{ $t("problem.memoryLimit") }}</label>
|
||||||
|
<help name="memoryLimit"></help>
|
||||||
<input type="number" class="form-control" required>
|
<input type="number" class="form-control" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -45,6 +48,11 @@
|
|||||||
<problem-sample v-ref:sample></problem-sample>
|
<problem-sample v-ref:sample></problem-sample>
|
||||||
<test-case-mgnt v-ref:testcase></test-case-mgnt>
|
<test-case-mgnt v-ref:testcase></test-case-mgnt>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<code-mirror></code-mirror>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -56,6 +64,8 @@
|
|||||||
import back from "../utils/back.vue"
|
import back from "../utils/back.vue"
|
||||||
import simditor from "../utils/simditor.vue"
|
import simditor from "../utils/simditor.vue"
|
||||||
import tagInput from "../utils/tagInput.vue"
|
import tagInput from "../utils/tagInput.vue"
|
||||||
|
import codeMirror from "../utils/codeMirror.vue"
|
||||||
|
import help from "../utils/help.vue"
|
||||||
|
|
||||||
export default({
|
export default({
|
||||||
data() {
|
data() {
|
||||||
@@ -68,7 +78,9 @@
|
|||||||
problemSample,
|
problemSample,
|
||||||
back,
|
back,
|
||||||
simditor,
|
simditor,
|
||||||
tagInput
|
tagInput,
|
||||||
|
codeMirror,
|
||||||
|
help
|
||||||
},
|
},
|
||||||
ready() {
|
ready() {
|
||||||
this.$refs.testcase.setTestCase([{input_name: "1.in", output_name: "1.out"}], false);
|
this.$refs.testcase.setTestCase([{input_name: "1.in", output_name: "1.out"}], false);
|
||||||
|
|||||||
26
frontend/admin/src/components/utils/help.vue
Normal file
26
frontend/admin/src/components/utils/help.vue
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
<popover trigger="hover" effect="fade" placement="top" header="false"
|
||||||
|
v-bind:content="translate()">
|
||||||
|
<span class="glyphicon glyphicon-question-sign"></span>
|
||||||
|
</popover>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {popover} from "vue-strap"
|
||||||
|
|
||||||
|
export default({
|
||||||
|
props: {
|
||||||
|
name: ""
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
translate() {
|
||||||
|
return this.$t("help." + this.name);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
popover
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -111,6 +111,10 @@ export default {
|
|||||||
chooseFile: "选择文件",
|
chooseFile: "选择文件",
|
||||||
|
|
||||||
unsupportedBrowserWarningMsg: "当前网页 <strong>不支持</strong> 你正在使用的浏览器, 为了正常的访问,请到 <a href=\"http://browsehappy.com/\"> 升级你的浏览器</a>"
|
unsupportedBrowserWarningMsg: "当前网页 <strong>不支持</strong> 你正在使用的浏览器, 为了正常的访问,请到 <a href=\"http://browsehappy.com/\"> 升级你的浏览器</a>"
|
||||||
|
},
|
||||||
|
help: {
|
||||||
|
timeLimit: "1-1000ms",
|
||||||
|
memoryLimit: "最小16M, Java最小32M"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -154,8 +154,6 @@ router.redirect({"/user": "/user/1"});
|
|||||||
router.redirect({"/announcement": "/announcement/1"});
|
router.redirect({"/announcement": "/announcement/1"});
|
||||||
router.redirect({"/problem": "problem/1"});
|
router.redirect({"/problem": "problem/1"});
|
||||||
|
|
||||||
setTimeout(function(){
|
|
||||||
// hide loading
|
// hide loading
|
||||||
document.getElementById("loading").style.display = "none";
|
document.getElementById("loading").style.display = "none";
|
||||||
router.start(App, '#app');
|
router.start(App, '#app');
|
||||||
}, 1500);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user