|
@@ -80,7 +80,7 @@
|
|
></div>
|
|
></div>
|
|
<div v-else v-for="i in pan(item.aiContent)">
|
|
<div v-else v-for="i in pan(item.aiContent)">
|
|
<img
|
|
<img
|
|
- style="width: 120px;height: 120px;"
|
|
|
|
|
|
+ style="width: 130px;height: 130px;"
|
|
:src="i.image"
|
|
:src="i.image"
|
|
alt=""
|
|
alt=""
|
|
@click="previewImg(i.image)"
|
|
@click="previewImg(i.image)"
|
|
@@ -93,6 +93,14 @@
|
|
v-loading="item.loading"
|
|
v-loading="item.loading"
|
|
v-html="htmlContent(item.aiContent)"
|
|
v-html="htmlContent(item.aiContent)"
|
|
></div>
|
|
></div>
|
|
|
|
+ <div v-if="!item.content.includes('图片')" class="aiCopy">
|
|
|
|
+ <img
|
|
|
|
+ @click="onCopy(item.aiContent)"
|
|
|
|
+ style="width: 30px;"
|
|
|
|
+ src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%A4%8D%E5%88%B6%E5%9B%BE%E6%A0%871715569581741.png"
|
|
|
|
+ alt=""
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
<div class="t_t_c_a_r_time">{{ item.createtime }}</div>
|
|
<div class="t_t_c_a_r_time">{{ item.createtime }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -149,7 +157,7 @@ export default {
|
|
loading: false,
|
|
loading: false,
|
|
chatLoading: false,
|
|
chatLoading: false,
|
|
chatList: [],
|
|
chatList: [],
|
|
- nowChatList:[],
|
|
|
|
|
|
+ nowChatList: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -170,6 +178,26 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ onCopy(content) {
|
|
|
|
+ // 创建临时textarea元素
|
|
|
|
+ const tempInput = document.createElement("textarea");
|
|
|
|
+ tempInput.value = content; // 设置要复制的内容
|
|
|
|
+ // 隐藏元素
|
|
|
|
+ tempInput.style.position = "absolute";
|
|
|
|
+ tempInput.style.left = "-9999px";
|
|
|
|
+ // 将元素添加到DOM中
|
|
|
|
+ document.body.appendChild(tempInput);
|
|
|
|
+ // 选中元素内容
|
|
|
|
+ tempInput.select();
|
|
|
|
+ // 执行复制操作
|
|
|
|
+ document.execCommand("copy");
|
|
|
|
+ // 移除临时元素
|
|
|
|
+ document.body.removeChild(tempInput);
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "复制成功",
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
|
|
+ },
|
|
exportCourse() {
|
|
exportCourse() {
|
|
let _user = `<div style="font-size:30px;margin-top:10px;"><span style="color: rgb(113, 124, 141); font-weight: 400;">创建者:</span><span>${this.courseDetail.username}</span></div>`;
|
|
let _user = `<div style="font-size:30px;margin-top:10px;"><span style="color: rgb(113, 124, 141); font-weight: 400;">创建者:</span><span>${this.courseDetail.username}</span></div>`;
|
|
const _chapInfo = JSON.parse(this.courseDetail.chapters);
|
|
const _chapInfo = JSON.parse(this.courseDetail.chapters);
|
|
@@ -229,7 +257,7 @@ export default {
|
|
this.chatList.find(i => i.uid == _uid).isalltext = true;
|
|
this.chatList.find(i => i.uid == _uid).isalltext = true;
|
|
this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
|
|
this.chatList.find(i => i.uid == _uid).isShowSynchronization = true;
|
|
this.chatList.find(i => i.uid == _uid).loading = false;
|
|
this.chatList.find(i => i.uid == _uid).loading = false;
|
|
- this.nowChatList.push(this.chatList.find(i=>i.uid==_uid));
|
|
|
|
|
|
+ this.nowChatList.push(this.chatList.find(i => i.uid == _uid));
|
|
// 这里保存对话
|
|
// 这里保存对话
|
|
this.insertChat(_uid);
|
|
this.insertChat(_uid);
|
|
return;
|
|
return;
|
|
@@ -363,11 +391,11 @@ export default {
|
|
let history = [];
|
|
let history = [];
|
|
this.nowChatList.forEach(i => {
|
|
this.nowChatList.forEach(i => {
|
|
if (i.content == "wanSearch") {
|
|
if (i.content == "wanSearch") {
|
|
- // history.push({
|
|
|
|
|
|
+ // history.push({
|
|
// role: "assistant",
|
|
// role: "assistant",
|
|
// content: i.aiContent
|
|
// content: i.aiContent
|
|
// });
|
|
// });
|
|
- return
|
|
|
|
|
|
+ return;
|
|
} else if (i.content == "getImage") {
|
|
} else if (i.content == "getImage") {
|
|
return history.push({
|
|
return history.push({
|
|
role: "assistant",
|
|
role: "assistant",
|
|
@@ -387,7 +415,7 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- history.push({ role: "user", content: _text });
|
|
|
|
|
|
+ history.push({ role: "user", content: _text });
|
|
// history.pop();
|
|
// history.pop();
|
|
let params = {
|
|
let params = {
|
|
model: "gpt-3.5-turbo",
|
|
model: "gpt-3.5-turbo",
|
|
@@ -550,12 +578,11 @@ Instruction: Based on the context, follow "Format example", write content.
|
|
let history = [];
|
|
let history = [];
|
|
this.nowChatList.forEach(i => {
|
|
this.nowChatList.forEach(i => {
|
|
if (i.content == "wanSearch") {
|
|
if (i.content == "wanSearch") {
|
|
- // history.push({
|
|
|
|
|
|
+ // history.push({
|
|
// role: "assistant",
|
|
// role: "assistant",
|
|
// content: JSON.stringify(i.aiContent)
|
|
// content: JSON.stringify(i.aiContent)
|
|
// });
|
|
// });
|
|
- return
|
|
|
|
-
|
|
|
|
|
|
+ return;
|
|
} else if (i.content == "getImage") {
|
|
} else if (i.content == "getImage") {
|
|
return history.push({
|
|
return history.push({
|
|
role: "assistant",
|
|
role: "assistant",
|
|
@@ -579,7 +606,7 @@ Instruction: Based on the context, follow "Format example", write content.
|
|
if (_msg) {
|
|
if (_msg) {
|
|
history.push({ role: "user", content: _msg });
|
|
history.push({ role: "user", content: _msg });
|
|
}
|
|
}
|
|
- // history.push({ role: "user", content: _text });
|
|
|
|
|
|
+ // history.push({ role: "user", content: _text });
|
|
this.scrollBottom();
|
|
this.scrollBottom();
|
|
|
|
|
|
let params = {
|
|
let params = {
|
|
@@ -627,7 +654,7 @@ Instruction: Based on the context, follow "Format example", write content.
|
|
this.getChatList().then(_ => {
|
|
this.getChatList().then(_ => {
|
|
this.scrollBottom();
|
|
this.scrollBottom();
|
|
});
|
|
});
|
|
- this.nowChatList = [];
|
|
|
|
|
|
+ this.nowChatList = [];
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -638,7 +665,13 @@ Instruction: Based on the context, follow "Format example", write content.
|
|
height: 100%;
|
|
height: 100%;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+.aiCopy {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 5px;
|
|
|
|
+ bottom: 0%;
|
|
|
|
+ /* transform: translate(0, -30%); */
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
.taskTop {
|
|
.taskTop {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 280px;
|
|
height: 280px;
|
|
@@ -817,6 +850,7 @@ Instruction: Based on the context, follow "Format example", write content.
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding-right: 35px;
|
|
padding-right: 35px;
|
|
|
|
+ position: relative;
|
|
}
|
|
}
|
|
|
|
|
|
.t_t_c_a_right {
|
|
.t_t_c_a_right {
|