|
@@ -557,7 +557,7 @@ export default {
|
|
|
selectable(row, index) {
|
|
|
return row.worksCount > 0
|
|
|
},
|
|
|
- confirmSelection() {
|
|
|
+ async confirmSelection() {
|
|
|
// 获取用户选择的表单
|
|
|
const selectedForms = this.$refs.table.selection; // 获取选中的行
|
|
|
console.log("用户选择的表单:", selectedForms); // 打印用户选择的表单
|
|
@@ -568,11 +568,14 @@ export default {
|
|
|
// return lastArr
|
|
|
// }, []).join(',');
|
|
|
this.cid = selectedForms.map(i => i.courseId).join(",")
|
|
|
+ const names = selectedForms.map(item => item.title).join('');
|
|
|
+ console.log(names);
|
|
|
this.formId = selectedForms.map(i => i.courseId).join('')
|
|
|
console.log("cid", this.cid);
|
|
|
this.getData(this.cid)
|
|
|
- this.guessAskJson()
|
|
|
- this.addChat()
|
|
|
+ await this.getChatList()
|
|
|
+ await this.guessAskJson()
|
|
|
+ this.addChat(names)
|
|
|
this.dialogTableVisible = false;
|
|
|
// this.getChatList()
|
|
|
|
|
@@ -595,16 +598,11 @@ export default {
|
|
|
console.log("选择的文件:", file.name);
|
|
|
}
|
|
|
},
|
|
|
- addChat() {
|
|
|
- return new Promise((resolve) => {
|
|
|
- const names = this.menuList.map(item => item.name).join(', ');
|
|
|
- console.log(names);
|
|
|
- console.log(">", courseId);
|
|
|
-
|
|
|
+ addChat(names) {
|
|
|
let params = [{
|
|
|
uid: this.userid,
|
|
|
name: names,
|
|
|
- courseId: this.cid
|
|
|
+ courseId: this.formId
|
|
|
}];
|
|
|
this.ajax
|
|
|
.post(this.$store.state.api + "addChat", params)
|
|
@@ -617,9 +615,8 @@ export default {
|
|
|
resolve();
|
|
|
console.error(err);
|
|
|
})
|
|
|
- })
|
|
|
},
|
|
|
- guessAskJson() {
|
|
|
+ async guessAskJson() {
|
|
|
const names = this.worksArray.map(item => item.name).join(', ');
|
|
|
console.log("获取猜你想搜", names);
|
|
|
let _uid = uuidv4();
|
|
@@ -2131,7 +2128,7 @@ export default {
|
|
|
.then(res => { });
|
|
|
},
|
|
|
// 获取对应的聊天记录
|
|
|
- getChatList() {
|
|
|
+ async getChatList() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
// if (this.loading) return;
|
|
|
this.array = [];
|
|
@@ -2532,7 +2529,7 @@ export default {
|
|
|
this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
});
|
|
|
// if (this.courseId) {
|
|
|
- // this.insertChat(_uuid);
|
|
|
+ this.insertChat(_uuid);
|
|
|
// }
|
|
|
})
|
|
|
.catch(err => {
|