Explorar el Código

feat: 审核按钮

daisy hace 5 años
padre
commit
fab4e8aa90

+ 65 - 3
src/components/AbstractQuestionCard.vue

@@ -33,7 +33,9 @@
                     <el-button type="text" circle @click="withdraw" v-show="isAll"><strong>收起</strong></el-button>
                     <el-button type="text" circle @click="withdraw" v-show="isAll"><strong>收起</strong></el-button>
                 </el-col>
                 </el-col>
                 <el-col :span="1">
                 <el-col :span="1">
-                    <el-button type="primary" icon="el-icon-edit" circle @click="updateQuestion"></el-button>
+                  <el-button type="primary" icon="el-icon-edit" circle @click="updateQuestion"></el-button>
+                  <el-button type="primary" icon="el-icon-check" circle @click="checkQuestionSuccess"></el-button>
+                  <el-button type="warning" icon="el-icon-close" circle @click="checkDialogVisible=true"></el-button>
                 </el-col>
                 </el-col>
                 <el-col :span="1">
                 <el-col :span="1">
                     <el-button v-if="isDelete === false" type="danger" icon="el-icon-delete" circle @click="deleteQuestion"></el-button>
                     <el-button v-if="isDelete === false" type="danger" icon="el-icon-delete" circle @click="deleteQuestion"></el-button>
@@ -166,6 +168,19 @@
     >
     >
         <QuestionUpdater :question="questionvo" @closeDialog="closeDialog"/>
         <QuestionUpdater :question="questionvo" @closeDialog="closeDialog"/>
     </el-drawer>
     </el-drawer>
+
+  <el-dialog title="审核不通过原因" v-model="checkDialogVisible" width="30%" center
+             :before-close="handleCheckDialogClose">
+    <el-space direction="vertical">
+    <el-space direction="vertical" :fill="true">
+      <el-checkbox-group v-model="failCheckList">
+        <el-checkbox v-for="(item, index) in failCheckOption" :label="item"/>
+      </el-checkbox-group>
+      <el-input v-model="failCheckInput" placeholder="请输入原因"/>
+    </el-space>
+    <el-button type="primary" @click="checkQuestionFail">提交</el-button>
+    </el-space>
+  </el-dialog>
 </template>
 </template>
 
 
 <script>
 <script>
@@ -190,6 +205,15 @@
                 isDelete: false,
                 isDelete: false,
                 dialog: false,
                 dialog: false,
                 checkedUserName: '',
                 checkedUserName: '',
+              // 审核dialog的可视化
+              checkDialogVisible: false,
+              // 审核失败的原因
+              failCheckOption: [
+                  '题目中存在错误','题目与相关内容无关','题目中存在敏感词','其他'
+              ],
+              // 详细解释
+              failCheckInput: "",
+              failCheckList: []
             }
             }
         },
         },
         methods:{
         methods:{
@@ -264,7 +288,41 @@
                 if ( minute < 10 ) { minute = '0' + minute; }
                 if ( minute < 10 ) { minute = '0' + minute; }
                 if ( second < 10 ) { second = '0' + second; }
                 if ( second < 10 ) { second = '0' + second; }
                 return year +"-"+ month +"-" + theDate + " "+ hour +":"+ minute +":"+ second;
                 return year +"-"+ month +"-" + theDate + " "+ hour +":"+ minute +":"+ second;
-            }
+            },
+
+          // 题目审核通过
+          checkQuestionSuccess(){
+            const _this = this
+            console.log(_this.questionvo)
+            console.log(_this.$store.state.user)
+            console.log("当前时间")
+            // todo 更新题目的状态
+          },
+
+          // 题目审核不通过
+          checkQuestionFail(){
+            const _this = this
+            console.log(_this.questionvo)
+            console.log(_this.$store.state.user)
+            console.log(_this.failCheckList)
+            console.log(_this.failCheckInput)
+            console.log("当前时间")
+            // todo 更新题目的状态
+            _this.failCheckList = []
+            _this.failCheckInput = ""
+            _this.checkDialogVisible = false
+          },
+
+          // 关闭审核dialog前的方法
+          handleCheckDialogClose(done){
+            const _this = this
+            _this.$confirm('此操作将丢失填写信息, 是否继续?', '提示')
+                .then(() => {
+                  _this.failCheckList = []
+                  _this.failCheckInput = ""
+                  done()})
+                .catch(()=>{})
+          },
         },
         },
         computed: {
         computed: {
             // checkedUserName() {
             // checkedUserName() {
@@ -289,7 +347,6 @@
                     console.log(err);
                     console.log(err);
                 })
                 })
             }
             }
-
         }
         }
     }
     }
 </script>
 </script>
@@ -338,4 +395,9 @@
         margin-bottom: 10px;
         margin-bottom: 10px;
     }
     }
 
 
+    label.el-checkbox{
+      padding: 5px;
+      width: 100%;
+    }
+
 </style>
 </style>

+ 0 - 13
src/components/ListItem.vue

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

+ 66 - 0
src/views/Bok/Main/Review/index.vue

@@ -0,0 +1,66 @@
+<template>
+  <h1>题目审查</h1>
+  <el-button @click="jumpToLogin">jumpToLogin</el-button>
+  <div>
+    <checkQuestionCard v-for="(item, index) in questionvoList"
+                       :questionvo="item"></checkQuestionCard>
+  </div>
+</template>
+
+<script>
+import checkQuestionCard from "@/components/checkQuestionCard";
+
+export default {
+  name: "Review",
+  components: {
+    checkQuestionCard,
+  },
+  data() {
+    return {
+      questionvoList: [
+        {
+          id: '123456',
+          type: 'choice',
+          state: 'CHECKING',
+          checkedUserId: 0,
+          savedUserId: 364,
+          stem: '',
+          weight: 0,
+          analysis: '',
+          keyPoints: '',
+          tags: [],
+          knowledgeId: [],
+          options: {},
+          blanks: {},
+          answer: '',
+          inputOutputMapping: {},
+          millisecondLimit: 0,
+          memoryLimit: 0,
+          createdTime: Date,
+          lastModifiedTime: Date,
+        },
+        {}
+      ]
+
+    }
+  },
+  methods: {
+    getLoginUrl() {
+      const portal = 'http://p.seecoder.cn'
+
+      const location = window.location
+      return `${portal}/api/interaction?client_id=seec-mooc&redirect_uri=${encodeURIComponent(
+          location.origin + '/'
+      )}&scope=openid`
+    },
+    jumpToLogin() {
+      window.location.href = this.getLoginUrl()
+    },
+
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 6 - 9
src/views/Bok/Main/Search/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-    <el-space :fill="true" direction="vertical" alignment="flex-start" :size="30">
+    <el-space :fill="true" direction="vertical" alignment="flex-start" :size="30" style="width: 90%;">
         <h1>Question Search</h1>
         <h1>Question Search</h1>
         <el-input placeholder="请输入内容" v-model="searchContent" @keydown.enter="clickSearch">
         <el-input placeholder="请输入内容" v-model="searchContent" @keydown.enter="clickSearch">
             <template #append>
             <template #append>
@@ -34,7 +34,6 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import QuestionList from "@/components/ListItem";
 import ButtonFilter from "@/components/ButtonFilter";
 import ButtonFilter from "@/components/ButtonFilter";
 import Sorter from "@/components/Sorter";
 import Sorter from "@/components/Sorter";
 import BriefQuestionCard from "@/components/BriefQuestionCard";
 import BriefQuestionCard from "@/components/BriefQuestionCard";
@@ -42,11 +41,11 @@ import SearchFilter from "@/components/SearchFilter";
 import AbstractQuestionCard from "../../../../components/AbstractQuestionCard";
 import AbstractQuestionCard from "../../../../components/AbstractQuestionCard";
 import axios from "axios";
 import axios from "axios";
 import src from "./srcData"
 import src from "./srcData"
+import {knowledgeData} from "@/utils/knowledgeData";
 
 
 export default {
 export default {
     name: "Search",
     name: "Search",
     components: {
     components: {
-        QuestionList,
         ButtonFilter,
         ButtonFilter,
         SearchFilter,
         SearchFilter,
         "qr-sorter": Sorter,
         "qr-sorter": Sorter,
@@ -124,6 +123,7 @@ export default {
             _this.searchContent = _this.$route.params.searchContent;
             _this.searchContent = _this.$route.params.searchContent;
             _this.clickSearch()
             _this.clickSearch()
         }
         }
+        console.log(knowledgeData)
     },
     },
     methods: {
     methods: {
         // 展开和收起
         // 展开和收起
@@ -359,14 +359,11 @@ export default {
 }
 }
 
 
 .collapse-title {
 .collapse-title {
-    display: flex;
-
-&
--length {
+  display: flex;
+  &-length {
     margin-left: auto;
     margin-left: auto;
     margin-right: 14px;
     margin-right: 14px;
-}
-
+  }
 }
 }
 ::v-deep .el-collapse-item__content {
 ::v-deep .el-collapse-item__content {
     padding: 0;
     padding: 0;

+ 7 - 2
src/views/Bok/Main/Search/srcData.js

@@ -1,4 +1,5 @@
 import axios from "axios";
 import axios from "axios";
+import knowledgeJson from "@/assets/knowledge.json"
 
 
 const typeOption = [
 const typeOption = [
   {
   {
@@ -52,7 +53,11 @@ const levelOption = [
 
 
 const tagKeyword = ["111", "222"]
 const tagKeyword = ["111", "222"]
 
 
-const knowledgeKeyword = ["java", "python", "c++"]
+let knowledgeKeyword = []
+
+for (let knowledgeJsonElement of knowledgeJson) {
+  knowledgeKeyword.push(knowledgeJsonElement.name)
+}
 
 
 const sortOption = [
 const sortOption = [
   {
   {
@@ -71,4 +76,4 @@ export default {
   tagKeyword,
   tagKeyword,
   knowledgeKeyword,
   knowledgeKeyword,
   sortOption,
   sortOption,
-}
+}

+ 1 - 1
src/views/Bok/Main/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <router-view :key="$route.path" style="padding-left: 20px;padding-right: 20px;width:calc(100% - 40px)"/>
+  <router-view :key="$route.path"/>
 </template>
 </template>
 
 
 <script>
 <script>

+ 2 - 1
src/views/Bok/NavBar.vue

@@ -1,12 +1,13 @@
 <template>
 <template>
     <div class="navbar-wrapper">
     <div class="navbar-wrapper">
         <el-input placeholder="请输入内容" v-model="searchContent" size="mini" class="input-with-select"
         <el-input placeholder="请输入内容" v-model="searchContent" size="mini" class="input-with-select"
-        v-if="$route.path!=='/Search'" @keydown.enter="clickSearch">
+        v-if="$route.path!=='/search'" @keydown.enter="clickSearch">
             <template #append>
             <template #append>
                 <el-button icon="el-icon-search" @click="clickSearch"/>
                 <el-button icon="el-icon-search" @click="clickSearch"/>
             </template>
             </template>
         </el-input>
         </el-input>
         <el-dropdown trigger="click" style="position: absolute;top: 0px;right: 0px">
         <el-dropdown trigger="click" style="position: absolute;top: 0px;right: 0px">
+          <p style="position: absolute;top: 15px;left: -80px">{{$store.state.user.name}}</p>
             <el-avatar shape="square" :size="30" :src="squareUrl"></el-avatar>
             <el-avatar shape="square" :size="30" :src="squareUrl"></el-avatar>
             <template #dropdown>
             <template #dropdown>
                 <el-dropdown-menu>
                 <el-dropdown-menu>

+ 2 - 4
src/views/Bok/SideBar.vue

@@ -29,10 +29,6 @@
         <i class="el-icon-document"></i>
         <i class="el-icon-document"></i>
         <template #title>试卷袋</template>
         <template #title>试卷袋</template>
       </el-menu-item>
       </el-menu-item>
-<!--      <el-menu-item index="collection">-->
-<!--        <i class="el-icon-collection"></i>-->
-<!--        <template #title>收藏</template>-->
-<!--      </el-menu-item>-->
       <el-menu-item index="check">
       <el-menu-item index="check">
         <i class="el-icon-circle-check"></i>
         <i class="el-icon-circle-check"></i>
         <template #title>审核</template>
         <template #title>审核</template>
@@ -79,12 +75,14 @@ export default {
 @import "../../style/variables";
 @import "../../style/variables";
 
 
 .sidebar-wrapper {
 .sidebar-wrapper {
+  z-index: 10000;
   position: fixed;
   position: fixed;
   width: $sideBarWidth;
   width: $sideBarWidth;
   height: 100%;
   height: 100%;
   /*margin: 0px;*/
   /*margin: 0px;*/
   //float: left;
   //float: left;
   background-color: #ecf5ff;
   background-color: #ecf5ff;
+  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
 }
 }
 
 
 .el-menu {
 .el-menu {

+ 12 - 0
src/views/Bok/index.vue

@@ -35,4 +35,16 @@ export default {
     //padding-left: 20px;
     //padding-left: 20px;
     //padding-right: 20px;
     //padding-right: 20px;
 }
 }
+
+@media screen and (max-width: 1000px) {
+  .main-container {
+    width: #{1000px - $sideBarWidth};
+  }
+}
+
+.bok-main {
+  padding-left: 20px;
+  padding-right: 20px;
+  width: calc(100% - 40px);
+}
 </style>
 </style>