From fc8720fc400ee82041d3b8ffd59a4f207d2fb5c4 Mon Sep 17 00:00:00 2001 From: liuye Date: Fri, 12 Jul 2024 17:59:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E5=8A=A9=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../baiduAI/AppDialogue/AppDialogue.vue | 40 +++++++++++++------ src/project/baiduAI/AppRecord2/AppRecord.vue | 30 ++++++++++---- 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/src/project/baiduAI/AppDialogue/AppDialogue.vue b/src/project/baiduAI/AppDialogue/AppDialogue.vue index 219d62b..70e7c4c 100644 --- a/src/project/baiduAI/AppDialogue/AppDialogue.vue +++ b/src/project/baiduAI/AppDialogue/AppDialogue.vue @@ -2,9 +2,9 @@
- +
+ {{aiConfigName || '选择应用'}} +
@@ -118,13 +118,11 @@ export default { pages: 2, areaId: '', statusBarHeight: uni.getSystemInfoSync().statusBarHeight, - typeList: [ - {dictValue: '1', dictName: '文本助理'}, - {dictValue: '2', dictName: '日常助理'} - ], - type: '', + typeList: [], + aiConfigId: '', + aiConfigName: '', showType: false, - showPopup: true + showPopup: true, } }, computed: { @@ -136,6 +134,7 @@ export default { }); }, onShow() { + this.getAiTypeList() this.getHistoryList() }, onPullDownRefresh() { @@ -218,7 +217,7 @@ export default { return this.$u.toast("请先进行登录") } this.$loading() - this.$instance.post("/app/appaicopilotinfo/add", {content: this.content, appType: 0, areaId: this.areaId}).then(res => { + this.$instance.post("/app/appaicopilotinfo/add", {content: this.content, appType: 0, areaId: this.areaId, aiConfigId: this.aiConfigId}).then(res => { if(res.code == 0) { this.content = '' this.messageList.push(res.data[0]) @@ -238,7 +237,7 @@ export default { return this.$u.toast("请先进行登录") } this.$loading() - this.$instance.post("/app/appaicopilotinfo/add", {sdkFileUrl: this.voiceUrl, fileId: this.voiceId, appType: 0}).then(res => { + this.$instance.post("/app/appaicopilotinfo/add", {sdkFileUrl: this.voiceUrl, fileId: this.voiceId, appType: 0, aiConfigId: this.aiConfigId}).then(res => { if(res.code == 0) { this.voiceUrl = '' this.voiceId = '' @@ -262,7 +261,7 @@ export default { return this.$u.toast("请先进行登录") } this.$loading() - this.$instance.post(`/app/appaicopilotinfo/list?current=${this.current}&size=10`).then(res => { + this.$instance.post(`/app/appaicopilotinfo/list?current=${this.current}&size=10&aiConfigId=${this.aiConfigId}`).then(res => { if(res.code == 0 && res.data.records.length) { res.data.records.map((item) => { if(item.sdkFileUrl) { @@ -322,8 +321,23 @@ export default { } }, confirmType(val) { - this.type = val[0].value; + this.aiConfigId = val[0].value + this.aiConfigName = val[0].label }, + getAiTypeList() { + this.$instance.post(`/app/appaiconfiginfo/list?status=1`).then(res => { + if(res.code == 0) { + res.data.records.map((item) => { + item.dictName = item.appName + item.dictValue = item.id + }) + this.typeList = res.data.records + this.aiConfigId = this.typeList[0].dictValue + this.aiConfigName = this.typeList[0].dictName + this.getHistoryList() + } + }) + } }, } diff --git a/src/project/baiduAI/AppRecord2/AppRecord.vue b/src/project/baiduAI/AppRecord2/AppRecord.vue index 28f8ae3..81fe1aa 100644 --- a/src/project/baiduAI/AppRecord2/AppRecord.vue +++ b/src/project/baiduAI/AppRecord2/AppRecord.vue @@ -9,13 +9,13 @@
-
-

111111111111

+
+

{{item.content}}

-

2024-06-02 10:21:23

+

{{item.createTime}}

-

查看对话

-
+

查看对话

+
@@ -56,7 +56,7 @@ export default { ...mapState(['user', 'token']), }, onShow() { - //this.getHistoryList() + this.getHistoryList() }, onPullDownRefresh() { if(this.current > this.pages) { @@ -72,7 +72,7 @@ export default { return this.$u.toast("请先进行登录") } this.$loading() - this.$instance.post(`/app/appaicopilotinfo/list?current=${this.current}&size=10&content=${this.searchVal}`).then(res => { + this.$instance.post(`/app/appaicopilotinfo/listHistory?current=${this.current}&size=10&content=${this.searchVal}`).then(res => { if(res.code == 0 && res.data.records.length) { res.data.records.map((item) => { if(item.sdkFileUrl) { @@ -105,6 +105,22 @@ export default { this.searchVal = '' this.getSearchList() }, + toDetail(e) { + uni.navigateTo({url: `./Detail`}) + }, + del(e) { + this.$confirm('确定删除该数据?').then(() => { + uni.showLoading() + this.$instance.post(`/app/appresident/delete?ids=${e.id}`).then((res) => { + if (res.code == 0) { + this.$u.toast('删除成功!') + this.getSearchList() + } + uni.hideLoading() + }) + }).catch(() => { + }) + } }, }