|
@@ -10,11 +10,16 @@
|
|
|
:file="upload_file_for_outline"
|
|
:file="upload_file_for_outline"
|
|
|
@removeFile="removeFileForOutLine"
|
|
@removeFile="removeFileForOutLine"
|
|
|
></DocxFile>
|
|
></DocxFile>
|
|
|
|
|
+ <ReportTypeList
|
|
|
|
|
+ v-if="chat_type == 'znyj'"
|
|
|
|
|
+ :report_type_list="report_type_list"
|
|
|
|
|
+ @select-report-type="handleSelectReportType"
|
|
|
|
|
+ ></ReportTypeList>
|
|
|
</slot>
|
|
</slot>
|
|
|
|
|
|
|
|
<div class="textarea-container" v-if="has_textarea">
|
|
<div class="textarea-container" v-if="has_textarea">
|
|
|
<a-textarea
|
|
<a-textarea
|
|
|
- v-if="chat_type != 'bgsc'"
|
|
|
|
|
|
|
+ v-if="chat_type != 'bgsc' && chat_type != 'znyj'"
|
|
|
ref="chat_input_textarea"
|
|
ref="chat_input_textarea"
|
|
|
class="chat-textarea-input"
|
|
class="chat-textarea-input"
|
|
|
:placeholder="text_placeholder"
|
|
:placeholder="text_placeholder"
|
|
@@ -23,7 +28,7 @@
|
|
|
@input="handleTextInput"
|
|
@input="handleTextInput"
|
|
|
@keyup="handleTextKeyUp"
|
|
@keyup="handleTextKeyUp"
|
|
|
/>
|
|
/>
|
|
|
- <div v-else style="width: 100%">
|
|
|
|
|
|
|
+ <div v-if="chat_type == 'bgsc'" style="width: 100%">
|
|
|
<TextAreaTemplate
|
|
<TextAreaTemplate
|
|
|
v-if="is_template_input && !show_template_input"
|
|
v-if="is_template_input && !show_template_input"
|
|
|
:target_template_item="selected_template"
|
|
:target_template_item="selected_template"
|
|
@@ -39,20 +44,19 @@
|
|
|
@input="handleTextInput"
|
|
@input="handleTextInput"
|
|
|
@keyup="handleTextKeyUp"
|
|
@keyup="handleTextKeyUp"
|
|
|
/>
|
|
/>
|
|
|
- <!-- <div
|
|
|
|
|
- class="template_textarea"
|
|
|
|
|
- v-html="template_text_value"
|
|
|
|
|
- contenteditable
|
|
|
|
|
- @input="handleTextInput"
|
|
|
|
|
- @keyup="handleTextKeyUp"
|
|
|
|
|
- v-if="!is_template_input && show_template_input"
|
|
|
|
|
- ></div> -->
|
|
|
|
|
<TextAreaTemplateSelected
|
|
<TextAreaTemplateSelected
|
|
|
v-if="!is_template_input && show_template_input"
|
|
v-if="!is_template_input && show_template_input"
|
|
|
:target_template_item="selected_template"
|
|
:target_template_item="selected_template"
|
|
|
@submit_selected_template="handleSubmitSelectedTemplate"
|
|
@submit_selected_template="handleSubmitSelectedTemplate"
|
|
|
></TextAreaTemplateSelected>
|
|
></TextAreaTemplateSelected>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="chat_type == 'znyj'">
|
|
|
|
|
+ <TextAreaEmail
|
|
|
|
|
+ v-if="chat_type === 'znyj'"
|
|
|
|
|
+ ref="emailAreaRef"
|
|
|
|
|
+ :target_report_type="target_report_type"
|
|
|
|
|
+ ></TextAreaEmail>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<InputActions
|
|
<InputActions
|
|
|
:has_input_text="has_input_text"
|
|
:has_input_text="has_input_text"
|
|
@@ -70,6 +74,7 @@
|
|
|
@open_template_select="openTemplateSelect"
|
|
@open_template_select="openTemplateSelect"
|
|
|
@open_draft="openDraft"
|
|
@open_draft="openDraft"
|
|
|
@open_data_source="openDataSource"
|
|
@open_data_source="openDataSource"
|
|
|
|
|
+ @open_task_config="openTaskConfig"
|
|
|
/>
|
|
/>
|
|
|
<slot name="bottom"></slot>
|
|
<slot name="bottom"></slot>
|
|
|
</div>
|
|
</div>
|
|
@@ -96,6 +101,11 @@
|
|
|
@open_data_source_manage="openDataSourceManage"
|
|
@open_data_source_manage="openDataSourceManage"
|
|
|
@edit-data-source="handleEditDataSource"
|
|
@edit-data-source="handleEditDataSource"
|
|
|
></DataSourceModal>
|
|
></DataSourceModal>
|
|
|
|
|
+ <TaskConfigModal
|
|
|
|
|
+ v-if="show_task_config_model"
|
|
|
|
|
+ :show_modal="show_task_config_model"
|
|
|
|
|
+ @close-task-config-modal="closeTaskConfigModal"
|
|
|
|
|
+ ></TaskConfigModal>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -103,13 +113,16 @@
|
|
|
import { ref, onMounted, onUnmounted, watch, computed, nextTick } from 'vue';
|
|
import { ref, onMounted, onUnmounted, watch, computed, nextTick } from 'vue';
|
|
|
import InputActions from './dialog-input/InputActions.vue';
|
|
import InputActions from './dialog-input/InputActions.vue';
|
|
|
import UploadList from './upload-action/UploadList.vue';
|
|
import UploadList from './upload-action/UploadList.vue';
|
|
|
|
|
+import ReportTypeList from './dialog-input/email-input/ReportTypeList.vue';
|
|
|
import DocxFile from './upload-action/DocxFile.vue';
|
|
import DocxFile from './upload-action/DocxFile.vue';
|
|
|
import TextAreaTemplate from './dialog-input/TextAreaTemplate.vue';
|
|
import TextAreaTemplate from './dialog-input/TextAreaTemplate.vue';
|
|
|
import TextAreaTemplateSelected from './dialog-input/TextAreaTemplateSelected.vue';
|
|
import TextAreaTemplateSelected from './dialog-input/TextAreaTemplateSelected.vue';
|
|
|
|
|
+import TextAreaEmail from './dialog-input/email-input/TextAreaEmail.vue';
|
|
|
|
|
|
|
|
import TemplateSelectModal from '../template-manage/TempalteSelectModal.vue';
|
|
import TemplateSelectModal from '../template-manage/TempalteSelectModal.vue';
|
|
|
import DraftModal from '../draft-manage/DraftModal.vue';
|
|
import DraftModal from '../draft-manage/DraftModal.vue';
|
|
|
import DataSourceModal from '../data-source-manage/DataSourceModal.vue';
|
|
import DataSourceModal from '../data-source-manage/DataSourceModal.vue';
|
|
|
|
|
+import TaskConfigModal from '../task-config/TaskConfigModal.vue';
|
|
|
// import FileUploadPreviewV1 from '../file-preview/FileUploadPreviewV1.vue';
|
|
// import FileUploadPreviewV1 from '../file-preview/FileUploadPreviewV1.vue';
|
|
|
// import useFileSelect from './use-file-select';
|
|
// import useFileSelect from './use-file-select';
|
|
|
// import useFileSelectedV2 from './use-file-select-v2';
|
|
// import useFileSelectedV2 from './use-file-select-v2';
|
|
@@ -161,6 +174,8 @@ const text_placeholder = ref('请输入你的问题');
|
|
|
|
|
|
|
|
// 文件列表-用于展示
|
|
// 文件列表-用于展示
|
|
|
const upload_file_list = ref([]);
|
|
const upload_file_list = ref([]);
|
|
|
|
|
+// 邮件自动发送-报表类型列表
|
|
|
|
|
+const report_type_list = ref(window.report_type_list);
|
|
|
// 文件队列-用于流程
|
|
// 文件队列-用于流程
|
|
|
const upload_queue = ref([]);
|
|
const upload_queue = ref([]);
|
|
|
// 是否正在上传
|
|
// 是否正在上传
|
|
@@ -177,6 +192,14 @@ const show_template_select_model = ref(false);
|
|
|
const show_draft_model = ref(false);
|
|
const show_draft_model = ref(false);
|
|
|
// 是否展示数据源弹窗
|
|
// 是否展示数据源弹窗
|
|
|
const show_data_source_model = ref(false);
|
|
const show_data_source_model = ref(false);
|
|
|
|
|
+// 是否展示任务配置弹窗
|
|
|
|
|
+const show_task_config_model = ref(false);
|
|
|
|
|
+// 邮件自动发送-选中的报表类型
|
|
|
|
|
+const target_report_type = ref('1');
|
|
|
|
|
+
|
|
|
|
|
+// 邮件自动发送组件
|
|
|
|
|
+const emailAreaRef = ref(null);
|
|
|
|
|
+
|
|
|
// 选中的模板
|
|
// 选中的模板
|
|
|
const selected_template = ref(null);
|
|
const selected_template = ref(null);
|
|
|
// 是否显示上传模板按钮
|
|
// 是否显示上传模板按钮
|
|
@@ -237,6 +260,27 @@ const handleSubmit = () => {
|
|
|
input_text_value.value = window.bgcl_question;
|
|
input_text_value.value = window.bgcl_question;
|
|
|
input_file_list.value = upload_file_list.value;
|
|
input_file_list.value = upload_file_list.value;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (props.chat_type === 'znyj') {
|
|
|
|
|
+ const has_content = checkEmailSubmitFormat(emailAreaRef.value);
|
|
|
|
|
+ console.log('has_content');
|
|
|
|
|
+ if (!has_content) return;
|
|
|
|
|
+
|
|
|
|
|
+ const { date, subject, toEmail, ccEmail } = emailAreaRef.value;
|
|
|
|
|
+ const is_toEmail_valid = checkEmailFormat(toEmail.value);
|
|
|
|
|
+ if (!is_toEmail_valid) {
|
|
|
|
|
+ Message.error('收件邮箱格式错误,多个邮箱间以逗号隔开');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const is_ccEmail_valid = checkEmailFormat(toEmail.value);
|
|
|
|
|
+ if (!is_ccEmail_valid) {
|
|
|
|
|
+ Message.error('抄送邮箱格式错误,多个邮箱间以逗号隔开');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ input_text_value.value = `帮我生成${date}的全省供电可靠性报告,主题为${subject},收件邮箱为${toEmail},抄送人邮箱为${ccEmail}`;
|
|
|
|
|
+
|
|
|
|
|
+ console.log(date, subject, toEmail, ccEmail);
|
|
|
|
|
+ }
|
|
|
// 检查是否是禁用状态
|
|
// 检查是否是禁用状态
|
|
|
if (!input_text_value.value.trim()) {
|
|
if (!input_text_value.value.trim()) {
|
|
|
selected_template.value = null;
|
|
selected_template.value = null;
|
|
@@ -250,12 +294,46 @@ const handleSubmit = () => {
|
|
|
text: input_text_value.value,
|
|
text: input_text_value.value,
|
|
|
files: input_file_list.value,
|
|
files: input_file_list.value,
|
|
|
event_id: event_id.value || '',
|
|
event_id: event_id.value || '',
|
|
|
- template_id: selected_template.value?.id || ''
|
|
|
|
|
|
|
+ template_id: selected_template.value?.id || '',
|
|
|
|
|
+ email_type: window.report_type_list.find((item) => item.key === target_report_type.value)?.email_type || ''
|
|
|
// config: action_config.value
|
|
// config: action_config.value
|
|
|
});
|
|
});
|
|
|
|
|
+ emailAreaRef.value.clear();
|
|
|
is_template_input.value = false;
|
|
is_template_input.value = false;
|
|
|
show_template_input.value = false;
|
|
show_template_input.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
+// 邮件自动发送-检查提交格式
|
|
|
|
|
+const checkEmailSubmitFormat = (obj) => {
|
|
|
|
|
+ const { date, subject, toEmail, ccEmail } = obj;
|
|
|
|
|
+ if (!date) {
|
|
|
|
|
+ Message.error('请填写日期');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!subject) {
|
|
|
|
|
+ Message.error('请填写主题');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!toEmail) {
|
|
|
|
|
+ Message.error('请填写收件邮箱');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!ccEmail) {
|
|
|
|
|
+ Message.error('请填写抄送邮箱');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+};
|
|
|
|
|
+// 邮件自动发送-检查邮箱格式
|
|
|
|
|
+const checkEmailFormat = (email_str) => {
|
|
|
|
|
+ if (!email_str) return true;
|
|
|
|
|
+
|
|
|
|
|
+ const emails = email_str
|
|
|
|
|
+ .split(',')
|
|
|
|
|
+ .map((email) => email.trim())
|
|
|
|
|
+ .filter((email) => email);
|
|
|
|
|
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
|
|
|
+ return emails.every((email) => emailRegex.test(email));
|
|
|
|
|
+};
|
|
|
const handleStop = () => {
|
|
const handleStop = () => {
|
|
|
emit('stop');
|
|
emit('stop');
|
|
|
};
|
|
};
|
|
@@ -295,6 +373,10 @@ const handleSubmitSelectedTemplate = (text) => {
|
|
|
is_template_input.value = false;
|
|
is_template_input.value = false;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+// 邮件自动发送选中的报表类型
|
|
|
|
|
+const handleSelectReportType = (type) => {
|
|
|
|
|
+ target_report_type.value = type;
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
const uploadFileForOutline = (file) => {
|
|
const uploadFileForOutline = (file) => {
|
|
|
upload_file_for_outline.value = {
|
|
upload_file_for_outline.value = {
|
|
@@ -412,6 +494,9 @@ const clear = () => {
|
|
|
selected_template.value = null;
|
|
selected_template.value = null;
|
|
|
show_upload_for_ouline.value = true;
|
|
show_upload_for_ouline.value = true;
|
|
|
upload_file_for_outline.value = {};
|
|
upload_file_for_outline.value = {};
|
|
|
|
|
+ if (props.chat_type === 'znyj') {
|
|
|
|
|
+ input_text_value.value = '帮我生成{date}的全省供电可靠性报告,主题为{title},收件邮箱为{toEmail},抄送邮箱为{ccEmail}';
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
const toRecommend = (txt) => {
|
|
const toRecommend = (txt) => {
|
|
|
input_text_value.value = txt;
|
|
input_text_value.value = txt;
|
|
@@ -432,6 +517,14 @@ const closeDraftModal = () => {
|
|
|
const openDataSource = () => {
|
|
const openDataSource = () => {
|
|
|
show_data_source_model.value = true;
|
|
show_data_source_model.value = true;
|
|
|
};
|
|
};
|
|
|
|
|
+// 打开任务配置弹窗
|
|
|
|
|
+const openTaskConfig = () => {
|
|
|
|
|
+ show_task_config_model.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+// 关闭任务配置弹窗
|
|
|
|
|
+const closeTaskConfigModal = () => {
|
|
|
|
|
+ show_task_config_model.value = false;
|
|
|
|
|
+};
|
|
|
// 关闭数据源弹窗
|
|
// 关闭数据源弹窗
|
|
|
const closeDataSourceModal = () => {
|
|
const closeDataSourceModal = () => {
|
|
|
show_data_source_model.value = false;
|
|
show_data_source_model.value = false;
|
|
@@ -578,6 +671,18 @@ watch(
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => props.chat_type,
|
|
|
|
|
+ () => {
|
|
|
|
|
+ if (props.chat_type === 'znyj') {
|
|
|
|
|
+ input_text_value.value =
|
|
|
|
|
+ '帮我生成{date}的全省供电可靠性报告,主题为{title},收件邮箱为{toEmail},抄送邮箱为{ccEmail}';
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ immediate: true
|
|
|
|
|
+ }
|
|
|
|
|
+);
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
// 对话输入框自动获得焦点
|
|
// 对话输入框自动获得焦点
|
|
|
autoFocus();
|
|
autoFocus();
|