@bit-sun/business-component 2.4.31-alpha.3 → 2.4.31-alpha.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/dist/index.esm.js +37 -20
- package/dist/index.js +37 -19
- package/dist/utils/auth.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +0 -1
- package/src/components/Business/BsLayouts/index.tsx +27 -13
- package/src/components/Business/BsLayouts/utils.tsx +2 -0
- package/src/components/Business/BsSulaQueryTable/index.tsx +2 -1
- package/src/components/Business/DetailPageWrapper/index.tsx +2 -1
- package/src/utils/auth.ts +6 -0
package/dist/index.esm.js
CHANGED
|
@@ -1515,6 +1515,11 @@ var handleJudgeAuthButtons = function handleJudgeAuthButtons(buttonCodeArray) {
|
|
|
1515
1515
|
});
|
|
1516
1516
|
return result;
|
|
1517
1517
|
};
|
|
1518
|
+
// 判断何时菜单权限和表格权限生效
|
|
1519
|
+
var shouldUseAuth = function shouldUseAuth() {
|
|
1520
|
+
// @ts-ignore
|
|
1521
|
+
return window.__POWERED_BY_WUJIE__ ? true : false;
|
|
1522
|
+
};
|
|
1518
1523
|
|
|
1519
1524
|
var css_248z$1 = ".luckysheet {\n overflow: hidden;\n}\n.luckysheet .luckysheet-work-area.luckysheet-noselected-text {\n display: none;\n}\n.sheet_table_top {\n height: 50px;\n background: #f2f2f2;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n border: 1px solid #d8d8d8;\n}\n.sheet_table_top .menu_item_text {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.sheet_table_footer {\n height: 50px;\n background: #f2f2f2;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n border: 1px solid #d8d8d8;\n}\n.sheet_table_text {\n color: #8f8f8f;\n}\n.sheet_table_dnd_text {\n background: #f2f2f2;\n border: 1px solid #d8d8d8;\n display: inline-block;\n width: 100px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n";
|
|
1520
1525
|
styleInject(css_248z$1);
|
|
@@ -12479,7 +12484,7 @@ var DetailWrapper = /*#__PURE__*/React$1.memo(function (_ref) {
|
|
|
12479
12484
|
var renderPageActionList = function renderPageActionList(actionLists) {
|
|
12480
12485
|
var authButton = localStorage.getItem(getMenuAuthDataKey()) ? JSON.parse(localStorage.getItem(getMenuAuthDataKey())) : [];
|
|
12481
12486
|
var visibleActions = actionLists.filter(function (action) {
|
|
12482
|
-
return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
|
|
12487
|
+
return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (!shouldUseAuth() || judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
|
|
12483
12488
|
return item === action.code;
|
|
12484
12489
|
}));
|
|
12485
12490
|
});
|
|
@@ -14121,7 +14126,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
14121
14126
|
if (Number(item.slice(-1)) >= 1) {
|
|
14122
14127
|
Item = item.substr(0, item.length - 1);
|
|
14123
14128
|
}
|
|
14124
|
-
if (!authButton.filter(function (itemInner) {
|
|
14129
|
+
if (shouldUseAuth() && !authButton.filter(function (itemInner) {
|
|
14125
14130
|
return Item === itemInner;
|
|
14126
14131
|
}).length) {
|
|
14127
14132
|
resourceCodeArray[item].visible = false;
|
|
@@ -14557,7 +14562,7 @@ var setMenuTreeData = function setMenuTreeData(routesData) {
|
|
|
14557
14562
|
routesData.splice(i, 1);
|
|
14558
14563
|
return 0; // continue
|
|
14559
14564
|
}
|
|
14560
|
-
if (routesData[i].code && authButton.every(function (item) {
|
|
14565
|
+
if (shouldUseAuth() && routesData[i].code && authButton.every(function (item) {
|
|
14561
14566
|
return routesData[i].code != item;
|
|
14562
14567
|
})) {
|
|
14563
14568
|
routesData.splice(i, 1);
|
|
@@ -15200,9 +15205,7 @@ var GlobalHeaderCom = function GlobalHeaderCom(props) {
|
|
|
15200
15205
|
deep(item.routes);
|
|
15201
15206
|
} else if (!item.hideInMenu && (name ? formatMessage({
|
|
15202
15207
|
id: "menu.".concat(item.name)
|
|
15203
|
-
}).indexOf(name) !== -1 : true)
|
|
15204
|
-
return d === item.code;
|
|
15205
|
-
})) {
|
|
15208
|
+
}).indexOf(name) !== -1 : true)) {
|
|
15206
15209
|
resultList.push(_objectSpread2(_objectSpread2({}, item), {}, {
|
|
15207
15210
|
fullPathName: getFullPathName(item.name)
|
|
15208
15211
|
}));
|
|
@@ -16780,19 +16783,33 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
16780
16783
|
data.forEach(function (node) {
|
|
16781
16784
|
if (node.routes && node.routes.length > 0) {
|
|
16782
16785
|
getTreeList(node.routes);
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16786
|
+
return;
|
|
16787
|
+
}
|
|
16788
|
+
// todo:暂时处理非wujie环境不做404管控
|
|
16789
|
+
if (!window.__POWERED_BY_WUJIE__) {
|
|
16790
|
+
treeList.push({
|
|
16791
|
+
tab: node.locale,
|
|
16792
|
+
key: node.path,
|
|
16793
|
+
locale: node.locale,
|
|
16794
|
+
closable: true,
|
|
16795
|
+
content: node.component,
|
|
16796
|
+
name: node.name,
|
|
16797
|
+
hideInMenu: node.hideInMenu,
|
|
16798
|
+
isOnlyOnePage: node.isOnlyOnePage
|
|
16799
|
+
});
|
|
16800
|
+
return;
|
|
16801
|
+
}
|
|
16802
|
+
if (node.path === '/' || getLimitedMenuPath(node) || getGenerateDocs(node)) {
|
|
16803
|
+
treeList.push({
|
|
16804
|
+
tab: node.locale,
|
|
16805
|
+
key: node.path,
|
|
16806
|
+
locale: node.locale,
|
|
16807
|
+
closable: true,
|
|
16808
|
+
content: node.component,
|
|
16809
|
+
name: node.name,
|
|
16810
|
+
hideInMenu: node.hideInMenu,
|
|
16811
|
+
isOnlyOnePage: node.isOnlyOnePage
|
|
16812
|
+
});
|
|
16796
16813
|
}
|
|
16797
16814
|
});
|
|
16798
16815
|
};
|
|
@@ -32772,4 +32789,4 @@ var index$8 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
32772
32789
|
})));
|
|
32773
32790
|
});
|
|
32774
32791
|
|
|
32775
|
-
export { AddSelect, AddSkcSelect, AddSkuSelect, AddSpuSelect, BillEntry, BsCascader, index$6 as BsLayout, BsSulaQueryTable, BusinessSearchSelect$1 as BusinessSearchSelect, BusinessTreeSearchSelect$1 as BusinessTreeSearchSelect, index$2 as CheckOneUser, ColumnSettingTable, CommodityEntry, DataImport, DataValidation, index$4 as DetailPageWrapper, EllipsisTooltip, ExportIcon, GuideWrapper, index$5 as HomePageWrapper, JsonQueryTable, index$7 as MoreTreeTable, QueryMutipleInput, RuleObjectComponent as RuleComponent, index$8 as RuleSetter, SearchSelect, index$3 as StateFlow, ColumnSettingSulaTable as SulaColumnSettingTable, TableColumnSetting, TreeSearchSelect, authFunc, checkQuantityAccuracy, downloadExcel, formatter, getAccountID, getAccountId, getConfigTableColumns, getCurrentTargetBgId, getCurrentTenantId, getDictionarySource, getEmployeeCode, getEmployeeId, getLastKey, getLimitMenuDataKey, getLocalStorageSaveKey, getMenuAuthDataKey, getSessionId, getTenantList, getUserId, getUserName, go2BackAndClose, handleAntdColumnsSpecialParams, handleBssulaColumnsSpecialParams, handleError, handleJudgeAuthButtons, handleRequestAuthHeader, handleRequestUrl, handleUserPhone, judgeIsEmpty, judgeIsRequestError, judgeIsRequestSuccess, memoizeOneFormatter, precisionQuantity, removeCurrentTenantId, removeTenantList, saveCurrentTenantId, saveTenantList, setConfigTableColumns, uuid };
|
|
32792
|
+
export { AddSelect, AddSkcSelect, AddSkuSelect, AddSpuSelect, BillEntry, BsCascader, index$6 as BsLayout, BsSulaQueryTable, BusinessSearchSelect$1 as BusinessSearchSelect, BusinessTreeSearchSelect$1 as BusinessTreeSearchSelect, index$2 as CheckOneUser, ColumnSettingTable, CommodityEntry, DataImport, DataValidation, index$4 as DetailPageWrapper, EllipsisTooltip, ExportIcon, GuideWrapper, index$5 as HomePageWrapper, JsonQueryTable, index$7 as MoreTreeTable, QueryMutipleInput, RuleObjectComponent as RuleComponent, index$8 as RuleSetter, SearchSelect, index$3 as StateFlow, ColumnSettingSulaTable as SulaColumnSettingTable, TableColumnSetting, TreeSearchSelect, authFunc, checkQuantityAccuracy, downloadExcel, formatter, getAccountID, getAccountId, getConfigTableColumns, getCurrentTargetBgId, getCurrentTenantId, getDictionarySource, getEmployeeCode, getEmployeeId, getLastKey, getLimitMenuDataKey, getLocalStorageSaveKey, getMenuAuthDataKey, getSessionId, getTenantList, getUserId, getUserName, go2BackAndClose, handleAntdColumnsSpecialParams, handleBssulaColumnsSpecialParams, handleError, handleJudgeAuthButtons, handleRequestAuthHeader, handleRequestUrl, handleUserPhone, judgeIsEmpty, judgeIsRequestError, judgeIsRequestSuccess, memoizeOneFormatter, precisionQuantity, removeCurrentTenantId, removeTenantList, saveCurrentTenantId, saveTenantList, setConfigTableColumns, shouldUseAuth, uuid };
|
package/dist/index.js
CHANGED
|
@@ -1535,6 +1535,11 @@ var handleJudgeAuthButtons = function handleJudgeAuthButtons(buttonCodeArray) {
|
|
|
1535
1535
|
});
|
|
1536
1536
|
return result;
|
|
1537
1537
|
};
|
|
1538
|
+
// 判断何时菜单权限和表格权限生效
|
|
1539
|
+
var shouldUseAuth = function shouldUseAuth() {
|
|
1540
|
+
// @ts-ignore
|
|
1541
|
+
return window.__POWERED_BY_WUJIE__ ? true : false;
|
|
1542
|
+
};
|
|
1538
1543
|
|
|
1539
1544
|
var css_248z$1 = ".luckysheet {\n overflow: hidden;\n}\n.luckysheet .luckysheet-work-area.luckysheet-noselected-text {\n display: none;\n}\n.sheet_table_top {\n height: 50px;\n background: #f2f2f2;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n border: 1px solid #d8d8d8;\n}\n.sheet_table_top .menu_item_text {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.sheet_table_footer {\n height: 50px;\n background: #f2f2f2;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n border: 1px solid #d8d8d8;\n}\n.sheet_table_text {\n color: #8f8f8f;\n}\n.sheet_table_dnd_text {\n background: #f2f2f2;\n border: 1px solid #d8d8d8;\n display: inline-block;\n width: 100px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n";
|
|
1540
1545
|
styleInject(css_248z$1);
|
|
@@ -12499,7 +12504,7 @@ var DetailWrapper = /*#__PURE__*/React__default['default'].memo(function (_ref)
|
|
|
12499
12504
|
var renderPageActionList = function renderPageActionList(actionLists) {
|
|
12500
12505
|
var authButton = localStorage.getItem(getMenuAuthDataKey()) ? JSON.parse(localStorage.getItem(getMenuAuthDataKey())) : [];
|
|
12501
12506
|
var visibleActions = actionLists.filter(function (action) {
|
|
12502
|
-
return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
|
|
12507
|
+
return (action.visible && action.visible !== 'false' || judgeIsEmpty$1(action.visible)) && (!shouldUseAuth() || judgeIsEmpty$1(action.code) || authButton.filter(function (item) {
|
|
12503
12508
|
return item === action.code;
|
|
12504
12509
|
}));
|
|
12505
12510
|
});
|
|
@@ -14141,7 +14146,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
14141
14146
|
if (Number(item.slice(-1)) >= 1) {
|
|
14142
14147
|
Item = item.substr(0, item.length - 1);
|
|
14143
14148
|
}
|
|
14144
|
-
if (!authButton.filter(function (itemInner) {
|
|
14149
|
+
if (shouldUseAuth() && !authButton.filter(function (itemInner) {
|
|
14145
14150
|
return Item === itemInner;
|
|
14146
14151
|
}).length) {
|
|
14147
14152
|
resourceCodeArray[item].visible = false;
|
|
@@ -14577,7 +14582,7 @@ var setMenuTreeData = function setMenuTreeData(routesData) {
|
|
|
14577
14582
|
routesData.splice(i, 1);
|
|
14578
14583
|
return 0; // continue
|
|
14579
14584
|
}
|
|
14580
|
-
if (routesData[i].code && authButton.every(function (item) {
|
|
14585
|
+
if (shouldUseAuth() && routesData[i].code && authButton.every(function (item) {
|
|
14581
14586
|
return routesData[i].code != item;
|
|
14582
14587
|
})) {
|
|
14583
14588
|
routesData.splice(i, 1);
|
|
@@ -15220,9 +15225,7 @@ var GlobalHeaderCom = function GlobalHeaderCom(props) {
|
|
|
15220
15225
|
deep(item.routes);
|
|
15221
15226
|
} else if (!item.hideInMenu && (name ? umi.formatMessage({
|
|
15222
15227
|
id: "menu.".concat(item.name)
|
|
15223
|
-
}).indexOf(name) !== -1 : true)
|
|
15224
|
-
return d === item.code;
|
|
15225
|
-
})) {
|
|
15228
|
+
}).indexOf(name) !== -1 : true)) {
|
|
15226
15229
|
resultList.push(_objectSpread2(_objectSpread2({}, item), {}, {
|
|
15227
15230
|
fullPathName: getFullPathName(item.name)
|
|
15228
15231
|
}));
|
|
@@ -16800,19 +16803,33 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
16800
16803
|
data.forEach(function (node) {
|
|
16801
16804
|
if (node.routes && node.routes.length > 0) {
|
|
16802
16805
|
getTreeList(node.routes);
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16806
|
+
return;
|
|
16807
|
+
}
|
|
16808
|
+
// todo:暂时处理非wujie环境不做404管控
|
|
16809
|
+
if (!window.__POWERED_BY_WUJIE__) {
|
|
16810
|
+
treeList.push({
|
|
16811
|
+
tab: node.locale,
|
|
16812
|
+
key: node.path,
|
|
16813
|
+
locale: node.locale,
|
|
16814
|
+
closable: true,
|
|
16815
|
+
content: node.component,
|
|
16816
|
+
name: node.name,
|
|
16817
|
+
hideInMenu: node.hideInMenu,
|
|
16818
|
+
isOnlyOnePage: node.isOnlyOnePage
|
|
16819
|
+
});
|
|
16820
|
+
return;
|
|
16821
|
+
}
|
|
16822
|
+
if (node.path === '/' || getLimitedMenuPath(node) || getGenerateDocs(node)) {
|
|
16823
|
+
treeList.push({
|
|
16824
|
+
tab: node.locale,
|
|
16825
|
+
key: node.path,
|
|
16826
|
+
locale: node.locale,
|
|
16827
|
+
closable: true,
|
|
16828
|
+
content: node.component,
|
|
16829
|
+
name: node.name,
|
|
16830
|
+
hideInMenu: node.hideInMenu,
|
|
16831
|
+
isOnlyOnePage: node.isOnlyOnePage
|
|
16832
|
+
});
|
|
16816
16833
|
}
|
|
16817
16834
|
});
|
|
16818
16835
|
};
|
|
@@ -32860,4 +32877,5 @@ exports.removeTenantList = removeTenantList;
|
|
|
32860
32877
|
exports.saveCurrentTenantId = saveCurrentTenantId;
|
|
32861
32878
|
exports.saveTenantList = saveTenantList;
|
|
32862
32879
|
exports.setConfigTableColumns = setConfigTableColumns;
|
|
32880
|
+
exports.shouldUseAuth = shouldUseAuth;
|
|
32863
32881
|
exports.uuid = uuid;
|
package/dist/utils/auth.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -621,19 +621,33 @@ class BasicLayout extends React.PureComponent {
|
|
|
621
621
|
data.forEach((node) => {
|
|
622
622
|
if (node.routes && node.routes.length > 0) {
|
|
623
623
|
getTreeList(node.routes);
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
// todo:暂时处理非wujie环境不做404管控
|
|
627
|
+
if (!window.__POWERED_BY_WUJIE__) {
|
|
628
|
+
treeList.push({
|
|
629
|
+
tab: node.locale,
|
|
630
|
+
key: node.path,
|
|
631
|
+
locale: node.locale,
|
|
632
|
+
closable: true,
|
|
633
|
+
content: node.component,
|
|
634
|
+
name: node.name,
|
|
635
|
+
hideInMenu: node.hideInMenu,
|
|
636
|
+
isOnlyOnePage: node.isOnlyOnePage,
|
|
637
|
+
});
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
if (node.path === '/' || getLimitedMenuPath(node) || getGenerateDocs(node)) {
|
|
641
|
+
treeList.push({
|
|
642
|
+
tab: node.locale,
|
|
643
|
+
key: node.path,
|
|
644
|
+
locale: node.locale,
|
|
645
|
+
closable: true,
|
|
646
|
+
content: node.component,
|
|
647
|
+
name: node.name,
|
|
648
|
+
hideInMenu: node.hideInMenu,
|
|
649
|
+
isOnlyOnePage: node.isOnlyOnePage,
|
|
650
|
+
});
|
|
637
651
|
}
|
|
638
652
|
});
|
|
639
653
|
};
|
|
@@ -3,6 +3,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
3
3
|
import memoizeOne from 'memoize-one';
|
|
4
4
|
import { getMenuAuthDataKey } from '@/utils/LocalstorageUtils'
|
|
5
5
|
import { history } from 'umi';
|
|
6
|
+
import { shouldUseAuth } from '@/utils';
|
|
6
7
|
|
|
7
8
|
const cache = {};
|
|
8
9
|
const cacheLimit = 10000;
|
|
@@ -122,6 +123,7 @@ export const setMenuTreeData = (routesData: Array<any>) => {
|
|
|
122
123
|
continue;
|
|
123
124
|
}
|
|
124
125
|
if (
|
|
126
|
+
shouldUseAuth() &&
|
|
125
127
|
routesData[i].code &&
|
|
126
128
|
authButton.every((item) => {
|
|
127
129
|
return routesData[i].code != item;
|
|
@@ -20,6 +20,7 @@ import ExportIcon from '@/components/Functional/ExportFunctions/ExportIcon';
|
|
|
20
20
|
import ENUM from '@/utils/enumConfig';
|
|
21
21
|
import { handleBssulaColumnsSpecialParams } from '@/utils/utils';
|
|
22
22
|
import { getMenuAuthDataKey } from '@/utils/LocalstorageUtils';
|
|
23
|
+
import { shouldUseAuth } from '@/utils';
|
|
23
24
|
|
|
24
25
|
const MemoQueryTable = React.memo(QueryTable);
|
|
25
26
|
|
|
@@ -177,7 +178,7 @@ export default (props: any) => {
|
|
|
177
178
|
if (Number(item.slice(-1)) >= 1) {
|
|
178
179
|
Item = item.substr(0, item.length - 1);
|
|
179
180
|
}
|
|
180
|
-
if (!authButton.filter((itemInner: any) => Item === itemInner).length) {
|
|
181
|
+
if (shouldUseAuth() && !authButton.filter((itemInner: any) => Item === itemInner).length) {
|
|
181
182
|
resourceCodeArray[item].visible = false;
|
|
182
183
|
}
|
|
183
184
|
});
|
|
@@ -17,6 +17,7 @@ import moreIcon from '../../../assets/btn-more.svg';
|
|
|
17
17
|
import { useLocation, formatMessage } from 'umi';
|
|
18
18
|
import CommonAlert from '../CommonAlert';
|
|
19
19
|
import { getMenuAuthDataKey, getLimitMenuDataKey } from '@/utils/LocalstorageUtils';
|
|
20
|
+
import { shouldUseAuth } from '@/utils';
|
|
20
21
|
|
|
21
22
|
interface actionItem {
|
|
22
23
|
type?: string;
|
|
@@ -154,7 +155,7 @@ const DetailWrapper = React.memo(
|
|
|
154
155
|
let visibleActions = actionLists.filter(
|
|
155
156
|
(action) =>
|
|
156
157
|
((action.visible && action.visible !== 'false') || judgeIsEmpty(action.visible)) &&
|
|
157
|
-
(judgeIsEmpty(action.code) || authButton.filter(item => item === action.code)),
|
|
158
|
+
(!shouldUseAuth() || (judgeIsEmpty(action.code) || authButton.filter(item => item === action.code))),
|
|
158
159
|
);
|
|
159
160
|
|
|
160
161
|
const renderButton = (item: actionItem, type?: any) => {
|
package/src/utils/auth.ts
CHANGED