liaojiaxing 3 месяцев назад
Родитель
Сommit
5a5d5a427f

+ 1 - 0
apps/designer/.umirc.ts

@@ -4,6 +4,7 @@ export default defineConfig({
   base: '/',
   publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
   outputPath: 'systemDesign',
+  esbuildMinifyIIFE: true,
   favicons: [
     '/favicon.ico'
   ],

+ 1 - 0
apps/er-designer/.umirc.ts

@@ -4,6 +4,7 @@ export default defineConfig({
   base: '/',
   publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
   outputPath: 'dataModel',
+  esbuildMinifyIIFE: true,
   favicons: [
     '/favicon.ico'
   ],

+ 8 - 3
apps/er-designer/src/components/SyncModal.tsx

@@ -1,10 +1,11 @@
 import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react";
-import { Modal, Table, Collapse, Checkbox, message } from "antd";
+import { Modal, Collapse, message, Empty } from "antd";
 import DiffTable from "./DiffTable";
 import { useModel, useRequest } from "umi";
 import { PushDataModelTable } from "@/api/dataModel";
-import { GetAllDesignTables, GetAllBusinessTableColumns } from "@/api";
+import { GetAllDesignTables } from "@/api";
 import { TableItemType } from "@/type";
+import NoData from "@/assets/no-data.png";
 
 export default forwardRef(function SyncModal(props: {onPush: () => void}, ref) {
   const [open, setOpen] = useState(false);
@@ -89,7 +90,8 @@ export default forwardRef(function SyncModal(props: {onPush: () => void}, ref) {
         },
       }}
       okButtonProps={{
-        loading: okLoading
+        loading: okLoading,
+        disabled: !tableList.length
       }}
       onCancel={() => setOpen(false)}
       onOk={handleSubmit}
@@ -135,6 +137,9 @@ export default forwardRef(function SyncModal(props: {onPush: () => void}, ref) {
           };
         })}
       />
+      {
+        !tableList.length && <Empty image={NoData} description="当前模型表为空,请添加后再进行同步!"/>
+      }
     </Modal>
   );
 });

+ 1 - 1
apps/er-designer/src/pages/detail/components/AddTable.tsx

@@ -64,7 +64,7 @@ export default forwardRef(function AddTable(
     },
   }));
 
-  const { data, loading, run } = useRequest(() => GetAllDesignTables, {
+  const { data, loading, run } = useRequest(() => GetAllDesignTables(), {
     manual: true,
   });
 

+ 1 - 1
apps/er-designer/src/pages/detail/index.tsx

@@ -233,7 +233,7 @@ export default function index() {
     <div className="flex gap-12px">
       <a onClick={handleSync}>
         <i className="iconfont icon-tongbu text-12px" />
-        数据同步
+        数据同步
       </a>
       <a onClick={() => project.id && addModelRef.current?.edit(project)}>
         <i className="iconfont icon-bianji text-12px" />