|
|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div id="app">
|
|
|
- <Slider @select-nav="selectNav" :index="navIndex" v-show="!closeOthers"></Slider>
|
|
|
+ <Slider @select-nav="selectNav" :index="navId" v-show="!closeOthers"></Slider>
|
|
|
<div class="main">
|
|
|
- <div :class="{ 'history-wrap': true, 'history-wrap-open': !closeOthers && navIndex > -1 }">
|
|
|
+ <div :class="{ 'history-wrap': true, 'history-wrap-open': !closeOthers && navId > -1 }">
|
|
|
<History :list="historyList" @set-new="() => {
|
|
|
showDialog = false;
|
|
|
selectId = selectId;
|
|
|
@@ -10,40 +10,75 @@
|
|
|
" :selectId="selectId" @handle-click="selectHistory" />
|
|
|
</div>
|
|
|
<div class="wrap">
|
|
|
- <Index :number="swiperNumber" v-if="navIndex === -1" @select-nav="selectNav" />
|
|
|
- <div :class="{ 'border-wrap': true, 'border-no-wrap': navIndex === -2 }" v-else>
|
|
|
+ <Index :number="swiperNumber" v-if="navId === -1" @select-nav="selectNav" />
|
|
|
+ <div :class="{ 'border-wrap': true, 'border-no-wrap': navId === -2 }" v-else>
|
|
|
<div>
|
|
|
<header v-if="!showDialog">
|
|
|
<div>
|
|
|
<img src="@/assets/other/robot.gif" width="52" />
|
|
|
<p>
|
|
|
- {{ SYSTEM_NAME }}<span>{{ slider[navIndex].title }}</span>
|
|
|
+ {{ SYSTEM_NAME }}<span>{{ slider[navId].title }}</span>
|
|
|
</p>
|
|
|
- <span>{{ slider[navIndex].dialog }}</span>
|
|
|
+ <span>{{ slider[navId].dialog }}</span>
|
|
|
</div>
|
|
|
</header>
|
|
|
<section :class="{ 'section-padding': showDialog }">
|
|
|
<!-- 报告生成 -->
|
|
|
- <DocumentCombine v-if="navIndex === 0 && !showDialog" />
|
|
|
+ <DocumentCombine v-if="navId == 0 && !showDialog" />
|
|
|
<!-- 报表合并 -->
|
|
|
- <Document v-if="navIndex === 1 && !showDialog" />
|
|
|
+ <Document v-if="navId === 1 && !showDialog" />
|
|
|
<!-- 知识问答 -->
|
|
|
- <DocumentQuestion v-if="navIndex === 2 && !showDialog" />
|
|
|
+ <DocumentQuestion v-if="navId === 2 && !showDialog" />
|
|
|
<!-- 文档智能 -->
|
|
|
- <DocumentAnswer v-if="navIndex === 3 && !showDialog" :agentId="selectId" />
|
|
|
+ <DocumentAnswer v-if="navId === 3 && !showDialog" :agentId="selectId" />
|
|
|
<!-- 智能问答 -->
|
|
|
- <Answer v-if="navIndex === 4 && !showDialog" />
|
|
|
+ <Answer v-if="navId === 4 && !showDialog" />
|
|
|
<!-- 文库详情 -->
|
|
|
- <DocumentDetail v-if="navIndex === -2" @go-back="goBack" />
|
|
|
- <dialog-wrap v-if="showDialog && initDialog" v-show="!hideDialog"
|
|
|
- :type="dialogType[navIndex]" :isSetting="false" :readonly="readonly"
|
|
|
- @setReadonly="setReadonly" @goDocument="goDocument" :agentId="selectId"
|
|
|
- :dialogId="dialogId" :list="dialogList" />
|
|
|
+ <DocumentDetail v-if="navId === -2" @go-back="goBack" />
|
|
|
+ <dialog-wrap v-if="showDialog && initDialog" v-show="!hideDialog" :type="dialogType[navId]"
|
|
|
+ :isSetting="false" :readonly="readonly" @setReadonly="setReadonly"
|
|
|
+ @goDocument="goDocument" :agentId="selectId" :dialogId="dialogId" :list="dialogList" />
|
|
|
</section>
|
|
|
- <footer v-if="navIndex !== -2 && navIndex !== 0">
|
|
|
+ <footer v-if="navId !== -2 && navId !== 0 && navId !== 3">
|
|
|
<message-input :readonly="readonly" eventName="open-dialog" />
|
|
|
</footer>
|
|
|
- <footer v-if="navIndex === 0 && !showDialog" class="upload-footer">
|
|
|
+ <footer v-if="navId === 0 && !showDialog" class="upload-footer">
|
|
|
+ <section v-for="(item, key) in variables" :key="key">
|
|
|
+ <div>
|
|
|
+ <p>
|
|
|
+ <span>{{ item.variable_name }}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <a-input :style="{ flex: '1' }" :placeholder="`请输入${item.variable_name}`"
|
|
|
+ allow-clear @change="(event) => {
|
|
|
+ customChange(event, item.node_id, item.variable_name);
|
|
|
+ }
|
|
|
+ " v-if="item.value_type === 1" />
|
|
|
+ <a-upload v-else :style="{ width: '300px' }" :multiple="false" :limit="1"
|
|
|
+ :custom-request="(option) => {
|
|
|
+ customRequest(option, item.node_id, item.variable_name);
|
|
|
+ }
|
|
|
+ " :show-upload-button="{ showOnExceedLimit: true }"
|
|
|
+ accept=".pdf,.doc,.docx,.txt,.md,.ppt.pptx" />
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ <a-textarea @keydown.enter="beginCombine" :max-length="maxLength" v-model="textValue"
|
|
|
+ :show-word-limit="textValue.length > maxLength / 2" :auto-size="{ maxRows: 6 }"
|
|
|
+ placeholder="输入您想了解的内容,Shift+Enter换行" :style="{
|
|
|
+ flex: 1,
|
|
|
+ borderRadius: '12px',
|
|
|
+ marginTop: '20px',
|
|
|
+ padding: '0px 30px 0 16px',
|
|
|
+ background: 'transparent',
|
|
|
+ border: '1px solid #e3e3e3',
|
|
|
+ minHeight: '120px',
|
|
|
+ paddingBottom: `${textValue.length > maxLength / 2 ? '20px' : ''}`
|
|
|
+ }">
|
|
|
+ </a-textarea>
|
|
|
+ <a-button :style="{ width: '500px' }" type="primary" @click="beginCombine">开始</a-button>
|
|
|
+ </footer>
|
|
|
+ <footer v-if="navId === 3 && !showDialog" class="upload-footer">
|
|
|
<section v-for="(item, key) in variables" :key="key">
|
|
|
<div>
|
|
|
<p>
|
|
|
@@ -80,7 +115,7 @@
|
|
|
<a-button :style="{ width: '500px' }" type="primary" @click="beginCombine">开始</a-button>
|
|
|
</footer>
|
|
|
<a-tooltip :content="closeOthers ? '收起' : '展开'">
|
|
|
- <div @click="openAll" v-if="navIndex !== -2">
|
|
|
+ <div @click="openAll" v-if="navId !== -2">
|
|
|
<img src="@/assets/other/open.svg" width="20" v-if="closeOthers" />
|
|
|
<img src="@/assets/other/close.svg" width="20" v-else />
|
|
|
</div>
|
|
|
@@ -88,7 +123,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <right v-if="navIndex === 0 || navIndex === 2" /> -->
|
|
|
+ <!-- <right v-if="navId === 0 || navId === 2" /> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -134,7 +169,7 @@ export default defineComponent({
|
|
|
|
|
|
const closeOthers = ref(false);
|
|
|
const swiperNumber = ref(5);
|
|
|
- const navIndex = ref(-1);
|
|
|
+ const navId = ref(-1);
|
|
|
const readonly = ref(false);
|
|
|
const showDialog = ref(false);
|
|
|
const dialogList = ref([]);
|
|
|
@@ -150,17 +185,19 @@ export default defineComponent({
|
|
|
let reportData = {};
|
|
|
let agents = {}
|
|
|
|
|
|
- // NOTE: 暂时删除
|
|
|
- if (config.slider && Array.isArray(config.slider)) {
|
|
|
- config.slider = config.slider.filter(item => item.title !== "报告生成");
|
|
|
- config.slider = config.slider.filter(item => item.title !== "报表合并");
|
|
|
- }
|
|
|
+ // // NOTE: 暂时删除
|
|
|
+ // if (config.slider && Array.isArray(config.slider)) {
|
|
|
+ // config.slider = config.slider.filter(item => item.title !== "报告生成");
|
|
|
+ // config.slider = config.slider.filter(item => item.title !== "报表合并");
|
|
|
+ // }
|
|
|
|
|
|
const openAll = () => {
|
|
|
closeOthers.value = !closeOthers.value;
|
|
|
};
|
|
|
const selectNav = async (node) => {
|
|
|
- navIndex.value = node.index;
|
|
|
+ navId.value = node.id;
|
|
|
+ navId.value = node.index;
|
|
|
+ console.log('navId', navId.value)
|
|
|
if (node.index === -1) {
|
|
|
swiperNumber.value = 5;
|
|
|
} else {
|
|
|
@@ -171,7 +208,7 @@ export default defineComponent({
|
|
|
|
|
|
selectId.value = (agents.find(agent => agent.name === node.title) || {}).id || null;
|
|
|
const data = await ajax.message.getDialogs(selectId.value);
|
|
|
- if (navIndex.value === 0) {
|
|
|
+ if (navId.value === 0 || navId.value === 3) {
|
|
|
const result = await ajax.agent.getVariables(selectId.value);
|
|
|
variables.value = result;
|
|
|
reportData = {};
|
|
|
@@ -188,11 +225,11 @@ export default defineComponent({
|
|
|
readonly.value = status;
|
|
|
};
|
|
|
const goDocument = () => {
|
|
|
- navIndex.value = -2;
|
|
|
+ navId.value = -2;
|
|
|
hideDialog.value = true;
|
|
|
};
|
|
|
const goBack = () => {
|
|
|
- navIndex.value = 0;
|
|
|
+ navId.value = 0;
|
|
|
hideDialog.value = false;
|
|
|
};
|
|
|
const selectHistory = async (id) => {
|
|
|
@@ -310,7 +347,7 @@ export default defineComponent({
|
|
|
beginCombine,
|
|
|
selectId,
|
|
|
dialogId,
|
|
|
- navIndex,
|
|
|
+ navId,
|
|
|
variables,
|
|
|
selectNav,
|
|
|
swiperNumber,
|