Browse Source

保留了朱睿的工作不动;
对路由结构做了新的调整,详细内容参考讨论内容;
尚未开始具体页面。

daisy 5 years ago
parent
commit
9909ca9c7d

+ 3 - 7
src/components/bok/NavBar.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="navbar-wrapper">
-    <el-breadcrumb separator-class="el-icon-arrow-right">
-      <el-breadcrumb-item v-for="(p, i) in path" :key="'p-' + i" :to="toBreadcrumbLink(p)">{{ p }}</el-breadcrumb-item>
-    </el-breadcrumb>
+<!--    <el-breadcrumb separator-class="el-icon-arrow-right">-->
+<!--      <el-breadcrumb-item v-for="(p, i) in path" :key="'p-' + i" :to="toBreadcrumbLink(p)">{{ p }}</el-breadcrumb-item>-->
+<!--    </el-breadcrumb>-->
     <el-dropdown trigger="click" style="position: absolute;top: 0px;right: 0px">
       <el-avatar shape="square" :size="30" :src="squareUrl"></el-avatar>
       <template #dropdown>
@@ -35,10 +35,6 @@ export default {
     }
   },
   mounted() {
-    const _this = this;
-
-    _this.path = _this.$route.path.split("/");
-    _this.path[0] = _this.systemName;
   },
   methods: {
     toBreadcrumbLink(p) {

+ 16 - 8
src/components/bok/SideBar.vue

@@ -9,18 +9,26 @@
         @select="handleSelect"
         @open="handleOpen"
         @close="handleClose">
-      <el-menu-item index="questionSearch">
-        <i class="el-icon-search"></i>
-        <template #title>搜索</template>
-      </el-menu-item>
+<!--      <el-menu-item index="questionSearch">-->
+<!--        <i class="el-icon-search"></i>-->
+<!--        <template #title>搜索</template>-->
+<!--      </el-menu-item>-->
       <el-menu-item index="questionRepository">
-        <i class="el-icon-menu"></i>
+        <i class="el-icon-box"></i>
         <template #title>题库</template>
       </el-menu-item>
-      <el-menu-item index="completion">
-        <i class="el-icon-notebook-1"></i>
-        <template #title>已做</template>
+      <el-menu-item index="knowledge">
+        <i class="el-icon-menu"></i>
+        <template #title>知识点</template>
+      </el-menu-item>
+      <el-menu-item index="knowledgeGraph">
+        <i class="el-icon-connection"></i>
+        <template #title>知识图谱</template>
       </el-menu-item>
+<!--      <el-menu-item index="completion">-->
+<!--        <i class="el-icon-notebook-1"></i>-->
+<!--        <template #title>已做</template>-->
+<!--      </el-menu-item>-->
       <el-menu-item index="collection">
         <i class="el-icon-collection"></i>
         <template #title>收藏</template>

+ 2 - 2
src/components/bok/bokMain/Example.vue → src/components/bok/bokMain/Knowledge.vue

@@ -1,10 +1,10 @@
 <template>
-  <div><h1>Example</h1></div>
+<div><h1>Knowledge</h1></div>
 </template>
 
 <script>
 export default {
-  name: "example"
+  name: "Knowledge"
 }
 </script>
 

+ 13 - 0
src/components/bok/bokMain/KnowledgeGraph.vue

@@ -0,0 +1,13 @@
+<template>
+<div><h1>Knowledge Graph</h1></div>
+</template>
+
+<script>
+export default {
+  name: "KnowledgeGraph"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 3 - 3
src/components/bok/bokMain/Completion.vue → src/components/bok/bokMain/KnowledgePoint.vue

@@ -1,15 +1,15 @@
 <template>
 <div>
-  <h1>Completion</h1>
+  <h1>Knowledge Point</h1>
 </div>
 </template>
 
 <script>
 export default {
-  name: "Completion"
+  name: "KnowledgePoint"
 }
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 13 - 0
src/components/bok/bokMain/QuestionList/Search.vue

@@ -0,0 +1,13 @@
+<template>
+<div><h1>Question List Search</h1></div>
+</template>
+
+<script>
+export default {
+  name: "QLSearch"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/components/bok/bokMain/QuestionList/index.vue

@@ -0,0 +1,13 @@
+<template>
+<div><h1>Question List</h1></div>
+</template>
+
+<script>
+export default {
+  name: "QuestionList"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 0
src/components/bok/bokMain/QuestionRepository/Search.vue

@@ -0,0 +1,13 @@
+<template>
+<div><h1>Question Repository Search</h1></div>
+</template>
+
+<script>
+export default {
+  name: "QRSearch"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 12 - 12
src/components/bok/bokMain/QuestionRepository.vue → src/components/bok/bokMain/QuestionRepository/index.vue

@@ -1,16 +1,16 @@
 <template>
   <div class="question-repository">
     <h1>Question Repository</h1>
-    <div>
-      <el-select v-model="select_value" filterable placeholder="请选择">
-        <el-option
-                v-for="item in options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-        </el-option>
-      </el-select>
-    </div>
+<!--    <div>-->
+<!--      <el-select v-model="select_value" filterable placeholder="请选择">-->
+<!--        <el-option-->
+<!--                v-for="item in options"-->
+<!--                :key="item.value"-->
+<!--                :label="item.label"-->
+<!--                :value="item.value">-->
+<!--        </el-option>-->
+<!--      </el-select>-->
+<!--    </div>-->
     <ul v-if="select_value === '选项1'">
       <li v-for="(item, index) in packages">
         <question-package :name="item.name" :description="item.description"
@@ -31,8 +31,8 @@
 </template>
 
 <script>
-  import QuestionPackage from "../../card/QuestionPackage";
-  import BriefQuestionCard from "../../card/BriefQuestionCard";
+  import QuestionPackage from "../../../card/QuestionPackage";
+  import BriefQuestionCard from "../../../card/BriefQuestionCard";
 
   export default {
     name: "QuestionRepository",

+ 0 - 35
src/components/bok/bokMain/QuestionSearch.vue

@@ -1,35 +0,0 @@
-<template>
-  <div>
-    <h1>Question Search</h1>
-    <el-input placeholder="请输入内容" v-model="searchContent" @change="searchQuestion">
-      <template #append>
-        <el-button icon="el-icon-search"></el-button>
-      </template>
-    </el-input>
-  </div>
-</template>
-
-<script>
-export default {
-  name: "QuestionSearch",
-  data() {
-    return {
-      searchContent: "",
-    }
-  },
-  methods:{
-    searchQuestion(content){
-      if (content === ""){
-        return;
-      }
-      alert(content);
-    },
-  },
-}
-</script>
-
-<style scoped>
-.el-input{
-  width: 80%;
-}
-</style>

+ 0 - 66
src/components/question/NavBar.vue

@@ -1,66 +0,0 @@
-<template>
-  <div class="q-navbar-wrapper">
-    <ul>
-      <li><a @click="$router.push('/questionRepository')">题库</a></li>
-    </ul>
-    <el-dropdown trigger="click" style="position: absolute;top: 0px;right: 0px">
-      <el-avatar shape="square" :size="30" :src="squareUrl"></el-avatar>
-      <template #dropdown>
-        <el-dropdown-menu>
-          <el-dropdown-item>选项1</el-dropdown-item>
-          <el-dropdown-item>选项2</el-dropdown-item>
-          <el-dropdown-item>选项3</el-dropdown-item>
-          <el-dropdown-item>选项4</el-dropdown-item>
-        </el-dropdown-menu>
-      </template>
-    </el-dropdown>
-  </div>
-</template>
-
-<script>
-export default {
-  name: "NavBar",
-  data(){
-    return{
-      squareUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
-    }
-  },
-}
-</script>
-
-<style scoped>
-.q-navbar-wrapper{
-  position: relative;
-  width: 100%;
-  height: 50px;
-  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
-}
-
-.q-navbar-wrapper ul{
-  padding: 0px;
-  margin: 0px;
-  list-style: none;
-  height: auto;
-  width: auto;
-  overflow: auto;
-  position: absolute;
-  left: 20px;
-}
-
-.q-navbar-wrapper ul li{
-  padding: 11px 13px 15px 0px;
-  margin: 0px;
-  display: inline-block;
-  float: left;
-  font-size: 18px;
-  cursor: pointer;
-}
-
-.el-avatar {
-  margin: 10px;
-}
-
-.el-avatar:hover{
-  cursor: pointer;
-}
-</style>

+ 35 - 21
src/router/index.js

@@ -22,43 +22,57 @@ const routes = [
     component: () => import('../views/Bok'),
     redirect: '/questionRepository',
     children: [
-      {
-        path: 'example',
-        name: 'Example',
-        component: () => import('../components/bok/bokMain/Example'),
-      },
-      {
-        path: 'questionSearch',
-        name: 'QuestionSearch',
-        component: () => import('../components/bok/bokMain/QuestionSearch'),
-      },
       {
         path: 'questionRepository',
         name: "QuestionRepository",
-        component: () => import("../components/bok/bokMain/QuestionRepository"),
+        component: () => import("../components/bok/bokMain/QuestionRepository/index"),
+        children:[
+          {
+            path: "search/:content",
+            name: "QR_Search",
+            component: ()=>import("../components/bok/bokMain/QuestionRepository/Search"),
+          },
+        ],
       },
       {
         path: "collection",
         name: "Collection",
         component: () => import("../components/bok/bokMain/Collection"),
       },
-      {
-        path: "completion",
-        name: "Completion",
-        component: () => import("../components/bok/bokMain/Completion"),
-      },
       {
         path: "setting",
         name: "Setting",
         component: () => import("../components/bok/bokMain/Setting"),
       },
+      {
+        path: "knowledge",
+        name: "Knowledge",
+        component: ()=>import("@/components/bok/bokMain/Knowledge")
+      },
+      {
+        path: "knowledgeGraph",
+        name: "KnowledgeGraph",
+        component: ()=>import("@/components/bok/bokMain/KnowledgeGraph")
+      },
+      {
+        path: "questionList/:questionListId",
+        name: "QuestionList",
+        component: ()=>import("@/components/bok/bokMain/QuestionList/index"),
+        children: [
+          {
+            path: "search/:content",
+            name: "QL_Search",
+            component:()=>import("@/components/bok/bokMain/QuestionList/Search"),
+          },
+        ],
+      },
+      {
+        path: "knowledgePoint/:knowledgePointId",
+        name: "KnowledgePoint",
+        component: ()=>import("@/components/bok/bokMain/KnowledgePoint")
+      },
     ]
   },
-  {
-    path: "/question/:questionId",
-    name: 'Question',
-    component: () => import('../views/Question')
-  },
   {
     path: "/module/:moduleId",
     name: 'Module',

+ 3 - 3
src/views/Module.vue

@@ -1,5 +1,5 @@
 <template>
-    <Q_NavBar></Q_NavBar>
+<!--    <Q_NavBar></Q_NavBar>-->
     <h1>{{moduleId}}</h1>
     <QuestionListItem v-for="(item, index) in moduleArray"
                         :name="'name' + item"
@@ -9,13 +9,13 @@
 </template>
 
 <script>
-    import Q_NavBar from "@/components/question/NavBar"
+    // import Q_NavBar from "@/components/question/NavBar"
     import QuestionListItem from "../components/card/QuestionListItem";
     export default {
         name: "Module",
         components:{
             QuestionListItem,
-            Q_NavBar
+            // Q_NavBar
         },
         data(){
             return{

+ 0 - 125
src/views/Question.vue

@@ -1,125 +0,0 @@
-<template>
-  <div>
-    <q-navbar></q-navbar>
-    <div class="q-main-container">
-<!--      <h1 style="margin: 0px;padding: 20px">Question-{{questionId}}</h1>-->
-      <el-card class="box-card">
-        <template #header>
-          <div class="card-header">
-            <span>{{questionVO.id}}</span>
-            <span v-if="questionVO.type1 === 0">选择题</span>
-            <span v-else>其他题型</span>
-            <span>tag</span>
-            <span>knwledgeId</span>
-          </div>
-        </template>
-
-        <div class="questionCard-stem">
-          题目: {{questionVO.stem}}
-        </div>
-        <el-divider></el-divider>
-        <div class="questionCard-answer">
-          正确答案:[ {{questionVO.answer}} ]
-        </div>
-        <div class="questionCard-options">
-          <el-radio v-model="answer"  label="A">A: {{questionVO.options["A"]}}</el-radio>
-          <el-radio v-model="answer"  label="B">B: {{questionVO.options["B"]}}</el-radio>
-          <el-radio v-model="answer"  label="C">C: {{questionVO.options["C"]}}</el-radio>
-          <el-radio v-model="answer"  label="D">D: {{questionVO.options["D"]}}</el-radio>
-        </div>
-
-        <el-divider></el-divider>
-
-        <div class="questionCard-operations">
-          <!--      <IconText :src="collectUrl" :message="collectMessage"></IconText>-->
-          <el-button @click="nextQuestion">下一题</el-button>
-          <el-button @click="analyze">题目分析</el-button>
-        </div>
-
-        <div>
-          <el-pagination
-                  :page-size="1"
-                  :pager-count="11"
-                  layout="prev, pager, next"
-                  :total="15">
-          </el-pagination>
-        </div>
-
-      </el-card>
-    </div>
-  </div>
-</template>
-
-<script>
-import Q_NavBar from "@/components/question/NavBar"
-
-export default {
-  name: "Question",
-  components: {
-    "q-navbar": Q_NavBar,
-  },
-  data() {
-    return {
-      questionId: null,
-      answer:"A",
-      questionVO: {
-        id: "00001",
-        type1: 0,
-        stem: "小苏今年几岁了?",
-        options: {
-          "A": "15",
-          "B": "25",
-          "C": "18",
-          "D": "22"
-        },
-        blanks: null,
-        answer: "D",
-        keyPoints: "年龄",
-        analysis: "小苏是2000年出生了,所以得出今年其虚岁为22岁。",
-        tags: ['苏学', '年龄'],
-        knowledgeId: ['计算']
-      }
-    }
-  },
-  mounted() {
-    const _this = this
-    let path = _this.$route.path.split("/")
-    _this.questionId = Number(path[path.length - 1])
-  },
-  methods: {
-    nextQuestion(){
-      alert("next Question!")
-    },
-    analyze(){
-      alert(this.questionVO.analysis)
-    }
-  }
-}
-</script>
-
-<style scoped>
-.q-main-container {
-  background-color: #ecf5ff;
-}
-
-.card-header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-
-.text {
-  font-size: 14px;
-}
-
-.item {
-  margin-bottom: 18px;
-}
-
-.box-card {
-  margin: 40px auto;
-  width: 50%;
-  border: 3px solid cornflowerblue;
-  padding: 10px;
-}
-</style>