fan-standard-comp 3.1.3 → 3.1.4
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/package.json +1 -1
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -597
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +0 -2
- package/es/ButtonGroup/ButtonList.js +0 -37
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -38
- package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/es/ButtonGroup/PopConfirmTitle.js +0 -37
- package/es/ButtonGroup/index.d.ts +0 -30
- package/es/ButtonGroup/index.js +0 -374
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/DragContent/DragBar.js +0 -21
- package/es/DragContent/index.d.ts +0 -14
- package/es/DragContent/index.js +0 -173
- package/es/DragContent/index.less +0 -44
- package/es/FormComp/ChunkUploader/api.js +0 -76
- package/es/FormComp/ChunkUploader/index.js +0 -391
- package/es/FormComp/ChunkUploader/lib.js +0 -96
- package/es/FormComp/ChunkUploader/style/style.less +0 -3
- package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
- package/es/FormComp/ChunkUploader/worker.js +0 -23
- package/es/FormComp/EditButton/index.d.ts +0 -26
- package/es/FormComp/EditButton/index.js +0 -140
- package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/es/FormComp/FieldComponent/ReUpload.js +0 -131
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -251
- package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/es/FormComp/FieldComponent/TitleNode.js +0 -9
- package/es/FormComp/FieldComponent/index.d.ts +0 -38
- package/es/FormComp/FieldComponent/index.js +0 -413
- package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
- package/es/FormComp/FieldComponent/style/index.less +0 -116
- package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/es/FormComp/RenderItemGroup/index.js +0 -234
- package/es/FormComp/Uploader/index.d.ts +0 -19
- package/es/FormComp/Uploader/index.js +0 -275
- package/es/FormComp/Uploader/style/index.less +0 -14
- package/es/FormComp/Uploader/util.d.ts +0 -8
- package/es/FormComp/Uploader/util.js +0 -38
- package/es/FormComp/VarTemplate/index.js +0 -293
- package/es/FormComp/index.d.ts +0 -1
- package/es/FormComp/index.js +0 -1
- package/es/NavLeafScroll/index.js +0 -379
- package/es/NavLeafScroll/style/index.less +0 -119
- package/es/RefactorTree/data.d.ts +0 -7
- package/es/RefactorTree/index.d.ts +0 -40
- package/es/RefactorTree/index.js +0 -167
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -237
- package/es/RefactorTree/style/index.d.ts +0 -1
- package/es/RefactorTree/style/index.js +0 -1
- package/es/RefactorTree/style/index.less +0 -22
- package/es/RefactorTree/util.d.ts +0 -42
- package/es/RefactorTree/util.js +0 -187
- package/es/SpecIcon/fonts/demo.css +0 -539
- package/es/SpecIcon/fonts/demo_index.html +0 -1315
- package/es/SpecIcon/fonts/iconfont.css +0 -211
- package/es/SpecIcon/fonts/iconfont.eot +0 -0
- package/es/SpecIcon/fonts/iconfont.js +0 -41
- package/es/SpecIcon/fonts/iconfont.json +0 -352
- package/es/SpecIcon/fonts/iconfont.svg +0 -173
- package/es/SpecIcon/fonts/iconfont.ttf +0 -0
- package/es/SpecIcon/fonts/iconfont.woff +0 -0
- package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/es/SpecIcon/index.d.ts +0 -17
- package/es/SpecIcon/index.js +0 -77
- package/es/SpecIcon/style/iconfont.less +0 -213
- package/es/SpecIcon/style/index.less +0 -98
- package/es/SplitterLayout/Pane.d.ts +0 -13
- package/es/SplitterLayout/Pane.js +0 -36
- package/es/SplitterLayout/index.js +0 -375
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SplitterLayout/Pane.js +0 -50
- package/es/StandardContent/SplitterLayout/index.js +0 -374
- package/es/StandardContent/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SubfieldContent.d.ts +0 -17
- package/es/StandardContent/SubfieldContent.js +0 -41
- package/es/StandardContent/WrapperContent.d.ts +0 -13
- package/es/StandardContent/WrapperContent.js +0 -29
- package/es/StandardContent/data.d.ts +0 -101
- package/es/StandardContent/style/index.less +0 -80
- package/es/StandardDragModal/index.d.ts +0 -11
- package/es/StandardDragModal/index.js +0 -30
- package/es/StandardFilter/index.d.ts +0 -35
- package/es/StandardFilter/index.js +0 -253
- package/es/StandardFilter/style/index.less +0 -62
- package/es/StandardForm/ActionList.js +0 -44
- package/es/StandardForm/StepForm.d.ts +0 -19
- package/es/StandardForm/StepForm.js +0 -267
- package/es/StandardForm/TabForm.d.ts +0 -19
- package/es/StandardForm/TabForm.js +0 -122
- package/es/StandardForm/index.d.ts +0 -32
- package/es/StandardForm/index.js +0 -170
- package/es/StandardForm/style/index.less +0 -58
- package/es/StandardModal/UpdateFormRef.js +0 -18
- package/es/StandardModal/index.d.ts +0 -44
- package/es/StandardModal/index.js +0 -495
- package/es/StandardModal/style/index.less +0 -50
- package/es/StandardPanel/index.d.ts +0 -28
- package/es/StandardPanel/index.js +0 -134
- package/es/StandardPanel/style/index.less +0 -135
- package/es/StandardTable/index.d.ts +0 -22
- package/es/StandardTable/index.js +0 -126
- package/es/StandardTable/style/index.d.ts +0 -1
- package/es/StandardTable/style/index.js +0 -1
- package/es/StandardTable/style/index.less +0 -206
- package/es/components/IconNode/index.d.ts +0 -16
- package/es/components/IconNode/index.js +0 -28
- package/es/components/index.d.ts +0 -2
- package/es/components/index.js +0 -2
- package/es/data/func.code.js +0 -112
- package/es/data/general.config.js +0 -172
- package/es/data/index.js +0 -3
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -31
- package/es/styles/index.less +0 -0
- package/es/theme/spec-variable.less +0 -48
- package/es/utils/ValueFormat.js +0 -50
- package/es/utils/filterPermission.js +0 -111
- package/es/utils/getParentNodes.js +0 -215
- package/es/utils/index.js +0 -3
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -55
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -51
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
- package/lib/ButtonGroup/index.d.ts +0 -30
- package/lib/ButtonGroup/index.js +0 -405
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/DragContent/DragBar.js +0 -33
- package/lib/DragContent/index.d.ts +0 -14
- package/lib/DragContent/index.js +0 -191
- package/lib/DragContent/index.less +0 -44
- package/lib/FormComp/ChunkUploader/api.js +0 -89
- package/lib/FormComp/ChunkUploader/index.js +0 -410
- package/lib/FormComp/ChunkUploader/lib.js +0 -113
- package/lib/FormComp/ChunkUploader/style/style.less +0 -3
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
- package/lib/FormComp/ChunkUploader/worker.js +0 -28
- package/lib/FormComp/EditButton/index.d.ts +0 -26
- package/lib/FormComp/EditButton/index.js +0 -159
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -274
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
- package/lib/FormComp/FieldComponent/index.d.ts +0 -38
- package/lib/FormComp/FieldComponent/index.js +0 -457
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
- package/lib/FormComp/FieldComponent/style/index.less +0 -116
- package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/lib/FormComp/RenderItemGroup/index.js +0 -255
- package/lib/FormComp/Uploader/index.d.ts +0 -19
- package/lib/FormComp/Uploader/index.js +0 -301
- package/lib/FormComp/Uploader/style/index.less +0 -14
- package/lib/FormComp/Uploader/util.d.ts +0 -8
- package/lib/FormComp/Uploader/util.js +0 -47
- package/lib/FormComp/VarTemplate/index.js +0 -308
- package/lib/FormComp/index.d.ts +0 -1
- package/lib/FormComp/index.js +0 -15
- package/lib/NavLeafScroll/index.js +0 -397
- package/lib/NavLeafScroll/style/index.less +0 -119
- package/lib/RefactorTree/data.d.ts +0 -7
- package/lib/RefactorTree/index.d.ts +0 -40
- package/lib/RefactorTree/index.js +0 -190
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -260
- package/lib/RefactorTree/style/index.d.ts +0 -1
- package/lib/RefactorTree/style/index.js +0 -3
- package/lib/RefactorTree/style/index.less +0 -22
- package/lib/RefactorTree/util.d.ts +0 -42
- package/lib/RefactorTree/util.js +0 -195
- package/lib/SpecIcon/fonts/demo.css +0 -539
- package/lib/SpecIcon/fonts/demo_index.html +0 -1315
- package/lib/SpecIcon/fonts/iconfont.css +0 -211
- package/lib/SpecIcon/fonts/iconfont.eot +0 -0
- package/lib/SpecIcon/fonts/iconfont.js +0 -43
- package/lib/SpecIcon/fonts/iconfont.json +0 -352
- package/lib/SpecIcon/fonts/iconfont.svg +0 -173
- package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/lib/SpecIcon/index.d.ts +0 -17
- package/lib/SpecIcon/index.js +0 -90
- package/lib/SpecIcon/style/iconfont.less +0 -213
- package/lib/SpecIcon/style/index.less +0 -98
- package/lib/SplitterLayout/Pane.d.ts +0 -13
- package/lib/SplitterLayout/Pane.js +0 -48
- package/lib/SplitterLayout/index.js +0 -386
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
- package/lib/StandardContent/SplitterLayout/index.js +0 -387
- package/lib/StandardContent/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SubfieldContent.d.ts +0 -17
- package/lib/StandardContent/SubfieldContent.js +0 -56
- package/lib/StandardContent/WrapperContent.d.ts +0 -13
- package/lib/StandardContent/WrapperContent.js +0 -43
- package/lib/StandardContent/data.d.ts +0 -101
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/StandardDragModal/index.d.ts +0 -11
- package/lib/StandardDragModal/index.js +0 -43
- package/lib/StandardFilter/index.d.ts +0 -35
- package/lib/StandardFilter/index.js +0 -272
- package/lib/StandardFilter/style/index.less +0 -62
- package/lib/StandardForm/ActionList.js +0 -57
- package/lib/StandardForm/StepForm.d.ts +0 -19
- package/lib/StandardForm/StepForm.js +0 -295
- package/lib/StandardForm/TabForm.d.ts +0 -19
- package/lib/StandardForm/TabForm.js +0 -148
- package/lib/StandardForm/index.d.ts +0 -32
- package/lib/StandardForm/index.js +0 -197
- package/lib/StandardForm/style/index.less +0 -58
- package/lib/StandardModal/UpdateFormRef.js +0 -32
- package/lib/StandardModal/index.d.ts +0 -44
- package/lib/StandardModal/index.js +0 -525
- package/lib/StandardModal/style/index.less +0 -50
- package/lib/StandardPanel/index.d.ts +0 -28
- package/lib/StandardPanel/index.js +0 -155
- package/lib/StandardPanel/style/index.less +0 -135
- package/lib/StandardTable/index.d.ts +0 -22
- package/lib/StandardTable/index.js +0 -143
- package/lib/StandardTable/style/index.d.ts +0 -1
- package/lib/StandardTable/style/index.js +0 -3
- package/lib/StandardTable/style/index.less +0 -206
- package/lib/components/IconNode/index.d.ts +0 -16
- package/lib/components/IconNode/index.js +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/components/index.js +0 -15
- package/lib/data/func.code.js +0 -119
- package/lib/data/general.config.js +0 -179
- package/lib/data/index.js +0 -23
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -236
- package/lib/styles/index.less +0 -0
- package/lib/theme/spec-variable.less +0 -48
- package/lib/utils/ValueFormat.js +0 -58
- package/lib/utils/filterPermission.js +0 -127
- package/lib/utils/getParentNodes.js +0 -226
- package/lib/utils/index.js +0 -35
package/lib/utils/ValueFormat.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* 工具类: 表单组控件值格式转换工具
|
|
10
|
-
* @params {Object} fieldsValue: 表单组内的控件值
|
|
11
|
-
* @params {Array} formItemGroup: 表单组
|
|
12
|
-
* */
|
|
13
|
-
var UtilValueFormat = function UtilValueFormat(fieldsValue, formItemGroup) {
|
|
14
|
-
formItemGroup && formItemGroup.forEach(function (item) {
|
|
15
|
-
var _item$protoConfig, _fieldsValue$item$fil, _item$protoConfig2, _fieldsValue$item$fil2, _item$protoConfig3, _fieldsValue$item$fil3, _item$protoConfig4;
|
|
16
|
-
|
|
17
|
-
if (!fieldsValue[item.filedName]) return;
|
|
18
|
-
|
|
19
|
-
switch (item.type) {
|
|
20
|
-
case 'datePicker':
|
|
21
|
-
case 'dateTimePicker':
|
|
22
|
-
case 'rangePicker':
|
|
23
|
-
case 'rangeTimePicker':
|
|
24
|
-
var pickerFormatNew;
|
|
25
|
-
|
|
26
|
-
if (item === null || item === void 0 ? void 0 : (_item$protoConfig = item.protoConfig) === null || _item$protoConfig === void 0 ? void 0 : _item$protoConfig.picker) {
|
|
27
|
-
switch (item.protoConfig.picker) {
|
|
28
|
-
case 'week':
|
|
29
|
-
pickerFormatNew = 'YYYY-wo';
|
|
30
|
-
break;
|
|
31
|
-
|
|
32
|
-
case 'month':
|
|
33
|
-
pickerFormatNew = 'MM月';
|
|
34
|
-
break;
|
|
35
|
-
|
|
36
|
-
case 'year':
|
|
37
|
-
pickerFormatNew = 'YYYY';
|
|
38
|
-
break;
|
|
39
|
-
|
|
40
|
-
default:
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
pickerFormatNew = item.type === 'datePicker' || item.type === 'rangePicker' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
fieldsValue[item.filedName] = item.type === 'datePicker' || item.type === 'dateTimePicker' ? (_fieldsValue$item$fil = fieldsValue[item.filedName]) === null || _fieldsValue$item$fil === void 0 ? void 0 : _fieldsValue$item$fil.format((item === null || item === void 0 ? void 0 : (_item$protoConfig2 = item.protoConfig) === null || _item$protoConfig2 === void 0 ? void 0 : _item$protoConfig2.format) || pickerFormatNew) : [(_fieldsValue$item$fil2 = fieldsValue[item.filedName][0]) === null || _fieldsValue$item$fil2 === void 0 ? void 0 : _fieldsValue$item$fil2.format((item === null || item === void 0 ? void 0 : (_item$protoConfig3 = item.protoConfig) === null || _item$protoConfig3 === void 0 ? void 0 : _item$protoConfig3.format) || pickerFormatNew), (_fieldsValue$item$fil3 = fieldsValue[item.filedName][1]) === null || _fieldsValue$item$fil3 === void 0 ? void 0 : _fieldsValue$item$fil3.format((item === null || item === void 0 ? void 0 : (_item$protoConfig4 = item.protoConfig) === null || _item$protoConfig4 === void 0 ? void 0 : _item$protoConfig4.format) || pickerFormatNew)];
|
|
48
|
-
break;
|
|
49
|
-
|
|
50
|
-
default:
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return fieldsValue;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var _default = UtilValueFormat;
|
|
58
|
-
exports.default = _default;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.btnClickFunc = exports.btnIsDisabled = exports.btnIsHide = exports.removeNoPermission = void 0;
|
|
7
|
-
|
|
8
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
15
|
-
|
|
16
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
|
|
18
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
19
|
-
|
|
20
|
-
// 按钮方法
|
|
21
|
-
var btnClickFunc = function btnClickFunc(fn) {
|
|
22
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
23
|
-
if (!fn) return null;
|
|
24
|
-
var paramsArr = [];
|
|
25
|
-
|
|
26
|
-
if (_typeof(params) === 'object') {
|
|
27
|
-
Object.keys(params).map(function (item) {
|
|
28
|
-
paramsArr.push(params[item]);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (typeof fn === 'function') {
|
|
33
|
-
return fn.apply(void 0, paramsArr); // 表格列返回的是方法
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return fn;
|
|
37
|
-
}; // 按钮是否禁用
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
exports.btnClickFunc = btnClickFunc;
|
|
41
|
-
|
|
42
|
-
var btnIsDisabled = function btnIsDisabled(isDisabled) {
|
|
43
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
44
|
-
if (!isDisabled) return false;
|
|
45
|
-
var paramsArr = [];
|
|
46
|
-
|
|
47
|
-
if (_typeof(params) === 'object') {
|
|
48
|
-
Object.keys(params).map(function (item) {
|
|
49
|
-
paramsArr.push(params[item]);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (typeof isDisabled === 'function') {
|
|
54
|
-
return isDisabled.apply(void 0, paramsArr); // 表格列返回的是方法
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return isDisabled;
|
|
58
|
-
}; // 按钮是否隐藏
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
exports.btnIsDisabled = btnIsDisabled;
|
|
62
|
-
|
|
63
|
-
var btnIsHide = function btnIsHide(isHide) {
|
|
64
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
65
|
-
if (!isHide) return false;
|
|
66
|
-
var paramsArr = [];
|
|
67
|
-
|
|
68
|
-
if (_typeof(params) === 'object') {
|
|
69
|
-
Object.keys(params).map(function (item) {
|
|
70
|
-
paramsArr.push(params[item]);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (typeof isHide === 'function') {
|
|
75
|
-
return isHide.apply(void 0, paramsArr); // 表格列返回的是方法
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return isHide;
|
|
79
|
-
}; // 重新组合数据(排除不包含在permissionCodes内及isHide数据
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
exports.btnIsHide = btnIsHide;
|
|
83
|
-
|
|
84
|
-
var removeNoPermission = function removeNoPermission(array, permissionCodes, codes, params) {
|
|
85
|
-
return Array.isArray(array) && array.filter(function (item) {
|
|
86
|
-
if (item.children) {
|
|
87
|
-
item.children = removeNoPermission(item.children, permissionCodes, codes, params);
|
|
88
|
-
if (item.children.length === 0) return false; // 如果子集合过滤为空时,不返当前数据
|
|
89
|
-
} // permissionCodes未定义,则直接返回不进行过滤
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (item.hasOwnProperty('code') && permissionCodes) {
|
|
93
|
-
// if (!permissionCodes) return true // permissionCodes未定义,则直接返回不进行过滤
|
|
94
|
-
// 判断是否包含 'code'字段,如果包含则先过滤有在 permissionCodes内的(permissionCodes数组为0时,也不返回数据)
|
|
95
|
-
// 并用是不隐藏的条件
|
|
96
|
-
return permissionCodes.length !== 0 && permissionCodes.includes(item.code) && !btnIsHide(item.isHide, params);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (item.hasOwnProperty('isHide')) {
|
|
100
|
-
// 判断是否包含 'isHide'字段,如果包含则先过滤 isHide 为false
|
|
101
|
-
return !btnIsHide(item.isHide, params);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return true;
|
|
105
|
-
}).map(function (resultItem) {
|
|
106
|
-
// 与codes进行对比,相应的 code匹配以对应的name,icon,code返回
|
|
107
|
-
// 如果有配置code,则使用func.code.js里面配置的名称
|
|
108
|
-
if (codes && resultItem.code) {
|
|
109
|
-
var matchIndex = _lodash.default.findIndex(codes, function (btnItem) {
|
|
110
|
-
return btnItem.code === resultItem.code;
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
if (matchIndex !== -1) {
|
|
114
|
-
var _codes$matchIndex;
|
|
115
|
-
|
|
116
|
-
// 如果有配置code,则使用func.code.js里面配置的名称
|
|
117
|
-
resultItem = _objectSpread(_objectSpread(_objectSpread({}, resultItem), codes[matchIndex]), {}, {
|
|
118
|
-
icon: resultItem.icon || ((_codes$matchIndex = codes[matchIndex]) === null || _codes$matchIndex === void 0 ? void 0 : _codes$matchIndex.icon)
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return resultItem;
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
exports.removeNoPermission = removeNoPermission;
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getNodePaths = exports.getChildrenNodes = exports.getParentNodes = void 0;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @description 递归查看父级节点数据集合及当前节点数据
|
|
10
|
-
* @params {Array} list 当前需要过滤查看的数据集合、
|
|
11
|
-
* @params {String/Array} nodeKey 当前用于查找匹配数据的标识值
|
|
12
|
-
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
13
|
-
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
14
|
-
* @params {Object} extra
|
|
15
|
-
*
|
|
16
|
-
* @result {Array} nodeParent 当前传入nodeKey值所有上级别父级数据对象数组集合(倒序排列,根节点在最后一条)
|
|
17
|
-
* @result {Array} parentKeys 当前传入nodeKey值所有上级别父级数据关键字数据集合(keyParam)(倒序排列,根节点在最后一条)
|
|
18
|
-
* @result {Array} matchNode 当前传入nodeKey值所在的数据对象集合
|
|
19
|
-
* */
|
|
20
|
-
var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
21
|
-
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
22
|
-
childrenParam: 'children',
|
|
23
|
-
keyParam: 'value'
|
|
24
|
-
};
|
|
25
|
-
var extraProps = arguments.length > 3 ? arguments[3] : undefined;
|
|
26
|
-
// firstExtra 对应 rule值 SHOW_PARENT,SHOW_CHILD,SHOW_ALL 这几个值是由 'tree-select'控件配置返回的
|
|
27
|
-
// const childrenParams = ['menuItems', 'menuFuncItems', 'items']
|
|
28
|
-
var matchNode = [];
|
|
29
|
-
var parentKeys = []; // 存储查找到的节点的父节点数据
|
|
30
|
-
|
|
31
|
-
var nodeParent = []; // 存储查找到的节点的父节点数据
|
|
32
|
-
// 移除上一次累加的数据
|
|
33
|
-
|
|
34
|
-
var removePrevIndex = function removePrevIndex(array, item) {
|
|
35
|
-
for (var i = 0; i < array.length; i += 1) {
|
|
36
|
-
if (array[i][params.keyParam] === item[params.keyParam]) {
|
|
37
|
-
return i;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return null;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var deepFind = function deepFind(array, nodeId) {
|
|
45
|
-
for (var i = 0; i < array.length; i += 1) {
|
|
46
|
-
var node = array[i];
|
|
47
|
-
|
|
48
|
-
if (node[params.keyParam] === nodeId) {
|
|
49
|
-
matchNode.splice(0, 1, node); // 查找到则赋值,且跳出循环
|
|
50
|
-
|
|
51
|
-
break;
|
|
52
|
-
} // 如果是单个
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
|
|
56
|
-
deepFind(node[params.childrenParam] || node[params.childrenParam], nodeId);
|
|
57
|
-
nodeParent.push(node); // 将当前节点数据存储到父节点数据中
|
|
58
|
-
|
|
59
|
-
if (matchNode.length > 0) {
|
|
60
|
-
break; // 在子节点查找到了,需要跳出
|
|
61
|
-
} else {
|
|
62
|
-
nodeParent.splice(removePrevIndex(nodeParent, node), 1); // 如果在子节点没有查找到,则将原来添加的父节点数据移除
|
|
63
|
-
}
|
|
64
|
-
} // 其他条件
|
|
65
|
-
|
|
66
|
-
/* else if (node.menuFuncItems && node.menuFuncItems.length > 0) {
|
|
67
|
-
deepFind(node.menuFuncItems, nodeId);
|
|
68
|
-
nodeParent.push(node); // 将当前节点数据存储到父节点数据中
|
|
69
|
-
if (matchNode.length > 0) {
|
|
70
|
-
break; // 在子节点查找到了,需要跳出
|
|
71
|
-
} else {
|
|
72
|
-
nodeParent.splice(removePrevIndex(nodeParent, node), 1); // 如果在子节点没有查找到,则将原来添加的父节点数据移除
|
|
73
|
-
}
|
|
74
|
-
} else if (node.items && node.items.length > 0) {
|
|
75
|
-
// 数据权限的子菜单集合 items
|
|
76
|
-
deepFind(node.items, nodeId);
|
|
77
|
-
nodeParent.push(node); // 将当前节点数据存储到父节点数据中
|
|
78
|
-
if (matchNode.length > 0) {
|
|
79
|
-
break; // 在子节点查找到了,需要跳出
|
|
80
|
-
} else {
|
|
81
|
-
nodeParent.splice(removePrevIndex(nodeParent, node), 1); // 如果在子节点没有查找到,则将原来添加的父节点数据移除
|
|
82
|
-
}
|
|
83
|
-
} else if (node.dataScopeList && node.dataScopeList.length > 0) {
|
|
84
|
-
// 数据权限的子菜单集合 dataScopeList
|
|
85
|
-
deepFind(node.dataScopeList, nodeId);
|
|
86
|
-
nodeParent.push(node); // 将当前节点数据存储到父节点数据中
|
|
87
|
-
if (matchNode.length > 0) {
|
|
88
|
-
break; // 在子节点查找到了,需要跳出
|
|
89
|
-
} else {
|
|
90
|
-
nodeParent.splice(removePrevIndex(nodeParent, node), 1); // 如果在子节点没有查找到,则将原来添加的父节点数据移除
|
|
91
|
-
}
|
|
92
|
-
}*/
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return matchNode; // 返回查找到的节点数据(格式为数组)
|
|
97
|
-
}; // 查找单个节点
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var findMatchItem = function findMatchItem(arrList, key) {
|
|
101
|
-
var matchItem;
|
|
102
|
-
|
|
103
|
-
for (var i = 0; i < arrList.length; i += 1) {
|
|
104
|
-
var node = arrList[i];
|
|
105
|
-
|
|
106
|
-
if (node[params.keyParam] === key) {
|
|
107
|
-
matchItem = node;
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (node[params.childrenParam]) {
|
|
112
|
-
matchItem = findMatchItem(node[params.childrenParam], key);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return matchItem;
|
|
117
|
-
}; // nodeKey 为数组时返回当前数据(TODO。目前仅返回一级,多级情况未判断,且 nodeParent 值也未调整)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (Array.isArray(nodeKey)) {
|
|
121
|
-
// const {showCheckedStrategy} = extraProps;
|
|
122
|
-
// TODO 需要判断 showCheckedStrategy 值为 SHOW_PARENT、 SHOW_CHILD 、SHOW_ALL不同情况展示
|
|
123
|
-
nodeKey.map(function (key) {
|
|
124
|
-
var matchItem = findMatchItem(list, key);
|
|
125
|
-
if (matchItem) matchNode.push(findMatchItem(list, key));
|
|
126
|
-
});
|
|
127
|
-
} else {
|
|
128
|
-
deepFind(list, nodeKey);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
nodeParent.forEach(function (par) {
|
|
132
|
-
return parentKeys.push(par[params.keyParam]);
|
|
133
|
-
}); // 将所有父节点的关键值(keyParam指定字段名)的数据集合在数组内
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
nodeParent: nodeParent,
|
|
137
|
-
parentKeys: parentKeys,
|
|
138
|
-
matchNode: matchNode
|
|
139
|
-
}; // 最终查找到的父节点数组 // nodeParent.concat(result || []);
|
|
140
|
-
}; // 递归查找指定ID所有的子菜单与子功能集合
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
exports.getParentNodes = getParentNodes;
|
|
144
|
-
|
|
145
|
-
var getChildrenNodes = function getChildrenNodes(childNode) {
|
|
146
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
147
|
-
childrenParam: 'children',
|
|
148
|
-
keyParam: 'value'
|
|
149
|
-
};
|
|
150
|
-
var childKeys = [];
|
|
151
|
-
var nodeChildren = []; // 存储:authId, types
|
|
152
|
-
|
|
153
|
-
var deepFindChild = function deepFindChild(cList) {
|
|
154
|
-
Array.isArray(cList) && cList.forEach(function (item) {
|
|
155
|
-
childKeys.push(item[params.keyParam]);
|
|
156
|
-
nodeChildren.push(item);
|
|
157
|
-
if (item[params.childrenParam]) deepFindChild(item[params.childrenParam]);
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
deepFindChild(childNode);
|
|
162
|
-
return {
|
|
163
|
-
childKeys: childKeys,
|
|
164
|
-
nodeChildren: nodeChildren
|
|
165
|
-
};
|
|
166
|
-
}; // 查找节点路径
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
exports.getChildrenNodes = getChildrenNodes;
|
|
170
|
-
|
|
171
|
-
var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
172
|
-
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
173
|
-
childrenParam: 'children',
|
|
174
|
-
keyParam: 'value'
|
|
175
|
-
};
|
|
176
|
-
var extraProps = arguments.length > 3 ? arguments[3] : undefined;
|
|
177
|
-
|
|
178
|
-
// 获取指定节点的路径数组
|
|
179
|
-
var getPathByKey = function getPathByKey(value, arr) {
|
|
180
|
-
var findNodePath = function findNodePath(node, value, nodePathArray) {
|
|
181
|
-
// 这里可以自定义push的内容,而不是整个node,而且这里node也包含了children
|
|
182
|
-
nodePathArray.push(node); // 找到符合条件的节点,通过throw终止掉递归
|
|
183
|
-
|
|
184
|
-
if (node[params.keyParam] === value) {
|
|
185
|
-
// 也可以直接使用return;结束循环
|
|
186
|
-
throw "over!";
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
|
|
190
|
-
for (var i = 0; i < node[params.childrenParam].length; i++) {
|
|
191
|
-
findNodePath(node[params.childrenParam][i], value, nodePathArray);
|
|
192
|
-
} // 当前节点的子节点遍历完依旧没找到,则删除路径中的该节点
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
nodePathArray.pop();
|
|
196
|
-
} else {
|
|
197
|
-
// 找到叶子节点时,删除路径当中的该叶子节点
|
|
198
|
-
nodePathArray.pop();
|
|
199
|
-
}
|
|
200
|
-
}; // 用于存储节点唯一标识值路径数组
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var nodePathArray = [];
|
|
204
|
-
|
|
205
|
-
try {
|
|
206
|
-
for (var i = 0; i < arr.length; i++) {
|
|
207
|
-
findNodePath(arr[i], value, nodePathArray);
|
|
208
|
-
}
|
|
209
|
-
} catch (e) {
|
|
210
|
-
return nodePathArray;
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
var pathNode = [];
|
|
215
|
-
|
|
216
|
-
if (Array.isArray(nodeKey)) {
|
|
217
|
-
nodeKey.map(function (key) {
|
|
218
|
-
var pathItems = getPathByKey(key, list);
|
|
219
|
-
if (pathItems) pathNode.push(pathItems);
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return pathNode;
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
exports.getNodePaths = getNodePaths;
|
package/lib/utils/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "UtilValueFormat", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _ValueFormat.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "getParentNodes", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _getParentNodes.getParentNodes;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "getChildrenNodes", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _getParentNodes.getChildrenNodes;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "getNodePaths", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _getParentNodes.getNodePaths;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
var _ValueFormat = _interopRequireDefault(require("./ValueFormat"));
|
|
32
|
-
|
|
33
|
-
var _getParentNodes = require("./getParentNodes");
|
|
34
|
-
|
|
35
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|