|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <main>
|
|
|
|
|
- <section class="xiaoshuhuitu-sections">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <!-- <section class="xiaoshuhuitu-sections">
|
|
|
<div v-for="(item, key) in data" :key="key" :style="{ background: item.background }">
|
|
<div v-for="(item, key) in data" :key="key" :style="{ background: item.background }">
|
|
|
<img :src="getAssetURL(item.img)" />
|
|
<img :src="getAssetURL(item.img)" />
|
|
|
<div :style="{ color: item.color }">
|
|
<div :style="{ color: item.color }">
|
|
@@ -8,123 +8,122 @@
|
|
|
<span>{{ item.content }}</span>
|
|
<span>{{ item.content }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </section>
|
|
|
|
|
|
|
+ </section> -->
|
|
|
|
|
+
|
|
|
|
|
+<footer class="picture-upload-footer">
|
|
|
|
|
+ <a-popover :popup-visible="showUpload" position="tl" @popup-visible-change="() => {
|
|
|
|
|
+ showDeleteTooltip = false;
|
|
|
|
|
+ }">
|
|
|
|
|
+ <div class="text-hide">
|
|
|
|
|
+ <div class="upload-img-container" @click="() => {
|
|
|
|
|
+ showUpload = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ ">
|
|
|
|
|
+ <img src="@/assets/document/6.svg" class="img-normal" v-if="!showUpload" />
|
|
|
|
|
+ <img src="@/assets/document/7.svg" class="img-hover" v-if="!showUpload" />
|
|
|
|
|
+ <img src="@/assets/document/8.svg" class="img-active" v-if="showUpload" />
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <footer class="picture-upload-footer">
|
|
|
|
|
- <a-popover :popup-visible="showUpload" position="tl" @popup-visible-change="() => {
|
|
|
|
|
- showDeleteTooltip = false;
|
|
|
|
|
- }">
|
|
|
|
|
- <div class="text-hide">
|
|
|
|
|
|
|
+ <p>已选择 {{ fileList.length }} 个图片</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <template #content>
|
|
|
|
|
+ <div :class="{ 'upload-wrap': true, 'upload-wrap-narrow': uploadFile }">
|
|
|
|
|
+ <header>
|
|
|
|
|
+ <p>{{ uploadFile ? "上传图片" : "上传图片" }}</p>
|
|
|
<div @click="() => {
|
|
<div @click="() => {
|
|
|
- showUpload = true;
|
|
|
|
|
|
|
+ showUpload = false;
|
|
|
}
|
|
}
|
|
|
">
|
|
">
|
|
|
- <img src="@/assets/document/6.svg" class="img-normal" v-if="!showUpload" />
|
|
|
|
|
- <img src="@/assets/document/7.svg" class="img-hover" v-if="!showUpload" />
|
|
|
|
|
- <img src="@/assets/document/8.svg" class="img-active" v-if="showUpload" />
|
|
|
|
|
|
|
+ <icon-close size="large" />
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <p>已选择 {{ fileList.length }} 个图片</p>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <template #content>
|
|
|
|
|
- <div :class="{ 'upload-wrap': true, 'upload-wrap-narrow': uploadFile }">
|
|
|
|
|
- <header>
|
|
|
|
|
- <p>{{ uploadFile ? "上传图片" : "上传图片" }}</p>
|
|
|
|
|
- <div @click="() => {
|
|
|
|
|
- showUpload = false;
|
|
|
|
|
- }
|
|
|
|
|
- ">
|
|
|
|
|
- <icon-close size="large" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </header>
|
|
|
|
|
-
|
|
|
|
|
- <div class="xiaoshuhuitu-image-upload">
|
|
|
|
|
- <section>
|
|
|
|
|
- <a-upload
|
|
|
|
|
- draggable
|
|
|
|
|
- list-type="picture"
|
|
|
|
|
- :multiple="false"
|
|
|
|
|
- :limit="1"
|
|
|
|
|
- :show-file-list="false"
|
|
|
|
|
- @before-upload="onBeforeUpload"
|
|
|
|
|
- @exceed-limit="onExceedLimit"
|
|
|
|
|
- @before-remove="onBeforeRemove"
|
|
|
|
|
- :custom-request="customRequest"
|
|
|
|
|
- :show-upload-button="{ showOnExceedLimit: false }"
|
|
|
|
|
- accept=".png,.jpg"
|
|
|
|
|
- >
|
|
|
|
|
- <template #upload-button>
|
|
|
|
|
- <div class="upload-main">
|
|
|
|
|
- <p>拖拽图片到这里,或<span>点此上传</span></p>
|
|
|
|
|
- <span>
|
|
|
|
|
- 支持上传 .png, .jpg,大小不超过10M
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ </header>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="xiaoshuhuitu-image-upload">
|
|
|
|
|
+ <section>
|
|
|
|
|
+ <a-upload
|
|
|
|
|
+ draggable
|
|
|
|
|
+ list-type="picture"
|
|
|
|
|
+ :multiple="false"
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :show-file-list="false"
|
|
|
|
|
+ @before-upload="onBeforeUpload"
|
|
|
|
|
+ @exceed-limit="onExceedLimit"
|
|
|
|
|
+ @before-remove="onBeforeRemove"
|
|
|
|
|
+ :custom-request="customRequest"
|
|
|
|
|
+ :show-upload-button="{ showOnExceedLimit: false }"
|
|
|
|
|
+ accept=".png,.jpg"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #upload-button>
|
|
|
|
|
+ <div class="upload-main">
|
|
|
|
|
+ <p>拖拽图片到这里,或<span>点此上传</span></p>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ 支持上传 .png, .jpg,大小不超过10M
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-upload>
|
|
|
|
|
+ </section>
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="tableData.length > 0">
|
|
|
|
|
+ <p>
|
|
|
|
|
+ <span>已选择图片列表</span>
|
|
|
|
|
+ <span>共{{ tableData.length }}个</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-table :pagination="false" row-key="name" :columns="columns" :data="tableData"
|
|
|
|
|
+ :row-selection="rowSelection" v-model:selectedKeys="selectedKeys">
|
|
|
|
|
+ <template #methods="{ record }">
|
|
|
|
|
+ <a-tooltip content="下载">
|
|
|
|
|
+ <div class="method-button" @click="downloadDocument(record)">
|
|
|
|
|
+ <icon-cloud-download />
|
|
|
</div>
|
|
</div>
|
|
|
- </template>
|
|
|
|
|
- </a-upload>
|
|
|
|
|
- </section>
|
|
|
|
|
-
|
|
|
|
|
- <div v-if="tableData.length > 0">
|
|
|
|
|
- <p>
|
|
|
|
|
- <span>已选择图片列表</span>
|
|
|
|
|
- <span>共{{ tableData.length }}个</span>
|
|
|
|
|
- </p>
|
|
|
|
|
- <div>
|
|
|
|
|
- <a-table :pagination="false" row-key="name" :columns="columns" :data="tableData"
|
|
|
|
|
- :row-selection="rowSelection" v-model:selectedKeys="selectedKeys">
|
|
|
|
|
- <template #methods="{ record }">
|
|
|
|
|
- <a-tooltip content="下载">
|
|
|
|
|
- <div class="method-button" @click="downloadDocument(record)">
|
|
|
|
|
- <icon-cloud-download />
|
|
|
|
|
- </div>
|
|
|
|
|
- </a-tooltip>
|
|
|
|
|
- <a-popover :popup-visible="showDeleteTooltip && deleteId === record.key">
|
|
|
|
|
- <a-tooltip content="删除">
|
|
|
|
|
- <div class="method-button" @click="handleDeleteButton(record.key)">
|
|
|
|
|
- <icon-delete />
|
|
|
|
|
- </div>
|
|
|
|
|
- </a-tooltip>
|
|
|
|
|
- <template #content>
|
|
|
|
|
|
|
+ </a-tooltip>
|
|
|
|
|
+ <a-popover :popup-visible="showDeleteTooltip && deleteId === record.key">
|
|
|
|
|
+ <a-tooltip content="删除">
|
|
|
|
|
+ <div class="method-button" @click="handleDeleteButton(record.key)">
|
|
|
|
|
+ <icon-delete />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </a-tooltip>
|
|
|
|
|
+ <template #content>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <p>删除后无法恢复,您是否删除?</p>
|
|
|
|
|
+ <div class="delete-buttons">
|
|
|
<div>
|
|
<div>
|
|
|
- <p>删除后无法恢复,您是否删除?</p>
|
|
|
|
|
- <div class="delete-buttons">
|
|
|
|
|
- <div>
|
|
|
|
|
- <a-button size="mini" type="primary" style="margin-right: 10px"
|
|
|
|
|
- @click="deleteDocument">确认</a-button>
|
|
|
|
|
- <a-button size="mini" type="outline" @click="() => {
|
|
|
|
|
- showDeleteTooltip = false;
|
|
|
|
|
- }
|
|
|
|
|
- ">取消</a-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <a-button size="mini" type="primary" style="margin-right: 10px"
|
|
|
|
|
+ @click="deleteDocument">确认</a-button>
|
|
|
|
|
+ <a-button size="mini" type="outline" @click="() => {
|
|
|
|
|
+ showDeleteTooltip = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ ">取消</a-button>
|
|
|
</div>
|
|
</div>
|
|
|
- </template>
|
|
|
|
|
- </a-popover>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
- </a-table>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </a-popover>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div class="bottom-buttons">
|
|
|
|
|
- <div>
|
|
|
|
|
- <a-button type="outline" style="margin-right: 10px" @click="selectFiles(false)">取消</a-button>
|
|
|
|
|
- <a-button :loading="buttonLoading" type="primary" @click="selectFiles(true, 'paper')">去{{
|
|
|
|
|
- uploadFile ? '提问'
|
|
|
|
|
- : '提问'
|
|
|
|
|
- }}({{ fileList.length
|
|
|
|
|
- }})</a-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </a-popover>
|
|
|
|
|
|
|
+ <div class="bottom-buttons">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-button type="outline" style="margin-right: 10px" @click="selectFiles(false)">取消</a-button>
|
|
|
|
|
+ <a-button :loading="buttonLoading" type="primary" @click="selectFiles(true, 'paper')">去{{
|
|
|
|
|
+ uploadFile ? '提问'
|
|
|
|
|
+ : '提问'
|
|
|
|
|
+ }}({{ fileList.length
|
|
|
|
|
+ }})</a-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-popover>
|
|
|
|
|
|
|
|
- <span class="placeholder-width-5px"></span>
|
|
|
|
|
- <BtnIframeComfyui />
|
|
|
|
|
- </footer>
|
|
|
|
|
- </main>
|
|
|
|
|
|
|
+ <span class="placeholder-width-5px"></span>
|
|
|
|
|
+ <BtnIframeComfyui />
|
|
|
|
|
+</footer>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
@@ -136,8 +135,10 @@ import BtnIframeComfyui from './btn-iframe-comfyui/BtnIframeComfyui.vue';
|
|
|
|
|
|
|
|
import ImgEditBtn from './image-editor/ImgEditBtn.vue';
|
|
import ImgEditBtn from './image-editor/ImgEditBtn.vue';
|
|
|
|
|
|
|
|
|
|
+import {huituSetTempImageFile} from './dialog-wrap/temp-image'
|
|
|
|
|
+
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
- props: ["data", "hasUpload", "hasSlider", "uploadFile", "isQuestion", "agentId", "agengtName"],
|
|
|
|
|
|
|
+ props: ["data", "uploadFile", "isQuestion", "agentId", "agengtName"],
|
|
|
components: {
|
|
components: {
|
|
|
BtnIframeComfyui,
|
|
BtnIframeComfyui,
|
|
|
|
|
|
|
@@ -201,13 +202,19 @@ export default defineComponent({
|
|
|
helper.write('sendData', sendData);
|
|
helper.write('sendData', sendData);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ let temp_file = null;
|
|
|
fileList.value.forEach(file => {
|
|
fileList.value.forEach(file => {
|
|
|
formData.append('file', file)
|
|
formData.append('file', file)
|
|
|
|
|
+
|
|
|
|
|
+ temp_file = file;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const data = await ajax.message.createDialog(props.agentId);
|
|
const data = await ajax.message.createDialog(props.agentId);
|
|
|
const result = await ajax.file.uploadFile(props.agentId, data.chat_id, formData);
|
|
const result = await ajax.file.uploadFile(props.agentId, data.chat_id, formData);
|
|
|
|
|
|
|
|
|
|
+ // 保存一张临时图片
|
|
|
|
|
+ huituSetTempImageFile(temp_file, props.agentId, data.chat_id);
|
|
|
|
|
+
|
|
|
// 保存小数绘图数据
|
|
// 保存小数绘图数据
|
|
|
helper.write('sendData', {
|
|
helper.write('sendData', {
|
|
|
name: '小数绘图',
|
|
name: '小数绘图',
|
|
@@ -247,7 +254,6 @@ export default defineComponent({
|
|
|
// helper.$bus.emit("open-dialog", '合并Excel');
|
|
// helper.$bus.emit("open-dialog", '合并Excel');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteButton = (id) => {
|
|
const handleDeleteButton = (id) => {
|
|
@@ -367,6 +373,7 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.bottom-buttons {
|
|
.bottom-buttons {
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -431,58 +438,98 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-main {
|
|
|
|
|
- height: 100%;
|
|
|
|
|
|
|
+footer.picture-upload-footer{
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- flex-direction: column;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
|
|
|
- >section {
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
|
|
+ .text-hide {
|
|
|
|
|
+ // width: 110px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- gap: 20px;
|
|
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- &.section-full {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
|
|
+ .upload-img-container{
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ // width: 110px;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+
|
|
|
|
|
+ .img-normal {
|
|
|
|
|
+ display: block;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- >div {
|
|
|
|
|
- width: 382px;
|
|
|
|
|
- height: 120px;
|
|
|
|
|
- padding: 20px 24px;
|
|
|
|
|
- border-radius: 8px;
|
|
|
|
|
- display: flex;
|
|
|
|
|
|
|
+ .img-hover {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- >img {
|
|
|
|
|
- width: 38px;
|
|
|
|
|
- height: 38px;
|
|
|
|
|
- margin-right: 12px;
|
|
|
|
|
|
|
+ &:hover {
|
|
|
|
|
+ .img-normal {
|
|
|
|
|
+ display: none;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- >div {
|
|
|
|
|
- font-size: 18px;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
-
|
|
|
|
|
- >span {
|
|
|
|
|
- font-size: 15px;
|
|
|
|
|
- font-weight: 400;
|
|
|
|
|
- color: #797d7f;
|
|
|
|
|
- margin-top: 8px;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- text-overflow: ellipsis;
|
|
|
|
|
- display: -webkit-box;
|
|
|
|
|
- -webkit-line-clamp: 2;
|
|
|
|
|
- -webkit-box-orient: vertical;
|
|
|
|
|
- line-height: 1.4;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .img-hover {
|
|
|
|
|
+ display: block;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- footer.picture-upload-footer{
|
|
|
|
|
- justify-content: flex-start;
|
|
|
|
|
|
|
+ >img {
|
|
|
|
|
+ width: 110px;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+main {
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+
|
|
|
|
|
+ // >section {
|
|
|
|
|
+ // overflow-y: auto;
|
|
|
|
|
+ // display: flex;
|
|
|
|
|
+ // flex-wrap: wrap;
|
|
|
|
|
+ // gap: 20px;
|
|
|
|
|
+
|
|
|
|
|
+ // &.section-full {
|
|
|
|
|
+ // flex: 1;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // >div {
|
|
|
|
|
+ // width: 382px;
|
|
|
|
|
+ // height: 120px;
|
|
|
|
|
+ // padding: 20px 24px;
|
|
|
|
|
+ // border-radius: 8px;
|
|
|
|
|
+ // display: flex;
|
|
|
|
|
+
|
|
|
|
|
+ // >img {
|
|
|
|
|
+ // width: 38px;
|
|
|
|
|
+ // height: 38px;
|
|
|
|
|
+ // margin-right: 12px;
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // >div {
|
|
|
|
|
+ // font-size: 18px;
|
|
|
|
|
+ // font-weight: bold;
|
|
|
|
|
+
|
|
|
|
|
+ // >span {
|
|
|
|
|
+ // font-size: 15px;
|
|
|
|
|
+ // font-weight: 400;
|
|
|
|
|
+ // color: #797d7f;
|
|
|
|
|
+ // margin-top: 8px;
|
|
|
|
|
+ // overflow: hidden;
|
|
|
|
|
+ // text-overflow: ellipsis;
|
|
|
|
|
+ // display: -webkit-box;
|
|
|
|
|
+ // -webkit-line-clamp: 2;
|
|
|
|
|
+ // -webkit-box-orient: vertical;
|
|
|
|
|
+ // line-height: 1.4;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
>footer {
|
|
>footer {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|