|
|
@@ -1,84 +1,134 @@
|
|
|
<template>
|
|
|
- <footer class="upload-footer wendangbaogaoshengcheng-footer" v-if="start_status !== 3">
|
|
|
- <a-space size="large">
|
|
|
- <a-tooltip :content="radio_qingxi_text">
|
|
|
- <a-radio :value="1" :model-value="act_type" @click="handleRadioClick(1)">文档清洗</a-radio>
|
|
|
- </a-tooltip>
|
|
|
-
|
|
|
- <a-tooltip :content="radio_shengcheng_text">
|
|
|
- <a-radio :value="2" :model-value="act_type" @click="handleRadioClick(2)">报告生成</a-radio>
|
|
|
- </a-tooltip>
|
|
|
- </a-space>
|
|
|
-
|
|
|
- <div class="vertical-placeholder"></div>
|
|
|
-
|
|
|
- <a-typography-text>
|
|
|
- 标题<span class="attention-requred">*</span>
|
|
|
- </a-typography-text>
|
|
|
- <a-input :style="{ flex: '1' }" v-model="textValue" :placeholder="`请输入标题`" allow-clear
|
|
|
- @input="handleInputChange" />
|
|
|
-
|
|
|
- <div class="vertical-placeholder"></div>
|
|
|
-
|
|
|
- <a-typography-text>
|
|
|
- 请上传文件<span class="attention-requred">*</span>
|
|
|
- </a-typography-text>
|
|
|
-
|
|
|
-
|
|
|
- <a-upload :file-list="file_list" :multiple="true" :limit="MAX_ACCEPT_FILE" :auto-upload="false"
|
|
|
- :show-upload-button="{ showOnExceedLimit: false }" accept=".pdf,.docx" @change="handleFileChange">
|
|
|
- <template #upload-button>
|
|
|
- <a-tooltip :content="upload_warning_text">
|
|
|
- <a-button class="upload-button">
|
|
|
- <template #icon>
|
|
|
- <icon-upload />
|
|
|
- </template>
|
|
|
-
|
|
|
- <template #default>点击上传</template>
|
|
|
- </a-button>
|
|
|
- </a-tooltip>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template #file-name="{ fileItem }">
|
|
|
- <a-tooltip :content="fileItem.name">
|
|
|
- <span>{{fileItem.name}}</span>
|
|
|
- </a-tooltip>
|
|
|
- </template>
|
|
|
-
|
|
|
- <!-- <template #upload-item="{ fileItem, index }">
|
|
|
+ <footer class="wendangbaogaoshengcheng-footer" v-if="start_status !== 3">
|
|
|
+ <div class="upload-footer" v-show="doc_form_show">
|
|
|
+ <div v-if="act_type === 3" class="form-fold-btn" @click="handleFormFold">
|
|
|
+ <icon-menu-fold :size="20" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <ActionTypeRadio @change="handleRadioChange"/>
|
|
|
+
|
|
|
+ <div class="vertical-placeholder"></div>
|
|
|
+
|
|
|
+ <TextInputType1 v-if="act_type === 1" @change="handleTextChange"/>
|
|
|
+ <TextInputType2 v-if="act_type === 2" @change="handleTextChange"/>
|
|
|
+ <TextInputType3 v-if="act_type === 3" @change="handleTextChange"/>
|
|
|
+
|
|
|
+ <div class="vertical-placeholder"></div>
|
|
|
+
|
|
|
+ <a-typography-text>
|
|
|
+ 请上传文件<span class="attention-requred">*</span>
|
|
|
+ </a-typography-text>
|
|
|
+
|
|
|
+ <a-upload :file-list="file_list" :multiple="true" :limit="MAX_ACCEPT_FILE" :auto-upload="false"
|
|
|
+ :show-upload-button="{ showOnExceedLimit: false }" accept=".pdf,.docx" @change="handleFileChange">
|
|
|
+ <template #upload-button>
|
|
|
+ <a-tooltip :content="upload_warning_text">
|
|
|
+ <a-button class="upload-button">
|
|
|
+ <template #icon>
|
|
|
+ <icon-upload />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #default>点击上传</template>
|
|
|
+ </a-button>
|
|
|
+ </a-tooltip>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #file-name="{ fileItem }">
|
|
|
+ <a-tooltip :content="fileItem.name">
|
|
|
+ <span>{{fileItem.name}}</span>
|
|
|
+ </a-tooltip>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- <template #upload-item="{ fileItem, index }">
|
|
|
<div>
|
|
|
<div>{{ fileItem.name }}</div>
|
|
|
</div>
|
|
|
</template> -->
|
|
|
- </a-upload>
|
|
|
+ </a-upload>
|
|
|
+
|
|
|
|
|
|
+ <template v-if="act_type === 2 || act_type === 1">
|
|
|
+ <div class="vertical-placeholder"></div>
|
|
|
|
|
|
- <div class="vertical-placeholder"></div>
|
|
|
+ <a-button :style="{ width: '500px' }" type="primary" @click="handleStart"
|
|
|
+ :disabled="start_status !== 1">开始</a-button>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template v-if="act_type === 3">
|
|
|
+ <div class="message-input-container">
|
|
|
+ <div v-show="!doc_form_show" class="form-fold-btn open" @click="handleFormOpen">
|
|
|
+ <icon-menu-fold :size="20" />
|
|
|
+ </div>
|
|
|
|
|
|
- <a-button :style="{ width: '500px' }" type="primary" @click="handleStart"
|
|
|
- :disabled="start_status !== 1">开始</a-button>
|
|
|
+ <message-input :readonly="readonly" eventName="open-dialog" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</footer>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, inject, computed } from "vue";
|
|
|
import { Message } from '@arco-design/web-vue';
|
|
|
|
|
|
+import MessageInput from "./MessageInput.vue";
|
|
|
+
|
|
|
+import ActionTypeRadio from './document-report/ActionTypeRadio.vue'
|
|
|
+import TextInputType1 from './document-report/TextInputType1.vue'
|
|
|
+import TextInputType2 from './document-report/TextInputType2.vue'
|
|
|
+import TextInputType3 from './document-report/TextInputType3.vue'
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
agentId: String,
|
|
|
+
|
|
|
+ readonly: Boolean
|
|
|
});
|
|
|
|
|
|
const { config, helper, ajax } = inject("$global");
|
|
|
|
|
|
-// 操作类型
|
|
|
+/**
|
|
|
+ * 操作类型
|
|
|
+ * 1 文档清洗
|
|
|
+ * 2 报告生成
|
|
|
+ * 3 小标题生成
|
|
|
+ */
|
|
|
const act_type = ref(1);
|
|
|
-const act_opts = [
|
|
|
- { label: '文档清洗', value: 1 },
|
|
|
- { label: '报告生成', value: 2 },
|
|
|
-];
|
|
|
+const text_title = ref(""); // 单行文本:标题
|
|
|
+const text_description = ref(""); // 多行文本:描述
|
|
|
+
|
|
|
+/**
|
|
|
+ * 文本输入区域变化事件
|
|
|
+ * @param textObj
|
|
|
+ */
|
|
|
+const handleTextChange = (textObj) => {
|
|
|
+ text_title.value = textObj.title || '';
|
|
|
+ text_description.value = textObj.description || '';
|
|
|
+}
|
|
|
+
|
|
|
+const handleTextClear = () => {
|
|
|
+ text_title.value = '';
|
|
|
+ text_description.value = '';
|
|
|
+}
|
|
|
+/**
|
|
|
+ * 操作类别变更
|
|
|
+ * @param value
|
|
|
+ */
|
|
|
+const handleRadioChange = (value) => {
|
|
|
+ act_type.value = value / 1;
|
|
|
+
|
|
|
+ handleTextClear();
|
|
|
+}
|
|
|
|
|
|
-// 标题
|
|
|
-const textValue = ref("");
|
|
|
-const maxLength = ref(120); // 允许输入的最大长度
|
|
|
+/**
|
|
|
+ * 控制表单区域的展开和折叠
|
|
|
+ * 当 使用 小标题生成 功能时,表单可以进行折叠或者展开,并且存在 对话输入区域,且必须输入文本才可以进行对话
|
|
|
+ */
|
|
|
+const doc_form_show = ref(true);
|
|
|
+const handleFormFold = () => {
|
|
|
+ doc_form_show.value = false;
|
|
|
+}
|
|
|
+const handleFormOpen = () => {
|
|
|
+ doc_form_show.value = true;
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 文件处理
|
|
|
@@ -95,10 +145,6 @@ const file_total = computed(() => {
|
|
|
const start_status = ref(1); // 状态值:1 初始 2 进行中 3 成功 4 出错 5 异常
|
|
|
const start_message = ref('');
|
|
|
|
|
|
-const handleRadioClick = (value) => {
|
|
|
- act_type.value = value / 1;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* 标题数据变化
|
|
|
* @param value
|
|
|
@@ -143,7 +189,7 @@ const showMsg = (msg) => {
|
|
|
*/
|
|
|
const handleStart = async () => {
|
|
|
const action_type = act_type.value; // 操作类型
|
|
|
- const title = textValue.value; // 标题
|
|
|
+ const title = text_title.value; // 标题
|
|
|
const f_list = file_list.value;
|
|
|
|
|
|
if (!action_type) {
|
|
|
@@ -233,6 +279,7 @@ const handleStart = async () => {
|
|
|
|
|
|
const upload_warning_text = `支持上传文件pdf、docx文档(最多${MAX_ACCEPT_FILE}个,每个大小不超过10MB)`;
|
|
|
const radio_qingxi_text = "对上传的文档进行清洗,输出生成清洗后的文档";
|
|
|
+const radio_xiaobiaoti_text = "对上传文档进行内容总结和分类,生成小标题并提供相应的分类内容。"
|
|
|
const radio_shengcheng_text = "对上传的(经过清洗的)文档生成报告,输出生成的报告文档"
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -241,10 +288,23 @@ const radio_shengcheng_text = "对上传的(经过清洗的)文档生成报告
|
|
|
}
|
|
|
|
|
|
.upload-footer {
|
|
|
- margin-bottom: 50px;
|
|
|
+ margin-bottom: 10px;
|
|
|
padding: 20px;
|
|
|
width: 540px;
|
|
|
+ // min-height: 240px;
|
|
|
border: 1px solid #eee;
|
|
|
+
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.form-fold-btn{
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 9;
|
|
|
+}
|
|
|
+.form-fold-btn.open{
|
|
|
+ left: 4px;
|
|
|
+ top: -4px;
|
|
|
}
|
|
|
|
|
|
.attention-requred {
|
|
|
@@ -252,7 +312,7 @@ const radio_shengcheng_text = "对上传的(经过清洗的)文档生成报告
|
|
|
}
|
|
|
|
|
|
.wendangbaogaoshengcheng-footer {
|
|
|
- min-height: 240px;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.max-limit-warning {
|
|
|
@@ -268,6 +328,10 @@ const radio_shengcheng_text = "对上传的(经过清洗的)文档生成报告
|
|
|
background-color: rgb(var(--primary-5));
|
|
|
color: #fff;
|
|
|
}
|
|
|
+
|
|
|
+.message-input-container{
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
</style>
|
|
|
<style>
|
|
|
.wendangbaogaoshengcheng-footer .arco-upload-icon.arco-upload-icon-start {
|