react-toolkits 2.11.4 → 2.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +13 -23
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ interface LayoutProps extends Pick<GameSelectProps, 'filter' | 'onGameChange'> {
|
|
|
116
116
|
isMenuLoading?: boolean;
|
|
117
117
|
title?: ReactNode;
|
|
118
118
|
items?: NavMenuItem[];
|
|
119
|
+
hideGameSelect?: boolean;
|
|
119
120
|
navWidth?: string | number;
|
|
120
121
|
logoutRedirectUrl: string;
|
|
121
122
|
headerExtra?: {
|
|
@@ -390,11 +391,11 @@ interface MenuListItem {
|
|
|
390
391
|
is_common: boolean;
|
|
391
392
|
is_model: boolean;
|
|
392
393
|
model_name: 'change' | 'recharge';
|
|
393
|
-
type?: string;
|
|
394
394
|
permissions: Permission[];
|
|
395
395
|
front_route: string;
|
|
396
396
|
order: number;
|
|
397
397
|
scheme: string;
|
|
398
|
+
ext: string;
|
|
398
399
|
}
|
|
399
400
|
|
|
400
401
|
declare function useMenuList(): swr.SWRResponse<MenuListItem[], any, any>;
|
package/lib/index.js
CHANGED
|
@@ -1030,20 +1030,10 @@ var init_menuItemList = __esm({
|
|
|
1030
1030
|
render: (value) => value ? "\u662F" : "\u5426"
|
|
1031
1031
|
},
|
|
1032
1032
|
{
|
|
1033
|
-
title: "
|
|
1033
|
+
title: "\u662F\u5426\u9884\u8BBE",
|
|
1034
1034
|
dataIndex: "is_model",
|
|
1035
1035
|
key: "is_model",
|
|
1036
|
-
render: (value) => value ? "\
|
|
1037
|
-
},
|
|
1038
|
-
// {
|
|
1039
|
-
// title: 'Model',
|
|
1040
|
-
// dataIndex: 'model_name',
|
|
1041
|
-
// key: 'model_name',
|
|
1042
|
-
// },
|
|
1043
|
-
{
|
|
1044
|
-
title: "\u7C7B\u578B",
|
|
1045
|
-
dataIndex: "type",
|
|
1046
|
-
key: "type"
|
|
1036
|
+
render: (value) => value ? "\u5426" : "\u662F"
|
|
1047
1037
|
},
|
|
1048
1038
|
{
|
|
1049
1039
|
title: "\u64CD\u4F5C",
|
|
@@ -1145,7 +1135,7 @@ var init_createMenuItem = __esm({
|
|
|
1145
1135
|
permissions: JSON.parse(permissions)
|
|
1146
1136
|
});
|
|
1147
1137
|
mutate2();
|
|
1148
|
-
message.success("\u521B\u5EFA\u6210\u529F", () => {
|
|
1138
|
+
message.success("\u521B\u5EFA\u6210\u529F", 1.5, () => {
|
|
1149
1139
|
navigate("..", { relative: "path" });
|
|
1150
1140
|
});
|
|
1151
1141
|
};
|
|
@@ -1154,15 +1144,14 @@ var init_createMenuItem = __esm({
|
|
|
1154
1144
|
{
|
|
1155
1145
|
form,
|
|
1156
1146
|
labelCol: { flex: "120px" },
|
|
1157
|
-
initialValues: { is_common: false, is_model: false },
|
|
1147
|
+
initialValues: { is_common: false, is_model: false, order: 0 },
|
|
1158
1148
|
onFinish,
|
|
1159
1149
|
children: [
|
|
1160
1150
|
/* @__PURE__ */ jsx(Form.Item, { label: "\u83DC\u5355\u9879\u540D\u79F0", name: "category", rules: [{ required: true }], children: /* @__PURE__ */ jsx(Input, {}) }),
|
|
1161
1151
|
/* @__PURE__ */ jsx(Form.Item, { label: "\u524D\u7AEF\u8DEF\u7531", name: "front_route", rules: [{ required: true }], children: /* @__PURE__ */ jsx(Input, { prefix: FRONTEND_ROUTE_PREFIX }) }),
|
|
1162
1152
|
/* @__PURE__ */ jsx(Form.Item, { label: "Is Common", name: "is_common", rules: [{ required: true }], valuePropName: "checked", children: /* @__PURE__ */ jsx(Switch, {}) }),
|
|
1163
|
-
/* @__PURE__ */ jsx(Form.Item, { label: "Type", name: "type", rules: [{ required: true }], children: /* @__PURE__ */ jsx(Input, {}) }),
|
|
1164
1153
|
/* @__PURE__ */ jsx(Form.Item, { label: "Order", name: "order", children: /* @__PURE__ */ jsx(InputNumber, { className: "w-full" }) }),
|
|
1165
|
-
/* @__PURE__ */ jsx(Form.Item, { label: "\u63A5\u53E3\u89C4\u5219", name: "permissions",
|
|
1154
|
+
/* @__PURE__ */ jsx(Form.Item, { label: "\u63A5\u53E3\u89C4\u5219", name: "permissions", children: /* @__PURE__ */ jsx(
|
|
1166
1155
|
Editor,
|
|
1167
1156
|
{
|
|
1168
1157
|
theme: "vs-dark",
|
|
@@ -1199,7 +1188,8 @@ var init_createMenuItem = __esm({
|
|
|
1199
1188
|
children: "\u53D6\u6D88"
|
|
1200
1189
|
}
|
|
1201
1190
|
)
|
|
1202
|
-
] }) })
|
|
1191
|
+
] }) }),
|
|
1192
|
+
/* @__PURE__ */ jsx(Form.Item, { label: "Ext", name: "ext", children: /* @__PURE__ */ jsx(Input.TextArea, { rows: 5 }) })
|
|
1203
1193
|
]
|
|
1204
1194
|
}
|
|
1205
1195
|
) });
|
|
@@ -1239,7 +1229,7 @@ var init_updateMenuItem = __esm({
|
|
|
1239
1229
|
id: +params.id
|
|
1240
1230
|
});
|
|
1241
1231
|
mutate2();
|
|
1242
|
-
message.success("\u66F4\u65B0\u6210\u529F", () => {
|
|
1232
|
+
message.success("\u66F4\u65B0\u6210\u529F", 1.5, () => {
|
|
1243
1233
|
navigate("../..", { relative: "path" });
|
|
1244
1234
|
});
|
|
1245
1235
|
};
|
|
@@ -1258,15 +1248,14 @@ var init_updateMenuItem = __esm({
|
|
|
1258
1248
|
{
|
|
1259
1249
|
form,
|
|
1260
1250
|
labelCol: { flex: "120px" },
|
|
1261
|
-
initialValues: { is_common: false, is_model: false },
|
|
1251
|
+
initialValues: { is_common: false, is_model: false, order: 0 },
|
|
1262
1252
|
onFinish,
|
|
1263
1253
|
children: [
|
|
1264
1254
|
/* @__PURE__ */ jsx(Form.Item, { label: "\u83DC\u5355\u9879\u540D\u79F0", name: "category", rules: [{ required: true }], children: /* @__PURE__ */ jsx(Input, {}) }),
|
|
1265
1255
|
/* @__PURE__ */ jsx(Form.Item, { label: "\u524D\u7AEF\u8DEF\u7531", name: "front_route", rules: [{ required: true }], children: /* @__PURE__ */ jsx(Input, { prefix: FRONTEND_ROUTE_PREFIX }) }),
|
|
1266
1256
|
/* @__PURE__ */ jsx(Form.Item, { label: "Is Common", name: "is_common", rules: [{ required: true }], valuePropName: "checked", children: /* @__PURE__ */ jsx(Switch, {}) }),
|
|
1267
|
-
/* @__PURE__ */ jsx(Form.Item, { label: "Type", name: "type", rules: [{ required: true }], children: /* @__PURE__ */ jsx(Input, {}) }),
|
|
1268
1257
|
/* @__PURE__ */ jsx(Form.Item, { label: "Order", name: "order", children: /* @__PURE__ */ jsx(InputNumber, { className: "w-full" }) }),
|
|
1269
|
-
/* @__PURE__ */ jsx(Form.Item, { label: "\u63A5\u53E3\u89C4\u5219", name: "permissions",
|
|
1258
|
+
/* @__PURE__ */ jsx(Form.Item, { label: "\u63A5\u53E3\u89C4\u5219", name: "permissions", children: /* @__PURE__ */ jsx(
|
|
1270
1259
|
Editor,
|
|
1271
1260
|
{
|
|
1272
1261
|
theme: "vs-dark",
|
|
@@ -1292,6 +1281,7 @@ var init_updateMenuItem = __esm({
|
|
|
1292
1281
|
}
|
|
1293
1282
|
}
|
|
1294
1283
|
) }),
|
|
1284
|
+
/* @__PURE__ */ jsx(Form.Item, { label: "Ext", name: "ext", children: /* @__PURE__ */ jsx(Input.TextArea, { rows: 5 }) }),
|
|
1295
1285
|
/* @__PURE__ */ jsx(Form.Item, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-center gap-8", children: [
|
|
1296
1286
|
/* @__PURE__ */ jsx(Button, { type: "primary", htmlType: "submit", children: "\u63D0\u4EA4" }),
|
|
1297
1287
|
/* @__PURE__ */ jsx(
|
|
@@ -2638,6 +2628,7 @@ var Layout2 = (props) => {
|
|
|
2638
2628
|
title,
|
|
2639
2629
|
items,
|
|
2640
2630
|
headerExtra,
|
|
2631
|
+
hideGameSelect,
|
|
2641
2632
|
children,
|
|
2642
2633
|
navWidth,
|
|
2643
2634
|
logoutRedirectUrl,
|
|
@@ -2649,7 +2640,6 @@ var Layout2 = (props) => {
|
|
|
2649
2640
|
} = theme3.useToken();
|
|
2650
2641
|
const usePermissionApiV2 = useToolkitsStore((state) => state.usePermissionApiV2);
|
|
2651
2642
|
const { collapsed, setCollapsed } = useLayoutStore();
|
|
2652
|
-
const { isGlobal } = useToolkitsStore((state) => state);
|
|
2653
2643
|
const onCollapse = async () => {
|
|
2654
2644
|
setCollapsed(!collapsed);
|
|
2655
2645
|
};
|
|
@@ -2697,7 +2687,7 @@ var Layout2 = (props) => {
|
|
|
2697
2687
|
onClick: onCollapse
|
|
2698
2688
|
}
|
|
2699
2689
|
),
|
|
2700
|
-
usePermissionApiV2 && !
|
|
2690
|
+
usePermissionApiV2 && !hideGameSelect && /* @__PURE__ */ jsx(GameSelect_default, { filter, onGameChange }),
|
|
2701
2691
|
headerExtra?.left?.map((extra) => /* @__PURE__ */ jsx("span", { children: extra.children }, extra.key))
|
|
2702
2692
|
] }),
|
|
2703
2693
|
/* @__PURE__ */ jsxs(Space, { size: "small", split: /* @__PURE__ */ jsx(Divider, { type: "vertical" }), children: [
|