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
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,35 +19,62 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
19
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
20
|
});
|
|
10
21
|
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
11
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
51
|
};
|
|
14
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
53
|
exports.ApiPostRender = void 0;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
54
|
+
var react_1 = __importDefault(require("react"));
|
|
55
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
56
|
+
var index_1 = require("../index");
|
|
57
|
+
var XHR_1 = require("../XHR");
|
|
58
|
+
var hooks_1 = require("../../hooks");
|
|
59
|
+
var _define_1 = require("./_define");
|
|
60
|
+
var Const_1 = require("../Const");
|
|
61
|
+
var SESSION_KEY = '__API_KV_';
|
|
62
|
+
var getInCache = function (SESSION, key) {
|
|
25
63
|
var cache = index_1.CacheUtil.getData(SESSION);
|
|
26
|
-
|
|
64
|
+
var cacheKey = key + '';
|
|
27
65
|
if (!lodash_1.default.has(cache, cacheKey)) {
|
|
28
66
|
return null;
|
|
29
67
|
}
|
|
30
|
-
|
|
68
|
+
var val = lodash_1.default.get(cache, cacheKey);
|
|
31
69
|
if (val === true) {
|
|
32
70
|
return null;
|
|
33
71
|
}
|
|
34
72
|
return val;
|
|
35
73
|
};
|
|
36
|
-
|
|
37
|
-
|
|
74
|
+
var getLabel = function (props, resp, key) {
|
|
75
|
+
var SESSION = SESSION_KEY + props.api;
|
|
38
76
|
var cache = index_1.CacheUtil.getData(SESSION);
|
|
39
|
-
|
|
77
|
+
var cacheKey = key + '';
|
|
40
78
|
if (SESSION == null) {
|
|
41
79
|
index_1.CacheUtil.set(SESSION, {});
|
|
42
80
|
cache = index_1.CacheUtil.getData(SESSION);
|
|
@@ -48,7 +86,7 @@ const getLabel = (props, resp, key) => {
|
|
|
48
86
|
}
|
|
49
87
|
;
|
|
50
88
|
var result = false;
|
|
51
|
-
|
|
89
|
+
var arr = (0, _define_1.getList)(resp);
|
|
52
90
|
if (arr.length > 0)
|
|
53
91
|
result = resp.list[0][props.nameField] + '';
|
|
54
92
|
cache[cacheKey] = result;
|
|
@@ -62,50 +100,63 @@ const getLabel = (props, resp, key) => {
|
|
|
62
100
|
* API 缓存有 KEY 但 KEY = FALSE 确定无值
|
|
63
101
|
* API 缓存有值 = 值
|
|
64
102
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
(0, hooks_1.useEffectFunction)(()
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
var _ApiPostRender = function (props) {
|
|
104
|
+
var update = (0, hooks_1.useUpdate)();
|
|
105
|
+
var KEY = SESSION_KEY + props.api;
|
|
106
|
+
var cacheKey = props.value + '';
|
|
107
|
+
(0, hooks_1.useEffectFunction)(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
+
var cache, txt, i, resp, result;
|
|
109
|
+
var _a;
|
|
110
|
+
return __generator(this, function (_b) {
|
|
111
|
+
switch (_b.label) {
|
|
112
|
+
case 0:
|
|
113
|
+
if (cacheKey == '')
|
|
114
|
+
return [2 /*return*/];
|
|
115
|
+
cache = index_1.CacheUtil.getData(KEY);
|
|
116
|
+
if (!lodash_1.default.has(cache, cacheKey)) return [3 /*break*/, 4];
|
|
117
|
+
txt = lodash_1.default.get(cache, cacheKey);
|
|
118
|
+
if (txt !== true)
|
|
119
|
+
return [2 /*return*/];
|
|
120
|
+
i = 0;
|
|
121
|
+
_b.label = 1;
|
|
122
|
+
case 1:
|
|
123
|
+
if (!(txt === true && i < 200)) return [3 /*break*/, 3];
|
|
124
|
+
i++;
|
|
125
|
+
return [4 /*yield*/, index_1.Ajax.WAIT(lodash_1.default.random(50, 150))];
|
|
126
|
+
case 2:
|
|
127
|
+
_b.sent();
|
|
128
|
+
cache = index_1.CacheUtil.getData(KEY);
|
|
129
|
+
txt = lodash_1.default.get(cache, cacheKey);
|
|
130
|
+
return [3 /*break*/, 1];
|
|
131
|
+
case 3:
|
|
132
|
+
if (txt !== true) {
|
|
133
|
+
update();
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
return [2 /*return*/];
|
|
137
|
+
case 4:
|
|
138
|
+
;
|
|
139
|
+
cache = index_1.CacheUtil.getData(KEY);
|
|
140
|
+
// 不存在
|
|
141
|
+
cache[cacheKey] = true;
|
|
142
|
+
index_1.CacheUtil.set(KEY, cache);
|
|
143
|
+
update();
|
|
144
|
+
return [4 /*yield*/, index_1.Ajax.POST(props.api, __assign(__assign({}, props.param), (_a = {}, _a[props.valueFiled] = props.value, _a)), { process: false })];
|
|
145
|
+
case 5:
|
|
146
|
+
resp = _b.sent();
|
|
147
|
+
result = getLabel(props, resp, cacheKey);
|
|
148
|
+
cache = index_1.CacheUtil.getData(KEY);
|
|
149
|
+
cache[cacheKey] = result;
|
|
150
|
+
index_1.CacheUtil.set(KEY, cache);
|
|
151
|
+
update();
|
|
152
|
+
return [2 /*return*/];
|
|
89
153
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
cache = index_1.CacheUtil.getData(KEY);
|
|
94
|
-
// 不存在
|
|
95
|
-
cache[cacheKey] = true;
|
|
96
|
-
index_1.CacheUtil.set(KEY, cache);
|
|
97
|
-
update();
|
|
98
|
-
const resp = yield index_1.Ajax.POST(props.api, Object.assign(Object.assign({}, props.param), { [props.valueFiled]: props.value }), { process: false });
|
|
99
|
-
const result = getLabel(props, resp, cacheKey);
|
|
100
|
-
cache = index_1.CacheUtil.getData(KEY);
|
|
101
|
-
cache[cacheKey] = result;
|
|
102
|
-
index_1.CacheUtil.set(KEY, cache);
|
|
103
|
-
update();
|
|
104
|
-
}));
|
|
105
|
-
const CACHE = index_1.CacheUtil.getData(KEY);
|
|
154
|
+
});
|
|
155
|
+
}); });
|
|
156
|
+
var CACHE = index_1.CacheUtil.getData(KEY);
|
|
106
157
|
if (props.value == null || CACHE == null || !lodash_1.default.has(CACHE, cacheKey) || CACHE[cacheKey] === true)
|
|
107
158
|
return Const_1.NONE;
|
|
108
|
-
|
|
159
|
+
var result = CACHE[cacheKey];
|
|
109
160
|
if (lodash_1.default.isFunction(props.render)) {
|
|
110
161
|
if (result === false) {
|
|
111
162
|
return props.render({ label: null, value: cacheKey });
|
|
@@ -116,23 +167,25 @@ const _ApiPostRender = (props) => {
|
|
|
116
167
|
return props.default || props.value;
|
|
117
168
|
return (0, _define_1.getValue)(result, props);
|
|
118
169
|
};
|
|
119
|
-
|
|
120
|
-
|
|
170
|
+
var ApiPostRender = function (options) {
|
|
171
|
+
var KEY = SESSION_KEY + options.api;
|
|
121
172
|
if (index_1.CacheUtil.getData(KEY) === null) {
|
|
122
173
|
index_1.CacheUtil.set(KEY, {});
|
|
123
174
|
}
|
|
124
|
-
|
|
125
|
-
lodash_1.default.keys(cache).map(key
|
|
175
|
+
var cache = index_1.CacheUtil.getData(KEY);
|
|
176
|
+
lodash_1.default.keys(cache).map(function (key) {
|
|
126
177
|
if (cache[key] === true) {
|
|
127
178
|
lodash_1.default.unset(cache, key);
|
|
128
179
|
}
|
|
129
180
|
});
|
|
130
181
|
index_1.CacheUtil.set(KEY, cache);
|
|
131
|
-
|
|
132
|
-
fn.autocomplate = (txt)
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
|
|
182
|
+
var fn = function (txt) { return react_1.default.createElement(_ApiPostRender, __assign({ key: KEY + txt }, options, { value: txt })); };
|
|
183
|
+
fn.autocomplate = function (txt) { return __awaiter(void 0, void 0, void 0, function () {
|
|
184
|
+
return __generator(this, function (_a) {
|
|
185
|
+
return [2 /*return*/, []];
|
|
186
|
+
});
|
|
187
|
+
}); };
|
|
188
|
+
fn.clear = function (key) {
|
|
136
189
|
if (key === undefined) {
|
|
137
190
|
index_1.CacheUtil.set(KEY, null);
|
|
138
191
|
return;
|
|
@@ -140,16 +193,17 @@ const ApiPostRender = (options) => {
|
|
|
140
193
|
var cache = index_1.CacheUtil.getData(KEY);
|
|
141
194
|
if (cache == null)
|
|
142
195
|
return;
|
|
143
|
-
|
|
196
|
+
var cacheKey = key + '';
|
|
144
197
|
if (!lodash_1.default.has(cache, cacheKey))
|
|
145
198
|
return;
|
|
146
199
|
lodash_1.default.unset(cache, cacheKey);
|
|
147
200
|
index_1.CacheUtil.set(KEY, cache);
|
|
148
201
|
};
|
|
149
|
-
fn.getText = (key, def)
|
|
150
|
-
|
|
202
|
+
fn.getText = function (key, def) {
|
|
203
|
+
var _a;
|
|
204
|
+
var result = getInCache(KEY, key);
|
|
151
205
|
if (result === null) {
|
|
152
|
-
|
|
206
|
+
var resp = (0, XHR_1.POSTSYNC)(options.api, __assign(__assign({}, options.param), (_a = {}, _a[options.valueFiled] = key, _a)));
|
|
153
207
|
result = getLabel(options, resp, key);
|
|
154
208
|
}
|
|
155
209
|
if (result == false)
|
|
@@ -4,16 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.dateRender = exports.DateRender = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var dayjs_1 = __importDefault(require("dayjs"));
|
|
9
|
+
var Const_1 = require("../Const");
|
|
10
|
+
var DateRender = function (options) {
|
|
11
|
+
var config = options == undefined ? {} : options;
|
|
12
|
+
var fn = function (txt) {
|
|
13
13
|
if (txt == null)
|
|
14
14
|
return Const_1.NONE || config.default;
|
|
15
15
|
;
|
|
16
|
-
|
|
16
|
+
var date = (0, dayjs_1.default)(txt, config.sourceFormat || undefined);
|
|
17
17
|
if (!date.isValid())
|
|
18
18
|
return Const_1.NONE || config.default;
|
|
19
19
|
if (config.className) {
|
|
@@ -21,10 +21,10 @@ const DateRender = (options) => {
|
|
|
21
21
|
}
|
|
22
22
|
return date.format(config.targetFormat || 'YYYY-MM-DD HH:mm:ss');
|
|
23
23
|
};
|
|
24
|
-
fn.getText = (txt, def)
|
|
24
|
+
fn.getText = function (txt, def) {
|
|
25
25
|
if (txt == null)
|
|
26
26
|
return (def || '');
|
|
27
|
-
|
|
27
|
+
var date = (0, dayjs_1.default)(txt, config.sourceFormat || undefined);
|
|
28
28
|
if (!date.isValid())
|
|
29
29
|
return txt + '';
|
|
30
30
|
return date.format(config.targetFormat || 'YYYY-MM-DD HH:mm:ss');
|
|
@@ -1,22 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
2
29
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
31
|
};
|
|
5
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
33
|
exports.DICT = exports.initDict = exports.DictRender = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
34
|
+
var react_1 = __importDefault(require("react"));
|
|
35
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
36
|
+
var antd_1 = require("antd");
|
|
37
|
+
var Icon_1 = require("../../components/_adapt/Icon");
|
|
38
|
+
var index_1 = require("../index");
|
|
39
|
+
var Const_1 = require("../../components/_setup/Const");
|
|
40
|
+
var Const_2 = require("../Const");
|
|
41
|
+
var _Support_1 = require("../_Support");
|
|
42
|
+
var _V_DICT = (0, _Support_1.globalDefault)('_V_DICT', { DICTS: [], DICT_MAP: new Map() });
|
|
16
43
|
exports.DICT = _V_DICT;
|
|
17
|
-
|
|
44
|
+
var DICT = _V_DICT.DICT_MAP;
|
|
18
45
|
// var DICT = globalDefault('_V_DICT' as any, new Map<string, DictInfo>());
|
|
19
|
-
|
|
46
|
+
var VALIDATE_FORMAT = new Set(['tag', 'color', 'status', 'sup', 'sub', 'icon', 'progress', 'clazz']);
|
|
20
47
|
// const tagRender = (key: string | number, def: string | false = TEXT.RENDER_TEXT, map: Map<string, [string, string]>) => {
|
|
21
48
|
// if (!map.has(key)) {
|
|
22
49
|
// if (def) {
|
|
@@ -27,48 +54,48 @@ const VALIDATE_FORMAT = new Set(['tag', 'color', 'status', 'sup', 'sub', 'icon',
|
|
|
27
54
|
// let [txt, format] = map.get(key);
|
|
28
55
|
// return <Tag className="c-dict-tag" color={format ? format : 'geekblue'}>{txt}</Tag>
|
|
29
56
|
// }
|
|
30
|
-
|
|
31
|
-
|
|
57
|
+
var STATUS = new Set(['success', 'processing', 'warning', 'error', 'default']);
|
|
58
|
+
var statusRender = function (key, def, map) {
|
|
32
59
|
if (!map.has(key)) {
|
|
33
60
|
if (def === false)
|
|
34
61
|
return key;
|
|
35
62
|
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-status", status: "default", text: def });
|
|
36
63
|
}
|
|
37
|
-
|
|
64
|
+
var _a = __read(map.get(key), 2), txt = _a[0], format = _a[1];
|
|
38
65
|
if (STATUS.has(format)) {
|
|
39
66
|
// return <Badge status={format as any} text={txt} />
|
|
40
67
|
}
|
|
41
68
|
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-status", status: "default", text: txt });
|
|
42
69
|
};
|
|
43
|
-
|
|
70
|
+
var subRender = function (key, def, map) {
|
|
44
71
|
if (!map.has(key)) {
|
|
45
72
|
if (def === false)
|
|
46
73
|
return key;
|
|
47
74
|
return def;
|
|
48
75
|
}
|
|
49
|
-
|
|
76
|
+
var _a = __read(map.get(key), 2), txt = _a[0], format = _a[1];
|
|
50
77
|
return react_1.default.createElement("span", { className: "c-dict-sub" },
|
|
51
78
|
txt,
|
|
52
79
|
format && react_1.default.createElement("sub", null, format));
|
|
53
80
|
};
|
|
54
|
-
|
|
81
|
+
var supRender = function (key, def, map) {
|
|
55
82
|
if (!map.has(key)) {
|
|
56
83
|
if (def === false)
|
|
57
84
|
return key;
|
|
58
85
|
return def;
|
|
59
86
|
}
|
|
60
|
-
|
|
87
|
+
var _a = __read(map.get(key), 2), txt = _a[0], format = _a[1];
|
|
61
88
|
return react_1.default.createElement("span", { className: "c-dict-sup" },
|
|
62
89
|
txt,
|
|
63
90
|
format && react_1.default.createElement("sup", null, format));
|
|
64
91
|
};
|
|
65
|
-
|
|
92
|
+
var iconRender = function (key, def, map) {
|
|
66
93
|
if (!map.has(key)) {
|
|
67
94
|
if (def === false)
|
|
68
95
|
return key;
|
|
69
96
|
return def;
|
|
70
97
|
}
|
|
71
|
-
|
|
98
|
+
var _a = __read(map.get(key), 2), txt = _a[0], format = _a[1];
|
|
72
99
|
if (format == null || format == '') {
|
|
73
100
|
return txt;
|
|
74
101
|
}
|
|
@@ -82,13 +109,13 @@ const iconRender = (key, def, map) => {
|
|
|
82
109
|
txt);
|
|
83
110
|
};
|
|
84
111
|
// const PROGRESS = new Set<string>(['prepare', 'ready', 'doing', 'finsh', 'error'])
|
|
85
|
-
|
|
112
|
+
var progressRender = function (key, def, map) {
|
|
86
113
|
if (!map.has(key)) {
|
|
87
114
|
if (def == false)
|
|
88
115
|
return key;
|
|
89
116
|
return def;
|
|
90
117
|
}
|
|
91
|
-
|
|
118
|
+
var _a = __read(map.get(key), 2), txt = _a[0], format = _a[1];
|
|
92
119
|
switch (format) {
|
|
93
120
|
case 'prepare':
|
|
94
121
|
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-progress c-dict-progress-" + format, count: react_1.default.createElement(Icon_1.Icon, { type: "plus-circle" }), text: txt });
|
|
@@ -103,28 +130,28 @@ const progressRender = (key, def, map) => {
|
|
|
103
130
|
}
|
|
104
131
|
return txt;
|
|
105
132
|
};
|
|
106
|
-
|
|
133
|
+
var borderRender = function (key, def, map) {
|
|
107
134
|
if (!map.has(key)) {
|
|
108
135
|
if (def === false)
|
|
109
136
|
return key;
|
|
110
137
|
return def;
|
|
111
138
|
}
|
|
112
|
-
|
|
139
|
+
var _a = __read(map.get(key), 2), txt = _a[0], format = _a[1];
|
|
113
140
|
return react_1.default.createElement("span", { className: "c-dict-border", style: { color: format, borderLeftColor: format } }, txt);
|
|
114
141
|
};
|
|
115
|
-
|
|
142
|
+
var extClass = function (key, def, map) {
|
|
116
143
|
if (!map.has(key)) {
|
|
117
144
|
if (def === false)
|
|
118
145
|
return key;
|
|
119
146
|
return def;
|
|
120
147
|
}
|
|
121
|
-
|
|
148
|
+
var _a = __read(map.get(key), 2), txt = _a[0], format = _a[1];
|
|
122
149
|
if (format) {
|
|
123
150
|
return react_1.default.createElement("span", { className: format }, txt);
|
|
124
151
|
}
|
|
125
152
|
return txt;
|
|
126
153
|
};
|
|
127
|
-
|
|
154
|
+
var renderDictValue = function (info, item) {
|
|
128
155
|
switch (info.format) {
|
|
129
156
|
case 'tag':
|
|
130
157
|
// return tagRender(item.value);
|
|
@@ -153,23 +180,23 @@ const renderDictValue = (info, item) => {
|
|
|
153
180
|
}
|
|
154
181
|
return item.label;
|
|
155
182
|
};
|
|
156
|
-
|
|
183
|
+
var _DictRender = function (props) {
|
|
157
184
|
// if (DICT == null) return NONE;
|
|
158
185
|
if (props.value === null)
|
|
159
186
|
return props.default || Const_2.NONE;
|
|
160
|
-
|
|
187
|
+
var dictInfo = DICT.get(props.dictType);
|
|
161
188
|
if (dictInfo == null)
|
|
162
189
|
return props.default || Const_2.NONE;
|
|
163
|
-
|
|
164
|
-
|
|
190
|
+
var dictKey = props.value + '';
|
|
191
|
+
var idx = lodash_1.default.findIndex(dictInfo.nodes, function (item) { return dictKey == item.value; });
|
|
165
192
|
if (idx < 0)
|
|
166
193
|
return props.default || Const_2.NONE;
|
|
167
194
|
return renderDictValue(dictInfo, dictInfo.nodes[idx]);
|
|
168
195
|
};
|
|
169
|
-
|
|
196
|
+
var putOptions = function (arr, config) {
|
|
170
197
|
if (config === undefined)
|
|
171
198
|
return arr;
|
|
172
|
-
|
|
199
|
+
var list = arr.slice();
|
|
173
200
|
if (config.shift) {
|
|
174
201
|
if (config.shift === true) {
|
|
175
202
|
list.unshift({ label: index_1.i18n.txt(Const_1.V.TXT_ALL), value: '' });
|
|
@@ -179,7 +206,7 @@ const putOptions = (arr, config) => {
|
|
|
179
206
|
}
|
|
180
207
|
}
|
|
181
208
|
if (config.valueFormat == 'number') {
|
|
182
|
-
list.map(item
|
|
209
|
+
list.map(function (item) {
|
|
183
210
|
try {
|
|
184
211
|
item.value = parseInt(item.value);
|
|
185
212
|
}
|
|
@@ -189,28 +216,28 @@ const putOptions = (arr, config) => {
|
|
|
189
216
|
}
|
|
190
217
|
return list;
|
|
191
218
|
};
|
|
192
|
-
|
|
193
|
-
|
|
219
|
+
var DictCache = new Map();
|
|
220
|
+
var DictRender = function (options) {
|
|
194
221
|
if (lodash_1.default.isString(options) && DictCache.has(options))
|
|
195
222
|
return DictCache.get(options);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return react_1.default.createElement(_DictRender,
|
|
223
|
+
var props = lodash_1.default.isString(options) ? { dictType: options } : options;
|
|
224
|
+
var fn = function (txt) {
|
|
225
|
+
return react_1.default.createElement(_DictRender, __assign({}, props, { value: txt }));
|
|
199
226
|
};
|
|
200
|
-
fn.options = (config)
|
|
201
|
-
|
|
227
|
+
fn.options = function (config) {
|
|
228
|
+
var info = DICT.get(props.dictType);
|
|
202
229
|
if (info == null)
|
|
203
230
|
return [];
|
|
204
231
|
return putOptions(info.nodes, config);
|
|
205
232
|
};
|
|
206
|
-
fn.getText = (key, def)
|
|
233
|
+
fn.getText = function (key, def) {
|
|
207
234
|
if (key === null)
|
|
208
235
|
return lodash_1.default.isString(def) ? def : '';
|
|
209
|
-
|
|
236
|
+
var dictInfo = DICT.get(props.dictType);
|
|
210
237
|
if (dictInfo == null)
|
|
211
238
|
return lodash_1.default.isString(def) ? def : '';
|
|
212
|
-
|
|
213
|
-
|
|
239
|
+
var dictKey = key + '';
|
|
240
|
+
var idx = lodash_1.default.findIndex(dictInfo.nodes, function (item) { return dictKey == item.value; });
|
|
214
241
|
if (idx < 0)
|
|
215
242
|
return lodash_1.default.isString(def) ? def : '';
|
|
216
243
|
return dictInfo.nodes[idx].label;
|
|
@@ -220,13 +247,13 @@ const DictRender = (options) => {
|
|
|
220
247
|
return fn;
|
|
221
248
|
};
|
|
222
249
|
exports.DictRender = DictRender;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
childs.map(item
|
|
226
|
-
|
|
250
|
+
var initNodes = function (parentType, dict, nodes) {
|
|
251
|
+
var childs = lodash_1.default.filter(dict, function (item) { return item.parentType == parentType; });
|
|
252
|
+
childs.map(function (item) {
|
|
253
|
+
var value = lodash_1.default.trim(item.code);
|
|
227
254
|
if (value.length > 0)
|
|
228
|
-
nodes.push({ label: item.codeValue, value });
|
|
229
|
-
|
|
255
|
+
nodes.push({ label: item.codeValue, value: value });
|
|
256
|
+
var subChildren = lodash_1.default.filter(dict, function (sub) { return sub.parentType == item.type; });
|
|
230
257
|
if (subChildren.length > 0) {
|
|
231
258
|
initNodes(item.type, dict, nodes);
|
|
232
259
|
}
|
|
@@ -235,11 +262,11 @@ const initNodes = (parentType, dict, nodes) => {
|
|
|
235
262
|
/**
|
|
236
263
|
* 初始化字典,将字典接口的响应数组传入
|
|
237
264
|
*/
|
|
238
|
-
|
|
239
|
-
|
|
265
|
+
var initDict = function (dict) {
|
|
266
|
+
var roots = lodash_1.default.filter(dict, function (item) { return item['parentType'] == '0' || item['parentType'] == ''; });
|
|
240
267
|
_V_DICT.DICTS = [];
|
|
241
|
-
roots.map(root
|
|
242
|
-
|
|
268
|
+
roots.map(function (root) {
|
|
269
|
+
var info = { code: root.type, nodes: [] };
|
|
243
270
|
_V_DICT.DICTS.push({ label: root.codeValue, value: root.type });
|
|
244
271
|
if (root.format && VALIDATE_FORMAT.has(root.format))
|
|
245
272
|
info.format = root.format;
|
|
@@ -1,25 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __values = (this && this.__values) || function(o) {
|
|
3
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
+
if (m) return m.call(o);
|
|
5
|
+
if (o && typeof o.length === "number") return {
|
|
6
|
+
next: function () {
|
|
7
|
+
if (o && i >= o.length) o = void 0;
|
|
8
|
+
return { value: o && o[i++], done: !o };
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
exports.imgRender = exports.fileRender = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
20
|
+
var Icon_1 = require("../../components/_adapt/Icon");
|
|
21
|
+
var index_1 = require("../index");
|
|
22
|
+
var Const_1 = require("../../components/_setup/Const");
|
|
12
23
|
// 支持直接用浏览器打开的格式
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
var VIEW_TYPES = ['.png', '.jpg', '.svg', '.jpeg', '.gif', '.pdf', '.mp4', '.mp3'];
|
|
25
|
+
var canView = function (fileName) {
|
|
26
|
+
var e_1, _a;
|
|
27
|
+
try {
|
|
28
|
+
for (var VIEW_TYPES_1 = __values(VIEW_TYPES), VIEW_TYPES_1_1 = VIEW_TYPES_1.next(); !VIEW_TYPES_1_1.done; VIEW_TYPES_1_1 = VIEW_TYPES_1.next()) {
|
|
29
|
+
var sux = VIEW_TYPES_1_1.value;
|
|
30
|
+
if (lodash_1.default.toLower(fileName).endsWith(sux)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
36
|
+
finally {
|
|
37
|
+
try {
|
|
38
|
+
if (VIEW_TYPES_1_1 && !VIEW_TYPES_1_1.done && (_a = VIEW_TYPES_1.return)) _a.call(VIEW_TYPES_1);
|
|
18
39
|
}
|
|
40
|
+
finally { if (e_1) throw e_1.error; }
|
|
19
41
|
}
|
|
20
42
|
return false;
|
|
21
43
|
};
|
|
22
|
-
|
|
44
|
+
var fileRender = function (fileId, fileName) {
|
|
23
45
|
if (fileName && canView(fileName)) {
|
|
24
46
|
return react_1.default.createElement("a", { href: index_1.GLOBAL.CONFIG.UPLOAD.PREVIEW + fileId, target: "_blank", title: fileName },
|
|
25
47
|
react_1.default.createElement(Icon_1.Icon, { type: "search" }),
|
|
@@ -32,7 +54,7 @@ const fileRender = (fileId, fileName) => {
|
|
|
32
54
|
fileName ? fileName : index_1.i18n.txt(Const_1.V.BTN_DOWNLOAD));
|
|
33
55
|
};
|
|
34
56
|
exports.fileRender = fileRender;
|
|
35
|
-
|
|
57
|
+
var imgRender = function (fileId) {
|
|
36
58
|
// if (portrait) {
|
|
37
59
|
// if (_.startsWith(portrait, '/') || _.startsWith(portrait, 'http:')) {
|
|
38
60
|
// return portrait;
|