上传文件完成
This commit is contained in:
@@ -4,6 +4,7 @@ import ThinkingBar from "./components/thinkingBar.vue";
|
||||
import {mapState} from "vuex";
|
||||
import AiDrag from "../basic/AiDrag.vue";
|
||||
import AiLocateDialog from "../tools/AiLocateDialog.vue";
|
||||
import AiUploader from "../basic/AiUploader.vue";
|
||||
|
||||
export default {
|
||||
name: "AiCopilot",
|
||||
@@ -24,7 +25,8 @@ export default {
|
||||
currentConversation: null,
|
||||
app: {},
|
||||
locate: false,
|
||||
latlng: ""
|
||||
latlng: "",
|
||||
files: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -33,15 +35,8 @@ export default {
|
||||
expandBtn: v => v.expand ? "收起" : "展开",
|
||||
isNeedPosition: v => ["1"].includes(v.app.ability),
|
||||
btns: v => [
|
||||
{
|
||||
label: "文件", icon: "https://cdn.sinoecare.com/i/2024/07/04/668663436e46e.png", click: () => {
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "位置", icon: "https://cdn.sinoecare.com/i/2024/08/19/66c2f907bd444.png", hide: !v.isNeedPosition, click: () => {
|
||||
v.locate = true
|
||||
}
|
||||
}
|
||||
{label: "文件", icon: "https://cdn.sinoecare.com/i/2024/07/04/668663436e46e.png", click: () => v.$refs.uploadTrigger.click()},
|
||||
{label: "位置", icon: "https://cdn.sinoecare.com/i/2024/08/19/66c2f907bd444.png", hide: !v.isNeedPosition, click: () => v.locate = true}
|
||||
].filter(e => e.hide !== true),
|
||||
rowBtns: v => [
|
||||
{icon: "https://cdn.sinoecare.com/i/2024/07/04/66866edc2910a.png", label: "置顶", click: row => 0},
|
||||
@@ -50,7 +45,7 @@ export default {
|
||||
],
|
||||
dialogWidth: v => v.expand ? 960 : 468
|
||||
},
|
||||
components: {AiLocateDialog, AiDrag, ThinkingBar, ChatContent},
|
||||
components: {AiUploader, AiLocateDialog, AiDrag, ThinkingBar, ChatContent},
|
||||
methods: {
|
||||
getHistory(params) {
|
||||
this.http.post("/app/appaicopilotinfo/list", null, {params}).then(res => {
|
||||
@@ -195,6 +190,9 @@ export default {
|
||||
<div class="topBar flex">
|
||||
<div v-for="(btn,i) in btns" :key="i" class="btn pointer" :style="{backgroundImage: `url(${btn.icon})`}" v-text="btn.label" @click="btn.click"/>
|
||||
</div>
|
||||
<ai-uploader v-model="files" :instance="http" :limit="1" show-loading fileType="file">
|
||||
<div slot="trigger" ref="uploadTrigger"/>
|
||||
</ai-uploader>
|
||||
<div class="flex end">
|
||||
<el-input type="textarea" class="fill input" autosize resize="none" v-model="prompt" placeholder="请输入..." :rows="5"
|
||||
@keydown.native="handleHotkey" :disabled="loading" :placeholder="loading?'正在思考中...':'请输入'" ref="sendInput"/>
|
||||
@@ -483,6 +481,43 @@ export default {
|
||||
background: transparent;
|
||||
min-height: 73px !important;
|
||||
}
|
||||
|
||||
.el-upload {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-upload-list {
|
||||
display: flex;
|
||||
|
||||
li {
|
||||
width: auto;
|
||||
padding: 6px 12px;
|
||||
background: #0152f50f;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
line-height: normal;
|
||||
margin-top: 0;
|
||||
|
||||
.el-upload-list__item-name {
|
||||
margin-right: 0;
|
||||
padding-left: 0;
|
||||
color: #525F7A;
|
||||
}
|
||||
|
||||
.el-icon-close {
|
||||
right: 0;
|
||||
top: 0;
|
||||
transform: translate(2px, -2px);
|
||||
background-color: #A4ADC2;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
|
||||
&:hover {
|
||||
background-color: #2970FF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user