@yibozhang/pro-table 0.0.1
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/README.md +24 -0
- package/bundles/yibozhang-pro-table.umd.js +3110 -0
- package/bundles/yibozhang-pro-table.umd.js.map +1 -0
- package/bundles/yibozhang-pro-table.umd.min.js +2 -0
- package/bundles/yibozhang-pro-table.umd.min.js.map +1 -0
- package/esm2015/lib/components/colmuns-setting/colmuns-setting.component.js +158 -0
- package/esm2015/lib/components/dynamic-search-field/dynamic-search-field.component.js +101 -0
- package/esm2015/lib/constants.js +89 -0
- package/esm2015/lib/page-container/page-container.component.js +21 -0
- package/esm2015/lib/page-container/page-container.module.js +25 -0
- package/esm2015/lib/page-public/antd-form.js +734 -0
- package/esm2015/lib/plate-input/plate-input.component.js +155 -0
- package/esm2015/lib/plate-input/plate-input.module.js +26 -0
- package/esm2015/lib/plate-input/plate-prefix-load.service.js +41 -0
- package/esm2015/lib/pro-table.component.js +983 -0
- package/esm2015/lib/pro-table.module.js +73 -0
- package/esm2015/lib/table-search-bar/table-search-bar-module.js +27 -0
- package/esm2015/lib/table-search-bar/table-search-bar.component.js +51 -0
- package/esm2015/lib/tokens.js +4 -0
- package/esm2015/lib/type.js +2 -0
- package/esm2015/public-api.js +12 -0
- package/esm2015/yibozhang-pro-table.js +13 -0
- package/fesm2015/yibozhang-pro-table.js +2448 -0
- package/fesm2015/yibozhang-pro-table.js.map +1 -0
- package/lib/components/colmuns-setting/colmuns-setting.component.d.ts +35 -0
- package/lib/components/colmuns-setting/colmuns-setting.component.d.ts.map +1 -0
- package/lib/components/dynamic-search-field/dynamic-search-field.component.d.ts +22 -0
- package/lib/components/dynamic-search-field/dynamic-search-field.component.d.ts.map +1 -0
- package/lib/constants.d.ts +20 -0
- package/lib/constants.d.ts.map +1 -0
- package/lib/page-container/page-container.component.d.ts +9 -0
- package/lib/page-container/page-container.component.d.ts.map +1 -0
- package/lib/page-container/page-container.module.d.ts +3 -0
- package/lib/page-container/page-container.module.d.ts.map +1 -0
- package/lib/page-public/antd-form.d.ts +99 -0
- package/lib/page-public/antd-form.d.ts.map +1 -0
- package/lib/plate-input/plate-input.component.d.ts +31 -0
- package/lib/plate-input/plate-input.component.d.ts.map +1 -0
- package/lib/plate-input/plate-input.module.d.ts +3 -0
- package/lib/plate-input/plate-input.module.d.ts.map +1 -0
- package/lib/plate-input/plate-prefix-load.service.d.ts +13 -0
- package/lib/plate-input/plate-prefix-load.service.d.ts.map +1 -0
- package/lib/pro-table.component.d.ts +122 -0
- package/lib/pro-table.component.d.ts.map +1 -0
- package/lib/pro-table.module.d.ts +3 -0
- package/lib/pro-table.module.d.ts.map +1 -0
- package/lib/table-search-bar/table-search-bar-module.d.ts +3 -0
- package/lib/table-search-bar/table-search-bar-module.d.ts.map +1 -0
- package/lib/table-search-bar/table-search-bar.component.d.ts +15 -0
- package/lib/table-search-bar/table-search-bar.component.d.ts.map +1 -0
- package/lib/tokens.d.ts +36 -0
- package/lib/tokens.d.ts.map +1 -0
- package/lib/type.d.ts +226 -0
- package/lib/type.d.ts.map +1 -0
- package/package.json +40 -0
- package/public-api.d.ts +9 -0
- package/public-api.d.ts.map +1 -0
- package/src/lib/styles/custom-antd.less +114 -0
- package/src/lib/styles/margin.css +90 -0
- package/src/lib/styles/theme.less +42 -0
- package/yibozhang-pro-table.d.ts +13 -0
- package/yibozhang-pro-table.d.ts.map +1 -0
- package/yibozhang-pro-table.metadata.json +1 -0
|
@@ -0,0 +1,3110 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('lodash-es'), require('rxjs'), require('@angular/cdk/drag-drop'), require('@angular/common'), require('@angular/common/http'), require('@angular/forms'), require('@angular/router'), require('ng-zorro-antd/button'), require('ng-zorro-antd/checkbox'), require('ng-zorro-antd/date-picker'), require('ng-zorro-antd/form'), require('ng-zorro-antd/grid'), require('ng-zorro-antd/icon'), require('ng-zorro-antd/input'), require('ng-zorro-antd/modal'), require('ng-zorro-antd/popover'), require('ng-zorro-antd/select'), require('ng-zorro-antd/space'), require('ng-zorro-antd/table'), require('ng-zorro-antd/typography'), require('ng-zorro-antd/card'), require('sortablejs'), require('ng-zorro-antd/auto-complete'), require('ng-zorro-antd/input-number'), require('ng-zorro-antd/tooltip'), require('rxjs/operators')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@yibozhang/pro-table', ['exports', '@angular/core', 'lodash-es', 'rxjs', '@angular/cdk/drag-drop', '@angular/common', '@angular/common/http', '@angular/forms', '@angular/router', 'ng-zorro-antd/button', 'ng-zorro-antd/checkbox', 'ng-zorro-antd/date-picker', 'ng-zorro-antd/form', 'ng-zorro-antd/grid', 'ng-zorro-antd/icon', 'ng-zorro-antd/input', 'ng-zorro-antd/modal', 'ng-zorro-antd/popover', 'ng-zorro-antd/select', 'ng-zorro-antd/space', 'ng-zorro-antd/table', 'ng-zorro-antd/typography', 'ng-zorro-antd/card', 'sortablejs', 'ng-zorro-antd/auto-complete', 'ng-zorro-antd/input-number', 'ng-zorro-antd/tooltip', 'rxjs/operators'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.yibozhang = global.yibozhang || {}, global.yibozhang['pro-table'] = {}), global.ng.core, global.lodashEs, global.rxjs, global.ng.cdk.dragDrop, global.ng.common, global.ng.common.http, global.ng.forms, global.ng.router, global.button, global.checkbox, global.datePicker, global.form, global.grid, global.icon, global.input, global.modal, global.popover, global.select, global.space, global.table, global.typography, global.card, global.Sortable, global.autoComplete, global.inputNumber, global.tooltip, global.rxjs.operators));
|
|
5
|
+
}(this, (function (exports, i0, lodashEs, rxjs, dragDrop, common, http, i1, router, button, checkbox, datePicker, form, grid, icon, input, modal, popover, select, space, table, typography, card, Sortable, autoComplete, inputNumber, tooltip, operators) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var Sortable__default = /*#__PURE__*/_interopDefaultLegacy(Sortable);
|
|
10
|
+
|
|
11
|
+
/******************************************************************************
|
|
12
|
+
Copyright (c) Microsoft Corporation.
|
|
13
|
+
|
|
14
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
15
|
+
purpose with or without fee is hereby granted.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
19
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
21
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
***************************************************************************** */
|
|
25
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
26
|
+
var extendStatics = function (d, b) {
|
|
27
|
+
extendStatics = Object.setPrototypeOf ||
|
|
28
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
29
|
+
function (d, b) { for (var p in b)
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
31
|
+
d[p] = b[p]; };
|
|
32
|
+
return extendStatics(d, b);
|
|
33
|
+
};
|
|
34
|
+
function __extends(d, b) {
|
|
35
|
+
if (typeof b !== "function" && b !== null)
|
|
36
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
37
|
+
extendStatics(d, b);
|
|
38
|
+
function __() { this.constructor = d; }
|
|
39
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
40
|
+
}
|
|
41
|
+
var __assign = function () {
|
|
42
|
+
__assign = Object.assign || function __assign(t) {
|
|
43
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
44
|
+
s = arguments[i];
|
|
45
|
+
for (var p in s)
|
|
46
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
47
|
+
t[p] = s[p];
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
};
|
|
51
|
+
return __assign.apply(this, arguments);
|
|
52
|
+
};
|
|
53
|
+
function __rest(s, e) {
|
|
54
|
+
var t = {};
|
|
55
|
+
for (var p in s)
|
|
56
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
57
|
+
t[p] = s[p];
|
|
58
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
59
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
60
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
61
|
+
t[p[i]] = s[p[i]];
|
|
62
|
+
}
|
|
63
|
+
return t;
|
|
64
|
+
}
|
|
65
|
+
function __decorate(decorators, target, key, desc) {
|
|
66
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
67
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
68
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
69
|
+
else
|
|
70
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
71
|
+
if (d = decorators[i])
|
|
72
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
73
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
74
|
+
}
|
|
75
|
+
function __param(paramIndex, decorator) {
|
|
76
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
77
|
+
}
|
|
78
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
79
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
|
80
|
+
throw new TypeError("Function expected"); return f; }
|
|
81
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
82
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
83
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
84
|
+
var _, done = false;
|
|
85
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
86
|
+
var context = {};
|
|
87
|
+
for (var p in contextIn)
|
|
88
|
+
context[p] = p === "access" ? {} : contextIn[p];
|
|
89
|
+
for (var p in contextIn.access)
|
|
90
|
+
context.access[p] = contextIn.access[p];
|
|
91
|
+
context.addInitializer = function (f) { if (done)
|
|
92
|
+
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
93
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
94
|
+
if (kind === "accessor") {
|
|
95
|
+
if (result === void 0)
|
|
96
|
+
continue;
|
|
97
|
+
if (result === null || typeof result !== "object")
|
|
98
|
+
throw new TypeError("Object expected");
|
|
99
|
+
if (_ = accept(result.get))
|
|
100
|
+
descriptor.get = _;
|
|
101
|
+
if (_ = accept(result.set))
|
|
102
|
+
descriptor.set = _;
|
|
103
|
+
if (_ = accept(result.init))
|
|
104
|
+
initializers.unshift(_);
|
|
105
|
+
}
|
|
106
|
+
else if (_ = accept(result)) {
|
|
107
|
+
if (kind === "field")
|
|
108
|
+
initializers.unshift(_);
|
|
109
|
+
else
|
|
110
|
+
descriptor[key] = _;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (target)
|
|
114
|
+
Object.defineProperty(target, contextIn.name, descriptor);
|
|
115
|
+
done = true;
|
|
116
|
+
}
|
|
117
|
+
;
|
|
118
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
119
|
+
var useValue = arguments.length > 2;
|
|
120
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
121
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
122
|
+
}
|
|
123
|
+
return useValue ? value : void 0;
|
|
124
|
+
}
|
|
125
|
+
;
|
|
126
|
+
function __propKey(x) {
|
|
127
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
128
|
+
}
|
|
129
|
+
;
|
|
130
|
+
function __setFunctionName(f, name, prefix) {
|
|
131
|
+
if (typeof name === "symbol")
|
|
132
|
+
name = name.description ? "[".concat(name.description, "]") : "";
|
|
133
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
134
|
+
}
|
|
135
|
+
;
|
|
136
|
+
function __metadata(metadataKey, metadataValue) {
|
|
137
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
138
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
139
|
+
}
|
|
140
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
141
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
142
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
143
|
+
function fulfilled(value) { try {
|
|
144
|
+
step(generator.next(value));
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
reject(e);
|
|
148
|
+
} }
|
|
149
|
+
function rejected(value) { try {
|
|
150
|
+
step(generator["throw"](value));
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
reject(e);
|
|
154
|
+
} }
|
|
155
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
156
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function __generator(thisArg, body) {
|
|
160
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
161
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
162
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
163
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
164
|
+
function step(op) {
|
|
165
|
+
if (f)
|
|
166
|
+
throw new TypeError("Generator is already executing.");
|
|
167
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
168
|
+
try {
|
|
169
|
+
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)
|
|
170
|
+
return t;
|
|
171
|
+
if (y = 0, t)
|
|
172
|
+
op = [op[0] & 2, t.value];
|
|
173
|
+
switch (op[0]) {
|
|
174
|
+
case 0:
|
|
175
|
+
case 1:
|
|
176
|
+
t = op;
|
|
177
|
+
break;
|
|
178
|
+
case 4:
|
|
179
|
+
_.label++;
|
|
180
|
+
return { value: op[1], done: false };
|
|
181
|
+
case 5:
|
|
182
|
+
_.label++;
|
|
183
|
+
y = op[1];
|
|
184
|
+
op = [0];
|
|
185
|
+
continue;
|
|
186
|
+
case 7:
|
|
187
|
+
op = _.ops.pop();
|
|
188
|
+
_.trys.pop();
|
|
189
|
+
continue;
|
|
190
|
+
default:
|
|
191
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
192
|
+
_ = 0;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
196
|
+
_.label = op[1];
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
200
|
+
_.label = t[1];
|
|
201
|
+
t = op;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
if (t && _.label < t[2]) {
|
|
205
|
+
_.label = t[2];
|
|
206
|
+
_.ops.push(op);
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
if (t[2])
|
|
210
|
+
_.ops.pop();
|
|
211
|
+
_.trys.pop();
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
op = body.call(thisArg, _);
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
op = [6, e];
|
|
218
|
+
y = 0;
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
f = t = 0;
|
|
222
|
+
}
|
|
223
|
+
if (op[0] & 5)
|
|
224
|
+
throw op[1];
|
|
225
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
229
|
+
if (k2 === undefined)
|
|
230
|
+
k2 = k;
|
|
231
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
232
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
233
|
+
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
234
|
+
}
|
|
235
|
+
Object.defineProperty(o, k2, desc);
|
|
236
|
+
}) : (function (o, m, k, k2) {
|
|
237
|
+
if (k2 === undefined)
|
|
238
|
+
k2 = k;
|
|
239
|
+
o[k2] = m[k];
|
|
240
|
+
});
|
|
241
|
+
function __exportStar(m, o) {
|
|
242
|
+
for (var p in m)
|
|
243
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
244
|
+
__createBinding(o, m, p);
|
|
245
|
+
}
|
|
246
|
+
function __values(o) {
|
|
247
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
248
|
+
if (m)
|
|
249
|
+
return m.call(o);
|
|
250
|
+
if (o && typeof o.length === "number")
|
|
251
|
+
return {
|
|
252
|
+
next: function () {
|
|
253
|
+
if (o && i >= o.length)
|
|
254
|
+
o = void 0;
|
|
255
|
+
return { value: o && o[i++], done: !o };
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
259
|
+
}
|
|
260
|
+
function __read(o, n) {
|
|
261
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
262
|
+
if (!m)
|
|
263
|
+
return o;
|
|
264
|
+
var i = m.call(o), r, ar = [], e;
|
|
265
|
+
try {
|
|
266
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
267
|
+
ar.push(r.value);
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
e = { error: error };
|
|
271
|
+
}
|
|
272
|
+
finally {
|
|
273
|
+
try {
|
|
274
|
+
if (r && !r.done && (m = i["return"]))
|
|
275
|
+
m.call(i);
|
|
276
|
+
}
|
|
277
|
+
finally {
|
|
278
|
+
if (e)
|
|
279
|
+
throw e.error;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return ar;
|
|
283
|
+
}
|
|
284
|
+
/** @deprecated */
|
|
285
|
+
function __spread() {
|
|
286
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
287
|
+
ar = ar.concat(__read(arguments[i]));
|
|
288
|
+
return ar;
|
|
289
|
+
}
|
|
290
|
+
/** @deprecated */
|
|
291
|
+
function __spreadArrays() {
|
|
292
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
293
|
+
s += arguments[i].length;
|
|
294
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
295
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
296
|
+
r[k] = a[j];
|
|
297
|
+
return r;
|
|
298
|
+
}
|
|
299
|
+
function __spreadArray(to, from, pack) {
|
|
300
|
+
if (pack || arguments.length === 2)
|
|
301
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
302
|
+
if (ar || !(i in from)) {
|
|
303
|
+
if (!ar)
|
|
304
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
305
|
+
ar[i] = from[i];
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
309
|
+
}
|
|
310
|
+
function __await(v) {
|
|
311
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
312
|
+
}
|
|
313
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
314
|
+
if (!Symbol.asyncIterator)
|
|
315
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
316
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
317
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
318
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
319
|
+
function verb(n, f) { if (g[n]) {
|
|
320
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); };
|
|
321
|
+
if (f)
|
|
322
|
+
i[n] = f(i[n]);
|
|
323
|
+
} }
|
|
324
|
+
function resume(n, v) { try {
|
|
325
|
+
step(g[n](v));
|
|
326
|
+
}
|
|
327
|
+
catch (e) {
|
|
328
|
+
settle(q[0][3], e);
|
|
329
|
+
} }
|
|
330
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
331
|
+
function fulfill(value) { resume("next", value); }
|
|
332
|
+
function reject(value) { resume("throw", value); }
|
|
333
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
334
|
+
resume(q[0][0], q[0][1]); }
|
|
335
|
+
}
|
|
336
|
+
function __asyncDelegator(o) {
|
|
337
|
+
var i, p;
|
|
338
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
339
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
340
|
+
}
|
|
341
|
+
function __asyncValues(o) {
|
|
342
|
+
if (!Symbol.asyncIterator)
|
|
343
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
344
|
+
var m = o[Symbol.asyncIterator], i;
|
|
345
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
346
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
347
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
348
|
+
}
|
|
349
|
+
function __makeTemplateObject(cooked, raw) {
|
|
350
|
+
if (Object.defineProperty) {
|
|
351
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
cooked.raw = raw;
|
|
355
|
+
}
|
|
356
|
+
return cooked;
|
|
357
|
+
}
|
|
358
|
+
;
|
|
359
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
360
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
361
|
+
}) : function (o, v) {
|
|
362
|
+
o["default"] = v;
|
|
363
|
+
};
|
|
364
|
+
var ownKeys = function (o) {
|
|
365
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
366
|
+
var ar = [];
|
|
367
|
+
for (var k in o)
|
|
368
|
+
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
369
|
+
ar[ar.length] = k;
|
|
370
|
+
return ar;
|
|
371
|
+
};
|
|
372
|
+
return ownKeys(o);
|
|
373
|
+
};
|
|
374
|
+
function __importStar(mod) {
|
|
375
|
+
if (mod && mod.__esModule)
|
|
376
|
+
return mod;
|
|
377
|
+
var result = {};
|
|
378
|
+
if (mod != null)
|
|
379
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
380
|
+
if (k[i] !== "default")
|
|
381
|
+
__createBinding(result, mod, k[i]);
|
|
382
|
+
__setModuleDefault(result, mod);
|
|
383
|
+
return result;
|
|
384
|
+
}
|
|
385
|
+
function __importDefault(mod) {
|
|
386
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
387
|
+
}
|
|
388
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
389
|
+
if (kind === "a" && !f)
|
|
390
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
391
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
392
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
393
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
394
|
+
}
|
|
395
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
396
|
+
if (kind === "m")
|
|
397
|
+
throw new TypeError("Private method is not writable");
|
|
398
|
+
if (kind === "a" && !f)
|
|
399
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
400
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
401
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
402
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
403
|
+
}
|
|
404
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
405
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
406
|
+
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
407
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
408
|
+
}
|
|
409
|
+
function __addDisposableResource(env, value, async) {
|
|
410
|
+
if (value !== null && value !== void 0) {
|
|
411
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
412
|
+
throw new TypeError("Object expected.");
|
|
413
|
+
var dispose, inner;
|
|
414
|
+
if (async) {
|
|
415
|
+
if (!Symbol.asyncDispose)
|
|
416
|
+
throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
417
|
+
dispose = value[Symbol.asyncDispose];
|
|
418
|
+
}
|
|
419
|
+
if (dispose === void 0) {
|
|
420
|
+
if (!Symbol.dispose)
|
|
421
|
+
throw new TypeError("Symbol.dispose is not defined.");
|
|
422
|
+
dispose = value[Symbol.dispose];
|
|
423
|
+
if (async)
|
|
424
|
+
inner = dispose;
|
|
425
|
+
}
|
|
426
|
+
if (typeof dispose !== "function")
|
|
427
|
+
throw new TypeError("Object not disposable.");
|
|
428
|
+
if (inner)
|
|
429
|
+
dispose = function () { try {
|
|
430
|
+
inner.call(this);
|
|
431
|
+
}
|
|
432
|
+
catch (e) {
|
|
433
|
+
return Promise.reject(e);
|
|
434
|
+
} };
|
|
435
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
436
|
+
}
|
|
437
|
+
else if (async) {
|
|
438
|
+
env.stack.push({ async: true });
|
|
439
|
+
}
|
|
440
|
+
return value;
|
|
441
|
+
}
|
|
442
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
443
|
+
var e = new Error(message);
|
|
444
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
445
|
+
};
|
|
446
|
+
function __disposeResources(env) {
|
|
447
|
+
function fail(e) {
|
|
448
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
449
|
+
env.hasError = true;
|
|
450
|
+
}
|
|
451
|
+
var r, s = 0;
|
|
452
|
+
function next() {
|
|
453
|
+
while (r = env.stack.pop()) {
|
|
454
|
+
try {
|
|
455
|
+
if (!r.async && s === 1)
|
|
456
|
+
return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
457
|
+
if (r.dispose) {
|
|
458
|
+
var result = r.dispose.call(r.value);
|
|
459
|
+
if (r.async)
|
|
460
|
+
return s |= 2, Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
|
|
461
|
+
}
|
|
462
|
+
else
|
|
463
|
+
s |= 1;
|
|
464
|
+
}
|
|
465
|
+
catch (e) {
|
|
466
|
+
fail(e);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (s === 1)
|
|
470
|
+
return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
471
|
+
if (env.hasError)
|
|
472
|
+
throw env.error;
|
|
473
|
+
}
|
|
474
|
+
return next();
|
|
475
|
+
}
|
|
476
|
+
function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
477
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
478
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
479
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
return path;
|
|
483
|
+
}
|
|
484
|
+
var tslib_es6 = {
|
|
485
|
+
__extends: __extends,
|
|
486
|
+
__assign: __assign,
|
|
487
|
+
__rest: __rest,
|
|
488
|
+
__decorate: __decorate,
|
|
489
|
+
__param: __param,
|
|
490
|
+
__esDecorate: __esDecorate,
|
|
491
|
+
__runInitializers: __runInitializers,
|
|
492
|
+
__propKey: __propKey,
|
|
493
|
+
__setFunctionName: __setFunctionName,
|
|
494
|
+
__metadata: __metadata,
|
|
495
|
+
__awaiter: __awaiter,
|
|
496
|
+
__generator: __generator,
|
|
497
|
+
__createBinding: __createBinding,
|
|
498
|
+
__exportStar: __exportStar,
|
|
499
|
+
__values: __values,
|
|
500
|
+
__read: __read,
|
|
501
|
+
__spread: __spread,
|
|
502
|
+
__spreadArrays: __spreadArrays,
|
|
503
|
+
__spreadArray: __spreadArray,
|
|
504
|
+
__await: __await,
|
|
505
|
+
__asyncGenerator: __asyncGenerator,
|
|
506
|
+
__asyncDelegator: __asyncDelegator,
|
|
507
|
+
__asyncValues: __asyncValues,
|
|
508
|
+
__makeTemplateObject: __makeTemplateObject,
|
|
509
|
+
__importStar: __importStar,
|
|
510
|
+
__importDefault: __importDefault,
|
|
511
|
+
__classPrivateFieldGet: __classPrivateFieldGet,
|
|
512
|
+
__classPrivateFieldSet: __classPrivateFieldSet,
|
|
513
|
+
__classPrivateFieldIn: __classPrivateFieldIn,
|
|
514
|
+
__addDisposableResource: __addDisposableResource,
|
|
515
|
+
__disposeResources: __disposeResources,
|
|
516
|
+
__rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
var ɵ0 = function () { return []; }, ɵ1 = function (value) { return "" + value; }, ɵ2 = function (value) { return value; };
|
|
520
|
+
var PRO_TABLE_DEFAULT_PROPS = {
|
|
521
|
+
input: {
|
|
522
|
+
name: "",
|
|
523
|
+
placeHolder: "",
|
|
524
|
+
disabled: false,
|
|
525
|
+
label: "",
|
|
526
|
+
value: "",
|
|
527
|
+
},
|
|
528
|
+
select: {
|
|
529
|
+
name: "",
|
|
530
|
+
options: [],
|
|
531
|
+
disabled: false,
|
|
532
|
+
label: "",
|
|
533
|
+
value: "",
|
|
534
|
+
allowClear: true,
|
|
535
|
+
placeHolder: "",
|
|
536
|
+
},
|
|
537
|
+
selectMultiple: {
|
|
538
|
+
name: "",
|
|
539
|
+
options: [],
|
|
540
|
+
disabled: false,
|
|
541
|
+
label: "",
|
|
542
|
+
value: [],
|
|
543
|
+
allowClear: true,
|
|
544
|
+
placeHolder: "请选择",
|
|
545
|
+
},
|
|
546
|
+
inputPlate: {
|
|
547
|
+
name: "",
|
|
548
|
+
label: "",
|
|
549
|
+
value: "",
|
|
550
|
+
},
|
|
551
|
+
checkbox: {
|
|
552
|
+
name: "",
|
|
553
|
+
options: [],
|
|
554
|
+
disabled: false,
|
|
555
|
+
label: "",
|
|
556
|
+
value: [],
|
|
557
|
+
noStyle: false,
|
|
558
|
+
},
|
|
559
|
+
date: {
|
|
560
|
+
name: "",
|
|
561
|
+
disabled: false,
|
|
562
|
+
label: "",
|
|
563
|
+
value: "",
|
|
564
|
+
allowClear: true,
|
|
565
|
+
placeHolder: "请选择",
|
|
566
|
+
showTime: false,
|
|
567
|
+
format: "yyyy-MM-dd",
|
|
568
|
+
mode: "date",
|
|
569
|
+
},
|
|
570
|
+
autoComplete: {
|
|
571
|
+
name: "",
|
|
572
|
+
disabled: false,
|
|
573
|
+
placeHolder: "请输入",
|
|
574
|
+
label: "",
|
|
575
|
+
value: "",
|
|
576
|
+
dataSource: ɵ0,
|
|
577
|
+
backFill: false,
|
|
578
|
+
defaultActiveFirstOption: false,
|
|
579
|
+
returnFullData: false,
|
|
580
|
+
},
|
|
581
|
+
inputNumber: {
|
|
582
|
+
name: "",
|
|
583
|
+
disabled: false,
|
|
584
|
+
label: "",
|
|
585
|
+
value: "",
|
|
586
|
+
placeHolder: "请输入",
|
|
587
|
+
min: 0,
|
|
588
|
+
max: 100,
|
|
589
|
+
precision: 0,
|
|
590
|
+
formatterPercent: ɵ1,
|
|
591
|
+
parserPercent: ɵ2,
|
|
592
|
+
},
|
|
593
|
+
custom: {
|
|
594
|
+
name: "",
|
|
595
|
+
value: null,
|
|
596
|
+
label: "",
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
var PRO_TABLE_DEFAULT_COLUMN = {
|
|
600
|
+
width: "",
|
|
601
|
+
align: "left",
|
|
602
|
+
fixedLeft: false,
|
|
603
|
+
fixedRight: false,
|
|
604
|
+
auxiliaryColumn: false,
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
var PRO_TABLE_COLUMN_REMOTE = new i0.InjectionToken("PRO_TABLE_COLUMN_REMOTE");
|
|
608
|
+
var PLATE_PREFIX_LOAD_SERVICE = new i0.InjectionToken("PLATE_PREFIX_LOAD_SERVICE");
|
|
609
|
+
|
|
610
|
+
var ProTableComponent = /** @class */ (function () {
|
|
611
|
+
function ProTableComponent(columnRemote) {
|
|
612
|
+
this.columnRemote = columnRemote;
|
|
613
|
+
this.showSearchBtn = true;
|
|
614
|
+
this.showClearBtn = true;
|
|
615
|
+
this.title = null;
|
|
616
|
+
this.tableName = "";
|
|
617
|
+
this.multiRow = false;
|
|
618
|
+
this.columns = [];
|
|
619
|
+
this.showSearchBar = true;
|
|
620
|
+
this.showActionBar = true;
|
|
621
|
+
this.confirmBtnText = "查询";
|
|
622
|
+
this.clearBtnText = "清空";
|
|
623
|
+
this.labelWidth = "90px";
|
|
624
|
+
this.labelAlign = "right";
|
|
625
|
+
this.dataSource = [];
|
|
626
|
+
this.bordered = true;
|
|
627
|
+
this.outerBordered = true;
|
|
628
|
+
this.showPagination = true;
|
|
629
|
+
this.frontPagination = false;
|
|
630
|
+
this.scroll = null;
|
|
631
|
+
this.summaryData = null;
|
|
632
|
+
// 排序模式:local 本地排序;server 在线排序(提交给接口)
|
|
633
|
+
this.sortMode = "local";
|
|
634
|
+
this.showColumnSetting = false;
|
|
635
|
+
// 是否开启多列排序(默认单列)
|
|
636
|
+
this.multipleSort = false;
|
|
637
|
+
this.showCheckbox = false;
|
|
638
|
+
// 判断行是否禁用的函数
|
|
639
|
+
this.rowDisabled = function () { return false; };
|
|
640
|
+
// 是否自动触发请求
|
|
641
|
+
this.autoTriggerRequest = true;
|
|
642
|
+
this.onRowClick = new i0.EventEmitter();
|
|
643
|
+
this.onRowDbClick = new i0.EventEmitter();
|
|
644
|
+
this.onValuesChange = new i0.EventEmitter();
|
|
645
|
+
this.onResetFormBeforeReload = new i0.EventEmitter();
|
|
646
|
+
this._savedSearchParams = {};
|
|
647
|
+
// 存储模板映射关系 - 通过字符串名称映射到模板引用
|
|
648
|
+
this.templateMap = new Map();
|
|
649
|
+
// 存储所有自定义模板的引用
|
|
650
|
+
this.customTemplates = new Map();
|
|
651
|
+
// 记录各列排序状态:'ascend' | 'descend' | null
|
|
652
|
+
this._sortMap = {};
|
|
653
|
+
// 记录多列排序的优先级(后设置的优先)
|
|
654
|
+
this._sortPriority = [];
|
|
655
|
+
// 存储每个 autoComplete 字段的防抖函数
|
|
656
|
+
this._autoCompleteDebounceMap = new Map();
|
|
657
|
+
// 仅在初始化时运行列配置预检查,避免后续调用重复触发
|
|
658
|
+
this._preCheckDone = false;
|
|
659
|
+
this._columns = [];
|
|
660
|
+
// 筛选表单数据存储
|
|
661
|
+
this._searchParams = {};
|
|
662
|
+
// 筛选表单list渲染数据
|
|
663
|
+
this._searchFiledColumns = [];
|
|
664
|
+
this._pageInfo = {
|
|
665
|
+
pageIndex: 1,
|
|
666
|
+
pageSize: 15,
|
|
667
|
+
total: 100,
|
|
668
|
+
pageSizeOptions: [10, 15, 20, 50, 100, 500, 1000],
|
|
669
|
+
};
|
|
670
|
+
this._loading = false;
|
|
671
|
+
this._selectedTableRow = null;
|
|
672
|
+
// 选中的行数据(用于复选框选择)
|
|
673
|
+
this._selectedRows = [];
|
|
674
|
+
// 全选状态
|
|
675
|
+
this._checkedAll = false;
|
|
676
|
+
// 半选状态(部分选中)
|
|
677
|
+
this._indeterminate = false;
|
|
678
|
+
// 远程columns
|
|
679
|
+
this._serverColumns = [];
|
|
680
|
+
// 存储 autoComplete 字段的数据源
|
|
681
|
+
this._autoCompleteDataSources = {};
|
|
682
|
+
}
|
|
683
|
+
ProTableComponent.prototype.fetchRemoteColumns = function () {
|
|
684
|
+
var _a;
|
|
685
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
686
|
+
var res, error_1;
|
|
687
|
+
return __generator(this, function (_d) {
|
|
688
|
+
switch (_d.label) {
|
|
689
|
+
case 0:
|
|
690
|
+
if (!((_a = this.columnRemote) === null || _a === void 0 ? void 0 : _a.getCol) || !this.tableName) {
|
|
691
|
+
return [2 /*return*/, null];
|
|
692
|
+
}
|
|
693
|
+
_d.label = 1;
|
|
694
|
+
case 1:
|
|
695
|
+
_d.trys.push([1, 3, , 4]);
|
|
696
|
+
return [4 /*yield*/, this.columnRemote.getCol(this.tableName, this.multiRow)];
|
|
697
|
+
case 2:
|
|
698
|
+
res = _d.sent();
|
|
699
|
+
return [2 /*return*/, res];
|
|
700
|
+
case 3:
|
|
701
|
+
error_1 = _d.sent();
|
|
702
|
+
return [2 /*return*/, null];
|
|
703
|
+
case 4: return [2 /*return*/];
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
});
|
|
707
|
+
};
|
|
708
|
+
ProTableComponent.prototype.persistRemoteColumns = function (columns) {
|
|
709
|
+
var _a;
|
|
710
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
711
|
+
var result, error_2;
|
|
712
|
+
return __generator(this, function (_d) {
|
|
713
|
+
switch (_d.label) {
|
|
714
|
+
case 0:
|
|
715
|
+
if (!((_a = this.columnRemote) === null || _a === void 0 ? void 0 : _a.setCol) || !this.tableName) {
|
|
716
|
+
return [2 /*return*/, null];
|
|
717
|
+
}
|
|
718
|
+
_d.label = 1;
|
|
719
|
+
case 1:
|
|
720
|
+
_d.trys.push([1, 4, , 5]);
|
|
721
|
+
result = this.columnRemote.setCol(this.tableName, columns, this.multiRow);
|
|
722
|
+
if (!(result && rxjs.isObservable(result))) return [3 /*break*/, 3];
|
|
723
|
+
return [4 /*yield*/, result.toPromise()];
|
|
724
|
+
case 2: return [2 /*return*/, _d.sent()];
|
|
725
|
+
case 3: return [2 /*return*/, result];
|
|
726
|
+
case 4:
|
|
727
|
+
error_2 = _d.sent();
|
|
728
|
+
return [2 /*return*/, null];
|
|
729
|
+
case 5: return [2 /*return*/];
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
});
|
|
733
|
+
};
|
|
734
|
+
ProTableComponent.prototype.ngOnInit = function () {
|
|
735
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
736
|
+
return __generator(this, function (_d) {
|
|
737
|
+
switch (_d.label) {
|
|
738
|
+
case 0:
|
|
739
|
+
this._searchParams = {};
|
|
740
|
+
this.formateInnerColumns(this.columns);
|
|
741
|
+
return [4 /*yield*/, this.setSearchParams(this.columns)];
|
|
742
|
+
case 1:
|
|
743
|
+
_d.sent();
|
|
744
|
+
// 使用 Proxy 包装 _searchParams,拦截表单项值变化并向外发出事件
|
|
745
|
+
this._searchParams = this.createSearchParamsProxy(this._searchParams);
|
|
746
|
+
if (this.autoTriggerRequest) {
|
|
747
|
+
this.handleQuery();
|
|
748
|
+
}
|
|
749
|
+
this.queryDynamicColumns();
|
|
750
|
+
return [2 /*return*/];
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
});
|
|
754
|
+
};
|
|
755
|
+
ProTableComponent.prototype.ngAfterContentInit = function () {
|
|
756
|
+
// 自动注册所有自定义模板
|
|
757
|
+
this.autoRegisterTemplates();
|
|
758
|
+
};
|
|
759
|
+
ProTableComponent.prototype.preCheckServerColumns = function () {
|
|
760
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
761
|
+
var res, initColumns, initRes;
|
|
762
|
+
return __generator(this, function (_d) {
|
|
763
|
+
switch (_d.label) {
|
|
764
|
+
case 0: return [4 /*yield*/, this.fetchRemoteColumns()];
|
|
765
|
+
case 1:
|
|
766
|
+
res = _d.sent();
|
|
767
|
+
if (!res)
|
|
768
|
+
return [2 /*return*/, false];
|
|
769
|
+
initColumns = this.columns
|
|
770
|
+
.filter(function (col) { return !col.auxiliaryColumn; })
|
|
771
|
+
.map(function (column) {
|
|
772
|
+
return {
|
|
773
|
+
field: column.prop,
|
|
774
|
+
isShow: !column.hideInTable,
|
|
775
|
+
header: column.title,
|
|
776
|
+
sortName: column.sortName || null,
|
|
777
|
+
};
|
|
778
|
+
});
|
|
779
|
+
if (!(res.code === 0)) return [3 /*break*/, 5];
|
|
780
|
+
if (!!lodashEs.isEqual(res.data.tabColumn, initColumns)) return [3 /*break*/, 3];
|
|
781
|
+
return [4 /*yield*/, this.persistRemoteColumns(initColumns)];
|
|
782
|
+
case 2:
|
|
783
|
+
initRes = _d.sent();
|
|
784
|
+
if (initRes) {
|
|
785
|
+
this.queryDynamicColumns();
|
|
786
|
+
}
|
|
787
|
+
return [2 /*return*/, false];
|
|
788
|
+
case 3:
|
|
789
|
+
console.log("一致");
|
|
790
|
+
return [2 /*return*/, true];
|
|
791
|
+
case 4: return [3 /*break*/, 6];
|
|
792
|
+
case 5: return [2 /*return*/, false];
|
|
793
|
+
case 6: return [2 /*return*/];
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
});
|
|
797
|
+
};
|
|
798
|
+
ProTableComponent.prototype.queryDynamicColumns = function () {
|
|
799
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
800
|
+
var checkResult, res, _tabColumn, initColumns, initRes;
|
|
801
|
+
return __generator(this, function (_d) {
|
|
802
|
+
switch (_d.label) {
|
|
803
|
+
case 0:
|
|
804
|
+
if (!this.tableName || !this.columnRemote)
|
|
805
|
+
return [2 /*return*/];
|
|
806
|
+
if (!!this._preCheckDone) return [3 /*break*/, 2];
|
|
807
|
+
return [4 /*yield*/, this.preCheckServerColumns()];
|
|
808
|
+
case 1:
|
|
809
|
+
checkResult = _d.sent();
|
|
810
|
+
this._preCheckDone = true;
|
|
811
|
+
if (!checkResult)
|
|
812
|
+
return [2 /*return*/];
|
|
813
|
+
_d.label = 2;
|
|
814
|
+
case 2: return [4 /*yield*/, this.fetchRemoteColumns()];
|
|
815
|
+
case 3:
|
|
816
|
+
res = _d.sent();
|
|
817
|
+
if (!res)
|
|
818
|
+
return [2 /*return*/];
|
|
819
|
+
if (!(res.code === 0)) return [3 /*break*/, 4];
|
|
820
|
+
_tabColumn = res.data.tabColumn.map(function (item) {
|
|
821
|
+
return {
|
|
822
|
+
title: item.header,
|
|
823
|
+
prop: item.field,
|
|
824
|
+
sortName: item.sortName,
|
|
825
|
+
hideInTable: !item.isShow,
|
|
826
|
+
};
|
|
827
|
+
});
|
|
828
|
+
this._serverColumns = _tabColumn;
|
|
829
|
+
this.updateTableColumns(_tabColumn);
|
|
830
|
+
return [3 /*break*/, 6];
|
|
831
|
+
case 4:
|
|
832
|
+
if (!(res.code === 10)) return [3 /*break*/, 6];
|
|
833
|
+
initColumns = this.columns
|
|
834
|
+
.filter(function (col) { return !col.auxiliaryColumn; })
|
|
835
|
+
.map(function (column) {
|
|
836
|
+
return {
|
|
837
|
+
field: column.prop,
|
|
838
|
+
isShow: true,
|
|
839
|
+
header: column.title,
|
|
840
|
+
sortName: column.sortName || null,
|
|
841
|
+
};
|
|
842
|
+
});
|
|
843
|
+
return [4 /*yield*/, this.persistRemoteColumns(initColumns)];
|
|
844
|
+
case 5:
|
|
845
|
+
initRes = _d.sent();
|
|
846
|
+
if (initRes) {
|
|
847
|
+
this.queryDynamicColumns();
|
|
848
|
+
}
|
|
849
|
+
_d.label = 6;
|
|
850
|
+
case 6: return [2 /*return*/];
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
});
|
|
854
|
+
};
|
|
855
|
+
ProTableComponent.prototype.formateInnerColumns = function (columns) {
|
|
856
|
+
this._columns = columns
|
|
857
|
+
.filter(function (item) { return !item.hideInTable; })
|
|
858
|
+
.map(function (item) {
|
|
859
|
+
return Object.assign(Object.assign({}, PRO_TABLE_DEFAULT_COLUMN), item);
|
|
860
|
+
});
|
|
861
|
+
};
|
|
862
|
+
// 自动注册模板的方法
|
|
863
|
+
ProTableComponent.prototype.autoRegisterTemplates = function () {
|
|
864
|
+
var _this = this;
|
|
865
|
+
// 获取所有需要自定义模板的列
|
|
866
|
+
var columnsWithCustomRender = this._columns.filter(function (col) { return col.customRender; });
|
|
867
|
+
if (columnsWithCustomRender.length > 0) {
|
|
868
|
+
// 尝试从ContentChildren中查找对应的模板
|
|
869
|
+
columnsWithCustomRender.forEach(function (column) {
|
|
870
|
+
var templateName = column.customRender;
|
|
871
|
+
var template = _this.findTemplateByName(templateName);
|
|
872
|
+
if (template) {
|
|
873
|
+
_this.customTemplates.set(templateName, template);
|
|
874
|
+
}
|
|
875
|
+
else {
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
// 获取所有需要自定义label模板的列(使用原始columns,确保顺序正确)
|
|
880
|
+
var columnsWithCustomLabel = this.columns.filter(function (col) { return col.customLabelRender; });
|
|
881
|
+
if (columnsWithCustomLabel.length > 0) {
|
|
882
|
+
// 尝试从ContentChildren中查找对应的label模板
|
|
883
|
+
columnsWithCustomLabel.forEach(function (column) {
|
|
884
|
+
var templateName = column.customLabelRender;
|
|
885
|
+
var template = _this.findLabelTemplateByName(templateName, columnsWithCustomLabel);
|
|
886
|
+
if (template) {
|
|
887
|
+
_this.customTemplates.set(templateName, template);
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
// 根据名称查找模板
|
|
895
|
+
ProTableComponent.prototype.findTemplateByName = function (templateName) {
|
|
896
|
+
return this.getTemplateFromContent(templateName);
|
|
897
|
+
};
|
|
898
|
+
// 从ContentChildren中查找指定名称的模板
|
|
899
|
+
ProTableComponent.prototype.getTemplateFromContent = function (templateName) {
|
|
900
|
+
var _this = this;
|
|
901
|
+
var customRenderColumns = this._columns.filter(function (col) { return col.customRender; });
|
|
902
|
+
var templateIndex = customRenderColumns.findIndex(function (col) { return col.customRender === templateName; });
|
|
903
|
+
if (templateIndex >= 0) {
|
|
904
|
+
// 获取所有模板,并过滤掉特殊模板(actionBar和ImgActionBar)
|
|
905
|
+
// 这样可以避免因为特殊模板的位置导致索引计算错误
|
|
906
|
+
var templates = this.allTemplates.toArray();
|
|
907
|
+
var customTemplates = templates.filter(function (tpl) { return tpl !== _this.actionBarTpl && tpl !== _this.imgActionBarTpl; });
|
|
908
|
+
if (templateIndex < customTemplates.length) {
|
|
909
|
+
var template = customTemplates[templateIndex];
|
|
910
|
+
return template;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
console.warn("\u672A\u627E\u5230\u6A21\u677F " + templateName);
|
|
914
|
+
return null;
|
|
915
|
+
};
|
|
916
|
+
// 根据名称查找label模板
|
|
917
|
+
ProTableComponent.prototype.findLabelTemplateByName = function (templateName, customLabelColumns) {
|
|
918
|
+
var _this = this;
|
|
919
|
+
var templateIndex = customLabelColumns.findIndex(function (col) { return col.customLabelRender === templateName; });
|
|
920
|
+
if (templateIndex >= 0) {
|
|
921
|
+
// 获取所有模板,并过滤掉特殊模板(actionBar和ImgActionBar)
|
|
922
|
+
var templates = this.allTemplates.toArray();
|
|
923
|
+
var customTemplates = templates.filter(function (tpl) { return tpl !== _this.actionBarTpl && tpl !== _this.imgActionBarTpl; });
|
|
924
|
+
// 计算label模板的索引:需要跳过所有的customRender模板
|
|
925
|
+
var customRenderColumns = this._columns.filter(function (col) { return col.customRender; });
|
|
926
|
+
var labelTemplateIndex = customRenderColumns.length + templateIndex;
|
|
927
|
+
if (labelTemplateIndex < customTemplates.length) {
|
|
928
|
+
var template = customTemplates[labelTemplateIndex];
|
|
929
|
+
return template;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
console.warn("\u672A\u627E\u5230label\u6A21\u677F " + templateName);
|
|
933
|
+
return null;
|
|
934
|
+
};
|
|
935
|
+
// 设置筛选表单默认属性
|
|
936
|
+
ProTableComponent.prototype.setSearchFormDefaultProp = function (columns) {
|
|
937
|
+
columns.forEach(function (item) {
|
|
938
|
+
if (item.valueType) {
|
|
939
|
+
if (item.fieldProps) {
|
|
940
|
+
item.fieldProps = Object.assign(Object.assign({}, PRO_TABLE_DEFAULT_PROPS[item.valueType]), item.fieldProps);
|
|
941
|
+
}
|
|
942
|
+
else {
|
|
943
|
+
item.fieldProps = Object.assign({}, PRO_TABLE_DEFAULT_PROPS[item.valueType]);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
};
|
|
948
|
+
// 动态设置Options
|
|
949
|
+
ProTableComponent.prototype.setSelectRequest = function (columns) {
|
|
950
|
+
var _this = this;
|
|
951
|
+
columns.map(function (item) { return __awaiter(_this, void 0, void 0, function () {
|
|
952
|
+
var _a, _b, options, error_3;
|
|
953
|
+
return __generator(this, function (_d) {
|
|
954
|
+
switch (_d.label) {
|
|
955
|
+
case 0:
|
|
956
|
+
if (!(item.fieldProps && lodashEs.hasIn(item.fieldProps, "request"))) return [3 /*break*/, 4];
|
|
957
|
+
_d.label = 1;
|
|
958
|
+
case 1:
|
|
959
|
+
_d.trys.push([1, 3, , 4]);
|
|
960
|
+
return [4 /*yield*/, ((_b = (_a = item.fieldProps).request) === null || _b === void 0 ? void 0 : _b.call(_a))];
|
|
961
|
+
case 2:
|
|
962
|
+
options = _d.sent();
|
|
963
|
+
item.fieldProps.options = options;
|
|
964
|
+
return [3 /*break*/, 4];
|
|
965
|
+
case 3:
|
|
966
|
+
error_3 = _d.sent();
|
|
967
|
+
item.fieldProps.options = [];
|
|
968
|
+
return [3 /*break*/, 4];
|
|
969
|
+
case 4: return [2 /*return*/];
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
}); });
|
|
973
|
+
};
|
|
974
|
+
ProTableComponent.prototype.setSearchParams = function (columns) {
|
|
975
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
976
|
+
var _this = this;
|
|
977
|
+
return __generator(this, function (_d) {
|
|
978
|
+
this._searchFiledColumns = [];
|
|
979
|
+
columns
|
|
980
|
+
.filter(function (item) {
|
|
981
|
+
var flag = !item.hideInSearch && item.valueType;
|
|
982
|
+
if (flag) {
|
|
983
|
+
_this._searchFiledColumns.push(lodashEs.cloneDeep(item));
|
|
984
|
+
}
|
|
985
|
+
return flag;
|
|
986
|
+
})
|
|
987
|
+
.forEach(function (column) {
|
|
988
|
+
var _a, _b, _c;
|
|
989
|
+
var key = ((_a = column.fieldProps) === null || _a === void 0 ? void 0 : _a.name) || column.prop;
|
|
990
|
+
var defaultValue = PRO_TABLE_DEFAULT_PROPS[column.valueType].value;
|
|
991
|
+
// 对于checkbox类型,从options中找出checked为true的项作为默认值
|
|
992
|
+
if (column.valueType === "checkbox") {
|
|
993
|
+
var checkedValues = (((_b = column.fieldProps) === null || _b === void 0 ? void 0 : _b.options) || [])
|
|
994
|
+
.filter(function (opt) { return opt.checked; })
|
|
995
|
+
.map(function (opt) { return opt.value; });
|
|
996
|
+
_this._searchParams[key] =
|
|
997
|
+
checkedValues.length > 0 ? checkedValues : defaultValue;
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
_this._searchParams[key] = ((_c = column.fieldProps) === null || _c === void 0 ? void 0 : _c.value) || defaultValue;
|
|
1001
|
+
}
|
|
1002
|
+
// 初始化 autoComplete 数据源
|
|
1003
|
+
if (column.valueType === "autoComplete") {
|
|
1004
|
+
_this._autoCompleteDataSources[key] = [];
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
// 根据列的 order 字段进行排序,未设置 order 的放在最后
|
|
1008
|
+
this._searchFiledColumns.sort(function (a, b) {
|
|
1009
|
+
var aOrder = lodashEs.isNil(a === null || a === void 0 ? void 0 : a.order) ? Number.MAX_SAFE_INTEGER : a.order;
|
|
1010
|
+
var bOrder = lodashEs.isNil(b === null || b === void 0 ? void 0 : b.order) ? Number.MAX_SAFE_INTEGER : b.order;
|
|
1011
|
+
if (aOrder === bOrder)
|
|
1012
|
+
return 0;
|
|
1013
|
+
return aOrder - bOrder;
|
|
1014
|
+
});
|
|
1015
|
+
this.setSearchFormDefaultProp(this._searchFiledColumns);
|
|
1016
|
+
// 并发加载所有需要异步获取的选项
|
|
1017
|
+
this.setSelectRequest(this._searchFiledColumns);
|
|
1018
|
+
return [2 /*return*/];
|
|
1019
|
+
});
|
|
1020
|
+
});
|
|
1021
|
+
};
|
|
1022
|
+
ProTableComponent.prototype.updateTableColumns = function (injectColumns) {
|
|
1023
|
+
// 1. 使用最原始的columns作为数据源,确保辅助列完全不受影响
|
|
1024
|
+
var originalColumns = lodashEs.cloneDeep(this.columns);
|
|
1025
|
+
// 2. 处理字段映射(如果提供了fields参数)
|
|
1026
|
+
var processedInjectColumns = injectColumns;
|
|
1027
|
+
// 3. 分离辅助列和非辅助列(使用原始数据)
|
|
1028
|
+
var nonAuxiliaryColumns = originalColumns.filter(function (col) { return !col.auxiliaryColumn; });
|
|
1029
|
+
// 4. 按照injectColumns的顺序重新排列非辅助列
|
|
1030
|
+
var reorderedNonAuxiliaryColumns = [];
|
|
1031
|
+
var remainingNonAuxiliaryColumns = __spread(nonAuxiliaryColumns); // 复制一份用于查找和移除
|
|
1032
|
+
processedInjectColumns.forEach(function (injectCol) {
|
|
1033
|
+
// 查找非辅助列中对应的下标
|
|
1034
|
+
var existingColIndex = remainingNonAuxiliaryColumns.findIndex(function (col) { return col.prop === injectCol.prop; });
|
|
1035
|
+
if (existingColIndex !== -1) {
|
|
1036
|
+
// 如果找到相同列,用injectColumns中的属性覆盖原始columns中的属性
|
|
1037
|
+
var existingCol = remainingNonAuxiliaryColumns[existingColIndex];
|
|
1038
|
+
var updatedCol = Object.assign(Object.assign({}, existingCol), injectCol);
|
|
1039
|
+
reorderedNonAuxiliaryColumns.push(updatedCol);
|
|
1040
|
+
// 从剩余数组中移除,避免重复
|
|
1041
|
+
remainingNonAuxiliaryColumns.splice(existingColIndex, 1);
|
|
1042
|
+
}
|
|
1043
|
+
else {
|
|
1044
|
+
// 如果没找到对应的列,直接添加injectColumns中的列
|
|
1045
|
+
reorderedNonAuxiliaryColumns.push(injectCol);
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
// 5. 处理剩余的原始columns中的非辅助列(在injectColumns中未出现的列)
|
|
1049
|
+
// 这些列应该被隐藏(设置hideInTable为true)
|
|
1050
|
+
remainingNonAuxiliaryColumns.forEach(function (remainingCol) {
|
|
1051
|
+
var hiddenCol = Object.assign(Object.assign({}, remainingCol), { hideInTable: true });
|
|
1052
|
+
reorderedNonAuxiliaryColumns.push(hiddenCol);
|
|
1053
|
+
});
|
|
1054
|
+
// 6. 按照原始columns的顺序重新组合:保持辅助列的原始位置和属性
|
|
1055
|
+
var finalColumns = [];
|
|
1056
|
+
var nonAuxiliaryIndex = 0;
|
|
1057
|
+
var auxiliaryIndex = 0;
|
|
1058
|
+
originalColumns.forEach(function (originalCol) {
|
|
1059
|
+
if (originalCol.auxiliaryColumn) {
|
|
1060
|
+
// 如果是辅助列,使用原始列数据,完全不进行任何修改
|
|
1061
|
+
finalColumns.push(originalCol);
|
|
1062
|
+
auxiliaryIndex++;
|
|
1063
|
+
}
|
|
1064
|
+
else {
|
|
1065
|
+
// 如果是非辅助列,使用重新排序后的列,但保留原始列的所有属性
|
|
1066
|
+
var reorderedCol = reorderedNonAuxiliaryColumns[nonAuxiliaryIndex];
|
|
1067
|
+
if (reorderedCol) {
|
|
1068
|
+
// 合并原始列和重新排序后的列,确保保留所有原始属性
|
|
1069
|
+
var mergedCol = Object.assign(Object.assign({}, originalCol), reorderedCol);
|
|
1070
|
+
finalColumns.push(mergedCol);
|
|
1071
|
+
}
|
|
1072
|
+
else {
|
|
1073
|
+
// 如果重新排序后的列不存在,使用原始列
|
|
1074
|
+
finalColumns.push(originalCol);
|
|
1075
|
+
}
|
|
1076
|
+
nonAuxiliaryIndex++;
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
this.formateInnerColumns(finalColumns);
|
|
1080
|
+
};
|
|
1081
|
+
// 通过 Proxy 监听 _searchParams 的属性变更
|
|
1082
|
+
ProTableComponent.prototype.createSearchParamsProxy = function (target) {
|
|
1083
|
+
var self = this;
|
|
1084
|
+
var handler = {
|
|
1085
|
+
set: function (obj, prop, value) {
|
|
1086
|
+
var key = String(prop);
|
|
1087
|
+
var oldVal = obj[key];
|
|
1088
|
+
if (oldVal === value) {
|
|
1089
|
+
obj[key] = value;
|
|
1090
|
+
return true;
|
|
1091
|
+
}
|
|
1092
|
+
obj[key] = value;
|
|
1093
|
+
try {
|
|
1094
|
+
self.onValuesChange.emit({
|
|
1095
|
+
key: key,
|
|
1096
|
+
value: value,
|
|
1097
|
+
params: self.getSearchParams(),
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
catch (e) { }
|
|
1101
|
+
return true;
|
|
1102
|
+
},
|
|
1103
|
+
};
|
|
1104
|
+
return new Proxy(target, handler);
|
|
1105
|
+
};
|
|
1106
|
+
ProTableComponent.prototype.clearEmptySearchParams = function () {
|
|
1107
|
+
var cloneSearchParams = lodashEs.cloneDeep(this._searchParams);
|
|
1108
|
+
return cloneSearchParams;
|
|
1109
|
+
};
|
|
1110
|
+
ProTableComponent.prototype.buildServerSortPayload = function () {
|
|
1111
|
+
var _this = this;
|
|
1112
|
+
// 构建激活排序集合(按优先级从低到高,末尾优先)
|
|
1113
|
+
var activeKeys = this._sortPriority.filter(function (k) { return !!_this._sortMap[k]; });
|
|
1114
|
+
if (activeKeys.length === 0)
|
|
1115
|
+
return null;
|
|
1116
|
+
var sorts = activeKeys.map(function (field) {
|
|
1117
|
+
// 查找对应的列配置,优先使用sortName字段
|
|
1118
|
+
var column = _this._columns.find(function (col) { return col.prop === field; });
|
|
1119
|
+
var sortField = (column === null || column === void 0 ? void 0 : column.sortName) || field;
|
|
1120
|
+
return {
|
|
1121
|
+
field: sortField,
|
|
1122
|
+
order: _this._sortMap[field],
|
|
1123
|
+
};
|
|
1124
|
+
});
|
|
1125
|
+
if (this.multipleSort) {
|
|
1126
|
+
return sorts; // 以数组形式提交多列排序
|
|
1127
|
+
}
|
|
1128
|
+
var _d = __read(sorts, 1), first = _d[0];
|
|
1129
|
+
return first; // 兼容单列结构 { field, order }
|
|
1130
|
+
};
|
|
1131
|
+
ProTableComponent.prototype.sortDataSourceInPlace = function () {
|
|
1132
|
+
var _this = this;
|
|
1133
|
+
if (!Array.isArray(this.dataSource) || this.dataSource.length === 0)
|
|
1134
|
+
return;
|
|
1135
|
+
var activeKeys = this._sortPriority.filter(function (k) { return !!_this._sortMap[k]; });
|
|
1136
|
+
if (activeKeys.length === 0)
|
|
1137
|
+
return;
|
|
1138
|
+
// 复制一份优先级,从前到后优先级从低到高(最后设置的字段优先)
|
|
1139
|
+
var keysInPriority = __spread(activeKeys);
|
|
1140
|
+
this.dataSource.sort(function (a, b) {
|
|
1141
|
+
for (var i = keysInPriority.length - 1; i >= 0; i--) {
|
|
1142
|
+
var field = keysInPriority[i];
|
|
1143
|
+
var order = _this._sortMap[field];
|
|
1144
|
+
var av = a === null || a === void 0 ? void 0 : a[field];
|
|
1145
|
+
var bv = b === null || b === void 0 ? void 0 : b[field];
|
|
1146
|
+
var cmp = _this.compareValues(av, bv);
|
|
1147
|
+
if (cmp !== 0)
|
|
1148
|
+
return order === "ascend" ? cmp : -cmp;
|
|
1149
|
+
}
|
|
1150
|
+
return 0;
|
|
1151
|
+
});
|
|
1152
|
+
};
|
|
1153
|
+
ProTableComponent.prototype.compareValues = function (aVal, bVal) {
|
|
1154
|
+
if (aVal == null && bVal == null)
|
|
1155
|
+
return 0;
|
|
1156
|
+
if (aVal == null)
|
|
1157
|
+
return -1;
|
|
1158
|
+
if (bVal == null)
|
|
1159
|
+
return 1;
|
|
1160
|
+
if (aVal instanceof Date && bVal instanceof Date) {
|
|
1161
|
+
return aVal.getTime() - bVal.getTime();
|
|
1162
|
+
}
|
|
1163
|
+
if (typeof aVal === "boolean" && typeof bVal === "boolean") {
|
|
1164
|
+
return aVal === bVal ? 0 : aVal ? 1 : -1;
|
|
1165
|
+
}
|
|
1166
|
+
if (typeof aVal === "number" && typeof bVal === "number") {
|
|
1167
|
+
return aVal - bVal;
|
|
1168
|
+
}
|
|
1169
|
+
if (typeof aVal === "string" && typeof bVal === "string") {
|
|
1170
|
+
return aVal.localeCompare(bVal);
|
|
1171
|
+
}
|
|
1172
|
+
var aNum = Number(aVal);
|
|
1173
|
+
var bNum = Number(bVal);
|
|
1174
|
+
if (!isNaN(aNum) && !isNaN(bNum))
|
|
1175
|
+
return aNum - bNum;
|
|
1176
|
+
return String(aVal).localeCompare(String(bVal));
|
|
1177
|
+
};
|
|
1178
|
+
// 执行 autoComplete 数据源查询(实际执行逻辑)
|
|
1179
|
+
ProTableComponent.prototype.executeAutoCompleteDataSource = function (event, column) {
|
|
1180
|
+
var _this = this;
|
|
1181
|
+
var _a;
|
|
1182
|
+
var fieldKey = ((_a = column.fieldProps) === null || _a === void 0 ? void 0 : _a.name) || column.prop;
|
|
1183
|
+
if (column.fieldProps.dataSource &&
|
|
1184
|
+
typeof column.fieldProps.dataSource ===
|
|
1185
|
+
"function") {
|
|
1186
|
+
try {
|
|
1187
|
+
var result = column.fieldProps.dataSource(event);
|
|
1188
|
+
// 如果返回的是 Promise,处理异步结果
|
|
1189
|
+
if (result instanceof Promise) {
|
|
1190
|
+
result
|
|
1191
|
+
.then(function (data) {
|
|
1192
|
+
_this._autoCompleteDataSources[fieldKey] = data || [];
|
|
1193
|
+
})
|
|
1194
|
+
.catch(function (error) {
|
|
1195
|
+
console.error("AutoComplete dataSource error:", error);
|
|
1196
|
+
_this._autoCompleteDataSources[fieldKey] = [];
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
else {
|
|
1200
|
+
// 同步返回结果
|
|
1201
|
+
this._autoCompleteDataSources[fieldKey] = result || [];
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
catch (error) {
|
|
1205
|
+
console.error("AutoComplete dataSource error:", error);
|
|
1206
|
+
this._autoCompleteDataSources[fieldKey] = [];
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
ProTableComponent.prototype.getSearchParams = function (options) {
|
|
1211
|
+
var _d = (options || {}).useSaved, useSaved = _d === void 0 ? false : _d;
|
|
1212
|
+
var rawParams = useSaved ? this._savedSearchParams : this._searchParams;
|
|
1213
|
+
var params = lodashEs.cloneDeep(rawParams || {});
|
|
1214
|
+
return Object.assign({ params: params, pageInfo: {
|
|
1215
|
+
pageIndex: this._pageInfo.pageIndex,
|
|
1216
|
+
pageSize: this._pageInfo.pageSize,
|
|
1217
|
+
} }, (this.sortMode === "server"
|
|
1218
|
+
? { sort: this.buildServerSortPayload() }
|
|
1219
|
+
: {}));
|
|
1220
|
+
};
|
|
1221
|
+
ProTableComponent.prototype.reload = function (afterDelete) {
|
|
1222
|
+
this.handleQuery(afterDelete);
|
|
1223
|
+
};
|
|
1224
|
+
ProTableComponent.prototype.setFieldsValue = function (fields) {
|
|
1225
|
+
var _this = this;
|
|
1226
|
+
Object.keys(fields).forEach(function (k) {
|
|
1227
|
+
_this._searchParams[k] = fields[k]; // 保留 Proxy,逐项赋值触发拦截
|
|
1228
|
+
});
|
|
1229
|
+
};
|
|
1230
|
+
ProTableComponent.prototype.setFieldValue = function (key, value) {
|
|
1231
|
+
this._searchParams[key] = value;
|
|
1232
|
+
};
|
|
1233
|
+
ProTableComponent.prototype.clearSelectedRow = function () {
|
|
1234
|
+
this._selectedTableRow = null;
|
|
1235
|
+
};
|
|
1236
|
+
ProTableComponent.prototype.setColumns = function (columns, options) {
|
|
1237
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1238
|
+
return __generator(this, function (_d) {
|
|
1239
|
+
switch (_d.label) {
|
|
1240
|
+
case 0:
|
|
1241
|
+
// 更新 columns 输入属性
|
|
1242
|
+
this.columns = lodashEs.cloneDeep(columns);
|
|
1243
|
+
// 重新格式化内部列
|
|
1244
|
+
this.formateInnerColumns(this.columns);
|
|
1245
|
+
// 重新设置搜索参数(异步操作)
|
|
1246
|
+
// 先清空旧的搜索参数,避免旧数据残留
|
|
1247
|
+
this._searchParams = {};
|
|
1248
|
+
return [4 /*yield*/, this.setSearchParams(this.columns)];
|
|
1249
|
+
case 1:
|
|
1250
|
+
_d.sent();
|
|
1251
|
+
// 重新创建 Proxy,确保表单项值变化能正常触发事件
|
|
1252
|
+
this._searchParams = this.createSearchParamsProxy(this._searchParams);
|
|
1253
|
+
// 重新注册模板(如果组件已经初始化完成)
|
|
1254
|
+
if (this.allTemplates) {
|
|
1255
|
+
this.autoRegisterTemplates();
|
|
1256
|
+
}
|
|
1257
|
+
// 如果设置了 reload 选项为 true,则重新查询数据
|
|
1258
|
+
if ((options === null || options === void 0 ? void 0 : options.reload) === true) {
|
|
1259
|
+
this.handleQuery();
|
|
1260
|
+
}
|
|
1261
|
+
return [2 /*return*/];
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
});
|
|
1265
|
+
};
|
|
1266
|
+
ProTableComponent.prototype.getSelectedRowData = function () {
|
|
1267
|
+
return this._selectedTableRow;
|
|
1268
|
+
};
|
|
1269
|
+
ProTableComponent.prototype.getCheckedRows = function () {
|
|
1270
|
+
return this._selectedRows;
|
|
1271
|
+
};
|
|
1272
|
+
// 获取指定名称的模板
|
|
1273
|
+
ProTableComponent.prototype.getTemplate = function (name) {
|
|
1274
|
+
if (!name)
|
|
1275
|
+
return null;
|
|
1276
|
+
try {
|
|
1277
|
+
// 首先从自定义模板中查找
|
|
1278
|
+
var customTemplate = this.customTemplates.get(name);
|
|
1279
|
+
if (customTemplate) {
|
|
1280
|
+
return customTemplate;
|
|
1281
|
+
}
|
|
1282
|
+
// 然后从通用模板映射中查找
|
|
1283
|
+
var template = this.templateMap.get(name);
|
|
1284
|
+
if (template) {
|
|
1285
|
+
return template;
|
|
1286
|
+
}
|
|
1287
|
+
return null;
|
|
1288
|
+
}
|
|
1289
|
+
catch (error) {
|
|
1290
|
+
return null;
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1293
|
+
ProTableComponent.prototype.getToolTipTextValue = function (column, data) {
|
|
1294
|
+
var key = column.customRender && this.getTemplate(column.customRender)
|
|
1295
|
+
? ""
|
|
1296
|
+
: column.ellipsis
|
|
1297
|
+
? column.prop
|
|
1298
|
+
: "";
|
|
1299
|
+
return !key ? "" : data[key];
|
|
1300
|
+
};
|
|
1301
|
+
ProTableComponent.prototype.getTableRowChecked = function (data) {
|
|
1302
|
+
// 启用复选框时:行高亮应与复选框选中状态一致(支持多选)
|
|
1303
|
+
if (this.showCheckbox) {
|
|
1304
|
+
return this.isRowChecked(data);
|
|
1305
|
+
}
|
|
1306
|
+
// 未启用复选框时:仍然使用单选行高亮
|
|
1307
|
+
if (!this._selectedTableRow)
|
|
1308
|
+
return false;
|
|
1309
|
+
return JSON.stringify(this._selectedTableRow) === JSON.stringify(data);
|
|
1310
|
+
};
|
|
1311
|
+
// 检查行是否被禁用
|
|
1312
|
+
ProTableComponent.prototype.isRowDisabled = function (data) {
|
|
1313
|
+
if (!this.showCheckbox)
|
|
1314
|
+
return false;
|
|
1315
|
+
return this.rowDisabled ? this.rowDisabled(data) : false;
|
|
1316
|
+
};
|
|
1317
|
+
// 检查行是否被复选框选中
|
|
1318
|
+
ProTableComponent.prototype.isRowChecked = function (data) {
|
|
1319
|
+
if (!this.showCheckbox)
|
|
1320
|
+
return false;
|
|
1321
|
+
return this._selectedRows.some(function (row) { return JSON.stringify(row) === JSON.stringify(data); });
|
|
1322
|
+
};
|
|
1323
|
+
// 切换行的选中状态
|
|
1324
|
+
ProTableComponent.prototype.toggleRowChecked = function (data, checked, event) {
|
|
1325
|
+
if (event) {
|
|
1326
|
+
event.stopPropagation(); // 阻止事件冒泡,避免触发行点击
|
|
1327
|
+
}
|
|
1328
|
+
// 如果行被禁用,不允许切换选中状态
|
|
1329
|
+
if (this.isRowDisabled(data)) {
|
|
1330
|
+
return;
|
|
1331
|
+
}
|
|
1332
|
+
var index = this._selectedRows.findIndex(function (row) { return JSON.stringify(row) === JSON.stringify(data); });
|
|
1333
|
+
if (checked) {
|
|
1334
|
+
// 选中
|
|
1335
|
+
if (index === -1) {
|
|
1336
|
+
this._selectedRows.push(data);
|
|
1337
|
+
}
|
|
1338
|
+
// 勾选复选框时同步设置高亮选中行
|
|
1339
|
+
this._selectedTableRow = data;
|
|
1340
|
+
}
|
|
1341
|
+
else {
|
|
1342
|
+
// 取消选中
|
|
1343
|
+
if (index > -1) {
|
|
1344
|
+
this._selectedRows.splice(index, 1);
|
|
1345
|
+
}
|
|
1346
|
+
// 若当前高亮行为该行,则取消高亮
|
|
1347
|
+
if (this._selectedTableRow &&
|
|
1348
|
+
JSON.stringify(this._selectedTableRow) === JSON.stringify(data)) {
|
|
1349
|
+
this._selectedTableRow = null;
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
this.updateCheckAllStatus();
|
|
1353
|
+
};
|
|
1354
|
+
// 更新全选状态
|
|
1355
|
+
ProTableComponent.prototype.updateCheckAllStatus = function () {
|
|
1356
|
+
var _this = this;
|
|
1357
|
+
if (!this.showCheckbox || !Array.isArray(this.dataSource)) {
|
|
1358
|
+
this._checkedAll = false;
|
|
1359
|
+
this._indeterminate = false;
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
// 只计算可用的行(未禁用的行)
|
|
1363
|
+
var availableRows = this.dataSource.filter(function (row) { return !_this.isRowDisabled(row); });
|
|
1364
|
+
var checkedCount = this._selectedRows.length;
|
|
1365
|
+
var totalCount = availableRows.length;
|
|
1366
|
+
this._checkedAll =
|
|
1367
|
+
totalCount > 0 && checkedCount > 0 && checkedCount === totalCount;
|
|
1368
|
+
this._indeterminate = checkedCount > 0 && checkedCount < totalCount;
|
|
1369
|
+
};
|
|
1370
|
+
// 全选/取消全选
|
|
1371
|
+
ProTableComponent.prototype.toggleCheckAll = function (checked, event) {
|
|
1372
|
+
var _this = this;
|
|
1373
|
+
if (event) {
|
|
1374
|
+
event.stopPropagation();
|
|
1375
|
+
}
|
|
1376
|
+
if (checked) {
|
|
1377
|
+
// 全选:只选中未禁用的行
|
|
1378
|
+
this._selectedRows = this.dataSource.filter(function (row) { return !_this.isRowDisabled(row); });
|
|
1379
|
+
// 同步设置高亮选中行为第一条可选数据
|
|
1380
|
+
var availableRows = this._selectedRows;
|
|
1381
|
+
this._selectedTableRow =
|
|
1382
|
+
availableRows.length > 0 ? availableRows[0] : null;
|
|
1383
|
+
}
|
|
1384
|
+
else {
|
|
1385
|
+
// 取消全选
|
|
1386
|
+
this._selectedRows = [];
|
|
1387
|
+
// 取消高亮
|
|
1388
|
+
this._selectedTableRow = null;
|
|
1389
|
+
}
|
|
1390
|
+
this.updateCheckAllStatus();
|
|
1391
|
+
};
|
|
1392
|
+
// 获取选中的行数据
|
|
1393
|
+
ProTableComponent.prototype.getSelectedRows = function () {
|
|
1394
|
+
return this._selectedRows;
|
|
1395
|
+
};
|
|
1396
|
+
// 清空选中的行
|
|
1397
|
+
ProTableComponent.prototype.clearSelectedRows = function () {
|
|
1398
|
+
this._selectedRows = [];
|
|
1399
|
+
this._checkedAll = false;
|
|
1400
|
+
this._indeterminate = false;
|
|
1401
|
+
this._selectedTableRow = null;
|
|
1402
|
+
};
|
|
1403
|
+
ProTableComponent.prototype.handleFieldCheckBoxChange = function (checkBoxOptions, key) {
|
|
1404
|
+
var _d;
|
|
1405
|
+
this.setFieldsValue((_d = {},
|
|
1406
|
+
_d[key] = checkBoxOptions
|
|
1407
|
+
.filter(function (item) { return item.checked; })
|
|
1408
|
+
.map(function (item) { return item.value; }),
|
|
1409
|
+
_d));
|
|
1410
|
+
};
|
|
1411
|
+
ProTableComponent.prototype.handleSearch = function () {
|
|
1412
|
+
this._savedSearchParams = this.clearEmptySearchParams();
|
|
1413
|
+
this._pageInfo.pageIndex = 1;
|
|
1414
|
+
this.handleQuery();
|
|
1415
|
+
};
|
|
1416
|
+
ProTableComponent.prototype.handleResetForm = function () {
|
|
1417
|
+
var _this = this;
|
|
1418
|
+
Object.keys(this._searchParams).forEach(function (key) {
|
|
1419
|
+
var targetColumn = _this._searchFiledColumns.find(function (item) {
|
|
1420
|
+
var _a;
|
|
1421
|
+
return (((_a = item.fieldProps) === null || _a === void 0 ? void 0 : _a.name) || item.prop) === key;
|
|
1422
|
+
});
|
|
1423
|
+
// 对于checkbox类型,需要特殊处理默认值
|
|
1424
|
+
if ((targetColumn === null || targetColumn === void 0 ? void 0 : targetColumn.valueType) === "checkbox") {
|
|
1425
|
+
// 从原始columns配置中获取初始配置,以确保使用正确的默认值
|
|
1426
|
+
var originalColumn = _this.columns.find(function (item) {
|
|
1427
|
+
var _a;
|
|
1428
|
+
return (((_a = item.fieldProps) === null || _a === void 0 ? void 0 : _a.name) || item.prop) === key;
|
|
1429
|
+
});
|
|
1430
|
+
// 从原始options中找出checked为true的项作为默认值
|
|
1431
|
+
var originalFieldProps = originalColumn === null || originalColumn === void 0 ? void 0 : originalColumn.fieldProps;
|
|
1432
|
+
var checkedValues = ((originalFieldProps === null || originalFieldProps === void 0 ? void 0 : originalFieldProps.options) || [])
|
|
1433
|
+
.filter(function (opt) { return opt.checked; })
|
|
1434
|
+
.map(function (opt) { return opt.value; });
|
|
1435
|
+
var defaultValue = checkedValues.length > 0
|
|
1436
|
+
? checkedValues
|
|
1437
|
+
: PRO_TABLE_DEFAULT_PROPS[targetColumn.valueType].value;
|
|
1438
|
+
_this._searchParams[key] = defaultValue;
|
|
1439
|
+
// 根据默认值恢复options的checked状态,使用原始options的结构
|
|
1440
|
+
var defaultValues_1 = Array.isArray(defaultValue) ? defaultValue : [];
|
|
1441
|
+
var originalOptions = (originalFieldProps === null || originalFieldProps === void 0 ? void 0 : originalFieldProps.options) || [];
|
|
1442
|
+
var targetFieldProps = targetColumn.fieldProps;
|
|
1443
|
+
targetFieldProps.options = originalOptions.map(function (item) {
|
|
1444
|
+
return Object.assign(Object.assign({}, item), { checked: defaultValues_1.includes(item.value) });
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
else {
|
|
1448
|
+
_this._searchParams[key] = (targetColumn === null || targetColumn === void 0 ? void 0 : targetColumn.fieldProps) ? (targetColumn === null || targetColumn === void 0 ? void 0 : targetColumn.fieldProps.value) ||
|
|
1449
|
+
PRO_TABLE_DEFAULT_PROPS[targetColumn.valueType].value
|
|
1450
|
+
: PRO_TABLE_DEFAULT_PROPS[targetColumn.valueType].value;
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
this._savedSearchParams = {};
|
|
1454
|
+
this._pageInfo.pageIndex = 1;
|
|
1455
|
+
this.onResetFormBeforeReload.emit();
|
|
1456
|
+
this.handleQuery();
|
|
1457
|
+
};
|
|
1458
|
+
ProTableComponent.prototype.handlePageIndexChange = function (pageIndex) {
|
|
1459
|
+
this._pageInfo.pageIndex = pageIndex;
|
|
1460
|
+
this.handleQuery();
|
|
1461
|
+
};
|
|
1462
|
+
ProTableComponent.prototype.handlePageSizeChange = function (pageSize) {
|
|
1463
|
+
this._pageInfo.pageSize = pageSize;
|
|
1464
|
+
this._pageInfo.pageIndex = 1;
|
|
1465
|
+
this.handleQuery();
|
|
1466
|
+
};
|
|
1467
|
+
ProTableComponent.prototype.handleQuery = function (afterDelete) {
|
|
1468
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1469
|
+
var result, error_4;
|
|
1470
|
+
return __generator(this, function (_d) {
|
|
1471
|
+
switch (_d.label) {
|
|
1472
|
+
case 0:
|
|
1473
|
+
// 删除后刷新且当前页仅剩一条记录时,若不在第一页则先回退一页
|
|
1474
|
+
if (afterDelete &&
|
|
1475
|
+
Array.isArray(this.dataSource) &&
|
|
1476
|
+
this.dataSource.length === 1 &&
|
|
1477
|
+
this._pageInfo.pageIndex > 1) {
|
|
1478
|
+
this._pageInfo.pageIndex = this._pageInfo.pageIndex - 1;
|
|
1479
|
+
}
|
|
1480
|
+
this._loading = true;
|
|
1481
|
+
if (!this.request) return [3 /*break*/, 6];
|
|
1482
|
+
_d.label = 1;
|
|
1483
|
+
case 1:
|
|
1484
|
+
_d.trys.push([1, 3, 4, 5]);
|
|
1485
|
+
return [4 /*yield*/, this.request(Object.assign({ params: this.clearEmptySearchParams(), pageInfo: {
|
|
1486
|
+
pageIndex: this._pageInfo.pageIndex,
|
|
1487
|
+
pageSize: this._pageInfo.pageSize,
|
|
1488
|
+
} }, (this.sortMode === "server"
|
|
1489
|
+
? { sort: this.buildServerSortPayload() }
|
|
1490
|
+
: {})))];
|
|
1491
|
+
case 2:
|
|
1492
|
+
result = _d.sent();
|
|
1493
|
+
this.dataSource = result.data || [];
|
|
1494
|
+
this.summaryData = result.summaryData || null;
|
|
1495
|
+
// 本地排序模式:拿到数据后在前端排序
|
|
1496
|
+
if (this.sortMode === "local") {
|
|
1497
|
+
this.sortDataSourceInPlace();
|
|
1498
|
+
}
|
|
1499
|
+
this._pageInfo.total = result.total || 0;
|
|
1500
|
+
// 更新全选状态
|
|
1501
|
+
if (this.showCheckbox) {
|
|
1502
|
+
this.updateCheckAllStatus();
|
|
1503
|
+
}
|
|
1504
|
+
return [3 /*break*/, 5];
|
|
1505
|
+
case 3:
|
|
1506
|
+
error_4 = _d.sent();
|
|
1507
|
+
console.error("查询失败:", error_4);
|
|
1508
|
+
this.dataSource = [];
|
|
1509
|
+
this._pageInfo.total = 0;
|
|
1510
|
+
this.summaryData = null;
|
|
1511
|
+
return [3 /*break*/, 5];
|
|
1512
|
+
case 4:
|
|
1513
|
+
this._loading = false;
|
|
1514
|
+
this._selectedTableRow = null;
|
|
1515
|
+
return [7 /*endfinally*/];
|
|
1516
|
+
case 5: return [3 /*break*/, 7];
|
|
1517
|
+
case 6:
|
|
1518
|
+
console.warn("未提供 _request 回调函数");
|
|
1519
|
+
this._loading = false;
|
|
1520
|
+
_d.label = 7;
|
|
1521
|
+
case 7:
|
|
1522
|
+
this.clearSelectedRows();
|
|
1523
|
+
return [2 /*return*/];
|
|
1524
|
+
}
|
|
1525
|
+
});
|
|
1526
|
+
});
|
|
1527
|
+
};
|
|
1528
|
+
// 触发列排序变更
|
|
1529
|
+
ProTableComponent.prototype.onSortChange = function (sortKey, sortOrder) {
|
|
1530
|
+
var _this = this;
|
|
1531
|
+
// 单列排序:重置其它列;多列排序:保留其它列
|
|
1532
|
+
if (!this.multipleSort) {
|
|
1533
|
+
Object.keys(this._sortMap).forEach(function (key) {
|
|
1534
|
+
if (key !== sortKey)
|
|
1535
|
+
_this._sortMap[key] = null;
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
this._sortMap[sortKey] = sortOrder;
|
|
1539
|
+
// 维护优先级队列:有序列且非空 -> 置于末尾;为空 -> 移除
|
|
1540
|
+
this._sortPriority = this._sortPriority.filter(function (k) { return k !== sortKey; });
|
|
1541
|
+
if (sortOrder) {
|
|
1542
|
+
this._sortPriority.push(sortKey);
|
|
1543
|
+
}
|
|
1544
|
+
if (this.sortMode === "local") {
|
|
1545
|
+
this.sortDataSourceInPlace();
|
|
1546
|
+
}
|
|
1547
|
+
else {
|
|
1548
|
+
// 在线排序:重新请求
|
|
1549
|
+
this.handleQuery();
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
ProTableComponent.prototype.getSortOrder = function (sortKey) {
|
|
1553
|
+
return this._sortMap[sortKey] || null;
|
|
1554
|
+
};
|
|
1555
|
+
ProTableComponent.prototype.handleTableRowClick = function (data) {
|
|
1556
|
+
this._selectedTableRow = data;
|
|
1557
|
+
// 如果开启了复选框,点击行时只选中点击行(如果行未被禁用)
|
|
1558
|
+
if (this.showCheckbox && !this.isRowDisabled(data)) {
|
|
1559
|
+
// 先清空所有选中行
|
|
1560
|
+
this._selectedRows = [];
|
|
1561
|
+
// 只选中当前点击的行
|
|
1562
|
+
this.toggleRowChecked(data, true);
|
|
1563
|
+
}
|
|
1564
|
+
this.onRowClick.emit(this._selectedTableRow);
|
|
1565
|
+
};
|
|
1566
|
+
ProTableComponent.prototype.handleTableRowDbClick = function (data) {
|
|
1567
|
+
this._selectedTableRow = data;
|
|
1568
|
+
this.onRowDbClick.emit(this._selectedTableRow);
|
|
1569
|
+
};
|
|
1570
|
+
ProTableComponent.prototype.handleColumnsSettingConfirm = function () {
|
|
1571
|
+
this.queryDynamicColumns();
|
|
1572
|
+
};
|
|
1573
|
+
// 处理 autoComplete 输入事件(带防抖)
|
|
1574
|
+
ProTableComponent.prototype.handleAutoCompleteInput = function (event, column) {
|
|
1575
|
+
var _this = this;
|
|
1576
|
+
var _a;
|
|
1577
|
+
var fieldKey = ((_a = column.fieldProps) === null || _a === void 0 ? void 0 : _a.name) || column.prop;
|
|
1578
|
+
// 如果该字段还没有防抖函数,创建一个
|
|
1579
|
+
if (!this._autoCompleteDebounceMap.has(fieldKey)) {
|
|
1580
|
+
var debouncedFn_1 = lodashEs.debounce(function (evt) {
|
|
1581
|
+
// 重新查找对应的 column,确保使用最新的配置
|
|
1582
|
+
var currentColumn = _this._searchFiledColumns.find(function (col) { var _a; return (((_a = col.fieldProps) === null || _a === void 0 ? void 0 : _a.name) || col.prop) === fieldKey; });
|
|
1583
|
+
if (currentColumn) {
|
|
1584
|
+
_this.executeAutoCompleteDataSource(evt, currentColumn);
|
|
1585
|
+
}
|
|
1586
|
+
}, 300); // 300ms 防抖延迟
|
|
1587
|
+
this._autoCompleteDebounceMap.set(fieldKey, debouncedFn_1);
|
|
1588
|
+
}
|
|
1589
|
+
// 调用防抖函数
|
|
1590
|
+
var debouncedFn = this._autoCompleteDebounceMap.get(fieldKey);
|
|
1591
|
+
if (debouncedFn) {
|
|
1592
|
+
debouncedFn(event);
|
|
1593
|
+
}
|
|
1594
|
+
};
|
|
1595
|
+
// 获取 autoComplete 的数据源
|
|
1596
|
+
ProTableComponent.prototype.getAutoCompleteDataSource = function (column) {
|
|
1597
|
+
var _a;
|
|
1598
|
+
var fieldKey = ((_a = column.fieldProps) === null || _a === void 0 ? void 0 : _a.name) || column.prop;
|
|
1599
|
+
return this._autoCompleteDataSources[fieldKey] || [];
|
|
1600
|
+
};
|
|
1601
|
+
ProTableComponent.prototype.getFieldProps = function (column) {
|
|
1602
|
+
return column.fieldProps;
|
|
1603
|
+
};
|
|
1604
|
+
// 获取指定名称的label模板
|
|
1605
|
+
ProTableComponent.prototype.getLabelTemplate = function (name) {
|
|
1606
|
+
if (!name)
|
|
1607
|
+
return null;
|
|
1608
|
+
try {
|
|
1609
|
+
// 首先从自定义模板中查找
|
|
1610
|
+
var customTemplate = this.customTemplates.get(name);
|
|
1611
|
+
if (customTemplate) {
|
|
1612
|
+
return customTemplate;
|
|
1613
|
+
}
|
|
1614
|
+
// 然后从通用模板映射中查找
|
|
1615
|
+
var template = this.templateMap.get(name);
|
|
1616
|
+
if (template) {
|
|
1617
|
+
return template;
|
|
1618
|
+
}
|
|
1619
|
+
return null;
|
|
1620
|
+
}
|
|
1621
|
+
catch (error) {
|
|
1622
|
+
return null;
|
|
1623
|
+
}
|
|
1624
|
+
};
|
|
1625
|
+
// 获取 form-item 的动态类名
|
|
1626
|
+
ProTableComponent.prototype.getFormItemClassName = function (column) {
|
|
1627
|
+
var fieldName = this.getFieldProps(column).name || column.prop;
|
|
1628
|
+
return "pro-table-" + fieldName + "-form-item";
|
|
1629
|
+
};
|
|
1630
|
+
return ProTableComponent;
|
|
1631
|
+
}());
|
|
1632
|
+
ProTableComponent.decorators = [
|
|
1633
|
+
{ type: i0.Component, args: [{
|
|
1634
|
+
selector: "app-pro-table",
|
|
1635
|
+
template: "<app-page-container [title]=\"title\">\r\n <ng-template #header>\r\n <app-table-search-bar\r\n *ngIf=\"showSearchBar\"\r\n [labelWidth]=\"labelWidth\"\r\n [labelAlign]=\"labelAlign\"\r\n >\r\n <ng-template #leftContent>\r\n <nz-form-item\r\n *ngFor=\"let column of _searchFiledColumns\"\r\n [ngClass]=\"getFormItemClassName(column)\"\r\n >\r\n <nz-form-label *ngIf=\"!getFieldProps(column).hideLabel\" nzNoColon>\r\n <!-- \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49label\u6A21\u677F -->\r\n <ng-container\r\n *ngIf=\"\r\n column.customLabelRender &&\r\n getLabelTemplate(column.customLabelRender);\r\n else defaultLabel\r\n \"\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]=\"getLabelTemplate(column.customLabelRender)\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: column,\r\n column: column,\r\n fieldProps: getFieldProps(column)\r\n }\"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #defaultLabel>\r\n {{ getFieldProps(column).label || column.title }}\r\n </ng-template>\r\n </nz-form-label>\r\n <nz-form-control *ngIf=\"column.valueType === 'input'\">\r\n <input\r\n nz-input\r\n [name]=\"getFieldProps(column).name || column.prop\"\r\n [placeholder]=\"getFieldProps(column).placeHolder\"\r\n [disabled]=\"getFieldProps(column).disabled\"\r\n [(ngModel)]=\"\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n \"\r\n />\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'inputPlate'\">\r\n <app-plate-input\r\n [name]=\"getFieldProps(column).name || column.prop\"\r\n [(ngModel)]=\"\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n \"\r\n ></app-plate-input>\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'select'\">\r\n <nz-select\r\n [(ngModel)]=\"\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n \"\r\n [nzAllowClear]=\"getFieldProps(column).allowClear\"\r\n [nzPlaceHolder]=\"getFieldProps(column).placeHolder\"\r\n [name]=\"getFieldProps(column).name || column.prop\"\r\n [nzOptions]=\"getFieldProps(column).options\"\r\n [nzDisabled]=\"getFieldProps(column).disabled\"\r\n >\r\n </nz-select>\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'selectMultiple'\">\r\n <nz-select\r\n [(ngModel)]=\"\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n \"\r\n [nzAllowClear]=\"getFieldProps(column).allowClear\"\r\n [nzPlaceHolder]=\"getFieldProps(column).placeHolder\"\r\n [name]=\"getFieldProps(column).name || column.prop\"\r\n [nzOptions]=\"getFieldProps(column).options\"\r\n [nzDisabled]=\"getFieldProps(column).disabled\"\r\n nzMode=\"multiple\"\r\n >\r\n </nz-select>\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'date'\">\r\n <nz-date-picker\r\n [nzShowTime]=\"getFieldProps(column).showTime\"\r\n [nzFormat]=\"getFieldProps(column).format\"\r\n [nzPlaceHolder]=\"getFieldProps(column).placeHolder\"\r\n [nzAllowClear]=\"getFieldProps(column).allowClear\"\r\n [nzDisabled]=\"getFieldProps(column).disabled\"\r\n [(ngModel)]=\"\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n \"\r\n [nzMode]=\"getFieldProps(column).mode\"\r\n ></nz-date-picker>\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'checkbox'\">\r\n <nz-checkbox-group\r\n [class]=\"\r\n getFieldProps(column).noStyle\r\n ? 'pro-table-checkboxgroup-nostyle'\r\n : ''\r\n \"\r\n [(ngModel)]=\"getFieldProps(column).options\"\r\n [nzDisabled]=\"getFieldProps(column).disabled\"\r\n (ngModelChange)=\"\r\n handleFieldCheckBoxChange(\r\n $event,\r\n getFieldProps(column).name || column.prop\r\n )\r\n \"\r\n ></nz-checkbox-group>\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'autoComplete'\">\r\n <input\r\n nz-input\r\n [(ngModel)]=\"\r\n _searchParams[getFieldProps(column)?.name || column.prop]\r\n \"\r\n (input)=\"handleAutoCompleteInput($event, column)\"\r\n [nzAutocomplete]=\"auto\"\r\n [disabled]=\"getFieldProps(column)?.disabled\"\r\n [placeholder]=\"getFieldProps(column)?.placeHolder\"\r\n />\r\n <nz-autocomplete\r\n [nzBackfill]=\"getFieldProps(column).backFill\"\r\n [nzDefaultActiveFirstOption]=\"\r\n getFieldProps(column).defaultActiveFirstOption\r\n \"\r\n [nzWidth]=\"getFieldProps(column).width\"\r\n #auto\r\n >\r\n <nz-auto-option\r\n *ngFor=\"let option of getAutoCompleteDataSource(column)\"\r\n [nzValue]=\"\r\n getFieldProps(column).returnFullData ? option : option.value\r\n \"\r\n [nzLabel]=\"option.label\"\r\n [nzDisabled]=\"option.disabled\"\r\n >\r\n {{ option.label }}\r\n </nz-auto-option>\r\n </nz-autocomplete>\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'custom'\">\r\n <app-dynamic-search-field\r\n [component]=\"getFieldProps(column).component\"\r\n [value]=\"_searchParams[getFieldProps(column).name || column.prop]\"\r\n [props]=\"getFieldProps(column)\"\r\n (valueChange)=\"\r\n setFieldValue(getFieldProps(column).name || column.prop, $event)\r\n \"\r\n ></app-dynamic-search-field>\r\n </nz-form-control>\r\n <nz-form-control *ngIf=\"column.valueType === 'inputNumber'\">\r\n <nz-input-number\r\n [style.width]=\"'100%'\"\r\n [(ngModel)]=\"\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n \"\r\n [nzPlaceHolder]=\"getFieldProps(column).placeHolder\"\r\n [nzDisabled]=\"getFieldProps(column).disabled\"\r\n [nzFormatter]=\"getFieldProps(column).formatterPercent\"\r\n [nzParser]=\"getFieldProps(column).parserPercent\"\r\n ></nz-input-number>\r\n </nz-form-control>\r\n </nz-form-item>\r\n </ng-template>\r\n <ng-template #actionTextBtn>\r\n <nz-space [nzSize]=\"4\">\r\n <nz-space-item *ngIf=\"showSearchBtn\">\r\n <button nz-button nzType=\"primary\" (click)=\"handleSearch()\">\r\n {{ confirmBtnText }}\r\n </button>\r\n </nz-space-item>\r\n <nz-space-item *ngIf=\"showClearBtn\">\r\n <button nz-button (click)=\"handleResetForm()\">\r\n {{ clearBtnText }}\r\n </button>\r\n </nz-space-item>\r\n </nz-space>\r\n </ng-template>\r\n <ng-template #actionImgBtn>\r\n <nz-space>\r\n <ng-container *ngTemplateOutlet=\"imgActionBarTpl\"></ng-container>\r\n <nz-space-item class=\"setting-space-item\" *ngIf=\"showColumnSetting\">\r\n <app-colmuns-setting\r\n [columns]=\"columns\"\r\n [selectedColumns]=\"_serverColumns\"\r\n [tableName]=\"tableName\"\r\n (afterConfirm)=\"handleColumnsSettingConfirm()\"\r\n ></app-colmuns-setting>\r\n </nz-space-item>\r\n </nz-space>\r\n </ng-template>\r\n </app-table-search-bar>\r\n </ng-template>\r\n <ng-template #body>\r\n <div class=\"mb-12\">\r\n <ng-container *ngIf=\"showActionBar\">\r\n <ng-container *ngTemplateOutlet=\"actionBarTpl\"></ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-container *ngIf=\"customTableRender\">\r\n <ng-container *ngTemplateOutlet=\"customTableRender\"></ng-container>\r\n </ng-container>\r\n <nz-table\r\n *ngIf=\"!customTableRender\"\r\n #basicTable\r\n nzSize=\"small\"\r\n nzShowSizeChanger\r\n [nzBordered]=\"bordered\"\r\n [nzOuterBordered]=\"outerBordered\"\r\n [nzData]=\"dataSource\"\r\n [nzPageIndex]=\"_pageInfo.pageIndex\"\r\n [nzPageSize]=\"_pageInfo.pageSize\"\r\n [nzTotal]=\"_pageInfo.total\"\r\n [nzPageSizeOptions]=\"_pageInfo.pageSizeOptions\"\r\n [nzShowPagination]=\"showPagination\"\r\n [nzShowTotal]=\"totalTemplate\"\r\n [nzLoading]=\"_loading\"\r\n [nzFrontPagination]=\"frontPagination\"\r\n [nzScroll]=\"scroll\"\r\n (nzPageIndexChange)=\"handlePageIndexChange($event)\"\r\n (nzPageSizeChange)=\"handlePageSizeChange($event)\"\r\n >\r\n <thead>\r\n <tr>\r\n <!-- \u590D\u9009\u6846\u5217\uFF08\u5F53 showCheckbox=true \u65F6\u663E\u793A\uFF09 -->\r\n <th\r\n *ngIf=\"showCheckbox\"\r\n [nzWidth]=\"'50px'\"\r\n [nzAlign]=\"'center'\"\r\n style=\"text-align: center\"\r\n >\r\n <label\r\n nz-checkbox\r\n [(ngModel)]=\"_checkedAll\"\r\n [nzIndeterminate]=\"_indeterminate\"\r\n (ngModelChange)=\"toggleCheckAll($event)\"\r\n (click)=\"$event.stopPropagation()\"\r\n ></label>\r\n </th>\r\n <th\r\n *ngFor=\"let column of _columns\"\r\n [nzWidth]=\"column.width\"\r\n [nzAlign]=\"column.align\"\r\n [nzLeft]=\"column.fixedLeft\"\r\n [nzRight]=\"column.fixedRight\"\r\n [nzShowSort]=\"!!column.sorter\"\r\n [nzSortOrder]=\"getSortOrder(column.prop)\"\r\n (nzSortOrderChange)=\"onSortChange(column.prop, $event)\"\r\n >\r\n {{ column.title }}\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr\r\n style=\"cursor: pointer\"\r\n *ngFor=\"let data; let i = index; of: basicTable.data\"\r\n [ngClass]=\"{\r\n 'ant-table-custom-row-selected': !!getTableRowChecked(data),\r\n 'ant-table-custom-row-even': i % 2 === 0,\r\n 'ant-table-custom-row-odd': i % 2 !== 0\r\n }\"\r\n (click)=\"handleTableRowClick(data)\"\r\n (dblclick)=\"handleTableRowDbClick(data)\"\r\n >\r\n <!-- \u590D\u9009\u6846\u5217\uFF08\u5F53 showCheckbox=true \u65F6\u663E\u793A\uFF09 -->\r\n <td\r\n *ngIf=\"showCheckbox\"\r\n [nzAlign]=\"'center'\"\r\n style=\"text-align: center\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <label\r\n nz-checkbox\r\n [ngModel]=\"isRowChecked(data)\"\r\n [nzDisabled]=\"isRowDisabled(data)\"\r\n (ngModelChange)=\"toggleRowChecked(data, $event)\"\r\n ></label>\r\n </td>\r\n <td\r\n *ngFor=\"let column of _columns\"\r\n [nzLeft]=\"column.fixedLeft\"\r\n [nzRight]=\"column.fixedRight\"\r\n [nzAlign]=\"column.align\"\r\n class=\"pro-ellipsis\"\r\n [title]=\"data[column.prop]\"\r\n >\r\n <!-- \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49\u6A21\u677F -->\r\n <ng-container\r\n *ngIf=\"\r\n column.customRender && getTemplate(column.customRender);\r\n let template\r\n \"\r\n >\r\n <ng-template\r\n [ngTemplateOutlet]=\"template\"\r\n [ngTemplateOutletContext]=\"{\r\n $implicit: data,\r\n data: data,\r\n column: column,\r\n index: i,\r\n pageInfo: _pageInfo\r\n }\"\r\n >\r\n </ng-template>\r\n </ng-container>\r\n\r\n <!-- \u9ED8\u8BA4\u6E32\u67D3\u903B\u8F91 -->\r\n <ng-container\r\n *ngIf=\"!column.customRender || !getTemplate(column.customRender)\"\r\n >\r\n {{ data[column.prop] }}\r\n </ng-container>\r\n </td>\r\n </tr>\r\n <tr *ngIf=\"summaryData && _pageInfo.total > 0\">\r\n <!-- \u6C47\u603B\u884C\u7684\u590D\u9009\u6846\u5217\uFF08\u5F53 showCheckbox=true \u65F6\u663E\u793A\uFF0C\u4F46\u4E3A\u7A7A\uFF09 -->\r\n <td\r\n *ngIf=\"showCheckbox\"\r\n style=\"font-weight: bold; border-right: 1px solid #e8e8e8\"\r\n ></td>\r\n <td\r\n *ngFor=\"let column; let i = index; of: _columns\"\r\n [nzLeft]=\"column.fixedLeft\"\r\n [nzRight]=\"column.fixedRight\"\r\n style=\"font-weight: bold; border-right: 1px solid #e8e8e8\"\r\n [nzAlign]=\"column.align\"\r\n >\r\n <span *ngIf=\"i === 0\">\u603B\u8BA1</span>\r\n <ng-container *ngIf=\"i !== 0 && column.summary\">\r\n {{\r\n column.summary?.format\r\n ? column.summary?.format(\r\n summaryData[column.summary?.name || column.prop]\r\n )\r\n : summaryData[column.summary?.name || column.prop]\r\n }}\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <ng-template #totalTemplate let-total\r\n >\u5171 {{ _pageInfo.total }} \u6761\u8BB0\u5F55</ng-template\r\n >\r\n </nz-table>\r\n </ng-template>\r\n</app-page-container>\r\n",
|
|
1636
|
+
styles: [".pro-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .setting-space-item{margin-right:0!important}::ng-deep .pro-table-checkboxgroup-nostyle{white-space:nowrap}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body table{border-collapse:separate;border-spacing:0}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td{border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th{border-bottom:1px solid #e8e8e8!important;border-right:1px solid #e8e8e8!important;white-space:nowrap}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td:first-child,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th:first-child{border-left:none!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-cell-fix-left,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-cell-fix-right,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th.ant-table-cell-fix-left,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th.ant-table-cell-fix-right{border-bottom:1px solid #e8e8e8!important;border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th{border-top:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td:last-child,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th:last-child{border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr:last-child>td{border-bottom:1px solid #e8e8e8!important}::ng-deep .table-search-bar-left .ant-form-item{margin-bottom:8px}"]
|
|
1637
|
+
},] }
|
|
1638
|
+
];
|
|
1639
|
+
ProTableComponent.ctorParameters = function () { return [
|
|
1640
|
+
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [PRO_TABLE_COLUMN_REMOTE,] }] }
|
|
1641
|
+
]; };
|
|
1642
|
+
ProTableComponent.propDecorators = {
|
|
1643
|
+
showSearchBtn: [{ type: i0.Input }],
|
|
1644
|
+
showClearBtn: [{ type: i0.Input }],
|
|
1645
|
+
title: [{ type: i0.Input }],
|
|
1646
|
+
tableName: [{ type: i0.Input }],
|
|
1647
|
+
multiRow: [{ type: i0.Input }],
|
|
1648
|
+
columns: [{ type: i0.Input }],
|
|
1649
|
+
showSearchBar: [{ type: i0.Input }],
|
|
1650
|
+
showActionBar: [{ type: i0.Input }],
|
|
1651
|
+
confirmBtnText: [{ type: i0.Input }],
|
|
1652
|
+
clearBtnText: [{ type: i0.Input }],
|
|
1653
|
+
labelWidth: [{ type: i0.Input }],
|
|
1654
|
+
labelAlign: [{ type: i0.Input }],
|
|
1655
|
+
dataSource: [{ type: i0.Input }],
|
|
1656
|
+
bordered: [{ type: i0.Input }],
|
|
1657
|
+
outerBordered: [{ type: i0.Input }],
|
|
1658
|
+
showPagination: [{ type: i0.Input }],
|
|
1659
|
+
frontPagination: [{ type: i0.Input }],
|
|
1660
|
+
scroll: [{ type: i0.Input }],
|
|
1661
|
+
request: [{ type: i0.Input }],
|
|
1662
|
+
summaryData: [{ type: i0.Input }],
|
|
1663
|
+
sortMode: [{ type: i0.Input }],
|
|
1664
|
+
showColumnSetting: [{ type: i0.Input }],
|
|
1665
|
+
multipleSort: [{ type: i0.Input }],
|
|
1666
|
+
showCheckbox: [{ type: i0.Input }],
|
|
1667
|
+
rowDisabled: [{ type: i0.Input }],
|
|
1668
|
+
autoTriggerRequest: [{ type: i0.Input }],
|
|
1669
|
+
customTableRender: [{ type: i0.Input }],
|
|
1670
|
+
onRowClick: [{ type: i0.Output }],
|
|
1671
|
+
onRowDbClick: [{ type: i0.Output }],
|
|
1672
|
+
onValuesChange: [{ type: i0.Output }],
|
|
1673
|
+
onResetFormBeforeReload: [{ type: i0.Output }],
|
|
1674
|
+
actionBarTpl: [{ type: i0.ContentChild, args: ["actionBar",] }],
|
|
1675
|
+
imgActionBarTpl: [{ type: i0.ContentChild, args: ["ImgActionBar",] }],
|
|
1676
|
+
allTemplates: [{ type: i0.ContentChildren, args: [i0.TemplateRef,] }]
|
|
1677
|
+
};
|
|
1678
|
+
|
|
1679
|
+
var PageContainerComponent = /** @class */ (function () {
|
|
1680
|
+
function PageContainerComponent() {
|
|
1681
|
+
this.title = "";
|
|
1682
|
+
}
|
|
1683
|
+
PageContainerComponent.prototype.ngOnInit = function () { };
|
|
1684
|
+
return PageContainerComponent;
|
|
1685
|
+
}());
|
|
1686
|
+
PageContainerComponent.decorators = [
|
|
1687
|
+
{ type: i0.Component, args: [{
|
|
1688
|
+
selector: "app-page-container",
|
|
1689
|
+
template: "<nz-card\r\n [nzBorderless]=\"true\"\r\n [nzBodyStyle]=\"{ padding: '10px', width: '100%' }\"\r\n>\r\n <div class=\"page-container-title\" *ngIf=\"title\">{{ title }}</div>\r\n <div class=\"page-container-header\">\r\n <ng-container *ngTemplateOutlet=\"headerTpl\"></ng-container>\r\n </div>\r\n <div class=\"page-container-body\">\r\n <ng-container *ngTemplateOutlet=\"bodyTpl\"></ng-container>\r\n </div>\r\n</nz-card>\r\n",
|
|
1690
|
+
styles: [".page-container-title{border-left:3px solid #096dd9;color:#1d1d1d;font-size:16px;margin-bottom:16px;padding-left:10px}.page-container-body,.page-container-header{box-sizing:border-box;padding:7px}"]
|
|
1691
|
+
},] }
|
|
1692
|
+
];
|
|
1693
|
+
PageContainerComponent.ctorParameters = function () { return []; };
|
|
1694
|
+
PageContainerComponent.propDecorators = {
|
|
1695
|
+
title: [{ type: i0.Input }],
|
|
1696
|
+
headerTpl: [{ type: i0.ContentChild, args: ["header",] }],
|
|
1697
|
+
bodyTpl: [{ type: i0.ContentChild, args: ["body",] }]
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
var PageContainerModule = /** @class */ (function () {
|
|
1701
|
+
function PageContainerModule() {
|
|
1702
|
+
}
|
|
1703
|
+
return PageContainerModule;
|
|
1704
|
+
}());
|
|
1705
|
+
PageContainerModule.decorators = [
|
|
1706
|
+
{ type: i0.NgModule, args: [{
|
|
1707
|
+
imports: [
|
|
1708
|
+
common.CommonModule,
|
|
1709
|
+
i1.FormsModule,
|
|
1710
|
+
http.HttpClientModule,
|
|
1711
|
+
router.RouterModule,
|
|
1712
|
+
card.NzCardModule,
|
|
1713
|
+
i1.ReactiveFormsModule,
|
|
1714
|
+
],
|
|
1715
|
+
declarations: [PageContainerComponent],
|
|
1716
|
+
providers: [],
|
|
1717
|
+
exports: [PageContainerComponent],
|
|
1718
|
+
},] }
|
|
1719
|
+
];
|
|
1720
|
+
|
|
1721
|
+
var PlateInputComponent = /** @class */ (function () {
|
|
1722
|
+
function PlateInputComponent(cdr, elementRef, platePrefixLoadService) {
|
|
1723
|
+
this.cdr = cdr;
|
|
1724
|
+
this.elementRef = elementRef;
|
|
1725
|
+
this.platePrefixLoadService = platePrefixLoadService;
|
|
1726
|
+
this.nzPopoverVisible = false;
|
|
1727
|
+
this.platePrefix = "";
|
|
1728
|
+
this.plateSuffix = "";
|
|
1729
|
+
this.platePrefixOptions = [];
|
|
1730
|
+
this.disabled = false;
|
|
1731
|
+
this.onChange = function (value) { };
|
|
1732
|
+
this.onTouched = function () { };
|
|
1733
|
+
}
|
|
1734
|
+
PlateInputComponent.prototype.ngOnInit = function () {
|
|
1735
|
+
var _this = this;
|
|
1736
|
+
if (this.platePrefixLoadService) {
|
|
1737
|
+
// 使用注入的全局服务加载车牌前缀选项
|
|
1738
|
+
this.platePrefixLoadService
|
|
1739
|
+
.loadPrefixOptions()
|
|
1740
|
+
.then(function (data) {
|
|
1741
|
+
_this.platePrefixOptions = data;
|
|
1742
|
+
})
|
|
1743
|
+
.catch(function () {
|
|
1744
|
+
_this.platePrefixOptions = [];
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
else {
|
|
1748
|
+
// 如果没有注入服务,则保持空数组
|
|
1749
|
+
this.platePrefixOptions = [];
|
|
1750
|
+
}
|
|
1751
|
+
};
|
|
1752
|
+
PlateInputComponent.prototype.handlePlatePrefix = function (value) {
|
|
1753
|
+
this.platePrefix = value;
|
|
1754
|
+
this.emitValue();
|
|
1755
|
+
this.nzPopoverVisible = false;
|
|
1756
|
+
this.removeClickOutsideListener();
|
|
1757
|
+
};
|
|
1758
|
+
PlateInputComponent.prototype.writeValue = function (value) {
|
|
1759
|
+
if (value) {
|
|
1760
|
+
this.platePrefix = value.split("")[0];
|
|
1761
|
+
this.plateSuffix = value
|
|
1762
|
+
.split("")
|
|
1763
|
+
.filter(function (item, index) { return index > 0; })
|
|
1764
|
+
.join("");
|
|
1765
|
+
}
|
|
1766
|
+
else {
|
|
1767
|
+
this.platePrefix = "";
|
|
1768
|
+
this.plateSuffix = "";
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
PlateInputComponent.prototype.registerOnChange = function (fn) {
|
|
1772
|
+
this.onChange = fn;
|
|
1773
|
+
};
|
|
1774
|
+
PlateInputComponent.prototype.registerOnTouched = function (fn) {
|
|
1775
|
+
this.onTouched = fn;
|
|
1776
|
+
};
|
|
1777
|
+
PlateInputComponent.prototype.setDisabledState = function (isDisabled) {
|
|
1778
|
+
var previousDisabled = this.disabled;
|
|
1779
|
+
this.disabled = isDisabled;
|
|
1780
|
+
// 如果禁用状态改变,关闭 popover 并移除监听器
|
|
1781
|
+
if (previousDisabled !== isDisabled) {
|
|
1782
|
+
this.nzPopoverVisible = false;
|
|
1783
|
+
this.removeClickOutsideListener();
|
|
1784
|
+
// 强制变更检测
|
|
1785
|
+
this.cdr.detectChanges();
|
|
1786
|
+
}
|
|
1787
|
+
};
|
|
1788
|
+
PlateInputComponent.prototype.handlePrefixClick = function (event) {
|
|
1789
|
+
var _this = this;
|
|
1790
|
+
if (this.disabled) {
|
|
1791
|
+
event.preventDefault();
|
|
1792
|
+
event.stopPropagation();
|
|
1793
|
+
this.nzPopoverVisible = false;
|
|
1794
|
+
return;
|
|
1795
|
+
}
|
|
1796
|
+
// 手动切换 popover 的显示/隐藏状态
|
|
1797
|
+
this.nzPopoverVisible = !this.nzPopoverVisible;
|
|
1798
|
+
// 如果打开了 popover,添加文档点击监听器
|
|
1799
|
+
if (this.nzPopoverVisible) {
|
|
1800
|
+
setTimeout(function () {
|
|
1801
|
+
_this.attachClickOutsideListener();
|
|
1802
|
+
}, 0);
|
|
1803
|
+
}
|
|
1804
|
+
else {
|
|
1805
|
+
this.removeClickOutsideListener();
|
|
1806
|
+
}
|
|
1807
|
+
event.stopPropagation(); // 阻止事件冒泡
|
|
1808
|
+
};
|
|
1809
|
+
PlateInputComponent.prototype.attachClickOutsideListener = function () {
|
|
1810
|
+
var _this = this;
|
|
1811
|
+
if (this.clickOutsideHandler) {
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
this.clickOutsideHandler = function (event) {
|
|
1815
|
+
var nativeElement = _this.elementRef.nativeElement;
|
|
1816
|
+
var target = event.target;
|
|
1817
|
+
// 检查是否点击在 popover 内容区域内
|
|
1818
|
+
var popoverContent = document.querySelector('.plate-input-popover');
|
|
1819
|
+
var clickedInPopover = popoverContent && popoverContent.contains(target);
|
|
1820
|
+
// 检查是否点击在组件内部(前缀按钮)
|
|
1821
|
+
var clickedInComponent = nativeElement.contains(target);
|
|
1822
|
+
// 如果点击既不在组件内部,也不在 popover 内容区域,则关闭 popover
|
|
1823
|
+
if (!clickedInComponent && !clickedInPopover) {
|
|
1824
|
+
_this.nzPopoverVisible = false;
|
|
1825
|
+
_this.removeClickOutsideListener();
|
|
1826
|
+
_this.cdr.detectChanges();
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
// 使用捕获阶段,确保在其他事件处理之前执行
|
|
1830
|
+
document.addEventListener('click', this.clickOutsideHandler, true);
|
|
1831
|
+
};
|
|
1832
|
+
PlateInputComponent.prototype.removeClickOutsideListener = function () {
|
|
1833
|
+
if (this.clickOutsideHandler) {
|
|
1834
|
+
document.removeEventListener('click', this.clickOutsideHandler, true);
|
|
1835
|
+
this.clickOutsideHandler = undefined;
|
|
1836
|
+
}
|
|
1837
|
+
};
|
|
1838
|
+
PlateInputComponent.prototype.ngOnDestroy = function () {
|
|
1839
|
+
this.removeClickOutsideListener();
|
|
1840
|
+
};
|
|
1841
|
+
PlateInputComponent.prototype.emitValue = function () {
|
|
1842
|
+
var fullPlate = this.platePrefix + this.plateSuffix;
|
|
1843
|
+
this.onChange(fullPlate);
|
|
1844
|
+
};
|
|
1845
|
+
PlateInputComponent.prototype.onBlur = function () {
|
|
1846
|
+
this.onTouched();
|
|
1847
|
+
};
|
|
1848
|
+
PlateInputComponent.prototype.handleAntdPlateSuffixBlur = function (event) {
|
|
1849
|
+
if (this.disabled)
|
|
1850
|
+
return;
|
|
1851
|
+
var value = event.target.value.toUpperCase();
|
|
1852
|
+
this.plateSuffix = value;
|
|
1853
|
+
this.emitValue();
|
|
1854
|
+
};
|
|
1855
|
+
return PlateInputComponent;
|
|
1856
|
+
}());
|
|
1857
|
+
PlateInputComponent.decorators = [
|
|
1858
|
+
{ type: i0.Component, args: [{
|
|
1859
|
+
selector: "app-plate-input",
|
|
1860
|
+
template: "<div\r\n class=\"plate-antd-input-container\"\r\n [class.plate-antd-input-disabled]=\"disabled\"\r\n>\r\n <div\r\n class=\"plate-input-prefix\"\r\n [class.plate-input-prefix-disabled]=\"disabled\"\r\n nz-popover\r\n nzPopoverPlacement=\"bottom\"\r\n nzPopoverOverlayClassName=\"plate-input-popover\"\r\n [(nzPopoverVisible)]=\"nzPopoverVisible\"\r\n [nzPopoverTrigger]=\"'manual'\"\r\n [nzPopoverContent]=\"contentTemplate\"\r\n (click)=\"handlePrefixClick($event)\"\r\n >\r\n {{ platePrefix | uppercase }}\r\n <i\r\n class=\"plate-input-icon-down\"\r\n [nzRotate]=\"nzPopoverVisible ? 180 : 0\"\r\n nz-icon\r\n nzType=\"down\"\r\n nzTheme=\"outline\"\r\n ></i>\r\n </div>\r\n <ng-template #contentTemplate>\r\n <div nz-row style=\"height: 100%\">\r\n <div\r\n nz-col\r\n nzSpan=\"4\"\r\n *ngFor=\"let item of platePrefixOptions\"\r\n class=\"plate-input-popover-item\"\r\n (click)=\"!disabled && handlePlatePrefix(item.value)\"\r\n [ngClass]=\"{\r\n 'plate-input-popover-item-active': item.value === platePrefix,\r\n 'plate-input-popover-item-default': item.value !== platePrefix\r\n }\"\r\n >\r\n <div class=\"plate-input-popover-item-label\">\r\n {{ item.label }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <input\r\n class=\"plate-input-suffix\"\r\n type=\"text\"\r\n nz-input\r\n style=\"width: 75%\"\r\n [value]=\"plateSuffix | uppercase\"\r\n [disabled]=\"disabled\"\r\n (blur)=\"!disabled && handleAntdPlateSuffixBlur($event)\"\r\n />\r\n</div>\r\n",
|
|
1861
|
+
providers: [
|
|
1862
|
+
{
|
|
1863
|
+
provide: i1.NG_VALUE_ACCESSOR,
|
|
1864
|
+
useExisting: i0.forwardRef(function () { return PlateInputComponent; }),
|
|
1865
|
+
multi: true,
|
|
1866
|
+
},
|
|
1867
|
+
],
|
|
1868
|
+
styles: ["::ng-deep .plate-input-popover{box-sizing:border-box;padding:5px 0}::ng-deep .plate-input-popover .ant-popover-inner-content{height:264px;padding:0;width:387px}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item{box-sizing:border-box;cursor:pointer;height:42px;padding:6px 12px}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item .plate-input-popover-item-label{align-items:center;border:1px solid #ccc;display:flex;height:100%;justify-content:center;width:100%}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-default:hover{background-color:#eaeaea}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-active{background-color:#096dd9;color:#fff}::ng-deep .plate-input-prefix:hover:after{background-color:transparent;content:\"\";height:100%;position:absolute;right:0;top:0;width:1px;z-index:2}::ng-deep .plate-antd-input-container{display:flex;flex-wrap:nowrap;width:100%}::ng-deep .plate-antd-input-container .plate-input-prefix{align-items:center;border:1px solid #d9d9d9;border-radius:2px;cursor:pointer;display:flex;justify-content:center;min-height:32px;position:relative;text-align:center;width:60px}::ng-deep .plate-antd-input-container .plate-input-prefix .plate-input-icon-down{font-size:10px;position:absolute;right:5px;top:50%;transform:translateY(-50%)}::ng-deep .plate-antd-input-container .plate-input-prefix:hover:not(.plate-input-prefix-disabled){border-color:#40a9ff}::ng-deep .plate-antd-input-container .plate-input-prefix-disabled{background-color:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}::ng-deep .plate-antd-input-container .plate-input-suffix{width:calc(100% - 60px)}"]
|
|
1869
|
+
},] }
|
|
1870
|
+
];
|
|
1871
|
+
PlateInputComponent.ctorParameters = function () { return [
|
|
1872
|
+
{ type: i0.ChangeDetectorRef },
|
|
1873
|
+
{ type: i0.ElementRef },
|
|
1874
|
+
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [PLATE_PREFIX_LOAD_SERVICE,] }] }
|
|
1875
|
+
]; };
|
|
1876
|
+
|
|
1877
|
+
var PlateInputModule = /** @class */ (function () {
|
|
1878
|
+
function PlateInputModule() {
|
|
1879
|
+
}
|
|
1880
|
+
return PlateInputModule;
|
|
1881
|
+
}());
|
|
1882
|
+
PlateInputModule.decorators = [
|
|
1883
|
+
{ type: i0.NgModule, args: [{
|
|
1884
|
+
imports: [
|
|
1885
|
+
common.CommonModule,
|
|
1886
|
+
i1.FormsModule,
|
|
1887
|
+
grid.NzGridModule,
|
|
1888
|
+
input.NzInputModule,
|
|
1889
|
+
popover.NzPopoverModule,
|
|
1890
|
+
icon.NzIconModule,
|
|
1891
|
+
],
|
|
1892
|
+
declarations: [PlateInputComponent],
|
|
1893
|
+
providers: [],
|
|
1894
|
+
exports: [PlateInputComponent],
|
|
1895
|
+
},] }
|
|
1896
|
+
];
|
|
1897
|
+
|
|
1898
|
+
var TableSearchBarComponent = /** @class */ (function () {
|
|
1899
|
+
function TableSearchBarComponent() {
|
|
1900
|
+
this.leftColSpan = 21;
|
|
1901
|
+
this.rightColSpan = 3;
|
|
1902
|
+
this.labelWidth = "90px";
|
|
1903
|
+
this.labelAlign = "right";
|
|
1904
|
+
}
|
|
1905
|
+
TableSearchBarComponent.prototype.ngOnInit = function () {
|
|
1906
|
+
this.setCSSVariablesToTarget();
|
|
1907
|
+
};
|
|
1908
|
+
TableSearchBarComponent.prototype.ngAfterViewInit = function () {
|
|
1909
|
+
this.setCSSVariablesToTarget();
|
|
1910
|
+
};
|
|
1911
|
+
TableSearchBarComponent.prototype.setCSSVariablesToTarget = function () {
|
|
1912
|
+
// setTimeout(() => {
|
|
1913
|
+
// const leftElement = document.querySelectorAll(".table-search-bar-left");
|
|
1914
|
+
// console.log('leftElement',leftElement);
|
|
1915
|
+
// if (leftElement.length > 0) {
|
|
1916
|
+
// leftElement.forEach((element) => {
|
|
1917
|
+
// (element as HTMLElement).style.setProperty(
|
|
1918
|
+
// "--label-width",
|
|
1919
|
+
// this.labelWidth
|
|
1920
|
+
// );
|
|
1921
|
+
// (element as HTMLElement).style.setProperty(
|
|
1922
|
+
// "--label-align",
|
|
1923
|
+
// this.labelAlign
|
|
1924
|
+
// );
|
|
1925
|
+
// });
|
|
1926
|
+
// }
|
|
1927
|
+
// });
|
|
1928
|
+
};
|
|
1929
|
+
return TableSearchBarComponent;
|
|
1930
|
+
}());
|
|
1931
|
+
TableSearchBarComponent.decorators = [
|
|
1932
|
+
{ type: i0.Component, args: [{
|
|
1933
|
+
selector: "app-table-search-bar",
|
|
1934
|
+
template: "<div class=\"table-search-bar\">\r\n <div class=\"table-search-bar-left\" style=\"--label-width: {{ labelWidth }}; --label-align: {{ labelAlign }};\">\r\n <ng-container *ngTemplateOutlet=\"leftContentTpl\"></ng-container>\r\n </div>\r\n <div class=\"table-search-bar-right\">\r\n <nz-space nzDirection=\"vertical\" nzAlign=\"end\">\r\n <nz-space-item>\r\n <ng-container *ngTemplateOutlet=\"actionTextBtnTpl\"></ng-container>\r\n </nz-space-item>\r\n <nz-space-item>\r\n <ng-container *ngTemplateOutlet=\"actionImgBtnTpl\"></ng-container>\r\n </nz-space-item>\r\n </nz-space>\r\n <!-- <ng-container *ngTemplateOutlet=\"rightContentTpl\"></ng-container> -->\r\n </div>\r\n</div>\r\n",
|
|
1935
|
+
styles: ["::ng-deep .table-search-bar{align-items:flex-start;display:flex;flex-wrap:wrap;gap:16px;width:100%}::ng-deep .table-search-bar-left{display:flex;flex:1;flex-wrap:wrap;gap:0 normal;min-width:0}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item{flex-shrink:0;flex-wrap:nowrap;width:250px}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-form-item-label{flex-shrink:0;text-align:var(--label-align);width:var(--label-width)}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-form-item-label label:after{content:\"\"}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-picker{width:100%}::ng-deep .table-search-bar-right{align-items:flex-start;display:flex;flex-shrink:0}"]
|
|
1936
|
+
},] }
|
|
1937
|
+
];
|
|
1938
|
+
TableSearchBarComponent.ctorParameters = function () { return []; };
|
|
1939
|
+
TableSearchBarComponent.propDecorators = {
|
|
1940
|
+
leftColSpan: [{ type: i0.Input }],
|
|
1941
|
+
rightColSpan: [{ type: i0.Input }],
|
|
1942
|
+
labelWidth: [{ type: i0.Input }],
|
|
1943
|
+
labelAlign: [{ type: i0.Input }],
|
|
1944
|
+
leftContentTpl: [{ type: i0.ContentChild, args: ["leftContent",] }],
|
|
1945
|
+
actionTextBtnTpl: [{ type: i0.ContentChild, args: ["actionTextBtn",] }],
|
|
1946
|
+
actionImgBtnTpl: [{ type: i0.ContentChild, args: ["actionImgBtn",] }]
|
|
1947
|
+
};
|
|
1948
|
+
|
|
1949
|
+
var TableSearchBarModule = /** @class */ (function () {
|
|
1950
|
+
function TableSearchBarModule() {
|
|
1951
|
+
}
|
|
1952
|
+
return TableSearchBarModule;
|
|
1953
|
+
}());
|
|
1954
|
+
TableSearchBarModule.decorators = [
|
|
1955
|
+
{ type: i0.NgModule, args: [{
|
|
1956
|
+
imports: [
|
|
1957
|
+
common.CommonModule,
|
|
1958
|
+
i1.FormsModule,
|
|
1959
|
+
http.HttpClientModule,
|
|
1960
|
+
router.RouterModule,
|
|
1961
|
+
grid.NzGridModule,
|
|
1962
|
+
i1.ReactiveFormsModule,
|
|
1963
|
+
space.NzSpaceModule,
|
|
1964
|
+
],
|
|
1965
|
+
declarations: [TableSearchBarComponent],
|
|
1966
|
+
providers: [],
|
|
1967
|
+
exports: [TableSearchBarComponent],
|
|
1968
|
+
},] }
|
|
1969
|
+
];
|
|
1970
|
+
|
|
1971
|
+
var ColmunsSettingComponent = /** @class */ (function () {
|
|
1972
|
+
function ColmunsSettingComponent(columnRemote) {
|
|
1973
|
+
this.columnRemote = columnRemote;
|
|
1974
|
+
this.columns = [];
|
|
1975
|
+
this.selectedColumns = [];
|
|
1976
|
+
this.afterConfirm = new i0.EventEmitter();
|
|
1977
|
+
this.modalVisible = false;
|
|
1978
|
+
this.options = [];
|
|
1979
|
+
this.sortableInstance = null;
|
|
1980
|
+
}
|
|
1981
|
+
ColmunsSettingComponent.prototype.ngOnInit = function () { };
|
|
1982
|
+
ColmunsSettingComponent.prototype.ngAfterViewInit = function () {
|
|
1983
|
+
this.initSortable();
|
|
1984
|
+
};
|
|
1985
|
+
ColmunsSettingComponent.prototype.ngOnDestroy = function () {
|
|
1986
|
+
if (this.sortableInstance) {
|
|
1987
|
+
this.sortableInstance.destroy();
|
|
1988
|
+
}
|
|
1989
|
+
};
|
|
1990
|
+
ColmunsSettingComponent.prototype.initSortable = function () {
|
|
1991
|
+
var _this = this;
|
|
1992
|
+
// 先销毁已存在的实例
|
|
1993
|
+
if (this.sortableInstance) {
|
|
1994
|
+
this.sortableInstance.destroy();
|
|
1995
|
+
this.sortableInstance = null;
|
|
1996
|
+
}
|
|
1997
|
+
if (this.sortableContainer && this.sortableContainer.nativeElement) {
|
|
1998
|
+
this.sortableInstance = new Sortable__default['default'](this.sortableContainer.nativeElement, {
|
|
1999
|
+
animation: 150,
|
|
2000
|
+
ghostClass: "sortable-ghost",
|
|
2001
|
+
chosenClass: "sortable-chosen",
|
|
2002
|
+
dragClass: "sortable-drag",
|
|
2003
|
+
handle: ".sort-list-item",
|
|
2004
|
+
onEnd: function (evt) {
|
|
2005
|
+
_this.onSortEnd(evt);
|
|
2006
|
+
},
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
2010
|
+
ColmunsSettingComponent.prototype.onSortEnd = function (evt) {
|
|
2011
|
+
var oldIndex = evt.oldIndex, newIndex = evt.newIndex;
|
|
2012
|
+
if (oldIndex !== newIndex) {
|
|
2013
|
+
// 创建新的数组来避免直接修改输入属性
|
|
2014
|
+
var newSelectedColumns = __spread(this.selectedColumns);
|
|
2015
|
+
var movedItem = newSelectedColumns.splice(oldIndex, 1)[0];
|
|
2016
|
+
newSelectedColumns.splice(newIndex, 0, movedItem);
|
|
2017
|
+
// 更新 selectedColumns
|
|
2018
|
+
this.selectedColumns = newSelectedColumns;
|
|
2019
|
+
}
|
|
2020
|
+
};
|
|
2021
|
+
ColmunsSettingComponent.prototype.trackByColumn = function (index, item) {
|
|
2022
|
+
return item.prop || index.toString();
|
|
2023
|
+
};
|
|
2024
|
+
/**
|
|
2025
|
+
* 同步 options 数组的 checked 状态与 selectedColumns
|
|
2026
|
+
*/
|
|
2027
|
+
ColmunsSettingComponent.prototype.syncOptionsWithSelectedColumns = function () {
|
|
2028
|
+
var selectedProps = this.selectedColumns.map(function (col) { return col.prop; });
|
|
2029
|
+
this.options.forEach(function (option) {
|
|
2030
|
+
option.checked = selectedProps.includes(option.value);
|
|
2031
|
+
});
|
|
2032
|
+
};
|
|
2033
|
+
ColmunsSettingComponent.prototype.handleModalVisible = function () {
|
|
2034
|
+
var _this = this;
|
|
2035
|
+
this.options = this.columns
|
|
2036
|
+
.filter(function (item) { return !item.auxiliaryColumn; })
|
|
2037
|
+
.map(function (item) {
|
|
2038
|
+
return {
|
|
2039
|
+
label: item.title,
|
|
2040
|
+
value: item.prop,
|
|
2041
|
+
checked: item.hideInTable ? false : true,
|
|
2042
|
+
sortName: item.sortName || null,
|
|
2043
|
+
};
|
|
2044
|
+
});
|
|
2045
|
+
// 同步 options 的 checked 状态与当前 selectedColumns
|
|
2046
|
+
this.syncOptionsWithSelectedColumns();
|
|
2047
|
+
this.modalVisible = true;
|
|
2048
|
+
// 模态框打开后重新初始化排序
|
|
2049
|
+
setTimeout(function () {
|
|
2050
|
+
_this.initSortable();
|
|
2051
|
+
}, 100);
|
|
2052
|
+
};
|
|
2053
|
+
ColmunsSettingComponent.prototype.handleModalClose = function () {
|
|
2054
|
+
this.modalVisible = false;
|
|
2055
|
+
if (this.sortableInstance) {
|
|
2056
|
+
this.sortableInstance.destroy();
|
|
2057
|
+
this.sortableInstance = null;
|
|
2058
|
+
}
|
|
2059
|
+
};
|
|
2060
|
+
ColmunsSettingComponent.prototype.handleSelectRemove = function (key) {
|
|
2061
|
+
this.selectedColumns = this.selectedColumns.filter(function (item) { return item.prop !== key; });
|
|
2062
|
+
// 使用同步方法确保所有状态一致
|
|
2063
|
+
this.syncOptionsWithSelectedColumns();
|
|
2064
|
+
};
|
|
2065
|
+
ColmunsSettingComponent.prototype.handleCheckBoxChange = function (value, record) {
|
|
2066
|
+
if (!value) {
|
|
2067
|
+
this.handleSelectRemove(record.value);
|
|
2068
|
+
}
|
|
2069
|
+
else {
|
|
2070
|
+
this.selectedColumns.push({
|
|
2071
|
+
title: record.label,
|
|
2072
|
+
prop: record.value,
|
|
2073
|
+
sortName: record.sortName,
|
|
2074
|
+
hideInTable: false,
|
|
2075
|
+
});
|
|
2076
|
+
// 添加项目后同步状态
|
|
2077
|
+
this.syncOptionsWithSelectedColumns();
|
|
2078
|
+
}
|
|
2079
|
+
};
|
|
2080
|
+
ColmunsSettingComponent.prototype.handleConfirm = function () {
|
|
2081
|
+
var _this = this;
|
|
2082
|
+
var _a;
|
|
2083
|
+
if (!((_a = this.columnRemote) === null || _a === void 0 ? void 0 : _a.setCol) || !this.tableName) {
|
|
2084
|
+
this.modalVisible = false;
|
|
2085
|
+
this.afterConfirm.emit();
|
|
2086
|
+
return;
|
|
2087
|
+
}
|
|
2088
|
+
var payload = this.selectedColumns.map(function (column) {
|
|
2089
|
+
return {
|
|
2090
|
+
field: column.prop,
|
|
2091
|
+
isShow: column.hideInTable ? false : true,
|
|
2092
|
+
header: column.title,
|
|
2093
|
+
sortName: column.sortName || null,
|
|
2094
|
+
};
|
|
2095
|
+
});
|
|
2096
|
+
var result = this.columnRemote.setCol(this.tableName, payload);
|
|
2097
|
+
var done = function (res) {
|
|
2098
|
+
_this.modalVisible = false;
|
|
2099
|
+
_this.afterConfirm.emit();
|
|
2100
|
+
};
|
|
2101
|
+
if (result && rxjs.isObservable(result)) {
|
|
2102
|
+
result.subscribe(done, function () { return done(null); });
|
|
2103
|
+
}
|
|
2104
|
+
else {
|
|
2105
|
+
Promise.resolve(result).finally(function () { return done(null); });
|
|
2106
|
+
}
|
|
2107
|
+
};
|
|
2108
|
+
return ColmunsSettingComponent;
|
|
2109
|
+
}());
|
|
2110
|
+
ColmunsSettingComponent.decorators = [
|
|
2111
|
+
{ type: i0.Component, args: [{
|
|
2112
|
+
selector: "app-colmuns-setting",
|
|
2113
|
+
template: "<div class=\"action-pic-btn\" (click)=\"handleModalVisible()\" title=\"\u5217\u8BBE\u7F6E\">\r\n <i nz-icon nzType=\"setting\" nzTheme=\"outline\"></i>\r\n</div>\r\n\r\n<nz-modal\r\n [(nzVisible)]=\"modalVisible\"\r\n [nzWidth]=\"820\"\r\n [nzTitle]=\"modalTitle\"\r\n (nzOnCancel)=\"handleModalClose()\"\r\n [nzContent]=\"modalBody\"\r\n [nzBodyStyle]=\"{ padding: '12px' }\"\r\n (nzOnOk)=\"handleConfirm()\"\r\n [nzWrapClassName]=\"'draggable-modal'\"\r\n>\r\n <ng-template #modalTitle>\r\n <div\r\n class=\"modal-drag-handle\"\r\n cdkDrag\r\n [cdkDragRootElement]=\"'.draggable-modal .ant-modal'\"\r\n cdkDragHandle\r\n [cdkDragBoundary]=\"'.draggable-modal'\"\r\n >\r\n <span>\u8BBE\u7F6E\u663E\u793A\u5B57\u6BB5</span>\r\n </div>\r\n </ng-template>\r\n <ng-template #modalBody>\r\n <div class=\"modal-body\">\r\n <div class=\"check-box-list\">\r\n <div class=\"mb-12\">\u53EF\u9009\u5B57\u6BB5</div>\r\n <nz-checkbox-wrapper style=\"width: 100%\">\r\n <div nz-row [nzGutter]=\"[24, 24]\">\r\n <div nz-col nzSpan=\"6\" *ngFor=\"let item of options\">\r\n <label\r\n nz-checkbox\r\n nzValue=\"item.value\"\r\n [ngModel]=\"item.checked\"\r\n (ngModelChange)=\"handleCheckBoxChange($event, item)\"\r\n >{{ item.label }}</label\r\n >\r\n </div>\r\n </div>\r\n </nz-checkbox-wrapper>\r\n </div>\r\n <div class=\"sort-list\">\r\n <div nz-typography class=\"mb-4\">\u5F53\u524D\u5DF2\u7ECF\u9009\u5B9A\u7684\u5B57\u6BB5</div>\r\n <div\r\n nz-typography\r\n nzType=\"secondary\"\r\n class=\"mb-4\"\r\n [style.fontSize]=\"'12px'\"\r\n >\r\n \u63D0\u793A\uFF1A\u53EF\u62D6\u52A8\u6392\u5E8F\r\n </div>\r\n <div #sortableContainer class=\"sortable-container\">\r\n <div\r\n class=\"sort-list-item mb-12\"\r\n *ngFor=\"let item of selectedColumns; trackBy: trackByColumn\"\r\n >\r\n {{ item.title }}\r\n <a\r\n href=\"javascript:void(0)\"\r\n class=\"fieldd-remove\"\r\n title=\"\u5220\u9664\"\r\n (click)=\"handleSelectRemove(item.prop)\"\r\n >\u00D7</a\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</nz-modal>\r\n",
|
|
2114
|
+
styles: [".action-pic-btn{align-items:center;cursor:pointer;display:inline-flex;height:32px;justify-content:center;width:32px}.modal-body{display:flex;height:600px;width:100%}.modal-body .check-box-list{height:100%;width:calc(100% - 200px)}.modal-body .sort-list{border-left:1px solid #e3e3e3;box-sizing:border-box;height:100%;overflow-y:auto;padding-left:12px;padding-right:12px;width:200px}.modal-body .sort-list .sortable-container{min-height:100px}.modal-body .sort-list .sort-list-item{-moz-user-select:none;-webkit-user-select:none;align-items:center;cursor:move;display:flex;justify-content:space-between;user-select:none}.modal-body .sort-list .sort-list-item a{font-size:18px}.modal-drag-handle{-moz-user-select:none;-webkit-user-select:none;cursor:move;user-select:none;width:100%}"]
|
|
2115
|
+
},] }
|
|
2116
|
+
];
|
|
2117
|
+
ColmunsSettingComponent.ctorParameters = function () { return [
|
|
2118
|
+
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [PRO_TABLE_COLUMN_REMOTE,] }] }
|
|
2119
|
+
]; };
|
|
2120
|
+
ColmunsSettingComponent.propDecorators = {
|
|
2121
|
+
columns: [{ type: i0.Input }],
|
|
2122
|
+
selectedColumns: [{ type: i0.Input }],
|
|
2123
|
+
tableName: [{ type: i0.Input }],
|
|
2124
|
+
afterConfirm: [{ type: i0.Output }],
|
|
2125
|
+
sortableContainer: [{ type: i0.ViewChild, args: ["sortableContainer", { static: false },] }]
|
|
2126
|
+
};
|
|
2127
|
+
|
|
2128
|
+
var DynamicSearchFieldComponent = /** @class */ (function () {
|
|
2129
|
+
function DynamicSearchFieldComponent(cfr) {
|
|
2130
|
+
this.cfr = cfr;
|
|
2131
|
+
this.component = null;
|
|
2132
|
+
this.props = null;
|
|
2133
|
+
this.valueChange = new i0.EventEmitter();
|
|
2134
|
+
this.cmpRef = null;
|
|
2135
|
+
this.isCva = false;
|
|
2136
|
+
this.cvaOnChange = null;
|
|
2137
|
+
}
|
|
2138
|
+
DynamicSearchFieldComponent.prototype.ngOnInit = function () {
|
|
2139
|
+
this.render();
|
|
2140
|
+
};
|
|
2141
|
+
DynamicSearchFieldComponent.prototype.ngOnChanges = function (changes) {
|
|
2142
|
+
if (changes.component && !changes.component.firstChange) {
|
|
2143
|
+
this.destroy();
|
|
2144
|
+
this.render();
|
|
2145
|
+
return;
|
|
2146
|
+
}
|
|
2147
|
+
if (this.cmpRef) {
|
|
2148
|
+
if (changes.value && !changes.value.firstChange) {
|
|
2149
|
+
if (this.isCva) {
|
|
2150
|
+
if (typeof this.cmpRef.instance.writeValue === 'function') {
|
|
2151
|
+
this.cmpRef.instance.writeValue(this.value);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
else if ('value' in this.cmpRef.instance) {
|
|
2155
|
+
this.cmpRef.instance.value = this.value;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
if (changes.props && !changes.props.firstChange) {
|
|
2159
|
+
this.applyProps();
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
};
|
|
2163
|
+
DynamicSearchFieldComponent.prototype.render = function () {
|
|
2164
|
+
var _this = this;
|
|
2165
|
+
if (!this.component)
|
|
2166
|
+
return;
|
|
2167
|
+
var factory = this.cfr.resolveComponentFactory(this.component);
|
|
2168
|
+
this.vc.clear();
|
|
2169
|
+
this.cmpRef = this.vc.createComponent(factory);
|
|
2170
|
+
this.isCva = typeof this.cmpRef.instance.registerOnChange === 'function' && typeof this.cmpRef.instance.writeValue === 'function';
|
|
2171
|
+
if (this.isCva) {
|
|
2172
|
+
this.cmpRef.instance.writeValue(this.value);
|
|
2173
|
+
this.cmpRef.instance.registerOnChange(function (v) {
|
|
2174
|
+
_this.valueChange.emit(v);
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
else {
|
|
2178
|
+
if ('value' in this.cmpRef.instance) {
|
|
2179
|
+
this.cmpRef.instance.value = this.value;
|
|
2180
|
+
}
|
|
2181
|
+
if ('valueChange' in this.cmpRef.instance && this.cmpRef.instance.valueChange && typeof this.cmpRef.instance.valueChange.subscribe === 'function') {
|
|
2182
|
+
this.cmpRef.instance.valueChange.subscribe(function (v) {
|
|
2183
|
+
_this.valueChange.emit(v);
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
this.applyProps();
|
|
2188
|
+
};
|
|
2189
|
+
DynamicSearchFieldComponent.prototype.applyProps = function () {
|
|
2190
|
+
var _this = this;
|
|
2191
|
+
var p = this.props || {};
|
|
2192
|
+
var extra = p.componentProps || {};
|
|
2193
|
+
Object.keys(extra).forEach(function (k) {
|
|
2194
|
+
try {
|
|
2195
|
+
_this.cmpRef.instance[k] = extra[k];
|
|
2196
|
+
}
|
|
2197
|
+
catch (_a) { }
|
|
2198
|
+
});
|
|
2199
|
+
};
|
|
2200
|
+
DynamicSearchFieldComponent.prototype.destroy = function () {
|
|
2201
|
+
if (this.cmpRef) {
|
|
2202
|
+
try {
|
|
2203
|
+
this.cmpRef.destroy();
|
|
2204
|
+
}
|
|
2205
|
+
catch (_a) { }
|
|
2206
|
+
this.cmpRef = null;
|
|
2207
|
+
}
|
|
2208
|
+
};
|
|
2209
|
+
DynamicSearchFieldComponent.prototype.ngOnDestroy = function () {
|
|
2210
|
+
this.destroy();
|
|
2211
|
+
};
|
|
2212
|
+
return DynamicSearchFieldComponent;
|
|
2213
|
+
}());
|
|
2214
|
+
DynamicSearchFieldComponent.decorators = [
|
|
2215
|
+
{ type: i0.Component, args: [{
|
|
2216
|
+
selector: 'app-dynamic-search-field',
|
|
2217
|
+
template: "<ng-template #vc></ng-template>"
|
|
2218
|
+
},] }
|
|
2219
|
+
];
|
|
2220
|
+
DynamicSearchFieldComponent.ctorParameters = function () { return [
|
|
2221
|
+
{ type: i0.ComponentFactoryResolver }
|
|
2222
|
+
]; };
|
|
2223
|
+
DynamicSearchFieldComponent.propDecorators = {
|
|
2224
|
+
component: [{ type: i0.Input }],
|
|
2225
|
+
value: [{ type: i0.Input }],
|
|
2226
|
+
props: [{ type: i0.Input }],
|
|
2227
|
+
valueChange: [{ type: i0.Output }],
|
|
2228
|
+
vc: [{ type: i0.ViewChild, args: ['vc', { read: i0.ViewContainerRef, static: true },] }]
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2231
|
+
var ProTableModule = /** @class */ (function () {
|
|
2232
|
+
function ProTableModule() {
|
|
2233
|
+
}
|
|
2234
|
+
return ProTableModule;
|
|
2235
|
+
}());
|
|
2236
|
+
ProTableModule.decorators = [
|
|
2237
|
+
{ type: i0.NgModule, args: [{
|
|
2238
|
+
imports: [
|
|
2239
|
+
common.CommonModule,
|
|
2240
|
+
i1.FormsModule,
|
|
2241
|
+
http.HttpClientModule,
|
|
2242
|
+
router.RouterModule,
|
|
2243
|
+
form.NzFormModule,
|
|
2244
|
+
select.NzSelectModule,
|
|
2245
|
+
space.NzSpaceModule,
|
|
2246
|
+
grid.NzGridModule,
|
|
2247
|
+
input.NzInputModule,
|
|
2248
|
+
i1.ReactiveFormsModule,
|
|
2249
|
+
popover.NzPopoverModule,
|
|
2250
|
+
icon.NzIconModule,
|
|
2251
|
+
button.NzButtonModule,
|
|
2252
|
+
PageContainerModule,
|
|
2253
|
+
TableSearchBarModule,
|
|
2254
|
+
table.NzTableModule,
|
|
2255
|
+
PlateInputModule,
|
|
2256
|
+
datePicker.NzDatePickerModule,
|
|
2257
|
+
modal.NzModalModule,
|
|
2258
|
+
checkbox.NzCheckboxModule,
|
|
2259
|
+
typography.NzTypographyModule,
|
|
2260
|
+
dragDrop.DragDropModule,
|
|
2261
|
+
checkbox.NzCheckboxModule,
|
|
2262
|
+
autoComplete.NzAutocompleteModule,
|
|
2263
|
+
inputNumber.NzInputNumberModule,
|
|
2264
|
+
tooltip.NzToolTipModule,
|
|
2265
|
+
],
|
|
2266
|
+
declarations: [ProTableComponent, ColmunsSettingComponent, DynamicSearchFieldComponent],
|
|
2267
|
+
providers: [
|
|
2268
|
+
{
|
|
2269
|
+
// 默认不提供远程列服务,宿主可覆盖注入
|
|
2270
|
+
provide: PRO_TABLE_COLUMN_REMOTE,
|
|
2271
|
+
useValue: null,
|
|
2272
|
+
},
|
|
2273
|
+
],
|
|
2274
|
+
exports: [ProTableComponent],
|
|
2275
|
+
},] }
|
|
2276
|
+
];
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* 默认的车牌前缀加载服务实现
|
|
2280
|
+
* 使用 HttpClient 调用 API 获取车牌前缀选项
|
|
2281
|
+
*/
|
|
2282
|
+
var DefaultPlatePrefixLoadService = /** @class */ (function () {
|
|
2283
|
+
function DefaultPlatePrefixLoadService(http) {
|
|
2284
|
+
this.http = http;
|
|
2285
|
+
this.defaultApiUrl = "/PlateFirstWord/GetPlateFirstWord";
|
|
2286
|
+
}
|
|
2287
|
+
DefaultPlatePrefixLoadService.prototype.loadPrefixOptions = function () {
|
|
2288
|
+
return this.http
|
|
2289
|
+
.post(this.defaultApiUrl, { dictCode: "PlateFirstWord" })
|
|
2290
|
+
.toPromise()
|
|
2291
|
+
.then(function (list) {
|
|
2292
|
+
var options = [];
|
|
2293
|
+
// 添加空选项(与旧版保持一致)
|
|
2294
|
+
options.push({ label: "", value: "" });
|
|
2295
|
+
// 转换数据格式
|
|
2296
|
+
for (var i = 0; i < list.length; i++) {
|
|
2297
|
+
options.push({
|
|
2298
|
+
label: list[i],
|
|
2299
|
+
value: list[i],
|
|
2300
|
+
});
|
|
2301
|
+
}
|
|
2302
|
+
return options;
|
|
2303
|
+
})
|
|
2304
|
+
.catch(function () {
|
|
2305
|
+
// 发生错误时返回空数组
|
|
2306
|
+
return [];
|
|
2307
|
+
});
|
|
2308
|
+
};
|
|
2309
|
+
return DefaultPlatePrefixLoadService;
|
|
2310
|
+
}());
|
|
2311
|
+
DefaultPlatePrefixLoadService.decorators = [
|
|
2312
|
+
{ type: i0.Injectable }
|
|
2313
|
+
];
|
|
2314
|
+
DefaultPlatePrefixLoadService.ctorParameters = function () { return [
|
|
2315
|
+
{ type: http.HttpClient }
|
|
2316
|
+
]; };
|
|
2317
|
+
|
|
2318
|
+
// ==================== 服务类 ====================
|
|
2319
|
+
var AntdFormService = /** @class */ (function () {
|
|
2320
|
+
// ==================== 构造函数 ====================
|
|
2321
|
+
function AntdFormService(fb) {
|
|
2322
|
+
this.fb = fb;
|
|
2323
|
+
// ==================== 公共属性 ====================
|
|
2324
|
+
this.formStore = {};
|
|
2325
|
+
this.formModifyType = "create";
|
|
2326
|
+
// ==================== 私有属性 ====================
|
|
2327
|
+
this.labelWidth = "120px";
|
|
2328
|
+
this.labelAlign = "right";
|
|
2329
|
+
this.labelObservers = {};
|
|
2330
|
+
this.errorMessageStore = {};
|
|
2331
|
+
this.formArrayConfigStore = {};
|
|
2332
|
+
this.INTERNAL_ID_FIELD = "__formItemId";
|
|
2333
|
+
this.classPrefix = "ant-form-";
|
|
2334
|
+
this.defaultErrorMessages = {
|
|
2335
|
+
required: "该字段为必填项",
|
|
2336
|
+
minlength: "输入长度不足",
|
|
2337
|
+
maxlength: "输入长度超限",
|
|
2338
|
+
email: "请输入合法的邮箱地址",
|
|
2339
|
+
pattern: "输入格式不正确",
|
|
2340
|
+
};
|
|
2341
|
+
}
|
|
2342
|
+
// ==================== 表单创建和初始化 ====================
|
|
2343
|
+
// 初始化表单(支持 FormArray)
|
|
2344
|
+
AntdFormService.prototype.createFormGroup = function (name, config, options) {
|
|
2345
|
+
var _this = this;
|
|
2346
|
+
var groupConfig = {};
|
|
2347
|
+
this.errorMessageStore[name] = {};
|
|
2348
|
+
Object.entries(config).forEach(function (_f) {
|
|
2349
|
+
var _g = __read(_f, 2), key = _g[0], field = _g[1];
|
|
2350
|
+
var _a, _b, _c;
|
|
2351
|
+
if (_this.isFormArrayConfig(field)) {
|
|
2352
|
+
// FormArray 配置处理
|
|
2353
|
+
if (!_this.formArrayConfigStore[name]) {
|
|
2354
|
+
_this.formArrayConfigStore[name] = {};
|
|
2355
|
+
}
|
|
2356
|
+
_this.formArrayConfigStore[name][key] = {
|
|
2357
|
+
itemConfig: field.itemConfig,
|
|
2358
|
+
uniqueIdField: field.uniqueIdField,
|
|
2359
|
+
};
|
|
2360
|
+
var formArray = _this.createFormArrayFromConfig(name, key, field.itemConfig, field.initialItems || [], field.uniqueIdField);
|
|
2361
|
+
groupConfig[key] = formArray;
|
|
2362
|
+
// 存储 FormArray 字段的错误消息配置,格式:arrayName[].fieldName
|
|
2363
|
+
if (field.errorMessages) {
|
|
2364
|
+
Object.entries(field.errorMessages).forEach(function (_f) {
|
|
2365
|
+
var _g = __read(_f, 2), fieldName = _g[0], errorMessages = _g[1];
|
|
2366
|
+
var errorMessageKey = key + "[]." + fieldName;
|
|
2367
|
+
_this.errorMessageStore[name][errorMessageKey] = errorMessages;
|
|
2368
|
+
});
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
else {
|
|
2372
|
+
// 普通字段配置
|
|
2373
|
+
var fieldConfig = field;
|
|
2374
|
+
groupConfig[key] = [
|
|
2375
|
+
{ value: fieldConfig.value, disabled: (_a = fieldConfig.disabled) !== null && _a !== void 0 ? _a : false },
|
|
2376
|
+
(_c = (_b = fieldConfig.validators) === null || _b === void 0 ? void 0 : _b.call(fieldConfig)) !== null && _c !== void 0 ? _c : [],
|
|
2377
|
+
];
|
|
2378
|
+
if (fieldConfig.errorMessages) {
|
|
2379
|
+
_this.errorMessageStore[name][key] = fieldConfig.errorMessages;
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
});
|
|
2383
|
+
if (options === null || options === void 0 ? void 0 : options.labelWidth) {
|
|
2384
|
+
this.labelWidth = options.labelWidth;
|
|
2385
|
+
}
|
|
2386
|
+
if (options === null || options === void 0 ? void 0 : options.labelAlign) {
|
|
2387
|
+
this.labelAlign = options.labelAlign;
|
|
2388
|
+
}
|
|
2389
|
+
this.formStore[name] = this.fb.group(groupConfig);
|
|
2390
|
+
this.setCSSVariablesToTarget(name);
|
|
2391
|
+
return this.formStore[name];
|
|
2392
|
+
};
|
|
2393
|
+
// ==================== 表单操作 ====================
|
|
2394
|
+
// 重置表单
|
|
2395
|
+
AntdFormService.prototype.resetFormGroup = function (name, value) {
|
|
2396
|
+
var _a;
|
|
2397
|
+
(_a = this.formStore[name]) === null || _a === void 0 ? void 0 : _a.reset(value);
|
|
2398
|
+
};
|
|
2399
|
+
// 批量添加字段配置
|
|
2400
|
+
AntdFormService.prototype.addFieldsConfig = function (formName, fieldsConfig, options) {
|
|
2401
|
+
var _this = this;
|
|
2402
|
+
var _a;
|
|
2403
|
+
var result = {
|
|
2404
|
+
success: true,
|
|
2405
|
+
added: [],
|
|
2406
|
+
failed: [],
|
|
2407
|
+
};
|
|
2408
|
+
// 1. 验证表单是否存在
|
|
2409
|
+
var formGroup = this.formStore[formName];
|
|
2410
|
+
if (!formGroup) {
|
|
2411
|
+
// 如果表单不存在,所有字段都失败
|
|
2412
|
+
Object.keys(fieldsConfig).forEach(function (fieldName) {
|
|
2413
|
+
var _a;
|
|
2414
|
+
var error = "Form \"" + formName + "\" not found";
|
|
2415
|
+
result.failed.push({
|
|
2416
|
+
fieldName: fieldName,
|
|
2417
|
+
error: error,
|
|
2418
|
+
});
|
|
2419
|
+
(_a = options === null || options === void 0 ? void 0 : options.onFieldAdded) === null || _a === void 0 ? void 0 : _a.call(options, fieldName, false, error);
|
|
2420
|
+
});
|
|
2421
|
+
result.success = false;
|
|
2422
|
+
return result;
|
|
2423
|
+
}
|
|
2424
|
+
// 2. 初始化 errorMessageStore 和 formArrayConfigStore(如果不存在)
|
|
2425
|
+
if (!this.errorMessageStore[formName]) {
|
|
2426
|
+
this.errorMessageStore[formName] = {};
|
|
2427
|
+
}
|
|
2428
|
+
if (!this.formArrayConfigStore[formName]) {
|
|
2429
|
+
this.formArrayConfigStore[formName] = {};
|
|
2430
|
+
}
|
|
2431
|
+
// 3. 批量构建控件配置
|
|
2432
|
+
var controlsToAdd = {};
|
|
2433
|
+
var errorMessagesToAdd = {};
|
|
2434
|
+
var formArrayConfigsToAdd = {};
|
|
2435
|
+
// 4. 遍历所有字段配置,进行验证和构建
|
|
2436
|
+
Object.entries(fieldsConfig).forEach(function (_f) {
|
|
2437
|
+
var _g = __read(_f, 2), fieldName = _g[0], fieldConfig = _g[1];
|
|
2438
|
+
var _a, _b, _c, _d, _e;
|
|
2439
|
+
try {
|
|
2440
|
+
// 4.1 检查字段是否已存在
|
|
2441
|
+
if (formGroup.get(fieldName)) {
|
|
2442
|
+
var error = "Field \"" + fieldName + "\" already exists";
|
|
2443
|
+
result.failed.push({
|
|
2444
|
+
fieldName: fieldName,
|
|
2445
|
+
error: error,
|
|
2446
|
+
});
|
|
2447
|
+
(_a = options === null || options === void 0 ? void 0 : options.onFieldAdded) === null || _a === void 0 ? void 0 : _a.call(options, fieldName, false, error);
|
|
2448
|
+
return;
|
|
2449
|
+
}
|
|
2450
|
+
// 4.2 根据字段类型创建控件
|
|
2451
|
+
if (_this.isFormArrayConfig(fieldConfig)) {
|
|
2452
|
+
// FormArray 处理
|
|
2453
|
+
var formArray = _this.createFormArrayFromConfig(formName, fieldName, fieldConfig.itemConfig, fieldConfig.initialItems || [], fieldConfig.uniqueIdField);
|
|
2454
|
+
controlsToAdd[fieldName] = formArray;
|
|
2455
|
+
// 存储 FormArray 配置
|
|
2456
|
+
formArrayConfigsToAdd[fieldName] = {
|
|
2457
|
+
itemConfig: fieldConfig.itemConfig,
|
|
2458
|
+
uniqueIdField: fieldConfig.uniqueIdField,
|
|
2459
|
+
};
|
|
2460
|
+
// 存储错误消息
|
|
2461
|
+
if (fieldConfig.errorMessages) {
|
|
2462
|
+
Object.entries(fieldConfig.errorMessages).forEach(function (_f) {
|
|
2463
|
+
var _g = __read(_f, 2), itemFieldName = _g[0], errorMessages = _g[1];
|
|
2464
|
+
var errorMessageKey = fieldName + "[]." + itemFieldName;
|
|
2465
|
+
errorMessagesToAdd[errorMessageKey] = errorMessages;
|
|
2466
|
+
});
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
else {
|
|
2470
|
+
// 普通字段处理
|
|
2471
|
+
var fieldConfigTyped = fieldConfig;
|
|
2472
|
+
var controlOptions = {
|
|
2473
|
+
validators: (_c = (_b = fieldConfigTyped.validators) === null || _b === void 0 ? void 0 : _b.call(fieldConfigTyped)) !== null && _c !== void 0 ? _c : [],
|
|
2474
|
+
};
|
|
2475
|
+
var control = _this.fb.control(fieldConfigTyped.value, controlOptions);
|
|
2476
|
+
// 设置 disabled 状态
|
|
2477
|
+
if (fieldConfigTyped.disabled) {
|
|
2478
|
+
control.disable();
|
|
2479
|
+
}
|
|
2480
|
+
controlsToAdd[fieldName] = control;
|
|
2481
|
+
// 存储错误消息
|
|
2482
|
+
if (fieldConfigTyped.errorMessages) {
|
|
2483
|
+
errorMessagesToAdd[fieldName] = fieldConfigTyped.errorMessages;
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
result.added.push(fieldName);
|
|
2487
|
+
(_d = options === null || options === void 0 ? void 0 : options.onFieldAdded) === null || _d === void 0 ? void 0 : _d.call(options, fieldName, true);
|
|
2488
|
+
}
|
|
2489
|
+
catch (error) {
|
|
2490
|
+
var errorMessage = (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.toString()) || "Unknown error";
|
|
2491
|
+
result.failed.push({
|
|
2492
|
+
fieldName: fieldName,
|
|
2493
|
+
error: errorMessage,
|
|
2494
|
+
});
|
|
2495
|
+
(_e = options === null || options === void 0 ? void 0 : options.onFieldAdded) === null || _e === void 0 ? void 0 : _e.call(options, fieldName, false, errorMessage);
|
|
2496
|
+
}
|
|
2497
|
+
});
|
|
2498
|
+
// 5. 批量添加到 FormGroup
|
|
2499
|
+
if (Object.keys(controlsToAdd).length > 0) {
|
|
2500
|
+
Object.entries(controlsToAdd).forEach(function (_f) {
|
|
2501
|
+
var _g = __read(_f, 2), fieldName = _g[0], control = _g[1];
|
|
2502
|
+
formGroup.addControl(fieldName, control);
|
|
2503
|
+
});
|
|
2504
|
+
// 6. 批量存储错误消息
|
|
2505
|
+
Object.entries(errorMessagesToAdd).forEach(function (_f) {
|
|
2506
|
+
var _g = __read(_f, 2), key = _g[0], messages = _g[1];
|
|
2507
|
+
_this.errorMessageStore[formName][key] = messages;
|
|
2508
|
+
});
|
|
2509
|
+
// 7. 批量存储 FormArray 配置
|
|
2510
|
+
Object.entries(formArrayConfigsToAdd).forEach(function (_f) {
|
|
2511
|
+
var _g = __read(_f, 2), fieldName = _g[0], config = _g[1];
|
|
2512
|
+
_this.formArrayConfigStore[formName][fieldName] = config;
|
|
2513
|
+
});
|
|
2514
|
+
// 8. 更新表单验证状态
|
|
2515
|
+
if (options === null || options === void 0 ? void 0 : options.updateValueAndValidity) {
|
|
2516
|
+
formGroup.updateValueAndValidity({
|
|
2517
|
+
emitEvent: (_a = options === null || options === void 0 ? void 0 : options.emitEvent) !== null && _a !== void 0 ? _a : true,
|
|
2518
|
+
});
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
// 9. 判断整体是否成功
|
|
2522
|
+
result.success = result.failed.length === 0;
|
|
2523
|
+
return result;
|
|
2524
|
+
};
|
|
2525
|
+
// 批量删除字段配置
|
|
2526
|
+
AntdFormService.prototype.removeFieldsConfig = function (formName, fieldNames, options) {
|
|
2527
|
+
var _this = this;
|
|
2528
|
+
var result = {
|
|
2529
|
+
success: true,
|
|
2530
|
+
removed: [],
|
|
2531
|
+
failed: [],
|
|
2532
|
+
};
|
|
2533
|
+
// 1. 验证表单是否存在
|
|
2534
|
+
var formGroup = this.formStore[formName];
|
|
2535
|
+
if (!formGroup) {
|
|
2536
|
+
fieldNames.forEach(function (fieldName) {
|
|
2537
|
+
var _a;
|
|
2538
|
+
var error = "Form \"" + formName + "\" not found";
|
|
2539
|
+
result.failed.push({
|
|
2540
|
+
fieldName: fieldName,
|
|
2541
|
+
error: error,
|
|
2542
|
+
});
|
|
2543
|
+
(_a = options === null || options === void 0 ? void 0 : options.onFieldRemoved) === null || _a === void 0 ? void 0 : _a.call(options, fieldName, false, error);
|
|
2544
|
+
});
|
|
2545
|
+
result.success = false;
|
|
2546
|
+
return result;
|
|
2547
|
+
}
|
|
2548
|
+
// 2. 批量收集需要清理的信息
|
|
2549
|
+
var fieldsToRemove = [];
|
|
2550
|
+
var errorMessageKeysToRemove = [];
|
|
2551
|
+
var formArrayFields = [];
|
|
2552
|
+
// 3. 验证每个字段并收集信息
|
|
2553
|
+
fieldNames.forEach(function (fieldName) {
|
|
2554
|
+
var _a;
|
|
2555
|
+
var control = formGroup.get(fieldName);
|
|
2556
|
+
if (!control) {
|
|
2557
|
+
var error = "Field \"" + fieldName + "\" not found";
|
|
2558
|
+
result.failed.push({
|
|
2559
|
+
fieldName: fieldName,
|
|
2560
|
+
error: error,
|
|
2561
|
+
});
|
|
2562
|
+
(_a = options === null || options === void 0 ? void 0 : options.onFieldRemoved) === null || _a === void 0 ? void 0 : _a.call(options, fieldName, false, error);
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
// 判断是否是 FormArray
|
|
2566
|
+
if (control instanceof i1.FormArray) {
|
|
2567
|
+
formArrayFields.push(fieldName);
|
|
2568
|
+
// 收集 FormArray 相关的错误消息键(格式:arrayName[].fieldName)
|
|
2569
|
+
if (_this.errorMessageStore[formName]) {
|
|
2570
|
+
Object.keys(_this.errorMessageStore[formName]).forEach(function (key) {
|
|
2571
|
+
if (key.startsWith(fieldName + "[].")) {
|
|
2572
|
+
errorMessageKeysToRemove.push(key);
|
|
2573
|
+
}
|
|
2574
|
+
});
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
else {
|
|
2578
|
+
// 普通字段的错误消息键
|
|
2579
|
+
errorMessageKeysToRemove.push(fieldName);
|
|
2580
|
+
}
|
|
2581
|
+
fieldsToRemove.push(fieldName);
|
|
2582
|
+
});
|
|
2583
|
+
// 4. 批量执行删除操作
|
|
2584
|
+
try {
|
|
2585
|
+
// 4.1 从 FormGroup 中移除控件
|
|
2586
|
+
fieldsToRemove.forEach(function (fieldName) {
|
|
2587
|
+
var _a;
|
|
2588
|
+
formGroup.removeControl(fieldName);
|
|
2589
|
+
result.removed.push(fieldName);
|
|
2590
|
+
(_a = options === null || options === void 0 ? void 0 : options.onFieldRemoved) === null || _a === void 0 ? void 0 : _a.call(options, fieldName, true);
|
|
2591
|
+
});
|
|
2592
|
+
// 4.2 批量删除错误消息
|
|
2593
|
+
if (this.errorMessageStore[formName]) {
|
|
2594
|
+
errorMessageKeysToRemove.forEach(function (key) {
|
|
2595
|
+
delete _this.errorMessageStore[formName][key];
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2598
|
+
// 4.3 批量删除 FormArray 配置
|
|
2599
|
+
if (this.formArrayConfigStore[formName]) {
|
|
2600
|
+
formArrayFields.forEach(function (fieldName) {
|
|
2601
|
+
delete _this.formArrayConfigStore[formName][fieldName];
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
catch (error) {
|
|
2606
|
+
// 如果批量删除过程中出错,标记为失败
|
|
2607
|
+
fieldsToRemove.forEach(function (fieldName) {
|
|
2608
|
+
var _a;
|
|
2609
|
+
if (!result.removed.includes(fieldName)) {
|
|
2610
|
+
var errorMessage = (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.toString()) || "Failed to remove field";
|
|
2611
|
+
result.failed.push({
|
|
2612
|
+
fieldName: fieldName,
|
|
2613
|
+
error: errorMessage,
|
|
2614
|
+
});
|
|
2615
|
+
(_a = options === null || options === void 0 ? void 0 : options.onFieldRemoved) === null || _a === void 0 ? void 0 : _a.call(options, fieldName, false, errorMessage);
|
|
2616
|
+
}
|
|
2617
|
+
});
|
|
2618
|
+
}
|
|
2619
|
+
// 5. 判断整体是否成功
|
|
2620
|
+
result.success = result.failed.length === 0;
|
|
2621
|
+
return result;
|
|
2622
|
+
};
|
|
2623
|
+
// 局部赋值(支持 FormArray 的智能更新,统一根据 action 字段判断操作类型)
|
|
2624
|
+
AntdFormService.prototype.patchFormValues = function (name, values, options) {
|
|
2625
|
+
var _this = this;
|
|
2626
|
+
var _a;
|
|
2627
|
+
var formGroup = this.formStore[name];
|
|
2628
|
+
if (!formGroup) {
|
|
2629
|
+
console.warn("[AntdFormService] patchFormValues: form \"" + name + "\" not found.");
|
|
2630
|
+
return;
|
|
2631
|
+
}
|
|
2632
|
+
var processedValues = {};
|
|
2633
|
+
Object.entries(values).forEach(function (_f) {
|
|
2634
|
+
var _g = __read(_f, 2), key = _g[0], value = _g[1];
|
|
2635
|
+
var control = formGroup.get(key);
|
|
2636
|
+
// 检测是否是 FormArray
|
|
2637
|
+
if (control instanceof i1.FormArray && Array.isArray(value)) {
|
|
2638
|
+
_this.patchFormArray(name, key, value);
|
|
2639
|
+
return;
|
|
2640
|
+
}
|
|
2641
|
+
// 普通字段,直接加入
|
|
2642
|
+
processedValues[key] = value;
|
|
2643
|
+
});
|
|
2644
|
+
// 处理普通字段
|
|
2645
|
+
if (Object.keys(processedValues).length > 0) {
|
|
2646
|
+
formGroup.patchValue(processedValues, {
|
|
2647
|
+
emitEvent: (_a = options === null || options === void 0 ? void 0 : options.emitEvent) !== null && _a !== void 0 ? _a : true,
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2651
|
+
// 表单校验(自动过滤内部字段)
|
|
2652
|
+
AntdFormService.prototype.validateForm = function (name, options) {
|
|
2653
|
+
var _a, _b;
|
|
2654
|
+
if (this.formStore[name].valid) {
|
|
2655
|
+
var rawValue = this.formStore[name].getRawValue();
|
|
2656
|
+
return this.excludeInternalFields(rawValue);
|
|
2657
|
+
}
|
|
2658
|
+
else {
|
|
2659
|
+
// 递归校验所有控件,包括 FormArray 中的项
|
|
2660
|
+
this.markAllControlsAsDirty(this.formStore[name], (_a = options === null || options === void 0 ? void 0 : options.emitEvent) !== null && _a !== void 0 ? _a : true, (_b = options === null || options === void 0 ? void 0 : options.onlySelf) !== null && _b !== void 0 ? _b : false);
|
|
2661
|
+
return false;
|
|
2662
|
+
}
|
|
2663
|
+
};
|
|
2664
|
+
// 递归标记所有无效控件为 dirty(包括 FormArray 中的项)
|
|
2665
|
+
AntdFormService.prototype.markAllControlsAsDirty = function (control, emitEvent, onlySelf) {
|
|
2666
|
+
var _this = this;
|
|
2667
|
+
if (control.invalid) {
|
|
2668
|
+
control.markAsDirty();
|
|
2669
|
+
control.updateValueAndValidity({
|
|
2670
|
+
emitEvent: emitEvent,
|
|
2671
|
+
onlySelf: onlySelf,
|
|
2672
|
+
});
|
|
2673
|
+
}
|
|
2674
|
+
// 如果是 FormGroup,递归处理所有子控件
|
|
2675
|
+
if (control instanceof i1.FormGroup) {
|
|
2676
|
+
Object.values(control.controls).forEach(function (childControl) {
|
|
2677
|
+
_this.markAllControlsAsDirty(childControl, emitEvent, onlySelf);
|
|
2678
|
+
});
|
|
2679
|
+
}
|
|
2680
|
+
// 如果是 FormArray,递归处理数组中的每一项
|
|
2681
|
+
if (control instanceof i1.FormArray) {
|
|
2682
|
+
control.controls.forEach(function (childControl) {
|
|
2683
|
+
_this.markAllControlsAsDirty(childControl, emitEvent, onlySelf);
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2686
|
+
};
|
|
2687
|
+
// ==================== 错误消息相关 ====================
|
|
2688
|
+
// 获取字段首条错误提示,支持普通字段和 FormArray 字段(格式:arrayName.index.fieldName)
|
|
2689
|
+
AntdFormService.prototype.getFieldErrorMessage = function (name, controlName) {
|
|
2690
|
+
var e_1, _f;
|
|
2691
|
+
var _a;
|
|
2692
|
+
var formGroup = this.formStore[name];
|
|
2693
|
+
if (!formGroup) {
|
|
2694
|
+
console.warn("[AntdFormService] getFieldErrorMessage: form \"" + name + "\" not found.");
|
|
2695
|
+
return "";
|
|
2696
|
+
}
|
|
2697
|
+
var control = formGroup.get(controlName);
|
|
2698
|
+
if (!control) {
|
|
2699
|
+
console.warn("[AntdFormService] getFieldErrorMessage: control \"" + controlName + "\" not found in form \"" + name + "\".");
|
|
2700
|
+
return "";
|
|
2701
|
+
}
|
|
2702
|
+
if (!control.errors) {
|
|
2703
|
+
return "";
|
|
2704
|
+
}
|
|
2705
|
+
// 解析 controlName,支持 FormArray 格式:arrayName.index.fieldName
|
|
2706
|
+
var errorMessageKey = controlName;
|
|
2707
|
+
var arrayMatch = controlName.match(/^(.+)\.(\d+)\.(.+)$/);
|
|
2708
|
+
if (arrayMatch) {
|
|
2709
|
+
// FormArray 格式:arrayName.index.fieldName -> 使用 arrayName[].fieldName 作为 key
|
|
2710
|
+
var _g = __read(arrayMatch, 4), arrayName = _g[1], fieldName = _g[3];
|
|
2711
|
+
errorMessageKey = arrayName + "[]." + fieldName;
|
|
2712
|
+
}
|
|
2713
|
+
// 从 errorMessageStore 获取错误消息配置
|
|
2714
|
+
var errorMessages = (_a = this.errorMessageStore[name]) === null || _a === void 0 ? void 0 : _a[errorMessageKey];
|
|
2715
|
+
var mergedMessages = Object.assign(Object.assign({}, this.defaultErrorMessages), (errorMessages !== null && errorMessages !== void 0 ? errorMessages : {}));
|
|
2716
|
+
try {
|
|
2717
|
+
for (var _h = __values(Object.keys(control.errors)), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
2718
|
+
var errorKey = _j.value;
|
|
2719
|
+
var message = mergedMessages[errorKey];
|
|
2720
|
+
if (message) {
|
|
2721
|
+
// 不再支持函数形式,只返回字符串
|
|
2722
|
+
return typeof message === "string" ? message : "";
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2727
|
+
finally {
|
|
2728
|
+
try {
|
|
2729
|
+
if (_j && !_j.done && (_f = _h.return)) _f.call(_h);
|
|
2730
|
+
}
|
|
2731
|
+
finally { if (e_1) throw e_1.error; }
|
|
2732
|
+
}
|
|
2733
|
+
return "";
|
|
2734
|
+
};
|
|
2735
|
+
// ==================== 监听相关 ====================
|
|
2736
|
+
// 监听表单所有字段变更
|
|
2737
|
+
AntdFormService.prototype.watchFormChanges = function (name, handler, options) {
|
|
2738
|
+
var formGroup = this.formStore[name];
|
|
2739
|
+
if (!formGroup) {
|
|
2740
|
+
console.warn("[AntdFormService] watchFormChanges: form \"" + name + "\" not found.");
|
|
2741
|
+
return undefined;
|
|
2742
|
+
}
|
|
2743
|
+
return this.setupValueChangeSubscription(formGroup, handler, options);
|
|
2744
|
+
};
|
|
2745
|
+
// 监听指定字段变更
|
|
2746
|
+
AntdFormService.prototype.watchFieldChanges = function (name, controlName, handler, options) {
|
|
2747
|
+
var formGroup = this.formStore[name];
|
|
2748
|
+
if (!formGroup) {
|
|
2749
|
+
console.warn("[AntdFormService] watchFieldChanges: form \"" + name + "\" not found.");
|
|
2750
|
+
return undefined;
|
|
2751
|
+
}
|
|
2752
|
+
var control = formGroup.get(controlName);
|
|
2753
|
+
if (!control) {
|
|
2754
|
+
console.warn("[AntdFormService] watchFieldChanges: control \"" + controlName + "\" not found in form \"" + name + "\".");
|
|
2755
|
+
return undefined;
|
|
2756
|
+
}
|
|
2757
|
+
return this.setupValueChangeSubscription(control, handler, options);
|
|
2758
|
+
};
|
|
2759
|
+
// ==================== 工具方法 ====================
|
|
2760
|
+
// 获取表单类名
|
|
2761
|
+
AntdFormService.prototype.getFormClassName = function (name) {
|
|
2762
|
+
return "" + this.classPrefix + name;
|
|
2763
|
+
};
|
|
2764
|
+
// 设置 CSS 变量到目标元素(支持持久化监听动态添加的元素)
|
|
2765
|
+
AntdFormService.prototype.setCSSVariablesToTarget = function (name) {
|
|
2766
|
+
var _this = this;
|
|
2767
|
+
var selector = "." + this.getFormClassName(name) + " .ant-form-item-label";
|
|
2768
|
+
var formContainerSelector = "." + this.getFormClassName(name);
|
|
2769
|
+
var applyStyles = function () {
|
|
2770
|
+
var dom = document.querySelectorAll(selector);
|
|
2771
|
+
if (!dom.length) {
|
|
2772
|
+
return false;
|
|
2773
|
+
}
|
|
2774
|
+
var appliedCount = 0;
|
|
2775
|
+
dom.forEach(function (item) {
|
|
2776
|
+
var target = item;
|
|
2777
|
+
if (target.style.width !== _this.labelWidth ||
|
|
2778
|
+
target.style.textAlign !== _this.labelAlign) {
|
|
2779
|
+
target.style.width = _this.labelWidth;
|
|
2780
|
+
target.style.textAlign = _this.labelAlign;
|
|
2781
|
+
appliedCount++;
|
|
2782
|
+
}
|
|
2783
|
+
});
|
|
2784
|
+
return appliedCount > 0;
|
|
2785
|
+
};
|
|
2786
|
+
if (this.labelObservers[name]) {
|
|
2787
|
+
return;
|
|
2788
|
+
}
|
|
2789
|
+
var timeout = null;
|
|
2790
|
+
var observer = new MutationObserver(function () {
|
|
2791
|
+
cancelAnimationFrame(timeout);
|
|
2792
|
+
timeout = requestAnimationFrame(function () {
|
|
2793
|
+
setTimeout(function () {
|
|
2794
|
+
applyStyles();
|
|
2795
|
+
}, 0);
|
|
2796
|
+
});
|
|
2797
|
+
});
|
|
2798
|
+
var formContainer = document.querySelector(formContainerSelector);
|
|
2799
|
+
observer.observe(formContainer || document.body, {
|
|
2800
|
+
childList: true,
|
|
2801
|
+
subtree: true,
|
|
2802
|
+
attributes: true,
|
|
2803
|
+
});
|
|
2804
|
+
this.labelObservers[name] = observer;
|
|
2805
|
+
};
|
|
2806
|
+
// ==================== 私有方法 ====================
|
|
2807
|
+
// 获取 FormArray
|
|
2808
|
+
AntdFormService.prototype.getFormArray = function (formName, arrayName) {
|
|
2809
|
+
var formGroup = this.formStore[formName];
|
|
2810
|
+
if (!formGroup) {
|
|
2811
|
+
console.warn("[AntdFormService] getFormArray: form \"" + formName + "\" not found.");
|
|
2812
|
+
return null;
|
|
2813
|
+
}
|
|
2814
|
+
var control = formGroup.get(arrayName);
|
|
2815
|
+
if (!control || !(control instanceof i1.FormArray)) {
|
|
2816
|
+
console.warn("[AntdFormService] getFormArray: array \"" + arrayName + "\" not found in form \"" + formName + "\".");
|
|
2817
|
+
return null;
|
|
2818
|
+
}
|
|
2819
|
+
return control;
|
|
2820
|
+
};
|
|
2821
|
+
// 判断是否是 FormArray 配置
|
|
2822
|
+
AntdFormService.prototype.isFormArrayConfig = function (field) {
|
|
2823
|
+
return field.type === "array";
|
|
2824
|
+
};
|
|
2825
|
+
// 从配置创建 FormArray
|
|
2826
|
+
AntdFormService.prototype.createFormArrayFromConfig = function (formName, arrayName, itemConfig, initialItems, uniqueIdField) {
|
|
2827
|
+
var _this = this;
|
|
2828
|
+
var formArray = this.fb.array([]);
|
|
2829
|
+
initialItems.forEach(function (item) {
|
|
2830
|
+
var itemGroup = _this.createItemFormGroup(itemConfig, item, uniqueIdField);
|
|
2831
|
+
formArray.push(itemGroup);
|
|
2832
|
+
});
|
|
2833
|
+
return formArray;
|
|
2834
|
+
};
|
|
2835
|
+
// 生成内部ID(使用业务唯一字段或生成临时ID)
|
|
2836
|
+
AntdFormService.prototype.generateInternalId = function (itemData, uniqueIdField) {
|
|
2837
|
+
// 优先使用业务唯一字段
|
|
2838
|
+
if (uniqueIdField && (itemData === null || itemData === void 0 ? void 0 : itemData[uniqueIdField]) !== undefined) {
|
|
2839
|
+
var businessId = itemData[uniqueIdField];
|
|
2840
|
+
if (businessId !== null &&
|
|
2841
|
+
businessId !== undefined &&
|
|
2842
|
+
businessId !== "") {
|
|
2843
|
+
return "business-" + uniqueIdField + "-" + businessId;
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
// 如果没有业务ID,生成临时ID(用于新添加的项)
|
|
2847
|
+
return "temp-" + Date.now() + "-" + Math.random().toString(36).substr(2, 9);
|
|
2848
|
+
};
|
|
2849
|
+
// 创建单个项的 FormGroup
|
|
2850
|
+
AntdFormService.prototype.createItemFormGroup = function (itemConfig, itemData, uniqueIdField) {
|
|
2851
|
+
var _this = this;
|
|
2852
|
+
var groupConfig = {};
|
|
2853
|
+
// 添加内部ID字段
|
|
2854
|
+
var itemId = this.generateInternalId(itemData, uniqueIdField);
|
|
2855
|
+
groupConfig[this.INTERNAL_ID_FIELD] = [
|
|
2856
|
+
{ value: itemId, disabled: true },
|
|
2857
|
+
[],
|
|
2858
|
+
];
|
|
2859
|
+
// 添加业务字段
|
|
2860
|
+
Object.entries(itemConfig).forEach(function (_f) {
|
|
2861
|
+
var _g = __read(_f, 2), key = _g[0], field = _g[1];
|
|
2862
|
+
var _a, _b, _c;
|
|
2863
|
+
// itemConfig 中的字段应该是 FieldConfig,不应该包含 FormArrayConfig
|
|
2864
|
+
if (_this.isFormArrayConfig(field)) {
|
|
2865
|
+
console.warn("[AntdFormService] createItemFormGroup: FormArrayConfig is not allowed in itemConfig. Skipping field \"" + key + "\".");
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
var fieldConfig = field;
|
|
2869
|
+
var value = (itemData === null || itemData === void 0 ? void 0 : itemData[key]) !== undefined ? itemData[key] : fieldConfig.value;
|
|
2870
|
+
groupConfig[key] = [
|
|
2871
|
+
{ value: value, disabled: (_a = fieldConfig.disabled) !== null && _a !== void 0 ? _a : false },
|
|
2872
|
+
(_c = (_b = fieldConfig.validators) === null || _b === void 0 ? void 0 : _b.call(fieldConfig)) !== null && _c !== void 0 ? _c : [],
|
|
2873
|
+
];
|
|
2874
|
+
});
|
|
2875
|
+
return this.fb.group(groupConfig);
|
|
2876
|
+
};
|
|
2877
|
+
// 通过业务唯一字段查找内部ID
|
|
2878
|
+
AntdFormService.prototype.findFormArrayItemIdByBusinessField = function (formName, arrayName, uniqueIdField, businessIdValue) {
|
|
2879
|
+
var formArray = this.getFormArray(formName, arrayName);
|
|
2880
|
+
if (!formArray)
|
|
2881
|
+
return null;
|
|
2882
|
+
for (var i = 0; i < formArray.length; i++) {
|
|
2883
|
+
var item = formArray.at(i);
|
|
2884
|
+
var itemValue = item.getRawValue();
|
|
2885
|
+
var internalId = itemValue[this.INTERNAL_ID_FIELD];
|
|
2886
|
+
// 检查内部ID是否匹配业务ID
|
|
2887
|
+
if (internalId && internalId.startsWith("business-" + uniqueIdField + "-")) {
|
|
2888
|
+
var idInInternalId = internalId.replace("business-" + uniqueIdField + "-", "");
|
|
2889
|
+
if (String(idInInternalId) === String(businessIdValue)) {
|
|
2890
|
+
return internalId;
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
// 也检查当前业务字段值是否匹配(处理业务ID更新的情况)
|
|
2894
|
+
if (itemValue[uniqueIdField] === businessIdValue) {
|
|
2895
|
+
return internalId;
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
return null;
|
|
2899
|
+
};
|
|
2900
|
+
// 通过内部ID查找项
|
|
2901
|
+
AntdFormService.prototype.findFormArrayItemById = function (formName, arrayName, itemId) {
|
|
2902
|
+
var _a;
|
|
2903
|
+
var formArray = this.getFormArray(formName, arrayName);
|
|
2904
|
+
if (!formArray)
|
|
2905
|
+
return null;
|
|
2906
|
+
for (var i = 0; i < formArray.length; i++) {
|
|
2907
|
+
var item = formArray.at(i);
|
|
2908
|
+
var id = (_a = item.get(this.INTERNAL_ID_FIELD)) === null || _a === void 0 ? void 0 : _a.value;
|
|
2909
|
+
if (id === itemId) {
|
|
2910
|
+
return { index: i, formGroup: item };
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
return null;
|
|
2914
|
+
};
|
|
2915
|
+
// 获取操作类型(必须明确指定 action 字段)
|
|
2916
|
+
AntdFormService.prototype.getOperationType = function (itemData) {
|
|
2917
|
+
if (!itemData || typeof itemData !== "object")
|
|
2918
|
+
return null;
|
|
2919
|
+
var action = itemData.action;
|
|
2920
|
+
if (action === "delete" || action === "update" || action === "create") {
|
|
2921
|
+
return action;
|
|
2922
|
+
}
|
|
2923
|
+
return null;
|
|
2924
|
+
};
|
|
2925
|
+
// 过滤操作字段(action 字段不保存到表单中)
|
|
2926
|
+
AntdFormService.prototype.filterOperationFields = function (itemData) {
|
|
2927
|
+
if (!itemData || typeof itemData !== "object")
|
|
2928
|
+
return itemData;
|
|
2929
|
+
var filtered = {};
|
|
2930
|
+
Object.entries(itemData).forEach(function (_f) {
|
|
2931
|
+
var _g = __read(_f, 2), key = _g[0], value = _g[1];
|
|
2932
|
+
if (key !== "action") {
|
|
2933
|
+
filtered[key] = value;
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
2936
|
+
return filtered;
|
|
2937
|
+
};
|
|
2938
|
+
// 处理 FormArray 的更新(统一根据 action 字段判断操作类型)
|
|
2939
|
+
AntdFormService.prototype.patchFormArray = function (formName, arrayName, newValues) {
|
|
2940
|
+
var _this = this;
|
|
2941
|
+
var _a;
|
|
2942
|
+
var formArray = this.getFormArray(formName, arrayName);
|
|
2943
|
+
if (!formArray) {
|
|
2944
|
+
console.warn("[AntdFormService] patchFormArray: array \"" + arrayName + "\" not found in form \"" + formName + "\".");
|
|
2945
|
+
return;
|
|
2946
|
+
}
|
|
2947
|
+
var config = (_a = this.formArrayConfigStore[formName]) === null || _a === void 0 ? void 0 : _a[arrayName];
|
|
2948
|
+
if (!config) {
|
|
2949
|
+
console.warn("[AntdFormService] patchFormArray: config not found for array \"" + arrayName + "\" in form \"" + formName + "\".");
|
|
2950
|
+
return;
|
|
2951
|
+
}
|
|
2952
|
+
var itemConfig = config.itemConfig, uniqueIdField = config.uniqueIdField;
|
|
2953
|
+
// 统一根据 action 字段判断操作类型
|
|
2954
|
+
var itemsToDelete = new Set();
|
|
2955
|
+
var itemsToUpdate = new Map();
|
|
2956
|
+
var itemsToAdd = [];
|
|
2957
|
+
newValues.forEach(function (itemData) {
|
|
2958
|
+
if (!itemData || typeof itemData !== "object")
|
|
2959
|
+
return;
|
|
2960
|
+
var operationType = _this.getOperationType(itemData);
|
|
2961
|
+
if (!operationType) {
|
|
2962
|
+
console.warn("[AntdFormService] patchFormArray: Item missing required \"action\" field. Skipping.", itemData);
|
|
2963
|
+
return;
|
|
2964
|
+
}
|
|
2965
|
+
// 删除操作
|
|
2966
|
+
if (operationType === "delete") {
|
|
2967
|
+
if (uniqueIdField && itemData[uniqueIdField] !== undefined) {
|
|
2968
|
+
var businessId = itemData[uniqueIdField];
|
|
2969
|
+
var internalId = _this.findFormArrayItemIdByBusinessField(formName, arrayName, uniqueIdField, businessId);
|
|
2970
|
+
if (internalId) {
|
|
2971
|
+
itemsToDelete.add(internalId);
|
|
2972
|
+
}
|
|
2973
|
+
else {
|
|
2974
|
+
console.warn("[AntdFormService] patchFormArray: Cannot delete item with " + uniqueIdField + "=" + businessId + ", item not found.");
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
else {
|
|
2978
|
+
console.warn("[AntdFormService] patchFormArray: Cannot delete item, missing required uniqueIdField \"" + uniqueIdField + "\".");
|
|
2979
|
+
}
|
|
2980
|
+
return;
|
|
2981
|
+
}
|
|
2982
|
+
// 更新操作
|
|
2983
|
+
if (operationType === "update") {
|
|
2984
|
+
if (uniqueIdField && itemData[uniqueIdField] !== undefined) {
|
|
2985
|
+
var businessId = itemData[uniqueIdField];
|
|
2986
|
+
var internalId = _this.findFormArrayItemIdByBusinessField(formName, arrayName, uniqueIdField, businessId);
|
|
2987
|
+
if (internalId) {
|
|
2988
|
+
var filteredData = _this.filterOperationFields(itemData);
|
|
2989
|
+
itemsToUpdate.set(internalId, filteredData);
|
|
2990
|
+
}
|
|
2991
|
+
else {
|
|
2992
|
+
console.warn("[AntdFormService] patchFormArray: Cannot update item with " + uniqueIdField + "=" + businessId + ", item not found. Skipping.");
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
else {
|
|
2996
|
+
console.warn("[AntdFormService] patchFormArray: Cannot update item, missing required uniqueIdField \"" + uniqueIdField + "\". Skipping.");
|
|
2997
|
+
}
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
// 创建操作
|
|
3001
|
+
if (operationType === "create") {
|
|
3002
|
+
var filteredData = _this.filterOperationFields(itemData);
|
|
3003
|
+
itemsToAdd.push(filteredData);
|
|
3004
|
+
}
|
|
3005
|
+
});
|
|
3006
|
+
// 执行删除(需要从后往前删除,避免索引变化)
|
|
3007
|
+
var deleteIndices = [];
|
|
3008
|
+
itemsToDelete.forEach(function (itemId) {
|
|
3009
|
+
var found = _this.findFormArrayItemById(formName, arrayName, itemId);
|
|
3010
|
+
if (found) {
|
|
3011
|
+
deleteIndices.push(found.index);
|
|
3012
|
+
}
|
|
3013
|
+
});
|
|
3014
|
+
deleteIndices
|
|
3015
|
+
.sort(function (a, b) { return b - a; })
|
|
3016
|
+
.forEach(function (index) {
|
|
3017
|
+
formArray.removeAt(index);
|
|
3018
|
+
});
|
|
3019
|
+
// 执行更新
|
|
3020
|
+
itemsToUpdate.forEach(function (itemData, itemId) {
|
|
3021
|
+
var found = _this.findFormArrayItemById(formName, arrayName, itemId);
|
|
3022
|
+
if (found) {
|
|
3023
|
+
var _a_1 = itemData, _b = _this.INTERNAL_ID_FIELD, _ = _a_1[_b], dataToUpdate = __rest(_a_1, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
3024
|
+
found.formGroup.patchValue(dataToUpdate);
|
|
3025
|
+
}
|
|
3026
|
+
});
|
|
3027
|
+
// 执行添加
|
|
3028
|
+
itemsToAdd.forEach(function (itemData) {
|
|
3029
|
+
var newItem = _this.createItemFormGroup(itemConfig, itemData, uniqueIdField);
|
|
3030
|
+
formArray.push(newItem);
|
|
3031
|
+
});
|
|
3032
|
+
};
|
|
3033
|
+
// 过滤内部字段(递归处理对象和数组)
|
|
3034
|
+
AntdFormService.prototype.excludeInternalFields = function (value) {
|
|
3035
|
+
var _this = this;
|
|
3036
|
+
if (value === null || value === undefined) {
|
|
3037
|
+
return value;
|
|
3038
|
+
}
|
|
3039
|
+
if (Array.isArray(value)) {
|
|
3040
|
+
return value.map(function (item) { return _this.excludeInternalFields(item); });
|
|
3041
|
+
}
|
|
3042
|
+
if (typeof value !== "object") {
|
|
3043
|
+
return value;
|
|
3044
|
+
}
|
|
3045
|
+
var filtered = {};
|
|
3046
|
+
Object.entries(value).forEach(function (_f) {
|
|
3047
|
+
var _g = __read(_f, 2), key = _g[0], val = _g[1];
|
|
3048
|
+
// 过滤以 __ 开头的内部字段和 action 字段
|
|
3049
|
+
if (!key.startsWith("__") && key !== "action") {
|
|
3050
|
+
filtered[key] = _this.excludeInternalFields(val);
|
|
3051
|
+
}
|
|
3052
|
+
});
|
|
3053
|
+
return filtered;
|
|
3054
|
+
};
|
|
3055
|
+
// 设置值变更订阅
|
|
3056
|
+
AntdFormService.prototype.setupValueChangeSubscription = function (target, handler, options) {
|
|
3057
|
+
var valueChanges$ = target.valueChanges;
|
|
3058
|
+
if ((options === null || options === void 0 ? void 0 : options.debounce) != null) {
|
|
3059
|
+
valueChanges$ = valueChanges$.pipe(operators.debounceTime(options.debounce));
|
|
3060
|
+
}
|
|
3061
|
+
if ((options === null || options === void 0 ? void 0 : options.distinctUntilChanged) !== false) {
|
|
3062
|
+
valueChanges$ = valueChanges$.pipe(operators.distinctUntilChanged());
|
|
3063
|
+
}
|
|
3064
|
+
if (options === null || options === void 0 ? void 0 : options.emitInitial) {
|
|
3065
|
+
handler(target.value);
|
|
3066
|
+
}
|
|
3067
|
+
return valueChanges$.subscribe(handler);
|
|
3068
|
+
};
|
|
3069
|
+
return AntdFormService;
|
|
3070
|
+
}());
|
|
3071
|
+
AntdFormService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AntdFormService_Factory() { return new AntdFormService(i0.ɵɵinject(i1.FormBuilder)); }, token: AntdFormService, providedIn: "root" });
|
|
3072
|
+
AntdFormService.decorators = [
|
|
3073
|
+
{ type: i0.Injectable, args: [{ providedIn: "root" },] }
|
|
3074
|
+
];
|
|
3075
|
+
AntdFormService.ctorParameters = function () { return [
|
|
3076
|
+
{ type: i1.FormBuilder }
|
|
3077
|
+
]; };
|
|
3078
|
+
|
|
3079
|
+
/*
|
|
3080
|
+
* Public API Surface of pro-table
|
|
3081
|
+
*/
|
|
3082
|
+
|
|
3083
|
+
/**
|
|
3084
|
+
* Generated bundle index. Do not edit.
|
|
3085
|
+
*/
|
|
3086
|
+
|
|
3087
|
+
exports.AntdFormService = AntdFormService;
|
|
3088
|
+
exports.DefaultPlatePrefixLoadService = DefaultPlatePrefixLoadService;
|
|
3089
|
+
exports.PLATE_PREFIX_LOAD_SERVICE = PLATE_PREFIX_LOAD_SERVICE;
|
|
3090
|
+
exports.PRO_TABLE_COLUMN_REMOTE = PRO_TABLE_COLUMN_REMOTE;
|
|
3091
|
+
exports.PRO_TABLE_DEFAULT_COLUMN = PRO_TABLE_DEFAULT_COLUMN;
|
|
3092
|
+
exports.PRO_TABLE_DEFAULT_PROPS = PRO_TABLE_DEFAULT_PROPS;
|
|
3093
|
+
exports.ProTableComponent = ProTableComponent;
|
|
3094
|
+
exports.ProTableModule = ProTableModule;
|
|
3095
|
+
exports.ɵ0 = ɵ0;
|
|
3096
|
+
exports.ɵ1 = ɵ1;
|
|
3097
|
+
exports.ɵ2 = ɵ2;
|
|
3098
|
+
exports.ɵa = PageContainerModule;
|
|
3099
|
+
exports.ɵb = PageContainerComponent;
|
|
3100
|
+
exports.ɵc = TableSearchBarModule;
|
|
3101
|
+
exports.ɵd = TableSearchBarComponent;
|
|
3102
|
+
exports.ɵe = PlateInputModule;
|
|
3103
|
+
exports.ɵf = PlateInputComponent;
|
|
3104
|
+
exports.ɵg = ColmunsSettingComponent;
|
|
3105
|
+
exports.ɵh = DynamicSearchFieldComponent;
|
|
3106
|
+
|
|
3107
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3108
|
+
|
|
3109
|
+
})));
|
|
3110
|
+
//# sourceMappingURL=yibozhang-pro-table.umd.js.map
|