|
@@ -1,26 +1,29 @@
|
|
|
<template>
|
|
|
<div class="ch_box" ref="ch_box">
|
|
|
-
|
|
|
<div class="ch_content_box" v-if="type == 1">
|
|
|
<searchArea
|
|
|
:courseDetail="courseDetail"
|
|
|
ref="searchAreaRef"
|
|
|
- :navList="navList"
|
|
|
- :tcid="tcid"
|
|
|
+ :navList="navList"
|
|
|
+ :tcid="tcid"
|
|
|
+ :fileId="fileId"
|
|
|
+ :recordType="recordType"
|
|
|
v-if="itemType == 1"
|
|
|
/>
|
|
|
<taskArea
|
|
|
:courseDetail="courseDetail"
|
|
|
- :navList="navList"
|
|
|
- :courseType="courseType"
|
|
|
- :taskCount="taskCount"
|
|
|
- :worksStudent="worksStudent"
|
|
|
+ :navList="navList"
|
|
|
+ :courseType="courseType"
|
|
|
+ :taskCount="taskCount"
|
|
|
+ :worksStudent="worksStudent"
|
|
|
ref="taskAreaRef"
|
|
|
+ :fileId="fileId"
|
|
|
v-if="itemType == 2"
|
|
|
/>
|
|
|
<dialogArea
|
|
|
:courseDetail="courseDetail"
|
|
|
ref="dialogAreaRef"
|
|
|
+ :fileId="fileId"
|
|
|
v-if="itemType == 3"
|
|
|
/>
|
|
|
</div>
|
|
@@ -41,7 +44,7 @@
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
|
|
|
- <div @click="$emit('review')" v-if="tType==1">
|
|
|
+ <div @click="$emit('review')" v-if="tType == 1">
|
|
|
<el-tooltip class="item" effect="dark" content="评论" placement="top">
|
|
|
<img
|
|
|
:src="require('../../assets/icon/course/comment.png')"
|
|
@@ -50,7 +53,8 @@
|
|
|
/>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <div @click="$emit('authority')" v-if="(tType==1 || tType == 4)"><!-- -->
|
|
|
+ <div @click="$emit('authority')" v-if="tType == 1 || tType == 4">
|
|
|
+ <!-- -->
|
|
|
<el-tooltip class="item" effect="dark" content="权限" placement="top">
|
|
|
<img
|
|
|
:src="require('../../assets/icon/course/setting.png')"
|
|
@@ -150,8 +154,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <levitatedSphere @startTime="startTime"/>
|
|
|
- <timepiece ref="timepieceRef"/>
|
|
|
+ <levitatedSphere ref="levitatedSphereRef" @startTime="startTime" />
|
|
|
+ <timepiece ref="timepieceRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -159,7 +163,7 @@
|
|
|
import searchArea from "./component/searchArea.vue";
|
|
|
import taskArea from "./component/taskArea.vue";
|
|
|
import dialogArea from "./component/dialogArea.vue";
|
|
|
-import levitatedSphere from './component/levitatedSphere.vue'
|
|
|
+import levitatedSphere from "./component/levitatedSphere.vue";
|
|
|
import timepiece from "./component/timepiece.vue";
|
|
|
export default {
|
|
|
emits: ["refresh", "goStep", "backPage", "authority", "review"],
|
|
@@ -167,47 +171,55 @@ export default {
|
|
|
searchArea,
|
|
|
taskArea,
|
|
|
dialogArea,
|
|
|
- levitatedSphere,
|
|
|
- timepiece
|
|
|
+ levitatedSphere,
|
|
|
+ timepiece
|
|
|
},
|
|
|
props: {
|
|
|
courseDetail: {
|
|
|
type: Object,
|
|
|
default: () => {}
|
|
|
},
|
|
|
- tType:{
|
|
|
- type:Number,
|
|
|
- default:0,
|
|
|
- },
|
|
|
- navList:{
|
|
|
- type:Array,
|
|
|
- default:()=>[]
|
|
|
- },
|
|
|
- tcid:{
|
|
|
- type:String,
|
|
|
- default:""
|
|
|
- },
|
|
|
- courseType:{
|
|
|
- type:Number,
|
|
|
- default:0
|
|
|
- },
|
|
|
- taskCount:{
|
|
|
- type:Number,
|
|
|
- default:0
|
|
|
- },
|
|
|
- worksStudent:{
|
|
|
- type:Array,
|
|
|
- default:()=>[]
|
|
|
- }
|
|
|
+ tType: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
+ navList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ },
|
|
|
+ tcid: {
|
|
|
+ type: String,
|
|
|
+ default: ""
|
|
|
+ },
|
|
|
+ courseType: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
+ taskCount: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
+ worksStudent: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ },
|
|
|
+ fileList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
type: 0,
|
|
|
- itemType: 0 //0--无 1-搜索 2-任务 3-对话
|
|
|
+ itemType: 0, //0--无 1-搜索 2-任务 3-对话
|
|
|
+ fileId: [],
|
|
|
+ recordType:0,
|
|
|
+ getFileIdLoading: false
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.setWidth();
|
|
|
+ this.getFileId();
|
|
|
},
|
|
|
methods: {
|
|
|
setWidth() {
|
|
@@ -236,16 +248,62 @@ export default {
|
|
|
this.itemType = type;
|
|
|
});
|
|
|
},
|
|
|
- //计时
|
|
|
- startTime(time){
|
|
|
- this.$refs.timepieceRef.startTime(time);
|
|
|
- }
|
|
|
- },
|
|
|
- mounted(){
|
|
|
- // setTimeout(()=>{
|
|
|
- // this.startTime(10)
|
|
|
- // },2000)
|
|
|
- }
|
|
|
+ //计时
|
|
|
+ startTime(time) {
|
|
|
+ this.$refs.timepieceRef.startTime(time);
|
|
|
+ },
|
|
|
+ getFileId() {
|
|
|
+ if (this.getFileIdLoading) return;
|
|
|
+ this.getFileIdLoading = true;
|
|
|
+ this.fileId = [];
|
|
|
+ let _this = this;
|
|
|
+ let _successFileUrl = [];
|
|
|
+ if (this.fileList.length <= 0) retrun;
|
|
|
+ let addType = ["DOCX", "DOC", "PPT", "PPTX", "MD", "TXT"];
|
|
|
+ this.fileList.forEach(i => {
|
|
|
+ if (
|
|
|
+ addType.includes(
|
|
|
+ i.url.split(".")[i.url.split(".").length - 1].toLocaleUpperCase()
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ _successFileUrl.push(i.url);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ let promiseList = [];
|
|
|
+ _successFileUrl.forEach(i => {
|
|
|
+ promiseList.push(
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ _this.ajax
|
|
|
+ .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
|
|
|
+ url: i
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ let _data = res.data.FunctionResponse;
|
|
|
+ if (_data.result && _data.result.id) {
|
|
|
+ this.fileId.push(_data.result.id);
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ );
|
|
|
+ });
|
|
|
+ Promise.all(promiseList).then(res => {
|
|
|
+ this.getFileIdLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ startAssistant(){
|
|
|
+ if(this.recordType==0){
|
|
|
+ this.$refs.levitatedSphereRef.recordStart();
|
|
|
+ }else if(this.recordType==1){
|
|
|
+ this.$refs.levitatedSphereRef.stopRecord();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeRecordType(type){
|
|
|
+ console.log("修改了")
|
|
|
+ this.recordType = type;
|
|
|
+ console.log(this.recordType)
|
|
|
+ },
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -261,7 +319,7 @@ export default {
|
|
|
/* overflow: hidden; */
|
|
|
display: flex;
|
|
|
top: 20px;
|
|
|
- z-index:1000;
|
|
|
+ z-index: 1000;
|
|
|
}
|
|
|
|
|
|
.ch_nav_box {
|
|
@@ -270,9 +328,9 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
/* justify-content: flex-end; */
|
|
|
- margin-top: auto;
|
|
|
+ margin-top: auto;
|
|
|
align-items: center;
|
|
|
- overflow: auto;
|
|
|
+ overflow: auto;
|
|
|
}
|
|
|
|
|
|
.ch_content_box {
|
|
@@ -353,7 +411,7 @@ export default {
|
|
|
.ch_nav_box_top {
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
- margin-top: auto;
|
|
|
+ margin-top: auto;
|
|
|
}
|
|
|
.ch_nav_box_top > div {
|
|
|
width: 100%;
|