|
@@ -29,7 +29,7 @@
|
|
|
"
|
|
|
>
|
|
|
<div class="s_t_c_a_left">
|
|
|
- <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
|
|
|
+ <el-avatar v-if="item.filename" :src="item.filename"></el-avatar>
|
|
|
<span v-else>Ai</span>
|
|
|
</div>
|
|
|
<div class="s_t_c_a_right">
|
|
@@ -268,14 +268,14 @@
|
|
|
<img src="../../../assets/icon/course/sRio2.png" style="margin-right: 5px;" alt="" v-else> -->
|
|
|
搜索视频
|
|
|
</div>
|
|
|
- <div class="s_b_ba-item" @click.stop="choiceRole()">
|
|
|
- <img
|
|
|
- style="width: 20px;"
|
|
|
- src="../../../assets/icon/course/role.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- 选择智能体
|
|
|
- </div>
|
|
|
+ <div class="s_b_ba-item" @click.stop="choiceRole()">
|
|
|
+ <img
|
|
|
+ style="width: 20px;"
|
|
|
+ src="../../../assets/icon/course/role.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ 选择智能体
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="s_b_atBox" v-if="openAtBox" v-loading="loading">
|
|
@@ -602,11 +602,31 @@
|
|
|
<div class="choiceTopArea" v-if="cardType == 1">
|
|
|
<div class="choiceTop">
|
|
|
<div class="choiceRoleHeader">
|
|
|
- <div>切换角色:</div>
|
|
|
- <span>您希望以下哪个角色回答您的问题,请选择:</span>
|
|
|
+ <div
|
|
|
+ class="s_t_c_ai"
|
|
|
+ >
|
|
|
+ <div class="s_t_c_a_left">
|
|
|
+ <el-avatar :src="require('../../../assets/icon/course/aiWait.svg')"></el-avatar>
|
|
|
+ </div>
|
|
|
+ <div class="s_t_c_a_right">
|
|
|
+ <div
|
|
|
+ class="s_t_c_a_r_content"
|
|
|
+ >选择您需要的智能体,开始对话</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="choiceSelect">
|
|
|
- <el-button
|
|
|
+ <div style="width:100%">
|
|
|
+ <div class="roleInput"> <el-input
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="roleText"
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input></div>
|
|
|
+
|
|
|
+ <div class="roleBtn"> <el-button
|
|
|
class="option"
|
|
|
:style="{
|
|
|
background: sortOption == 0 ? '#36A9FC' : '',
|
|
@@ -625,28 +645,38 @@
|
|
|
@click="optBtn(1)"
|
|
|
plain
|
|
|
>社区</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div
|
|
|
+ ></div>
|
|
|
+ </div>
|
|
|
+ <div class="roleListBox">
|
|
|
+ <div
|
|
|
class="characterBlock"
|
|
|
- v-if="sortOption == 0"
|
|
|
- v-for="(item, index) in roleList"
|
|
|
+ v-for="(item, index) in showRoleList"
|
|
|
:key="item.id"
|
|
|
@click.stop="choseRole(item)"
|
|
|
>
|
|
|
<div class="imgLeft">
|
|
|
<div class="img">
|
|
|
- <img v-if="item.headUrl" style="width: 100%;height: 100%;" :src="item.headUrl" />
|
|
|
- <img v-else style="width: 100%;height: 100%;" :src="require('../../../assets/icon/course/ai.png')">
|
|
|
+ <img
|
|
|
+ style="width: 100%;height: 100%;"
|
|
|
+ :src="
|
|
|
+ item.headUrl && item.headUrl != ''
|
|
|
+ ? item.headUrl
|
|
|
+ : require('../../../assets/icon/course/ai.png')
|
|
|
+ "
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="txtRight">
|
|
|
- <div class="bir">{{ item.assistantName }}</div>
|
|
|
+
|
|
|
+ <el-tooltip class="item" effect="dark" :content="item.assistantName" placement="top">
|
|
|
+ <div class="bir">{{ item.assistantName }}</div>
|
|
|
+ </el-tooltip>
|
|
|
<div
|
|
|
:style="{
|
|
|
color: '#fff',
|
|
|
display:
|
|
|
- (choseRoleItem && choseRoleItem.assistant_id == item.assistant_id)
|
|
|
+ choseRoleItem &&
|
|
|
+ choseRoleItem.assistant_id == item.assistant_id
|
|
|
? 'block'
|
|
|
: 'none'
|
|
|
}"
|
|
@@ -655,23 +685,19 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div
|
|
|
class="characterBlock"
|
|
|
- v-if="sortOption == 1"
|
|
|
- v-for="(item, index) in roleList2"
|
|
|
+ v-if="sortOption == 0"
|
|
|
+ v-for="(item, index) in roleList"
|
|
|
:key="item.id"
|
|
|
@click.stop="choseRole(item)"
|
|
|
>
|
|
|
<div class="imgLeft">
|
|
|
<div class="img">
|
|
|
- <img
|
|
|
- style="width: 100%;height: 100%;"
|
|
|
- :src="
|
|
|
- item.headUrl
|
|
|
- ? item.headUrl
|
|
|
- : require('../../../assets/icon/course/ai.png')
|
|
|
- "
|
|
|
- />
|
|
|
+ <img v-if="item.headUrl" style="width: 100%;height: 100%;" :src="item.headUrl" />
|
|
|
+ <img v-else style="width: 100%;height: 100%;" :src="require('../../../assets/icon/course/ai.png')">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="txtRight">
|
|
@@ -680,7 +706,7 @@
|
|
|
:style="{
|
|
|
color: '#fff',
|
|
|
display:
|
|
|
- choseRoleItem.assistant_id == item.assistant_id
|
|
|
+ (choseRoleItem && choseRoleItem.assistant_id == item.assistant_id)
|
|
|
? 'block'
|
|
|
: 'none'
|
|
|
}"
|
|
@@ -688,7 +714,8 @@
|
|
|
已选择
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
</div>
|
|
|
<div class="choiceBottom">
|
|
|
<el-button class="cb_btn" size="mini" @click="noChangeRole()"
|
|
@@ -825,11 +852,28 @@ export default {
|
|
|
choseRoleItem: null,
|
|
|
cardType: 0,
|
|
|
roleList: [],
|
|
|
- roleList2: [],
|
|
|
- sortOption: 0 //切换角色 0我的 1 社区
|
|
|
+ roleList2: [],
|
|
|
+ sortOption: 0, //切换角色 0我的 1 社区
|
|
|
+ roleText: ""
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ showRoleList() {
|
|
|
+ let _result = [];
|
|
|
+
|
|
|
+ if (this.sortOption == 0) {
|
|
|
+ _result = this.roleList;
|
|
|
+ } else if (this.sortOption == 1) {
|
|
|
+ _result = this.roleList2;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.roleText) {
|
|
|
+ _result = _result.filter(
|
|
|
+ i => i.assistantName.indexOf(this.roleText) != -1
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return _result;
|
|
|
+ },
|
|
|
openAtBox() {
|
|
|
// return false;
|
|
|
if (this.text.length == 0) return false;
|
|
@@ -1065,13 +1109,13 @@ export default {
|
|
|
this.$confirm("确定清空聊天记录吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
.then(_ => {
|
|
|
this.loading = true;
|
|
|
let params = {
|
|
|
user_id: this.userid,
|
|
|
- id:"602def61-005d-11ee-91d8-005056b8q12w",
|
|
|
+ id: "602def61-005d-11ee-91d8-005056b8q12w",
|
|
|
session_name: `${this.courseId}-studyStudent-md`
|
|
|
};
|
|
|
|
|
@@ -1079,7 +1123,7 @@ export default {
|
|
|
.post("https://gpt4.cocorobo.cn/delete_park_session", params)
|
|
|
.then(res => {
|
|
|
this.chatList = [];
|
|
|
- this.stopSend();
|
|
|
+ this.stopSend();
|
|
|
this.$message.success("清除聊天记录成功");
|
|
|
this.loading = false;
|
|
|
})
|
|
@@ -1137,7 +1181,7 @@ export default {
|
|
|
aiContent: "",
|
|
|
oldContent: "",
|
|
|
isShowSynchronization: false,
|
|
|
- filename: this.choseRoleItem?this.choseRoleItem.headUrl:"",
|
|
|
+ filename: this.choseRoleItem ? this.choseRoleItem.headUrl : "",
|
|
|
index: this.chatList.length,
|
|
|
is_mind_map: false,
|
|
|
loading: true
|
|
@@ -1309,7 +1353,9 @@ export default {
|
|
|
history.push({ type: "text", text: _text });
|
|
|
}
|
|
|
let params = {
|
|
|
- assistant_id: this.choseRoleItem?this.choseRoleItem.assistant_id:"f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
|
|
|
+ assistant_id: this.choseRoleItem
|
|
|
+ ? this.choseRoleItem.assistant_id
|
|
|
+ : "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
|
|
|
userId: this.userid,
|
|
|
message: _text,
|
|
|
session_name: `${this.courseId}-studyStudent-md`,
|
|
@@ -2601,12 +2647,12 @@ ${_wordData}
|
|
|
choseRole(item) {
|
|
|
this.choseRoleItem = item;
|
|
|
console.log("选择角色", this.choseRoleItem);
|
|
|
- this.scrollBottom();
|
|
|
+ this.scrollBottom();
|
|
|
},
|
|
|
noChangeRole() {
|
|
|
this.cardType = 0;
|
|
|
this.choseRoleItem = null;
|
|
|
- this.scrollBottom();
|
|
|
+ this.scrollBottom();
|
|
|
},
|
|
|
changeRole() {
|
|
|
this.cardType = 0;
|
|
@@ -2923,10 +2969,10 @@ ${_wordData}
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
|
|
|
-.s_t_c_a_left>img{
|
|
|
- width: 35px;
|
|
|
+.s_t_c_a_left > img {
|
|
|
+ width: 35px;
|
|
|
height: 35px;
|
|
|
- border-radius: 50%;
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
|
|
|
|
.s_t_c_a_left > span {
|
|
@@ -3524,25 +3570,26 @@ ${_wordData}
|
|
|
|
|
|
.choiceRoleHeader {
|
|
|
width: 100%;
|
|
|
+ height:100px;
|
|
|
+ display: flex;
|
|
|
/* margin: 10px; */
|
|
|
- margin-bottom: 20px;
|
|
|
}
|
|
|
|
|
|
.choiceRoleHeader > div {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
+ display: flex;
|
|
|
}
|
|
|
|
|
|
-.choiceRoleHeader > span {
|
|
|
- font-size: 14px;
|
|
|
-}
|
|
|
.choiceSelect {
|
|
|
width: 100%;
|
|
|
+ height:calc(100% - 100px);
|
|
|
display: flex;
|
|
|
- height: 35px;
|
|
|
+ flex-direction: column;
|
|
|
justify-content: flex-start;
|
|
|
align-items: center;
|
|
|
- margin: 15px 0;
|
|
|
+ padding: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 10px;
|
|
|
+ background: #F2F2F2;
|
|
|
}
|
|
|
.choiceSelect > .option {
|
|
|
width: 80px;
|
|
@@ -3554,6 +3601,29 @@ ${_wordData}
|
|
|
align-items: center;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
+.roleInput{
|
|
|
+ width:100%;
|
|
|
+ height:50px;
|
|
|
+}
|
|
|
+
|
|
|
+.roleBtn{
|
|
|
+ width:100%;
|
|
|
+ height:50px;
|
|
|
+ margin: 5px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.roleListBox{
|
|
|
+ width:100%;
|
|
|
+ height:calc(100% - 100px - 10px);
|
|
|
+ overflow-x: hidden;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ padding: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
.filterSubjects {
|
|
|
margin: 10px;
|
|
|
width: 100%;
|
|
@@ -3638,7 +3708,8 @@ ${_wordData}
|
|
|
display: flex;
|
|
|
background: rgba(54, 169, 252, 1);
|
|
|
width: 100%;
|
|
|
- height: 80px;
|
|
|
+ height: auto;
|
|
|
+ padding:10px 0;
|
|
|
margin: 0 auto;
|
|
|
border-radius: 10px;
|
|
|
margin-bottom: 15px;
|
|
@@ -3669,7 +3740,7 @@ ${_wordData}
|
|
|
align-items: center;
|
|
|
}
|
|
|
.characterBlock > .txtRight > .bir {
|
|
|
- width: 180px;
|
|
|
+ width: 170px;
|
|
|
height: 35px;
|
|
|
display: flex;
|
|
|
align-items: center;
|