Browse Source

添加ai分析页面

SanHQin 5 months ago
parent
commit
4d72e4ae43

+ 8 - 2
src/components/pages/test/add/edit/index.vue

@@ -73,6 +73,9 @@ export default {
     },
     cJson: {
       type: Array
+    },
+		fileData: {
+      type: Object
     }
   },
   data() {
@@ -81,7 +84,7 @@ export default {
       checkJson: [],
       loading: false,
 			userId: this.$route.query.userid,
-			fileData:null,
+
 			viewFile:false,
     };
   },
@@ -91,7 +94,7 @@ export default {
         this.checkJson = this.depthCopy(newVal);
       },
       deep: true
-    }
+    },
   },
   methods: {
     updateTitle(value) {
@@ -322,6 +325,9 @@ Instruction: Based on the context, follow "Format example", write content
   },
   mounted() {
     this.checkJson = this.depthCopy(this.cJson);
+		if(this.fileData){
+			this.viewFile = true;
+		}
   }
 };
 </script>

+ 39 - 21
src/components/pages/test/check/aiBoxRight.vue

@@ -483,7 +483,7 @@ export default {
         11: "课程",
       },
       answerArray: [],
-      fileId: ""
+      fileId: []
     };
   },
   watch: {
@@ -507,7 +507,13 @@ export default {
       handler(newValue, oldValue) {
         if (newValue.length) {
           console.log('newValue',newValue);
-          this.setJson(newValue)
+					this.$emit("clearFileData")
+					this.fileId = [];
+					newValue.forEach(el=>{
+						this.setJson(el)
+					})
+					// console.log("👈👉",newValue)
+          // this.setJson(newValue)
         }
       }
     }
@@ -560,7 +566,12 @@ export default {
     //   // 如果仍需要上传文件,可以保留这行
     //   return this.uploadFile(blob);
     // },
-    setJson(array){
+    setJson(obj){
+			let array = obj.worksArray
+			let name = obj.name
+			console.log(obj)
+			console.log(array)
+
       const getAnswer = (j) => {
         if (j.type === 1) {
           return j.json.array
@@ -587,6 +598,8 @@ export default {
         "题目": j.json.title
       }));
 
+			console.log(questions)
+
       // 构建CSV内容
       let csvContent = "用户名 | 提交时间 | " + questions.map(q => `${q.序号}-${q.题目类型}-${q.题目}`).join(' | ') + "\n";
 
@@ -602,12 +615,12 @@ export default {
       // 创建Blob对象
       const blob = new Blob([csvContent], { type: "text/plain;charset=utf-8" });
       blob.lastModifiedDate = new Date();
-      blob.name = `表单数据.txt`;
+      blob.name = `${name}_表单数据.txt`;
 
       // 如果仍需要上传文件,可以保留这行
-      return this.uploadFile(blob);
+      return this.uploadFile({file:blob,name:name});
     },
-    uploadFile(file) {
+    uploadFile({file,name}) {
       var credentials = {
         accessKeyId: "AKIATLPEDU37QV5CHLMH",
         secretAccessKey: "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"
@@ -656,7 +669,8 @@ export default {
                 .then(res => {
                   let _data = res.data.FunctionResponse;
                   if (_data.result && _data.result.id) {
-                    _this.fileId = _data.result.id;
+                    _this.fileId.push(_data.result.id);
+										_this.$emit("pushFileData",{fileId:_data.result.id,name:name,url:data.Location})
                   } else {
                     console.error("获取fileId失败");
                   }
@@ -783,7 +797,7 @@ export default {
               message: _replaceText,
               session_name: `${this.courseId}-${this.userid}-test`,
               uid: _uid,
-              file_ids: this.fileId ? [this.fileId] : [],
+              file_ids: this.fileId ? this.fileId : [],
               // model: "gpt-4o-2024-08-06"
               model: "qwen-plus"
             };
@@ -882,7 +896,7 @@ export default {
             message: `Role: 你是数据检索大师,可以利用file_search的方式完整的去分析文件内容 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.\n${message}`,
             session_name: `${this.courseId}-${this.userid}-test`,
             uid: _uuid,
-            file_ids: this.fileId ? [this.fileId] : [],
+            file_ids: this.fileId ? this.fileId : [],
             model: "gpt-4o-2024-08-06"
           };
           this.$nextTick(() => {
@@ -1417,9 +1431,11 @@ export default {
     //     this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
     //   });
     // });
-    if(this.worksArray.length){
-      this.setJson(this.worksArray);
-    }
+    // if(this.worksArray.length){
+		// 	this.worksArray.forEach(el=>{
+		// 		this.setJson(el)
+		// 	})
+    // }
     this.getRoleList();
     this.getPublicRoleList();
   }
@@ -1428,20 +1444,22 @@ export default {
 
 <style scoped>
 .ai_body {
-  height: calc(100% - 158px - 46px);
-  width: 500px;
-  margin: 0 auto;
+  /* height: calc(100% - 158px - 46px);
+  width: 500px; */
+	height: 100%;
+	width: 100%;
+  /* margin: 0 auto; */
   display: flex;
   flex-direction: column;
-  position: fixed;
-  z-index: 999;
+  /* position: fixed; */
+  /* z-index: 999; */
   background: #fff;
-  right: 30px;
-  bottom: 10px;
+  /* right: 30px; */
+  /* bottom: 10px; */
   padding: 10px 20px;
   box-sizing: border-box;
-  box-shadow: 0 0 5px 2px #00000045;
-  border-radius: 5px;
+  /* box-shadow: 0 0 5px 2px #00000045;
+  border-radius: 5px; */
 }
 
 .binfo_input {

+ 18 - 2
src/components/pages/test/check/index.vue

@@ -568,7 +568,9 @@
               </div>
             </div>
           </div>
-          <aiBoxRight v-show="aiChatV && isDesktop" :courseId="cid" :worksArray="worksArray" ref="aiChat"></aiBoxRight>
+					<div class="aiBoxRight" ref="aiBoxRightDivRef" v-show="aiChatV && isDesktop" >
+						<aiBoxRight :courseId="cid" :worksArray="[{name:testJson.title,worksArray:worksArray}]" ref="aiChat"></aiBoxRight>
+					</div>
           <!-- 按人员pc端 isDesktop-->
           <div class="table_content" v-if="stype == 2 && isDesktop">
             <el-table class="el-table" ref="table" :data="worksArray" border :fit="true" :key="2" v-loading="isLoading"
@@ -1125,7 +1127,8 @@ export default {
       this.$nextTick(() => {
         const boxStickyHeight = this.$refs.boxSticky ? this.$refs.boxSticky.offsetHeight : 0;
         const chatHeight = `calc(100% - ${boxStickyHeight}px - 46px)`;
-        this.$refs.aiChat.$el.style.height = chatHeight;
+        // this.$refs.aiChat.$el.style.height = chatHeight;
+				this.$refs.aiBoxRightDivRef.style.height = chatHeight;
       });
     },
     fileClose(done){
@@ -3307,4 +3310,17 @@ export default {
   z-index: 999;
   background: #fff;
 }
+
+.aiBoxRight{
+	height: calc(100% - 158px - 46px);
+  width: 500px;
+	margin: 0 auto;
+	position: fixed;
+  z-index: 999;
+	right: 30px;
+  bottom: 10px;
+	box-shadow: 0 0 5px 2px #00000045;
+  border-radius: 5px;
+	overflow: hidden;
+}
 </style>

+ 429 - 0
src/components/pages/test/choseCheck/index.vue

@@ -0,0 +1,429 @@
+<template>
+  <div class="choseCheck">
+    <div class="cc_top">
+      <div class="cc_t_left">
+        <el-breadcrumb separator-class="el-icon-arrow-right">
+          <el-breadcrumb-item
+            :to="{
+              path:
+                '/test?userid=' +
+                userid +
+                '&oid=' +
+                oid +
+                '&org=' +
+                org +
+                '&role=' +
+                role
+            }"
+            >表单管理</el-breadcrumb-item
+          >
+          <el-breadcrumb-item>
+            <span style="color: rgb(15, 126, 255)">AI分析</span>
+          </el-breadcrumb-item>
+        </el-breadcrumb>
+      </div>
+      <div class="cc_t_right">
+        <div class="r_pub_button_retrun" @click="back">返回</div>
+      </div>
+    </div>
+    <div class="cc_bottom" v-loading="loading">
+			<div class="cc_b_left">
+				<div v-if="!loading">
+					<aiBoxRight :courseId="aiBoxRightCid" :worksArray="courseInfoList" ref="aiChat" @pushFileData="pushFileData" @clearFileData="clearFileData"></aiBoxRight>
+				</div>
+			</div>
+			<div class="cc_b_right">
+				<div class="cc_b_r_menu">
+					
+						<div v-for="(item,index) in menuList" @click="changeMenuIndex(index)" :key="index" :class="{'cc_b_r_menu_active':menuIndex==index}">
+							<el-tooltip  class="item" effect="dark" :content="item.name" placement="top">
+								<span>{{item.name}}</span>
+						</el-tooltip>
+						</div>
+					
+				</div>
+				<div class="cc_b_r_content">
+					<txtView v-if="showFileUrl" :url="showFileUrl"></txtView>
+				</div>
+			</div>
+		</div>
+  </div>
+</template>
+
+<script>
+import aiBoxRight from '../check/aiBoxRight.vue';
+import txtView from './txtView.vue';
+export default {
+  name: "ChoseCheck",
+	components:{
+		aiBoxRight,
+		txtView
+	},
+  data() {
+    return {
+      // 组件数据
+      userid: this.$route.query.userid,
+      oid: this.$route.query.oid,
+      org: this.$route.query.org,
+      role: this.$route.query.role,
+      cid: this.$route.query.cid,
+			menuList:[],
+			menuIndex:0,
+			courseInfoList:[],
+			loading:true
+    };
+  },
+  methods: {
+    // 组件方法
+    back() {
+      this.goTo(
+        "/test?userid=" +
+          this.userid +
+          "&oid=" +
+          this.oid +
+          "&org=" +
+          this.org +
+          "&role=" +
+          this.role
+      );
+    },
+    goTo(path) {
+      this.$router.push(path);
+    },
+		getData(){
+			if(this.cid){
+				this.loading = true
+				let cidList = this.cid.split(',')
+				let promiseList = []
+				cidList.forEach(el=>{
+					promiseList.push(this.getCourseData(el))
+				})
+				Promise.all(promiseList).then(res=>{
+					console.log(this.courseInfoList)
+					this.loading = false
+				})
+			}
+		},
+		getCourseData(courseId) {
+      return new Promise((resolve)=>{
+				let params = {
+        cid: courseId,
+        cn: "",
+        tim : "",
+        tea: ""
+      };
+      this.ajax
+        .get(this.$store.state.api + "getTestWorksNoPageCopy", params)
+        .then(async (res) => {
+          let testJson = res.data[0][0]
+          let works = res.data[1]
+          let chapters = this.setJSON(this.setJson2(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
+          let courseCount11 = []
+          let array = []
+          let courseIds = []; // 初始化一个空数组来存储所有的courseId
+          for (let i = 0; i < works.length; i++) {
+            let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
+            if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
+              let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
+              for (var ja = 0; ja < _json.length; ja++) {
+                let _json2 = _json[ja].json;
+                if (_json[ja].type == 6) {
+                  let courseId = _json2.answer2;
+                  courseIds.push(courseId); // 将type为6的courseId添加到数组中
+                }
+                if (_json[ja].type == 11) {
+                  let _answer = _json2.answer2;
+                  _answer.length ? courseCount11 = courseCount11.concat(_answer) : '';
+                  _json[ja].json.courseId = _answer ? _answer : [];
+                  courseIds = courseIds.concat(_answer); // 将type为11的courseId添加到数组中
+                }
+              }
+            }
+          }
+          // 将所有的courseId去重
+          courseIds = Array.from(new Set(courseIds));
+          // 使用一个数组来存储所有的courseId后,执行getCourseInfoTestAll
+          let courseTitles = {}; // 初始化一个空对象来存储所有的courseTitles
+          let params2 = [{
+            cid: courseIds.join(",")
+          }]
+
+          let data2 = await this.ajax.post(this.$store.state.api + 'getCourseInfoTestAll2', params2);
+          let result2 = data2.data[0];
+          result2.forEach(i => {
+            courseTitles[i.courseId] = i.title;
+          });
+
+          for (let i = 0; i < works.length; i++) {
+            let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
+            if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
+              let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
+
+              _json.forEach(item => {
+                if (item.type == 11) {
+                  let cid = item.json.answer2
+                  let _title = []
+                  for(var i = 0; i < cid.length; i++){
+                    _title.push(courseTitles[cid[i]])
+                  }
+                  item.json.answer2 = _title.length ? _title.join(",") : '';
+                }
+                if (item.type == 6) {
+                  let courseId = item.json.answer2;
+                  item.json.answer2 = courseTitles[courseId] || '';
+                }
+              });
+              // 更新对应的_json对象的answer2
+              array.push({
+                courseid: works[i].courseid,
+                id: works[i].id,
+                userid: works[i].userid,
+                name: works[i].username ? works[i].username : '匿名',
+                time: works[i].time,
+                array: _json,
+                cut:0,
+                uteaName: works[i].uteaName,
+                courseJson: JSON.parse(works[i].courseJson),
+              })
+            }
+          }
+					let obj = {courseId:testJson.courseId,name:testJson.title,worksArray:array}
+					this.courseInfoList.push(obj)
+					resolve(obj)
+        })
+        .catch((err) => {
+					resolve();
+          console.error(err);
+        });
+			})
+    },
+		setJSON(json) {
+      return json.filter((item) => {
+        if (item.array) {
+          item.array = item.array.filter((item2) => {
+            if (item2.ttype == 1 && item2.json) {
+              delete item2.json.answer2
+              delete item2.json.score2
+              delete item2.json.file
+            }
+            if (item2.array) {
+              item2.array = item2.array.filter((item3) => {
+                if (item3.ttype == 1 && item3.json) {
+                  delete item3.json.answer2
+                  delete item3.json.score2
+                  delete item3.json.file
+                }
+                return item3;
+              });
+            }
+            return item2;
+          });
+        } else if (item.ttype == 1 && item.json) {
+          delete item.json.answer2
+          delete item.json.score2
+          delete item.json.file
+        }
+        return item
+      });
+    },
+		JSONSetting(json) {
+      let _json = json
+      let array = []
+      _json.filter((item) => {
+        if (item.array) {
+          item.array = item.array.filter((item2) => {
+            if (item2.ttype == 1 && item2.json) {
+              array.push(item2)
+            }
+            if (item2.array) {
+              item2.array = item2.array.filter((item3) => {
+                if (item3.ttype == 1 && item3.json) {
+                  array.push(item3)
+                }
+                return item3;
+              });
+            }
+            return item2;
+          });
+        }
+        if (item.ttype == 1 && item.json) {
+          array.push(item)
+        }
+        return item;
+      });
+      return array;
+    },
+		setFilter(json) {
+      let _json = json
+      let array = []
+      _json.filter((item) => {
+        item.nameFilters = [],
+          item.filterParams = {
+            name: [],
+          }
+        if (item.type == 1) {
+          for (var i = 0; i < item.json.array.length; i++) {
+            item.nameFilters.push({ text: item.json.array[i].option, value: item.json.array[i].option })
+          }
+        }
+        array.push(item)
+        return item;
+      });
+      return array
+    },
+		setJson2(json) {
+      let _json = json;
+      // this.type = _json[0].ttype;
+      let checkArray = _json.filter((item) => {
+        if (item.array) {
+          item.array = item.array.filter((item2) => {
+            if (item2.ttype == 1 && item2.json && !item2.json.answer2) {
+              item2.json.answer2 = [];
+            }
+            if (item2.array) {
+              item2.array = item2.array.filter((item3) => {
+                if (item3.ttype == 1 && item3.json && !item3.json.answer2) {
+                  item3.json.answer2 = [];
+                }
+                return item3;
+              });
+            }
+            return (
+              (item2.ttype != 1 && item2.array.length > 0) || item2.ttype == 1
+            );
+          });
+        }
+        if (item.ttype == 1 && item.json && !item.json.answer2) {
+          item.json.answer2 = [];
+        }
+        return (item.ttype != 1 && item.array.length > 0) || item.ttype == 1;
+      });
+      return checkArray;
+
+    },
+		pushFileData(data){
+			this.menuList.push(data)
+		},
+		clearFileData(){
+			this.menuList = []
+		},
+		changeMenuIndex(index){
+			this.menuIndex = index
+		}
+  },
+	computed:{
+		showFileUrl(){
+			if(this.menuList.length){
+				return this.menuList[this.menuIndex].url
+			}else{
+				return ""
+			}
+		},
+		aiBoxRightCid(){
+			let _result = this.cid;
+
+			let _cidList = _result.split(',');
+			if(_cidList.length>1){
+				_cidList.sort((a, b) => parseInt(b) - parseInt(a));
+				_result = _cidList.join(',');
+			}
+			
+			return _result
+		}
+	},
+	mounted(){
+		this.getData();
+	}
+};
+</script>
+
+<style scoped>
+/* 组件样式 */
+.choseCheck {
+  width: 100vw;
+  height: 100vh;
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 0 20px;
+}
+
+.cc_top {
+  width: 100%;
+  height: 40px;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+}
+.cc_bottom {
+  width: 100%;
+  height: calc(100% - 40px - 10px);
+  overflow: auto;
+  background-color: #fff;
+	border-radius: 5px;
+	display: flex;
+}
+
+.cc_b_left{
+	width: 50%;
+	height: 100%;
+}
+
+.cc_b_left>div{
+	width: 100%;
+	height: 100%;
+}
+
+.cc_b_right{
+	width: 50%;
+	height: 100%;
+	box-sizing: border-box;
+	border-left: 1px solid #E4E7ED;
+}
+
+.cc_b_r_menu{
+	width: 100%;
+	height: 50px;
+	display: flex;
+	align-items: center;
+	box-sizing: border-box;
+	border-bottom: 1px solid #E4E7ED;
+	overflow: auto;
+}
+
+.cc_b_r_menu>div{
+	height: 100%;
+	width: 100px;
+	min-width: 100px;
+	max-width: 100px;
+	padding: 0 15px;
+	display: flex;
+	text-align: center;
+	/* justify-content: center; */
+	align-items: center;
+	cursor: pointer;
+	transition: all 0.3s;
+	/* text-overflow: ellipsis;
+	overflow: hidden;
+	white-space: nowrap; */
+}
+
+.cc_b_r_menu>div:hover{
+	background-color: #F5F7FA;
+}
+.cc_b_r_menu>div>span{
+	width: 100%;
+	text-overflow: ellipsis;
+	overflow: hidden;
+	white-space: nowrap;
+}
+
+.cc_b_r_menu_active{
+	background-color: #3681FC !important;
+	color: #fff;
+}
+
+.cc_b_r_content{
+	width: 100%;
+	height: calc(100% - 50px);
+}
+</style>

+ 106 - 0
src/components/pages/test/choseCheck/txtView.vue

@@ -0,0 +1,106 @@
+<template>
+  <div class="txtView" v-loading="loading">
+		<div class="tv_content" v-text="content"></div>
+	</div>
+</template>
+
+<script>
+import "../../../../common/aws-sdk-2.235.1.min.js";
+
+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 {
+        const fileContent = data.Body.toString("utf-8");
+        resolve({ data: fileContent });
+      } // sxuccessful response
+    });
+    // axios({
+  });
+};
+export default {
+  props: {
+    url: {
+      type: String,
+      default: ""
+    },
+  },
+	data(){
+		return{
+			content:"",
+			loading:""
+		}
+	},
+	methods: {
+		getTxtContent() {
+			if(!this.url)return;
+			this.loading = true;
+			getFile(this.url).then(res=>{
+				this.loading = false;
+				this.content = res.data;
+			})
+		},
+	},
+	watch:{
+		url(newVal,oldVal){
+			if(newVal!==oldVal){
+				this.getTxtContent();
+			}
+		}
+	},
+	mounted(){
+		this.getTxtContent();
+	}
+};
+</script>
+
+<style scoped>
+.txtView{
+	width: 100%;
+	height: 100%;
+	box-sizing: border-box;
+	background-color: #ececec;
+	padding: 0px 0px;
+}
+
+.tv_content{
+	width: 100%;
+	height: 100%;
+	box-sizing: border-box;
+	background-color: #fff;
+	overflow: auto;
+	word-wrap: break-word;
+	border-radius: 3px;
+	white-space: pre;
+	box-sizing: border-box;
+	padding: 10px;
+}
+</style>

+ 82 - 2
src/components/pages/test/index.vue

@@ -131,6 +131,7 @@
                             <el-button type="primary" class="bgColor" @click="openTestDataBoard()"
                                 v-if="oid == '4c686762-1d0a-11ed-8c78-005056b86db5'">表单看板</el-button>
                             <el-button type="primary" class="bgColor" @click="goToCourse()">新建表单</el-button>
+														<el-button type="primary" class="bgColor" v-if="checkList.length!==0" @click="aiAnalysis()">AI分析</el-button>
                         </div>
                     </div>
                 </div>
@@ -152,6 +153,12 @@
                                     <!-- <span>创建人:{{ item.uname }}</span> -->
                                     <span>提交数量:{{ item.worksCount }}</span>
                                 </div>
+																<div class="test_top_chose" v-if="item.worksCount>0" @click.stop="choseCourse(item.courseId)">
+																	<div class="test_top_chose_checkbox" :class="{test_top_chose_checkbox_active:checkList.includes(item.courseId)}">
+																		<svg t="1728873838936" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4300" width="200" height="200"><path d="M817.728 198.72l111.744 114.56-545.216 532.128-285.92-273.024 110.528-115.712 174.176 166.336z" p-id="4301"></path></svg>
+																	</div>
+																	<!-- <el-checkbox class="test_top_chose_checkbox" :checked="checkList.includes(item.courseId)"></el-checkbox> -->
+																</div>
                             </div>
                             <div class="test_time">
                                 <span><span>创建人</span></span><span>{{ item.uname }}</span>
@@ -472,7 +479,8 @@ export default {
             course2: [],
             dataJ: {},
             typeJArray: [],
-            zscore: 0
+            zscore: 0,
+						checkList:[],
         };
     },
     computed: {
@@ -1317,7 +1325,37 @@ export default {
                 .catch((err) => {
                     console.error(err);
                 });
-        }
+        },
+				choseCourse(courseId){//多选表单
+					console.log("测试测试")
+					if(this.checkList.includes(courseId)){
+						this.checkList = this.checkList.filter(item=>item != courseId)
+					}else{
+						if(this.checkList.length<10){
+							this.checkList.push(courseId)
+						}else{
+							this.$message.error("最多选择10个表单")
+						}
+						
+					}
+					console.log(this.checkList)
+					this.$forceUpdate()
+				},
+				aiAnalysis(){
+					this.$router.push(
+						"/choseCheckTest?cid=" +
+						this.checkList.join(',') +
+						"&userid=" +
+						this.userid +
+						"&oid=" +
+						this.oid +
+						"&org=" +
+						this.org +
+						"&type=2" +
+						"&role=" +
+						this.role
+            );
+				}
     },
     activated() {
         console.log(1);
@@ -1892,6 +1930,7 @@ export default {
     width: 100%;
     display: flex;
     align-items: center;
+		position: relative;
 }
 
 .test_top>.test_top_img {
@@ -1980,6 +2019,47 @@ export default {
     color: rgb(58, 131, 252);
 }
 
+.test_top_chose{
+	min-width: 18px;
+	min-height: 18px;
+	max-width: 18px;
+	max-height: 18px;
+	position: absolute;
+	right: 0px;
+	top: 0px;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+
+.test_top_chose_checkbox{
+	min-width: 18px;
+	min-height: 18px;
+	max-width: 18px;
+	max-height: 18px;
+	background-color: #fff;
+	border-radius: 2px;
+	border: 1px solid #DCDFE6;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	cursor: pointer;
+	color: #fff;
+	font-weight: bold;
+	position: relative;
+	font-size: 14px;
+}
+
+.test_top_chose_checkbox>svg{
+	fill: #fff;
+	width: 80%;
+	height: 80%;
+}
+
+.test_top_chose_checkbox_active{
+	background-color: #3681fc;
+}
+
 .test_box>.test_time {
     margin-top: 10px;
     font-size: 14px;

+ 8 - 0
src/router/index.js

@@ -137,6 +137,7 @@ import pocAiClassroom from '@/components/pages/pocAiClassroom'
 import pocAiChat from '@/components/pages/pocAiClassroom/chatArea2'
 import pocDoTask from '@/components/pages/pocAiClassroom/doTask'
 import pocClass from '@/components/pages/pocAiClassroom/pocClass'
+import choseCheckTest from '@/components/pages/test/choseCheck'
 // 全局修改默认配置,点击空白处不能关闭弹窗
 ElementUI.Dialog.props.closeOnClickModal.default = false
 Vue.use(Router).use(ElementUI)
@@ -972,6 +973,13 @@ export default new Router({
                 requireAuth: '' // 是否需要判断是否登录,这里是需要判断
             }
         },
+				{
+					path:'/choseCheckTest',
+					component:choseCheckTest,
+					meta:{
+						requireAuth:''//不需要鉴权
+					}
+				},
         {
             path: '/checkTest2',
             component: checkTest2,