diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/data-import/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/data-import/index.vue
index 81cf51c1..5b6e8478 100644
--- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/data-import/index.vue
+++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/data-import/index.vue
@@ -14,7 +14,7 @@ import { createIconifyIcon } from '@vben/icons';
import { Button, message, Progress, Space } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
-import { batchImportOrdersApi } from '#/api/ecommerce';
+import { batchImportOrdersApi } from '#/api/ecommerce/order';
import FieldMappingModal from '#/views/ecommerce/data-import/components/FieldMappingModal.vue';
import EntityCreationModal from './components/EntityCreationModal.vue';
diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/media/file/components/FileEditModal.vue b/ecom-dmb-frontend/apps/web-antd/src/views/media/file/components/FileEditModal.vue
index 78d1f9b4..45ae8e86 100644
--- a/ecom-dmb-frontend/apps/web-antd/src/views/media/file/components/FileEditModal.vue
+++ b/ecom-dmb-frontend/apps/web-antd/src/views/media/file/components/FileEditModal.vue
@@ -3,7 +3,9 @@ import type { FileDTO, FileVO } from '#/api/media/file/types';
import { ref, watch } from 'vue';
-import { Form, Input, message, Modal } from 'ant-design-vue';
+import { useVbenModal } from '@vben/common-ui';
+
+import { Form, Input, message } from 'ant-design-vue';
import { updateFileApi } from '#/api/media/file';
@@ -26,8 +28,18 @@ interface Emits {
(e: 'cancel'): void;
}
+// 创建 vben modal
+const [Modal, modalApi] = useVbenModal({
+ draggable: true,
+ onCancel() {
+ handleCancel();
+ },
+ onConfirm() {
+ handleOk();
+ },
+});
+
// 响应式数据
-const visible = ref(false);
const formRef = ref();
const formData = ref
({
tags: '',
@@ -38,22 +50,22 @@ const formData = ref({
watch(
() => props.open,
(newVal) => {
- visible.value = newVal;
- if (newVal && props.fileData) {
- // 填充表单数据
- formData.value = {
- tags: props.fileData.tags,
- remark: props.fileData.remark,
- };
+ if (newVal) {
+ modalApi.open();
+ if (props.fileData) {
+ // 填充表单数据
+ formData.value = {
+ tags: props.fileData.tags,
+ remark: props.fileData.remark,
+ };
+ }
+ } else {
+ modalApi.close();
}
},
+ { immediate: true },
);
-// 监听visible变化,同步到父组件
-watch(visible, (newVal) => {
- emit('update:open', newVal);
-});
-
// 确认操作
const handleOk = async () => {
try {
@@ -62,7 +74,8 @@ const handleOk = async () => {
await updateFileApi(props.fileData.id, formData.value);
message.success('更新成功');
emit('success');
- visible.value = false;
+ modalApi.close();
+ emit('update:open', false);
}
} catch {
message.error('更新失败');
@@ -72,7 +85,8 @@ const handleOk = async () => {
// 取消操作
const handleCancel = () => {
emit('cancel');
- visible.value = false;
+ modalApi.close();
+ emit('update:open', false);
// 重置表单数据
formData.value = {
tags: '',
@@ -82,12 +96,7 @@ const handleCancel = () => {
-
+