use ojtest for test api.
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
LANGUAGE_VALUE,
|
||||
SOURCES,
|
||||
} from "../../../utils/constants"
|
||||
import { isDesktop } from "../../../utils/breakpoints"
|
||||
import { isMobile } from "../../../utils/breakpoints"
|
||||
|
||||
const { problem } = defineProps<{
|
||||
problem: {
|
||||
@@ -19,6 +19,7 @@ const { problem } = defineProps<{
|
||||
const state = reactive({
|
||||
values: ref({ ...SOURCES }),
|
||||
language: problem.languages[0] || "C",
|
||||
isMobile,
|
||||
})
|
||||
|
||||
const monacoEditorRef = ref()
|
||||
@@ -69,7 +70,7 @@ async function init() {
|
||||
lineNumbersMinChars: 3,
|
||||
automaticLayout: true, // 自适应布局
|
||||
tabSize: 4,
|
||||
fontSize: 24, // 字体大小
|
||||
fontSize: state.isMobile ? 16 : 24, // 字体大小
|
||||
scrollBeyondLastLine: false, // 取消代码后面一大段空白
|
||||
})
|
||||
monaco.editor.getModels()[0].onDidChangeContent(() => {
|
||||
@@ -97,7 +98,7 @@ async function init() {
|
||||
</el-form>
|
||||
<div
|
||||
ref="monacoEditorRef"
|
||||
:class="isDesktop ? 'editor' : 'editorMobile'"
|
||||
:class="isMobile ? 'editorMobile' : 'editor'"
|
||||
></div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="测试用例"> 1 </el-tab-pane>
|
||||
|
||||
@@ -36,7 +36,7 @@ onMounted(() => {
|
||||
<el-row v-if="problem._id">
|
||||
<el-col :span="isDesktop ? 12 : 24">
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="题目描述" lazy>
|
||||
<el-tab-pane label="题目描述">
|
||||
<el-scrollbar v-if="isDesktop" height="calc(100vh - 171px)" noresize>
|
||||
<ProblemContent :problem="problem" />
|
||||
</el-scrollbar>
|
||||
@@ -52,10 +52,14 @@ onMounted(() => {
|
||||
<el-tab-pane label="提交情况">3</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
<el-col v-if="isDesktop" :span="12">
|
||||
<el-col v-if="isDesktop" :span="12" class="editorWrapper">
|
||||
<Editor :problem="problem" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.editorWrapper {
|
||||
height: calc(100vh - 171px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -63,10 +63,10 @@ function goSignup() {
|
||||
label-position="right"
|
||||
label-width="70px"
|
||||
>
|
||||
<el-form-item label="用户名" required prop="username">
|
||||
<el-form-item label="用户名" required prop="username" name="username">
|
||||
<el-input v-model="form.username"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" required prop="password">
|
||||
<el-form-item label="密码" required prop="password" name="password">
|
||||
<el-input
|
||||
v-model="form.password"
|
||||
type="password"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ElementPlusResolver } from "unplugin-vue-components/resolvers"
|
||||
import IconsResolver from "unplugin-icons/resolver"
|
||||
import Icons from "unplugin-icons/vite"
|
||||
|
||||
const url = "https://oj.hyyz.izhai.net"
|
||||
const url = "https://ojtest.hyyz.izhai.net"
|
||||
const proxyConfig = {
|
||||
target: url,
|
||||
changeOrigin: true,
|
||||
|
||||
Reference in New Issue
Block a user