SanHQin 7 maanden geleden
bovenliggende
commit
1370470ec0

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.a3e275c269b3a34b3ca536e34892dea5.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.de15001ce66f032e9274.js></script><script type=text/javascript src=./static/js/app.c90f2e34859b29afbf28.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.986a8e4123c265426b5496995e72ae93.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.de15001ce66f032e9274.js></script><script type=text/javascript src=./static/js/app.6033ad3bf136a8bc50cc.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.986a8e4123c265426b5496995e72ae93.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.986a8e4123c265426b5496995e72ae93.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.6033ad3bf136a8bc50cc.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.6033ad3bf136a8bc50cc.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.161e82026ac2ae03ab6f.js.map


+ 69 - 3
src/components/pages/test/add/components/choice/choice.vue

@@ -67,12 +67,22 @@
               @keyup.enter="save"
               placeholder="请输入选项标题"
             />
+
+            <div class="changeIndex">
+              <span  @click.stop="changeIndex(index,0)">
+                <svg t="1737082063936" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4412" width="200" height="200"><path d="M908.8 787.2 512 396.8l-396.8 396.8c-25.6 25.6-70.4 25.6-96 0s-25.6-70.4 0-96l441.6-441.6C480 236.8 492.8 230.4 512 230.4s32 6.4 51.2 19.2l441.6 441.6c25.6 25.6 25.6 70.4 0 96C979.2 819.2 934.4 819.2 908.8 787.2z" p-id="4413"></path></svg>
+                </span>
+              <span  @click.stop="changeIndex(index,1)">
+                <svg style="transform: rotate(180deg);" t="1737082063936" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4412" width="200" height="200"><path d="M908.8 787.2 512 396.8l-396.8 396.8c-25.6 25.6-70.4 25.6-96 0s-25.6-70.4 0-96l441.6-441.6C480 236.8 492.8 230.4 512 230.4s32 6.4 51.2 19.2l441.6 441.6c25.6 25.6 25.6 70.4 0 96C979.2 819.2 934.4 819.2 908.8 787.2z" p-id="4413"></path></svg></span>
+            </div>
+
             <span
               @click.stop="deleteChoice(index)"
               class="deleteChoice"
               v-if="cJson.array.length>2"
               >×</span
             >
+
           </div>
           <div
             class="choice_c"
@@ -101,12 +111,22 @@
               @keyup.enter="save"
               placeholder="请输入选项标题"
             />
+
+            <div class="changeIndex">
+              <span  @click.stop="changeIndex(index,0)">
+                <svg t="1737082063936" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4412" width="200" height="200"><path d="M908.8 787.2 512 396.8l-396.8 396.8c-25.6 25.6-70.4 25.6-96 0s-25.6-70.4 0-96l441.6-441.6C480 236.8 492.8 230.4 512 230.4s32 6.4 51.2 19.2l441.6 441.6c25.6 25.6 25.6 70.4 0 96C979.2 819.2 934.4 819.2 908.8 787.2z" p-id="4413"></path></svg>
+                </span>
+              <span  @click.stop="changeIndex(index,1)">
+                <svg style="transform: rotate(180deg);" t="1737082063936" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4412" width="200" height="200"><path d="M908.8 787.2 512 396.8l-396.8 396.8c-25.6 25.6-70.4 25.6-96 0s-25.6-70.4 0-96l441.6-441.6C480 236.8 492.8 230.4 512 230.4s32 6.4 51.2 19.2l441.6 441.6c25.6 25.6 25.6 70.4 0 96C979.2 819.2 934.4 819.2 908.8 787.2z" p-id="4413"></path></svg></span>
+            </div>
+
             <span
               @click.stop="deleteChoice(index)"
                 v-if="cJson.array.length>2"
               class="deleteChoice"
               >×</span
             >
+
           </div>
         </div>
       </div>
@@ -228,7 +248,18 @@ export default {
     },
 		addChoice(){
 			this.checkJson.array.push({ option: "选项" + (this.checkJson.array.length + 1), img: "" })
-		}
+		},
+    changeIndex(index,type){
+      if (type == 0 && index != 0) { // 上移
+        const item = this.checkJson.array.splice(index, 1)[0];
+        this.checkJson.array.splice(index - 1, 0, item);
+        // this.$message.info("上移");
+      } else if (type == 1 && index != this.checkJson.array.length - 1) { // 下移
+        const item = this.checkJson.array.splice(index, 1)[0];
+        this.checkJson.array.splice(index + 1, 0, item);
+        // this.$message.info("下移");
+      }
+    }
   },
   mounted() {
     // if (!this.cJson || Object.keys(this.cJson).length == 0) {
@@ -267,7 +298,7 @@ export default {
   align-items: center;
   margin-bottom: 10px;
   position: relative;
-  width: calc(100% - 50px);
+  width: calc(100% - 50px - 50px);
 }
 .choice_box > .choices > .choice > .choice_c > span {
   /* padding-right: 50px; */
@@ -306,7 +337,7 @@ export default {
   min-width: 25px;
   min-height: 25px;
   position: absolute;
-  right: -30px;
+  right: -60px;
   transform: translateY(2px);
   border-radius: 5px;
   color: #646a73 !important;
@@ -326,4 +357,39 @@ export default {
   background-color: #e8e9e9;
 }
 
+.changeIndex{
+  width: 16px;
+  height: 45px;
+  position: absolute;
+  right: -25px;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-around;
+  transform: translateY(2px);
+  /* background-color: red; */
+}
+
+.changeIndex>span{
+  width: 20px;
+  height: 18px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  box-sizing: border-box;
+  padding: 4px;
+  cursor: pointer;
+  border-radius: 4px;
+  background-color: #fff;
+  /* background-color: yellow; */
+}
+
+.changeIndex>span:hover{
+  background-color: #e8e9e9;
+}
+
+.changeIndex>span>svg{
+  width: 100%;
+  height: 100%;
+}
+
 </style>

+ 211 - 7
src/components/pages/test/check/index.vue

@@ -129,14 +129,14 @@
                   style="margin-right: 10px; position: relative"
                   v-if="stype == 2 || stype == 3"
                 >
-                  <el-date-picker
+                  <!-- <el-date-picker
                     v-model="SubmitTime"
                     type="date"
                     @change="searchCourse"
                     value-format="yyyy-MM-dd"
                     placeholder="选择日期"
                   >
-                  </el-date-picker>
+                  </el-date-picker> -->
                   <!-- <el-select v-model="SubmitTime" placeholder="按提交时间筛选">
                     <el-option
                       label="全部"
@@ -328,7 +328,7 @@
                 </div>
               </div>
               <div class="content2" v-if="item.type == 3">
-                <div class="left">
+                <div class="left"  style="min-height: 482px;">
                   <div class="title">
                     <span>序号</span>
                     <span>词频</span>
@@ -336,10 +336,10 @@
                   </div>
                   <div
                     class="data"
-                    v-for="(data, index2) in item.array"
-                    :key="index + '-' + index2"
+                    v-for="(data, index3) in item.showArray"
+                    :key="index + '-' + index3"
                   >
-                    <span>{{ index2 + 1 }}</span>
+                    <span>{{ index3 + 1 }}</span>
                     <span>{{ data.count }}次</span>
                     <el-tooltip
                       :content="data.name"
@@ -350,10 +350,29 @@
                       <span>{{ data.name }}</span>
                     </el-tooltip>
                   </div>
+                  <div class="paging" v-if="item.limit">
+                    <el-pagination
+                      background
+                      :hide-on-single-page="true"
+                      :page-size="item.limit"
+											@current-change="textPagingChange($event,item,index)"
+                      :current-page="item.nowPage"
+                      layout="prev, pager, next"
+                      :total="item.total">
+                    </el-pagination>
+                  </div>
                 </div>
                 <div class="right">
+									<div class="noWordCloud" v-if="!item.wordCloutData">
+										<el-button v-if="!item.loadingWordCloud" type="primary" @click="getWordCloutData(item,index)">生成词云图</el-button>
+                    <div v-else>
+                      <span>小可努力生成中,请稍等片刻</span>
+                      <img src="../../../../assets/KekeLoading.gif">
+                    </div>
+									</div>
                   <wordcloud
-                    :data="item.array"
+										v-else
+                    :data="item.wordCloutData"
                     nameKey="name"
                     valueKey="count"
                     :showTooltip="false"
@@ -1098,6 +1117,22 @@
                 width="170px"
                 align="left"
               >
+              <template slot="header" slot-scope="scope">
+                  <div
+                  style="display: flex; align-items: center"
+                  >
+                    <span>提交时间</span>
+                    <div class="tableDatePicker">
+                      <el-date-picker
+                        v-model="submissionTimePicker"
+                        @change="submissionTimePickerChange"
+                        type="daterange"
+                        range-separator="▼"
+                      >
+                      </el-date-picker>
+                    </div>
+                  </div>
+                </template>
                 <template slot-scope="scope">
                   <span
                     :style="`${
@@ -1735,6 +1770,8 @@ import FileSaver from "file-saver";
 import XLSX from "xlsx-js-style";
 import aiBoxRight from "./aiBoxRight.vue";
 
+import { v4 as uuidv4 } from "uuid";
+
 // word模板
 import docxTemplateDialog from "./docxTemplateDialog";
 
@@ -1851,6 +1888,7 @@ export default {
       fileLoading: [],
       selectWorkList: [],
       tableDatePicker: [],
+      submissionTimePicker:[],
       // fileLoadCount: [],
       // fileLoadNum: [],
       // infoprogress: [],
@@ -2395,6 +2433,20 @@ export default {
                       count: 1,
                     });
                   }
+
+                  let limit = 10;
+
+                  if(topic.array.length>limit){
+                    topic.showArray = topic.array.slice(0,limit)
+                    topic.nowPage = 1;
+                    topic.total = topic.array.length;
+                    topic.limit = limit;
+                  }else{
+                    topic.showArray = topic.array;
+                  }
+
+									topic.loadingWordCloud = false;
+									topic.wordCloutData = null;
                 }
               } else if (topic.type == 5) {
                 let _answer = el2.array[i].json.file
@@ -3552,7 +3604,127 @@ export default {
       });
       this.tableWorksArray = _copyData;
     },
+    submissionTimePickerChange(){
+      let _copyData = JSON.parse(JSON.stringify(this.worksArray));
+      console.log(this.submissionTimePicker)
+      if(!this.submissionTimePicker)return this.tableWorksArray = _copyData;
+      _copyData =  _copyData.filter(i=>{
+        let _startDate = new Date(this.submissionTimePicker[0]);
+        let _endDate = new Date(this.submissionTimePicker[1]);
+
+        let time = i.time.replace(/日/g, "").replace(/年|月/g, "-");
+        let _answerDate = new Date(time);
+        return _answerDate >= _startDate && _answerDate <= _endDate;
+      })
+
+      this.tableWorksArray = _copyData;
+      // this.submissionTimePicker.forEach((i, index) => {
+      //   /*[null,["2024-12-05T00:00:00.000","2025-01-12T00:00:00.000"],["2024-12-04T00:00:00.000","2025-01-24T00:00:00.000"]] */
+      //   if (i && i.length > 0) {
+      //     let _startDate = new Date(i[0]);
+      //     let _endDate = new Date(i[1]);
+      //     _copyData = _copyData.filter((f) => {
+      //       let _answer = f.array[index].json.answer2
+      //         .replace(/日/g, "")
+      //         .replace(/年|月/g, "-");
+      //       let _answerDate = new Date(_answer);
+      //       return _answerDate >= _startDate && _answerDate <= _endDate;
+      //     });
+      //   }
+      // });
+    },
+    textPagingChange(event,item,index){
+			this.testArray[index].nowPage = event;
+			let _nowPage = this.testArray[index].nowPage;
+			let _limit = this.testArray[index].limit;
+			this.testArray[index].showArray = this.testArray[index].array.slice(((_nowPage==0?1:_nowPage)-1)*_limit,((_nowPage==0?1:_nowPage)-1)*_limit+_limit);
+    },
+		getWordCloutData(item,index){
+			console.log(item,index);
+      this.testArray[index].loadingWordCloud = true;
+      const _msg = `NOTICE
+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.
+ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
+Instruction: Based on the context, follow "Format example", write content.
+
+## 任务
+
+请基于以下表单文本,提炼出多个关键词,用于绘制词云图。请给出相应的关键词,关键词出现的频次。请确保输出的关键字准确反映表单文本的主要内容和主题。
+
+## 要求
+
+1. **提取关键词**:从提供的课堂实录文本中提取出多个最具代表性的关键字。关键词应该涵盖表单文本中的主要概念、重要术语和核心主题。尽量选择多样化的关键词,避免过于集中在某一个主题或概念上。
+2. **词频统计**:计算每个关键字在文本中出现的频率。
+3. **输出格式**:输出结果应包含每个关键字、对应的词频数量。
+
+## 输出格式
+
+### 输出格式
+
+[
+	{"count":1,"name":"氯化钠"},
+	{"count":2,"name":"溶液"},
+	{"count":1,"name":"实验"},
+	{"count":3,"name":"质量分数"},
+	{"count":1,"name":"溶质"},
+	{"count":2,"name":"氢氧化钠"},
+	{"count":1,"name":"溶解度"},
+	{"count":4,"name":"饱和溶液"}
+]
+
+请仅仅输出表头,输出关键词和相应的内容,无需其它任何说明文字。
+冒号、逗号等符号均使用英文字符。
+
+### Format example
+
+[
+	{"count":1,"name":"氯化钠"},
+	{"count":2,"name":"溶液"},
+	{"count":1,"name":"实验"},
+	{"count":3,"name":"质量分数"},
+	{"count":1,"name":"溶质"},
+	{"count":2,"name":"氢氧化钠"},
+	{"count":1,"name":"溶解度"},
+	{"count":4,"name":"饱和溶液"}
+]
+
+## 表单文本
+${JSON.stringify(item.array)}
+`;
+
+        const _uuid = uuidv4();
+				let params = {
+					// model: "gpt-3.5-turbo",
+					temperature: 0,
+					max_tokens: 4096,
+					top_p: 1,
+					frequency_penalty: 0,
+					presence_penalty: 0,
+					messages: [{ role: "user", content: _msg }],
+					uid: _uuid,
+					mind_map_question: "",
+					stream: false,
+					model: "gpt-4o-2024-11-20",
+				};
+        this.ajax
+					.post("https://gpt4.cocorobo.cn/chat", params)
+					.then((res) => {
+            let _data = res.data.FunctionResponse.choices[0];
+						let _jsonData = _data.message.content;
+						_jsonData = _jsonData.replaceAll("```json", "").replaceAll("```", "");
+						let _result = JSON.parse(_jsonData);
+            this.testArray[index].wordCloutData = _result;
+            this.testArray[index].loadingWordCloud = false;
+            console.log(_result);
+          }).catch(e=>{
+            console.log(e);
+            this.testArray[index].loadingWordCloud = false;
+            this.testArray[index].wordCloutData = null;
+            this.$message.error("生成词云图失败")
+          })
+		},
   },
+
   beforeDestroy() {
     document.getElementsByTagName("html")[0].style.overflow = "";
     window.removeEventListener("resize", this.checkScreenSize);
@@ -4003,6 +4175,7 @@ export default {
   margin-left: 20px;
   border: 1px solid #e7e7e7;
   min-height: 300px;
+	box-sizing: border-box;
 }
 
 .title_content > .title_box > .content2 {
@@ -4014,6 +4187,7 @@ export default {
 .title_content > .title_box > .content2 > .left {
   width: calc(100% - 620px);
   border: 1px solid #e7e7e7;
+	box-sizing: border-box;
 }
 
 .title_content > .title_box > .content2 > .left > div + div {
@@ -4062,6 +4236,7 @@ export default {
   width: 600px;
   margin-left: 20px;
   border: 1px solid #e7e7e7;
+	box-sizing: border-box;
 }
 
 .title_content > .title_box > .content2 > .right >>> .wordCloud {
@@ -4529,4 +4704,33 @@ export default {
   top: -6px;
   color: red;
 }
+
+.paging{
+  width: 100%;
+  height: 40px;
+  display: flex;
+  justify-content: flex-end;
+	align-items: center;
+  margin-top:auto ;
+}
+
+.noWordCloud{
+	width: 100%;
+	height: 100%;
+	min-height: 300px;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+
+.noWordCloud>div{
+  display: flex;
+  align-items: center;
+}
+
+.noWordCloud>div>img{
+  width: 40px;
+  height: 40px;
+  margin-left: 5px;
+}
 </style>

Some files were not shown because too many files changed in this diff