From cec1c3b64cbc473024b3d2ba3aeb72c88629ba84 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 21 Oct 2021 09:31:10 +0800
Subject: [PATCH] +去掉考试管理 +题目行间距 +实操选完才进行下一题
---
vue.config.js | 4
src/page/index/top/top-menu.vue | 101 +++++++++++++++++----------------
src/page/index/top/index.vue | 4
src/styles/element-ui.scss | 8 ++
src/views/startexam/index.vue | 24 ++++++++
5 files changed, 87 insertions(+), 54 deletions(-)
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
index e53e255..ed7b5bf 100644
--- a/src/page/index/top/index.vue
+++ b/src/page/index/top/index.vue
@@ -100,9 +100,9 @@
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
- <el-dropdown-item>
+ <!-- <el-dropdown-item>
<router-link to="/">{{ $t("navbar.dashboard") }}</router-link>
- </el-dropdown-item>
+ </el-dropdown-item> -->
<el-dropdown-item>
<router-link to="/info/index">{{
$t("navbar.userinfo")
diff --git a/src/page/index/top/top-menu.vue b/src/page/index/top/top-menu.vue
index a16ca35..b772fdd 100644
--- a/src/page/index/top/top-menu.vue
+++ b/src/page/index/top/top-menu.vue
@@ -1,19 +1,21 @@
<template>
<div class="top-menu">
- <el-menu :default-active="activeIndex"
- mode="horizontal"
- text-color="#333">
+ <el-menu :default-active="activeIndex" mode="horizontal" text-color="#333">
<el-menu-item index="0" @click.native="openHome(itemHome)" key="0">
<template slot="title">
<i :class="itemHome.source"></i>
- <span>{{generateTitle(itemHome)}}</span>
+ <span>{{ generateTitle(itemHome) }}</span>
</template>
</el-menu-item>
- <template v-for="(item,index) in items">
- <el-menu-item :index="item.id+''" @click.native="openMenu(item)" :key="index">
+ <template v-for="(item, index) in items">
+ <el-menu-item
+ :index="item.id + ''"
+ @click.native="openMenu(item)"
+ :key="index"
+ >
<template slot="title">
- <i :class="item.source" style="padding-right: 5px;"></i>
- <span>{{generateTitle(item)}}</span>
+ <i :class="item.source" style="padding-right: 5px"></i>
+ <span>{{ generateTitle(item) }}</span>
</template>
</el-menu-item>
</template>
@@ -22,48 +24,51 @@
</template>
<script>
- import {mapGetters} from "vuex";
+import { mapGetters } from "vuex";
- export default {
- name: "top-menu",
- data() {
- return {
- itemHome: {
- name: '考试管理',
- source: 'el-icon-menu',
- },
- activeIndex: "0",
- items: [],
- };
+export default {
+ name: "top-menu",
+ data() {
+ return {
+ itemHome: {
+ // name: "考试管理",
+ source: "el-icon-menu",
+ },
+ activeIndex: "0",
+ items: [],
+ };
+ },
+ inject: ["index"],
+ created() {
+ this.getMenu();
+ },
+ computed: {
+ ...mapGetters(["tagCurrent", "menu"]),
+ },
+ methods: {
+ openHome(itemHome) {
+ this.index.openMenu(itemHome);
+ this.$router.push({
+ path: this.$router.$avueRouter.getPath(
+ { name: itemHome.name, src: "" },
+ {}
+ ),
+ });
},
- inject: ["index"],
- created() {
- this.getMenu();
+ openMenu(item) {
+ this.index.openMenu(item);
},
- computed: {
- ...mapGetters(["tagCurrent", "menu"])
+ getMenu() {
+ this.$store.dispatch("GetTopMenu").then((res) => {
+ this.items = res;
+ });
},
- methods: {
- openHome(itemHome) {
- this.index.openMenu(itemHome);
- this.$router.push({
- path: this.$router.$avueRouter.getPath({name: itemHome.name, src: ''}, {})
- });
- },
- openMenu(item) {
- this.index.openMenu(item)
- },
- getMenu() {
- this.$store.dispatch("GetTopMenu").then(res => {
- this.items = res;
- });
- },
- generateTitle(item) {
- return this.$router.$avueRouter.generateTitle(
- item.name,
- (item.meta || {}).i18n
- );
- },
- }
- };
+ generateTitle(item) {
+ return this.$router.$avueRouter.generateTitle(
+ item.name,
+ (item.meta || {}).i18n
+ );
+ },
+ },
+};
</script>
diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index 828f4a2..82efe5f 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -175,14 +175,18 @@
}
.subject-exam-title {
font-size: 30px !important;
+ margin-bottom: 0 !important;
}
.subject-content {
+ margin-top: 10px !important;
span {
- font-size: 24px !important;
+ font-size: 22px !important;
+ line-height: 28px !important;
+ font-weight: 500;
}
.subject-title {
font-size: 24px !important;
- line-height: 24px !important;
+ line-height: 26px !important;
letter-spacing: 0.1rem !important;
}
}
diff --git a/src/views/startexam/index.vue b/src/views/startexam/index.vue
index 190a0a3..0de0288 100644
--- a/src/views/startexam/index.vue
+++ b/src/views/startexam/index.vue
@@ -585,6 +585,30 @@
});
return;
}
+ // if (this.getAnswer() == "") {
+ // this.$message({
+ // message: "请选择答案",
+ // type: "warning",
+ // });
+ // return;
+ // }
+ // console.log(this.getAnswer(), this.query.type);
+ if (this.query.type == 3) {
+ let goShiCao = true;
+ const answer = this.getAnswer();
+ for (let k in answer) {
+ if (answer[k].value == "") {
+ goShiCao = false;
+ }
+ }
+ if (!goShiCao) {
+ this.$message({
+ message: "实操题目请选择完整顺序!",
+ type: "warning",
+ });
+ return;
+ }
+ }
this.subjectIds[i].answer = this.getAnswer();
diff --git a/vue.config.js b/vue.config.js
index 4b43a45..2c88110 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -28,8 +28,8 @@
proxy: {
'/api': {
//本地服务接口地址
- // target: 'http://192.168.0.114:81',
- target: 'http://localhost:81',
+ target: 'http://192.168.0.114:81',
+ // target: 'http://localhost:81',
// target: 'http://172.20.10.2:81',
//远程演示服务地址,可用于直接启动项目
// target: 'http://2h3f861221.wicp.vip:58646',
--
Gitblit v1.9.3