|
@@ -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>
|