Browse Source

Merge remote-tracking branch 'origin/main'

mjh 4 years ago
parent
commit
b7b6359398

+ 1 - 1
Dockerfile

@@ -1,4 +1,4 @@
-FROM node:10-alpine as builder
+FROM node:14.15.1 as builder
 WORKDIR /code
 ADD package.json /code
 RUN npm install --registry=https://registry.npm.taobao.org

+ 2 - 1
README.md

@@ -31,4 +31,5 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
 #### node-sass错误 
 ``` 
 npm install node-sass@4.x --registry=https://registry.npm.taobao.org
-```
+```
+### 测试是否可以修改

+ 81 - 52
package-lock.json

@@ -2052,17 +2052,6 @@
             "array-uniq": "^1.0.1"
           }
         },
-        "chalk": {
-          "version": "4.1.2",
-          "resolved": "https://registry.npmmirror.com/chalk/download/chalk-4.1.2.tgz",
-          "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
         "cliui": {
           "version": "6.0.0",
           "resolved": "https://registry.nlark.com/cliui/download/cliui-6.0.0.tgz",
@@ -2185,13 +2174,6 @@
             "pify": "^4.0.1"
           }
         },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz",
-          "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
-          "dev": true,
-          "optional": true
-        },
         "ignore": {
           "version": "4.0.6",
           "resolved": "https://registry.nlark.com/ignore/download/ignore-4.0.6.tgz",
@@ -2204,18 +2186,6 @@
           "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=",
           "dev": true
         },
-        "loader-utils": {
-          "version": "2.0.2",
-          "resolved": "https://registry.npmmirror.com/loader-utils/download/loader-utils-2.0.2.tgz",
-          "integrity": "sha1-1uO0+4GHByGuTghoqxHdY4NowSk=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
         "make-dir": {
           "version": "2.1.0",
           "resolved": "https://registry.nlark.com/make-dir/download/make-dir-2.1.0.tgz",
@@ -2310,16 +2280,6 @@
             "ansi-regex": "^5.0.1"
           }
         },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz",
-          "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        },
         "terser": {
           "version": "4.8.0",
           "resolved": "https://registry.npmmirror.com/terser/download/terser-4.8.0.tgz",
@@ -2348,18 +2308,6 @@
             "worker-farm": "^1.7.0"
           }
         },
-        "vue-loader-v16": {
-          "version": "npm:vue-loader@16.8.3",
-          "resolved": "https://registry.npmmirror.com/vue-loader/download/vue-loader-16.8.3.tgz",
-          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "chalk": "^4.1.0",
-            "hash-sum": "^2.0.0",
-            "loader-utils": "^2.0.0"
-          }
-        },
         "webpack-bundle-analyzer": {
           "version": "3.9.0",
           "resolved": "https://registry.npmmirror.com/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.9.0.tgz?cache=0&sync_timestamp=1634020242901&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.9.0.tgz",
@@ -13783,6 +13731,87 @@
         }
       }
     },
+    "vue-loader-v16": {
+      "version": "npm:vue-loader@16.8.3",
+      "resolved": "https://registry.npmmirror.com/vue-loader/download/vue-loader-16.8.3.tgz",
+      "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "chalk": "^4.1.0",
+        "hash-sum": "^2.0.0",
+        "loader-utils": "^2.0.0"
+      },
+      "dependencies": {
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmmirror.com/ansi-styles/download/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmmirror.com/chalk/download/chalk-4.1.2.tgz",
+          "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmmirror.com/color-convert/download/color-convert-2.0.1.tgz",
+          "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.nlark.com/color-name/download/color-name-1.1.4.tgz",
+          "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
+          "dev": true,
+          "optional": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626716578584&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz",
+          "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
+          "dev": true,
+          "optional": true
+        },
+        "loader-utils": {
+          "version": "2.0.2",
+          "resolved": "https://registry.npmmirror.com/loader-utils/download/loader-utils-2.0.2.tgz",
+          "integrity": "sha1-1uO0+4GHByGuTghoqxHdY4NowSk=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "big.js": "^5.2.2",
+            "emojis-list": "^3.0.0",
+            "json5": "^2.1.2"
+          }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmmirror.com/supports-color/download/supports-color-7.2.0.tgz",
+          "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        }
+      }
+    },
     "vue-router": {
       "version": "4.0.12",
       "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.12.tgz",

+ 1 - 1
src/api/bokfile.js

@@ -6,5 +6,5 @@ import axios from "axios";
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function uploadFile(params, config){
-    return axios.post("/api/api/bok-file", params, config);
+    return axios.post("/api/bok-file", params, config);
 }

+ 2 - 2
src/api/operation_record.js

@@ -6,12 +6,12 @@ import axios from "axios";
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function createRecord(ope_record) {
-    return axios.post("/api/api/ope_record", ope_record);
+    return axios.post("/api/ope_record", ope_record);
 }
 
 
 export function getRecordByQid(qid) {
-    return axios.get("/api/api/ope_record/"+qid,{
+    return axios.get("/api/ope_record/"+qid,{
         params:{
             offset: 0,
             pageSize: 1000,

+ 6 - 6
src/api/question.js

@@ -17,7 +17,7 @@ export function testFunc(name) {
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function getTargetQuestionList(offset, pageSize) {
-  return axios.get("/api/api/pageQuestion", {
+  return axios.get("/api/pageQuestion", {
     params: {
       offset: offset,
       pageSize: pageSize
@@ -32,7 +32,7 @@ export function getTargetQuestionList(offset, pageSize) {
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function requestQuestion(stem, ...items) {
-  return axios.get("/api/api/searchQuestion", {
+  return axios.get("/api/searchQuestion", {
     params: {
       stem: stem,
       tags: items[0],
@@ -52,7 +52,7 @@ export function requestQuestion(stem, ...items) {
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function deleteQuestionById(id) {
-  return axios.delete("/api/api/question/" + id);
+  return axios.delete("/api/question/" + id);
 }
 
 
@@ -62,7 +62,7 @@ export function deleteQuestionById(id) {
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function createQuestion(questionVO) {
-  return axios.post("/api/api/question", questionVO);
+  return axios.post("/api/question", questionVO);
 }
 
 
@@ -72,7 +72,7 @@ export function createQuestion(questionVO) {
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function updateQuestion(questionvo) {
-  return axios.put("/api/api/question/" + questionvo.id, questionvo);
+  return axios.put("/api/question/" + questionvo.id, questionvo);
 }
 
 
@@ -82,7 +82,7 @@ export function updateQuestion(questionvo) {
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function getStateQuestion(states, offset, pageSize) {
-  return axios.get("/api/api/state", {
+  return axios.get("/api/state", {
     params: {
       state: states,
       offset: offset,

+ 2 - 2
src/api/user.js

@@ -7,13 +7,13 @@ import axios from "axios";
  * @returns {Promise<AxiosResponse<any>>}
  */
 export function getUserById(id) {
-    return axios.get("/api/api/user/uid", {params:{
+    return axios.get("/api/user/uid", {params:{
             uid: id
         }});
 }
 
 
 export function getUserInfo(){
-    return axios.get("/api/api/user");
+    return axios.get("/api/user");
 }
 

+ 1 - 1
src/components/BriefQuestionCard.vue

@@ -178,7 +178,7 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    axios.delete("/api/api/question/"+this.questionvo.id).then(() => {
+                    axios.delete("/api/question/"+this.questionvo.id).then(() => {
                             this.$message({
                                 type: 'success',
                                 message: '删除成功!'

+ 3 - 1
src/components/QuestionCard/CreatingQuestionCard.vue

@@ -71,6 +71,7 @@ export default {
     disapproveQuestion(){},
 
     mockApproveQuestion() {
+      // TODO
       const _this = this
       _this.$message({
         type: "success",
@@ -80,6 +81,7 @@ export default {
     },
 
     mockDisapproveQuestion() {
+      // TODO
       const _this = this
       _this.$message({
         type: "error",
@@ -93,4 +95,4 @@ export default {
 
 <style scoped>
 
-</style>
+</style>

+ 1 - 1
src/components/QuestionGroupCreater.vue

@@ -53,7 +53,7 @@
                 question.state = "CHECKING";
                 question.savedUserId = this.$store.state.user.id;
               }
-                axios.post("/api/api/questions", questions)
+                axios.post("/api/questions", questions)
                     .then(res => {
                         console.log(res);
                         this.$notify({

+ 7 - 3
src/components/checkQuestionCard.vue

@@ -31,13 +31,16 @@
                     <el-button type="text" circle @click="expand" v-if="!isAll"><strong>展开</strong></el-button>
                     <el-button type="text" circle @click="withdraw" v-if="isAll"><strong>收起</strong></el-button>
                 </el-col>
+
                 <el-col :span="1">
-                    <el-button type="primary" icon="el-icon-check" circle @click="approve"></el-button>
+                  <el-button type="primary" icon="el-icon-check" circle @click="approve" v-if="questionvo.state !== 'APPROVED'"></el-button>
+                  <div v-else>APPROVED</div>
                 </el-col>
                 <el-col :span="1">
-                    <el-button type="warning" icon="el-icon-close" circle @click="checkDialogVisible=true"></el-button>
+                  <el-button type="warning" icon="el-icon-close" circle @click="checkDialogVisible=true" v-if="questionvo.state !== 'APPROVED'"></el-button>
                 </el-col>
             </el-row>
+
         </template>
         <div class="question-body">
             <div class="primary-question-card-body">
@@ -251,7 +254,7 @@ export default {
         },
 
         approve() { // 通过审核
-            this.questionvo.state = "APPROVED";
+
             let record = {
                 userId: store.state.user.id,
                 operationType: "Approve",
@@ -264,6 +267,7 @@ export default {
                     });
                     console.log("checkQuestionCard-approve");
                     console.log(res);
+                    this.questionvo.state = "APPROVED";
                     record.questionId = res.data.result.id;
                     record.time = new Date();
                     // 审核通过,添加操作记录

+ 56 - 4
src/views/Bok/Main/Check.vue

@@ -2,6 +2,28 @@
   <div>
     <h1>题目审查</h1>
     <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="全部审核" name="checkingAll">
+        <el-pagination
+            id="checking_all"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange_ALL"
+            :current-page="checkQuestionPage"
+            :page-sizes="[5, 10, 15, 20]"
+            :page-size="pageSize"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total=this.checkTotalNum
+            v-if="this.checkQuestionList.length !== 0"
+        />
+        <checkQuestionCard
+            v-for="(item, index) in checkQuestionList"
+            :questionvo="item"
+            :key="item.id"
+            :cur-num="index+(checkQuestionPage-1)*pageSize"
+            :total-num="checkTotalNum"
+            @approve="handleApproved(item, checkQuestionList)"
+        />
+      </el-tab-pane>
+
       <el-tab-pane label="新建审核" name="creating">
         <el-pagination
           @size-change="handleSizeChange"
@@ -114,7 +136,12 @@ export default {
       pageSize: 20,
 
       // 分页所需数据
-      activeName: "creating",
+      activeName: "checkingAll",
+
+      // 所有(线上)题目列表
+      checkQuestionList: [],
+      checkQuestionPage: 1,
+      checkTotalNum: 0,
 
       // 新建审核题目列表
       createQuestionList: [],
@@ -144,10 +171,22 @@ export default {
   },
   methods: {
 
-    handleSizeChange(val) {
+    handleSizeChange(val) { //修改页面大小
       console.log(`QuestionRepository/index-handleSizeChange 每页 ${val} 条`);
       this.pageSize = val;
     },
+    handleCurrentChange_ALL(val){
+      console.log(`当前页: ${val}`);
+      this.checkQuestionPage = val;
+      this.$api.getTargetQuestionList(val - 1, this.pageSize)
+          .then(res => {
+            console.log("handleCurrentChange-checkingAll");
+            console.log(res);
+            this.checkQuestionList = res.data.result.content;
+          }).catch(error => {
+        console.log(error);
+      })
+    },
     handleCurrentChange(val, currentPage, questionList, states) { // 当点击新的页面时才请求新的数据
       console.log(`Check-handleCurrentChange 当前页: ${val}`);
       currentPage = val;
@@ -165,9 +204,22 @@ export default {
     handleClick(tab, event) {
       const _this = this
       switch (tab.props.name) {
+        case "checkingAll":
+          this.$api.getTargetQuestionList(0, this.pageSize)
+              .then(res => {
+                // mjh change
+                console.log("getTargetQuestion-checkingAll");
+                console.log(res);
+                this.checkQuestionList = res.data.result.content;
+                this.checkTotalNum = res.data.result.totalElements;
+              })
+              .catch(err => {
+                console.log(err);
+              })
+              break;
         // 新建审核
         case "creating":
-          // todo: 用真实代码替换mockjs
+          // todo: 用真代码替换mockjs
           // this.$api.getStateQuestion(tab.props.name.toUpperCase(), 0, this.pageSize)
           //   .then(res => {
           //     // mjh change
@@ -235,7 +287,7 @@ export default {
     },
   },
   mounted() {
-    this.handleClick({props: {name: "creating"}}, null);
+    this.handleClick({props: {name: "checkingAll"}}, null);
   }
 }
 </script>

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

@@ -53,7 +53,7 @@ export default {
   },
   mounted() {
     this.knowledgeData = knowledgeData;
-    // axios.get("/api/api/knowledge",{
+    // axios.get("/api/knowledge",{
     //   params:{
     //     "abbreviation_keyPoints": '',
     //   }}).then(res => {

+ 1 - 4
vue.config.js

@@ -15,7 +15,7 @@ module.exports = {
             // 进度条
             new WebpackBar(),
             // 资源大小评估
-            new BundleAnalyzerPlugin(),
+            // new BundleAnalyzerPlugin(),
             // moment 本地化优化
             new MomentLocalesPlugin({
                 localesToKeep: ['zh-cn']
@@ -43,9 +43,6 @@ module.exports = {
             "/api": {
                 target: "http://127.0.0.1:8080",
                 changeOrigin: true,
-                pathRewrite: {
-                    "^/api": ""
-                }
             }
         },
         port: 8000,