@steedos-widgets/amis-object 1.1.9 → 1.1.10
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/dist/amis/AmisAppMenu.d.ts +8 -7
- package/dist/amis-object.cjs.js +29 -19
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.js +29 -19
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.js +29 -19
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +11 -11
- package/package.json +3 -3
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import './AmisAppMenu.less';
|
|
2
2
|
export declare const AmisAppMenu: (props: any) => Promise<{
|
|
3
3
|
type: string;
|
|
4
|
-
|
|
5
|
-
stacked: any;
|
|
6
|
-
overflow: any;
|
|
7
|
-
indentSize: any;
|
|
8
|
-
links: any;
|
|
9
|
-
source: {
|
|
4
|
+
schemaApi: {
|
|
10
5
|
method: string;
|
|
11
6
|
url: string;
|
|
12
7
|
adaptor: string;
|
|
13
8
|
headers: {
|
|
14
9
|
Authorization: string;
|
|
15
10
|
};
|
|
16
|
-
sendOn: string;
|
|
17
11
|
};
|
|
12
|
+
} | {
|
|
13
|
+
type: string;
|
|
14
|
+
className: string;
|
|
15
|
+
stacked: any;
|
|
16
|
+
overflow: any;
|
|
17
|
+
indentSize: any;
|
|
18
|
+
links: any;
|
|
18
19
|
}>;
|
package/dist/amis-object.cjs.js
CHANGED
|
@@ -12759,31 +12759,37 @@ var AmisLogo = function (props) { return __awaiter(void 0, void 0, void 0, funct
|
|
|
12759
12759
|
}); };
|
|
12760
12760
|
|
|
12761
12761
|
var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12762
|
-
var _a, stacked, overflow, appId, data, _b, links, _c, showIcon, _d, className, _e, indentSize, selectedId;
|
|
12762
|
+
var _a, stacked, overflow, appId, data, _b, links, _c, showIcon, _d, className, _e, indentSize, selectedId, schema;
|
|
12763
12763
|
return __generator(this, function (_f) {
|
|
12764
12764
|
_a = props.stacked, stacked = _a === void 0 ? false : _a, overflow = props.overflow, appId = props.appId, data = props.data, _b = props.links, links = _b === void 0 ? null : _b, _c = props.showIcon, showIcon = _c === void 0 ? true : _c, _d = props.className, className = _d === void 0 ? '' : _d, _e = props.indentSize, indentSize = _e === void 0 ? 12 : _e, selectedId = props.selectedId;
|
|
12765
12765
|
if (!appId) {
|
|
12766
12766
|
appId = data.context.appId || 'admin';
|
|
12767
12767
|
}
|
|
12768
12768
|
// console.log(`AmisAppMenu appId`, appId)
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
},
|
|
12786
|
-
|
|
12769
|
+
console.log("AmisAppMenu", appId, props);
|
|
12770
|
+
if (links) {
|
|
12771
|
+
return [2 /*return*/, {
|
|
12772
|
+
"type": "nav",
|
|
12773
|
+
className: "".concat(className),
|
|
12774
|
+
"stacked": stacked,
|
|
12775
|
+
"overflow": overflow,
|
|
12776
|
+
"indentSize": indentSize,
|
|
12777
|
+
"links": links
|
|
12778
|
+
}];
|
|
12779
|
+
}
|
|
12780
|
+
schema = {
|
|
12781
|
+
type: 'service',
|
|
12782
|
+
schemaApi: {
|
|
12783
|
+
"method": "get",
|
|
12784
|
+
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?try=1111111"),
|
|
12785
|
+
"adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n });\n })\n }\n payload.data = {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"links\": data.nav,\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
|
|
12786
|
+
"headers": {
|
|
12787
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
12788
|
+
}
|
|
12789
|
+
}
|
|
12790
|
+
};
|
|
12791
|
+
console.log("schema=====>", schema);
|
|
12792
|
+
return [2 /*return*/, schema];
|
|
12787
12793
|
});
|
|
12788
12794
|
}); };
|
|
12789
12795
|
|
|
@@ -13035,6 +13041,10 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
13035
13041
|
"color": "#FFFFFF"
|
|
13036
13042
|
},
|
|
13037
13043
|
size: 30
|
|
13044
|
+
},
|
|
13045
|
+
{
|
|
13046
|
+
"type": "tpl",
|
|
13047
|
+
"tpl": "<span class=\"hidden-xs user-name text-overflow\" style=\"height: 30px;line-height: 30px;font-size: 16px;font-weight: bold;margin-left: 10px;\">${global.user.name}<i class=\"fa fa-angle-down\" style=\"margin-left: 4px;\"></i></span>"
|
|
13038
13048
|
}
|
|
13039
13049
|
],
|
|
13040
13050
|
"overlay": [
|