Просмотр исходного кода

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

xieyonghong 3 лет назад
Родитель
Сommit
da312f3e22
1 измененных файлов с 2 добавлено и 2 удалено
  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) {
       setPid(_pId);
     }
-    if (_sortIndex) {
+    if (_sortIndex && id === ':id') {
       setSortIndex(_sortIndex);
     }
   };
@@ -77,9 +77,9 @@ export default () => {
       {tabKey === 'detail' && (param.id !== ':id' ? data : true) ? (
         <BaseDetail
           data={{
+            sortIndex: sortIndex,
             ...data,
             parentId: pId,
-            sortIndex: sortIndex,
           }}
           basePath={params.get('basePath')}
           onLoad={queryDetail}