小助理
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
<div class="AppDialogue">
|
<div class="AppDialogue">
|
||||||
<u-navbar title="Copilot小助理" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :is-back="false" height="88"></u-navbar>
|
<u-navbar title="Copilot小助理" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar" :is-back="false" height="88"></u-navbar>
|
||||||
<!-- <scroll-view scroll-y="true" class="scroll-Y" @scroll="scroll"> -->
|
<!-- <scroll-view scroll-y="true" class="scroll-Y" @scroll="scroll"> -->
|
||||||
<!-- <div class="top-select" @click="showType=true">
|
<div class="top-select" @click="showType=true">
|
||||||
{{typeList[type].dictName || '选择应用'}} <u-icon name="arrow-down" color="#fff" size="28"></u-icon>
|
{{aiConfigName || '选择应用'}} <u-icon name="arrow-down" color="#fff" size="28"></u-icon>
|
||||||
</div> -->
|
</div>
|
||||||
<div class="service-content" v-if="!messageList.length">
|
<div class="service-content" v-if="!messageList.length">
|
||||||
<div class="text-content">
|
<div class="text-content">
|
||||||
<div class="text-left">
|
<div class="text-left">
|
||||||
@@ -118,13 +118,11 @@ export default {
|
|||||||
pages: 2,
|
pages: 2,
|
||||||
areaId: '',
|
areaId: '',
|
||||||
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
|
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
|
||||||
typeList: [
|
typeList: [],
|
||||||
{dictValue: '1', dictName: '文本助理'},
|
aiConfigId: '',
|
||||||
{dictValue: '2', dictName: '日常助理'}
|
aiConfigName: '',
|
||||||
],
|
|
||||||
type: '',
|
|
||||||
showType: false,
|
showType: false,
|
||||||
showPopup: true
|
showPopup: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -136,6 +134,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.getAiTypeList()
|
||||||
this.getHistoryList()
|
this.getHistoryList()
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
@@ -218,7 +217,7 @@ export default {
|
|||||||
return this.$u.toast("请先进行登录")
|
return this.$u.toast("请先进行登录")
|
||||||
}
|
}
|
||||||
this.$loading()
|
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) {
|
if(res.code == 0) {
|
||||||
this.content = ''
|
this.content = ''
|
||||||
this.messageList.push(res.data[0])
|
this.messageList.push(res.data[0])
|
||||||
@@ -238,7 +237,7 @@ export default {
|
|||||||
return this.$u.toast("请先进行登录")
|
return this.$u.toast("请先进行登录")
|
||||||
}
|
}
|
||||||
this.$loading()
|
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) {
|
if(res.code == 0) {
|
||||||
this.voiceUrl = ''
|
this.voiceUrl = ''
|
||||||
this.voiceId = ''
|
this.voiceId = ''
|
||||||
@@ -262,7 +261,7 @@ export default {
|
|||||||
return this.$u.toast("请先进行登录")
|
return this.$u.toast("请先进行登录")
|
||||||
}
|
}
|
||||||
this.$loading()
|
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) {
|
if(res.code == 0 && res.data.records.length) {
|
||||||
res.data.records.map((item) => {
|
res.data.records.map((item) => {
|
||||||
if(item.sdkFileUrl) {
|
if(item.sdkFileUrl) {
|
||||||
@@ -322,8 +321,23 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmType(val) {
|
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()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-content">
|
<div class="list-content">
|
||||||
<div class="item">
|
<div class="item" v-for="(item, index) in messageList" :key="index">
|
||||||
<p class="item-text">111111111111</p>
|
<p class="item-text">{{item.content}}</p>
|
||||||
<div class="time-flex">
|
<div class="time-flex">
|
||||||
<p class="time-text">2024-06-02 10:21:23</p>
|
<p class="time-text">{{item.createTime}}</p>
|
||||||
<div class="item-view">
|
<div class="item-view">
|
||||||
<p>查看对话</p>
|
<p @click="toDetail(item)">查看对话</p>
|
||||||
<div class="del-btn">
|
<div class="del-btn" @click="del(item)">
|
||||||
<img src="./img/del-img.png" alt="">
|
<img src="./img/del-img.png" alt="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,7 +56,7 @@ export default {
|
|||||||
...mapState(['user', 'token']),
|
...mapState(['user', 'token']),
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
//this.getHistoryList()
|
this.getHistoryList()
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
if(this.current > this.pages) {
|
if(this.current > this.pages) {
|
||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
return this.$u.toast("请先进行登录")
|
return this.$u.toast("请先进行登录")
|
||||||
}
|
}
|
||||||
this.$loading()
|
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) {
|
if(res.code == 0 && res.data.records.length) {
|
||||||
res.data.records.map((item) => {
|
res.data.records.map((item) => {
|
||||||
if(item.sdkFileUrl) {
|
if(item.sdkFileUrl) {
|
||||||
@@ -105,6 +105,22 @@ export default {
|
|||||||
this.searchVal = ''
|
this.searchVal = ''
|
||||||
this.getSearchList()
|
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(() => {
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user