|
@@ -148,12 +148,14 @@
|
|
|
<MessagePicUpload />
|
|
<MessagePicUpload />
|
|
|
</footer>
|
|
</footer>
|
|
|
|
|
|
|
|
- <a-tooltip :content="closeOthers ? '收起' : '展开'">
|
|
|
|
|
|
|
+ <!-- <a-tooltip :content="closeOthers ? '收起' : '展开'">
|
|
|
<div @click="openAll" v-if="navId !== -2">
|
|
<div @click="openAll" v-if="navId !== -2">
|
|
|
<img src="@/assets/other/open.svg" width="20" v-if="closeOthers" />
|
|
<img src="@/assets/other/open.svg" width="20" v-if="closeOthers" />
|
|
|
<img src="@/assets/other/close.svg" width="20" v-else />
|
|
<img src="@/assets/other/close.svg" width="20" v-else />
|
|
|
</div>
|
|
</div>
|
|
|
- </a-tooltip>
|
|
|
|
|
|
|
+ </a-tooltip> -->
|
|
|
|
|
+
|
|
|
|
|
+ <ToggleBtn v-if="navId !== -2" :closeOthers="closeOthers" @toggle="openAll"/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -180,6 +182,9 @@ import DocumentInterlocution from './DocumentInterlocution.vue';
|
|
|
import DocumentQuestion from "./DocumentQuestion.vue";
|
|
import DocumentQuestion from "./DocumentQuestion.vue";
|
|
|
import DocumentQuestion2 from "./DocumentQuestion2.vue";
|
|
import DocumentQuestion2 from "./DocumentQuestion2.vue";
|
|
|
import Analysis from "./Analysis.vue";
|
|
import Analysis from "./Analysis.vue";
|
|
|
|
|
+
|
|
|
|
|
+import ToggleBtn from '../components/ToggleBtn.vue';
|
|
|
|
|
+
|
|
|
import { defineComponent, ref, onMounted, inject, onBeforeUnmount } from "vue";
|
|
import { defineComponent, ref, onMounted, inject, onBeforeUnmount } from "vue";
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
@@ -201,7 +206,9 @@ export default defineComponent({
|
|
|
DocumentQuestion2,
|
|
DocumentQuestion2,
|
|
|
Analysis,
|
|
Analysis,
|
|
|
DocumentDetail,
|
|
DocumentDetail,
|
|
|
- DocumentCombine
|
|
|
|
|
|
|
+ DocumentCombine,
|
|
|
|
|
+
|
|
|
|
|
+ ToggleBtn
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
// NOTE: 先把4文库问答的类型改成report类型,后续再改回来
|
|
// NOTE: 先把4文库问答的类型改成report类型,后续再改回来
|
|
@@ -214,7 +221,7 @@ export default defineComponent({
|
|
|
const swiperNumber = ref(5);
|
|
const swiperNumber = ref(5);
|
|
|
const navId = ref(-1);
|
|
const navId = ref(-1);
|
|
|
const readonly = ref(false);
|
|
const readonly = ref(false);
|
|
|
- const showDialog = ref(false);
|
|
|
|
|
|
|
+ const showDialog = ref(false); // 是否显示对话内容
|
|
|
const historyMode = ref(false);
|
|
const historyMode = ref(false);
|
|
|
const dialogList = ref([]);
|
|
const dialogList = ref([]);
|
|
|
const selectId = ref("");
|
|
const selectId = ref("");
|
|
@@ -303,29 +310,40 @@ export default defineComponent({
|
|
|
|
|
|
|
|
initDialog.value = true;
|
|
initDialog.value = true;
|
|
|
helper.$bus.emit("set-loading", false);
|
|
helper.$bus.emit("set-loading", false);
|
|
|
-
|
|
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
const beginCombine = async () => {
|
|
const beginCombine = async () => {
|
|
|
let report_name = "";
|
|
let report_name = "";
|
|
|
let inputData = [];
|
|
let inputData = [];
|
|
|
for (let key in reportData) {
|
|
for (let key in reportData) {
|
|
|
- if (typeof reportData[key].value === "string") {
|
|
|
|
|
- report_name += `${reportData[key].key}:${reportData[key].value}\n`;
|
|
|
|
|
- inputData.push({
|
|
|
|
|
- id: key,
|
|
|
|
|
- name: reportData[key].key,
|
|
|
|
|
- file_path: "",
|
|
|
|
|
- value: reportData[key].value
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 此部分代码于 2024/11/25日上午做了简单优化
|
|
|
|
|
+ * 优化时,仅调整了循环体内的代码
|
|
|
|
|
+ * 由于此功能暂时禁用,无法测试优化后的效果是否正常
|
|
|
|
|
+ * 如果后续测试时发现代码异常,可copy此时间之前的原代码
|
|
|
|
|
+ */
|
|
|
|
|
+ const cur_report = reportData[key];
|
|
|
|
|
+ const report_key = cur_report.key;
|
|
|
|
|
+ const report_value = cur_report.value;
|
|
|
|
|
+
|
|
|
|
|
+ const item = {
|
|
|
|
|
+ id: key,
|
|
|
|
|
+ name: report_key,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ if (typeof report_value === "string") {
|
|
|
|
|
+ report_name += `${report_key}:${report_value}\n`;
|
|
|
|
|
+
|
|
|
|
|
+ item.file_path = '';
|
|
|
|
|
+ item.value = report_value;
|
|
|
} else {
|
|
} else {
|
|
|
- report_name += `${reportData[key].key}:${reportData[key].value.name}\n`;
|
|
|
|
|
- inputData.push({
|
|
|
|
|
- id: key,
|
|
|
|
|
- name: reportData[key].key,
|
|
|
|
|
- file_path: reportData[key].value.url,
|
|
|
|
|
- value: ""
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ report_name += `${report_key}:${report_value.name}\n`;
|
|
|
|
|
+
|
|
|
|
|
+ item.file_path = report_value.url;
|
|
|
|
|
+ item.value = '';
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ inputData.push(item);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 如果不是历史记录对话模式,则创建对话
|
|
// 如果不是历史记录对话模式,则创建对话
|
|
@@ -336,9 +354,11 @@ export default defineComponent({
|
|
|
dialogId.value = data.chat_id;
|
|
dialogId.value = data.chat_id;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
dialogList.value = [];
|
|
dialogList.value = [];
|
|
|
showDialog.value = true;
|
|
showDialog.value = true;
|
|
|
initDialog.value = true;
|
|
initDialog.value = true;
|
|
|
|
|
+
|
|
|
const sendData = {
|
|
const sendData = {
|
|
|
chatHistory: [],
|
|
chatHistory: [],
|
|
|
message: textValue.value,
|
|
message: textValue.value,
|
|
@@ -350,10 +370,12 @@ export default defineComponent({
|
|
|
data: inputData
|
|
data: inputData
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
helper.$bus.emit("send-message", sendData);
|
|
helper.$bus.emit("send-message", sendData);
|
|
|
}, 500);
|
|
}, 500);
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
const continueCombine = async () => {
|
|
const continueCombine = async () => {
|
|
|
const sendData = {
|
|
const sendData = {
|
|
|
chatHistory: [],
|
|
chatHistory: [],
|
|
@@ -378,20 +400,26 @@ export default defineComponent({
|
|
|
value: event
|
|
value: event
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
const customRequest = async (option, key, value) => {
|
|
const customRequest = async (option, key, value) => {
|
|
|
const { onSuccess, fileItem } = option;
|
|
const { onSuccess, fileItem } = option;
|
|
|
const { file, uid, name } = fileItem;
|
|
const { file, uid, name } = fileItem;
|
|
|
const fileList = [];
|
|
const fileList = [];
|
|
|
|
|
+
|
|
|
fileList.push({
|
|
fileList.push({
|
|
|
id: uid,
|
|
id: uid,
|
|
|
file
|
|
file
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
onSuccess();
|
|
onSuccess();
|
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
|
|
|
+
|
|
|
fileList.forEach((item) => {
|
|
fileList.forEach((item) => {
|
|
|
formData.append("file", item.file);
|
|
formData.append("file", item.file);
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
const data = await ajax.file.uploadFiles(selectId.value, formData);
|
|
const data = await ajax.file.uploadFiles(selectId.value, formData);
|
|
|
|
|
+
|
|
|
reportData[key] = {
|
|
reportData[key] = {
|
|
|
key: value,
|
|
key: value,
|
|
|
value: {
|
|
value: {
|
|
@@ -400,6 +428,7 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
agents = await ajax.agent.getAgents();
|
|
agents = await ajax.agent.getAgents();
|
|
|
agentIds.value = agents && Array.isArray(agents) && agents.map((data) => data.id) || [];
|
|
agentIds.value = agents && Array.isArray(agents) && agents.map((data) => data.id) || [];
|