| | |
| | | </el-row> |
| | | </template> |
| | | <fileUpload |
| | | ref="fileUploadRef" |
| | | :fileSize="1024" |
| | | :fileType="['pdf', 'docx', 'txt', 'xlsx', 'pptx....']" |
| | | :limit="10" |
| | | v-model:modelValue="modelValue" |
| | | ref="fileUploadRef" |
| | | :fileSize="1024" |
| | | :fileType="['pdf', 'docx', 'txt', 'xlsx', 'pptx....']" |
| | | :limit="10" |
| | | :drag="false" |
| | | v-model:modelValue="modelValue" |
| | | /> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | }; |
| | | const fileUploadRef = ref(null); |
| | | const initForm = () => { |
| | | ruleForm.value = {} |
| | | fileUploadRef.value.init() |
| | | ruleForm.value = {}; |
| | | fileUploadRef.value.init(); |
| | | }; |
| | | const editForm = (val) => { |
| | | ruleForm.value = copyForm.value; |
| | | // fileUploadRef.value.editInit(ruleForm.value); |
| | | nextTick(() => { |
| | | // console.log("编辑表单数据:", fileUploadRef.value); |
| | | fileUploadRef.value.editInit(val); |
| | | |
| | | fileUploadRef.value.editInit(val); |
| | | }); |
| | | }; |
| | | defineExpose({ |
| | |
| | | type: "error", |
| | | message: error.msg || "操作失败", |
| | | }); |
| | | console.error("API 调用失败:", error); |
| | | return; |
| | | } |
| | | // 发送 emit 事件 |
| | | |
| | | |
| | | // 关闭对话框 |
| | | centerDialogVisible.value = false; |
| | | } catch (error) { |
| | | console.error("表单验证失败或API调用失败:", error); |
| | | ElMessage({ |
| | | type: "error", |
| | | message: error.msg || "操作失败", |
| | | }); |
| | | } |
| | | }; |
| | | </script> |