|
@@ -57,16 +57,41 @@
|
|
|
<footer v-if="navIndex !== -2 && navIndex !== 0">
|
|
<footer v-if="navIndex !== -2 && navIndex !== 0">
|
|
|
<message-input :readonly="readonly" eventName="open-dialog" />
|
|
<message-input :readonly="readonly" eventName="open-dialog" />
|
|
|
</footer>
|
|
</footer>
|
|
|
- <footer v-if="navIndex === 0" class="upload-footer">
|
|
|
|
|
|
|
+ <footer v-if="navIndex === 0 && !showDialog" class="upload-footer">
|
|
|
<p><span>标题</span></p>
|
|
<p><span>标题</span></p>
|
|
|
- <div><a-input :style="{ flex: '1' }" placeholder="请输入标题" allow-clear /></div>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-input
|
|
|
|
|
+ :style="{ flex: '1' }"
|
|
|
|
|
+ placeholder="请输入标题"
|
|
|
|
|
+ allow-clear
|
|
|
|
|
+ v-model="uploadTitle"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
<div>
|
|
<div>
|
|
|
<p><span>请上传文档</span></p>
|
|
<p><span>请上传文档</span></p>
|
|
|
- <a-upload :style="{ width: '110px' }" action="/" />
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-upload
|
|
|
|
|
+ :style="{ width: '300px' }"
|
|
|
|
|
+ :multiple="false"
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :custom-request="customRequest1"
|
|
|
|
|
+ :show-upload-button="{ showOnExceedLimit: true }"
|
|
|
|
|
+ accept=".pdf,.doc,.docx,.txt,.md,.ppt.pptx"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<p><span>请上传中心动态</span></p>
|
|
<p><span>请上传中心动态</span></p>
|
|
|
- <a-upload :style="{ width: '110px' }" action="/" />
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a-upload
|
|
|
|
|
+ :style="{ width: '300px' }"
|
|
|
|
|
+ :multiple="false"
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ :custom-request="customRequest2"
|
|
|
|
|
+ :show-upload-button="{ showOnExceedLimit: true }"
|
|
|
|
|
+ accept=".pdf,.doc,.docx,.txt,.md,.ppt.pptx"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<a-button :style="{ width: '500px' }" type="primary" @click="beginCombine">开始</a-button>
|
|
<a-button :style="{ width: '500px' }" type="primary" @click="beginCombine">开始</a-button>
|
|
|
</footer>
|
|
</footer>
|
|
@@ -99,6 +124,7 @@ import DocumentAnswer from "./DocumentAnswer.vue";
|
|
|
import DocumentQuestion from "./DocumentQuestion.vue";
|
|
import DocumentQuestion from "./DocumentQuestion.vue";
|
|
|
import Analysis from "./Analysis.vue";
|
|
import Analysis from "./Analysis.vue";
|
|
|
import { defineComponent, ref, onMounted, inject, onBeforeUnmount } from "vue";
|
|
import { defineComponent, ref, onMounted, inject, onBeforeUnmount } from "vue";
|
|
|
|
|
+import { write } from "clipboard-polyfill";
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
components: {
|
|
components: {
|
|
|
Right,
|
|
Right,
|
|
@@ -118,8 +144,9 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
// nav对应的问答类型,4文库问答,对应的是knowledge类型
|
|
// nav对应的问答类型,4文库问答,对应的是knowledge类型
|
|
|
- const dialogType = ["knowledge", "normal", "normal", "normal", "normal", "normal", "normal", "normal"];
|
|
|
|
|
|
|
+ const dialogType = ["report", "normal", "normal", "normal", "normal", "normal", "normal", "normal"];
|
|
|
const { config, helper, ajax } = inject("$global");
|
|
const { config, helper, ajax } = inject("$global");
|
|
|
|
|
+ const uploadTitle = ref("");
|
|
|
const closeOthers = ref(false);
|
|
const closeOthers = ref(false);
|
|
|
const swiperNumber = ref(5);
|
|
const swiperNumber = ref(5);
|
|
|
const navIndex = ref(-1);
|
|
const navIndex = ref(-1);
|
|
@@ -186,10 +213,75 @@ export default defineComponent({
|
|
|
dialogList.value = [];
|
|
dialogList.value = [];
|
|
|
showDialog.value = true;
|
|
showDialog.value = true;
|
|
|
initDialog.value = true;
|
|
initDialog.value = true;
|
|
|
|
|
+ const sendData = {
|
|
|
|
|
+ chatHistory: [],
|
|
|
|
|
+ name: "报告生成",
|
|
|
|
|
+ description: "报告生成",
|
|
|
|
|
+ inputs: {
|
|
|
|
|
+ report_name: `标题:${uploadTitle.value}\n请上传周报:${reportData.name1}\n请上传中心动态:${reportData.name2}\n`,
|
|
|
|
|
+ id: "Report-PRcYL",
|
|
|
|
|
+ data: [
|
|
|
|
|
+ {
|
|
|
|
|
+ id: "VariableNode-UB934",
|
|
|
|
|
+ name: "标题",
|
|
|
|
|
+ file_path: "",
|
|
|
|
|
+ value: uploadTitle.value
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ id: "InputFileNode-d2865",
|
|
|
|
|
+ name: "请上传周报",
|
|
|
|
|
+ file_path: reportData.url1,
|
|
|
|
|
+ value: ""
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ id: "InputFileNode-a4516",
|
|
|
|
|
+ name: "请上传中心动态",
|
|
|
|
|
+ file_path: reportData.url2,
|
|
|
|
|
+ value: ""
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- helper.$bus.emit("send-message", "开始");
|
|
|
|
|
|
|
+ helper.$bus.emit("send-message", sendData);
|
|
|
}, 200);
|
|
}, 200);
|
|
|
};
|
|
};
|
|
|
|
|
+ const reportData = {
|
|
|
|
|
+ title: "",
|
|
|
|
|
+ url1: "",
|
|
|
|
|
+ name1: "",
|
|
|
|
|
+ url2: "",
|
|
|
|
|
+ name2: ""
|
|
|
|
|
+ };
|
|
|
|
|
+ const customRequest1 = async (option) => {
|
|
|
|
|
+ const { name, url } = await customRequest(option);
|
|
|
|
|
+ reportData.url1 = url;
|
|
|
|
|
+ reportData.name1 = name;
|
|
|
|
|
+ };
|
|
|
|
|
+ const customRequest2 = async (option) => {
|
|
|
|
|
+ const { name, url } = await customRequest(option);
|
|
|
|
|
+ reportData.url2 = url;
|
|
|
|
|
+ reportData.name2 = name;
|
|
|
|
|
+ };
|
|
|
|
|
+ const customRequest = async (option) => {
|
|
|
|
|
+ const { onSuccess, fileItem } = option;
|
|
|
|
|
+ const { file, uid, name } = fileItem;
|
|
|
|
|
+ const fileList = [];
|
|
|
|
|
+ fileList.push({
|
|
|
|
|
+ id: uid,
|
|
|
|
|
+ file
|
|
|
|
|
+ });
|
|
|
|
|
+ onSuccess();
|
|
|
|
|
+ const formData = new FormData();
|
|
|
|
|
+ fileList.forEach((item) => {
|
|
|
|
|
+ formData.append("file", item.file);
|
|
|
|
|
+ });
|
|
|
|
|
+ const data = await ajax.file.uploadFiles(agentIds.value[navIndex.value], formData);
|
|
|
|
|
+ return {
|
|
|
|
|
+ name,
|
|
|
|
|
+ url: data.file_path
|
|
|
|
|
+ };
|
|
|
|
|
+ };
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
const agents = await ajax.agent.getAgents();
|
|
const agents = await ajax.agent.getAgents();
|
|
|
agentIds.value = agents.map((data) => data.id);
|
|
agentIds.value = agents.map((data) => data.id);
|
|
@@ -209,6 +301,9 @@ export default defineComponent({
|
|
|
helper.$bus.off("open-dialog");
|
|
helper.$bus.off("open-dialog");
|
|
|
});
|
|
});
|
|
|
return {
|
|
return {
|
|
|
|
|
+ uploadTitle,
|
|
|
|
|
+ customRequest1,
|
|
|
|
|
+ customRequest2,
|
|
|
historyList,
|
|
historyList,
|
|
|
beginCombine,
|
|
beginCombine,
|
|
|
selectId,
|
|
selectId,
|