Bladeren bron

fix: 修复菜单编辑时序号无法回显

xieyonghong 3 jaren geleden
bovenliggende
commit
da312f3e22
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      src/pages/system/Menu/Detail/index.tsx

+ 2 - 2
src/pages/system/Menu/Detail/index.tsx

@@ -40,7 +40,7 @@ export default () => {
     if (_pId) {
     if (_pId) {
       setPid(_pId);
       setPid(_pId);
     }
     }
-    if (_sortIndex) {
+    if (_sortIndex && id === ':id') {
       setSortIndex(_sortIndex);
       setSortIndex(_sortIndex);
     }
     }
   };
   };
@@ -77,9 +77,9 @@ export default () => {
       {tabKey === 'detail' && (param.id !== ':id' ? data : true) ? (
       {tabKey === 'detail' && (param.id !== ':id' ? data : true) ? (
         <BaseDetail
         <BaseDetail
           data={{
           data={{
+            sortIndex: sortIndex,
             ...data,
             ...data,
             parentId: pId,
             parentId: pId,
-            sortIndex: sortIndex,
           }}
           }}
           basePath={params.get('basePath')}
           basePath={params.get('basePath')}
           onLoad={queryDetail}
           onLoad={queryDetail}