vap1 0.2.3 → 0.2.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/components/Box/Box.js +75 -42
- package/components/Box/SelectBar.js +51 -24
- package/components/Box/_register.d.ts +4 -0
- package/components/Box/_register.js +10 -8
- package/components/Box/index.js +1 -1
- package/components/Lists/SList.js +76 -48
- package/components/SearchBar/ActionButtons.js +75 -42
- package/components/SearchBar/ByField.js +80 -52
- package/components/SearchBar/ByKeyword.js +44 -17
- package/components/SearchBar/SearchField.js +8 -8
- package/components/SearchBar/SearchTags.js +4 -4
- package/components/SearchBar/_register.js +9 -8
- package/components/SearchBar/index.js +22 -11
- package/components/Tables/ApiTable.d.ts +1 -1
- package/components/Tables/ApiTable.js +19 -8
- package/components/Tables/ApiTableModal.d.ts +1 -1
- package/components/Tables/ApiTableModal.js +40 -13
- package/components/Tables/Components/ActionBar.js +53 -26
- package/components/Tables/Components/Actions.js +40 -29
- package/components/Tables/Components/Summary.js +2 -2
- package/components/Tables/Components/index.js +3 -3
- package/components/Tables/STable.js +21 -10
- package/components/Tables/TopTable.d.ts +3 -2
- package/components/Tables/TopTable.js +64 -37
- package/components/Tables/TopTableModal.js +21 -10
- package/components/Tables/Util.d.ts +2 -2
- package/components/Tables/Util.js +11 -9
- package/components/Tables/VTable.d.ts +2 -2
- package/components/Tables/VTable.js +137 -65
- package/components/Tables/index.d.ts +7 -2
- package/components/Tables/index.js +5 -5
- package/components/TreeSelect/BaseTreeSelect.js +81 -45
- package/components/TreeSelect/DTreeSelect.js +191 -66
- package/components/TreeSelect/FTreeSelect.js +67 -20
- package/components/TreeSelect/STreeSelect.js +22 -11
- package/components/Trees/ActionTree.js +562 -431
- package/components/Trees/BaseTree.js +85 -38
- package/components/Trees/COTree/COButton.js +48 -21
- package/components/Trees/COTree/COSelect.js +31 -20
- package/components/Trees/COTree/COTree.js +223 -107
- package/components/Trees/COTree/COTreeUtil.js +160 -115
- package/components/Trees/DTree.js +139 -68
- package/components/Trees/FTree.js +76 -29
- package/components/Trees/STree.js +59 -23
- package/components/UForm/FormWrapper.js +70 -53
- package/components/UForm/UDescriptions.js +38 -38
- package/components/UForm/UForm.js +240 -135
- package/components/UForm/UFormModal.js +99 -44
- package/components/UForm/UInfo.js +33 -22
- package/components/UForm/UInfoModal.js +31 -20
- package/components/UForm/UModal.js +40 -13
- package/components/UForm/_FormUtils.js +29 -18
- package/components/UForm/_input.js +75 -39
- package/components/UForm/_register.js +11 -9
- package/components/Upload/UploadFile.js +38 -11
- package/components/Upload/UploadImage.js +50 -23
- package/components/Upload/UploadModal.js +149 -84
- package/components/Upload/useUpload.js +35 -19
- package/components/_RegisterUtil.js +20 -8
- package/components/_adapt/Alert.js +20 -9
- package/components/_adapt/Breadcrumb.js +18 -7
- package/components/_adapt/Button.js +24 -13
- package/components/_adapt/Col.js +34 -23
- package/components/_adapt/Collapse.js +21 -10
- package/components/_adapt/ColorPicker.js +55 -28
- package/components/_adapt/ConfigProvider.js +14 -3
- package/components/_adapt/Drawer.js +18 -7
- package/components/_adapt/Dropdown.js +23 -12
- package/components/_adapt/FloatButton.js +21 -10
- package/components/_adapt/Icon.js +18 -7
- package/components/_adapt/Input.js +17 -6
- package/components/_adapt/InputNumber.js +16 -5
- package/components/_adapt/Layout.js +84 -28
- package/components/_adapt/Menu.js +28 -17
- package/components/_adapt/Modal.js +72 -25
- package/components/_adapt/Pagination.js +14 -3
- package/components/_adapt/Popconfirm.js +17 -6
- package/components/_adapt/Popover.js +17 -6
- package/components/_adapt/Progress.js +42 -11
- package/components/_adapt/Radio.js +21 -10
- package/components/_adapt/Row.js +18 -7
- package/components/_adapt/Select.js +54 -43
- package/components/_adapt/Slider.js +1 -1
- package/components/_adapt/Space.js +2 -2
- package/components/_adapt/Table.js +16 -5
- package/components/_adapt/Tabs.js +17 -6
- package/components/_adapt/Tag.js +19 -8
- package/components/_adapt/Tooltip.js +15 -4
- package/components/_adapt/TreeSelect.js +18 -7
- package/components/_adapt/notification.js +1 -1
- package/components/_adapt/todo/Image.js +2 -2
- package/components/_adapt/todo/NotEffectOnV15.js +1 -1
- package/components/_adapt/todo/Segmented.js +2 -2
- package/components/_adapt/utils.js +28 -8
- package/components/_common/AutoComplete.js +101 -34
- package/components/_common/CountUp.js +30 -14
- package/components/_common/DateRange.js +36 -20
- package/components/_common/HighLight.js +22 -6
- package/components/_common/I18N.js +27 -2
- package/components/_common/Loading.js +25 -9
- package/components/_common/MonthRange.js +26 -26
- package/components/_common/PromiseLabel.js +68 -15
- package/components/_common/Role.js +2 -2
- package/components/_common/Upagination.js +45 -34
- package/components/_setup/Const.js +2 -2
- package/components/_setup/I18N/enUS.js +2 -2
- package/components/_setup/I18N/zhCN.js +3 -3
- package/components/_setup/I18N/zhHK.js +2 -2
- package/components/_setup/ICON/IconTypes.js +2 -2
- package/components/_setup/SearchField/SearchFieldAdvance.js +22 -11
- package/components/_setup/SearchField/SearchFieldDate.js +114 -77
- package/components/_setup/SearchField/SearchFieldInput.js +21 -10
- package/components/_setup/SearchField/SearchFieldSelect.js +55 -44
- package/components/_setup/SearchField/SearchFieldTree.js +63 -52
- package/components/_setup/SelectBar/SelectList.js +21 -10
- package/components/_setup/SelectBar/SelectTree.js +17 -6
- package/components/_setup/UForm/UFormAdvanceInput.js +105 -78
- package/components/_setup/UForm/UFormCOTree.js +21 -10
- package/components/_setup/UForm/UFormCrontab.js +51 -35
- package/components/_setup/UForm/UFormDate.js +158 -122
- package/components/_setup/UForm/UFormInput.js +110 -73
- package/components/_setup/UForm/UFormJSON.js +95 -57
- package/components/_setup/UForm/UFormJSONTable.js +79 -41
- package/components/_setup/UForm/UFormOrg.js +112 -48
- package/components/_setup/UForm/UFormRole.js +31 -20
- package/components/_setup/UForm/UFormSelect.js +106 -79
- package/components/_setup/UForm/UFormTree.js +52 -41
- package/components/_setup/UForm/UFormUpload.js +62 -34
- package/components/_setup/UForm/_utils.js +9 -9
- package/deps/JsonView.js +18 -7
- package/deps/SpringBoot.js +1 -1
- package/deps/SpringCloud.js +4 -4
- package/deps/_editor/advance/_Image.js +33 -20
- package/deps/_editor/base/Element.js +28 -17
- package/deps/_editor/base/Leaf.js +18 -7
- package/deps/_editor/base/Support.js +4 -4
- package/deps/_editor/i18n.js +1 -1
- package/deps/_editor/tools/Button.js +31 -19
- package/deps/_editor/tools/ToolBar.js +3 -3
- package/deps/_editor/tools/_BlockButton.js +49 -27
- package/deps/_editor/tools/_InsertButton.js +32 -28
- package/deps/_editor/tools/_MarkButton.js +15 -14
- package/deps/_editor/tools/_TxtButton.js +90 -58
- package/deps/api-audit.js +1 -1
- package/deps/echarts.js +58 -17
- package/deps/editor.js +52 -26
- package/deps/registerEditor.js +18 -7
- package/hooks/_list.js +1 -1
- package/hooks/useAjax.js +43 -19
- package/hooks/useAjaxAction.js +57 -20
- package/hooks/useAjaxQuery.js +121 -51
- package/hooks/useApi.js +35 -8
- package/hooks/useApiBase.js +291 -184
- package/hooks/useApiGlobal.js +40 -13
- package/hooks/useApp.js +4 -4
- package/hooks/useArray.js +114 -52
- package/hooks/useDefault.js +19 -3
- package/hooks/useDoLoad.js +25 -9
- package/hooks/useEffectFunction.js +4 -3
- package/hooks/useEffectOnce.js +5 -5
- package/hooks/useError.js +21 -5
- package/hooks/useFirstMountState.js +3 -3
- package/hooks/useGenkey.js +7 -7
- package/hooks/useGetSet.js +9 -9
- package/hooks/useGlobal.js +58 -29
- package/hooks/useHover.js +25 -9
- package/hooks/useMemoPromise.js +62 -22
- package/hooks/useModals.js +71 -36
- package/hooks/useMountedState.js +6 -6
- package/hooks/useOpenState.js +26 -10
- package/hooks/usePromise.js +15 -13
- package/hooks/useQueue.js +35 -8
- package/hooks/useSetState.js +25 -8
- package/hooks/useStateList.js +30 -18
- package/hooks/useSyncExternalStore.js +31 -15
- package/hooks/useToggle.js +6 -3
- package/hooks/useUnmountPromise.js +11 -11
- package/hooks/useUpdate.js +20 -4
- package/hooks/useUpdateEffect.js +5 -5
- package/login/Base65.js +15 -14
- package/login/Password.js +91 -38
- package/login/SM4.js +50 -49
- package/login/cems/index.js +2 -2
- package/login/jit/index.js +16 -71
- package/login/jit/pnxclient.js +6 -4
- package/login/vap/index.js +1 -1
- package/login/xrtx/index.js +2 -2
- package/package.json +1 -1
- package/screen/Comment.js +16 -5
- package/screen/Page.js +14 -14
- package/screen/render.js +2 -2
- package/uform/FormEditor.js +43 -26
- package/uform/FormViewer.js +30 -19
- package/uform/hooks/useEditor.js +83 -47
- package/uform/hooks/useForm.js +2 -2
- package/uform/index.js +10 -10
- package/uform/inputs/_advance.js +12 -12
- package/uform/inputs/_date.js +63 -52
- package/uform/inputs/_input.js +49 -38
- package/uform/inputs/_select.js +53 -42
- package/uform/inputs/_specific.js +33 -22
- package/uform/inputs/index.js +5 -5
- package/uform/inputs/register.js +14 -14
- package/uform/panel/Editor/GroupEditor.js +31 -31
- package/uform/panel/Editor/ListEditor.js +22 -22
- package/uform/panel/Editor/_FieldItems.js +16 -16
- package/uform/panel/Editor/_GroupCollapse.js +9 -9
- package/uform/panel/Editor/_GroupDefault.js +9 -9
- package/uform/panel/Editor/_GroupStep.js +18 -18
- package/uform/panel/Editor/_GroupTab.js +16 -16
- package/uform/panel/Editor/index.js +17 -17
- package/uform/panel/Items/index.js +22 -11
- package/uform/panel/Propreties/CanvasProperties.js +14 -14
- package/uform/panel/Propreties/Component/FieldPlugin.js +5 -5
- package/uform/panel/Propreties/Component/LinkAsyncFunction.js +22 -47
- package/uform/panel/Propreties/Component/LinkSyncFunction.js +20 -43
- package/uform/panel/Propreties/Component/Links.js +40 -29
- package/uform/panel/Propreties/Component/OptionTable.js +97 -52
- package/uform/panel/Propreties/Component/RegexpModal.js +11 -11
- package/uform/panel/Propreties/Component/Validate.js +35 -24
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +13 -24
- package/uform/panel/Propreties/Component/ValidateSyncFunction.js +15 -38
- package/uform/panel/Propreties/FieldOptions.js +78 -44
- package/uform/panel/Propreties/FieldProperties.js +47 -20
- package/uform/panel/Propreties/GroupProperties.js +9 -9
- package/uform/panel/Propreties/_ItemAdvance.js +37 -26
- package/uform/panel/Propreties/_ItemBase.js +30 -19
- package/uform/panel/Propreties/_ItemLink.js +20 -9
- package/uform/panel/Propreties/_ItemValidate.js +33 -22
- package/uform/plugins/index.js +7 -7
- package/uform/utils/Convert.js +137 -94
- package/uform/utils/SchemaConvert.js +43 -68
- package/uform/utils/arr.js +103 -75
- package/utils/Ajax.d.ts +1 -11
- package/utils/Ajax.js +154 -68
- package/utils/ArrayUtil.js +14 -12
- package/utils/CacheUtil.js +19 -13
- package/utils/Const.js +13 -13
- package/utils/CustomApp.js +15 -10
- package/utils/EventUtil.js +78 -14
- package/utils/Format.js +59 -38
- package/utils/Global.js +8 -8
- package/utils/Logger.js +56 -11
- package/utils/PageUtil.d.ts +12 -6
- package/utils/PageUtil.js +105 -35
- package/utils/Renders/ApiGetRender.js +187 -100
- package/utils/Renders/ApiPostRender.js +123 -69
- package/utils/Renders/DateRender.js +9 -9
- package/utils/Renders/DictRender.js +82 -55
- package/utils/Renders/FileRender.js +34 -12
- package/utils/Renders/ListRender.js +21 -21
- package/utils/Renders/NumberRender.js +14 -13
- package/utils/Renders/StatusRender.js +20 -20
- package/utils/Renders/StringRender.js +17 -17
- package/utils/Renders/_define.d.ts +2 -2
- package/utils/Renders/_define.js +7 -7
- package/utils/StringUtil.js +98 -67
- package/utils/TreeUtil.js +71 -20
- package/utils/VAP.js +14 -14
- package/utils/XHR.js +27 -11
- package/utils/_AjaxUtil.d.ts +10 -0
- package/utils/_AjaxUtil.js +35 -12
- package/utils/_Support.js +26 -26
- package/utils/i18n.js +78 -44
- package/utils/index.d.ts +9 -1
- package/utils/index.js +34 -5
- package/utils/screenful.js +82 -29
- package/widget/index.js +4 -4
|
@@ -4,19 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.switchHideRender = exports.switchShowRender = exports.switchCloseRender = exports.switchOpenRender = exports.switchDisableRender = exports.switchEnableRender = exports.switchYesNoRender = exports.ListRender = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
var i18n_1 = require("../i18n");
|
|
9
|
+
var Const_1 = require("../../components/_setup/Const");
|
|
10
|
+
var _define_1 = require("./_define");
|
|
11
|
+
var Const_2 = require("../Const");
|
|
12
|
+
var ListRender = function (options) {
|
|
13
|
+
var MAP = new Map();
|
|
14
|
+
var labelField = 'label';
|
|
15
|
+
var valueField = 'value';
|
|
16
|
+
var def = null;
|
|
17
|
+
var showValue = false;
|
|
18
|
+
var list;
|
|
19
|
+
var isArr = lodash_1.default.isArray(options);
|
|
20
20
|
if (isArr) {
|
|
21
21
|
list = options;
|
|
22
22
|
}
|
|
@@ -31,7 +31,7 @@ const ListRender = (options) => {
|
|
|
31
31
|
if (options.valueField)
|
|
32
32
|
valueField = options.valueField;
|
|
33
33
|
}
|
|
34
|
-
list.map(item
|
|
34
|
+
list.map(function (item) {
|
|
35
35
|
if (lodash_1.default.has(item, valueField) && item[valueField] !== null) {
|
|
36
36
|
if (lodash_1.default.has(item, 'ik') && lodash_1.default.isString(item['ik']) && (0, i18n_1.hasKey)(item['ik'])) {
|
|
37
37
|
MAP.set(lodash_1.default.trim(item[valueField]), (0, i18n_1.txt)(item['ik']));
|
|
@@ -41,10 +41,10 @@ const ListRender = (options) => {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
|
|
44
|
+
var fn = function (value) {
|
|
45
45
|
if (value === null)
|
|
46
46
|
return Const_2.NONE;
|
|
47
|
-
|
|
47
|
+
var key = lodash_1.default.trim(value + '');
|
|
48
48
|
var text = '';
|
|
49
49
|
if (!MAP.has(key)) {
|
|
50
50
|
if (def)
|
|
@@ -63,10 +63,10 @@ const ListRender = (options) => {
|
|
|
63
63
|
return text;
|
|
64
64
|
return (0, _define_1.getValue)(text, options);
|
|
65
65
|
};
|
|
66
|
-
fn.getText = (value, def)
|
|
66
|
+
fn.getText = function (value, def) {
|
|
67
67
|
if (value === null)
|
|
68
68
|
return def || '';
|
|
69
|
-
|
|
69
|
+
var key = lodash_1.default.trim(value + '');
|
|
70
70
|
var text = '';
|
|
71
71
|
if (!MAP.has(key)) {
|
|
72
72
|
if (def)
|
|
@@ -84,8 +84,8 @@ const ListRender = (options) => {
|
|
|
84
84
|
}
|
|
85
85
|
return text;
|
|
86
86
|
};
|
|
87
|
-
fn.options = (config)
|
|
88
|
-
|
|
87
|
+
fn.options = function (config) {
|
|
88
|
+
var rtnOptions = [];
|
|
89
89
|
if (config && config.shift) {
|
|
90
90
|
if (config.shift === true) {
|
|
91
91
|
rtnOptions.push({ label: (0, i18n_1.txt)(Const_1.V.TXT_ALL), value: '' });
|
|
@@ -94,7 +94,7 @@ const ListRender = (options) => {
|
|
|
94
94
|
rtnOptions.push(config.shift);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
list.map(item
|
|
97
|
+
list.map(function (item) {
|
|
98
98
|
rtnOptions.push({ label: (0, i18n_1.getText)(item['ik'], item[labelField]), value: (0, _define_1.convertValue)(item[valueField], config) });
|
|
99
99
|
});
|
|
100
100
|
return rtnOptions;
|
|
@@ -4,17 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.percentRender = exports.chineseRender = exports.usdRender = exports.sizeRender = exports.numberRender = exports.intRender = exports.NumberRender = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
var Format_1 = require("../Format");
|
|
10
|
+
var Const_1 = require("../Const");
|
|
11
|
+
var NumberRender = function (options) {
|
|
12
|
+
var config = options ? options : {};
|
|
13
|
+
var formater = (0, Format_1.getFormater)(config.format, options.len);
|
|
14
|
+
var fn = function (txt) {
|
|
15
15
|
if (txt === null)
|
|
16
16
|
return options.default || Const_1.NONE;
|
|
17
|
-
|
|
17
|
+
var num = null;
|
|
18
18
|
if (lodash_1.default.isString(txt)) {
|
|
19
19
|
try {
|
|
20
20
|
num = parseFloat(txt);
|
|
@@ -26,15 +26,16 @@ const NumberRender = (options) => {
|
|
|
26
26
|
else if (lodash_1.default.isNumber(txt)) {
|
|
27
27
|
num = txt;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
var rtn = formater(num);
|
|
30
30
|
if (options.onlyText || options.className == null)
|
|
31
31
|
return rtn + '';
|
|
32
32
|
return react_1.default.createElement("span", { className: options.className }, rtn);
|
|
33
33
|
};
|
|
34
|
-
fn.getText = (txt, def
|
|
34
|
+
fn.getText = function (txt, def) {
|
|
35
|
+
if (def === void 0) { def = '0'; }
|
|
35
36
|
if (txt === null)
|
|
36
37
|
return def;
|
|
37
|
-
|
|
38
|
+
var num = null;
|
|
38
39
|
if (lodash_1.default.isString(txt)) {
|
|
39
40
|
try {
|
|
40
41
|
num = parseFloat(txt);
|
|
@@ -46,7 +47,7 @@ const NumberRender = (options) => {
|
|
|
46
47
|
else if (lodash_1.default.isNumber(txt)) {
|
|
47
48
|
num = txt;
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
+
var rtn = formater(num);
|
|
50
51
|
return rtn;
|
|
51
52
|
};
|
|
52
53
|
return fn;
|
|
@@ -4,25 +4,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.StatusRender = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
STATUS.map((key)
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
var antd_1 = require("antd");
|
|
10
|
+
var _define_1 = require("./_define");
|
|
11
|
+
var i18n_1 = require("../i18n");
|
|
12
|
+
var Const_1 = require("../Const");
|
|
13
|
+
var Const_2 = require("../../components/_setup/Const");
|
|
14
|
+
var STATUS = ["success", "processing", "error", "default", "warning"];
|
|
15
|
+
var StatusRender = function (options) {
|
|
16
|
+
var StatusMap = new Map();
|
|
17
|
+
STATUS.map(function (key) {
|
|
18
18
|
if (lodash_1.default.has(options, key)) {
|
|
19
19
|
StatusMap.set(options[key].value + '', { label: (0, i18n_1.getText)(options[key].ik, options[key].label), status: key });
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
var fn = function (value) {
|
|
23
23
|
// "success", "processing", "error", "default", "warning"
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
var key = value + '';
|
|
25
|
+
var info = null;
|
|
26
26
|
if (StatusMap.has(key)) {
|
|
27
27
|
info = StatusMap.get(key);
|
|
28
28
|
}
|
|
@@ -33,8 +33,8 @@ const StatusRender = (options) => {
|
|
|
33
33
|
return react_1.default.createElement(antd_1.Badge, { status: info.status, text: info.label });
|
|
34
34
|
return Const_1.NONE;
|
|
35
35
|
};
|
|
36
|
-
fn.options = (config)
|
|
37
|
-
|
|
36
|
+
fn.options = function (config) {
|
|
37
|
+
var rtnOptions = [];
|
|
38
38
|
if (config && config.shift) {
|
|
39
39
|
if (config.shift === true) {
|
|
40
40
|
rtnOptions.push({ label: (0, i18n_1.txt)(Const_2.V.TXT_ALL), value: '' });
|
|
@@ -43,16 +43,16 @@ const StatusRender = (options) => {
|
|
|
43
43
|
rtnOptions.push(config.shift);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
STATUS.map((key)
|
|
46
|
+
STATUS.map(function (key) {
|
|
47
47
|
if (lodash_1.default.has(options, key)) {
|
|
48
48
|
rtnOptions.push({ label: options[key].label, value: (0, _define_1.convertValue)(options[key].value, config) });
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
return rtnOptions;
|
|
52
52
|
};
|
|
53
|
-
fn.getText = (value, def)
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
fn.getText = function (value, def) {
|
|
54
|
+
var key = value + '';
|
|
55
|
+
var info = null;
|
|
56
56
|
if (StatusMap.has(key)) {
|
|
57
57
|
info = StatusMap.get(key);
|
|
58
58
|
}
|
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.strCopyRender = exports.StrCopyRender = exports.htmlRender = exports.strRender = exports.HTMRender = exports.StrRender = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
var Icon_1 = require("../../components/_adapt/Icon");
|
|
10
|
+
var _define_1 = require("./_define");
|
|
11
|
+
var index_1 = require("../index");
|
|
12
|
+
var antd_1 = require("antd");
|
|
13
|
+
var StrRender = function (options) {
|
|
14
14
|
var config;
|
|
15
15
|
if (options == null) {
|
|
16
16
|
config = { len: 24 };
|
|
@@ -21,12 +21,12 @@ const StrRender = (options) => {
|
|
|
21
21
|
else {
|
|
22
22
|
config = options;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
var fn = function (value) {
|
|
25
25
|
if (value == null)
|
|
26
26
|
return config.default || '';
|
|
27
27
|
return (0, _define_1.getValue)(value + '', config);
|
|
28
28
|
};
|
|
29
|
-
fn.getText = (str, def)
|
|
29
|
+
fn.getText = function (str, def) {
|
|
30
30
|
return str;
|
|
31
31
|
};
|
|
32
32
|
return fn;
|
|
@@ -36,14 +36,14 @@ exports.StrRender = StrRender;
|
|
|
36
36
|
* 返回一个 htmlRender,用于显示自定义的html,会用div包住
|
|
37
37
|
* @param className 包住自定义html的 className 默认为空
|
|
38
38
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
var HTMRender = function (options) {
|
|
40
|
+
var config = options == null ? {} : options;
|
|
41
|
+
var fn = function (value) {
|
|
42
42
|
if (value == null)
|
|
43
43
|
return config.default || index_1.Const.NONE;
|
|
44
44
|
return react_1.default.createElement("span", { className: config.className, dangerouslySetInnerHTML: { __html: value + '' } });
|
|
45
45
|
};
|
|
46
|
-
fn.getText = (str, def)
|
|
46
|
+
fn.getText = function (str, def) {
|
|
47
47
|
return str;
|
|
48
48
|
};
|
|
49
49
|
return fn;
|
|
@@ -51,7 +51,7 @@ const HTMRender = (options) => {
|
|
|
51
51
|
exports.HTMRender = HTMRender;
|
|
52
52
|
exports.strRender = (0, exports.StrRender)();
|
|
53
53
|
exports.htmlRender = (0, exports.HTMRender)();
|
|
54
|
-
|
|
54
|
+
var StrCopyRender = function (options) {
|
|
55
55
|
var config;
|
|
56
56
|
if (options == null) {
|
|
57
57
|
config = { len: 24 };
|
|
@@ -62,18 +62,18 @@ const StrCopyRender = (options) => {
|
|
|
62
62
|
else {
|
|
63
63
|
config = options;
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
var fn = function (str) {
|
|
66
66
|
if (str === null || str === undefined)
|
|
67
67
|
return '';
|
|
68
68
|
return react_1.default.createElement("span", { className: 'c-copy', title: str },
|
|
69
|
-
react_1.default.createElement(Icon_1.Icon, { type: 'copy', onClick: ()
|
|
69
|
+
react_1.default.createElement(Icon_1.Icon, { type: 'copy', onClick: function () {
|
|
70
70
|
index_1.StringUtil.copy(str + '');
|
|
71
71
|
antd_1.message.success('文本已复制');
|
|
72
72
|
}, title: '\u70B9\u51FB\u590D\u5236' }),
|
|
73
73
|
(0, _define_1.getValue)(str + '', config),
|
|
74
74
|
" ");
|
|
75
75
|
};
|
|
76
|
-
fn.getText = (str, def)
|
|
76
|
+
fn.getText = function (str, def) {
|
|
77
77
|
return (str || def);
|
|
78
78
|
};
|
|
79
79
|
return fn;
|
|
@@ -20,7 +20,7 @@ export type OptionConvertConfig = {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const convertValue: (value: any, config?: OptionConvertConfig) => any;
|
|
22
22
|
export interface Render {
|
|
23
|
-
(value: string | number): (string | React.ReactNode);
|
|
24
|
-
getText: (value: string | number, def?: string) => string;
|
|
23
|
+
(value: string | number, ...args: any[]): (string | React.ReactNode);
|
|
24
|
+
getText: (value: string | number | boolean, def?: string) => string;
|
|
25
25
|
}
|
|
26
26
|
export declare const getList: (result: any) => PlainObject[];
|
package/utils/Renders/_define.js
CHANGED
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getList = exports.convertValue = exports.getValue = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
var Const_1 = require("../Const");
|
|
10
|
+
var getValue = function (txt, options) {
|
|
11
11
|
if (options == null)
|
|
12
12
|
return txt || Const_1.NONE;
|
|
13
|
-
|
|
13
|
+
var str;
|
|
14
14
|
if (txt == null) {
|
|
15
15
|
if (options.default)
|
|
16
16
|
return options.default;
|
|
@@ -29,7 +29,7 @@ const getValue = (txt, options) => {
|
|
|
29
29
|
return react_1.default.createElement("span", { className: options.className, title: txt }, str);
|
|
30
30
|
};
|
|
31
31
|
exports.getValue = getValue;
|
|
32
|
-
|
|
32
|
+
var convertValue = function (value, config) {
|
|
33
33
|
if (config == null || config.valueFormat == null)
|
|
34
34
|
return value;
|
|
35
35
|
if (config.valueFormat == 'number') {
|
|
@@ -43,7 +43,7 @@ const convertValue = (value, config) => {
|
|
|
43
43
|
return value + '';
|
|
44
44
|
};
|
|
45
45
|
exports.convertValue = convertValue;
|
|
46
|
-
|
|
46
|
+
var getList = function (result) {
|
|
47
47
|
if (lodash_1.default.has(result, 'code')) {
|
|
48
48
|
if (result.code != '0') {
|
|
49
49
|
return [];
|