瀏覽代碼

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

xieyonghong 3 年之前
父節點
當前提交
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}