@@ -511,6 +511,9 @@ export default {
// })
} else {
this.$message({ message: '已清空所有要上传的附件', offset: 8 })
+ if (this.$refs.fileInput) {
+ this.$refs.fileInput.value = ''
+ }
}
},
// 将上传的图片转为base64
@@ -733,7 +736,34 @@ export default {
jsonData.archival_category_code = this.aiAddArchiveCategory.code
jsonData.is_entity = 1
console.log('jsonData', jsonData)
- this.$refs.previewForm.addOrUpdateForm = jsonData
+
+ const newFormData = {}
+ for (const key in jsonData) {
+ if (jsonData.hasOwnProperty(key)) {
+ const value = jsonData[key]
+ const fieldConfig = this.formPreviewData.find(config => config.fieldName === key)
+ if (fieldConfig) {
+ // 判断是否是数字框且值包含数字
+ if (fieldConfig.isInputClass === 'number' && fieldConfig.isDataType === 2 && fieldConfig.isDataTypeDetails === 'int') {
+ const numMatch = value.match(/\d+/)
+ if (numMatch) {
+ // newFormData[key] = parseInt(numMatch[0])
+ newFormData[key] = numMatch[0]
+ } else {
+ console.log(`字段 ${key} 的值 ${value} 不包含有效数字,将不提交该字段`)
+ continue
+ }
+ } else {
+ newFormData[key] = value
+ }
+ } else {
+ newFormData[key] = value
+ }
+ }
+ }
+
+ console.log('newFormData', newFormData)
+ this.$refs.previewForm.addOrUpdateForm = newFormData
}
}
this.reader = null // 清空读取器
@@ -795,6 +825,9 @@ export default {
if (this.reader) {
this.reader.cancel() // 取消读取器,终止流式响应
}
+ if (this.$refs.fileInput) {
+ this.$refs.fileInput.value = ''
+ }
},
// 删除解析任务
handleDel(data) {
diff --git a/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue b/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue
index b73e68f..9949279 100644
--- a/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue
+++ b/src/views/AIAssistant/AIIntelligentCoding/aiForm.vue
@@ -465,6 +465,11 @@ export default {
this.researchContext = ''
this.message = []
this.formVisible = false
+ if (this.$refs.form) {
+ // this.$refs.form.clearValidate()
+ this.$refs.form.resetFields()
+ this.form = {}
+ }
this.deleteFile()
},
handleEditorChange(value) {
diff --git a/src/views/AIAssistant/AIIntelligentCoding/index.vue b/src/views/AIAssistant/AIIntelligentCoding/index.vue
index b7ef042..9891051 100644
--- a/src/views/AIAssistant/AIIntelligentCoding/index.vue
+++ b/src/views/AIAssistant/AIIntelligentCoding/index.vue
@@ -67,7 +67,7 @@
-
+
专题名称:{{ currentResearch && currentResearch.researchTitle }}
编研类型:{{ currentResearch && currentResearch.researchType }}
@@ -90,7 +90,7 @@