com-angel-authorization 1.0.24 → 1.0.26
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/README.md +2 -1
- package/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +37 -14
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +4 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +37 -14
- package/dist/react/index.js.map +1 -1
- package/dist/vue/index.cjs +36 -12
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +4 -0
- package/dist/vue/index.d.ts +4 -0
- package/dist/vue/index.js +36 -12
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
package/dist/vue/index.d.cts
CHANGED
|
@@ -252,6 +252,8 @@ type MenuResource = {
|
|
|
252
252
|
/** 关联权限点名称(列表展示用,后端可能返回) */
|
|
253
253
|
permissionPointNames?: string[];
|
|
254
254
|
status: ResourceStatus;
|
|
255
|
+
/** 显示排序,数值越小越靠前 */
|
|
256
|
+
sort: number;
|
|
255
257
|
};
|
|
256
258
|
type MenuResourceFormValues = {
|
|
257
259
|
/** 上级菜单 ID;选择「无」时为 null */
|
|
@@ -263,6 +265,8 @@ type MenuResourceFormValues = {
|
|
|
263
265
|
identification: string;
|
|
264
266
|
permissionPointIds: string[];
|
|
265
267
|
status: ResourceStatus;
|
|
268
|
+
/** 显示排序 */
|
|
269
|
+
sort: number;
|
|
266
270
|
};
|
|
267
271
|
type CreateMenuResourceBody = MenuResourceFormValues & {
|
|
268
272
|
resourceId: string;
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -252,6 +252,8 @@ type MenuResource = {
|
|
|
252
252
|
/** 关联权限点名称(列表展示用,后端可能返回) */
|
|
253
253
|
permissionPointNames?: string[];
|
|
254
254
|
status: ResourceStatus;
|
|
255
|
+
/** 显示排序,数值越小越靠前 */
|
|
256
|
+
sort: number;
|
|
255
257
|
};
|
|
256
258
|
type MenuResourceFormValues = {
|
|
257
259
|
/** 上级菜单 ID;选择「无」时为 null */
|
|
@@ -263,6 +265,8 @@ type MenuResourceFormValues = {
|
|
|
263
265
|
identification: string;
|
|
264
266
|
permissionPointIds: string[];
|
|
265
267
|
status: ResourceStatus;
|
|
268
|
+
/** 显示排序 */
|
|
269
|
+
sort: number;
|
|
266
270
|
};
|
|
267
271
|
type CreateMenuResourceBody = MenuResourceFormValues & {
|
|
268
272
|
resourceId: string;
|
package/dist/vue/index.js
CHANGED
|
@@ -541,6 +541,9 @@ function mapMenuResource(item) {
|
|
|
541
541
|
const depth = Number.isFinite(parsedDepth) && parsedDepth > 0 ? Math.floor(parsedDepth) : parentId ? ROOT_MENU_DEPTH + 1 : ROOT_MENU_DEPTH;
|
|
542
542
|
const rawLeaf = row.leaf;
|
|
543
543
|
const leaf = rawLeaf === true || rawLeaf === 1 || rawLeaf === "1" || String(rawLeaf).toLowerCase() === "true" ? MENU_LEAF_YES : Number(rawLeaf) === MENU_LEAF_YES ? MENU_LEAF_YES : 0;
|
|
544
|
+
const rawSort = row.sort ?? row.order ?? row.sortOrder ?? row.sort_order;
|
|
545
|
+
const parsedSort = Number(rawSort);
|
|
546
|
+
const sort = Number.isFinite(parsedSort) ? Math.floor(parsedSort) : 0;
|
|
544
547
|
return {
|
|
545
548
|
resourceId: String(resourceId),
|
|
546
549
|
parentId,
|
|
@@ -551,7 +554,8 @@ function mapMenuResource(item) {
|
|
|
551
554
|
identification: String(row.identification ?? row.identity ?? row.path ?? ""),
|
|
552
555
|
permissionPointIds,
|
|
553
556
|
permissionPointNames,
|
|
554
|
-
status: toResourceStatus(row.status)
|
|
557
|
+
status: toResourceStatus(row.status),
|
|
558
|
+
sort
|
|
555
559
|
};
|
|
556
560
|
}
|
|
557
561
|
function isMenuLeaf(row) {
|
|
@@ -605,7 +609,8 @@ function buildCreateMenuBody(values, resourceId = getAppClientId()) {
|
|
|
605
609
|
name: values.name.trim(),
|
|
606
610
|
identification: values.identification.trim(),
|
|
607
611
|
permissionPointIds: [...values.permissionPointIds],
|
|
608
|
-
status: values.status
|
|
612
|
+
status: values.status,
|
|
613
|
+
sort: Number.isFinite(Number(values.sort)) ? Math.floor(Number(values.sort)) : 0
|
|
609
614
|
};
|
|
610
615
|
}
|
|
611
616
|
function buildUpdateMenuBody(values) {
|
|
@@ -617,7 +622,8 @@ function buildUpdateMenuBody(values) {
|
|
|
617
622
|
name: values.name.trim(),
|
|
618
623
|
identification: values.identification.trim(),
|
|
619
624
|
permissionPointIds: [...values.permissionPointIds],
|
|
620
|
-
status: values.status
|
|
625
|
+
status: values.status,
|
|
626
|
+
sort: Number.isFinite(Number(values.sort)) ? Math.floor(Number(values.sort)) : 0
|
|
621
627
|
};
|
|
622
628
|
}
|
|
623
629
|
function createAuthorizationResourceApi(request) {
|
|
@@ -1435,7 +1441,8 @@ function emptyForm2() {
|
|
|
1435
1441
|
name: "",
|
|
1436
1442
|
identification: "",
|
|
1437
1443
|
permissionPointIds: [],
|
|
1438
|
-
status: RESOURCE_STATUS_ENABLED
|
|
1444
|
+
status: RESOURCE_STATUS_ENABLED,
|
|
1445
|
+
sort: 0
|
|
1439
1446
|
};
|
|
1440
1447
|
}
|
|
1441
1448
|
var s2 = {
|
|
@@ -1660,6 +1667,11 @@ var s2 = {
|
|
|
1660
1667
|
boxSizing: "border-box",
|
|
1661
1668
|
width: "100%"
|
|
1662
1669
|
},
|
|
1670
|
+
inputReadonly: {
|
|
1671
|
+
backgroundColor: "#f9fafb",
|
|
1672
|
+
color: "#667085",
|
|
1673
|
+
cursor: "not-allowed"
|
|
1674
|
+
},
|
|
1663
1675
|
control: {
|
|
1664
1676
|
width: "16px",
|
|
1665
1677
|
height: "16px",
|
|
@@ -1859,7 +1871,8 @@ var MenuManager = defineComponent3({
|
|
|
1859
1871
|
name: row.name,
|
|
1860
1872
|
identification: row.identification,
|
|
1861
1873
|
permissionPointIds: [...row.permissionPointIds],
|
|
1862
|
-
status: row.status
|
|
1874
|
+
status: row.status,
|
|
1875
|
+
sort: Number.isFinite(row.sort) ? row.sort : 0
|
|
1863
1876
|
});
|
|
1864
1877
|
dialogOpen.value = true;
|
|
1865
1878
|
void loadPermissionPoints();
|
|
@@ -2135,14 +2148,10 @@ var MenuManager = defineComponent3({
|
|
|
2135
2148
|
h2(
|
|
2136
2149
|
"select",
|
|
2137
2150
|
{
|
|
2138
|
-
style: s2.input,
|
|
2151
|
+
style: { ...s2.input, ...s2.inputReadonly },
|
|
2139
2152
|
value: form.parentId ?? ROOT_PARENT_ID,
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
const parentId = value ? value : null;
|
|
2143
|
-
form.parentId = parentId;
|
|
2144
|
-
form.depth = resolveMenuDepth(parentId, allKnownMenus.value);
|
|
2145
|
-
}
|
|
2153
|
+
disabled: true,
|
|
2154
|
+
"aria-readonly": "true"
|
|
2146
2155
|
},
|
|
2147
2156
|
[
|
|
2148
2157
|
h2("option", { value: ROOT_PARENT_ID }, "\u65E0"),
|
|
@@ -2189,6 +2198,21 @@ var MenuManager = defineComponent3({
|
|
|
2189
2198
|
}
|
|
2190
2199
|
})
|
|
2191
2200
|
]),
|
|
2201
|
+
h2("label", { style: s2.field }, [
|
|
2202
|
+
h2("span", { style: s2.label }, "\u663E\u793A\u6392\u5E8F"),
|
|
2203
|
+
h2("input", {
|
|
2204
|
+
style: s2.input,
|
|
2205
|
+
type: "number",
|
|
2206
|
+
value: form.sort,
|
|
2207
|
+
placeholder: "\u6570\u503C\u8D8A\u5C0F\u8D8A\u9760\u524D",
|
|
2208
|
+
onInput: (e) => {
|
|
2209
|
+
const value = Number(
|
|
2210
|
+
e.target.value
|
|
2211
|
+
);
|
|
2212
|
+
form.sort = Number.isFinite(value) ? Math.floor(value) : 0;
|
|
2213
|
+
}
|
|
2214
|
+
})
|
|
2215
|
+
]),
|
|
2192
2216
|
h2("label", { style: s2.field }, [
|
|
2193
2217
|
h2("span", { style: s2.label }, "\u8BF7\u6C42\u5730\u5740"),
|
|
2194
2218
|
h2("input", {
|