liuyg
2021-10-21 cec1c3b64cbc473024b3d2ba3aeb72c88629ba84
+去掉考试管理 +题目行间距 +实操选完才进行下一题
5 files modified
141 ■■■■■ changed files
src/page/index/top/index.vue 4 ●●●● patch | view | raw | blame | history
src/page/index/top/top-menu.vue 101 ●●●● patch | view | raw | blame | history
src/styles/element-ui.scss 8 ●●●● patch | view | raw | blame | history
src/views/startexam/index.vue 24 ●●●●● patch | view | raw | blame | history
vue.config.js 4 ●●●● patch | view | raw | blame | history
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")
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>
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;
        }
    }
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();
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',