From 07895c65b99fa43f8e54f5054bd8351a71158143 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 17 十月 2024 21:17:28 +0800
Subject: [PATCH] 工艺路线绑定优化

---
 src/views/tigerprojects/system/menu/index.vue |   56 +++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/src/views/tigerprojects/system/menu/index.vue b/src/views/tigerprojects/system/menu/index.vue
index fabbd90..9eea644 100644
--- a/src/views/tigerprojects/system/menu/index.vue
+++ b/src/views/tigerprojects/system/menu/index.vue
@@ -15,14 +15,15 @@
             @expanded-rows-change="onExpandedRChg"
           >
             <template #toolbar>
-              <a-button type="primary" @click="handleCreate"> 鏂板鑿滃崟 </a-button>
+              <a-button type="primary" @click="handleCreate('BS 鑿滃崟')"> 鏂板鑿滃崟 </a-button>
             </template>
             <template #action="{ record }">
               <TableAction
                 :actions="[
                   {
                     icon: 'clarity:note-edit-line',
-                    onClick: handleEdit.bind(null, record),
+                    onClick: handleEdit.bind(null, record, 'BS 鑿滃崟'),
+                    name: '',
                   },
                   {
                     icon: 'ant-design:delete-outlined',
@@ -32,6 +33,7 @@
                       placement: 'left',
                       confirm: handleDelete.bind(null, record),
                     },
+                    name: '',
                   },
                 ]"
               />
@@ -47,14 +49,15 @@
             @expanded-rows-change="onExpandedRChg"
           >
             <template #toolbar>
-              <a-button type="primary" @click="handleCreate"> 鏂板鑿滃崟 </a-button>
+              <a-button type="primary" @click="handleCreate('PDA')"> 鏂板鑿滃崟 </a-button>
             </template>
             <template #action="{ record }">
               <TableAction
                 :actions="[
                   {
                     icon: 'clarity:note-edit-line',
-                    onClick: handleEdit.bind(null, record),
+                    onClick: handleEdit.bind(null, record, 'PDA'),
+                    name: '',
                   },
                   {
                     icon: 'ant-design:delete-outlined',
@@ -64,6 +67,7 @@
                       placement: 'left',
                       confirm: handleDelete.bind(null, record),
                     },
+                    name: '',
                   },
                 ]"
               />
@@ -96,14 +100,14 @@
     api: getMenuList,
     searchInfo: { menuName: 'BS 鑿滃崟' },
     columns,
-    // formConfig: {
-    //   labelWidth: 120,
-    //   schemas: searchFormSchema,
-    // },
+    formConfig: {
+      labelWidth: 120,
+      schemas: searchFormSchema,
+    },
     isTreeTable: true,
     // pagination: false,
     // striped: false,
-    // // useSearchForm: true,
+    useSearchForm: true,
     showTableSetting: true,
     // bordered: true,
     // showIndexColumn: false,
@@ -118,20 +122,23 @@
     rowKey: 'id',
   });
 
-  const [registerTableSecond, { reloadSecond, expandAllSecond, expandRowsSecond }] = useTable({
+  const [
+    registerTableSecond,
+    { reload: reloadSecond, expandAll: expandAllSecond, expandRows: expandRowsSecond },
+  ] = useTable({
     // const [registerTable, { reload, expandRows }] = useTable({
     title: '鑿滃崟鍒楄〃',
     api: getMenuList,
     searchInfo: { menuName: 'PDA' },
     columns,
-    // formConfig: {
-    //   labelWidth: 120,
-    //   schemas: searchFormSchema,
-    // },
+    formConfig: {
+      labelWidth: 120,
+      schemas: searchFormSchema,
+    },
     isTreeTable: true,
     // pagination: false,
     // striped: false,
-    // // useSearchForm: true,
+    useSearchForm: true,
     showTableSetting: true,
     // bordered: true,
     // showIndexColumn: false,
@@ -146,16 +153,18 @@
     rowKey: 'id',
   });
 
-  function handleCreate() {
+  function handleCreate(menuName: string) {
     openDrawer(true, {
       isUpdate: false,
+      menuName: menuName,
     });
   }
 
-  function handleEdit(record: Recordable) {
+  function handleEdit(record: Recordable, menuName: string) {
     openDrawer(true, {
       record,
       isUpdate: true,
+      menuName: menuName,
     });
   }
 
@@ -165,20 +174,25 @@
     const apiAction = DeleteMenu(record);
     apiAction.then((onfulfilled) => {
       if (onfulfilled.IsSuccessed) {
-        reload();
+          reloadSecond();
+          reload();
       }
     });
   }
 
-  function handleSuccess({ values }) {
-    reload();
+  function handleSuccess(d) {
+    if (d.menuName == 'PDA') {
+      reloadSecond();
+    } else {
+      reload();
+    }
     nextTick(() => {
       setTimeout(() => {
         var tdList = document.querySelectorAll(
           '.ant-table-cell.ant-table-cell-ellipsis.ant-table-cell-with-append',
         );
         for (var i = 0; i < tdList.length; i++) {
-          if (tdList[i].attributes['title'].nodeValue == values.menuName) {
+          if (tdList[i].attributes['title'].nodeValue == d.values.menuName) {
             tdList[i].scrollIntoView();
           }
         }

--
Gitblit v1.9.3