lsc 11 mesiacov pred
rodič
commit
3796380d7e

+ 10 - 10
src/components/pages/aiAddCourse/addCourse.vue

@@ -1623,12 +1623,12 @@
                   : "下一步" }}
                 </button>
               </el-tooltip>
-              <el-tooltip effect="light" content="右键单击可配置提示词" placement="top"  v-if="isOutline2 && cidType == 0">
+              <!-- <el-tooltip effect="light" content="右键单击可配置提示词" placement="top"  v-if="isOutline2 && cidType == 0">
                 <button class="c_pub_button_confirm" @click="nextSteps(2, 2)" @contextmenu.prevent="nextSteps(1, 2)" :class="{
                       pub_btn_next_img: steps != 3,
                       pub_btn_finish_img: steps == 3,
                     }">下一步2</button>
-              </el-tooltip>
+              </el-tooltip> -->
             </div>
           </div>
           <div class="rightBox" v-if="steps == 2" :style="{
@@ -2377,15 +2377,15 @@
                         <div class="taskTitle">
                           <div style="display: flex;width: 100%;justify-content: space-between;">
                             <span>任务{{ itemTaskIndex + 1 }}</span>
-                            <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
+                            <!-- <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
                               <button class="c_pub_button_confirm" style="margin: 0 0 0 auto;"
                                 @contextmenu.prevent="openAiDialog2(1, 'aiTask2',itemTaskIndex)"
                                 @click="openAiDialog2(2, 'aiTask2',itemTaskIndex)">重新生成任务</button>
-                            </el-tooltip>
+                            </el-tooltip> -->
                             <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
                               <button class="c_pub_button_confirm" style="margin: 0 0 0 20px;"
                                 @contextmenu.prevent="openAiDialog2(1, 'aiTask3',itemTaskIndex)"
-                                @click="openAiDialog2(2, 'aiTask3',itemTaskIndex)">重新生成任务2</button>
+                                @click="openAiDialog2(2, 'aiTask3',itemTaskIndex)">重新生成任务</button>
                             </el-tooltip>
                           </div>
                         </div>
@@ -8242,11 +8242,11 @@ export default {
             this.loading = true
             functionA()
           } else {
-            if(ttype == 2){
-              this.openAiDialog(clickType, "aiTask3", 'all', functionA)
-            }else {
-              this.openAiDialog(clickType, "aiTask2", 'all', functionA)
-            }
+            // if(ttype == 2){
+            this.openAiDialog(clickType, "aiTask3", 'all', functionA)
+            // }else {
+            //   this.openAiDialog(clickType, "aiTask2", 'all', functionA)
+            // }
           }
           
         } else {

+ 12 - 8
src/components/pages/test/add/components/file/index.vue

@@ -22,8 +22,8 @@
                             @change="beforeUpload($event)" />
                     </div>
                 </div>
-                <div class="file_box" v-if="checkJson.file && checkJson.file.length" v-loading="loading">
-                    <div class="file_item" v-for="(item, index) in checkJson.file" :key="index">
+                <div class="file_box" v-if="checkJson.mobanFile && checkJson.mobanFile.length" v-loading="loading">
+                    <div class="file_item" v-for="(item, index) in checkJson.mobanFile" :key="index">
                         <div class="file_name">{{ item.name }}</div>
                         <div class="file_btns">
                             <div class="file_btn" @click="downloadFile(index)">下载</div>
@@ -161,12 +161,13 @@ export default {
             e.target.value = "";
         },
         delFile(index){
-            this.checkJson.file.splice(index, 1);
+            this.checkJson.mobanFile.splice(index, 1);
             this.$forceUpdate();
+            this.$emit("setJson", this.checkJson)
         },
         downloadFile(index){
             this.loading = true;
-            let file = this.checkJson.file[index]
+            let file = this.checkJson.mobanFile[index]
             getFile(file.url).then((data) => {
                 this.loading = false;
                 if (data.data != 1) {
@@ -355,23 +356,26 @@ export default {
                                 } else {
                                     _type = 5; //文件
                                 }
-                                if (_this.checkJson.file) {
-                                    _this.checkJson.file.push({
+                                if (_this.checkJson.mobanFile) {
+                                    _this.checkJson.mobanFile.push({
                                         name: _name,
                                         url: data.Location,
                                         type: _type
                                     });
+                                    _this.$forceUpdate();
                                 } else {
-                                    _this.checkJson.file = [];
-                                    _this.checkJson.file.push({
+                                    _this.checkJson.mobanFile = [];
+                                    _this.checkJson.mobanFile.push({
                                         name: _name,
                                         url: data.Location,
                                         type: _type
                                     });
+                                    _this.$forceUpdate();
                                 }
                                 _this.$forceUpdate();
 
                                 console.log(_this.checkJson);
+                                _this.$emit("setJson", _this.checkJson)
                                 console.log(data.Location);
                             }
                         });

+ 116 - 0
src/components/pages/test/add/edit/check/file.vue

@@ -27,6 +27,16 @@
         v-html="checkJson.detail"
         style="color: #00000099;margin-top: 5px;"
       ></div>
+      <div class="choices">
+        <div class="file_box" v-if="checkJson.mobanFile && checkJson.mobanFile.length" v-loading="loading">
+            <div class="file_item" v-for="(item, index) in checkJson.mobanFile" :key="index">
+                <div class="file_name">{{ item.name }}</div>
+                <div class="file_btns">
+                    <div class="file_btn" @click="downloadMobanFile(index)">下载</div>
+                </div>
+            </div>
+        </div>
+      </div>
       <div class="choices">
         <div class="uploadBtn" v-if="checktype == 1">
           <div class="btn" @click.stop="addImg($event)">
@@ -195,6 +205,45 @@ import checkfile from "../../../file/checkfile.vue";
 
 import uploadFile from "./uploadFile.vue";
 import { v4 as uuidv4 } from "uuid";
+
+const getFile = (url) => {
+  return new Promise((resolve, reject) => {
+    var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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",
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
+      let url2 = url;
+      let _url2 = "";
+      if (
+        url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+      ) {
+        _url2 = url2.split(
+          "https://view.officeapps.live.com/op/view.aspx?src="
+        )[1];
+      } else {
+        _url2 = url2;
+      }
+      var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+      let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
+      var params = {
+        Bucket: "ccrb",
+        Key: name
+      };
+      s3.getObject(params, function (err, data) {
+        if (err) {
+          console.log(err, err.stack)
+          resolve({ data: 1 });
+        }else {
+          resolve({ data: data.Body });
+          console.log(data); 
+        }
+      });
+  });
+};
+
+
 export default {
   components: {
     wpdf,
@@ -240,6 +289,7 @@ export default {
       wurl: "",
       isTong: false,
 			uploadList:[],
+      loading: false
     };
   },
   watch: {
@@ -692,6 +742,29 @@ export default {
         this.wurl = item.url;
       }
     },
+    downloadMobanFile(index){
+        this.loading = true;
+        let file = this.checkJson.mobanFile[index]
+        getFile(file.url).then((data) => {
+            this.loading = false;
+            if (data.data != 1) {
+                // 下载文件, 并存成ArrayBuffer对象
+                const file_name =file.name; // 获取文件名
+                const file_data = data.data; // 获取文件数据
+                let url = window.URL.createObjectURL(new Blob([file_data]));
+                let a = document.createElement("a");
+                a.name = file_name;
+                a.href = url;
+                a.download = file_name;
+                a.click();
+                console.log(data); 
+                this.$message.success("下载成功");
+            }else {
+                this.$message.error("下载失败");
+            }
+        });
+
+    },
     downloadFile(f) {
       var credentials = {
         accessKeyId: "AKIATLPEDU37QV5CHLMH",
@@ -996,4 +1069,47 @@ export default {
 	font-weight: bold;
 	margin-bottom: 10px;
 }
+
+
+.file_box {
+    /* padding: 0 0 0 15px; */
+    width: 100%;
+    box-sizing: border-box;
+    margin: 10px 0;
+}
+
+.file_item {
+    display: flex;
+    width: 100%;
+    padding: 5px;
+    box-sizing: border-box;
+    border-radius: 5px;
+}
+
+.file_item+.file_item {
+    margin-top: 10px;
+}
+
+.file_name {
+    color: #747474;
+}
+
+.file_item:hover{
+    background: #eee;
+}
+
+.file_btns {
+    margin-left: auto;
+    display: flex;
+    align-items: center;
+}
+
+.file_btn+.file_btn {
+    margin-left: 10px;
+}
+
+.file_btn {
+    color: #3681fc;
+    cursor: pointer;
+}
 </style>

+ 44 - 3
src/components/pages/test/examine/conpoments/personPage.vue

@@ -60,15 +60,25 @@
           :sortable="true"
           :sort-method="sortEvaMethod"
           align="center"
-          label="自评分"
+          label="自评分"
         >
         </el-table-column>
+        <el-table-column align="center" label="一级指标评分" >
+          <template slot-scope="scope">
+            <div class= "scoreBox" v-for="item, index in scope.row.json" :key="index">
+              <el-tooltip :content="item.name" placement="top" effect="dark">
+                <span>{{ item.name }}</span>
+              </el-tooltip>
+               :<span>{{ scoreChildren(item.children) }}</span>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column
           prop="cogSco"
           :sortable="true"
           :sort-method="sortCogMethod"
           align="center"
-          label="考核分数"
+          label="考核分"
         >
         </el-table-column>
         <el-table-column align="center" label="操作">
@@ -450,7 +460,19 @@ export default {
 
       // 立即调用函数并返回结果
       return accumulateSco2();
-    }
+    },
+
+    scoreChildren() {
+      return function(children){
+        let score = 0;
+        children.forEach(item => {
+          if (item.sco2 && parseFloat(item.sco2) > 0) {
+            score += parseFloat(item.sco2);
+          }
+        });
+        return score;
+      }
+    },
   },
   mounted() {
     this.getData();
@@ -1299,4 +1321,23 @@ input[type="number"] {
 .ColCon {
   flex: 1;
 }
+
+.scoreBox{
+  display: flex;
+  align-items: center;
+}
+
+.scoreBox > span:nth-child(1){
+  max-width: 100px;
+  width: 100px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  text-align: right;
+}
+
+.scoreBox > span:nth-child(2){
+  margin-left: 10px;
+}
+
 </style>

+ 77 - 1
src/components/pages/testStudent/view/component/file.vue

@@ -42,6 +42,16 @@
         v-html="checkJson.detail"
         style="color: #00000099;margin-top: 5px;"
       ></div>
+      <div class="choices">
+        <div class="file_box" v-if="checkJson.mobanFile && checkJson.mobanFile.length" v-loading="loading">
+            <div class="file_item" v-for="(item, index) in checkJson.mobanFile" :key="index">
+                <div class="file_name">{{ item.name }}</div>
+                <div class="file_btns">
+                    <div class="file_btn" @click="downloadMobanFile(index)">下载</div>
+                </div>
+            </div>
+        </div>
+      </div>
       <div class="choices">
         <div class="uploadBtn" v-if="checktype == 1">
           <div class="btn" @click.stop="addImg($event)">
@@ -313,7 +323,8 @@ export default {
       wurl: "",
       isloading: false,
       isTong: false,
-      uploadList: []
+      uploadList: [],
+      loading: false
     };
   },
   watch: {
@@ -762,6 +773,29 @@ export default {
         return (bytes / 1073741824).toFixed(2) + "GB";
       }
     },
+    downloadMobanFile(index){
+        this.loading = true;
+        let file = this.checkJson.mobanFile[index]
+        getFile(file.url).then((data) => {
+            this.loading = false;
+            if (data.data != 1) {
+                // 下载文件, 并存成ArrayBuffer对象
+                const file_name =file.name; // 获取文件名
+                const file_data = data.data; // 获取文件数据
+                let url = window.URL.createObjectURL(new Blob([file_data]));
+                let a = document.createElement("a");
+                a.name = file_name;
+                a.href = url;
+                a.download = file_name;
+                a.click();
+                console.log(data); 
+                this.$message.success("下载成功");
+            }else {
+                this.$message.error("下载失败");
+            }
+        });
+
+    },
     downloadFile(f) {
       var credentials = {
         accessKeyId: "AKIATLPEDU37QV5CHLMH",
@@ -1185,4 +1219,46 @@ export default {
 	font-weight: bold;
 	margin-bottom: 10px;
 }
+
+.file_box {
+    /* padding: 0 0 0 15px; */
+    width: 100%;
+    box-sizing: border-box;
+    margin: 10px 0;
+}
+
+.file_item {
+    display: flex;
+    width: 100%;
+    padding: 5px;
+    box-sizing: border-box;
+    border-radius: 5px;
+}
+
+.file_item+.file_item {
+    margin-top: 10px;
+}
+
+.file_name {
+    color: #747474;
+}
+
+.file_item:hover{
+    background: #eee;
+}
+
+.file_btns {
+    margin-left: auto;
+    display: flex;
+    align-items: center;
+}
+
+.file_btn+.file_btn {
+    margin-left: 10px;
+}
+
+.file_btn {
+    color: #3681fc;
+    cursor: pointer;
+}
 </style>