ngx-rs-ant 1.5.0 → 1.5.2
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/data-grid/data-grid.component.d.ts +26 -26
- package/data-grid/data-grid.factory.d.ts +1 -1
- package/data-grid/data-grid.module.d.ts +8 -8
- package/data-grid/data-grid.service.d.ts +2 -0
- package/data-grid/instance-link-template/instance-link-template.component.d.ts +21 -0
- package/data-grid/unit-info-template/unit-info-template.component.d.ts +2 -1
- package/data-grid/user-info-template/user-info-template.component.d.ts +2 -1
- package/esm2020/data-detail/data-detail.component.mjs +5 -1
- package/esm2020/data-grid/data-grid.component.mjs +78 -44
- package/esm2020/data-grid/data-grid.factory.mjs +13 -17
- package/esm2020/data-grid/data-grid.module.mjs +15 -18
- package/esm2020/data-grid/data-grid.service.mjs +26 -1
- package/esm2020/data-grid/file-cell-template/file-cell-template.component.mjs +3 -7
- package/esm2020/data-grid/instance-link-template/instance-link-template.component.mjs +64 -0
- package/esm2020/data-grid/unit-info-template/unit-info-template.component.mjs +12 -4
- package/esm2020/data-grid/user-info-template/user-info-template.component.mjs +12 -4
- package/esm2020/public-api.mjs +1 -3
- package/fesm2015/ngx-rs-ant.mjs +758 -661
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +751 -656
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -2
- package/data-grid/instance-link-template.directive.d.ts +0 -8
- package/data-grid/master-detail-template.directive.d.ts +0 -8
- package/esm2020/data-grid/instance-link-template.directive.mjs +0 -16
- package/esm2020/data-grid/master-detail-template.directive.mjs +0 -16
package/fesm2015/ngx-rs-ant.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { CommonModule, formatDate } from '@angular/common';
|
|
|
6
6
|
import { Subject, ReplaySubject, Subscription, map, shareReplay, lastValueFrom, debounceTime, interval } from 'rxjs';
|
|
7
7
|
import * as i2 from 'devextreme-angular/ui/number-box';
|
|
8
8
|
import * as i2$1 from 'devextreme-angular/ui/draggable';
|
|
9
|
-
import { DevExtremeModule, DxLoadPanelModule,
|
|
9
|
+
import { DevExtremeModule, DxLoadPanelModule, DxValidationGroupComponent, DxDataGridComponent } from 'devextreme-angular';
|
|
10
10
|
import BpmnModeler from 'camunda-bpmn-js/lib/camunda-platform/Modeler';
|
|
11
11
|
import { is } from 'bpmn-js/lib/util/ModelUtil';
|
|
12
12
|
import { TextAreaEntry, isTextAreaEntryEdited, SelectEntry, isSelectEntryEdited } from '@bpmn-io/properties-panel';
|
|
@@ -15,12 +15,12 @@ import * as i6$1 from 'devextreme-angular/ui/nested';
|
|
|
15
15
|
import { DxoPositionModule } from 'devextreme-angular/ui/nested';
|
|
16
16
|
import * as i4 from 'devextreme-angular/ui/button';
|
|
17
17
|
import * as i1$1 from '@angular/common/http';
|
|
18
|
+
import { __awaiter } from 'tslib';
|
|
19
|
+
import notify from 'devextreme/ui/notify';
|
|
18
20
|
import CustomStore from 'devextreme/data/custom_store';
|
|
19
21
|
import * as i3 from 'devextreme-angular/core';
|
|
20
22
|
import * as i5$1 from 'devextreme-angular/ui/data-grid';
|
|
21
23
|
import * as i5 from 'devextreme-angular/ui/tooltip';
|
|
22
|
-
import { __awaiter } from 'tslib';
|
|
23
|
-
import notify from 'devextreme/ui/notify';
|
|
24
24
|
import * as i2$2 from '@angular/platform-browser';
|
|
25
25
|
import * as i3$1 from 'devextreme-angular/ui/accordion';
|
|
26
26
|
import * as i7 from 'devextreme-angular/ui/validation-group';
|
|
@@ -1846,6 +1846,22 @@ class DataGridService {
|
|
|
1846
1846
|
}
|
|
1847
1847
|
});
|
|
1848
1848
|
}
|
|
1849
|
+
getOneByFilter(tenant, className, key, value, view) {
|
|
1850
|
+
let api = 'api/data/' + className;
|
|
1851
|
+
return this.http.get(api, {
|
|
1852
|
+
params: {
|
|
1853
|
+
tenant,
|
|
1854
|
+
view: view || '',
|
|
1855
|
+
filter: '["' + key + '","=","' + value + '"]',
|
|
1856
|
+
limit: 1
|
|
1857
|
+
}
|
|
1858
|
+
}).pipe(map(response => {
|
|
1859
|
+
if (response.data.count === 1) {
|
|
1860
|
+
return response.data.list[0];
|
|
1861
|
+
}
|
|
1862
|
+
return {};
|
|
1863
|
+
}));
|
|
1864
|
+
}
|
|
1849
1865
|
getMany(tenant, className, params) {
|
|
1850
1866
|
const api = 'api/data/' + className;
|
|
1851
1867
|
return this.http.get(api + params, {
|
|
@@ -1949,6 +1965,15 @@ class DataGridService {
|
|
|
1949
1965
|
responseType: "blob"
|
|
1950
1966
|
});
|
|
1951
1967
|
}
|
|
1968
|
+
getInstanceCaption(tenant, className, oid) {
|
|
1969
|
+
return this.http.get('api/data/' + className + '/' + oid + '/caption', {
|
|
1970
|
+
params: {
|
|
1971
|
+
tenant
|
|
1972
|
+
}
|
|
1973
|
+
}).pipe(map(response => {
|
|
1974
|
+
return response.data;
|
|
1975
|
+
}));
|
|
1976
|
+
}
|
|
1952
1977
|
getUserInfo(uid) {
|
|
1953
1978
|
if (!this.userInfoCache.hasOwnProperty(uid)) {
|
|
1954
1979
|
this.userInfoCache[uid] = this.http.get('api/data/custom', {
|
|
@@ -1982,20 +2007,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1982
2007
|
type: Injectable
|
|
1983
2008
|
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
1984
2009
|
|
|
1985
|
-
class MasterDetailTemplateDirective {
|
|
1986
|
-
constructor(templateRef) {
|
|
1987
|
-
this.templateRef = templateRef;
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
MasterDetailTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MasterDetailTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1991
|
-
MasterDetailTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: MasterDetailTemplateDirective, selector: "[rsMasterDetailTemplate]", ngImport: i0 });
|
|
1992
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MasterDetailTemplateDirective, decorators: [{
|
|
1993
|
-
type: Directive,
|
|
1994
|
-
args: [{
|
|
1995
|
-
selector: '[rsMasterDetailTemplate]'
|
|
1996
|
-
}]
|
|
1997
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
1998
|
-
|
|
1999
2010
|
class RowButtonsTemplateDirective {
|
|
2000
2011
|
constructor(templateRef) {
|
|
2001
2012
|
this.templateRef = templateRef;
|
|
@@ -2010,19 +2021,178 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
2010
2021
|
}]
|
|
2011
2022
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
2012
2023
|
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2024
|
+
function notify_error(message) {
|
|
2025
|
+
notify({
|
|
2026
|
+
displayTime: 12000,
|
|
2027
|
+
message,
|
|
2028
|
+
type: 'error',
|
|
2029
|
+
width: '300px'
|
|
2030
|
+
}, {
|
|
2031
|
+
direction: 'up-push',
|
|
2032
|
+
position: 'bottom right'
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2035
|
+
function notify_warning(message) {
|
|
2036
|
+
notify({
|
|
2037
|
+
displayTime: 8000,
|
|
2038
|
+
message,
|
|
2039
|
+
type: 'warning',
|
|
2040
|
+
width: '300px'
|
|
2041
|
+
}, {
|
|
2042
|
+
direction: 'up-push',
|
|
2043
|
+
position: 'bottom right'
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
function notify_success(message) {
|
|
2047
|
+
notify({
|
|
2048
|
+
displayTime: 4000,
|
|
2049
|
+
message,
|
|
2050
|
+
type: 'success',
|
|
2051
|
+
width: '300px'
|
|
2052
|
+
}, {
|
|
2053
|
+
direction: 'down-push',
|
|
2054
|
+
position: 'top right'
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
function format_date(date, locale) {
|
|
2058
|
+
return formatDate(date, 'yyyy/MM/dd', locale, 'GMT+8');
|
|
2059
|
+
}
|
|
2060
|
+
function format_datetime(date, locale) {
|
|
2061
|
+
return formatDate(date, 'yyyy/MM/dd HH:mm:ss', locale, 'GMT+8');
|
|
2062
|
+
}
|
|
2063
|
+
function file_type_icon(name) {
|
|
2064
|
+
const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
|
|
2065
|
+
switch (type) {
|
|
2066
|
+
case 'doc':
|
|
2067
|
+
case 'docx':
|
|
2068
|
+
return 'word';
|
|
2069
|
+
case 'xls':
|
|
2070
|
+
case 'xlsx':
|
|
2071
|
+
case 'csv':
|
|
2072
|
+
return 'excel';
|
|
2073
|
+
case 'ppt':
|
|
2074
|
+
case 'pptx':
|
|
2075
|
+
return 'ppt';
|
|
2076
|
+
case 'pdf':
|
|
2077
|
+
return 'pdf';
|
|
2078
|
+
case 'txt':
|
|
2079
|
+
case 'xml':
|
|
2080
|
+
case 'json':
|
|
2081
|
+
case 'js':
|
|
2082
|
+
return 'text';
|
|
2083
|
+
case 'png':
|
|
2084
|
+
case 'jpg':
|
|
2085
|
+
case 'jpeg':
|
|
2086
|
+
case 'gif':
|
|
2087
|
+
case 'bmp':
|
|
2088
|
+
return 'image';
|
|
2089
|
+
case 'zip':
|
|
2090
|
+
case 'rar':
|
|
2091
|
+
case '7z':
|
|
2092
|
+
case 'jar':
|
|
2093
|
+
return 'zip';
|
|
2094
|
+
default:
|
|
2095
|
+
return 'unknown';
|
|
2016
2096
|
}
|
|
2017
2097
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2098
|
+
function support_preview_ext() {
|
|
2099
|
+
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'doc', 'docx', 'txt', 'xml', 'json', 'js', 'xls', 'xlsx', 'csv', 'ppt', 'pptx'];
|
|
2100
|
+
}
|
|
2101
|
+
function format_file_size(size) {
|
|
2102
|
+
const labels = ['b', 'Kb', 'Mb', 'Gb'];
|
|
2103
|
+
const count = labels.length - 1;
|
|
2104
|
+
let i = 0;
|
|
2105
|
+
while (i < count && size >= 1024) {
|
|
2106
|
+
size /= 1024;
|
|
2107
|
+
i++;
|
|
2108
|
+
}
|
|
2109
|
+
return Math.round(size * 100) / 100 + " " + labels[i];
|
|
2110
|
+
}
|
|
2111
|
+
function download_file(blob, filename, callback) {
|
|
2112
|
+
const url = window.webkitURL.createObjectURL(blob);
|
|
2113
|
+
const a = document.createElement('a');
|
|
2114
|
+
document.body.appendChild(a);
|
|
2115
|
+
a.setAttribute('style', 'display:none');
|
|
2116
|
+
a.setAttribute('href', url);
|
|
2117
|
+
a.setAttribute('download', decodeURIComponent(filename));
|
|
2118
|
+
a.click();
|
|
2119
|
+
setTimeout(() => {
|
|
2120
|
+
if (callback) {
|
|
2121
|
+
callback();
|
|
2122
|
+
}
|
|
2123
|
+
a.remove();
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
function validate(validator) {
|
|
2127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2128
|
+
return new Promise(resolve => {
|
|
2129
|
+
var _a;
|
|
2130
|
+
const validateResult = validator.instance.validate();
|
|
2131
|
+
if (!validateResult.isValid) {
|
|
2132
|
+
resolve(false);
|
|
2133
|
+
}
|
|
2134
|
+
if (validateResult.status === 'pending') {
|
|
2135
|
+
(_a = validateResult.complete) === null || _a === void 0 ? void 0 : _a.then((result) => {
|
|
2136
|
+
if (result.isValid) {
|
|
2137
|
+
resolve(true);
|
|
2138
|
+
}
|
|
2139
|
+
else {
|
|
2140
|
+
resolve(false);
|
|
2141
|
+
}
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
else {
|
|
2145
|
+
resolve(true);
|
|
2146
|
+
}
|
|
2147
|
+
});
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
function validate_group(validationGroup) {
|
|
2151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2152
|
+
const top = validationGroup.element.nativeElement;
|
|
2153
|
+
let sourceNode;
|
|
2154
|
+
const targetClassName = 'dx-field';
|
|
2155
|
+
const findTargetNode = (node) => {
|
|
2156
|
+
sourceNode = node;
|
|
2157
|
+
while (true) {
|
|
2158
|
+
if (node.classList.contains(targetClassName)) {
|
|
2159
|
+
return node;
|
|
2160
|
+
}
|
|
2161
|
+
else {
|
|
2162
|
+
node = node.parentElement;
|
|
2163
|
+
if (node === top) {
|
|
2164
|
+
return sourceNode;
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
};
|
|
2169
|
+
return new Promise(resolve => {
|
|
2170
|
+
var _a, _b;
|
|
2171
|
+
const validateResult = validationGroup.instance.validate();
|
|
2172
|
+
if (!validateResult.isValid) {
|
|
2173
|
+
const brokenElement = ((_a = validateResult.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
2174
|
+
findTargetNode(brokenElement).scrollIntoView();
|
|
2175
|
+
resolve(false);
|
|
2176
|
+
}
|
|
2177
|
+
if (validateResult.status === 'pending') {
|
|
2178
|
+
(_b = validateResult.complete) === null || _b === void 0 ? void 0 : _b.then((result) => {
|
|
2179
|
+
var _a;
|
|
2180
|
+
if (result.isValid) {
|
|
2181
|
+
resolve(true);
|
|
2182
|
+
}
|
|
2183
|
+
else {
|
|
2184
|
+
const brokenElement = ((_a = result.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
2185
|
+
findTargetNode(brokenElement).scrollIntoView();
|
|
2186
|
+
resolve(false);
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
else {
|
|
2191
|
+
resolve(true);
|
|
2192
|
+
}
|
|
2193
|
+
});
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2026
2196
|
|
|
2027
2197
|
class DataGridFactory {
|
|
2028
2198
|
constructor(http) {
|
|
@@ -2073,7 +2243,6 @@ class DataGridFactory {
|
|
|
2073
2243
|
dataField: field.name,
|
|
2074
2244
|
caption: field.caption,
|
|
2075
2245
|
dataType: 'string',
|
|
2076
|
-
alignment: 'center',
|
|
2077
2246
|
cssClass: 'cell-vertical-middle',
|
|
2078
2247
|
allowHeaderFiltering: false,
|
|
2079
2248
|
allowFiltering: false,
|
|
@@ -2099,12 +2268,6 @@ class DataGridFactory {
|
|
|
2099
2268
|
visible: field.visible,
|
|
2100
2269
|
fixed: field.fixed
|
|
2101
2270
|
};
|
|
2102
|
-
if (field.isPrimaryKey) {
|
|
2103
|
-
column.instanceInfo = {
|
|
2104
|
-
tenant,
|
|
2105
|
-
className
|
|
2106
|
-
};
|
|
2107
|
-
}
|
|
2108
2271
|
switch (field.dataType) {
|
|
2109
2272
|
case 'BOOLEAN':
|
|
2110
2273
|
column.allowHeaderFiltering = false;
|
|
@@ -2338,11 +2501,6 @@ class DataGridFactory {
|
|
|
2338
2501
|
visible: field.visible,
|
|
2339
2502
|
fixed: field.fixed
|
|
2340
2503
|
};
|
|
2341
|
-
column.instanceInfo = {
|
|
2342
|
-
tenant,
|
|
2343
|
-
className: field.targetClassName,
|
|
2344
|
-
key: field.name
|
|
2345
|
-
};
|
|
2346
2504
|
switch (field.relationType) {
|
|
2347
2505
|
case 'MANY_TO_ONE':
|
|
2348
2506
|
case 'ONE_TO_ONE':
|
|
@@ -2360,16 +2518,24 @@ class DataGridFactory {
|
|
|
2360
2518
|
});
|
|
2361
2519
|
return result;
|
|
2362
2520
|
}
|
|
2363
|
-
makeDataGridDataSource(tenant, className, view, extraFilter, dataGridName) {
|
|
2521
|
+
makeDataGridDataSource(tenant, className, view, extraFilter, keyExpr, dataGridName) {
|
|
2522
|
+
if (!keyExpr) {
|
|
2523
|
+
keyExpr = 'oid';
|
|
2524
|
+
}
|
|
2364
2525
|
return new CustomStore({
|
|
2365
|
-
key:
|
|
2526
|
+
key: keyExpr,
|
|
2366
2527
|
byKey: (key) => {
|
|
2367
|
-
|
|
2528
|
+
if (keyExpr === 'oid') {
|
|
2529
|
+
return lastValueFrom(this.service.getOne(tenant, className, key).pipe(map(response => response.data)));
|
|
2530
|
+
}
|
|
2531
|
+
else {
|
|
2532
|
+
return lastValueFrom(this.service.getOneByFilter(tenant, className, keyExpr, key, view));
|
|
2533
|
+
}
|
|
2368
2534
|
},
|
|
2369
2535
|
load: (loadOptions) => {
|
|
2370
2536
|
if (loadOptions.dataField) {
|
|
2371
2537
|
// 未重写headerFilter的dataSource时,headerFilter会调用load方法加载筛选树,重写该方法查询该表所有数据
|
|
2372
|
-
//
|
|
2538
|
+
// 该方式存在风险,无法识别DevExtreme一定是通过headerFilter过滤才存在dataField参数
|
|
2373
2539
|
return lastValueFrom(this.service.getColumnDataSource(tenant, className, view, loadOptions.dataField));
|
|
2374
2540
|
}
|
|
2375
2541
|
let params = '?';
|
|
@@ -2428,179 +2594,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
2428
2594
|
}]
|
|
2429
2595
|
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
2430
2596
|
|
|
2431
|
-
function notify_error(message) {
|
|
2432
|
-
notify({
|
|
2433
|
-
displayTime: 12000,
|
|
2434
|
-
message,
|
|
2435
|
-
type: 'error',
|
|
2436
|
-
width: '300px'
|
|
2437
|
-
}, {
|
|
2438
|
-
direction: 'up-push',
|
|
2439
|
-
position: 'bottom right'
|
|
2440
|
-
});
|
|
2441
|
-
}
|
|
2442
|
-
function notify_warning(message) {
|
|
2443
|
-
notify({
|
|
2444
|
-
displayTime: 8000,
|
|
2445
|
-
message,
|
|
2446
|
-
type: 'warning',
|
|
2447
|
-
width: '300px'
|
|
2448
|
-
}, {
|
|
2449
|
-
direction: 'up-push',
|
|
2450
|
-
position: 'bottom right'
|
|
2451
|
-
});
|
|
2452
|
-
}
|
|
2453
|
-
function notify_success(message) {
|
|
2454
|
-
notify({
|
|
2455
|
-
displayTime: 4000,
|
|
2456
|
-
message,
|
|
2457
|
-
type: 'success',
|
|
2458
|
-
width: '300px'
|
|
2459
|
-
}, {
|
|
2460
|
-
direction: 'down-push',
|
|
2461
|
-
position: 'top right'
|
|
2462
|
-
});
|
|
2463
|
-
}
|
|
2464
|
-
function format_date(date, locale) {
|
|
2465
|
-
return formatDate(date, 'yyyy/MM/dd', locale, 'GMT+8');
|
|
2466
|
-
}
|
|
2467
|
-
function format_datetime(date, locale) {
|
|
2468
|
-
return formatDate(date, 'yyyy/MM/dd HH:mm:ss', locale, 'GMT+8');
|
|
2469
|
-
}
|
|
2470
|
-
function file_type_icon(name) {
|
|
2471
|
-
const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
|
|
2472
|
-
switch (type) {
|
|
2473
|
-
case 'doc':
|
|
2474
|
-
case 'docx':
|
|
2475
|
-
return 'word';
|
|
2476
|
-
case 'xls':
|
|
2477
|
-
case 'xlsx':
|
|
2478
|
-
case 'csv':
|
|
2479
|
-
return 'excel';
|
|
2480
|
-
case 'ppt':
|
|
2481
|
-
case 'pptx':
|
|
2482
|
-
return 'ppt';
|
|
2483
|
-
case 'pdf':
|
|
2484
|
-
return 'pdf';
|
|
2485
|
-
case 'txt':
|
|
2486
|
-
case 'xml':
|
|
2487
|
-
case 'json':
|
|
2488
|
-
case 'js':
|
|
2489
|
-
return 'text';
|
|
2490
|
-
case 'png':
|
|
2491
|
-
case 'jpg':
|
|
2492
|
-
case 'jpeg':
|
|
2493
|
-
case 'gif':
|
|
2494
|
-
case 'bmp':
|
|
2495
|
-
return 'image';
|
|
2496
|
-
case 'zip':
|
|
2497
|
-
case 'rar':
|
|
2498
|
-
case '7z':
|
|
2499
|
-
case 'jar':
|
|
2500
|
-
return 'zip';
|
|
2501
|
-
default:
|
|
2502
|
-
return 'unknown';
|
|
2503
|
-
}
|
|
2504
|
-
}
|
|
2505
|
-
function support_preview_ext() {
|
|
2506
|
-
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'doc', 'docx', 'txt', 'xml', 'json', 'js', 'xls', 'xlsx', 'csv', 'ppt', 'pptx'];
|
|
2507
|
-
}
|
|
2508
|
-
function format_file_size(size) {
|
|
2509
|
-
const labels = ['b', 'Kb', 'Mb', 'Gb'];
|
|
2510
|
-
const count = labels.length - 1;
|
|
2511
|
-
let i = 0;
|
|
2512
|
-
while (i < count && size >= 1024) {
|
|
2513
|
-
size /= 1024;
|
|
2514
|
-
i++;
|
|
2515
|
-
}
|
|
2516
|
-
return Math.round(size * 100) / 100 + " " + labels[i];
|
|
2517
|
-
}
|
|
2518
|
-
function download_file(blob, filename, callback) {
|
|
2519
|
-
const url = window.webkitURL.createObjectURL(blob);
|
|
2520
|
-
const a = document.createElement('a');
|
|
2521
|
-
document.body.appendChild(a);
|
|
2522
|
-
a.setAttribute('style', 'display:none');
|
|
2523
|
-
a.setAttribute('href', url);
|
|
2524
|
-
a.setAttribute('download', decodeURIComponent(filename));
|
|
2525
|
-
a.click();
|
|
2526
|
-
setTimeout(() => {
|
|
2527
|
-
if (callback) {
|
|
2528
|
-
callback();
|
|
2529
|
-
}
|
|
2530
|
-
a.remove();
|
|
2531
|
-
});
|
|
2532
|
-
}
|
|
2533
|
-
function validate(validator) {
|
|
2534
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2535
|
-
return new Promise(resolve => {
|
|
2536
|
-
var _a;
|
|
2537
|
-
const validateResult = validator.instance.validate();
|
|
2538
|
-
if (!validateResult.isValid) {
|
|
2539
|
-
resolve(false);
|
|
2540
|
-
}
|
|
2541
|
-
if (validateResult.status === 'pending') {
|
|
2542
|
-
(_a = validateResult.complete) === null || _a === void 0 ? void 0 : _a.then((result) => {
|
|
2543
|
-
if (result.isValid) {
|
|
2544
|
-
resolve(true);
|
|
2545
|
-
}
|
|
2546
|
-
else {
|
|
2547
|
-
resolve(false);
|
|
2548
|
-
}
|
|
2549
|
-
});
|
|
2550
|
-
}
|
|
2551
|
-
else {
|
|
2552
|
-
resolve(true);
|
|
2553
|
-
}
|
|
2554
|
-
});
|
|
2555
|
-
});
|
|
2556
|
-
}
|
|
2557
|
-
function validate_group(validationGroup) {
|
|
2558
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2559
|
-
const top = validationGroup.element.nativeElement;
|
|
2560
|
-
let sourceNode;
|
|
2561
|
-
const targetClassName = 'dx-field';
|
|
2562
|
-
const findTargetNode = (node) => {
|
|
2563
|
-
sourceNode = node;
|
|
2564
|
-
while (true) {
|
|
2565
|
-
if (node.classList.contains(targetClassName)) {
|
|
2566
|
-
return node;
|
|
2567
|
-
}
|
|
2568
|
-
else {
|
|
2569
|
-
node = node.parentElement;
|
|
2570
|
-
if (node === top) {
|
|
2571
|
-
return sourceNode;
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
};
|
|
2576
|
-
return new Promise(resolve => {
|
|
2577
|
-
var _a, _b;
|
|
2578
|
-
const validateResult = validationGroup.instance.validate();
|
|
2579
|
-
if (!validateResult.isValid) {
|
|
2580
|
-
const brokenElement = ((_a = validateResult.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
2581
|
-
findTargetNode(brokenElement).scrollIntoView();
|
|
2582
|
-
resolve(false);
|
|
2583
|
-
}
|
|
2584
|
-
if (validateResult.status === 'pending') {
|
|
2585
|
-
(_b = validateResult.complete) === null || _b === void 0 ? void 0 : _b.then((result) => {
|
|
2586
|
-
var _a;
|
|
2587
|
-
if (result.isValid) {
|
|
2588
|
-
resolve(true);
|
|
2589
|
-
}
|
|
2590
|
-
else {
|
|
2591
|
-
const brokenElement = ((_a = result.brokenRules) === null || _a === void 0 ? void 0 : _a[0]).validator.element();
|
|
2592
|
-
findTargetNode(brokenElement).scrollIntoView();
|
|
2593
|
-
resolve(false);
|
|
2594
|
-
}
|
|
2595
|
-
});
|
|
2596
|
-
}
|
|
2597
|
-
else {
|
|
2598
|
-
resolve(true);
|
|
2599
|
-
}
|
|
2600
|
-
});
|
|
2601
|
-
});
|
|
2602
|
-
}
|
|
2603
|
-
|
|
2604
2597
|
class FileCellTemplateComponent {
|
|
2605
2598
|
constructor(service, domSanitizer) {
|
|
2606
2599
|
this.service = service;
|
|
@@ -2632,10 +2625,6 @@ class FileCellTemplateComponent {
|
|
|
2632
2625
|
</table>
|
|
2633
2626
|
`);
|
|
2634
2627
|
this.icon = file_type_icon(this.filename);
|
|
2635
|
-
// 重绘表格宽高
|
|
2636
|
-
setTimeout(() => {
|
|
2637
|
-
this.service.cellTemplateLoaded$.emit();
|
|
2638
|
-
});
|
|
2639
2628
|
}
|
|
2640
2629
|
preview(tooltip) {
|
|
2641
2630
|
if (!window.coast.tabManager) {
|
|
@@ -2675,483 +2664,625 @@ class FileCellTemplateComponent {
|
|
|
2675
2664
|
}
|
|
2676
2665
|
}
|
|
2677
2666
|
FileCellTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FileCellTemplateComponent, deps: [{ token: DataGridService }, { token: i2$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
2678
|
-
FileCellTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FileCellTemplateComponent, selector: "rs-file-cell-template", inputs: { file: "file" }, ngImport: i0, template: "<dx-button #fileBtn type=\"default\" stylingMode=\"text\">\r\n <i class=\"coast-icon-file-{{icon}}\" style=\"padding-right: 4px;\"></i>\r\n {{ filename }}\r\n <dx-tooltip #tooltip\r\n [target]=\"fileBtn.instance.element()\"\r\n [position]=\"'top'\"\r\n [visible]=\"false\"\r\n [showEvent]=\"'click'\">\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <div [innerHTML]=\"content\"></div>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-file\" text=\"\u9884\u89C8\"\r\n (onClick)=\"preview(tooltip)\" [disabled]=\"!supportPreview || loading\"></dx-button>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-download\" text=\"\u4E0B\u8F7D\"\r\n (onClick)=\"download()\" [disabled]=\"loading\"></dx-button>\r\n </div>\r\n </dx-tooltip>\r\n</dx-button><br/>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i5.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }] });
|
|
2667
|
+
FileCellTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FileCellTemplateComponent, selector: "rs-file-cell-template", inputs: { file: "file" }, ngImport: i0, template: "<dx-button #fileBtn type=\"default\" stylingMode=\"text\" (onClick)=\"$event.event?.stopPropagation()\">\r\n <i class=\"coast-icon-file-{{icon}}\" style=\"padding-right: 4px;\"></i>\r\n {{ filename }}\r\n <dx-tooltip #tooltip\r\n [target]=\"fileBtn.instance.element()\"\r\n [position]=\"'top'\"\r\n [visible]=\"false\"\r\n [showEvent]=\"'click'\">\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <div [innerHTML]=\"content\"></div>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-file\" text=\"\u9884\u89C8\"\r\n (onClick)=\"preview(tooltip)\" [disabled]=\"!supportPreview || loading\"></dx-button>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-download\" text=\"\u4E0B\u8F7D\"\r\n (onClick)=\"download()\" [disabled]=\"loading\"></dx-button>\r\n </div>\r\n </dx-tooltip>\r\n</dx-button><br/>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i5.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }] });
|
|
2679
2668
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FileCellTemplateComponent, decorators: [{
|
|
2680
2669
|
type: Component,
|
|
2681
|
-
args: [{ selector: 'rs-file-cell-template', template: "<dx-button #fileBtn type=\"default\" stylingMode=\"text\">\r\n <i class=\"coast-icon-file-{{icon}}\" style=\"padding-right: 4px;\"></i>\r\n {{ filename }}\r\n <dx-tooltip #tooltip\r\n [target]=\"fileBtn.instance.element()\"\r\n [position]=\"'top'\"\r\n [visible]=\"false\"\r\n [showEvent]=\"'click'\">\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <div [innerHTML]=\"content\"></div>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-file\" text=\"\u9884\u89C8\"\r\n (onClick)=\"preview(tooltip)\" [disabled]=\"!supportPreview || loading\"></dx-button>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-download\" text=\"\u4E0B\u8F7D\"\r\n (onClick)=\"download()\" [disabled]=\"loading\"></dx-button>\r\n </div>\r\n </dx-tooltip>\r\n</dx-button><br/>\r\n" }]
|
|
2670
|
+
args: [{ selector: 'rs-file-cell-template', template: "<dx-button #fileBtn type=\"default\" stylingMode=\"text\" (onClick)=\"$event.event?.stopPropagation()\">\r\n <i class=\"coast-icon-file-{{icon}}\" style=\"padding-right: 4px;\"></i>\r\n {{ filename }}\r\n <dx-tooltip #tooltip\r\n [target]=\"fileBtn.instance.element()\"\r\n [position]=\"'top'\"\r\n [visible]=\"false\"\r\n [showEvent]=\"'click'\">\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <div [innerHTML]=\"content\"></div>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-file\" text=\"\u9884\u89C8\"\r\n (onClick)=\"preview(tooltip)\" [disabled]=\"!supportPreview || loading\"></dx-button>\r\n <dx-button type=\"default\" stylingMode=\"text\" icon=\"coast-icon coast-icon-download\" text=\"\u4E0B\u8F7D\"\r\n (onClick)=\"download()\" [disabled]=\"loading\"></dx-button>\r\n </div>\r\n </dx-tooltip>\r\n</dx-button><br/>\r\n" }]
|
|
2682
2671
|
}], ctorParameters: function () { return [{ type: DataGridService }, { type: i2$2.DomSanitizer }]; }, propDecorators: { file: [{
|
|
2683
2672
|
type: Input
|
|
2684
2673
|
}] } });
|
|
2685
2674
|
|
|
2686
|
-
class
|
|
2687
|
-
constructor(
|
|
2688
|
-
this.
|
|
2689
|
-
this.domSanitizer = domSanitizer;
|
|
2675
|
+
class DataDetailService {
|
|
2676
|
+
constructor(http) {
|
|
2677
|
+
this.http = http;
|
|
2690
2678
|
}
|
|
2691
|
-
|
|
2692
|
-
this.
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
<tr>
|
|
2699
|
-
<td style="text-align: right;">${item.caption}:</td>
|
|
2700
|
-
<td style="text-align: left;">${item.value}</td>
|
|
2701
|
-
</tr>
|
|
2702
|
-
`;
|
|
2679
|
+
getSectionList(tenant, className, oid) {
|
|
2680
|
+
return this.http.get('api/data/custom', {
|
|
2681
|
+
params: {
|
|
2682
|
+
tenant,
|
|
2683
|
+
className,
|
|
2684
|
+
oid,
|
|
2685
|
+
executor: 'com.cs.system.section.LoadSections'
|
|
2703
2686
|
}
|
|
2704
|
-
content += '</table>';
|
|
2705
|
-
this.content = this.domSanitizer.bypassSecurityTrustHtml(content);
|
|
2706
|
-
// 重绘表格宽高
|
|
2707
|
-
setTimeout(() => {
|
|
2708
|
-
this.service.cellTemplateLoaded$.emit();
|
|
2709
|
-
});
|
|
2710
2687
|
});
|
|
2711
2688
|
}
|
|
2712
2689
|
}
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type:
|
|
2716
|
-
type:
|
|
2717
|
-
|
|
2718
|
-
}], ctorParameters: function () { return [{ type: DataGridService }, { type: i2$2.DomSanitizer }]; }, propDecorators: { uid: [{
|
|
2719
|
-
type: Input
|
|
2720
|
-
}] } });
|
|
2690
|
+
DataDetailService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2691
|
+
DataDetailService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailService });
|
|
2692
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailService, decorators: [{
|
|
2693
|
+
type: Injectable
|
|
2694
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
2721
2695
|
|
|
2722
|
-
class
|
|
2723
|
-
constructor(
|
|
2724
|
-
this.
|
|
2725
|
-
this.domSanitizer = domSanitizer;
|
|
2696
|
+
class FormService {
|
|
2697
|
+
constructor(http) {
|
|
2698
|
+
this.http = http;
|
|
2726
2699
|
}
|
|
2727
|
-
|
|
2728
|
-
this.
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
for (const item of unitInfo) {
|
|
2733
|
-
content += `
|
|
2734
|
-
<tr>
|
|
2735
|
-
<td style="text-align: right;">${item.caption}:</td>
|
|
2736
|
-
<td style="text-align: left;">${item.value}</td>
|
|
2737
|
-
</tr>
|
|
2738
|
-
`;
|
|
2700
|
+
getFormTemplateConfig(tenant, className, template) {
|
|
2701
|
+
return this.http.get('api/metadata/form/' + className, {
|
|
2702
|
+
params: {
|
|
2703
|
+
tenant,
|
|
2704
|
+
template: template || ''
|
|
2739
2705
|
}
|
|
2740
|
-
content += '</table>';
|
|
2741
|
-
this.content = this.domSanitizer.bypassSecurityTrustHtml(content);
|
|
2742
|
-
// 重绘表格宽高
|
|
2743
|
-
setTimeout(() => {
|
|
2744
|
-
this.service.cellTemplateLoaded$.emit();
|
|
2745
|
-
});
|
|
2746
2706
|
});
|
|
2747
2707
|
}
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
}] } });
|
|
2757
|
-
|
|
2758
|
-
class DataGridComponent {
|
|
2759
|
-
constructor(factory, service) {
|
|
2760
|
-
this.factory = factory;
|
|
2761
|
-
this.service = service;
|
|
2762
|
-
this.tenant = 'T';
|
|
2763
|
-
this.enableMasterDetail = false;
|
|
2764
|
-
this.columns = [];
|
|
2765
|
-
this.dataSource = {};
|
|
2766
|
-
this.keyExpr = 'oid';
|
|
2767
|
-
this.selectedRowKeys = [];
|
|
2768
|
-
this.selectedRowKeysChange = new EventEmitter();
|
|
2769
|
-
this.selectionMode = 'none';
|
|
2770
|
-
this.onDxDataGridCellPrepared = new EventEmitter();
|
|
2771
|
-
this.onDxDataGridContentReady = new EventEmitter();
|
|
2772
|
-
this.onDxDataGridSelectionChanged = new EventEmitter();
|
|
2773
|
-
}
|
|
2774
|
-
ngOnInit() {
|
|
2775
|
-
this.reload();
|
|
2776
|
-
this.service.cellTemplateLoaded$.pipe(debounceTime(200)).subscribe(() => {
|
|
2777
|
-
this.dxDataGrid.instance.resize();
|
|
2708
|
+
getOne(tenant, className, oid, template, isCopy) {
|
|
2709
|
+
let api = 'api/data/' + className + '/' + oid;
|
|
2710
|
+
return this.http.get(api, {
|
|
2711
|
+
params: {
|
|
2712
|
+
tenant,
|
|
2713
|
+
template: template || '',
|
|
2714
|
+
isCopy: !!isCopy
|
|
2715
|
+
}
|
|
2778
2716
|
});
|
|
2779
2717
|
}
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
this.
|
|
2783
|
-
|
|
2784
|
-
|
|
2718
|
+
getInitModelByTemplate(tenant, className, template) {
|
|
2719
|
+
let api = 'api/data/' + className + '/new';
|
|
2720
|
+
return this.http.get(api, {
|
|
2721
|
+
params: {
|
|
2722
|
+
tenant,
|
|
2723
|
+
className,
|
|
2724
|
+
template: template || ''
|
|
2785
2725
|
}
|
|
2786
|
-
this.columns = columns;
|
|
2787
2726
|
});
|
|
2788
|
-
this.dataSource = this.factory.makeDataGridDataSource(this.tenant, this.className, this.view, this.filter, this.dataGridName);
|
|
2789
2727
|
}
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2728
|
+
createOrUpdate(tenant, className, model) {
|
|
2729
|
+
let api = 'api/data/' + className;
|
|
2730
|
+
if (model.oid) {
|
|
2731
|
+
api += '/' + model.oid;
|
|
2793
2732
|
}
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2733
|
+
return this.http.post(api, model, {
|
|
2734
|
+
params: {
|
|
2735
|
+
tenant
|
|
2797
2736
|
}
|
|
2798
|
-
|
|
2799
|
-
}
|
|
2800
|
-
if (cellInfo.column.lookup) {
|
|
2801
|
-
return cellInfo.column.lookup.calculateCellValue(cellInfo.value);
|
|
2802
|
-
}
|
|
2803
|
-
return cellInfo.value;
|
|
2737
|
+
});
|
|
2804
2738
|
}
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2739
|
+
}
|
|
2740
|
+
FormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2741
|
+
FormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormService });
|
|
2742
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormService, decorators: [{
|
|
2743
|
+
type: Injectable
|
|
2744
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
2745
|
+
|
|
2746
|
+
class FormComponent {
|
|
2747
|
+
constructor(viewContainerRef, service, elementRef) {
|
|
2748
|
+
this.viewContainerRef = viewContainerRef;
|
|
2749
|
+
this.service = service;
|
|
2750
|
+
this.elementRef = elementRef;
|
|
2751
|
+
this.tenant = 'T';
|
|
2752
|
+
this.onlyFrontEnd = false; // 仅前端,不通过oid获取实例model
|
|
2753
|
+
this.readonly = false;
|
|
2754
|
+
this.submitCallback = new EventEmitter();
|
|
2755
|
+
this.loading = false;
|
|
2756
|
+
this.changeFilter = new ChangeFilter();
|
|
2818
2757
|
}
|
|
2819
|
-
|
|
2820
|
-
this.
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
}
|
|
2758
|
+
ngOnInit() {
|
|
2759
|
+
this.load();
|
|
2760
|
+
this.changeFilter.anyNotFirst(['tenant', 'className', 'oid', 'copyOid', 'template'], () => {
|
|
2761
|
+
this.load();
|
|
2824
2762
|
});
|
|
2825
2763
|
}
|
|
2826
|
-
|
|
2827
|
-
|
|
2764
|
+
ngOnChanges(changes) {
|
|
2765
|
+
this.changeFilter.doFilter(changes);
|
|
2828
2766
|
}
|
|
2829
|
-
|
|
2830
|
-
this.
|
|
2767
|
+
ngOnDestroy() {
|
|
2768
|
+
this.changeFilter.dispose();
|
|
2831
2769
|
}
|
|
2832
|
-
|
|
2833
|
-
this.
|
|
2770
|
+
load() {
|
|
2771
|
+
this.loading = true;
|
|
2772
|
+
this.params = Object.assign(this.params || {}, {
|
|
2773
|
+
__form: {
|
|
2774
|
+
tenant: this.tenant,
|
|
2775
|
+
className: this.className,
|
|
2776
|
+
oid: this.oid,
|
|
2777
|
+
copyOid: this.copyOid,
|
|
2778
|
+
template: this.template
|
|
2779
|
+
}
|
|
2780
|
+
});
|
|
2781
|
+
this.service.getFormTemplateConfig(this.tenant, this.className, this.template).subscribe(response => {
|
|
2782
|
+
this.config = response.data.template;
|
|
2783
|
+
if (this.onlyFrontEnd) {
|
|
2784
|
+
this.loading = false;
|
|
2785
|
+
}
|
|
2786
|
+
else if (this.copyOid || this.oid) {
|
|
2787
|
+
this.service.getOne(this.tenant, this.className, this.copyOid || this.oid, this.template, this.copyOid)
|
|
2788
|
+
.subscribe(response => {
|
|
2789
|
+
this.model = response.data;
|
|
2790
|
+
this.loading = false;
|
|
2791
|
+
});
|
|
2792
|
+
}
|
|
2793
|
+
else {
|
|
2794
|
+
this.service.getInitModelByTemplate(this.tenant, this.className, this.template).subscribe(response => {
|
|
2795
|
+
this.model = response.data;
|
|
2796
|
+
this.loading = false;
|
|
2797
|
+
});
|
|
2798
|
+
}
|
|
2799
|
+
});
|
|
2834
2800
|
}
|
|
2835
|
-
|
|
2836
|
-
this.
|
|
2801
|
+
submitForm() {
|
|
2802
|
+
this.validate().then(isValid => {
|
|
2803
|
+
if (isValid) {
|
|
2804
|
+
const mergeModel = Object.assign({}, this.model);
|
|
2805
|
+
if (this.extraAttrMap) {
|
|
2806
|
+
for (const entry of this.extraAttrMap) {
|
|
2807
|
+
mergeModel[entry.name] = entry.value;
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
this.service.createOrUpdate(this.tenant, this.className, Object.assign({ oid: this.oid }, mergeModel)).subscribe(response => {
|
|
2811
|
+
this.submitCallback.emit(response);
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2814
|
+
else {
|
|
2815
|
+
this.submitCallback.emit({ success: false });
|
|
2816
|
+
}
|
|
2817
|
+
});
|
|
2837
2818
|
}
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
e.component.blur();
|
|
2843
|
-
};
|
|
2819
|
+
scrollToAnchorPoint(anchorPointId) {
|
|
2820
|
+
const points = this.elementRef.nativeElement.getElementsByClassName('__anchor_point_' + anchorPointId);
|
|
2821
|
+
if (points.length > 0) {
|
|
2822
|
+
points[0].scrollIntoView();
|
|
2844
2823
|
}
|
|
2845
2824
|
}
|
|
2825
|
+
validate() {
|
|
2826
|
+
return validate_group(this.validator);
|
|
2827
|
+
}
|
|
2828
|
+
submit() {
|
|
2829
|
+
this.formSubmitter.instance.element().click();
|
|
2830
|
+
}
|
|
2846
2831
|
}
|
|
2847
|
-
|
|
2848
|
-
DataGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DataGridComponent, selector: "rs-data-grid", inputs: { tenant: "tenant", className: "className", view: "view", filter: "filter", enableMasterDetail: "enableMasterDetail", dataGridName: "dataGridName", keyExpr: "keyExpr", height: "height", selectedRowKeys: "selectedRowKeys", selectionMode: "selectionMode", customColumnFn: "customColumnFn" }, outputs: { selectedRowKeysChange: "selectedRowKeysChange", onDxDataGridCellPrepared: "onDxDataGridCellPrepared", onDxDataGridContentReady: "onDxDataGridContentReady", onDxDataGridSelectionChanged: "onDxDataGridSelectionChanged" }, providers: [DataGridService], queries: [{ propertyName: "masterDetailTemplate", first: true, predicate: MasterDetailTemplateDirective, descendants: true }, { propertyName: "rowButtonsTemplate", first: true, predicate: RowButtonsTemplateDirective, descendants: true }, { propertyName: "instanceLinkTemplate", first: true, predicate: InstanceLinkTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "dxDataGrid", first: true, predicate: DxDataGridComponent, descendants: true, static: true }], ngImport: i0, template: "<dx-data-grid [showBorders]=\"true\"\r\n [showRowLines]=\"true\"\r\n [hoverStateEnabled]=\"true\"\r\n [rowAlternationEnabled]=\"true\"\r\n [columnAutoWidth]=\"true\"\r\n [allowColumnResizing]=\"true\"\r\n columnResizingMode=\"widget\"\r\n dateSerializationFormat=\"yyyy/MM/dd HH:mm:ss\"\r\n [syncLookupFilterValues]=\"false\"\r\n [dataSource]=\"dataSource\"\r\n [columns]=\"columns\"\r\n [height]=\"height\"\r\n [keyExpr]=\"keyExpr\"\r\n [selectedRowKeys]=\"selectedRowKeys\"\r\n (selectedRowKeysChange)=\"selectedRowKeysChange.emit($event)\"\r\n (onCellPrepared)=\"onCellPrepared($event)\"\r\n (onEditorPreparing)=\"onEditorPreparing($event)\"\r\n (onContentReady)=\"onContentReady($event)\"\r\n (onSelectionChanged)=\"onSelectionChanged($event)\"\r\n (onRowExpanding)=\"$event.component.collapseAll(-1)\">\r\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\r\n <dxo-selection [mode]=\"selectionMode\" selectAllMode=\"page\" showCheckBoxesMode=\"always\"></dxo-selection>\r\n <dxo-header-filter [visible]=\"true\">\r\n <dxo-search [enabled]=\"true\"></dxo-search>\r\n <dxo-texts [ok]=\"'\u786E\u5B9A'\"></dxo-texts>\r\n </dxo-header-filter>\r\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\r\n <dxo-remote-operations [filtering]=\"true\"\r\n [sorting]=\"true\"\r\n [paging]=\"true\">\r\n </dxo-remote-operations>\r\n <dxo-master-detail [enabled]=\"enableMasterDetail\" template=\"masterDetailTemplate\"></dxo-master-detail>\r\n <dxo-paging [pageSize]=\"15\"></dxo-paging>\r\n <dxo-pager [visible]=\"true\"\r\n [showInfo]=\"true\"\r\n infoText=\"\u7B2C{0}\u9875\uFF0C\u5171{1}\u9875\uFF08\u5171{2}\u4E2A\u9879\u76EE\uFF09\"\r\n [showPageSizeSelector]=\"true\"\r\n [allowedPageSizes]=\"[15, 30, 50]\"\r\n ></dxo-pager>\r\n <dxo-scrolling showScrollbar=\"always\"></dxo-scrolling>\r\n <div *dxTemplate=\"let cellInfo of 'masterDetailTemplate'\">\r\n <ng-container [ngTemplateOutlet]=\"masterDetailTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{$implicit: cellInfo, cellTemplateLoaded$: service.cellTemplateLoaded$}\"></ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'rowButtonsTemplate'\">\r\n <ng-container [ngTemplateOutlet]=\"rowButtonsTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{$implicit: cellInfo, cellTemplateLoaded$: service.cellTemplateLoaded$}\"></ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'instanceLinkTemplate'\">\r\n <ng-container [ngTemplateOutlet]=\"instanceLinkTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{$implicit: cellInfo, cellTemplateLoaded$: service.cellTemplateLoaded$}\"></ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'rowIndexTemplate'\">\r\n {{ cellInfo.rowIndex + 1 }}\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'multipleValueCellTemplate'\">\r\n <div [innerHTML]=\"convertMultipleValueCellText(cellInfo)\"></div>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'textCellTemplate'\">\r\n <div #textDiv style=\"text-overflow: ellipsis; overflow: hidden; cursor: pointer;\">{{ cellInfo.value }}</div>\r\n <dx-tooltip [target]=\"textDiv\"\r\n [position]=\"'top'\"\r\n [showEvent]=\"'click'\">\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <p style=\"max-width: 320px; text-align: left; white-space: normal;\" [innerText]=\"cellInfo.value\"></p>\r\n </div>\r\n </dx-tooltip>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'fileCellTemplate'\">\r\n <ng-container *ngFor=\"let file of cellInfo.value\">\r\n <rs-file-cell-template [file]=\"file\"></rs-file-cell-template>\r\n </ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'userCellTemplate'\">\r\n <ng-container *ngFor=\"let user of getOriginalValue(cellInfo, 'userInfo')\">\r\n <rs-user-info-template [uid]=\"user\"></rs-user-info-template>\r\n </ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'unitCellTemplate'\">\r\n <ng-container *ngFor=\"let unit of getOriginalValue(cellInfo, 'unitInfo')\">\r\n <rs-unit-info-template [uid]=\"unit\"></rs-unit-info-template>\r\n </ng-container>\r\n </div>\r\n</dx-data-grid>\r\n", styles: [":host{display:flex;flex-flow:column nowrap}:host dx-data-grid{flex:auto;height:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i5$1.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExporting", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i6$1.DxoSearchComponent, selector: "dxo-search", inputs: ["editorOptions", "enabled", "timeout", "mode", "searchExpr"] }, { kind: "component", type: i6$1.DxoSelectionComponent, selector: "dxo-selection", inputs: ["allowSelectAll", "recursive", "selectByClick", "deferred", "mode", "selectAllMode", "showCheckBoxesMode"] }, { kind: "component", type: i6$1.DxoTextsComponent, selector: "dxo-texts", inputs: ["fix", "leftPosition", "rightPosition", "unfix", "addRow", "cancelAllChanges", "cancelRowChanges", "confirmDeleteMessage", "confirmDeleteTitle", "deleteRow", "editRow", "saveAllChanges", "saveRowChanges", "undeleteRow", "validationCancelChanges", "exportAll", "exportSelectedRows", "exportTo", "clearFilter", "createFilter", "filterEnabledHint", "groupByThisColumn", "groupContinuedMessage", "groupContinuesMessage", "ungroup", "ungroupAll", "cancel", "emptyValue", "ok", "avg", "avgOtherColumn", "count", "max", "maxOtherColumn", "min", "minOtherColumn", "sum", "sumOtherColumn", "allFields", "columnFields", "dataFields", "filterFields", "rowFields", "columnFieldArea", "dataFieldArea", "filterFieldArea", "rowFieldArea", "collapseAll", "dataNotAvailable", "expandAll", "exportToExcel", "grandTotal", "noData", "removeAllSorting", "showFieldChooser", "sortColumnBySummary", "sortRowBySummary", "total", "addRowToNode"] }, { kind: "component", type: i6$1.DxoHeaderFilterComponent, selector: "dxo-header-filter", inputs: ["allowSearch", "allowSelectAll", "dataSource", "groupInterval", "height", "search", "searchMode", "width", "searchTimeout", "texts", "visible", "showRelevantValues"] }, { kind: "component", type: i6$1.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i6$1.DxoMasterDetailComponent, selector: "dxo-master-detail", inputs: ["autoExpandAll", "enabled", "template"] }, { kind: "component", type: i6$1.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "label", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i6$1.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "component", type: i6$1.DxoRemoteOperationsComponent, selector: "dxo-remote-operations", inputs: ["filtering", "grouping", "groupPaging", "paging", "sorting", "summary"] }, { kind: "component", type: i6$1.DxoScrollingComponent, selector: "dxo-scrolling", inputs: ["columnRenderingMode", "mode", "preloadEnabled", "renderAsync", "rowRenderingMode", "scrollByContent", "scrollByThumb", "showScrollbar", "useNative"] }, { kind: "component", type: i6$1.DxoSortingComponent, selector: "dxo-sorting", inputs: ["ascendingText", "clearText", "descendingText", "mode", "showSortIndexes"] }, { kind: "component", type: i5.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: FileCellTemplateComponent, selector: "rs-file-cell-template", inputs: ["file"] }, { kind: "component", type: UserInfoTemplateComponent, selector: "rs-user-info-template", inputs: ["uid"] }, { kind: "component", type: UnitInfoTemplateComponent, selector: "rs-unit-info-template", inputs: ["uid"] }] });
|
|
2849
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type:
|
|
2832
|
+
FormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, deps: [{ token: i0.ViewContainerRef }, { token: FormService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2833
|
+
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template", extraAttrMap: "extraAttrMap", opener: "opener", params: "params", tabViewContainerRef: "tabViewContainerRef", onlyFrontEnd: "onlyFrontEnd", model: "model", readonly: "readonly" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "validator", first: true, predicate: DxValidationGroupComponent, descendants: true }, { propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\r\n [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<dx-validation-group *ngIf=\"!loading\">\r\n <rs-box-container [config]=\"config\"\r\n [model]=\"model\"\r\n [opener]=\"this\"\r\n [params]=\"params\"\r\n [tabViewContainerRef]=\"tabViewContainerRef\"\r\n [readonly]=\"readonly\"></rs-box-container>\r\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm()\"></dx-button>\r\n</dx-validation-group>\r\n", styles: [":host{padding:12px 24px 20px}:host dx-validation-group{display:flex;flex-flow:row nowrap}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["config", "model", "opener", "params", "readonly", "tabViewContainerRef"] }, { kind: "component", type: i6$1.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i6.DxLoadPanelComponent, selector: "dx-load-panel", inputs: ["animation", "closeOnOutsideClick", "container", "copyRootClassesToWrapper", "deferRendering", "delay", "elementAttr", "focusStateEnabled", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "indicatorSrc", "maxHeight", "maxWidth", "message", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showIndicator", "showPane", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "delayChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "indicatorSrcChange", "maxHeightChange", "maxWidthChange", "messageChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showIndicatorChange", "showPaneChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: i7.DxValidationGroupComponent, selector: "dx-validation-group", inputs: ["elementAttr", "height", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "elementAttrChange", "heightChange", "widthChange"] }] });
|
|
2834
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormComponent, decorators: [{
|
|
2850
2835
|
type: Component,
|
|
2851
|
-
args: [{ selector: 'rs-
|
|
2852
|
-
}], ctorParameters: function () { return [{ type:
|
|
2836
|
+
args: [{ selector: 'rs-form', providers: [FormService], template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\r\n [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<dx-validation-group *ngIf=\"!loading\">\r\n <rs-box-container [config]=\"config\"\r\n [model]=\"model\"\r\n [opener]=\"this\"\r\n [params]=\"params\"\r\n [tabViewContainerRef]=\"tabViewContainerRef\"\r\n [readonly]=\"readonly\"></rs-box-container>\r\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm()\"></dx-button>\r\n</dx-validation-group>\r\n", styles: [":host{padding:12px 24px 20px}:host dx-validation-group{display:flex;flex-flow:row nowrap}\n"] }]
|
|
2837
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: FormService }, { type: i0.ElementRef }]; }, propDecorators: { tenant: [{
|
|
2853
2838
|
type: Input
|
|
2854
2839
|
}], className: [{
|
|
2855
2840
|
type: Input
|
|
2856
|
-
}],
|
|
2841
|
+
}], oid: [{
|
|
2857
2842
|
type: Input
|
|
2858
|
-
}],
|
|
2843
|
+
}], copyOid: [{
|
|
2859
2844
|
type: Input
|
|
2860
|
-
}],
|
|
2845
|
+
}], template: [{
|
|
2861
2846
|
type: Input
|
|
2862
|
-
}],
|
|
2847
|
+
}], extraAttrMap: [{
|
|
2863
2848
|
type: Input
|
|
2864
|
-
}],
|
|
2849
|
+
}], opener: [{
|
|
2865
2850
|
type: Input
|
|
2866
|
-
}],
|
|
2851
|
+
}], params: [{
|
|
2867
2852
|
type: Input
|
|
2868
|
-
}],
|
|
2853
|
+
}], tabViewContainerRef: [{
|
|
2869
2854
|
type: Input
|
|
2870
|
-
}],
|
|
2871
|
-
type: Output
|
|
2872
|
-
}], selectionMode: [{
|
|
2855
|
+
}], onlyFrontEnd: [{
|
|
2873
2856
|
type: Input
|
|
2874
|
-
}],
|
|
2857
|
+
}], model: [{
|
|
2875
2858
|
type: Input
|
|
2876
|
-
}],
|
|
2877
|
-
type:
|
|
2878
|
-
}],
|
|
2879
|
-
type: Output
|
|
2880
|
-
}], onDxDataGridSelectionChanged: [{
|
|
2881
|
-
type: Output
|
|
2882
|
-
}], dxDataGrid: [{
|
|
2859
|
+
}], readonly: [{
|
|
2860
|
+
type: Input
|
|
2861
|
+
}], validator: [{
|
|
2883
2862
|
type: ViewChild,
|
|
2884
|
-
args: [
|
|
2885
|
-
}],
|
|
2886
|
-
type:
|
|
2887
|
-
args: [
|
|
2888
|
-
}],
|
|
2889
|
-
type:
|
|
2890
|
-
args: [RowButtonsTemplateDirective]
|
|
2891
|
-
}], instanceLinkTemplate: [{
|
|
2892
|
-
type: ContentChild,
|
|
2893
|
-
args: [InstanceLinkTemplateDirective]
|
|
2863
|
+
args: [DxValidationGroupComponent]
|
|
2864
|
+
}], formSubmitter: [{
|
|
2865
|
+
type: ViewChild,
|
|
2866
|
+
args: ['formSubmitter']
|
|
2867
|
+
}], submitCallback: [{
|
|
2868
|
+
type: Output
|
|
2894
2869
|
}] } });
|
|
2895
2870
|
|
|
2896
|
-
class
|
|
2871
|
+
class DataDetailComponent {
|
|
2872
|
+
constructor(viewContainerRef, service) {
|
|
2873
|
+
this.viewContainerRef = viewContainerRef;
|
|
2874
|
+
this.service = service;
|
|
2875
|
+
this.sections = [];
|
|
2876
|
+
this.loading = false;
|
|
2877
|
+
}
|
|
2878
|
+
ngOnInit() {
|
|
2879
|
+
this.loading = true;
|
|
2880
|
+
this.service.getSectionList(this.tenant, this.className, this.oid).subscribe(response => {
|
|
2881
|
+
window.coast.tabManager.setTitle.next({
|
|
2882
|
+
id: 'detail:' + this.tenant + '_' + this.className + '_' + this.oid,
|
|
2883
|
+
title: response.data.title
|
|
2884
|
+
});
|
|
2885
|
+
this.sections = response.data.list;
|
|
2886
|
+
this.loading = false;
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2897
2889
|
}
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
UserInfoTemplateComponent,
|
|
2905
|
-
UnitInfoTemplateComponent], imports: [CommonModule,
|
|
2906
|
-
DevExtremeModule], exports: [DataGridComponent,
|
|
2907
|
-
InstanceLinkTemplateDirective,
|
|
2908
|
-
MasterDetailTemplateDirective,
|
|
2909
|
-
RowButtonsTemplateDirective] });
|
|
2910
|
-
DataGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, imports: [CommonModule,
|
|
2911
|
-
DevExtremeModule] });
|
|
2912
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, decorators: [{
|
|
2913
|
-
type: NgModule,
|
|
2914
|
-
args: [{
|
|
2915
|
-
declarations: [
|
|
2916
|
-
DataGridComponent,
|
|
2917
|
-
FileCellTemplateComponent,
|
|
2918
|
-
InstanceLinkTemplateDirective,
|
|
2919
|
-
MasterDetailTemplateDirective,
|
|
2920
|
-
RowButtonsTemplateDirective,
|
|
2921
|
-
UserInfoTemplateComponent,
|
|
2922
|
-
UnitInfoTemplateComponent
|
|
2923
|
-
],
|
|
2924
|
-
imports: [
|
|
2925
|
-
CommonModule,
|
|
2926
|
-
DevExtremeModule
|
|
2927
|
-
],
|
|
2928
|
-
exports: [
|
|
2929
|
-
DataGridComponent,
|
|
2930
|
-
InstanceLinkTemplateDirective,
|
|
2931
|
-
MasterDetailTemplateDirective,
|
|
2932
|
-
RowButtonsTemplateDirective
|
|
2933
|
-
]
|
|
2934
|
-
}]
|
|
2935
|
-
}] });
|
|
2890
|
+
DataDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailComponent, deps: [{ token: i0.ViewContainerRef }, { token: DataDetailService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2891
|
+
DataDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DataDetailComponent, selector: "coast-data-detail", providers: [DataDetailService], ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\n [visible]=\"loading\">\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\n</dx-load-panel>\n<div *ngIf=\"!loading && sections.length === 0\" class=\"empty\">\n <span>\u60A8\u65E0\u6743\u67E5\u770B\u8BE5\u6570\u636E\u5B9E\u4F8B\u4EFB\u4F55\u4FE1\u606F</span>\n</div>\n<ng-container *ngIf=\"sections.length > 0\">\n <dx-accordion [collapsible]=\"true\" [multiple]=\"true\" [deferRendering]=\"false\" [dataSource]=\"sections\"\n [selectedItems]=\"sections\">\n <div *dxTemplate=\"let section of 'title'\" class=\"section-title\">\n <div class=\"section-title-name\">{{ section.name }}</div>\n </div>\n <div *dxTemplate=\"let section of 'item'\">\n <rs-form [tenant]=\"tenant\" [className]=\"className\" [oid]=\"oid\" [template]=\"section.formTemplate\" [params]=\"params\"\n [tabViewContainerRef]=\"tabViewContainerRef\" [readonly]=\"true\"></rs-form>\n </div>\n </dx-accordion>\n</ng-container>\n", styles: [":host{flex:1;padding:24px;display:flex;flex-flow:column nowrap}:host div.empty{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div.empty span{text-align:center;-webkit-user-select:none;user-select:none}:host .section-title{border-bottom:1px solid var(--coast-border-color, #dddddd)}:host .section-title .section-title-name{height:24px;font-size:14px;font-weight:700;padding:4px 8px;display:flex;flex-flow:column nowrap;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.DxAccordionComponent, selector: "dx-accordion", inputs: ["accessKey", "activeStateEnabled", "animationDuration", "collapsible", "dataSource", "deferRendering", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "itemHoldTimeout", "items", "itemTemplate", "itemTitleTemplate", "keyExpr", "multiple", "noDataText", "repaintChangesOnly", "rtlEnabled", "selectedIndex", "selectedItem", "selectedItemKeys", "selectedItems", "tabIndex", "visible", "width"], outputs: ["onContentReady", "onDisposing", "onInitialized", "onItemClick", "onItemContextMenu", "onItemHold", "onItemRendered", "onItemTitleClick", "onOptionChanged", "onSelectionChanged", "accessKeyChange", "activeStateEnabledChange", "animationDurationChange", "collapsibleChange", "dataSourceChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "itemHoldTimeoutChange", "itemsChange", "itemTemplateChange", "itemTitleTemplateChange", "keyExprChange", "multipleChange", "noDataTextChange", "repaintChangesOnlyChange", "rtlEnabledChange", "selectedIndexChange", "selectedItemChange", "selectedItemKeysChange", "selectedItemsChange", "tabIndexChange", "visibleChange", "widthChange"] }, { kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i6$1.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i6.DxLoadPanelComponent, selector: "dx-load-panel", inputs: ["animation", "closeOnOutsideClick", "container", "copyRootClassesToWrapper", "deferRendering", "delay", "elementAttr", "focusStateEnabled", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "indicatorSrc", "maxHeight", "maxWidth", "message", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showIndicator", "showPane", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "delayChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "indicatorSrcChange", "maxHeightChange", "maxWidthChange", "messageChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showIndicatorChange", "showPaneChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: FormComponent, selector: "rs-form", inputs: ["tenant", "className", "oid", "copyOid", "template", "extraAttrMap", "opener", "params", "tabViewContainerRef", "onlyFrontEnd", "model", "readonly"], outputs: ["submitCallback"] }] });
|
|
2892
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailComponent, decorators: [{
|
|
2893
|
+
type: Component,
|
|
2894
|
+
args: [{ selector: 'coast-data-detail', providers: [DataDetailService], template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\n [visible]=\"loading\">\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\n</dx-load-panel>\n<div *ngIf=\"!loading && sections.length === 0\" class=\"empty\">\n <span>\u60A8\u65E0\u6743\u67E5\u770B\u8BE5\u6570\u636E\u5B9E\u4F8B\u4EFB\u4F55\u4FE1\u606F</span>\n</div>\n<ng-container *ngIf=\"sections.length > 0\">\n <dx-accordion [collapsible]=\"true\" [multiple]=\"true\" [deferRendering]=\"false\" [dataSource]=\"sections\"\n [selectedItems]=\"sections\">\n <div *dxTemplate=\"let section of 'title'\" class=\"section-title\">\n <div class=\"section-title-name\">{{ section.name }}</div>\n </div>\n <div *dxTemplate=\"let section of 'item'\">\n <rs-form [tenant]=\"tenant\" [className]=\"className\" [oid]=\"oid\" [template]=\"section.formTemplate\" [params]=\"params\"\n [tabViewContainerRef]=\"tabViewContainerRef\" [readonly]=\"true\"></rs-form>\n </div>\n </dx-accordion>\n</ng-container>\n", styles: [":host{flex:1;padding:24px;display:flex;flex-flow:column nowrap}:host div.empty{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div.empty span{text-align:center;-webkit-user-select:none;user-select:none}:host .section-title{border-bottom:1px solid var(--coast-border-color, #dddddd)}:host .section-title .section-title-name{height:24px;font-size:14px;font-weight:700;padding:4px 8px;display:flex;flex-flow:column nowrap;justify-content:center}\n"] }]
|
|
2895
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: DataDetailService }]; } });
|
|
2936
2896
|
|
|
2937
|
-
class
|
|
2938
|
-
constructor(
|
|
2939
|
-
this.
|
|
2897
|
+
class DrawerComponent {
|
|
2898
|
+
constructor(elementRef) {
|
|
2899
|
+
this.elementRef = elementRef;
|
|
2900
|
+
this.size = 'default';
|
|
2901
|
+
this._width = '480px';
|
|
2940
2902
|
}
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2903
|
+
ngOnInit() {
|
|
2904
|
+
if (this.size === 'large') {
|
|
2905
|
+
this._width = '960px';
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
show() {
|
|
2909
|
+
// 若存在多层抽屉,仅保留最上层遮罩颜色,下层遮罩设置为透明
|
|
2910
|
+
const nodeName = this.elementRef.nativeElement.nodeName;
|
|
2911
|
+
const drawers = this._parentViewContainerRef.element.nativeElement.parentElement.querySelectorAll(nodeName);
|
|
2912
|
+
for (let i = 0; i < drawers.length; i++) {
|
|
2913
|
+
if (i === drawers.length - 1) {
|
|
2914
|
+
drawers[i].querySelector('.drawer-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
|
|
2948
2915
|
}
|
|
2949
|
-
|
|
2916
|
+
else {
|
|
2917
|
+
drawers[i].querySelector('.drawer-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0)';
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
hide($event, backdrop) {
|
|
2922
|
+
// 在service中重写
|
|
2923
|
+
}
|
|
2924
|
+
ngOnDestroy() {
|
|
2925
|
+
// 若存在多层抽屉,下一层遮罩设置为不透明
|
|
2926
|
+
const nodeName = this.elementRef.nativeElement.nodeName;
|
|
2927
|
+
const nextDrawer = this._parentViewContainerRef.element.nativeElement.parentElement.querySelector(nodeName + ':nth-last-child(2)');
|
|
2928
|
+
if (nextDrawer) {
|
|
2929
|
+
nextDrawer.querySelector('.drawer-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
|
|
2930
|
+
}
|
|
2950
2931
|
}
|
|
2951
2932
|
}
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type:
|
|
2955
|
-
type:
|
|
2956
|
-
|
|
2933
|
+
DrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2934
|
+
DrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DrawerComponent, selector: "rs-drawer", ngImport: i0, template: "<div #drawerBackdrop class=\"drawer-backdrop\" (click)=\"hide($event, drawerBackdrop)\">\n <div class=\"drawer\" [ngStyle]=\"{width: _width}\">\n <div *ngIf=\"headerTemplate\" class=\"drawer-header\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: headerTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-close\">\n <dx-button height=\"40px\" icon=\"coast-icon coast-icon-arrow-right-filling\" (onClick)=\"hide($event)\"></dx-button>\n </div>\n </div>\n</div>\n", styles: [":host .drawer-backdrop{position:absolute;inset:0;z-index:calc(var(--coast-z-index-drawer, 1040) - 1)}:host .drawer-backdrop .drawer{position:absolute;right:0;height:100%;z-index:var(--coast-z-index-drawer, 1040);background-color:var(--coast-base-bg-color, #fff);display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-header{flex:0 0 36px;padding:8px;border-bottom:1px solid var(--coast-border-color, #dddddd);display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-end}:host .drawer-backdrop .drawer .drawer-content{flex:1;overflow:auto;display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-close{position:absolute;height:100%;width:20px;top:0;left:-20px;display:flex;flex-flow:row nowrap;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }] });
|
|
2935
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
2936
|
+
type: Component,
|
|
2937
|
+
args: [{ selector: 'rs-drawer', template: "<div #drawerBackdrop class=\"drawer-backdrop\" (click)=\"hide($event, drawerBackdrop)\">\n <div class=\"drawer\" [ngStyle]=\"{width: _width}\">\n <div *ngIf=\"headerTemplate\" class=\"drawer-header\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: headerTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-close\">\n <dx-button height=\"40px\" icon=\"coast-icon coast-icon-arrow-right-filling\" (onClick)=\"hide($event)\"></dx-button>\n </div>\n </div>\n</div>\n", styles: [":host .drawer-backdrop{position:absolute;inset:0;z-index:calc(var(--coast-z-index-drawer, 1040) - 1)}:host .drawer-backdrop .drawer{position:absolute;right:0;height:100%;z-index:var(--coast-z-index-drawer, 1040);background-color:var(--coast-base-bg-color, #fff);display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-header{flex:0 0 36px;padding:8px;border-bottom:1px solid var(--coast-border-color, #dddddd);display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-end}:host .drawer-backdrop .drawer .drawer-content{flex:1;overflow:auto;display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-close{position:absolute;height:100%;width:20px;top:0;left:-20px;display:flex;flex-flow:row nowrap;align-items:center}\n"] }]
|
|
2938
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
2957
2939
|
|
|
2958
|
-
class
|
|
2959
|
-
constructor(
|
|
2960
|
-
this.http = http;
|
|
2940
|
+
class DrawerService {
|
|
2941
|
+
constructor() {
|
|
2961
2942
|
}
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2943
|
+
open(viewContainerRef, size = 'default', contentTemplate, contentTemplateContext, headerTemplate, headerTemplateContext) {
|
|
2944
|
+
const drawerRef = viewContainerRef.createComponent(DrawerComponent);
|
|
2945
|
+
drawerRef.instance.hide = ($event, backdrop) => {
|
|
2946
|
+
if ($event.target === backdrop) {
|
|
2947
|
+
drawerRef.hostView.destroy();
|
|
2967
2948
|
}
|
|
2968
|
-
}
|
|
2949
|
+
};
|
|
2950
|
+
drawerRef.instance.size = size;
|
|
2951
|
+
drawerRef.instance.headerTemplate = headerTemplate;
|
|
2952
|
+
drawerRef.instance.headerTemplateContext = headerTemplateContext;
|
|
2953
|
+
drawerRef.instance.contentTemplate = contentTemplate;
|
|
2954
|
+
drawerRef.instance.contentTemplateContext = contentTemplateContext;
|
|
2955
|
+
drawerRef.instance._parentViewContainerRef = viewContainerRef;
|
|
2956
|
+
drawerRef.instance.show();
|
|
2957
|
+
return drawerRef.instance;
|
|
2969
2958
|
}
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2959
|
+
}
|
|
2960
|
+
DrawerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2961
|
+
DrawerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerService, providedIn: 'root' });
|
|
2962
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerService, decorators: [{
|
|
2963
|
+
type: Injectable,
|
|
2964
|
+
args: [{
|
|
2965
|
+
providedIn: 'root'
|
|
2966
|
+
}]
|
|
2967
|
+
}], ctorParameters: function () { return []; } });
|
|
2968
|
+
|
|
2969
|
+
class InstanceLinkTemplateComponent {
|
|
2970
|
+
constructor(service, drawerService) {
|
|
2971
|
+
this.service = service;
|
|
2972
|
+
this.drawerService = drawerService;
|
|
2973
|
+
}
|
|
2974
|
+
openNewTab($event) {
|
|
2975
|
+
var _a;
|
|
2976
|
+
(_a = $event.event) === null || _a === void 0 ? void 0 : _a.stopPropagation();
|
|
2977
|
+
if (!window.coast.tabManager) {
|
|
2978
|
+
notify_warning('此操作仅能在coast-web项目中执行,type:detail,config:tenant=' + this.tenant + ',className=' + this.className + ',oid=' + this.oid);
|
|
2979
|
+
return;
|
|
2980
|
+
}
|
|
2981
|
+
window.coast.tabManager.add.next({
|
|
2982
|
+
type: 'detail',
|
|
2983
|
+
id: 'detail:' + this.tenant + '_' + this.className + '_' + this.oid,
|
|
2984
|
+
title: '',
|
|
2985
|
+
component: DataDetailComponent,
|
|
2986
|
+
config: {
|
|
2987
|
+
tenant: this.tenant,
|
|
2988
|
+
className: this.className,
|
|
2989
|
+
oid: this.oid
|
|
2977
2990
|
}
|
|
2978
2991
|
});
|
|
2979
2992
|
}
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2993
|
+
openDrawer($event) {
|
|
2994
|
+
var _a;
|
|
2995
|
+
(_a = $event.event) === null || _a === void 0 ? void 0 : _a.stopPropagation();
|
|
2996
|
+
this.drawerService.open(this.drawerViewContainerRef, 'default', this.drawerFormContentTemplate, {
|
|
2997
|
+
template: this.drawerFormTemplate || 'About'
|
|
2998
|
+
}, this.drawerFormHeaderTemplate);
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
InstanceLinkTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InstanceLinkTemplateComponent, deps: [{ token: DataGridService }, { token: DrawerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3002
|
+
InstanceLinkTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: InstanceLinkTemplateComponent, selector: "rs-instance-link-template", inputs: { tenant: "tenant", className: "className", oid: "oid", instanceLinkType: "instanceLinkType", drawerViewContainerRef: "drawerViewContainerRef", drawerFormTemplate: "drawerFormTemplate" }, viewQueries: [{ propertyName: "drawerFormHeaderTemplate", first: true, predicate: ["drawerFormHeaderTemplate"], descendants: true, static: true }, { propertyName: "drawerFormContentTemplate", first: true, predicate: ["drawerFormContentTemplate"], descendants: true, static: true }], ngImport: i0, template: "<dx-button *ngIf=\"instanceLinkType === 'tab'\"\n type=\"default\"\n stylingMode=\"text\"\n icon=\"coast-icon coast-icon-send\"\n hint=\"\u67E5\u770B\u8BE6\u60C5\"\n (onClick)=\"openNewTab($event)\"></dx-button>\n<dx-button *ngIf=\"instanceLinkType === 'drawer'\"\n type=\"default\"\n stylingMode=\"text\"\n icon=\"coast-icon coast-icon-send\"\n hint=\"\u67E5\u770B\u8BE6\u60C5\"\n (onClick)=\"openDrawer($event)\"></dx-button>\n<ng-template #drawerFormHeaderTemplate>\n <dx-button icon=\"coast-icon coast-icon-send\" text=\"\u5728\u65B0\u9009\u9879\u5361\u4E2D\u67E5\u770B\" (onClick)=\"openNewTab($event)\"></dx-button>\n</ng-template>\n<ng-template #drawerFormContentTemplate let-modalContext>\n <rs-form [tenant]=\"tenant\"\n [className]=\"className\"\n [oid]=\"oid\"\n [template]=\"modalContext.template\"\n [readonly]=\"true\"></rs-form>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: FormComponent, selector: "rs-form", inputs: ["tenant", "className", "oid", "copyOid", "template", "extraAttrMap", "opener", "params", "tabViewContainerRef", "onlyFrontEnd", "model", "readonly"], outputs: ["submitCallback"] }] });
|
|
3003
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: InstanceLinkTemplateComponent, decorators: [{
|
|
3004
|
+
type: Component,
|
|
3005
|
+
args: [{ selector: 'rs-instance-link-template', template: "<dx-button *ngIf=\"instanceLinkType === 'tab'\"\n type=\"default\"\n stylingMode=\"text\"\n icon=\"coast-icon coast-icon-send\"\n hint=\"\u67E5\u770B\u8BE6\u60C5\"\n (onClick)=\"openNewTab($event)\"></dx-button>\n<dx-button *ngIf=\"instanceLinkType === 'drawer'\"\n type=\"default\"\n stylingMode=\"text\"\n icon=\"coast-icon coast-icon-send\"\n hint=\"\u67E5\u770B\u8BE6\u60C5\"\n (onClick)=\"openDrawer($event)\"></dx-button>\n<ng-template #drawerFormHeaderTemplate>\n <dx-button icon=\"coast-icon coast-icon-send\" text=\"\u5728\u65B0\u9009\u9879\u5361\u4E2D\u67E5\u770B\" (onClick)=\"openNewTab($event)\"></dx-button>\n</ng-template>\n<ng-template #drawerFormContentTemplate let-modalContext>\n <rs-form [tenant]=\"tenant\"\n [className]=\"className\"\n [oid]=\"oid\"\n [template]=\"modalContext.template\"\n [readonly]=\"true\"></rs-form>\n</ng-template>\n" }]
|
|
3006
|
+
}], ctorParameters: function () { return [{ type: DataGridService }, { type: DrawerService }]; }, propDecorators: { tenant: [{
|
|
3007
|
+
type: Input
|
|
3008
|
+
}], className: [{
|
|
3009
|
+
type: Input
|
|
3010
|
+
}], oid: [{
|
|
3011
|
+
type: Input
|
|
3012
|
+
}], instanceLinkType: [{
|
|
3013
|
+
type: Input
|
|
3014
|
+
}], drawerViewContainerRef: [{
|
|
3015
|
+
type: Input
|
|
3016
|
+
}], drawerFormTemplate: [{
|
|
3017
|
+
type: Input
|
|
3018
|
+
}], drawerFormHeaderTemplate: [{
|
|
3019
|
+
type: ViewChild,
|
|
3020
|
+
args: ['drawerFormHeaderTemplate', { static: true }]
|
|
3021
|
+
}], drawerFormContentTemplate: [{
|
|
3022
|
+
type: ViewChild,
|
|
3023
|
+
args: ['drawerFormContentTemplate', { static: true }]
|
|
3024
|
+
}] } });
|
|
3025
|
+
|
|
3026
|
+
class UnitInfoTemplateComponent {
|
|
3027
|
+
constructor(service, domSanitizer) {
|
|
3028
|
+
this.service = service;
|
|
3029
|
+
this.domSanitizer = domSanitizer;
|
|
3030
|
+
}
|
|
3031
|
+
ngOnInit() {
|
|
3032
|
+
const needRemoteDisplayName = Array.isArray(this.cellInfo.value);
|
|
3033
|
+
if (!needRemoteDisplayName) {
|
|
3034
|
+
this.displayName = this.cellInfo.value;
|
|
3035
|
+
}
|
|
3036
|
+
this.service.getUnitInfo(this.uid).subscribe(response => {
|
|
3037
|
+
if (needRemoteDisplayName) {
|
|
3038
|
+
this.displayName = response.displayName;
|
|
2987
3039
|
}
|
|
3040
|
+
const unitInfo = response.unitInfo;
|
|
3041
|
+
let content = '<table>';
|
|
3042
|
+
for (const item of unitInfo) {
|
|
3043
|
+
content += `
|
|
3044
|
+
<tr>
|
|
3045
|
+
<td style="text-align: right;">${item.caption}:</td>
|
|
3046
|
+
<td style="text-align: left;">${item.value}</td>
|
|
3047
|
+
</tr>
|
|
3048
|
+
`;
|
|
3049
|
+
}
|
|
3050
|
+
content += '</table>';
|
|
3051
|
+
this.content = this.domSanitizer.bypassSecurityTrustHtml(content);
|
|
3052
|
+
// 重绘表格宽高
|
|
3053
|
+
setTimeout(() => {
|
|
3054
|
+
this.service.cellTemplateLoaded$.emit();
|
|
3055
|
+
});
|
|
2988
3056
|
});
|
|
2989
3057
|
}
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
3058
|
+
}
|
|
3059
|
+
UnitInfoTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UnitInfoTemplateComponent, deps: [{ token: DataGridService }, { token: i2$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
3060
|
+
UnitInfoTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: UnitInfoTemplateComponent, selector: "rs-unit-info-template", inputs: { uid: "uid", cellInfo: "cellInfo" }, ngImport: i0, template: "<dx-button #textDiv type=\"default\" stylingMode=\"text\" (onClick)=\"$event.event?.stopPropagation()\">\n {{ displayName }}\n <dx-tooltip [target]=\"textDiv.instance.element()\"\n [position]=\"'top'\"\n [showEvent]=\"'click'\">\n <div *dxTemplate=\"let data of 'content'\">\n <div [innerHTML]=\"content\"></div>\n </div>\n </dx-tooltip>\n</dx-button>\n<br/>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i5.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }] });
|
|
3061
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UnitInfoTemplateComponent, decorators: [{
|
|
3062
|
+
type: Component,
|
|
3063
|
+
args: [{ selector: 'rs-unit-info-template', template: "<dx-button #textDiv type=\"default\" stylingMode=\"text\" (onClick)=\"$event.event?.stopPropagation()\">\n {{ displayName }}\n <dx-tooltip [target]=\"textDiv.instance.element()\"\n [position]=\"'top'\"\n [showEvent]=\"'click'\">\n <div *dxTemplate=\"let data of 'content'\">\n <div [innerHTML]=\"content\"></div>\n </div>\n </dx-tooltip>\n</dx-button>\n<br/>\n" }]
|
|
3064
|
+
}], ctorParameters: function () { return [{ type: DataGridService }, { type: i2$2.DomSanitizer }]; }, propDecorators: { uid: [{
|
|
3065
|
+
type: Input
|
|
3066
|
+
}], cellInfo: [{
|
|
3067
|
+
type: Input
|
|
3068
|
+
}] } });
|
|
3069
|
+
|
|
3070
|
+
class UserInfoTemplateComponent {
|
|
3071
|
+
constructor(service, domSanitizer) {
|
|
3072
|
+
this.service = service;
|
|
3073
|
+
this.domSanitizer = domSanitizer;
|
|
3074
|
+
}
|
|
3075
|
+
ngOnInit() {
|
|
3076
|
+
const needRemoteDisplayName = Array.isArray(this.cellInfo.value);
|
|
3077
|
+
if (!needRemoteDisplayName) {
|
|
3078
|
+
this.displayName = this.cellInfo.value;
|
|
2994
3079
|
}
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3080
|
+
this.service.getUserInfo(this.uid).subscribe(response => {
|
|
3081
|
+
if (needRemoteDisplayName) {
|
|
3082
|
+
this.displayName = response.displayName;
|
|
3083
|
+
}
|
|
3084
|
+
const userInfo = response.userInfo;
|
|
3085
|
+
let content = '<table>';
|
|
3086
|
+
for (const item of userInfo) {
|
|
3087
|
+
content += `
|
|
3088
|
+
<tr>
|
|
3089
|
+
<td style="text-align: right;">${item.caption}:</td>
|
|
3090
|
+
<td style="text-align: left;">${item.value}</td>
|
|
3091
|
+
</tr>
|
|
3092
|
+
`;
|
|
2998
3093
|
}
|
|
3094
|
+
content += '</table>';
|
|
3095
|
+
this.content = this.domSanitizer.bypassSecurityTrustHtml(content);
|
|
3096
|
+
// 重绘表格宽高
|
|
3097
|
+
setTimeout(() => {
|
|
3098
|
+
this.service.cellTemplateLoaded$.emit();
|
|
3099
|
+
});
|
|
2999
3100
|
});
|
|
3000
3101
|
}
|
|
3001
3102
|
}
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type:
|
|
3005
|
-
type:
|
|
3006
|
-
|
|
3103
|
+
UserInfoTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UserInfoTemplateComponent, deps: [{ token: DataGridService }, { token: i2$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
3104
|
+
UserInfoTemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: UserInfoTemplateComponent, selector: "rs-user-info-template", inputs: { uid: "uid", cellInfo: "cellInfo" }, ngImport: i0, template: "<dx-button #textDiv type=\"default\" stylingMode=\"text\" (onClick)=\"$event.event?.stopPropagation()\">\n {{ displayName }}\n <dx-tooltip [target]=\"textDiv.instance.element()\"\n [position]=\"'top'\"\n [showEvent]=\"'click'\">\n <div *dxTemplate=\"let data of 'content'\">\n <div [innerHTML]=\"content\"></div>\n </div>\n </dx-tooltip>\n</dx-button>\n<br/>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i5.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }] });
|
|
3105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: UserInfoTemplateComponent, decorators: [{
|
|
3106
|
+
type: Component,
|
|
3107
|
+
args: [{ selector: 'rs-user-info-template', template: "<dx-button #textDiv type=\"default\" stylingMode=\"text\" (onClick)=\"$event.event?.stopPropagation()\">\n {{ displayName }}\n <dx-tooltip [target]=\"textDiv.instance.element()\"\n [position]=\"'top'\"\n [showEvent]=\"'click'\">\n <div *dxTemplate=\"let data of 'content'\">\n <div [innerHTML]=\"content\"></div>\n </div>\n </dx-tooltip>\n</dx-button>\n<br/>\n" }]
|
|
3108
|
+
}], ctorParameters: function () { return [{ type: DataGridService }, { type: i2$2.DomSanitizer }]; }, propDecorators: { uid: [{
|
|
3109
|
+
type: Input
|
|
3110
|
+
}], cellInfo: [{
|
|
3111
|
+
type: Input
|
|
3112
|
+
}] } });
|
|
3007
3113
|
|
|
3008
|
-
class
|
|
3009
|
-
constructor(
|
|
3010
|
-
this.
|
|
3114
|
+
class DataGridComponent {
|
|
3115
|
+
constructor(factory, service, viewContainerRef) {
|
|
3116
|
+
this.factory = factory;
|
|
3011
3117
|
this.service = service;
|
|
3012
|
-
this.
|
|
3118
|
+
this.viewContainerRef = viewContainerRef;
|
|
3013
3119
|
this.tenant = 'T';
|
|
3014
|
-
this.
|
|
3015
|
-
this.
|
|
3016
|
-
this.
|
|
3017
|
-
this.
|
|
3018
|
-
this.
|
|
3120
|
+
this.keyExpr = ''; // 用于实例属性选择器,加载组件值时以选中字段为主键获取选中行数据
|
|
3121
|
+
this.onlyFrontEnd = false; // 仅前端,不通过获取表格数据
|
|
3122
|
+
this.dataSource = {};
|
|
3123
|
+
this.selectionMode = 'none';
|
|
3124
|
+
this.selectedRowKeys = [];
|
|
3125
|
+
this.selectedRowKeysChange = new EventEmitter();
|
|
3126
|
+
this.showRowNum = true;
|
|
3127
|
+
this.instanceLinkType = 'tab';
|
|
3128
|
+
this.drawerInstanceLinkViewContainerRef = this.viewContainerRef;
|
|
3129
|
+
this.onCellPrepared = new EventEmitter();
|
|
3130
|
+
this.onContentReady = new EventEmitter();
|
|
3131
|
+
this.onEditorPreparing = new EventEmitter();
|
|
3132
|
+
this.onRowClick = new EventEmitter();
|
|
3133
|
+
this.onRowDblClick = new EventEmitter();
|
|
3134
|
+
this.onSelectionChanged = new EventEmitter();
|
|
3135
|
+
this.columns = [];
|
|
3019
3136
|
}
|
|
3020
3137
|
ngOnInit() {
|
|
3021
|
-
this.
|
|
3022
|
-
this.
|
|
3023
|
-
this.
|
|
3138
|
+
this.reload();
|
|
3139
|
+
this.service.cellTemplateLoaded$.pipe(debounceTime(200)).subscribe(() => {
|
|
3140
|
+
this.dxDataGrid.instance.resize();
|
|
3024
3141
|
});
|
|
3025
3142
|
}
|
|
3026
|
-
|
|
3027
|
-
this.
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
}
|
|
3032
|
-
load() {
|
|
3033
|
-
this.loading = true;
|
|
3034
|
-
this.params = Object.assign(this.params || {}, {
|
|
3035
|
-
__form: {
|
|
3036
|
-
tenant: this.tenant,
|
|
3037
|
-
className: this.className,
|
|
3038
|
-
oid: this.oid,
|
|
3039
|
-
copyOid: this.copyOid,
|
|
3040
|
-
template: this.template
|
|
3041
|
-
}
|
|
3042
|
-
});
|
|
3043
|
-
this.service.getFormTemplateConfig(this.tenant, this.className, this.template).subscribe(response => {
|
|
3044
|
-
this.config = response.data.template;
|
|
3045
|
-
if (this.onlyFrontEnd) {
|
|
3046
|
-
this.loading = false;
|
|
3143
|
+
reload() {
|
|
3144
|
+
this.columns.length = 0;
|
|
3145
|
+
this.factory.makeDataGridColumns(this.tenant, this.className, this.view).subscribe(columns => {
|
|
3146
|
+
if (this.customColumnFn) {
|
|
3147
|
+
this.customColumnFn(columns);
|
|
3047
3148
|
}
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3149
|
+
if (this.instanceLinkType === 'tab' || this.instanceLinkType === 'drawer') {
|
|
3150
|
+
columns.unshift({
|
|
3151
|
+
fixed: true,
|
|
3152
|
+
width: 48,
|
|
3153
|
+
cellTemplate: 'instanceLinkTemplate',
|
|
3154
|
+
alignment: 'center',
|
|
3155
|
+
cssClass: 'cell-vertical-middle'
|
|
3053
3156
|
});
|
|
3054
3157
|
}
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3158
|
+
if (this.showRowNum) {
|
|
3159
|
+
columns.unshift({
|
|
3160
|
+
fixed: true,
|
|
3161
|
+
width: 48,
|
|
3162
|
+
cellTemplate: 'rowIndexTemplate',
|
|
3163
|
+
alignment: 'center',
|
|
3164
|
+
cssClass: 'cell-vertical-middle'
|
|
3059
3165
|
});
|
|
3060
3166
|
}
|
|
3167
|
+
this.columns = columns;
|
|
3061
3168
|
});
|
|
3169
|
+
if (this.onlyFrontEnd) {
|
|
3170
|
+
if (this.dataSource && !Array.isArray(this.dataSource)) {
|
|
3171
|
+
notify_error('if onlyFrontEnd set true, you have to set dataSource as an Array');
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
else {
|
|
3175
|
+
this.dataSource = this.factory.makeDataGridDataSource(this.tenant, this.className, this.view, this.filter, this.keyExpr, this.dataGridName);
|
|
3176
|
+
}
|
|
3062
3177
|
}
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3178
|
+
convertMultipleValueCellText(cellInfo) {
|
|
3179
|
+
if (!cellInfo.value) {
|
|
3180
|
+
return;
|
|
3181
|
+
}
|
|
3182
|
+
if (Array.isArray(cellInfo.value)) {
|
|
3183
|
+
if (cellInfo.column.lookup) {
|
|
3184
|
+
return cellInfo.value.map((item) => cellInfo.column.lookup.calculateCellValue(item)).join('<br />');
|
|
3185
|
+
}
|
|
3186
|
+
return cellInfo.value.join('<br />');
|
|
3187
|
+
}
|
|
3188
|
+
if (cellInfo.column.lookup) {
|
|
3189
|
+
return cellInfo.column.lookup.calculateCellValue(cellInfo.value);
|
|
3190
|
+
}
|
|
3191
|
+
return cellInfo.value;
|
|
3192
|
+
}
|
|
3193
|
+
getOriginalValue(cellInfo, key) {
|
|
3194
|
+
const config = cellInfo.column[key];
|
|
3195
|
+
if (config) {
|
|
3196
|
+
const value = cellInfo.data[config.field];
|
|
3197
|
+
if (value) {
|
|
3198
|
+
if (Array.isArray(value)) {
|
|
3199
|
+
return value;
|
|
3071
3200
|
}
|
|
3072
|
-
|
|
3073
|
-
this.submitCallback.emit(response);
|
|
3074
|
-
});
|
|
3201
|
+
return [value];
|
|
3075
3202
|
}
|
|
3076
|
-
|
|
3077
|
-
|
|
3203
|
+
return [];
|
|
3204
|
+
}
|
|
3205
|
+
return cellInfo.data[key];
|
|
3206
|
+
}
|
|
3207
|
+
getSelectedRowKeys() {
|
|
3208
|
+
return this.dxDataGrid.instance.getSelectedRowKeys();
|
|
3209
|
+
}
|
|
3210
|
+
refresh(callback) {
|
|
3211
|
+
this.dxDataGrid.instance.refresh().then(() => {
|
|
3212
|
+
if (callback) {
|
|
3213
|
+
callback();
|
|
3078
3214
|
}
|
|
3079
3215
|
});
|
|
3080
3216
|
}
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3217
|
+
onDxDataGridEditorPreparing($event) {
|
|
3218
|
+
if ($event.parentType === 'filterRow' && $event.editorName === 'dxTextBox') {
|
|
3219
|
+
$event.editorOptions.valueChangeEvent = 'blur';
|
|
3220
|
+
$event.editorOptions.onEnterKey = (e) => {
|
|
3221
|
+
e.component.blur();
|
|
3222
|
+
};
|
|
3085
3223
|
}
|
|
3086
|
-
|
|
3087
|
-
validate() {
|
|
3088
|
-
return validate_group(this.validator);
|
|
3089
|
-
}
|
|
3090
|
-
submit() {
|
|
3091
|
-
this.formSubmitter.instance.element().click();
|
|
3224
|
+
this.onEditorPreparing.emit($event);
|
|
3092
3225
|
}
|
|
3093
3226
|
}
|
|
3094
|
-
|
|
3095
|
-
FormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: FormComponent, selector: "rs-form", inputs: { tenant: "tenant", className: "className", oid: "oid", copyOid: "copyOid", template: "template", extraAttrMap: "extraAttrMap", opener: "opener", params: "params", tabViewContainerRef: "tabViewContainerRef", onlyFrontEnd: "onlyFrontEnd", model: "model", readonly: "readonly" }, outputs: { submitCallback: "submitCallback" }, providers: [FormService], viewQueries: [{ propertyName: "validator", first: true, predicate: DxValidationGroupComponent, descendants: true }, { propertyName: "formSubmitter", first: true, predicate: ["formSubmitter"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\r\n [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<dx-validation-group *ngIf=\"!loading\">\r\n <rs-box-container [config]=\"config\"\r\n [model]=\"model\"\r\n [opener]=\"this\"\r\n [params]=\"params\"\r\n [tabViewContainerRef]=\"tabViewContainerRef\"\r\n [readonly]=\"readonly\"></rs-box-container>\r\n <dx-button #formSubmitter [visible]=\"false\" (onClick)=\"submitForm()\"></dx-button>\r\n</dx-validation-group>\r\n", styles: [":host{padding:12px 24px 20px}:host dx-validation-group{display:flex;flex-flow:row nowrap}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BoxContainerComponent, selector: "rs-box-container", inputs: ["config", "model", "opener", "params", "readonly", "tabViewContainerRef"] }, { kind: "component", type: i6$1.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }, { kind: "component", type: i6.DxLoadPanelComponent, selector: "dx-load-panel", inputs: ["animation", "closeOnOutsideClick", "container", "copyRootClassesToWrapper", "deferRendering", "delay", "elementAttr", "focusStateEnabled", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "indicatorSrc", "maxHeight", "maxWidth", "message", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showIndicator", "showPane", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "delayChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "indicatorSrcChange", "maxHeightChange", "maxWidthChange", "messageChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showIndicatorChange", "showPaneChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: i7.DxValidationGroupComponent, selector: "dx-validation-group", inputs: ["elementAttr", "height", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "elementAttrChange", "heightChange", "widthChange"] }] });
|
|
3096
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type:
|
|
3227
|
+
DataGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridComponent, deps: [{ token: DataGridFactory }, { token: DataGridService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3228
|
+
DataGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DataGridComponent, selector: "rs-data-grid", inputs: { tenant: "tenant", className: "className", view: "view", filter: "filter", customColumnFn: "customColumnFn", keyExpr: "keyExpr", dataGridName: "dataGridName", height: "height", onlyFrontEnd: "onlyFrontEnd", dataSource: "dataSource", selectionMode: "selectionMode", selectedRowKeys: "selectedRowKeys", showRowNum: "showRowNum", instanceLinkType: "instanceLinkType", drawerInstanceLinkViewContainerRef: "drawerInstanceLinkViewContainerRef", drawerInstanceLinkFormTemplate: "drawerInstanceLinkFormTemplate" }, outputs: { selectedRowKeysChange: "selectedRowKeysChange", onCellPrepared: "onCellPrepared", onContentReady: "onContentReady", onEditorPreparing: "onEditorPreparing", onRowClick: "onRowClick", onRowDblClick: "onRowDblClick", onSelectionChanged: "onSelectionChanged" }, providers: [DataGridService], queries: [{ propertyName: "rowButtonsTemplate", first: true, predicate: RowButtonsTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "dxDataGrid", first: true, predicate: DxDataGridComponent, descendants: true, static: true }], ngImport: i0, template: "<dx-data-grid [showBorders]=\"true\"\r\n [showRowLines]=\"true\"\r\n [hoverStateEnabled]=\"true\"\r\n [rowAlternationEnabled]=\"true\"\r\n [columnAutoWidth]=\"true\"\r\n [allowColumnResizing]=\"true\"\r\n columnResizingMode=\"widget\"\r\n dateSerializationFormat=\"yyyy/MM/dd HH:mm:ss\"\r\n [syncLookupFilterValues]=\"false\"\r\n [dataSource]=\"dataSource\"\r\n [columns]=\"columns\"\r\n [height]=\"height\"\r\n [keyExpr]=\"keyExpr\"\r\n [selectedRowKeys]=\"selectedRowKeys\"\r\n (selectedRowKeysChange)=\"selectedRowKeysChange.emit($event)\"\r\n (onCellPrepared)=\"onCellPrepared.emit($event)\"\r\n (onContentReady)=\"onContentReady.emit($event)\"\r\n (onEditorPreparing)=\"onDxDataGridEditorPreparing($event)\"\r\n (onRowClick)=\"onRowClick.emit($event)\"\r\n (onRowDblClick)=\"onRowDblClick.emit($event)\"\r\n (onSelectionChanged)=\"onSelectionChanged.emit($event)\">\r\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\r\n <dxo-selection [mode]=\"selectionMode\" selectAllMode=\"page\" showCheckBoxesMode=\"always\"></dxo-selection>\r\n <dxo-header-filter [visible]=\"!onlyFrontEnd\">\r\n <dxo-search [enabled]=\"true\"></dxo-search>\r\n <dxo-texts [ok]=\"'\u786E\u5B9A'\"></dxo-texts>\r\n </dxo-header-filter>\r\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\r\n <dxo-remote-operations [filtering]=\"true\"\r\n [sorting]=\"true\"\r\n [paging]=\"true\">\r\n </dxo-remote-operations>\r\n <dxo-paging [pageSize]=\"15\"></dxo-paging>\r\n <dxo-pager [visible]=\"true\"\r\n [showInfo]=\"true\"\r\n infoText=\"\u7B2C{0}\u9875\uFF0C\u5171{1}\u9875\uFF08\u5171{2}\u4E2A\u9879\u76EE\uFF09\"\r\n [showPageSizeSelector]=\"true\"\r\n [allowedPageSizes]=\"[15, 30, 50]\"\r\n ></dxo-pager>\r\n <dxo-scrolling showScrollbar=\"always\"></dxo-scrolling>\r\n <div *dxTemplate=\"let cellInfo of 'rowIndexTemplate'\">\r\n {{ cellInfo.rowIndex + 1 }}\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'instanceLinkTemplate'\">\r\n <rs-instance-link-template [tenant]=\"tenant\"\r\n [className]=\"className\"\r\n [oid]=\"cellInfo.data.oid\"\r\n [instanceLinkType]=\"instanceLinkType\"\r\n [drawerViewContainerRef]=\"drawerInstanceLinkViewContainerRef\"\r\n [drawerFormTemplate]=\"drawerInstanceLinkFormTemplate\">\r\n </rs-instance-link-template>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'rowButtonsTemplate'\">\r\n <ng-container [ngTemplateOutlet]=\"rowButtonsTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{$implicit: cellInfo, cellTemplateLoaded$: service.cellTemplateLoaded$}\"></ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'multipleValueCellTemplate'\">\r\n <div [innerHTML]=\"convertMultipleValueCellText(cellInfo)\"></div>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'textCellTemplate'\">\r\n <div #textDiv style=\"text-overflow: ellipsis; overflow: hidden; cursor: pointer;\">{{ cellInfo.value }}</div>\r\n <dx-tooltip [target]=\"textDiv\"\r\n [position]=\"'top'\"\r\n [showEvent]=\"'click'\">\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <p style=\"max-width: 320px; text-align: left; white-space: normal;\" [innerText]=\"cellInfo.value\"></p>\r\n </div>\r\n </dx-tooltip>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'fileCellTemplate'\">\r\n <ng-container *ngFor=\"let file of cellInfo.value\">\r\n <rs-file-cell-template [file]=\"file\"></rs-file-cell-template>\r\n </ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'userCellTemplate'\">\r\n <ng-container *ngFor=\"let user of getOriginalValue(cellInfo, 'userInfo')\">\r\n <rs-user-info-template [uid]=\"user\" [cellInfo]=\"cellInfo\"></rs-user-info-template>\r\n </ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'unitCellTemplate'\">\r\n <ng-container *ngFor=\"let unit of getOriginalValue(cellInfo, 'unitInfo')\">\r\n <rs-unit-info-template [uid]=\"unit\" [cellInfo]=\"cellInfo\"></rs-unit-info-template>\r\n </ng-container>\r\n </div>\r\n</dx-data-grid>\r\n", styles: [":host{display:flex;flex-flow:column nowrap}:host dx-data-grid{flex:auto;height:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i5$1.DxDataGridComponent, selector: "dx-data-grid", inputs: ["accessKey", "activeStateEnabled", "allowColumnReordering", "allowColumnResizing", "autoNavigateToFocusedRow", "cacheEnabled", "cellHintEnabled", "columnAutoWidth", "columnChooser", "columnFixing", "columnHidingEnabled", "columnMinWidth", "columnResizingMode", "columns", "columnWidth", "customizeColumns", "dataRowTemplate", "dataSource", "dateSerializationFormat", "disabled", "editing", "elementAttr", "errorRowEnabled", "export", "filterBuilder", "filterBuilderPopup", "filterPanel", "filterRow", "filterSyncEnabled", "filterValue", "focusedColumnIndex", "focusedRowEnabled", "focusedRowIndex", "focusedRowKey", "grouping", "groupPanel", "headerFilter", "height", "highlightChanges", "hint", "hoverStateEnabled", "keyboardNavigation", "keyExpr", "loadPanel", "masterDetail", "noDataText", "pager", "paging", "remoteOperations", "renderAsync", "repaintChangesOnly", "rowAlternationEnabled", "rowDragging", "rowTemplate", "rtlEnabled", "scrolling", "searchPanel", "selectedRowKeys", "selection", "selectionFilter", "showBorders", "showColumnHeaders", "showColumnLines", "showRowLines", "sortByGroupSummaryInfo", "sorting", "stateStoring", "summary", "syncLookupFilterValues", "tabIndex", "toolbar", "twoWayBindingEnabled", "visible", "width", "wordWrapEnabled"], outputs: ["onAdaptiveDetailRowPreparing", "onCellClick", "onCellDblClick", "onCellHoverChanged", "onCellPrepared", "onContentReady", "onContextMenuPreparing", "onDataErrorOccurred", "onDisposing", "onEditCanceled", "onEditCanceling", "onEditingStart", "onEditorPrepared", "onEditorPreparing", "onExporting", "onFocusedCellChanged", "onFocusedCellChanging", "onFocusedRowChanged", "onFocusedRowChanging", "onInitialized", "onInitNewRow", "onKeyDown", "onOptionChanged", "onRowClick", "onRowCollapsed", "onRowCollapsing", "onRowDblClick", "onRowExpanded", "onRowExpanding", "onRowInserted", "onRowInserting", "onRowPrepared", "onRowRemoved", "onRowRemoving", "onRowUpdated", "onRowUpdating", "onRowValidating", "onSaved", "onSaving", "onSelectionChanged", "onToolbarPreparing", "accessKeyChange", "activeStateEnabledChange", "allowColumnReorderingChange", "allowColumnResizingChange", "autoNavigateToFocusedRowChange", "cacheEnabledChange", "cellHintEnabledChange", "columnAutoWidthChange", "columnChooserChange", "columnFixingChange", "columnHidingEnabledChange", "columnMinWidthChange", "columnResizingModeChange", "columnsChange", "columnWidthChange", "customizeColumnsChange", "dataRowTemplateChange", "dataSourceChange", "dateSerializationFormatChange", "disabledChange", "editingChange", "elementAttrChange", "errorRowEnabledChange", "exportChange", "filterBuilderChange", "filterBuilderPopupChange", "filterPanelChange", "filterRowChange", "filterSyncEnabledChange", "filterValueChange", "focusedColumnIndexChange", "focusedRowEnabledChange", "focusedRowIndexChange", "focusedRowKeyChange", "groupingChange", "groupPanelChange", "headerFilterChange", "heightChange", "highlightChangesChange", "hintChange", "hoverStateEnabledChange", "keyboardNavigationChange", "keyExprChange", "loadPanelChange", "masterDetailChange", "noDataTextChange", "pagerChange", "pagingChange", "remoteOperationsChange", "renderAsyncChange", "repaintChangesOnlyChange", "rowAlternationEnabledChange", "rowDraggingChange", "rowTemplateChange", "rtlEnabledChange", "scrollingChange", "searchPanelChange", "selectedRowKeysChange", "selectionChange", "selectionFilterChange", "showBordersChange", "showColumnHeadersChange", "showColumnLinesChange", "showRowLinesChange", "sortByGroupSummaryInfoChange", "sortingChange", "stateStoringChange", "summaryChange", "syncLookupFilterValuesChange", "tabIndexChange", "toolbarChange", "twoWayBindingEnabledChange", "visibleChange", "widthChange", "wordWrapEnabledChange"] }, { kind: "component", type: i6$1.DxoSearchComponent, selector: "dxo-search", inputs: ["editorOptions", "enabled", "timeout", "mode", "searchExpr"] }, { kind: "component", type: i6$1.DxoSelectionComponent, selector: "dxo-selection", inputs: ["allowSelectAll", "recursive", "selectByClick", "deferred", "mode", "selectAllMode", "showCheckBoxesMode"] }, { kind: "component", type: i6$1.DxoTextsComponent, selector: "dxo-texts", inputs: ["fix", "leftPosition", "rightPosition", "unfix", "addRow", "cancelAllChanges", "cancelRowChanges", "confirmDeleteMessage", "confirmDeleteTitle", "deleteRow", "editRow", "saveAllChanges", "saveRowChanges", "undeleteRow", "validationCancelChanges", "exportAll", "exportSelectedRows", "exportTo", "clearFilter", "createFilter", "filterEnabledHint", "groupByThisColumn", "groupContinuedMessage", "groupContinuesMessage", "ungroup", "ungroupAll", "cancel", "emptyValue", "ok", "avg", "avgOtherColumn", "count", "max", "maxOtherColumn", "min", "minOtherColumn", "sum", "sumOtherColumn", "allFields", "columnFields", "dataFields", "filterFields", "rowFields", "columnFieldArea", "dataFieldArea", "filterFieldArea", "rowFieldArea", "collapseAll", "dataNotAvailable", "expandAll", "exportToExcel", "grandTotal", "noData", "removeAllSorting", "showFieldChooser", "sortColumnBySummary", "sortRowBySummary", "total", "addRowToNode"] }, { kind: "component", type: i6$1.DxoHeaderFilterComponent, selector: "dxo-header-filter", inputs: ["allowSearch", "allowSelectAll", "dataSource", "groupInterval", "height", "search", "searchMode", "width", "searchTimeout", "texts", "visible", "showRelevantValues"] }, { kind: "component", type: i6$1.DxoFilterRowComponent, selector: "dxo-filter-row", inputs: ["applyFilter", "applyFilterText", "betweenEndText", "betweenStartText", "operationDescriptions", "resetOperationText", "showAllText", "showOperationChooser", "visible"] }, { kind: "component", type: i6$1.DxoPagerComponent, selector: "dxo-pager", inputs: ["allowedPageSizes", "displayMode", "infoText", "label", "showInfo", "showNavigationButtons", "showPageSizeSelector", "visible"] }, { kind: "component", type: i6$1.DxoPagingComponent, selector: "dxo-paging", inputs: ["enabled", "pageIndex", "pageSize"], outputs: ["pageIndexChange", "pageSizeChange"] }, { kind: "component", type: i6$1.DxoRemoteOperationsComponent, selector: "dxo-remote-operations", inputs: ["filtering", "grouping", "groupPaging", "paging", "sorting", "summary"] }, { kind: "component", type: i6$1.DxoScrollingComponent, selector: "dxo-scrolling", inputs: ["columnRenderingMode", "mode", "preloadEnabled", "renderAsync", "rowRenderingMode", "scrollByContent", "scrollByThumb", "showScrollbar", "useNative"] }, { kind: "component", type: i6$1.DxoSortingComponent, selector: "dxo-sorting", inputs: ["ascendingText", "clearText", "descendingText", "mode", "showSortIndexes"] }, { kind: "component", type: i5.DxTooltipComponent, selector: "dx-tooltip", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showEvent", "target", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showEventChange", "targetChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: FileCellTemplateComponent, selector: "rs-file-cell-template", inputs: ["file"] }, { kind: "component", type: InstanceLinkTemplateComponent, selector: "rs-instance-link-template", inputs: ["tenant", "className", "oid", "instanceLinkType", "drawerViewContainerRef", "drawerFormTemplate"] }, { kind: "component", type: UnitInfoTemplateComponent, selector: "rs-unit-info-template", inputs: ["uid", "cellInfo"] }, { kind: "component", type: UserInfoTemplateComponent, selector: "rs-user-info-template", inputs: ["uid", "cellInfo"] }] });
|
|
3229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridComponent, decorators: [{
|
|
3097
3230
|
type: Component,
|
|
3098
|
-
args: [{ selector: 'rs-
|
|
3099
|
-
}], ctorParameters: function () { return [{ type:
|
|
3231
|
+
args: [{ selector: 'rs-data-grid', providers: [DataGridService], template: "<dx-data-grid [showBorders]=\"true\"\r\n [showRowLines]=\"true\"\r\n [hoverStateEnabled]=\"true\"\r\n [rowAlternationEnabled]=\"true\"\r\n [columnAutoWidth]=\"true\"\r\n [allowColumnResizing]=\"true\"\r\n columnResizingMode=\"widget\"\r\n dateSerializationFormat=\"yyyy/MM/dd HH:mm:ss\"\r\n [syncLookupFilterValues]=\"false\"\r\n [dataSource]=\"dataSource\"\r\n [columns]=\"columns\"\r\n [height]=\"height\"\r\n [keyExpr]=\"keyExpr\"\r\n [selectedRowKeys]=\"selectedRowKeys\"\r\n (selectedRowKeysChange)=\"selectedRowKeysChange.emit($event)\"\r\n (onCellPrepared)=\"onCellPrepared.emit($event)\"\r\n (onContentReady)=\"onContentReady.emit($event)\"\r\n (onEditorPreparing)=\"onDxDataGridEditorPreparing($event)\"\r\n (onRowClick)=\"onRowClick.emit($event)\"\r\n (onRowDblClick)=\"onRowDblClick.emit($event)\"\r\n (onSelectionChanged)=\"onSelectionChanged.emit($event)\">\r\n <dxo-sorting mode=\"multiple\"></dxo-sorting>\r\n <dxo-selection [mode]=\"selectionMode\" selectAllMode=\"page\" showCheckBoxesMode=\"always\"></dxo-selection>\r\n <dxo-header-filter [visible]=\"!onlyFrontEnd\">\r\n <dxo-search [enabled]=\"true\"></dxo-search>\r\n <dxo-texts [ok]=\"'\u786E\u5B9A'\"></dxo-texts>\r\n </dxo-header-filter>\r\n <dxo-filter-row [visible]=\"true\"></dxo-filter-row>\r\n <dxo-remote-operations [filtering]=\"true\"\r\n [sorting]=\"true\"\r\n [paging]=\"true\">\r\n </dxo-remote-operations>\r\n <dxo-paging [pageSize]=\"15\"></dxo-paging>\r\n <dxo-pager [visible]=\"true\"\r\n [showInfo]=\"true\"\r\n infoText=\"\u7B2C{0}\u9875\uFF0C\u5171{1}\u9875\uFF08\u5171{2}\u4E2A\u9879\u76EE\uFF09\"\r\n [showPageSizeSelector]=\"true\"\r\n [allowedPageSizes]=\"[15, 30, 50]\"\r\n ></dxo-pager>\r\n <dxo-scrolling showScrollbar=\"always\"></dxo-scrolling>\r\n <div *dxTemplate=\"let cellInfo of 'rowIndexTemplate'\">\r\n {{ cellInfo.rowIndex + 1 }}\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'instanceLinkTemplate'\">\r\n <rs-instance-link-template [tenant]=\"tenant\"\r\n [className]=\"className\"\r\n [oid]=\"cellInfo.data.oid\"\r\n [instanceLinkType]=\"instanceLinkType\"\r\n [drawerViewContainerRef]=\"drawerInstanceLinkViewContainerRef\"\r\n [drawerFormTemplate]=\"drawerInstanceLinkFormTemplate\">\r\n </rs-instance-link-template>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'rowButtonsTemplate'\">\r\n <ng-container [ngTemplateOutlet]=\"rowButtonsTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{$implicit: cellInfo, cellTemplateLoaded$: service.cellTemplateLoaded$}\"></ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'multipleValueCellTemplate'\">\r\n <div [innerHTML]=\"convertMultipleValueCellText(cellInfo)\"></div>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'textCellTemplate'\">\r\n <div #textDiv style=\"text-overflow: ellipsis; overflow: hidden; cursor: pointer;\">{{ cellInfo.value }}</div>\r\n <dx-tooltip [target]=\"textDiv\"\r\n [position]=\"'top'\"\r\n [showEvent]=\"'click'\">\r\n <div *dxTemplate=\"let data of 'content'\">\r\n <p style=\"max-width: 320px; text-align: left; white-space: normal;\" [innerText]=\"cellInfo.value\"></p>\r\n </div>\r\n </dx-tooltip>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'fileCellTemplate'\">\r\n <ng-container *ngFor=\"let file of cellInfo.value\">\r\n <rs-file-cell-template [file]=\"file\"></rs-file-cell-template>\r\n </ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'userCellTemplate'\">\r\n <ng-container *ngFor=\"let user of getOriginalValue(cellInfo, 'userInfo')\">\r\n <rs-user-info-template [uid]=\"user\" [cellInfo]=\"cellInfo\"></rs-user-info-template>\r\n </ng-container>\r\n </div>\r\n <div *dxTemplate=\"let cellInfo of 'unitCellTemplate'\">\r\n <ng-container *ngFor=\"let unit of getOriginalValue(cellInfo, 'unitInfo')\">\r\n <rs-unit-info-template [uid]=\"unit\" [cellInfo]=\"cellInfo\"></rs-unit-info-template>\r\n </ng-container>\r\n </div>\r\n</dx-data-grid>\r\n", styles: [":host{display:flex;flex-flow:column nowrap}:host dx-data-grid{flex:auto;height:0}\n"] }]
|
|
3232
|
+
}], ctorParameters: function () { return [{ type: DataGridFactory }, { type: DataGridService }, { type: i0.ViewContainerRef }]; }, propDecorators: { tenant: [{
|
|
3100
3233
|
type: Input
|
|
3101
3234
|
}], className: [{
|
|
3102
3235
|
type: Input
|
|
3103
|
-
}],
|
|
3104
|
-
type: Input
|
|
3105
|
-
}], copyOid: [{
|
|
3236
|
+
}], view: [{
|
|
3106
3237
|
type: Input
|
|
3107
|
-
}],
|
|
3238
|
+
}], filter: [{
|
|
3108
3239
|
type: Input
|
|
3109
|
-
}],
|
|
3240
|
+
}], customColumnFn: [{
|
|
3110
3241
|
type: Input
|
|
3111
|
-
}],
|
|
3242
|
+
}], keyExpr: [{
|
|
3112
3243
|
type: Input
|
|
3113
|
-
}],
|
|
3244
|
+
}], dataGridName: [{
|
|
3114
3245
|
type: Input
|
|
3115
|
-
}],
|
|
3246
|
+
}], height: [{
|
|
3116
3247
|
type: Input
|
|
3117
3248
|
}], onlyFrontEnd: [{
|
|
3118
3249
|
type: Input
|
|
3119
|
-
}],
|
|
3250
|
+
}], dataSource: [{
|
|
3120
3251
|
type: Input
|
|
3121
|
-
}],
|
|
3252
|
+
}], selectionMode: [{
|
|
3122
3253
|
type: Input
|
|
3123
|
-
}],
|
|
3124
|
-
type:
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
}],
|
|
3254
|
+
}], selectedRowKeys: [{
|
|
3255
|
+
type: Input
|
|
3256
|
+
}], selectedRowKeysChange: [{
|
|
3257
|
+
type: Output
|
|
3258
|
+
}], showRowNum: [{
|
|
3259
|
+
type: Input
|
|
3260
|
+
}], instanceLinkType: [{
|
|
3261
|
+
type: Input
|
|
3262
|
+
}], drawerInstanceLinkViewContainerRef: [{
|
|
3263
|
+
type: Input
|
|
3264
|
+
}], drawerInstanceLinkFormTemplate: [{
|
|
3265
|
+
type: Input
|
|
3266
|
+
}], onCellPrepared: [{
|
|
3267
|
+
type: Output
|
|
3268
|
+
}], onContentReady: [{
|
|
3130
3269
|
type: Output
|
|
3270
|
+
}], onEditorPreparing: [{
|
|
3271
|
+
type: Output
|
|
3272
|
+
}], onRowClick: [{
|
|
3273
|
+
type: Output
|
|
3274
|
+
}], onRowDblClick: [{
|
|
3275
|
+
type: Output
|
|
3276
|
+
}], onSelectionChanged: [{
|
|
3277
|
+
type: Output
|
|
3278
|
+
}], dxDataGrid: [{
|
|
3279
|
+
type: ViewChild,
|
|
3280
|
+
args: [DxDataGridComponent, { static: true }]
|
|
3281
|
+
}], rowButtonsTemplate: [{
|
|
3282
|
+
type: ContentChild,
|
|
3283
|
+
args: [RowButtonsTemplateDirective]
|
|
3131
3284
|
}] } });
|
|
3132
3285
|
|
|
3133
|
-
class DataDetailComponent {
|
|
3134
|
-
constructor(viewContainerRef, service) {
|
|
3135
|
-
this.viewContainerRef = viewContainerRef;
|
|
3136
|
-
this.service = service;
|
|
3137
|
-
this.sections = [];
|
|
3138
|
-
this.loading = false;
|
|
3139
|
-
}
|
|
3140
|
-
ngOnInit() {
|
|
3141
|
-
this.loading = true;
|
|
3142
|
-
this.service.getSectionList(this.tenant, this.className, this.oid).subscribe(response => {
|
|
3143
|
-
this.sections = response.data.list;
|
|
3144
|
-
this.loading = false;
|
|
3145
|
-
});
|
|
3146
|
-
}
|
|
3147
|
-
}
|
|
3148
|
-
DataDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailComponent, deps: [{ token: i0.ViewContainerRef }, { token: DataDetailService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3149
|
-
DataDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DataDetailComponent, selector: "coast-data-detail", providers: [DataDetailService], ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\n [visible]=\"loading\">\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\n</dx-load-panel>\n<div *ngIf=\"!loading && sections.length === 0\" class=\"empty\">\n <span>\u60A8\u65E0\u6743\u67E5\u770B\u8BE5\u6570\u636E\u5B9E\u4F8B\u4EFB\u4F55\u4FE1\u606F</span>\n</div>\n<ng-container *ngIf=\"sections.length > 0\">\n <dx-accordion [collapsible]=\"true\" [multiple]=\"true\" [deferRendering]=\"false\" [dataSource]=\"sections\"\n [selectedItems]=\"sections\">\n <div *dxTemplate=\"let section of 'title'\" class=\"section-title\">\n <div class=\"section-title-name\">{{ section.name }}</div>\n </div>\n <div *dxTemplate=\"let section of 'item'\">\n <rs-form [tenant]=\"tenant\" [className]=\"className\" [oid]=\"oid\" [template]=\"section.formTemplate\" [params]=\"params\"\n [tabViewContainerRef]=\"tabViewContainerRef\" [readonly]=\"true\"></rs-form>\n </div>\n </dx-accordion>\n</ng-container>\n", styles: [":host{flex:1;padding:24px;display:flex;flex-flow:column nowrap}:host div.empty{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div.empty span{text-align:center;-webkit-user-select:none;user-select:none}:host .section-title{border-bottom:1px solid var(--coast-border-color, #dddddd)}:host .section-title .section-title-name{height:24px;font-size:14px;font-weight:700;padding:4px 8px;display:flex;flex-flow:column nowrap;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.DxAccordionComponent, selector: "dx-accordion", inputs: ["accessKey", "activeStateEnabled", "animationDuration", "collapsible", "dataSource", "deferRendering", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "itemHoldTimeout", "items", "itemTemplate", "itemTitleTemplate", "keyExpr", "multiple", "noDataText", "repaintChangesOnly", "rtlEnabled", "selectedIndex", "selectedItem", "selectedItemKeys", "selectedItems", "tabIndex", "visible", "width"], outputs: ["onContentReady", "onDisposing", "onInitialized", "onItemClick", "onItemContextMenu", "onItemHold", "onItemRendered", "onItemTitleClick", "onOptionChanged", "onSelectionChanged", "accessKeyChange", "activeStateEnabledChange", "animationDurationChange", "collapsibleChange", "dataSourceChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "itemHoldTimeoutChange", "itemsChange", "itemTemplateChange", "itemTitleTemplateChange", "keyExprChange", "multipleChange", "noDataTextChange", "repaintChangesOnlyChange", "rtlEnabledChange", "selectedIndexChange", "selectedItemChange", "selectedItemKeysChange", "selectedItemsChange", "tabIndexChange", "visibleChange", "widthChange"] }, { kind: "directive", type: i3.DxTemplateDirective, selector: "[dxTemplate]", inputs: ["dxTemplateOf"] }, { kind: "component", type: i6$1.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i6.DxLoadPanelComponent, selector: "dx-load-panel", inputs: ["animation", "closeOnOutsideClick", "container", "copyRootClassesToWrapper", "deferRendering", "delay", "elementAttr", "focusStateEnabled", "height", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "indicatorSrc", "maxHeight", "maxWidth", "message", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showIndicator", "showPane", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "animationChange", "closeOnOutsideClickChange", "containerChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "delayChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "indicatorSrcChange", "maxHeightChange", "maxWidthChange", "messageChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showIndicatorChange", "showPaneChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: FormComponent, selector: "rs-form", inputs: ["tenant", "className", "oid", "copyOid", "template", "extraAttrMap", "opener", "params", "tabViewContainerRef", "onlyFrontEnd", "model", "readonly"], outputs: ["submitCallback"] }] });
|
|
3150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailComponent, decorators: [{
|
|
3151
|
-
type: Component,
|
|
3152
|
-
args: [{ selector: 'coast-data-detail', providers: [DataDetailService], template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\"\n [visible]=\"loading\">\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\n</dx-load-panel>\n<div *ngIf=\"!loading && sections.length === 0\" class=\"empty\">\n <span>\u60A8\u65E0\u6743\u67E5\u770B\u8BE5\u6570\u636E\u5B9E\u4F8B\u4EFB\u4F55\u4FE1\u606F</span>\n</div>\n<ng-container *ngIf=\"sections.length > 0\">\n <dx-accordion [collapsible]=\"true\" [multiple]=\"true\" [deferRendering]=\"false\" [dataSource]=\"sections\"\n [selectedItems]=\"sections\">\n <div *dxTemplate=\"let section of 'title'\" class=\"section-title\">\n <div class=\"section-title-name\">{{ section.name }}</div>\n </div>\n <div *dxTemplate=\"let section of 'item'\">\n <rs-form [tenant]=\"tenant\" [className]=\"className\" [oid]=\"oid\" [template]=\"section.formTemplate\" [params]=\"params\"\n [tabViewContainerRef]=\"tabViewContainerRef\" [readonly]=\"true\"></rs-form>\n </div>\n </dx-accordion>\n</ng-container>\n", styles: [":host{flex:1;padding:24px;display:flex;flex-flow:column nowrap}:host div.empty{flex:1;padding:16px;display:flex;flex-flow:row nowrap;justify-content:center;align-items:center}:host div.empty span{text-align:center;-webkit-user-select:none;user-select:none}:host .section-title{border-bottom:1px solid var(--coast-border-color, #dddddd)}:host .section-title .section-title-name{height:24px;font-size:14px;font-weight:700;padding:4px 8px;display:flex;flex-flow:column nowrap;justify-content:center}\n"] }]
|
|
3153
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: DataDetailService }]; } });
|
|
3154
|
-
|
|
3155
3286
|
class FormModule {
|
|
3156
3287
|
}
|
|
3157
3288
|
FormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -3178,6 +3309,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
3178
3309
|
}]
|
|
3179
3310
|
}] });
|
|
3180
3311
|
|
|
3312
|
+
class DataGridModule {
|
|
3313
|
+
}
|
|
3314
|
+
DataGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3315
|
+
DataGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, declarations: [DataGridComponent,
|
|
3316
|
+
FileCellTemplateComponent,
|
|
3317
|
+
InstanceLinkTemplateComponent,
|
|
3318
|
+
UnitInfoTemplateComponent,
|
|
3319
|
+
UserInfoTemplateComponent,
|
|
3320
|
+
RowButtonsTemplateDirective], imports: [CommonModule,
|
|
3321
|
+
DevExtremeModule,
|
|
3322
|
+
FormModule], exports: [DataGridComponent,
|
|
3323
|
+
RowButtonsTemplateDirective] });
|
|
3324
|
+
DataGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, imports: [CommonModule,
|
|
3325
|
+
DevExtremeModule,
|
|
3326
|
+
FormModule] });
|
|
3327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataGridModule, decorators: [{
|
|
3328
|
+
type: NgModule,
|
|
3329
|
+
args: [{
|
|
3330
|
+
declarations: [
|
|
3331
|
+
DataGridComponent,
|
|
3332
|
+
FileCellTemplateComponent,
|
|
3333
|
+
InstanceLinkTemplateComponent,
|
|
3334
|
+
UnitInfoTemplateComponent,
|
|
3335
|
+
UserInfoTemplateComponent,
|
|
3336
|
+
RowButtonsTemplateDirective
|
|
3337
|
+
],
|
|
3338
|
+
imports: [
|
|
3339
|
+
CommonModule,
|
|
3340
|
+
DevExtremeModule,
|
|
3341
|
+
FormModule
|
|
3342
|
+
],
|
|
3343
|
+
exports: [
|
|
3344
|
+
DataGridComponent,
|
|
3345
|
+
RowButtonsTemplateDirective
|
|
3346
|
+
]
|
|
3347
|
+
}]
|
|
3348
|
+
}] });
|
|
3349
|
+
|
|
3181
3350
|
class DataDetailModule {
|
|
3182
3351
|
}
|
|
3183
3352
|
DataDetailModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DataDetailModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -3204,49 +3373,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
3204
3373
|
}]
|
|
3205
3374
|
}] });
|
|
3206
3375
|
|
|
3207
|
-
class DrawerComponent {
|
|
3208
|
-
constructor(elementRef) {
|
|
3209
|
-
this.elementRef = elementRef;
|
|
3210
|
-
this.size = 'default';
|
|
3211
|
-
this._width = '480px';
|
|
3212
|
-
}
|
|
3213
|
-
ngOnInit() {
|
|
3214
|
-
if (this.size === 'large') {
|
|
3215
|
-
this._width = '960px';
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
show() {
|
|
3219
|
-
// 若存在多层抽屉,仅保留最上层遮罩颜色,下层遮罩设置为透明
|
|
3220
|
-
const nodeName = this.elementRef.nativeElement.nodeName;
|
|
3221
|
-
const drawers = this._parentViewContainerRef.element.nativeElement.parentElement.querySelectorAll(nodeName);
|
|
3222
|
-
for (let i = 0; i < drawers.length; i++) {
|
|
3223
|
-
if (i === drawers.length - 1) {
|
|
3224
|
-
drawers[i].querySelector('.drawer-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
|
|
3225
|
-
}
|
|
3226
|
-
else {
|
|
3227
|
-
drawers[i].querySelector('.drawer-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0)';
|
|
3228
|
-
}
|
|
3229
|
-
}
|
|
3230
|
-
}
|
|
3231
|
-
hide($event, backdrop) {
|
|
3232
|
-
// 在service中重写
|
|
3233
|
-
}
|
|
3234
|
-
ngOnDestroy() {
|
|
3235
|
-
// 若存在多层抽屉,下一层遮罩设置为不透明
|
|
3236
|
-
const nodeName = this.elementRef.nativeElement.nodeName;
|
|
3237
|
-
const nextDrawer = this._parentViewContainerRef.element.nativeElement.parentElement.querySelector(nodeName + ':nth-last-child(2)');
|
|
3238
|
-
if (nextDrawer) {
|
|
3239
|
-
nextDrawer.querySelector('.drawer-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0.05)';
|
|
3240
|
-
}
|
|
3241
|
-
}
|
|
3242
|
-
}
|
|
3243
|
-
DrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3244
|
-
DrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: DrawerComponent, selector: "rs-drawer", ngImport: i0, template: "<div #drawerBackdrop class=\"drawer-backdrop\" (click)=\"hide($event, drawerBackdrop)\">\n <div class=\"drawer\" [ngStyle]=\"{width: _width}\">\n <div *ngIf=\"headerTemplate\" class=\"drawer-header\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: headerTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-close\">\n <dx-button height=\"40px\" icon=\"coast-icon coast-icon-arrow-right-filling\" (onClick)=\"hide($event)\"></dx-button>\n </div>\n </div>\n</div>\n", styles: [":host .drawer-backdrop{position:absolute;inset:0;z-index:calc(var(--coast-z-index-drawer, 1040) - 1)}:host .drawer-backdrop .drawer{position:absolute;right:0;height:100%;z-index:var(--coast-z-index-drawer, 1040);background-color:var(--coast-base-bg-color, #fff);display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-header{flex:0 0 36px;padding:8px;border-bottom:1px solid var(--coast-border-color, #dddddd);display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-end}:host .drawer-backdrop .drawer .drawer-content{flex:1;overflow:auto;display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-close{position:absolute;height:100%;width:20px;top:0;left:-20px;display:flex;flex-flow:row nowrap;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.DxButtonComponent, selector: "dx-button", inputs: ["accessKey", "activeStateEnabled", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "icon", "rtlEnabled", "stylingMode", "tabIndex", "template", "text", "type", "useSubmitBehavior", "validationGroup", "visible", "width"], outputs: ["onClick", "onContentReady", "onDisposing", "onInitialized", "onOptionChanged", "accessKeyChange", "activeStateEnabledChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "iconChange", "rtlEnabledChange", "stylingModeChange", "tabIndexChange", "templateChange", "textChange", "typeChange", "useSubmitBehaviorChange", "validationGroupChange", "visibleChange", "widthChange"] }] });
|
|
3245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
3246
|
-
type: Component,
|
|
3247
|
-
args: [{ selector: 'rs-drawer', template: "<div #drawerBackdrop class=\"drawer-backdrop\" (click)=\"hide($event, drawerBackdrop)\">\n <div class=\"drawer\" [ngStyle]=\"{width: _width}\">\n <div *ngIf=\"headerTemplate\" class=\"drawer-header\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: headerTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-content\">\n <ng-template [ngTemplateOutlet]=\"contentTemplate\"\n [ngTemplateOutletContext]=\"{$implicit: contentTemplateContext}\"></ng-template>\n </div>\n <div class=\"drawer-close\">\n <dx-button height=\"40px\" icon=\"coast-icon coast-icon-arrow-right-filling\" (onClick)=\"hide($event)\"></dx-button>\n </div>\n </div>\n</div>\n", styles: [":host .drawer-backdrop{position:absolute;inset:0;z-index:calc(var(--coast-z-index-drawer, 1040) - 1)}:host .drawer-backdrop .drawer{position:absolute;right:0;height:100%;z-index:var(--coast-z-index-drawer, 1040);background-color:var(--coast-base-bg-color, #fff);display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-header{flex:0 0 36px;padding:8px;border-bottom:1px solid var(--coast-border-color, #dddddd);display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-end}:host .drawer-backdrop .drawer .drawer-content{flex:1;overflow:auto;display:flex;flex-flow:column nowrap}:host .drawer-backdrop .drawer .drawer-close{position:absolute;height:100%;width:20px;top:0;left:-20px;display:flex;flex-flow:row nowrap;align-items:center}\n"] }]
|
|
3248
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
3249
|
-
|
|
3250
3376
|
class DrawerModule {
|
|
3251
3377
|
}
|
|
3252
3378
|
DrawerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -3267,35 +3393,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
3267
3393
|
}]
|
|
3268
3394
|
}] });
|
|
3269
3395
|
|
|
3270
|
-
class DrawerService {
|
|
3271
|
-
constructor() {
|
|
3272
|
-
}
|
|
3273
|
-
open(viewContainerRef, size = 'default', contentTemplate, contentTemplateContext, headerTemplate, headerTemplateContext) {
|
|
3274
|
-
const drawerRef = viewContainerRef.createComponent(DrawerComponent);
|
|
3275
|
-
drawerRef.instance.hide = ($event, backdrop) => {
|
|
3276
|
-
if ($event.target === backdrop) {
|
|
3277
|
-
drawerRef.hostView.destroy();
|
|
3278
|
-
}
|
|
3279
|
-
};
|
|
3280
|
-
drawerRef.instance.size = size;
|
|
3281
|
-
drawerRef.instance.headerTemplate = headerTemplate;
|
|
3282
|
-
drawerRef.instance.headerTemplateContext = headerTemplateContext;
|
|
3283
|
-
drawerRef.instance.contentTemplate = contentTemplate;
|
|
3284
|
-
drawerRef.instance.contentTemplateContext = contentTemplateContext;
|
|
3285
|
-
drawerRef.instance._parentViewContainerRef = viewContainerRef;
|
|
3286
|
-
drawerRef.instance.show();
|
|
3287
|
-
return drawerRef.instance;
|
|
3288
|
-
}
|
|
3289
|
-
}
|
|
3290
|
-
DrawerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3291
|
-
DrawerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerService, providedIn: 'root' });
|
|
3292
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: DrawerService, decorators: [{
|
|
3293
|
-
type: Injectable,
|
|
3294
|
-
args: [{
|
|
3295
|
-
providedIn: 'root'
|
|
3296
|
-
}]
|
|
3297
|
-
}], ctorParameters: function () { return []; } });
|
|
3298
|
-
|
|
3299
3396
|
class TooltipContentTemplateDirective {
|
|
3300
3397
|
constructor(templateRef) {
|
|
3301
3398
|
this.templateRef = templateRef;
|
|
@@ -3908,5 +4005,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
3908
4005
|
* Generated bundle index. Do not edit.
|
|
3909
4006
|
*/
|
|
3910
4007
|
|
|
3911
|
-
export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, ChangeFilter, CodeEditorComponent, CodeEditorModule, DataDetailComponent, DataDetailModule, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DynamicParamsComponent, DynamicParamsModule, FormComponent, FormModule, FormService, FullscreenDirective, IconSelectorComponent, IconSelectorModule,
|
|
4008
|
+
export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, ChangeFilter, CodeEditorComponent, CodeEditorModule, DataDetailComponent, DataDetailModule, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DynamicParamsComponent, DynamicParamsModule, FormComponent, FormModule, FormService, FullscreenDirective, IconSelectorComponent, IconSelectorModule, ItemConfigComponent, ItemStyleComponent, ModalComponent, ModalModule, ModalService, PdfViewerComponent, PluginManager, RowButtonsTemplateDirective, TooltipContentTemplateDirective, WebsocketModule, WebsocketService, download_file, file_type_icon, format_date, format_datetime, format_file_size, notify_error, notify_success, notify_warning, support_preview_ext, validate, validate_group };
|
|
3912
4009
|
//# sourceMappingURL=ngx-rs-ant.mjs.map
|