vap1 0.4.5 → 0.5.0
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/base.json +30 -0
- package/basetype.d.ts +4 -1
- package/cems/admin/AsyncSelect.d.ts +45 -0
- package/cems/admin/AsyncSelect.js +2 -0
- package/cems/admin/CardTable.d.ts +207 -0
- package/cems/admin/CardTable.js +2 -0
- package/cems/admin/EasyuiTree.d.ts +131 -0
- package/cems/admin/EasyuiTree.js +2 -0
- package/cems/admin/utils.d.ts +5 -0
- package/cems/admin/utils.js +3 -0
- package/cems/admin/validator.d.ts +137 -0
- package/cems/admin/validator.js +2 -0
- package/cems/assets/CUpload.d.ts +23 -0
- package/cems/assets/CUpload.js +2 -0
- package/cems/assets/Charts.d.ts +37 -0
- package/cems/assets/Charts.js +2 -0
- package/cems/assets/DInfo.d.ts +38 -0
- package/cems/assets/DInfo.js +2 -0
- package/cems/assets/DModal.d.ts +84 -0
- package/cems/assets/DModal.js +2 -0
- package/cems/assets/DTable.d.ts +128 -0
- package/cems/assets/DTable.js +2 -0
- package/cems/assets/DivWidth.d.ts +14 -0
- package/cems/assets/DivWidth.js +2 -0
- package/cems/assets/Patch.d.ts +9 -0
- package/cems/assets/Patch.js +2 -0
- package/cems/assets/Sensitive.d.ts +33 -0
- package/cems/assets/Sensitive.js +2 -0
- package/cems/assets/types.d.ts +200 -0
- package/cems/assets/types.js +2 -0
- package/cems/assets/utils.d.ts +61 -0
- package/cems/assets/utils.js +2 -0
- package/cems/define.d.ts +9 -0
- package/cems/define.js +18 -0
- package/cems/index.d.ts +228 -0
- package/cems/index.js +81 -0
- package/cems/policy/CForm.d.ts +133 -0
- package/cems/policy/CForm.js +2 -0
- package/cems/policy/DApiTable.d.ts +78 -0
- package/cems/policy/DApiTable.js +2 -0
- package/cems/policy/DButton.d.ts +17 -0
- package/cems/policy/DButton.js +2 -0
- package/cems/policy/DCheckbox.d.ts +50 -0
- package/cems/policy/DCheckbox.js +2 -0
- package/cems/policy/DCheckboxGroup.d.ts +34 -0
- package/cems/policy/DCheckboxGroup.js +2 -0
- package/cems/policy/DCol.d.ts +33 -0
- package/cems/policy/DCol.js +2 -0
- package/cems/policy/DColorPicker.d.ts +9 -0
- package/cems/policy/DColorPicker.js +2 -0
- package/cems/policy/DDatePicker.d.ts +41 -0
- package/cems/policy/DDatePicker.js +2 -0
- package/cems/policy/DDiv.d.ts +65 -0
- package/cems/policy/DDiv.js +2 -0
- package/cems/policy/DDrawer.d.ts +6 -0
- package/cems/policy/DDrawer.js +2 -0
- package/cems/policy/DDynamicSelect.d.ts +50 -0
- package/cems/policy/DDynamicSelect.js +2 -0
- package/cems/policy/DDynamicTreeSelect.d.ts +45 -0
- package/cems/policy/DDynamicTreeSelect.js +2 -0
- package/cems/policy/DForm.d.ts +248 -0
- package/cems/policy/DForm.js +2 -0
- package/cems/policy/DIcon.d.ts +33 -0
- package/cems/policy/DIcon.js +2 -0
- package/cems/policy/DInput.d.ts +41 -0
- package/cems/policy/DInput.js +2 -0
- package/cems/policy/DLabel.d.ts +17 -0
- package/cems/policy/DLabel.js +2 -0
- package/cems/policy/DPTable.d.ts +86 -0
- package/cems/policy/DPTable.js +2 -0
- package/cems/policy/DRadio.d.ts +34 -0
- package/cems/policy/DRadio.js +2 -0
- package/cems/policy/DSCTable.d.ts +33 -0
- package/cems/policy/DSCTable.js +2 -0
- package/cems/policy/DSelect.d.ts +42 -0
- package/cems/policy/DSelect.js +2 -0
- package/cems/policy/DSlider.d.ts +21 -0
- package/cems/policy/DSlider.js +2 -0
- package/cems/policy/DSwitch.d.ts +21 -0
- package/cems/policy/DSwitch.js +2 -0
- package/cems/policy/DTab.d.ts +30 -0
- package/cems/policy/DTab.js +2 -0
- package/cems/policy/DTimePicker.d.ts +37 -0
- package/cems/policy/DTimePicker.js +2 -0
- package/cems/policy/DTree.d.ts +98 -0
- package/cems/policy/DTree.js +2 -0
- package/cems/policy/DUpload.d.ts +33 -0
- package/cems/policy/DUpload.js +2 -0
- package/cems/policy/types.d.ts +200 -0
- package/cems/policy/types.js +2 -0
- package/cems/policy/utils.d.ts +13 -0
- package/cems/policy/utils.js +2 -0
- package/components/Box/Box.d.ts +43 -7
- package/components/Box/Box.js +67 -17
- package/components/Box/SelectBar.d.ts +1 -1
- package/components/Box/SelectBar.js +19 -9
- package/components/Lists/BaseList.d.ts +5 -0
- package/components/Lists/BaseList.js +111 -0
- package/components/Lists/Fields/IconRender.d.ts +53 -0
- package/components/Lists/Fields/IconRender.js +174 -0
- package/components/Lists/Fields/ItemRender.d.ts +2 -0
- package/components/Lists/Fields/ItemRender.js +127 -0
- package/components/Lists/Fields/_utils.d.ts +3 -0
- package/components/Lists/Fields/_utils.js +80 -0
- package/components/Lists/Fields/index.d.ts +3 -0
- package/components/Lists/Fields/index.js +47 -0
- package/components/Lists/Grid/grid.d.ts +7 -0
- package/components/Lists/Grid/grid.js +18 -0
- package/components/Lists/Grid/index.d.ts +3 -0
- package/components/Lists/Grid/index.js +50 -0
- package/components/Lists/Row/index.d.ts +3 -0
- package/components/Lists/Row/index.js +14 -0
- package/components/Lists/SList.js +17 -7
- package/components/Lists/Timeline/index.d.ts +3 -0
- package/components/Lists/Timeline/index.js +117 -0
- package/components/Lists/VList.d.ts +3 -0
- package/components/Lists/VList.js +92 -0
- package/components/Lists/components/LayoutSwitcher.d.ts +13 -0
- package/components/Lists/components/LayoutSwitcher.js +121 -0
- package/components/Lists/components/SearchTool.d.ts +13 -0
- package/components/Lists/components/SearchTool.js +34 -0
- package/components/Lists/index.d.ts +129 -0
- package/components/Lists/index.js +2 -0
- package/components/SearchTool/SearchBand/BandInput.d.ts +3 -0
- package/components/SearchTool/SearchBand/BandInput.js +54 -0
- package/components/SearchTool/SearchBand/BandTag.d.ts +7 -0
- package/components/SearchTool/SearchBand/BandTag.js +82 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.js +23 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.js +72 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.js +75 -0
- package/components/SearchTool/SearchBand/_register.d.ts +47 -0
- package/components/SearchTool/SearchBand/_register.js +15 -0
- package/components/SearchTool/SearchBand/hooks.d.ts +12 -0
- package/components/SearchTool/SearchBand/hooks.js +181 -0
- package/components/SearchTool/SearchBand/index.d.ts +3 -0
- package/components/SearchTool/SearchBand/index.js +66 -0
- package/components/SearchTool/SearchBand/type.d.ts +71 -0
- package/components/SearchTool/SearchBand/type.js +3 -0
- package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.d.ts +2 -2
- package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.js +22 -12
- package/components/{SearchBar → SearchTool/SearchBar}/ByField.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/ByField.js +21 -11
- package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.js +20 -10
- package/components/{SearchBar → SearchTool/SearchBar}/SearchField.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.js +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/_register.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/_register.js +3 -3
- package/components/SearchTool/SearchBar/index.d.ts +7 -0
- package/components/{SearchBar → SearchTool/SearchBar}/index.js +1 -1
- package/components/{SearchBar/index.d.ts → SearchTool/SearchBar/type.d.ts} +68 -67
- package/components/SearchTool/SearchBar/type.js +35 -0
- package/components/SearchTool/index.d.ts +5 -0
- package/components/SearchTool/index.js +7 -0
- package/components/Tables/ApiTable.d.ts +5 -7
- package/components/Tables/ApiTable.js +17 -7
- package/components/Tables/ApiTableModal.d.ts +5 -7
- package/components/Tables/ApiTableModal.js +17 -7
- package/components/Tables/Components/ActionBar.d.ts +8 -11
- package/components/Tables/Components/ActionBar.js +74 -41
- package/components/Tables/Components/Actions.d.ts +3 -1
- package/components/Tables/Components/Actions.js +40 -3
- package/components/Tables/Components/index.d.ts +3 -1
- package/components/Tables/Components/useTableContext.d.ts +16 -0
- package/components/Tables/Components/useTableContext.js +116 -0
- package/components/Tables/STable.js +17 -7
- package/components/Tables/TopTable.js +17 -7
- package/components/Tables/Util.d.ts +2 -2
- package/components/Tables/Util.js +0 -1
- package/components/Tables/VTable.d.ts +9 -9
- package/components/Tables/VTable.js +119 -172
- package/components/Tables/VTableBack.d.ts +0 -0
- package/components/Tables/VTableBack.js +269 -0
- package/components/Tables/index.d.ts +11 -22
- package/components/TreeSelect/BaseTreeSelect.js +17 -7
- package/components/TreeSelect/DTreeSelect.js +19 -9
- package/components/TreeSelect/FTreeSelect.js +2 -2
- package/components/TreeSelect/STreeSelect.js +1 -1
- package/components/Trees/ActionTree.d.ts +3 -5
- package/components/Trees/ActionTree.js +19 -9
- package/components/Trees/BaseTree.js +17 -7
- package/components/Trees/COTree/COButton.js +17 -7
- package/components/Trees/COTree/COSelect.js +17 -7
- package/components/Trees/COTree/COTree.js +19 -9
- package/components/Trees/DTree.d.ts +0 -7
- package/components/Trees/DTree.js +19 -9
- package/components/Trees/FTree.js +19 -9
- package/components/Trees/STree.js +17 -7
- package/components/UForm/FormWrapper.js +17 -7
- package/components/UForm/UDescriptions.d.ts +2 -3
- package/components/UForm/UDescriptions.js +17 -7
- package/components/UForm/UForm.d.ts +1 -1
- package/components/UForm/UForm.js +24 -11
- package/components/UForm/UFormModal.js +19 -9
- package/components/UForm/_FieldType.d.ts +1 -1
- package/components/UForm/_FieldType.js +4 -0
- package/components/UForm/_input.d.ts +5 -1
- package/components/UForm/_input.js +25 -8
- package/components/Upload/UploadImage.js +17 -7
- package/components/Upload/UploadModal.js +19 -9
- package/components/Upload/useUpload.js +2 -2
- package/components/_adapt/Alert.js +17 -7
- package/components/_adapt/Col.d.ts +1 -1
- package/components/_adapt/ColorPicker.js +17 -7
- package/components/_adapt/Drawer.js +17 -7
- package/components/_adapt/Dropdown.js +17 -7
- package/components/_adapt/FloatButton.js +17 -7
- package/components/_adapt/Input.js +17 -7
- package/components/_adapt/InputNumber.js +17 -7
- package/components/_adapt/Layout.js +17 -7
- package/components/_adapt/Menu.js +17 -7
- package/components/_adapt/Modal.js +17 -7
- package/components/_adapt/Popconfirm.js +17 -7
- package/components/_adapt/Popover.js +17 -7
- package/components/_adapt/Progress.js +17 -7
- package/components/_adapt/Select.js +17 -7
- package/components/_adapt/Table.js +17 -7
- package/components/_adapt/Tabs.js +17 -7
- package/components/_adapt/Tag.js +17 -7
- package/components/_adapt/TreeSelect.js +17 -7
- package/components/_adapt/todo/Image.d.ts +0 -1
- package/components/_adapt/todo/Segmented.d.ts +0 -1
- package/components/_common/AutoComplete.js +35 -12
- package/components/_common/CountUp.js +17 -7
- package/components/_common/DateRange.d.ts +5 -2
- package/components/_common/DateRange.js +43 -40
- package/components/_common/HighLight.d.ts +1 -1
- package/components/_common/HighLight.js +26 -24
- package/components/_common/Loading.js +17 -7
- package/components/_common/MonthRange.js +17 -7
- package/components/_common/PromiseLabel.js +2 -2
- package/components/_common/UTitle.d.ts +1 -1
- package/components/_common/UTitle.js +18 -8
- package/components/_common/Upagination.d.ts +1 -0
- package/components/_common/Upagination.js +5 -1
- package/components/_i18n.d.ts +1 -102
- package/components/index.d.ts +2 -2
- package/components/index.js +5 -1
- package/deps/JsonView.js +17 -7
- package/deps/app-audit/LookUp.js +19 -9
- package/deps/app-data/Const.d.ts +68 -3
- package/deps/app-data/Const.js +47 -3
- package/deps/app-data/TimeConst.d.ts +0 -0
- package/deps/app-data/TimeConst.js +58 -0
- package/deps/app-data/useSource.d.ts +22 -0
- package/deps/app-data/useSource.js +253 -162
- package/deps/echarts.d.ts +3 -0
- package/deps/echarts.js +20 -10
- package/deps/editor/Article.js +17 -7
- package/deps/editor/Editor.js +17 -7
- package/deps/editor/EditorModal.js +17 -7
- package/deps/editor/support/buttons/ImageButton.js +17 -7
- package/deps/editor/tools/Button.js +0 -2
- package/deps/editor/tools/_TxtButton.js +17 -7
- package/deps/vapc/_basic.d.ts +1 -0
- package/deps/vapc/_basic.js +15 -0
- package/deps/vapc/index.d.ts +10 -0
- package/deps/vapc/index.js +70 -0
- package/hooks/useAjaxAction.js +2 -2
- package/hooks/useAjaxQuery.js +2 -2
- package/hooks/useApiBase.js +2 -2
- package/hooks/useApiGlobal.js +1 -1
- package/hooks/useArray.js +2 -2
- package/hooks/useDefault.d.ts +0 -1
- package/hooks/useDoLoad.d.ts +1 -1
- package/hooks/useError.d.ts +1 -1
- package/hooks/useMemoPromise.js +2 -2
- package/index.d.ts +2 -1
- package/index.js +1 -1
- package/login/Base65.d.ts +7 -1
- package/login/Base65.js +49 -22
- package/login/Password.d.ts +8 -5
- package/login/Password.js +68 -102
- package/package.json +1 -1
- package/screen/Page.js +17 -7
- package/screen/vapc-schema/dark.d.ts +1 -0
- package/screen/vapc-schema/dark.js +50 -0
- package/screen/vapc-schema/insight.d.ts +1 -0
- package/screen/vapc-schema/insight.js +49 -0
- package/uform/FormEditor.js +17 -7
- package/uform/FormViewer.js +17 -7
- package/uform/hooks/useEditor.d.ts +0 -1
- package/uform/hooks/useForm.d.ts +0 -1
- package/uform/inputs/index.d.ts +0 -1
- package/uform/panel/Editor/_GroupDefault.js +17 -7
- package/uform/panel/Editor/_GroupStep.js +17 -7
- package/uform/panel/Editor/_GroupTab.js +17 -7
- package/uform/panel/Editor/index.js +17 -7
- package/uform/panel/Items/Fields.js +17 -7
- package/uform/panel/Items/InputSelector.js +17 -7
- package/uform/panel/Items/Inputs.js +17 -7
- package/uform/panel/Items/index.d.ts +1 -1
- package/uform/panel/Propreties/CanvasProperties.js +17 -7
- package/uform/panel/Propreties/Component/FieldPlugin.js +17 -7
- package/uform/panel/Propreties/Component/LinkAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/LinkSyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/Links.js +17 -7
- package/uform/panel/Propreties/Component/OptionTable.js +17 -7
- package/uform/panel/Propreties/Component/RegexpModal.js +17 -7
- package/uform/panel/Propreties/Component/Validate.js +17 -7
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/ValidateSyncFunction.js +17 -7
- package/uform/panel/Propreties/FieldOptions.js +17 -7
- package/uform/panel/Propreties/FieldProperties.js +17 -7
- package/uform/panel/Propreties/_ItemAdvance.js +17 -7
- package/uform/panel/Propreties/_ItemBase.js +17 -7
- package/uform/panel/Propreties/_ItemLink.js +17 -7
- package/uform/panel/Propreties/_ItemValidate.js +17 -7
- package/uform/schema.d.ts +1 -1
- package/uform/utils/Convert.js +2 -2
- package/utils/Ajax.d.ts +3 -0
- package/utils/Ajax.js +22 -16
- package/utils/CacheUtil.d.ts +1 -1
- package/utils/Const.js +17 -7
- package/utils/Format.d.ts +138 -14
- package/utils/Format.js +132 -23
- package/utils/Global.d.ts +46 -2
- package/utils/Global.js +24 -2
- package/utils/PageUtil.d.ts +111 -23
- package/utils/PageUtil.js +163 -28
- package/utils/Renders/ApiGetRender.js +25 -12
- package/utils/Renders/ApiPostRender.js +3 -3
- package/utils/Renders/CondictionRender.js +17 -7
- package/utils/Renders/DateRender.js +20 -2
- package/utils/Renders/ListRender.js +1 -1
- package/utils/Renders/NumberRender.js +24 -5
- package/utils/Renders/StringRender.js +81 -11
- package/utils/Renders/_define.d.ts +8 -7
- package/utils/Renders/_define.js +76 -17
- package/utils/StringUtil.d.ts +292 -62
- package/utils/StringUtil.js +310 -63
- package/utils/TreeUtil.js +14 -12
- package/utils/VAP.d.ts +26 -1
- package/utils/VAP.js +57 -1
- package/utils/_AjaxUtil.d.ts +1 -0
- package/utils/_AjaxUtil.js +70 -3
- package/utils/_Support.d.ts +2 -2
- package/utils/_Support.js +4 -2
- package/utils/crontab/_en.d.ts +2 -0
- package/utils/crontab/_en.js +178 -0
- package/utils/crontab/_global.d.ts +11 -0
- package/utils/crontab/_global.js +23 -0
- package/utils/crontab/_zh_CN.d.ts +2 -0
- package/utils/crontab/_zh_CN.js +180 -0
- package/utils/crontab/_zh_TW.d.ts +2 -0
- package/utils/crontab/_zh_TW.js +170 -0
- package/utils/crontab/crontabParser.d.ts +1 -0
- package/utils/crontab/crontabParser.js +251 -0
- package/utils/crontab/crontabRender.d.ts +23 -0
- package/utils/crontab/crontabRender.js +502 -0
- package/utils/crontab/index.d.ts +3 -0
- package/utils/crontab/index.js +9 -0
- package/utils/crontab/type.d.ts +79 -0
- package/utils/crontab/type.js +2 -0
- package/utils/crontab/utils.d.ts +20 -0
- package/utils/crontab/utils.js +122 -0
- package/utils/i18n.d.ts +13 -2
- package/utils/i18n.js +13 -2
- package/utils/index.d.ts +4 -0
- package/utils/index.js +19 -9
- package/utils/py.js +2 -0
- package/components/SearchBar/_FieldType.d.ts +0 -8
- package/components/SearchBar/_FieldType.js +0 -51
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchField.js +0 -0
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.d.ts +0 -0
package/deps/app-data/Const.js
CHANGED
|
@@ -1,10 +1,54 @@
|
|
|
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
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SOURCE_TYPE = exports.IMAGE_PREFIX = exports.API_PREFIX = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
17
|
+
exports.getSourceByName = exports.SOURCE_TYPE = exports.IMAGE_PREFIX = exports.API_PREFIX = void 0;
|
|
18
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
19
|
+
var PageUtil_1 = require("../../utils/PageUtil");
|
|
20
|
+
exports.API_PREFIX = (0, PageUtil_1.resolveURL)('/api-data');
|
|
21
|
+
exports.IMAGE_PREFIX = (0, PageUtil_1.resolveURL)('/data/images');
|
|
6
22
|
var SOURCE_TYPE;
|
|
7
23
|
(function (SOURCE_TYPE) {
|
|
8
24
|
SOURCE_TYPE[SOURCE_TYPE["ELASTIC"] = 1] = "ELASTIC";
|
|
9
25
|
SOURCE_TYPE[SOURCE_TYPE["MYSQL"] = 2] = "MYSQL";
|
|
26
|
+
SOURCE_TYPE[SOURCE_TYPE["DORIS"] = 5] = "DORIS";
|
|
10
27
|
})(SOURCE_TYPE || (exports.SOURCE_TYPE = SOURCE_TYPE = {}));
|
|
28
|
+
var getSourceByName = function (sourceName, sources) {
|
|
29
|
+
var e_1, _a;
|
|
30
|
+
var find = lodash_1.default.find(sources, { name: sourceName });
|
|
31
|
+
if (find)
|
|
32
|
+
return find;
|
|
33
|
+
var matched = [];
|
|
34
|
+
try {
|
|
35
|
+
for (var sources_1 = __values(sources), sources_1_1 = sources_1.next(); !sources_1_1.done; sources_1_1 = sources_1.next()) {
|
|
36
|
+
var source = sources_1_1.value;
|
|
37
|
+
var prefix = source.name.replace('-*', '').replace('*', '');
|
|
38
|
+
if (lodash_1.default.startsWith(sourceName, prefix)) {
|
|
39
|
+
matched.push(source);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
44
|
+
finally {
|
|
45
|
+
try {
|
|
46
|
+
if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
|
|
47
|
+
}
|
|
48
|
+
finally { if (e_1) throw e_1.error; }
|
|
49
|
+
}
|
|
50
|
+
if (matched.length == 0)
|
|
51
|
+
return { id: 0, title: sourceName, name: sourceName, type: 1 };
|
|
52
|
+
return lodash_1.default.orderBy(matched, function (item) { return item.name.length; }, 'desc')[0];
|
|
53
|
+
};
|
|
54
|
+
exports.getSourceByName = getSourceByName;
|
|
File without changes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// import dayjs from 'dayjs';
|
|
2
|
+
// import _ from 'lodash';
|
|
3
|
+
// // import type { Dayjs } from 'mo';
|
|
4
|
+
// const _toStart = mnt => mnt.millisecond(0).second(0).minute(0).hour(0);
|
|
5
|
+
// const _toEnd = mnt => mnt.millisecond(999).second(59).minute(59).hour(23);
|
|
6
|
+
// const _TODAY = _toEnd(dayjs());
|
|
7
|
+
// type RangeOption = {
|
|
8
|
+
// value: string,
|
|
9
|
+
// label: string,
|
|
10
|
+
// range: [Dayjs, Dayjs] | (() => [Dayjs, Dayjs]),
|
|
11
|
+
// }
|
|
12
|
+
// export const DEFAULT_TIME_RANGE = '1011';
|
|
13
|
+
// export const TIME_OPTION: RangeOption[] = [
|
|
14
|
+
// { value: "1001", label: "今天", range: [_toStart(dayjs()), _TODAY] },
|
|
15
|
+
// { value: "1002", label: "本周", range: [_toStart(dayjs().startOf('week')), _TODAY] },
|
|
16
|
+
// { value: "1003", label: "本月", range: [_toStart(dayjs().startOf('month')), _TODAY] },
|
|
17
|
+
// { value: "1004", label: "本年", range: [_toStart(dayjs().startOf('year')), _TODAY] },
|
|
18
|
+
// { value: "1005", label: "最近15分钟", range: () => [dayjs().subtract(15, 'minutes'), dayjs()] },
|
|
19
|
+
// { value: "1006", label: "最近30分钟", range: () => [dayjs().subtract(30, 'minutes'), dayjs()] },
|
|
20
|
+
// { value: "1007", label: "最近1小时", range: () => [dayjs().subtract(1, 'hours'), dayjs()] },
|
|
21
|
+
// { value: "1008", label: "最近4小时", range: () => [dayjs().subtract(4, 'hours'), dayjs()] },
|
|
22
|
+
// { value: "1009", label: "最近12小时", range: () => [dayjs().subtract(12, 'hours'), dayjs()] },
|
|
23
|
+
// { value: "1010", label: "最近24小时", range: () => [dayjs().subtract(24, 'hours'), dayjs()] },
|
|
24
|
+
// { value: "1013", label: "最近3天", range: [_toStart(dayjs().subtract(3, 'days')), _TODAY] },
|
|
25
|
+
// { value: "1011", label: "最近7天", range: [_toStart(dayjs().subtract(7, 'days')), _TODAY] },
|
|
26
|
+
// { value: "1012", label: "最近30天", range: [_toStart(dayjs().subtract(30, 'days')), _TODAY] },
|
|
27
|
+
// { value: "1014", label: "最近60天", range: [_toStart(dayjs().subtract(60, 'days')), _TODAY] },
|
|
28
|
+
// { value: "1015", label: "最近90天", range: [_toStart(dayjs().subtract(90, 'days')), _TODAY] },
|
|
29
|
+
// { value: "1016", label: "最近6月", range: [_toStart(dayjs().subtract(6, 'months')), _TODAY] },
|
|
30
|
+
// { value: "1017", label: "最近1年", range: [_toStart(dayjs().subtract(1, 'years')), _TODAY] },
|
|
31
|
+
// ];
|
|
32
|
+
// export const TIME_MAP: Map<string, RangeOption> = new Map();
|
|
33
|
+
// TIME_OPTION.map(item => TIME_MAP.set(item.value, item));
|
|
34
|
+
// export const getRange = (id = DEFAULT_TIME_RANGE): [Dayjs, Dayjs] => {
|
|
35
|
+
// var opt = TIME_MAP.get(id);
|
|
36
|
+
// if (opt == null) {
|
|
37
|
+
// opt = TIME_MAP.get(DEFAULT_TIME_RANGE);
|
|
38
|
+
// }
|
|
39
|
+
// if (_.isFunction(opt.range)) {
|
|
40
|
+
// return opt.range();
|
|
41
|
+
// }
|
|
42
|
+
// return [opt.range[0].clone(), opt.range[1].clone()];
|
|
43
|
+
// }
|
|
44
|
+
// export const getTimeRange = (id = DEFAULT_TIME_RANGE): [string, string] => {
|
|
45
|
+
// let [start, end] = getRange(id);
|
|
46
|
+
// return [start.format('YYYY-MM-DD HH:mm:ss'), end.format('YYYY-MM-DD HH:mm:ss')]
|
|
47
|
+
// }
|
|
48
|
+
// export const getMomentRange = (id, def?: [Dayjs, Dayjs]): [Dayjs, Dayjs] => {
|
|
49
|
+
// if (id == null || id == 0 || id == '0') {
|
|
50
|
+
// if (_.isArray(def) && def.length == 2) {
|
|
51
|
+
// return def;
|
|
52
|
+
// }
|
|
53
|
+
// getRange(DEFAULT_TIME_RANGE);
|
|
54
|
+
// }
|
|
55
|
+
// return getRange(id);
|
|
56
|
+
// }
|
|
57
|
+
// export const DEFAULT_START = getRange()[0];
|
|
58
|
+
// export const DEFAULT_END = getRange()[1];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SOURCE_TYPE } from './Const';
|
|
2
|
+
import type { BaseOption } from '../../basetype';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import type { Source, SourceField } from './Const';
|
|
5
|
+
export declare const sourceTypeRender: (type: SOURCE_TYPE) => ReactNode;
|
|
6
|
+
export type UseDataSource = {
|
|
7
|
+
sourceLoading: boolean;
|
|
8
|
+
all: Source[];
|
|
9
|
+
sourceMap: Map<number, Source>;
|
|
10
|
+
nameMap: Map<string, number>;
|
|
11
|
+
es: Source[];
|
|
12
|
+
mysql: Source[];
|
|
13
|
+
doris: Source[];
|
|
14
|
+
sourceOptions: BaseOption[];
|
|
15
|
+
esOptions: BaseOption[];
|
|
16
|
+
mysqlOptions: BaseOption[];
|
|
17
|
+
dorisOptions: BaseOption[];
|
|
18
|
+
sourceIdRender: (id: number) => ReactNode;
|
|
19
|
+
sourceNameRender: (name: string) => ReactNode;
|
|
20
|
+
getSourceFiled: (sourceId: number) => Promise<SourceField[]>;
|
|
21
|
+
};
|
|
22
|
+
export declare const useSource: () => UseDataSource;
|
|
@@ -1,162 +1,253 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
+
function step(op) {
|
|
49
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
+
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;
|
|
52
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
+
switch (op[0]) {
|
|
54
|
+
case 0: case 1: t = op; break;
|
|
55
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
+
default:
|
|
59
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
+
if (t[2]) _.ops.pop();
|
|
64
|
+
_.trys.pop(); continue;
|
|
65
|
+
}
|
|
66
|
+
op = body.call(thisArg, _);
|
|
67
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
72
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
73
|
+
if (!m) return o;
|
|
74
|
+
var i = m.call(o), r, ar = [], e;
|
|
75
|
+
try {
|
|
76
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
77
|
+
}
|
|
78
|
+
catch (error) { e = { error: error }; }
|
|
79
|
+
finally {
|
|
80
|
+
try {
|
|
81
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
82
|
+
}
|
|
83
|
+
finally { if (e) throw e.error; }
|
|
84
|
+
}
|
|
85
|
+
return ar;
|
|
86
|
+
};
|
|
87
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
88
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
89
|
+
};
|
|
90
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
91
|
+
exports.useSource = exports.sourceTypeRender = void 0;
|
|
92
|
+
var react_1 = __importStar(require("react"));
|
|
93
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
94
|
+
var utils_1 = require("../../utils");
|
|
95
|
+
var Icon_1 = require("../../components/_adapt/Icon");
|
|
96
|
+
var hooks_1 = require("../../hooks");
|
|
97
|
+
var Const_1 = require("./Const");
|
|
98
|
+
var SOURCE_API = Const_1.API_PREFIX + '/source';
|
|
99
|
+
var sourceTypeRender = function (type) {
|
|
100
|
+
switch (type) {
|
|
101
|
+
case Const_1.SOURCE_TYPE.ELASTIC:
|
|
102
|
+
return react_1.default.createElement("img", { src: "".concat(Const_1.IMAGE_PREFIX, "/source-type/elastic-search.svg"), height: 20, width: 58, style: { verticalAlign: 'middle' } });
|
|
103
|
+
case Const_1.SOURCE_TYPE.MYSQL:
|
|
104
|
+
return react_1.default.createElement("img", { src: "".concat(Const_1.IMAGE_PREFIX, "/source-type/mysql.svg"), height: 20, width: 30, style: { verticalAlign: 'middle' } });
|
|
105
|
+
case Const_1.SOURCE_TYPE.DORIS:
|
|
106
|
+
return react_1.default.createElement("img", { src: "".concat(Const_1.IMAGE_PREFIX, "/source-type/doris.svg"), height: 20, width: 59, style: { verticalAlign: 'middle' } });
|
|
107
|
+
default:
|
|
108
|
+
return react_1.default.createElement("img", { src: "".concat(Const_1.IMAGE_PREFIX, "/source-type/elastic-search.svg"), height: 20, width: 58, style: { verticalAlign: 'middle' } });
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
exports.sourceTypeRender = sourceTypeRender;
|
|
112
|
+
utils_1.Ajax.SESSION(SOURCE_API);
|
|
113
|
+
var DEFAULT = {
|
|
114
|
+
sourceLoading: true,
|
|
115
|
+
all: [],
|
|
116
|
+
es: [],
|
|
117
|
+
mysql: [],
|
|
118
|
+
doris: [],
|
|
119
|
+
sourceOptions: [],
|
|
120
|
+
esOptions: [],
|
|
121
|
+
mysqlOptions: [],
|
|
122
|
+
dorisOptions: [],
|
|
123
|
+
nameMap: new Map(),
|
|
124
|
+
sourceMap: new Map(),
|
|
125
|
+
};
|
|
126
|
+
var useSource = function () {
|
|
127
|
+
var _a = __read((0, hooks_1.useGlobal)('DATA_SOURCE', DEFAULT, { share: true, }), 3), _b = _a[0], sourceLoading = _b.sourceLoading, all = _b.all, es = _b.es, mysql = _b.mysql, doris = _b.doris, sourceOptions = _b.sourceOptions, esOptions = _b.esOptions, mysqlOptions = _b.mysqlOptions, dorisOptions = _b.dorisOptions, sourceMap = _b.sourceMap, nameMap = _b.nameMap, setState = _a[1], loaded = _a[2];
|
|
128
|
+
var reflush = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
129
|
+
var resp, es, mysql, doris, all, sourceMap, nameMap, sourceOptions, esOptions, mysqlOptions, dorisOptions;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
if (loaded)
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
return [4 /*yield*/, utils_1.Ajax.GET(SOURCE_API)];
|
|
136
|
+
case 1:
|
|
137
|
+
resp = _a.sent();
|
|
138
|
+
es = [];
|
|
139
|
+
mysql = [];
|
|
140
|
+
doris = [];
|
|
141
|
+
all = [];
|
|
142
|
+
sourceMap = new Map();
|
|
143
|
+
nameMap = new Map();
|
|
144
|
+
if (resp.code == '0') {
|
|
145
|
+
resp.data.map(function (item) {
|
|
146
|
+
all.push(item);
|
|
147
|
+
sourceMap.set(item.id, item);
|
|
148
|
+
nameMap.set(item.name, item.id);
|
|
149
|
+
if (item.type == Const_1.SOURCE_TYPE.ELASTIC) {
|
|
150
|
+
es.push(item);
|
|
151
|
+
}
|
|
152
|
+
else if (item.type == Const_1.SOURCE_TYPE.MYSQL) {
|
|
153
|
+
mysql.push(item);
|
|
154
|
+
}
|
|
155
|
+
else if (item.type == Const_1.SOURCE_TYPE.DORIS) {
|
|
156
|
+
doris.push(item);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
sourceOptions = [], esOptions = [], mysqlOptions = [], dorisOptions = [];
|
|
161
|
+
all.map(function (item) {
|
|
162
|
+
var option = {
|
|
163
|
+
value: item.id,
|
|
164
|
+
label: react_1.default.createElement("span", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
|
|
165
|
+
react_1.default.createElement("span", { style: { alignItems: 'center', display: 'flex' } },
|
|
166
|
+
(0, exports.sourceTypeRender)(item.type),
|
|
167
|
+
" ",
|
|
168
|
+
react_1.default.createElement("b", { style: { marginLeft: 4 } }, item.title)),
|
|
169
|
+
react_1.default.createElement("i", null, item.name))
|
|
170
|
+
};
|
|
171
|
+
sourceOptions.push(option);
|
|
172
|
+
if (item.type == Const_1.SOURCE_TYPE.ELASTIC) {
|
|
173
|
+
esOptions.push(option);
|
|
174
|
+
}
|
|
175
|
+
else if (item.type == Const_1.SOURCE_TYPE.MYSQL) {
|
|
176
|
+
mysqlOptions.push(option);
|
|
177
|
+
}
|
|
178
|
+
else if (item.type == Const_1.SOURCE_TYPE.DORIS) {
|
|
179
|
+
dorisOptions.push(option);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
setState({ sourceLoading: false, nameMap: nameMap, all: all, es: es, mysql: mysql, doris: doris, sourceOptions: sourceOptions, sourceMap: sourceMap, esOptions: esOptions, mysqlOptions: mysqlOptions, dorisOptions: dorisOptions });
|
|
183
|
+
return [2 /*return*/];
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}); };
|
|
187
|
+
(0, hooks_1.useEffectFunction)(reflush);
|
|
188
|
+
var getSourceFiled = (0, react_1.useCallback)(function (sourceId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
189
|
+
var API, resp;
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
API = "/api-data/source/field/".concat(sourceId);
|
|
194
|
+
utils_1.Ajax.SESSION(API);
|
|
195
|
+
return [4 /*yield*/, utils_1.Ajax.GET(API)];
|
|
196
|
+
case 1:
|
|
197
|
+
resp = _a.sent();
|
|
198
|
+
if (lodash_1.default.isArray(resp.data))
|
|
199
|
+
return [2 /*return*/, resp.data.filter(function (item) { return item.name != ''; })];
|
|
200
|
+
return [2 /*return*/, []];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}); }, []);
|
|
204
|
+
var sourceIdRender = (0, react_1.useCallback)(function (idStr, showIdx) {
|
|
205
|
+
if (showIdx === void 0) { showIdx = false; }
|
|
206
|
+
try {
|
|
207
|
+
var id = parseInt(idStr);
|
|
208
|
+
if (!sourceMap.has(id)) {
|
|
209
|
+
return '';
|
|
210
|
+
}
|
|
211
|
+
var source = sourceMap.get(id);
|
|
212
|
+
if (showIdx && source.title) {
|
|
213
|
+
return react_1.default.createElement("span", { style: { display: 'flex', alignItems: 'center', columnGap: 3 } },
|
|
214
|
+
source.icon && react_1.default.createElement(Icon_1.Icon, { type: source.icon }),
|
|
215
|
+
react_1.default.createElement("span", null,
|
|
216
|
+
source.title,
|
|
217
|
+
" ",
|
|
218
|
+
react_1.default.createElement("i", null,
|
|
219
|
+
"(",
|
|
220
|
+
source.name,
|
|
221
|
+
")")));
|
|
222
|
+
}
|
|
223
|
+
var txt = source.title || source.name;
|
|
224
|
+
return react_1.default.createElement("span", { style: { display: 'flex', alignItems: 'center', columnGap: 3 } },
|
|
225
|
+
source.icon && react_1.default.createElement(Icon_1.Icon, { type: source.icon }),
|
|
226
|
+
react_1.default.createElement("span", null, txt));
|
|
227
|
+
}
|
|
228
|
+
catch (_a) {
|
|
229
|
+
return utils_1.Const.NONE;
|
|
230
|
+
}
|
|
231
|
+
}, [sourceMap]);
|
|
232
|
+
var sourceNameRender = (0, react_1.useCallback)(function (sourceName) {
|
|
233
|
+
var source = (0, Const_1.getSourceByName)(sourceName, all);
|
|
234
|
+
return sourceIdRender(source.id);
|
|
235
|
+
}, [sourceMap]);
|
|
236
|
+
return {
|
|
237
|
+
sourceLoading: sourceLoading,
|
|
238
|
+
all: all,
|
|
239
|
+
sourceOptions: sourceOptions,
|
|
240
|
+
sourceMap: sourceMap,
|
|
241
|
+
nameMap: nameMap,
|
|
242
|
+
sourceIdRender: sourceIdRender,
|
|
243
|
+
sourceNameRender: sourceNameRender,
|
|
244
|
+
getSourceFiled: getSourceFiled,
|
|
245
|
+
es: es,
|
|
246
|
+
mysql: mysql,
|
|
247
|
+
doris: doris,
|
|
248
|
+
esOptions: esOptions,
|
|
249
|
+
mysqlOptions: mysqlOptions,
|
|
250
|
+
dorisOptions: dorisOptions,
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
exports.useSource = useSource;
|
package/deps/echarts.d.ts
CHANGED
package/deps/echarts.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __read = (this && this.__read) || function (o, n) {
|
|
26
36
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
37
|
if (!m) return o;
|
|
@@ -48,11 +58,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
48
58
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
49
59
|
};
|
|
50
60
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.EChart = void 0;
|
|
61
|
+
exports.EChart = exports.echarts = void 0;
|
|
52
62
|
var react_1 = __importStar(require("react"));
|
|
53
63
|
var utils_1 = require("../utils");
|
|
54
64
|
var _Support_1 = require("../utils/_Support");
|
|
55
|
-
|
|
65
|
+
exports.echarts = (0, _Support_1.globalDefault)('echarts', { init: function () {
|
|
56
66
|
var args = [];
|
|
57
67
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
58
68
|
args[_i] = arguments[_i];
|
|
@@ -74,7 +84,7 @@ var EChart = function (props) {
|
|
|
74
84
|
}, 33);
|
|
75
85
|
};
|
|
76
86
|
(0, react_1.useEffect)(function () {
|
|
77
|
-
graphRef.current = echarts.init(rootRef.current);
|
|
87
|
+
graphRef.current = exports.echarts.init(rootRef.current);
|
|
78
88
|
if (props.onClick) {
|
|
79
89
|
if (props.onClickType) {
|
|
80
90
|
graphRef.current.on('click', props.onClickType, function () {
|