amis-core 6.12.0-beta.10 → 6.12.0-beta.12
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/esm/Root.js +1 -1
- package/esm/RootRenderer.js +1 -1
- package/esm/SchemaRenderer.js +1 -1
- package/esm/Scoped.js +1 -1
- package/esm/StatusScoped.js +1 -1
- package/esm/StyleManager.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/actions/Action.js +1 -1
- package/esm/actions/AjaxAction.js +1 -1
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +1 -1
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +1 -1
- package/esm/actions/DialogAction.js +1 -1
- package/esm/actions/DrawerAction.js +1 -1
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/EventAction.js +1 -1
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/PrintAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/WaitAction.js +1 -1
- package/esm/components/Animations.js +1 -1
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.js +1 -1
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +1 -1
- package/esm/globalVar.js +1 -1
- package/esm/globalVarClientHandler.js +1 -1
- package/esm/globalVarDefaultValueHandler.js +1 -1
- package/esm/index.js +4 -4
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.js +1 -1
- package/esm/renderers/Item.js +1 -1
- package/esm/renderers/Options.js +1 -1
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/register.js +1 -1
- package/esm/renderers/wrapControl.js +1 -1
- package/esm/store/app.js +1 -1
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +4 -2
- package/esm/store/crud.js +27 -22
- package/esm/store/form.js +1 -1
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.js +4 -2
- package/esm/store/list.js +1 -1
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.js +1 -1
- package/esm/store/service.js +1 -1
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +1 -0
- package/esm/store/table.js +28 -20
- package/esm/store/table2.js +4 -3
- package/esm/theme.js +1 -1
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.js +1 -1
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/animations.js +1 -1
- package/esm/utils/api.js +1 -1
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/browser.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.js +1 -1
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.js +1 -1
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.js +1 -1
- package/esm/utils/filter.js +1 -1
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.js +1 -1
- package/esm/utils/getPageId.d.ts +1 -0
- package/esm/utils/getPageId.js +16 -0
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.js +1 -1
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.js +1 -1
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/labelToString.js +1 -1
- package/esm/utils/loopTooMuch.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.js +1 -1
- package/esm/utils/memoryParse.js +1 -1
- package/esm/utils/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.js +1 -1
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/printElement.js +1 -1
- package/esm/utils/renderer-event.js +1 -1
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveCondition.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style-helper.js +1 -1
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/esm/utils/visitedCache.js +1 -1
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.js +1 -1
- package/lib/Scoped.js +1 -1
- package/lib/StatusScoped.js +1 -1
- package/lib/StyleManager.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/actions/Action.js +1 -1
- package/lib/actions/AjaxAction.js +1 -1
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +1 -1
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +1 -1
- package/lib/actions/DialogAction.js +1 -1
- package/lib/actions/DrawerAction.js +1 -1
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/EventAction.js +1 -1
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/PrintAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/WaitAction.js +1 -1
- package/lib/components/Animations.js +1 -1
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.js +1 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +1 -1
- package/lib/globalVar.js +1 -1
- package/lib/globalVarClientHandler.js +1 -1
- package/lib/globalVarDefaultValueHandler.js +1 -1
- package/lib/index.js +4 -4
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.js +1 -1
- package/lib/renderers/Item.d.ts +1 -1
- package/lib/renderers/Item.js +1 -1
- package/lib/renderers/Options.js +1 -1
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/register.js +1 -1
- package/lib/renderers/wrapControl.js +1 -1
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +1 -0
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +4 -2
- package/lib/store/crud.js +27 -22
- package/lib/store/form.d.ts +1 -0
- package/lib/store/form.js +1 -1
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.js +4 -2
- package/lib/store/list.d.ts +1 -1
- package/lib/store/list.js +1 -1
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.js +1 -1
- package/lib/store/service.js +1 -1
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +2 -1
- package/lib/store/table.js +27 -19
- package/lib/store/table2.d.ts +1 -1
- package/lib/store/table2.js +4 -3
- package/lib/theme.js +1 -1
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.js +1 -1
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/animations.js +1 -1
- package/lib/utils/api.js +1 -1
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/browser.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.js +1 -1
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.js +1 -1
- package/lib/utils/filter.js +1 -1
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.js +1 -1
- package/lib/utils/getPageId.d.ts +1 -0
- package/lib/utils/getPageId.js +20 -0
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.js +1 -1
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/labelToString.js +1 -1
- package/lib/utils/loopTooMuch.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.js +1 -1
- package/lib/utils/memoryParse.js +1 -1
- package/lib/utils/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.js +1 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/printElement.js +1 -1
- package/lib/utils/renderer-event.js +1 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveCondition.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style-helper.js +1 -1
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/lib/utils/visitedCache.js +1 -1
- package/package.json +1 -1
package/esm/Root.js
CHANGED
package/esm/RootRenderer.js
CHANGED
package/esm/SchemaRenderer.js
CHANGED
package/esm/Scoped.js
CHANGED
package/esm/StatusScoped.js
CHANGED
package/esm/StyleManager.js
CHANGED
package/esm/WithRootStore.js
CHANGED
package/esm/WithStore.js
CHANGED
package/esm/actions/Action.js
CHANGED
package/esm/env.js
CHANGED
package/esm/envOverwrite.js
CHANGED
package/esm/factory.js
CHANGED
package/esm/globalVar.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.12.0-beta.
|
|
2
|
+
* amis-core v6.12.0-beta.12
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -154,10 +154,10 @@ export { StoreNode } from './store/node.js';
|
|
|
154
154
|
*/
|
|
155
155
|
var classPrefix = getClassPrefix();
|
|
156
156
|
// @ts-ignore
|
|
157
|
-
var version = '6.12.0-beta.
|
|
157
|
+
var version = '6.12.0-beta.12';
|
|
158
158
|
window.amisVersionInfo = {
|
|
159
|
-
version: '6.12.0-beta.
|
|
160
|
-
buildTime: '2025-03-
|
|
159
|
+
version: '6.12.0-beta.12',
|
|
160
|
+
buildTime: '2025-03-28T07:19:13.733Z'
|
|
161
161
|
};
|
|
162
162
|
function render(schema, _a, options, pathPrefix) {
|
|
163
163
|
if (_a === void 0) { _a = {}; }
|
package/esm/locale.js
CHANGED
package/esm/polyfills.js
CHANGED
package/esm/renderers/Form.js
CHANGED
package/esm/renderers/Item.js
CHANGED
package/esm/renderers/Options.js
CHANGED
package/esm/renderers/builtin.js
CHANGED
package/esm/store/app.js
CHANGED
package/esm/store/combo.js
CHANGED
package/esm/store/crud.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
58
58
|
items: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
59
59
|
selectedItems: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
60
60
|
unSelectedItems: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
61
|
-
|
|
61
|
+
filterTogglable: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
62
62
|
filterVisible: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
63
63
|
hasInnerModalOpen: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
64
64
|
}, {
|
|
@@ -139,12 +139,13 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
139
139
|
isTable2?: Boolean;
|
|
140
140
|
minLoadingTime?: number;
|
|
141
141
|
dataAppendTo?: 'top' | 'bottom';
|
|
142
|
+
totalField?: string;
|
|
142
143
|
}) => Promise<any>;
|
|
143
144
|
changePage: (page: number | string, perPage?: number | string) => void;
|
|
144
145
|
changePerPage: (perPage: number | string) => void;
|
|
145
146
|
selectAction: (action: ActionObject) => void;
|
|
146
147
|
saveRemote: (api: Api, data?: object, options?: fetchOptions) => Promise<any>;
|
|
147
|
-
setFilterTogglable: (
|
|
148
|
+
setFilterTogglable: (togglable: boolean, filterVisible?: boolean) => void;
|
|
148
149
|
setFilterVisible: (visible: boolean) => void;
|
|
149
150
|
setSelectedItems: (items: Array<any>) => void;
|
|
150
151
|
setUnSelectedItems: (items: Array<any>) => void;
|
|
@@ -152,6 +153,7 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
152
153
|
initFromScope: (scope: any, source: string, options: {
|
|
153
154
|
columns?: Array<any>;
|
|
154
155
|
matchFunc?: MatchFunc | null;
|
|
156
|
+
totalField?: string;
|
|
155
157
|
}) => void;
|
|
156
158
|
exportAsCSV: (options?: {
|
|
157
159
|
loadDataOnce?: boolean | undefined;
|
package/esm/store/crud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.12.0-beta.
|
|
2
|
+
* amis-core v6.12.0-beta.12
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -46,7 +46,7 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
46
46
|
items: types.optional(types.array(types.frozen()), []),
|
|
47
47
|
selectedItems: types.optional(types.array(types.frozen()), []),
|
|
48
48
|
unSelectedItems: types.optional(types.array(types.frozen()), []),
|
|
49
|
-
|
|
49
|
+
filterTogglable: false,
|
|
50
50
|
filterVisible: true,
|
|
51
51
|
hasInnerModalOpen: false
|
|
52
52
|
})
|
|
@@ -134,13 +134,13 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
134
134
|
}
|
|
135
135
|
var fetchInitData = flow(function getInitData(api, data, options) {
|
|
136
136
|
var startTime, rawItems, matchFunc, items, dir, data_1, ctx, json, elapsedTime, remainingTime_1, result, total, count, page, hasNext, oItems, oRows, columns, rest, items, _a, _b, key, rowsData, data_2, filteredItems, dir, e_1, env;
|
|
137
|
-
var _c, e_2,
|
|
138
|
-
var
|
|
137
|
+
var _c, _d, e_2, _e;
|
|
138
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
139
139
|
if (options === void 0) { options = {}; }
|
|
140
|
-
return __generator(this, function (
|
|
141
|
-
switch (
|
|
140
|
+
return __generator(this, function (_r) {
|
|
141
|
+
switch (_r.label) {
|
|
142
142
|
case 0:
|
|
143
|
-
|
|
143
|
+
_r.trys.push([0, 6, , 7]);
|
|
144
144
|
startTime = Date.now();
|
|
145
145
|
rawItems = options.source
|
|
146
146
|
? resolveVariableAndFilter(options.source, createObject(self.mergedData, {
|
|
@@ -161,8 +161,10 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
161
161
|
dir = /desc/i.test(self.query.orderDir) ? -1 : 1;
|
|
162
162
|
items = sortArray(items, self.query.orderBy, dir);
|
|
163
163
|
}
|
|
164
|
-
data_1 = __assign(__assign({}, self.data), { total
|
|
165
|
-
self.total =
|
|
164
|
+
data_1 = __assign(__assign({}, self.data), (_c = {}, _c[options.totalField || 'total'] = items.length, _c.items = items.slice((self.page - 1) * self.perPage, self.page * self.perPage), _c));
|
|
165
|
+
self.total =
|
|
166
|
+
parseInt((_f = data_1[options.totalField || 'total']) !== null && _f !== void 0 ? _f : data_1.count, 10) ||
|
|
167
|
+
0;
|
|
166
168
|
self.reInitData(data_1);
|
|
167
169
|
return [2 /*return*/];
|
|
168
170
|
}
|
|
@@ -172,17 +174,17 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
172
174
|
self.fetching = false;
|
|
173
175
|
}
|
|
174
176
|
options.silent || self.markFetching(true);
|
|
175
|
-
ctx = createObject(self.data, __assign(__assign(__assign({}, self.query), data), (
|
|
177
|
+
ctx = createObject(self.data, __assign(__assign(__assign({}, self.query), data), (_d = {}, _d[options.pageField || 'page'] = self.page, _d[options.perPageField || 'perPage'] = self.perPage, _d)));
|
|
176
178
|
// 一次性加载不要发送 perPage 属性
|
|
177
179
|
if (options.loadDataOnce) {
|
|
178
180
|
delete ctx[options.perPageField || 'perPage'];
|
|
179
181
|
}
|
|
180
182
|
return [4 /*yield*/, getEnv(self).fetcher(api, ctx, __assign(__assign({}, options), { cancelExecutor: function (executor) { return (fetchCancel = executor); } }))];
|
|
181
183
|
case 1:
|
|
182
|
-
json =
|
|
184
|
+
json = _r.sent();
|
|
183
185
|
fetchCancel = null;
|
|
184
186
|
if (!!json.ok) return [3 /*break*/, 2];
|
|
185
|
-
self.updateMessage((
|
|
187
|
+
self.updateMessage((_k = (_j = (_h = (_g = api === null || api === void 0 ? void 0 : api.messages) === null || _g === void 0 ? void 0 : _g.failed) !== null && _h !== void 0 ? _h : json.msg) !== null && _j !== void 0 ? _j : options.errorMessage) !== null && _k !== void 0 ? _k : self.__('CRUD.fetchFailed'), true);
|
|
186
188
|
!(api === null || api === void 0 ? void 0 : api.silent) &&
|
|
187
189
|
getEnv(self).notify('error', json.msg, json.msgTimeout !== undefined
|
|
188
190
|
? {
|
|
@@ -201,8 +203,8 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
201
203
|
if (!(remainingTime_1 > 0)) return [3 /*break*/, 4];
|
|
202
204
|
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, remainingTime_1); })];
|
|
203
205
|
case 3:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
_r.sent();
|
|
207
|
+
_r.label = 4;
|
|
206
208
|
case 4:
|
|
207
209
|
self.updatedAt = Date.now();
|
|
208
210
|
result = normalizeApiResponseData(json.data);
|
|
@@ -228,7 +230,7 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
228
230
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
229
231
|
finally {
|
|
230
232
|
try {
|
|
231
|
-
if (_b && !_b.done && (
|
|
233
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
232
234
|
}
|
|
233
235
|
finally { if (e_2) throw e_2.error; }
|
|
234
236
|
}
|
|
@@ -288,7 +290,9 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
288
290
|
self.reInitData(data_2, !!api.replaceData, api.concatDataFields);
|
|
289
291
|
options.syncResponse2Query !== false &&
|
|
290
292
|
updateQuery(pick(rest, Object.keys(self.query)), undefined, options.pageField || 'page', options.perPageField || 'perPage');
|
|
291
|
-
self.total =
|
|
293
|
+
self.total =
|
|
294
|
+
parseInt((_l = data_2[options.totalField || 'total']) !== null && _l !== void 0 ? _l : data_2.count, 10) ||
|
|
295
|
+
0;
|
|
292
296
|
typeof page !== 'undefined' && (self.page = parseInt(page, 10));
|
|
293
297
|
// 分页情况不清楚,只能知道有没有下一页。
|
|
294
298
|
if (typeof hasNext !== 'undefined') {
|
|
@@ -296,17 +300,17 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
296
300
|
self.total = 0;
|
|
297
301
|
self.hasNext = !!hasNext;
|
|
298
302
|
}
|
|
299
|
-
self.updateMessage((
|
|
303
|
+
self.updateMessage((_q = (_p = (_o = (_m = api.messages) === null || _m === void 0 ? void 0 : _m.success) !== null && _o !== void 0 ? _o : json.msg) !== null && _p !== void 0 ? _p : options.successMessage) !== null && _q !== void 0 ? _q : json.defaultMsg);
|
|
300
304
|
// 配置了获取成功提示后提示,默认是空不会提示。
|
|
301
305
|
options &&
|
|
302
306
|
options.successMessage &&
|
|
303
307
|
getEnv(self).notify('success', self.msg);
|
|
304
|
-
|
|
308
|
+
_r.label = 5;
|
|
305
309
|
case 5:
|
|
306
310
|
self.markFetching(false);
|
|
307
311
|
return [2 /*return*/, json];
|
|
308
312
|
case 6:
|
|
309
|
-
e_1 =
|
|
313
|
+
e_1 = _r.sent();
|
|
310
314
|
env = getEnv(self);
|
|
311
315
|
if (!isAlive(self) || self.disposed) {
|
|
312
316
|
return [2 /*return*/];
|
|
@@ -395,8 +399,8 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
395
399
|
}
|
|
396
400
|
});
|
|
397
401
|
});
|
|
398
|
-
var setFilterTogglable = function (
|
|
399
|
-
self.
|
|
402
|
+
var setFilterTogglable = function (togglable, filterVisible) {
|
|
403
|
+
self.filterTogglable = togglable;
|
|
400
404
|
filterVisible !== void 0 && (self.filterVisible = filterVisible);
|
|
401
405
|
};
|
|
402
406
|
var setFilterVisible = function (visible) {
|
|
@@ -439,7 +443,8 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
439
443
|
var data = __assign(__assign({}, self.pristine), { items: items.length > self.perPage
|
|
440
444
|
? items.slice((self.page - 1) * self.perPage, self.page * self.perPage)
|
|
441
445
|
: items, count: items.length, total: items.length });
|
|
442
|
-
self.total =
|
|
446
|
+
self.total =
|
|
447
|
+
parseInt((_a = data[options.totalField || 'total']) !== null && _a !== void 0 ? _a : data.count, 10) || 0;
|
|
443
448
|
self.items.replace(items);
|
|
444
449
|
self.reInitData(data);
|
|
445
450
|
};
|
package/esm/store/form.js
CHANGED
package/esm/store/formItem.js
CHANGED