ngx-rs-ant 2.2.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/data-grid/data-grid.component.mjs +3 -3
- package/esm2020/data-grid/instance-link-template/instance-link-template.component.mjs +3 -3
- package/esm2020/form/form.component.mjs +4 -4
- package/esm2020/modal/modal.component.mjs +5 -1
- package/esm2020/public-api.mjs +11 -1
- package/esm2020/types/component/mark-item-component-base.mjs +8 -0
- package/esm2020/types/config/mark-item-config-base.mjs +4 -0
- package/esm2020/types/config/modal-config-base.mjs +1 -1
- package/esm2020/util/utils.mjs +17 -17
- package/esm2020/word/section/color.pipe.mjs +19 -0
- package/esm2020/word/section/mark.pipe.mjs +20 -0
- package/esm2020/word/section/node/node.component.mjs +31 -0
- package/esm2020/word/section/node/paragraph/paragraph.component.mjs +44 -0
- package/esm2020/word/section/node/paragraph/run/run.component.mjs +84 -0
- package/esm2020/word/section/node/paragraph-for-input/item/item.component.mjs +64 -0
- package/esm2020/word/section/node/paragraph-for-input/paragraph-for-input.component.mjs +46 -0
- package/esm2020/word/section/pt.pipe.mjs +22 -0
- package/esm2020/word/section/section.component.mjs +44 -0
- package/esm2020/word/section/section.module.mjs +50 -0
- package/esm2020/word/section/section.service.mjs +48 -0
- package/esm2020/word/word-designer/mark-config/mark-config.component.mjs +77 -0
- package/esm2020/word/word-designer/word-designer.component.mjs +207 -0
- package/esm2020/word/word-designer/word-designer.module.mjs +35 -0
- package/esm2020/word/word-designer/word-designer.service.mjs +69 -0
- package/esm2020/word/word-editor/word-editor.component.mjs +154 -0
- package/esm2020/word/word-editor/word-editor.module.mjs +32 -0
- package/esm2020/word/word-editor/word-editor.service.mjs +67 -0
- package/fesm2015/ngx-rs-ant.mjs +1042 -22
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +1035 -22
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/modal/modal.component.d.ts +1 -0
- package/package.json +2 -2
- package/public-api.d.ts +10 -0
- package/types/component/mark-item-component-base.d.ts +21 -0
- package/types/config/mark-item-config-base.d.ts +17 -0
- package/types/config/modal-config-base.d.ts +8 -0
- package/util/utils.d.ts +10 -10
- package/word/section/color.pipe.d.ts +7 -0
- package/word/section/mark.pipe.d.ts +10 -0
- package/word/section/node/node.component.d.ts +12 -0
- package/word/section/node/paragraph/paragraph.component.d.ts +35 -0
- package/word/section/node/paragraph/run/run.component.d.ts +21 -0
- package/word/section/node/paragraph-for-input/item/item.component.d.ts +27 -0
- package/word/section/node/paragraph-for-input/paragraph-for-input.component.d.ts +35 -0
- package/word/section/pt.pipe.d.ts +7 -0
- package/word/section/section.component.d.ts +22 -0
- package/word/section/section.module.d.ts +16 -0
- package/word/section/section.service.d.ts +24 -0
- package/word/word-designer/mark-config/mark-config.component.d.ts +21 -0
- package/word/word-designer/word-designer.component.d.ts +48 -0
- package/word/word-designer/word-designer.module.d.ts +11 -0
- package/word/word-designer/word-designer.service.d.ts +13 -0
- package/word/word-editor/word-editor.component.d.ts +41 -0
- package/word/word-editor/word-editor.module.d.ts +10 -0
- package/word/word-editor/word-editor.service.d.ts +14 -0
package/fesm2020/ngx-rs-ant.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, Input, HostBinding, EventEmitter, Output, HostListener, ViewContainerRef, ViewChild, Directive, ViewChildren, NgModule, Injectable, ContentChild, Pipe } from '@angular/core';
|
|
3
|
-
import { PluginFactory } from 'coast-plugin-register';
|
|
3
|
+
import { PluginFactory, MarkItemFactory } from 'coast-plugin-register';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
6
|
import { Subject, ReplaySubject, Subscription, map, shareReplay, firstValueFrom, of, lastValueFrom, debounceTime, interval } from 'rxjs';
|
|
@@ -29,6 +29,8 @@ import * as i5$2 from 'devextreme-angular/ui/tooltip';
|
|
|
29
29
|
import * as i4 from 'devextreme-angular/ui/popover';
|
|
30
30
|
import * as i2$3 from 'ng2-pdfjs-viewer';
|
|
31
31
|
import { PdfJsViewerComponent, PdfJsViewerModule } from 'ng2-pdfjs-viewer';
|
|
32
|
+
import * as i2$4 from 'devextreme-angular/ui/select-box';
|
|
33
|
+
import * as i7$1 from 'devextreme-angular/ui/validation-group';
|
|
32
34
|
|
|
33
35
|
class DividerLineComponent {
|
|
34
36
|
get _style() {
|
|
@@ -1801,13 +1803,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1801
1803
|
}]
|
|
1802
1804
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
1803
1805
|
|
|
1804
|
-
function
|
|
1806
|
+
function notifyError(message) {
|
|
1805
1807
|
_notify(message, 12000, 'warning');
|
|
1806
1808
|
}
|
|
1807
|
-
function
|
|
1809
|
+
function notifyWarning(message) {
|
|
1808
1810
|
_notify(message, 8000, 'warning');
|
|
1809
1811
|
}
|
|
1810
|
-
function
|
|
1812
|
+
function notifySuccess(message) {
|
|
1811
1813
|
_notify(message, 4000, 'success');
|
|
1812
1814
|
}
|
|
1813
1815
|
function _notify(message, time, type) {
|
|
@@ -1827,7 +1829,7 @@ function _notify(message, time, type) {
|
|
|
1827
1829
|
function localeSortMethod(value1, value2) {
|
|
1828
1830
|
return value1.localeCompare(value2);
|
|
1829
1831
|
}
|
|
1830
|
-
function
|
|
1832
|
+
function fileTypeIcon(name) {
|
|
1831
1833
|
const type = name.substring(name.lastIndexOf('.') + 1).toLocaleLowerCase();
|
|
1832
1834
|
switch (type) {
|
|
1833
1835
|
case 'doc':
|
|
@@ -1862,11 +1864,11 @@ function file_type_icon(name) {
|
|
|
1862
1864
|
return 'unknown';
|
|
1863
1865
|
}
|
|
1864
1866
|
}
|
|
1865
|
-
function
|
|
1867
|
+
function supportPreviewExt() {
|
|
1866
1868
|
return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'doc', 'docx', 'txt', 'xml', 'json', 'js', 'xls', 'xlsx', 'csv', 'ppt', 'pptx', 'mp3', 'mp4'];
|
|
1867
1869
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const labels = ['b', 'Kb', 'Mb', 'Gb'];
|
|
1870
|
+
function formatFileSize(size) {
|
|
1871
|
+
const labels = ['b', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb'];
|
|
1870
1872
|
const count = labels.length - 1;
|
|
1871
1873
|
let i = 0;
|
|
1872
1874
|
while (i < count && size >= 1024) {
|
|
@@ -1875,7 +1877,7 @@ function format_file_size(size) {
|
|
|
1875
1877
|
}
|
|
1876
1878
|
return Math.round(size * 100) / 100 + " " + labels[i];
|
|
1877
1879
|
}
|
|
1878
|
-
function
|
|
1880
|
+
function filenameFromDisposition(disposition) {
|
|
1879
1881
|
const filenamePair = disposition.split(';').filter(str => /^filename=/.test(str.trim())).pop();
|
|
1880
1882
|
if (filenamePair) {
|
|
1881
1883
|
let str = filenamePair.trim();
|
|
@@ -1887,7 +1889,7 @@ function filename_from_disposition(disposition) {
|
|
|
1887
1889
|
return null;
|
|
1888
1890
|
}
|
|
1889
1891
|
}
|
|
1890
|
-
function
|
|
1892
|
+
function downloadFile(blob, filename, callback) {
|
|
1891
1893
|
const url = window.webkitURL.createObjectURL(blob);
|
|
1892
1894
|
const a = document.createElement('a');
|
|
1893
1895
|
document.body.appendChild(a);
|
|
@@ -1926,20 +1928,20 @@ function validate(validator) {
|
|
|
1926
1928
|
}
|
|
1927
1929
|
});
|
|
1928
1930
|
}
|
|
1929
|
-
function
|
|
1931
|
+
function validateGroup(validationGroupComponent) {
|
|
1930
1932
|
if (!validationGroupComponent) {
|
|
1931
1933
|
return firstValueFrom(of(true));
|
|
1932
1934
|
}
|
|
1933
|
-
return
|
|
1935
|
+
return _validateGroup(validationGroupComponent.instance, validationGroupComponent.element.nativeElement);
|
|
1934
1936
|
}
|
|
1935
|
-
function
|
|
1937
|
+
function validateGroupByName(name, brokenElementParent) {
|
|
1936
1938
|
const validationGroup = validationEngine.getGroupConfig(name);
|
|
1937
1939
|
if (!validationGroup) {
|
|
1938
1940
|
return firstValueFrom(of(true));
|
|
1939
1941
|
}
|
|
1940
|
-
return
|
|
1942
|
+
return _validateGroup(validationGroup, brokenElementParent);
|
|
1941
1943
|
}
|
|
1942
|
-
function
|
|
1944
|
+
function _validateGroup(validationGroup, brokenElementParent) {
|
|
1943
1945
|
let sourceNode;
|
|
1944
1946
|
const targetClassName = 'dx-field';
|
|
1945
1947
|
const findTargetNode = (node) => {
|
|
@@ -2023,7 +2025,7 @@ function evaluateFilter(filter, model) {
|
|
|
2023
2025
|
return false;
|
|
2024
2026
|
}
|
|
2025
2027
|
if (typeof filter[0] === 'string') {
|
|
2026
|
-
return
|
|
2028
|
+
return _evaluateCondition(filter, model);
|
|
2027
2029
|
}
|
|
2028
2030
|
// 复合条件,约定统一为and/or
|
|
2029
2031
|
let currentOperator = filter[1].toUpperCase();
|
|
@@ -2040,7 +2042,7 @@ function evaluateFilter(filter, model) {
|
|
|
2040
2042
|
}
|
|
2041
2043
|
return false;
|
|
2042
2044
|
}
|
|
2043
|
-
function
|
|
2045
|
+
function _evaluateCondition(condition, model) {
|
|
2044
2046
|
const [key, conditionType, value] = condition;
|
|
2045
2047
|
let modelValue = model[key];
|
|
2046
2048
|
switch (conditionType) {
|
|
@@ -2801,10 +2803,10 @@ class FormComponent extends UniqueId {
|
|
|
2801
2803
|
validate() {
|
|
2802
2804
|
return new Promise((resolve) => {
|
|
2803
2805
|
const promises = Array.from(this.elementRef.nativeElement.querySelectorAll('rs-form')).map((item) => {
|
|
2804
|
-
return
|
|
2806
|
+
return validateGroupByName(item.getAttribute('validator-group-name'), this.elementRef.nativeElement);
|
|
2805
2807
|
});
|
|
2806
2808
|
// 添加顶级元素的验证 Promise
|
|
2807
|
-
promises.push(
|
|
2809
|
+
promises.push(validateGroupByName(this.getUniqueId(), this.elementRef.nativeElement));
|
|
2808
2810
|
// 使用 Promise.all 等待所有 Promise 完成
|
|
2809
2811
|
Promise.all(promises)
|
|
2810
2812
|
.then((results) => {
|
|
@@ -2869,7 +2871,7 @@ class InstanceLinkTemplateComponent {
|
|
|
2869
2871
|
openNewTab($event) {
|
|
2870
2872
|
$event.event?.stopPropagation();
|
|
2871
2873
|
if (!window.coast.tabManager) {
|
|
2872
|
-
|
|
2874
|
+
notifyWarning('此操作仅能在coast-web项目中执行,type:detail,config:tenant=' + this.tenant + ',className=' + this.className + ',oid=' + this.oid);
|
|
2873
2875
|
return;
|
|
2874
2876
|
}
|
|
2875
2877
|
window.coast.tabManager.add.next({
|
|
@@ -3045,7 +3047,7 @@ class DataGridComponent {
|
|
|
3045
3047
|
});
|
|
3046
3048
|
if (this.onlyFrontEnd) {
|
|
3047
3049
|
if (this.dataSource && !Array.isArray(this.dataSource)) {
|
|
3048
|
-
|
|
3050
|
+
notifyError('因onlyFrontEnd参数为true,需要明确指定dataSource参数为数组');
|
|
3049
3051
|
}
|
|
3050
3052
|
}
|
|
3051
3053
|
else {
|
|
@@ -3692,11 +3694,15 @@ class ModalComponent {
|
|
|
3692
3694
|
modals[i].querySelector('.modal-backdrop').style.backgroundColor = 'rgba(37, 43, 58, 0)';
|
|
3693
3695
|
}
|
|
3694
3696
|
}
|
|
3697
|
+
this.elementRef.nativeElement.style.display = 'block';
|
|
3695
3698
|
}
|
|
3696
3699
|
hide() {
|
|
3697
3700
|
// 在service中重写
|
|
3698
3701
|
this.onHide.emit();
|
|
3699
3702
|
}
|
|
3703
|
+
onlyHide() {
|
|
3704
|
+
this.elementRef.nativeElement.style.display = 'none';
|
|
3705
|
+
}
|
|
3700
3706
|
ngOnDestroy() {
|
|
3701
3707
|
// 若存在多层模态框,下一层遮罩设置为不透明
|
|
3702
3708
|
const nodeName = this.elementRef.nativeElement.nodeName;
|
|
@@ -3909,6 +3915,13 @@ class FormItemComponentBase extends ComponentBase {
|
|
|
3909
3915
|
}
|
|
3910
3916
|
}
|
|
3911
3917
|
|
|
3918
|
+
class MarkItemComponentBase extends ComponentBase {
|
|
3919
|
+
constructor() {
|
|
3920
|
+
super(...arguments);
|
|
3921
|
+
this.readonly = false;
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3912
3925
|
class ModalComponentBase extends ComponentBase {
|
|
3913
3926
|
}
|
|
3914
3927
|
|
|
@@ -3931,6 +3944,9 @@ class CellConfigBase extends ConfigBase {
|
|
|
3931
3944
|
class FormItemConfigBase extends ConfigBase {
|
|
3932
3945
|
}
|
|
3933
3946
|
|
|
3947
|
+
class MarkItemConfigBase extends ComponentBase {
|
|
3948
|
+
}
|
|
3949
|
+
|
|
3934
3950
|
class ModalConfigBase extends ConfigBase {
|
|
3935
3951
|
}
|
|
3936
3952
|
|
|
@@ -4116,9 +4132,1006 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4116
4132
|
type: Injectable
|
|
4117
4133
|
}], ctorParameters: function () { return []; } });
|
|
4118
4134
|
|
|
4135
|
+
class PtPipe {
|
|
4136
|
+
transform(value, scale = 1) {
|
|
4137
|
+
if (!value) {
|
|
4138
|
+
return '';
|
|
4139
|
+
}
|
|
4140
|
+
if (typeof value === 'string') {
|
|
4141
|
+
return value;
|
|
4142
|
+
}
|
|
4143
|
+
return value * scale + 'pt';
|
|
4144
|
+
}
|
|
4145
|
+
}
|
|
4146
|
+
PtPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PtPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4147
|
+
PtPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PtPipe, name: "pt" });
|
|
4148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PtPipe, decorators: [{
|
|
4149
|
+
type: Pipe,
|
|
4150
|
+
args: [{
|
|
4151
|
+
name: 'pt'
|
|
4152
|
+
}]
|
|
4153
|
+
}] });
|
|
4154
|
+
|
|
4155
|
+
class SectionService {
|
|
4156
|
+
constructor() {
|
|
4157
|
+
this.scale = 1;
|
|
4158
|
+
this.marks = [];
|
|
4159
|
+
this.readonly = false;
|
|
4160
|
+
this.activeMark = { name: '未定义书签' };
|
|
4161
|
+
this.copiedMark = {};
|
|
4162
|
+
this.readyPasteMarkNames = [];
|
|
4163
|
+
this.lastClickToPasteMarkName = '';
|
|
4164
|
+
this.valueUpdated = new EventEmitter();
|
|
4165
|
+
}
|
|
4166
|
+
switchMark(type) {
|
|
4167
|
+
let index = this.marks.indexOf(this.activeMark);
|
|
4168
|
+
if (index + type === -1) {
|
|
4169
|
+
this.activeMark = this.marks[this.marks.length - 1];
|
|
4170
|
+
}
|
|
4171
|
+
else if (index + type === this.marks.length) {
|
|
4172
|
+
this.activeMark = this.marks[0];
|
|
4173
|
+
}
|
|
4174
|
+
else {
|
|
4175
|
+
this.activeMark = this.marks[index + type];
|
|
4176
|
+
}
|
|
4177
|
+
document.getElementById('mark-setting_' + this.activeMark.name)?.scrollIntoView({
|
|
4178
|
+
block: 'center',
|
|
4179
|
+
inline: 'center'
|
|
4180
|
+
});
|
|
4181
|
+
}
|
|
4182
|
+
getMark(name) {
|
|
4183
|
+
if (!name) {
|
|
4184
|
+
return undefined;
|
|
4185
|
+
}
|
|
4186
|
+
return this.marks.find(m => m.name === name);
|
|
4187
|
+
}
|
|
4188
|
+
getMarkIndex(name) {
|
|
4189
|
+
if (!name) {
|
|
4190
|
+
return -1;
|
|
4191
|
+
}
|
|
4192
|
+
return this.marks.findIndex(m => m.name === name);
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4195
|
+
SectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4196
|
+
SectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionService });
|
|
4197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionService, decorators: [{
|
|
4198
|
+
type: Injectable
|
|
4199
|
+
}] });
|
|
4200
|
+
|
|
4201
|
+
class MarkPipe {
|
|
4202
|
+
constructor(service) {
|
|
4203
|
+
this.service = service;
|
|
4204
|
+
}
|
|
4205
|
+
transform(name) {
|
|
4206
|
+
return this.service.getMark(name);
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
MarkPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MarkPipe, deps: [{ token: SectionService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4210
|
+
MarkPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: MarkPipe, name: "mark" });
|
|
4211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MarkPipe, decorators: [{
|
|
4212
|
+
type: Pipe,
|
|
4213
|
+
args: [{
|
|
4214
|
+
name: 'mark'
|
|
4215
|
+
}]
|
|
4216
|
+
}], ctorParameters: function () { return [{ type: SectionService }]; } });
|
|
4217
|
+
|
|
4218
|
+
class RunComponent {
|
|
4219
|
+
constructor(service) {
|
|
4220
|
+
this.service = service;
|
|
4221
|
+
this.editMode = false;
|
|
4222
|
+
this.pasteMode = false;
|
|
4223
|
+
}
|
|
4224
|
+
ngOnInit() {
|
|
4225
|
+
if (!this.node.text) {
|
|
4226
|
+
if (this.node.mark && this.editMode) {
|
|
4227
|
+
this.nodeText = ' ';
|
|
4228
|
+
}
|
|
4229
|
+
else {
|
|
4230
|
+
this.nodeText = '';
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4233
|
+
else {
|
|
4234
|
+
this.nodeText = this.node.text.replaceAll(' ', ' ').replaceAll('\f', ' ');
|
|
4235
|
+
}
|
|
4236
|
+
}
|
|
4237
|
+
click($event, markName) {
|
|
4238
|
+
if (this.pasteMode) {
|
|
4239
|
+
if (markName === this.service.activeMark?.name) {
|
|
4240
|
+
return;
|
|
4241
|
+
}
|
|
4242
|
+
if ($event.ctrlKey) {
|
|
4243
|
+
if (this.service.readyPasteMarkNames.includes(markName)) {
|
|
4244
|
+
this.service.readyPasteMarkNames.splice(this.service.readyPasteMarkNames.indexOf(markName), 1);
|
|
4245
|
+
}
|
|
4246
|
+
else {
|
|
4247
|
+
this.service.lastClickToPasteMarkName = markName;
|
|
4248
|
+
this.service.readyPasteMarkNames.push(markName);
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
else if ($event.shiftKey) {
|
|
4252
|
+
if (this.service.lastClickToPasteMarkName) {
|
|
4253
|
+
let startIndex = this.service.getMarkIndex(this.service.lastClickToPasteMarkName);
|
|
4254
|
+
let endIndex = this.service.getMarkIndex(markName);
|
|
4255
|
+
this.service.lastClickToPasteMarkName = markName;
|
|
4256
|
+
if (startIndex > endIndex) {
|
|
4257
|
+
let temp = startIndex;
|
|
4258
|
+
startIndex = endIndex;
|
|
4259
|
+
endIndex = temp;
|
|
4260
|
+
}
|
|
4261
|
+
for (let i = startIndex; i <= endIndex; i++) {
|
|
4262
|
+
let name = this.service.marks[i].name;
|
|
4263
|
+
if (!this.service.readyPasteMarkNames.includes(name)) {
|
|
4264
|
+
this.service.readyPasteMarkNames.push(name);
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
else {
|
|
4269
|
+
this.service.lastClickToPasteMarkName = markName;
|
|
4270
|
+
this.service.readyPasteMarkNames = [markName];
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4273
|
+
else {
|
|
4274
|
+
this.service.lastClickToPasteMarkName = markName;
|
|
4275
|
+
this.service.readyPasteMarkNames = [markName];
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
else {
|
|
4279
|
+
this.service.activeMark = this.service.getMark(markName);
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
RunComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RunComponent, deps: [{ token: SectionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4284
|
+
RunComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RunComponent, selector: "rs-run", inputs: { node: "node", editMode: "editMode", pasteMode: "pasteMode" }, ngImport: i0, template: "<div class=\"node\" [style.display]=\"node.type === 'image' ? 'inline-block' : ''\" [style.float]=\"node.style?.['float']\">\r\n <i *ngIf=\"node.mark && node.setting && editMode\"\r\n [id]=\"'mark-setting_' + node.mark\"\r\n [style.font-size]=\"12 | pt:service.scale\"\r\n [style.left]=\"-12 | pt:service.scale\"\r\n class=\"mark-setting coast-icon-setting\"\r\n [class.used]=\"(node.mark | mark)?.type\"\r\n [class.active]=\"node.mark === service.activeMark.name\"\r\n [class.copied]=\"node.mark === service.copiedMark.name\"\r\n [class.ready-paste]=\"service.readyPasteMarkNames.includes(node.mark)\"\r\n (click)=\"click($event, node.mark)\"></i>\r\n <span *ngIf=\"node.type === 'run'\"\r\n [style.font-family]=\"node.style['font-family']\"\r\n [style.font-size]=\"node.style['font-size'] | pt:service.scale\"\r\n [style.font-weight]=\"node.style['font-bold'] ? 'bold' : 'normal'\"\r\n [style.text-decoration]=\"node.style['underline'] ? 'underline 1px' : 'none'\"\r\n [style.float]=\"node.style['float']\"\r\n [class.mark]=\"node.mark === service.activeMark.name && editMode\"\r\n [innerHTML]=\"nodeText\">\r\n </span>\r\n <img *ngIf=\"node.type === 'image'\"\r\n [style.width]=\"node.style['width'] | pt:service.scale\"\r\n [style.height]=\"node.style['height'] | pt:service.scale\"\r\n [style.position]=\"node.style['position']\"\r\n [style.top]=\"node.style['top'] | pt:service.scale\"\r\n [style.left]=\"node.style['left'] | pt:service.scale\"\r\n [style.z-index]=\"node.style['z-index']\"\r\n [class.mark]=\"node.mark === service.activeMark.name && editMode\"\r\n [src]=\"'data:image/png;base64,' + node.data\" alt=\"\">\r\n</div>\r\n", styles: [":host .node{position:relative;display:inline;text-indent:0}:host .node .mark-setting{position:absolute;cursor:pointer;color:var(--coast-warning-color, rgb(240, 173, 78));z-index:1}:host .node .mark-setting.used{color:var(--coast-success-color, rgb(92, 184, 92))}:host .node .mark-setting.active{color:var(--coast-default-color, rgb(51, 122, 183))}:host .node .mark-setting.copied{background-color:var(--coast-success-color, rgb(92, 184, 92))}:host .node .mark-setting.ready-paste{background-color:var(--coast-danger-color, rgb(217, 83, 79))}:host .node span.mark{background-color:var(--coast-active-color, rgba(51, 122, 183, .5))}:host .node img.mark{border:1px solid var(--coast-active-color, rgba(51, 122, 183, .5))}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: MarkPipe, name: "mark" }, { kind: "pipe", type: PtPipe, name: "pt" }] });
|
|
4285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RunComponent, decorators: [{
|
|
4286
|
+
type: Component,
|
|
4287
|
+
args: [{ selector: 'rs-run', template: "<div class=\"node\" [style.display]=\"node.type === 'image' ? 'inline-block' : ''\" [style.float]=\"node.style?.['float']\">\r\n <i *ngIf=\"node.mark && node.setting && editMode\"\r\n [id]=\"'mark-setting_' + node.mark\"\r\n [style.font-size]=\"12 | pt:service.scale\"\r\n [style.left]=\"-12 | pt:service.scale\"\r\n class=\"mark-setting coast-icon-setting\"\r\n [class.used]=\"(node.mark | mark)?.type\"\r\n [class.active]=\"node.mark === service.activeMark.name\"\r\n [class.copied]=\"node.mark === service.copiedMark.name\"\r\n [class.ready-paste]=\"service.readyPasteMarkNames.includes(node.mark)\"\r\n (click)=\"click($event, node.mark)\"></i>\r\n <span *ngIf=\"node.type === 'run'\"\r\n [style.font-family]=\"node.style['font-family']\"\r\n [style.font-size]=\"node.style['font-size'] | pt:service.scale\"\r\n [style.font-weight]=\"node.style['font-bold'] ? 'bold' : 'normal'\"\r\n [style.text-decoration]=\"node.style['underline'] ? 'underline 1px' : 'none'\"\r\n [style.float]=\"node.style['float']\"\r\n [class.mark]=\"node.mark === service.activeMark.name && editMode\"\r\n [innerHTML]=\"nodeText\">\r\n </span>\r\n <img *ngIf=\"node.type === 'image'\"\r\n [style.width]=\"node.style['width'] | pt:service.scale\"\r\n [style.height]=\"node.style['height'] | pt:service.scale\"\r\n [style.position]=\"node.style['position']\"\r\n [style.top]=\"node.style['top'] | pt:service.scale\"\r\n [style.left]=\"node.style['left'] | pt:service.scale\"\r\n [style.z-index]=\"node.style['z-index']\"\r\n [class.mark]=\"node.mark === service.activeMark.name && editMode\"\r\n [src]=\"'data:image/png;base64,' + node.data\" alt=\"\">\r\n</div>\r\n", styles: [":host .node{position:relative;display:inline;text-indent:0}:host .node .mark-setting{position:absolute;cursor:pointer;color:var(--coast-warning-color, rgb(240, 173, 78));z-index:1}:host .node .mark-setting.used{color:var(--coast-success-color, rgb(92, 184, 92))}:host .node .mark-setting.active{color:var(--coast-default-color, rgb(51, 122, 183))}:host .node .mark-setting.copied{background-color:var(--coast-success-color, rgb(92, 184, 92))}:host .node .mark-setting.ready-paste{background-color:var(--coast-danger-color, rgb(217, 83, 79))}:host .node span.mark{background-color:var(--coast-active-color, rgba(51, 122, 183, .5))}:host .node img.mark{border:1px solid var(--coast-active-color, rgba(51, 122, 183, .5))}\n"] }]
|
|
4288
|
+
}], ctorParameters: function () { return [{ type: SectionService }]; }, propDecorators: { node: [{
|
|
4289
|
+
type: Input
|
|
4290
|
+
}], editMode: [{
|
|
4291
|
+
type: Input
|
|
4292
|
+
}], pasteMode: [{
|
|
4293
|
+
type: Input
|
|
4294
|
+
}] } });
|
|
4295
|
+
|
|
4296
|
+
class ParagraphComponent {
|
|
4297
|
+
get _style() {
|
|
4298
|
+
return {
|
|
4299
|
+
display: 'block',
|
|
4300
|
+
marginTop: this.pt.transform(this.paragraph.style['margin-top'], this.service.scale),
|
|
4301
|
+
marginBottom: this.pt.transform(this.paragraph.style['margin-bottom'], this.service.scale),
|
|
4302
|
+
marginLeft: this.pt.transform(this.paragraph.style['margin-left'], this.service.scale),
|
|
4303
|
+
textIndent: this.pt.transform(this.paragraph.style['text-indent'], this.service.scale),
|
|
4304
|
+
textAlign: this.paragraph.style['text-align'],
|
|
4305
|
+
lineHeight: this.pt.transform(this.paragraph.style['line-height'], this.service.scale),
|
|
4306
|
+
minHeight: this.pt.transform(this.paragraph.style['min-height'], this.service.scale),
|
|
4307
|
+
fontFamily: this.paragraph.style['font-family'],
|
|
4308
|
+
fontSize: this.pt.transform(this.paragraph.style['font-size'], this.service.scale)
|
|
4309
|
+
};
|
|
4310
|
+
}
|
|
4311
|
+
constructor(service, pt) {
|
|
4312
|
+
this.service = service;
|
|
4313
|
+
this.pt = pt;
|
|
4314
|
+
this.editMode = false;
|
|
4315
|
+
this.pasteMode = false;
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
ParagraphComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ParagraphComponent, deps: [{ token: SectionService }, { token: PtPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
4319
|
+
ParagraphComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ParagraphComponent, selector: "rs-paragraph", inputs: { paragraph: "paragraph", editMode: "editMode", pasteMode: "pasteMode" }, host: { properties: { "style": "this._style" } }, ngImport: i0, template: "<ng-container *ngFor=\"let node of paragraph.content\">\r\n <rs-run [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\"></rs-run>\r\n</ng-container>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: RunComponent, selector: "rs-run", inputs: ["node", "editMode", "pasteMode"] }] });
|
|
4320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ParagraphComponent, decorators: [{
|
|
4321
|
+
type: Component,
|
|
4322
|
+
args: [{ selector: 'rs-paragraph', template: "<ng-container *ngFor=\"let node of paragraph.content\">\r\n <rs-run [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\"></rs-run>\r\n</ng-container>\r\n" }]
|
|
4323
|
+
}], ctorParameters: function () { return [{ type: SectionService }, { type: PtPipe }]; }, propDecorators: { paragraph: [{
|
|
4324
|
+
type: Input
|
|
4325
|
+
}], editMode: [{
|
|
4326
|
+
type: Input
|
|
4327
|
+
}], pasteMode: [{
|
|
4328
|
+
type: Input
|
|
4329
|
+
}], _style: [{
|
|
4330
|
+
type: HostBinding,
|
|
4331
|
+
args: ['style']
|
|
4332
|
+
}] } });
|
|
4333
|
+
|
|
4334
|
+
class ItemComponent {
|
|
4335
|
+
get _style() {
|
|
4336
|
+
if (this.node.style?.float) {
|
|
4337
|
+
return { float: this.node.style.float };
|
|
4338
|
+
}
|
|
4339
|
+
return {};
|
|
4340
|
+
}
|
|
4341
|
+
constructor(service) {
|
|
4342
|
+
this.service = service;
|
|
4343
|
+
this.editMode = false;
|
|
4344
|
+
this.readonly = false;
|
|
4345
|
+
}
|
|
4346
|
+
ngOnInit() {
|
|
4347
|
+
if (!this.mark.type || !this.node.setting) {
|
|
4348
|
+
return;
|
|
4349
|
+
}
|
|
4350
|
+
let markItem = MarkItemFactory.get(this.mark.type);
|
|
4351
|
+
if (!markItem) {
|
|
4352
|
+
console.error('不存在组件:' + this.mark.type);
|
|
4353
|
+
return;
|
|
4354
|
+
}
|
|
4355
|
+
setTimeout(() => {
|
|
4356
|
+
let componentRef = this.itemRef.createComponent(markItem.component);
|
|
4357
|
+
const componentInstance = componentRef.instance;
|
|
4358
|
+
componentInstance.tenant = this.service.tenant;
|
|
4359
|
+
componentInstance.templateClassName = this.service.templateClassName;
|
|
4360
|
+
componentInstance.instanceClassName = this.service.instanceClassName;
|
|
4361
|
+
componentInstance.instanceOid = this.service.instanceOid;
|
|
4362
|
+
componentInstance.mark = this.mark;
|
|
4363
|
+
componentInstance.marks = this.service.marks;
|
|
4364
|
+
componentInstance.readonly = this.service.readonly || this.readonly;
|
|
4365
|
+
componentInstance.valueUpdated = this.service.valueUpdated;
|
|
4366
|
+
componentInstance.params = this.service.params;
|
|
4367
|
+
componentInstance.tabViewContainerRef = this.service.tabViewContainerRef;
|
|
4368
|
+
});
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
ItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ItemComponent, deps: [{ token: SectionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4372
|
+
ItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ItemComponent, selector: "rs-item", inputs: { node: "node", mark: "mark", editMode: "editMode", readonly: "readonly" }, host: { properties: { "style": "this._style" } }, viewQueries: [{ propertyName: "itemRef", first: true, predicate: ["itemRef"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<ng-container *ngIf=\"node.setting\" #itemRef></ng-container>\r\n<rs-run *ngIf=\"mark.config.showMarkContent\" [node]=\"node\" [editMode]=\"editMode\"></rs-run>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RunComponent, selector: "rs-run", inputs: ["node", "editMode", "pasteMode"] }] });
|
|
4373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ItemComponent, decorators: [{
|
|
4374
|
+
type: Component,
|
|
4375
|
+
args: [{ selector: 'rs-item', template: "<ng-container *ngIf=\"node.setting\" #itemRef></ng-container>\r\n<rs-run *ngIf=\"mark.config.showMarkContent\" [node]=\"node\" [editMode]=\"editMode\"></rs-run>\r\n" }]
|
|
4376
|
+
}], ctorParameters: function () { return [{ type: SectionService }]; }, propDecorators: { node: [{
|
|
4377
|
+
type: Input
|
|
4378
|
+
}], mark: [{
|
|
4379
|
+
type: Input
|
|
4380
|
+
}], editMode: [{
|
|
4381
|
+
type: Input
|
|
4382
|
+
}], readonly: [{
|
|
4383
|
+
type: Input
|
|
4384
|
+
}], _style: [{
|
|
4385
|
+
type: HostBinding,
|
|
4386
|
+
args: ['style']
|
|
4387
|
+
}], itemRef: [{
|
|
4388
|
+
type: ViewChild,
|
|
4389
|
+
args: ['itemRef', { read: ViewContainerRef }]
|
|
4390
|
+
}] } });
|
|
4391
|
+
|
|
4392
|
+
class ParagraphForInputComponent {
|
|
4393
|
+
get _style() {
|
|
4394
|
+
return {
|
|
4395
|
+
display: 'block',
|
|
4396
|
+
marginTop: this.pt.transform(this.paragraph.style['margin-top'], this.service.scale),
|
|
4397
|
+
marginBottom: this.pt.transform(this.paragraph.style['margin-bottom'], this.service.scale),
|
|
4398
|
+
marginLeft: this.pt.transform(this.paragraph.style['margin-left'], this.service.scale),
|
|
4399
|
+
textIndent: this.pt.transform(this.paragraph.style['text-indent'], this.service.scale),
|
|
4400
|
+
textAlign: this.paragraph.style['text-align'],
|
|
4401
|
+
lineHeight: this.pt.transform(this.paragraph.style['line-height'], this.service.scale),
|
|
4402
|
+
minHeight: this.pt.transform(this.paragraph.style['min-height'], this.service.scale),
|
|
4403
|
+
fontFamily: this.paragraph.style['font-family'],
|
|
4404
|
+
fontSize: this.pt.transform(this.paragraph.style['font-size'], this.service.scale)
|
|
4405
|
+
};
|
|
4406
|
+
}
|
|
4407
|
+
constructor(service, pt) {
|
|
4408
|
+
this.service = service;
|
|
4409
|
+
this.pt = pt;
|
|
4410
|
+
this.editMode = false;
|
|
4411
|
+
this.readonly = false;
|
|
4412
|
+
}
|
|
4413
|
+
}
|
|
4414
|
+
ParagraphForInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ParagraphForInputComponent, deps: [{ token: SectionService }, { token: PtPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
4415
|
+
ParagraphForInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ParagraphForInputComponent, selector: "rs-paragraph-for-input", inputs: { paragraph: "paragraph", editMode: "editMode", readonly: "readonly" }, host: { properties: { "style": "this._style" } }, ngImport: i0, template: "<ng-container *ngFor=\"let node of paragraph.content\">\r\n <rs-item *ngIf=\"node.mark\" [node]=\"node\" [mark]=\"node.mark | mark\" [editMode]=\"editMode\"\r\n [readonly]=\"readonly\"></rs-item>\r\n <rs-run *ngIf=\"!node.mark\" [node]=\"node\"></rs-run>\r\n</ng-container>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RunComponent, selector: "rs-run", inputs: ["node", "editMode", "pasteMode"] }, { kind: "component", type: ItemComponent, selector: "rs-item", inputs: ["node", "mark", "editMode", "readonly"] }, { kind: "pipe", type: MarkPipe, name: "mark" }] });
|
|
4416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ParagraphForInputComponent, decorators: [{
|
|
4417
|
+
type: Component,
|
|
4418
|
+
args: [{ selector: 'rs-paragraph-for-input', template: "<ng-container *ngFor=\"let node of paragraph.content\">\r\n <rs-item *ngIf=\"node.mark\" [node]=\"node\" [mark]=\"node.mark | mark\" [editMode]=\"editMode\"\r\n [readonly]=\"readonly\"></rs-item>\r\n <rs-run *ngIf=\"!node.mark\" [node]=\"node\"></rs-run>\r\n</ng-container>\r\n" }]
|
|
4419
|
+
}], ctorParameters: function () { return [{ type: SectionService }, { type: PtPipe }]; }, propDecorators: { paragraph: [{
|
|
4420
|
+
type: Input
|
|
4421
|
+
}], editMode: [{
|
|
4422
|
+
type: Input
|
|
4423
|
+
}], readonly: [{
|
|
4424
|
+
type: Input
|
|
4425
|
+
}], _style: [{
|
|
4426
|
+
type: HostBinding,
|
|
4427
|
+
args: ['style']
|
|
4428
|
+
}] } });
|
|
4429
|
+
|
|
4430
|
+
class ColorPipe {
|
|
4431
|
+
transform(value) {
|
|
4432
|
+
if (value[0] === 0 && value[1] === 0 && value[2] === 0 && value[3] === 0) {
|
|
4433
|
+
return '';
|
|
4434
|
+
}
|
|
4435
|
+
return 'rgba(' + value[0] * 255 + ',' + value[1] * 255 + ',' + value[2] * 255 + ',' + value[3] + ')';
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4438
|
+
ColorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4439
|
+
ColorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ColorPipe, name: "color" });
|
|
4440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColorPipe, decorators: [{
|
|
4441
|
+
type: Pipe,
|
|
4442
|
+
args: [{
|
|
4443
|
+
name: 'color'
|
|
4444
|
+
}]
|
|
4445
|
+
}] });
|
|
4446
|
+
|
|
4447
|
+
class NodeComponent {
|
|
4448
|
+
constructor(service) {
|
|
4449
|
+
this.service = service;
|
|
4450
|
+
this.editMode = false;
|
|
4451
|
+
this.pasteMode = false;
|
|
4452
|
+
this.readonly = false;
|
|
4453
|
+
}
|
|
4454
|
+
}
|
|
4455
|
+
NodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NodeComponent, deps: [{ token: SectionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4456
|
+
NodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: NodeComponent, selector: "rs-node", inputs: { node: "node", editMode: "editMode", pasteMode: "pasteMode", readonly: "readonly" }, ngImport: i0, template: "<div class=\"table\" [style.align-items]=\"node.align\" *ngIf=\"node.type === 'table'\">\r\n <table [style.margin-left]=\"node.style?.['margin-left'] | pt:service.scale\"\r\n [style.width]=\"(node.style?.widthType === 'percent' ? node.style?.width + '%' : node.style?.width) | pt:service.scale\"\r\n [style.border-top-width]=\"node.style?.['border-top-width'] | pt:service.scale\"\r\n [style.border-top-color]=\"node.style?.['border-top-color'] | color\"\r\n [style.border-right-width]=\"node.style?.['border-right-width'] | pt:service.scale\"\r\n [style.border-right-color]=\"node.style?.['border-right-color'] | color\"\r\n [style.border-bottom-width]=\"node.style?.['border-bottom-width'] | pt:service.scale\"\r\n [style.border-bottom-color]=\"node.style?.['border-bottom-color'] | color\"\r\n [style.border-left-width]=\"node.style?.['border-left-width'] | pt:service.scale\"\r\n [style.border-left-color]=\"node.style?.['border-left-color'] | color\">\r\n <tr *ngFor=\"let row of node.rows\" [style.height]=\"row.style.height | pt:service.scale\">\r\n <ng-container *ngFor=\"let cell of row.cells\">\r\n <ng-container *ngIf=\"!cell.ignore\">\r\n <td [rowSpan]=\"cell.rowSpan\" [colSpan]=\"cell.colSpan\"\r\n [style.width]=\"cell.style.width | pt:service.scale\"\r\n [style.padding-top]=\"cell.style?.['padding-top'] | pt:service.scale\"\r\n [style.padding-right]=\"cell.style?.['padding-right'] | pt:service.scale\"\r\n [style.padding-bottom]=\"cell.style?.['padding-bottom'] | pt:service.scale\"\r\n [style.padding-left]=\"cell.style?.['padding-left'] | pt:service.scale\"\r\n [style.vertical-align]=\"cell.style?.['vertical-align']\"\r\n [style.background-color]=\"cell.style?.['background-color'] | color\"\r\n [style.border-top-width]=\"cell.style?.['border-top-width'] | pt:service.scale\"\r\n [style.border-top-color]=\"cell.style?.['border-top-color'] | color\"\r\n [style.border-right-width]=\"cell.style?.['border-right-width'] | pt:service.scale\"\r\n [style.border-right-color]=\"cell.style?.['border-right-color'] | color\"\r\n [style.border-bottom-width]=\"cell.style?.['border-bottom-width'] | pt:service.scale\"\r\n [style.border-bottom-color]=\"cell.style?.['border-bottom-color'] | color\"\r\n [style.border-left-width]=\"cell.style?.['border-left-width'] | pt:service.scale\"\r\n [style.border-left-color]=\"cell.style?.['border-left-color'] | color\">\r\n <ng-container *ngFor=\"let node of cell.body\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n </tr>\r\n </table>\r\n</div>\r\n<ng-container *ngIf=\"node.type === 'paragraph'\">\r\n <ng-container *ngIf=\"editMode\">\r\n <rs-paragraph [paragraph]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\"></rs-paragraph>\r\n </ng-container>\r\n <ng-container *ngIf=\"!editMode\">\r\n <rs-paragraph-for-input [paragraph]=\"node\" [editMode]=\"editMode\"\r\n [readonly]=\"readonly\"></rs-paragraph-for-input>\r\n </ng-container>\r\n</ng-container>\r\n", styles: [":host .table{display:flex;flex-flow:column nowrap;justify-content:center}:host .table table{border-collapse:collapse}:host .table table td{border:1px solid #000000}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NodeComponent, selector: "rs-node", inputs: ["node", "editMode", "pasteMode", "readonly"] }, { kind: "component", type: ParagraphComponent, selector: "rs-paragraph", inputs: ["paragraph", "editMode", "pasteMode"] }, { kind: "component", type: ParagraphForInputComponent, selector: "rs-paragraph-for-input", inputs: ["paragraph", "editMode", "readonly"] }, { kind: "pipe", type: ColorPipe, name: "color" }, { kind: "pipe", type: PtPipe, name: "pt" }] });
|
|
4457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NodeComponent, decorators: [{
|
|
4458
|
+
type: Component,
|
|
4459
|
+
args: [{ selector: 'rs-node', template: "<div class=\"table\" [style.align-items]=\"node.align\" *ngIf=\"node.type === 'table'\">\r\n <table [style.margin-left]=\"node.style?.['margin-left'] | pt:service.scale\"\r\n [style.width]=\"(node.style?.widthType === 'percent' ? node.style?.width + '%' : node.style?.width) | pt:service.scale\"\r\n [style.border-top-width]=\"node.style?.['border-top-width'] | pt:service.scale\"\r\n [style.border-top-color]=\"node.style?.['border-top-color'] | color\"\r\n [style.border-right-width]=\"node.style?.['border-right-width'] | pt:service.scale\"\r\n [style.border-right-color]=\"node.style?.['border-right-color'] | color\"\r\n [style.border-bottom-width]=\"node.style?.['border-bottom-width'] | pt:service.scale\"\r\n [style.border-bottom-color]=\"node.style?.['border-bottom-color'] | color\"\r\n [style.border-left-width]=\"node.style?.['border-left-width'] | pt:service.scale\"\r\n [style.border-left-color]=\"node.style?.['border-left-color'] | color\">\r\n <tr *ngFor=\"let row of node.rows\" [style.height]=\"row.style.height | pt:service.scale\">\r\n <ng-container *ngFor=\"let cell of row.cells\">\r\n <ng-container *ngIf=\"!cell.ignore\">\r\n <td [rowSpan]=\"cell.rowSpan\" [colSpan]=\"cell.colSpan\"\r\n [style.width]=\"cell.style.width | pt:service.scale\"\r\n [style.padding-top]=\"cell.style?.['padding-top'] | pt:service.scale\"\r\n [style.padding-right]=\"cell.style?.['padding-right'] | pt:service.scale\"\r\n [style.padding-bottom]=\"cell.style?.['padding-bottom'] | pt:service.scale\"\r\n [style.padding-left]=\"cell.style?.['padding-left'] | pt:service.scale\"\r\n [style.vertical-align]=\"cell.style?.['vertical-align']\"\r\n [style.background-color]=\"cell.style?.['background-color'] | color\"\r\n [style.border-top-width]=\"cell.style?.['border-top-width'] | pt:service.scale\"\r\n [style.border-top-color]=\"cell.style?.['border-top-color'] | color\"\r\n [style.border-right-width]=\"cell.style?.['border-right-width'] | pt:service.scale\"\r\n [style.border-right-color]=\"cell.style?.['border-right-color'] | color\"\r\n [style.border-bottom-width]=\"cell.style?.['border-bottom-width'] | pt:service.scale\"\r\n [style.border-bottom-color]=\"cell.style?.['border-bottom-color'] | color\"\r\n [style.border-left-width]=\"cell.style?.['border-left-width'] | pt:service.scale\"\r\n [style.border-left-color]=\"cell.style?.['border-left-color'] | color\">\r\n <ng-container *ngFor=\"let node of cell.body\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n </tr>\r\n </table>\r\n</div>\r\n<ng-container *ngIf=\"node.type === 'paragraph'\">\r\n <ng-container *ngIf=\"editMode\">\r\n <rs-paragraph [paragraph]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\"></rs-paragraph>\r\n </ng-container>\r\n <ng-container *ngIf=\"!editMode\">\r\n <rs-paragraph-for-input [paragraph]=\"node\" [editMode]=\"editMode\"\r\n [readonly]=\"readonly\"></rs-paragraph-for-input>\r\n </ng-container>\r\n</ng-container>\r\n", styles: [":host .table{display:flex;flex-flow:column nowrap;justify-content:center}:host .table table{border-collapse:collapse}:host .table table td{border:1px solid #000000}\n"] }]
|
|
4460
|
+
}], ctorParameters: function () { return [{ type: SectionService }]; }, propDecorators: { node: [{
|
|
4461
|
+
type: Input
|
|
4462
|
+
}], editMode: [{
|
|
4463
|
+
type: Input
|
|
4464
|
+
}], pasteMode: [{
|
|
4465
|
+
type: Input
|
|
4466
|
+
}], readonly: [{
|
|
4467
|
+
type: Input
|
|
4468
|
+
}] } });
|
|
4469
|
+
|
|
4470
|
+
class SectionComponent {
|
|
4471
|
+
get _style() {
|
|
4472
|
+
return {
|
|
4473
|
+
width: this.pt.transform(this.section.style['width'], this.service.scale),
|
|
4474
|
+
paddingTop: this.pt.transform(this.section.style['padding-top'], this.service.scale),
|
|
4475
|
+
paddingRight: this.pt.transform(this.section.style['padding-right'], this.service.scale),
|
|
4476
|
+
paddingBottom: this.pt.transform(this.section.style['padding-bottom'], this.service.scale),
|
|
4477
|
+
paddingLeft: this.pt.transform(this.section.style['padding-left'], this.service.scale),
|
|
4478
|
+
userSelect: this.pasteMode ? 'none' : 'auto'
|
|
4479
|
+
};
|
|
4480
|
+
}
|
|
4481
|
+
constructor(service, pt) {
|
|
4482
|
+
this.service = service;
|
|
4483
|
+
this.pt = pt;
|
|
4484
|
+
this.editMode = false;
|
|
4485
|
+
this.pasteMode = false;
|
|
4486
|
+
this.readonly = false;
|
|
4487
|
+
}
|
|
4488
|
+
}
|
|
4489
|
+
SectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionComponent, deps: [{ token: SectionService }, { token: PtPipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
4490
|
+
SectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SectionComponent, selector: "rs-section", inputs: { section: "section", editMode: "editMode", pasteMode: "pasteMode", readonly: "readonly" }, host: { properties: { "style": "this._style" } }, providers: [PtPipe], ngImport: i0, template: "<div *ngIf=\"section.header\">\r\n <ng-container *ngFor=\"let node of section.header\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n </ng-container>\r\n</div>\r\n<ng-container *ngFor=\"let node of section.body\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n</ng-container>\r\n<div *ngIf=\"section.footer\">\r\n <ng-container *ngFor=\"let node of section.footer\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{display:block;background-color:#fff;margin-bottom:8px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NodeComponent, selector: "rs-node", inputs: ["node", "editMode", "pasteMode", "readonly"] }] });
|
|
4491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionComponent, decorators: [{
|
|
4492
|
+
type: Component,
|
|
4493
|
+
args: [{ selector: 'rs-section', providers: [PtPipe], template: "<div *ngIf=\"section.header\">\r\n <ng-container *ngFor=\"let node of section.header\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n </ng-container>\r\n</div>\r\n<ng-container *ngFor=\"let node of section.body\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n</ng-container>\r\n<div *ngIf=\"section.footer\">\r\n <ng-container *ngFor=\"let node of section.footer\">\r\n <rs-node [node]=\"node\" [editMode]=\"editMode\" [pasteMode]=\"pasteMode\" [readonly]=\"readonly\"></rs-node>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{display:block;background-color:#fff;margin-bottom:8px}\n"] }]
|
|
4494
|
+
}], ctorParameters: function () { return [{ type: SectionService }, { type: PtPipe }]; }, propDecorators: { section: [{
|
|
4495
|
+
type: Input
|
|
4496
|
+
}], editMode: [{
|
|
4497
|
+
type: Input
|
|
4498
|
+
}], pasteMode: [{
|
|
4499
|
+
type: Input
|
|
4500
|
+
}], readonly: [{
|
|
4501
|
+
type: Input
|
|
4502
|
+
}], _style: [{
|
|
4503
|
+
type: HostBinding,
|
|
4504
|
+
args: ['style']
|
|
4505
|
+
}] } });
|
|
4506
|
+
|
|
4507
|
+
class SectionModule {
|
|
4508
|
+
}
|
|
4509
|
+
SectionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4510
|
+
SectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SectionModule, declarations: [SectionComponent,
|
|
4511
|
+
NodeComponent,
|
|
4512
|
+
ParagraphComponent,
|
|
4513
|
+
RunComponent,
|
|
4514
|
+
ParagraphForInputComponent,
|
|
4515
|
+
ItemComponent,
|
|
4516
|
+
ColorPipe,
|
|
4517
|
+
MarkPipe,
|
|
4518
|
+
PtPipe], imports: [CommonModule], exports: [SectionComponent,
|
|
4519
|
+
NodeComponent] });
|
|
4520
|
+
SectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionModule, imports: [CommonModule] });
|
|
4521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SectionModule, decorators: [{
|
|
4522
|
+
type: NgModule,
|
|
4523
|
+
args: [{
|
|
4524
|
+
declarations: [
|
|
4525
|
+
SectionComponent,
|
|
4526
|
+
NodeComponent,
|
|
4527
|
+
ParagraphComponent,
|
|
4528
|
+
RunComponent,
|
|
4529
|
+
ParagraphForInputComponent,
|
|
4530
|
+
ItemComponent,
|
|
4531
|
+
ColorPipe,
|
|
4532
|
+
MarkPipe,
|
|
4533
|
+
PtPipe
|
|
4534
|
+
],
|
|
4535
|
+
imports: [
|
|
4536
|
+
CommonModule
|
|
4537
|
+
],
|
|
4538
|
+
exports: [
|
|
4539
|
+
SectionComponent,
|
|
4540
|
+
NodeComponent
|
|
4541
|
+
]
|
|
4542
|
+
}]
|
|
4543
|
+
}] });
|
|
4544
|
+
|
|
4545
|
+
class WordDesignerService {
|
|
4546
|
+
constructor(http) {
|
|
4547
|
+
this.http = http;
|
|
4548
|
+
}
|
|
4549
|
+
loadTemplate(tenant, className, oid) {
|
|
4550
|
+
return this.http.get('api/data/' + className + '/' + oid, {
|
|
4551
|
+
params: {
|
|
4552
|
+
tenant
|
|
4553
|
+
}
|
|
4554
|
+
}).pipe(map(response => {
|
|
4555
|
+
if (response.data?.templateConfig) {
|
|
4556
|
+
return JSON.parse(response.data.templateConfig);
|
|
4557
|
+
}
|
|
4558
|
+
return {};
|
|
4559
|
+
}));
|
|
4560
|
+
}
|
|
4561
|
+
uploadTemplateFile(tenant, className, oid, retainMarkConfig, file) {
|
|
4562
|
+
const formData = new FormData();
|
|
4563
|
+
formData.append('file', file);
|
|
4564
|
+
return this.http.post('api/data/custom/upload', formData, {
|
|
4565
|
+
params: {
|
|
4566
|
+
executor: 'com.cs.system.word.designer.UploadTemplateFile',
|
|
4567
|
+
tenant,
|
|
4568
|
+
className,
|
|
4569
|
+
oid,
|
|
4570
|
+
retainMarkConfig,
|
|
4571
|
+
filename: file.name
|
|
4572
|
+
}
|
|
4573
|
+
}).pipe(map(response => {
|
|
4574
|
+
return response.data || {};
|
|
4575
|
+
}));
|
|
4576
|
+
}
|
|
4577
|
+
downloadTemplateFile(tenant, className, oid, callback) {
|
|
4578
|
+
return this.http.get('api/data/custom/download', {
|
|
4579
|
+
params: {
|
|
4580
|
+
executor: 'com.cs.system.word.designer.DownloadTemplate',
|
|
4581
|
+
tenant,
|
|
4582
|
+
className,
|
|
4583
|
+
oid
|
|
4584
|
+
},
|
|
4585
|
+
observe: 'response',
|
|
4586
|
+
responseType: 'blob'
|
|
4587
|
+
}).subscribe(response => {
|
|
4588
|
+
const disposition = response.headers.get('Content-Disposition');
|
|
4589
|
+
const filename = disposition && filenameFromDisposition(disposition);
|
|
4590
|
+
if (response.body) {
|
|
4591
|
+
downloadFile(response.body, filename || '未命名文件', callback);
|
|
4592
|
+
}
|
|
4593
|
+
});
|
|
4594
|
+
}
|
|
4595
|
+
save(tenant, className, oid, model) {
|
|
4596
|
+
return this.http.post('api/data/' + className + '/' + oid, model, {
|
|
4597
|
+
params: {
|
|
4598
|
+
tenant
|
|
4599
|
+
}
|
|
4600
|
+
});
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
WordDesignerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4604
|
+
WordDesignerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerService });
|
|
4605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerService, decorators: [{
|
|
4606
|
+
type: Injectable
|
|
4607
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
4608
|
+
|
|
4609
|
+
class MarkConfigComponent {
|
|
4610
|
+
constructor() {
|
|
4611
|
+
this.changeMark = false;
|
|
4612
|
+
}
|
|
4613
|
+
get mark() {
|
|
4614
|
+
return this._mark;
|
|
4615
|
+
}
|
|
4616
|
+
set mark(mark) {
|
|
4617
|
+
if (!mark) {
|
|
4618
|
+
return;
|
|
4619
|
+
}
|
|
4620
|
+
this._mark = mark;
|
|
4621
|
+
this.changeMark = true;
|
|
4622
|
+
this.loadMarkConfig();
|
|
4623
|
+
}
|
|
4624
|
+
ngOnInit() {
|
|
4625
|
+
this.markTypes = MarkItemFactory.getMarkItems(...this.filterCategories || '');
|
|
4626
|
+
}
|
|
4627
|
+
loadMarkConfig() {
|
|
4628
|
+
setTimeout(() => {
|
|
4629
|
+
this.markItemConfigRef.clear();
|
|
4630
|
+
let config = MarkItemFactory.getConfig(this.mark.type);
|
|
4631
|
+
if (!config) {
|
|
4632
|
+
return;
|
|
4633
|
+
}
|
|
4634
|
+
const componentRef = this.markItemConfigRef.createComponent(config.component);
|
|
4635
|
+
const instance = componentRef.instance;
|
|
4636
|
+
instance.tenant = this.tenant;
|
|
4637
|
+
instance.templateClassName = this.templateClassName;
|
|
4638
|
+
instance.templateOid = this.templateOid;
|
|
4639
|
+
instance.instanceClassName = this.instanceClassName;
|
|
4640
|
+
instance.mark = this.mark;
|
|
4641
|
+
instance.marks = this.marks;
|
|
4642
|
+
});
|
|
4643
|
+
}
|
|
4644
|
+
changeMarkType() {
|
|
4645
|
+
if (this.changeMark) {
|
|
4646
|
+
this.changeMark = false;
|
|
4647
|
+
}
|
|
4648
|
+
else {
|
|
4649
|
+
this.mark.pickerCode = null;
|
|
4650
|
+
this.mark.generatorCode = null;
|
|
4651
|
+
}
|
|
4652
|
+
this.loadMarkConfig();
|
|
4653
|
+
}
|
|
4654
|
+
}
|
|
4655
|
+
MarkConfigComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MarkConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4656
|
+
MarkConfigComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MarkConfigComponent, selector: "rs-mark-config", inputs: { tenant: "tenant", templateClassName: "templateClassName", templateOid: "templateOid", instanceClassName: "instanceClassName", filterCategories: "filterCategories", mark: "mark", marks: "marks" }, viewQueries: [{ propertyName: "markItemConfigRef", first: true, predicate: ["markItemConfigRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div class=\"dx-field\">\n <div class=\"dx-field-label\">\n <span>\u4E66\u7B7E\u6807\u8BC6</span>\n <span class=\"required-mark\"> *</span>\n </div>\n <div class=\"dx-field-value\">\n <dx-text-box [(value)]=\"mark.name\" [readOnly]=\"true\">\n <dx-validator>\n <dxi-validation-rule type=\"required\" message=\"\u503C\u4E0D\u80FD\u4E3A\u7A7A\"></dxi-validation-rule>\n </dx-validator>\n </dx-text-box>\n </div>\n</div>\n<div class=\"dx-field\">\n <div class=\"dx-field-label\">\n <span>\u4E66\u7B7E\u540D\u79F0</span>\n </div>\n <div class=\"dx-field-value\">\n <dx-text-box [(value)]=\"mark.display\"></dx-text-box>\n </div>\n</div>\n<div class=\"dx-field\">\n <div class=\"dx-field-label\">\n <span>\u7EC4\u4EF6\u7C7B\u578B</span>\n <span class=\"required-mark\"> *</span>\n </div>\n <div class=\"dx-field-value\">\n <dx-select-box [dataSource]=\"markTypes\"\n valueExpr=\"name\"\n displayExpr=\"caption\"\n [(value)]=\"mark.type\"\n (onSelectionChanged)=\"changeMarkType()\">\n <dx-validator>\n <dxi-validation-rule type=\"required\" message=\"\u503C\u4E0D\u80FD\u4E3A\u7A7A\"></dxi-validation-rule>\n </dx-validator>\n </dx-select-box>\n </div>\n</div>\n<ng-container #markItemConfigRef></ng-container>\n", styles: [":host .dx-field{margin-bottom:8px;display:flex;flex-flow:row nowrap}:host .dx-field .dx-field-label{flex:0 0 80px}:host .dx-field .dx-field-value{flex:1}\n"], dependencies: [{ kind: "component", type: i6.DxiValidationRuleComponent, selector: "dxi-validation-rule", inputs: ["message", "trim", "type", "ignoreEmptyValue", "max", "min", "reevaluate", "validationCallback", "comparisonTarget", "comparisonType", "pattern"] }, { kind: "component", type: i2$4.DxSelectBoxComponent, selector: "dx-select-box", inputs: ["acceptCustomValue", "accessKey", "activeStateEnabled", "buttons", "customItemCreateEvent", "dataSource", "deferRendering", "disabled", "displayExpr", "displayValue", "dropDownButtonTemplate", "dropDownOptions", "elementAttr", "fieldTemplate", "focusStateEnabled", "grouped", "groupTemplate", "height", "hint", "hoverStateEnabled", "inputAttr", "isDirty", "isValid", "items", "itemTemplate", "label", "labelMode", "maxLength", "minSearchLength", "name", "noDataText", "opened", "openOnFieldClick", "placeholder", "readOnly", "rtlEnabled", "searchEnabled", "searchExpr", "searchMode", "searchTimeout", "selectedItem", "showClearButton", "showDataBeforeSearch", "showDropDownButton", "showSelectionControls", "spellcheck", "stylingMode", "tabIndex", "text", "useItemTextAsTitle", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "valueChangeEvent", "valueExpr", "visible", "width", "wrapItemText"], outputs: ["onChange", "onClosed", "onContentReady", "onCopy", "onCustomItemCreating", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onItemClick", "onKeyDown", "onKeyUp", "onOpened", "onOptionChanged", "onPaste", "onSelectionChanged", "onValueChanged", "acceptCustomValueChange", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "customItemCreateEventChange", "dataSourceChange", "deferRenderingChange", "disabledChange", "displayExprChange", "displayValueChange", "dropDownButtonTemplateChange", "dropDownOptionsChange", "elementAttrChange", "fieldTemplateChange", "focusStateEnabledChange", "groupedChange", "groupTemplateChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isDirtyChange", "isValidChange", "itemsChange", "itemTemplateChange", "labelChange", "labelModeChange", "maxLengthChange", "minSearchLengthChange", "nameChange", "noDataTextChange", "openedChange", "openOnFieldClickChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "searchEnabledChange", "searchExprChange", "searchModeChange", "searchTimeoutChange", "selectedItemChange", "showClearButtonChange", "showDataBeforeSearchChange", "showDropDownButtonChange", "showSelectionControlsChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useItemTextAsTitleChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationMessagePositionChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "valueExprChange", "visibleChange", "widthChange", "wrapItemTextChange", "onBlur"] }, { kind: "component", type: i7.DxTextBoxComponent, selector: "dx-text-box", inputs: ["accessKey", "activeStateEnabled", "buttons", "disabled", "elementAttr", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "inputAttr", "isDirty", "isValid", "label", "labelMode", "mask", "maskChar", "maskInvalidMessage", "maskRules", "maxLength", "mode", "name", "placeholder", "readOnly", "rtlEnabled", "showClearButton", "showMaskMode", "spellcheck", "stylingMode", "tabIndex", "text", "useMaskedValue", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "valueChangeEvent", "visible", "width"], outputs: ["onChange", "onContentReady", "onCopy", "onCut", "onDisposing", "onEnterKey", "onFocusIn", "onFocusOut", "onInitialized", "onInput", "onKeyDown", "onKeyUp", "onOptionChanged", "onPaste", "onValueChanged", "accessKeyChange", "activeStateEnabledChange", "buttonsChange", "disabledChange", "elementAttrChange", "focusStateEnabledChange", "heightChange", "hintChange", "hoverStateEnabledChange", "inputAttrChange", "isDirtyChange", "isValidChange", "labelChange", "labelModeChange", "maskChange", "maskCharChange", "maskInvalidMessageChange", "maskRulesChange", "maxLengthChange", "modeChange", "nameChange", "placeholderChange", "readOnlyChange", "rtlEnabledChange", "showClearButtonChange", "showMaskModeChange", "spellcheckChange", "stylingModeChange", "tabIndexChange", "textChange", "useMaskedValueChange", "validationErrorChange", "validationErrorsChange", "validationMessageModeChange", "validationMessagePositionChange", "validationStatusChange", "valueChange", "valueChangeEventChange", "visibleChange", "widthChange", "onBlur"] }, { kind: "component", type: i8.DxValidatorComponent, selector: "dx-validator", inputs: ["adapter", "elementAttr", "height", "name", "validationGroup", "validationRules", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "onValidated", "adapterChange", "elementAttrChange", "heightChange", "nameChange", "validationGroupChange", "validationRulesChange", "widthChange"] }] });
|
|
4657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MarkConfigComponent, decorators: [{
|
|
4658
|
+
type: Component,
|
|
4659
|
+
args: [{ selector: 'rs-mark-config', template: "<div class=\"dx-field\">\n <div class=\"dx-field-label\">\n <span>\u4E66\u7B7E\u6807\u8BC6</span>\n <span class=\"required-mark\"> *</span>\n </div>\n <div class=\"dx-field-value\">\n <dx-text-box [(value)]=\"mark.name\" [readOnly]=\"true\">\n <dx-validator>\n <dxi-validation-rule type=\"required\" message=\"\u503C\u4E0D\u80FD\u4E3A\u7A7A\"></dxi-validation-rule>\n </dx-validator>\n </dx-text-box>\n </div>\n</div>\n<div class=\"dx-field\">\n <div class=\"dx-field-label\">\n <span>\u4E66\u7B7E\u540D\u79F0</span>\n </div>\n <div class=\"dx-field-value\">\n <dx-text-box [(value)]=\"mark.display\"></dx-text-box>\n </div>\n</div>\n<div class=\"dx-field\">\n <div class=\"dx-field-label\">\n <span>\u7EC4\u4EF6\u7C7B\u578B</span>\n <span class=\"required-mark\"> *</span>\n </div>\n <div class=\"dx-field-value\">\n <dx-select-box [dataSource]=\"markTypes\"\n valueExpr=\"name\"\n displayExpr=\"caption\"\n [(value)]=\"mark.type\"\n (onSelectionChanged)=\"changeMarkType()\">\n <dx-validator>\n <dxi-validation-rule type=\"required\" message=\"\u503C\u4E0D\u80FD\u4E3A\u7A7A\"></dxi-validation-rule>\n </dx-validator>\n </dx-select-box>\n </div>\n</div>\n<ng-container #markItemConfigRef></ng-container>\n", styles: [":host .dx-field{margin-bottom:8px;display:flex;flex-flow:row nowrap}:host .dx-field .dx-field-label{flex:0 0 80px}:host .dx-field .dx-field-value{flex:1}\n"] }]
|
|
4660
|
+
}], propDecorators: { tenant: [{
|
|
4661
|
+
type: Input
|
|
4662
|
+
}], templateClassName: [{
|
|
4663
|
+
type: Input
|
|
4664
|
+
}], templateOid: [{
|
|
4665
|
+
type: Input
|
|
4666
|
+
}], instanceClassName: [{
|
|
4667
|
+
type: Input
|
|
4668
|
+
}], filterCategories: [{
|
|
4669
|
+
type: Input
|
|
4670
|
+
}], mark: [{
|
|
4671
|
+
type: Input
|
|
4672
|
+
}], marks: [{
|
|
4673
|
+
type: Input
|
|
4674
|
+
}], markItemConfigRef: [{
|
|
4675
|
+
type: ViewChild,
|
|
4676
|
+
args: ['markItemConfigRef', { static: true, read: ViewContainerRef }]
|
|
4677
|
+
}] } });
|
|
4678
|
+
|
|
4679
|
+
class WordDesignerComponent {
|
|
4680
|
+
handleKeyDown($event) {
|
|
4681
|
+
switch ($event.code) {
|
|
4682
|
+
case 'ArrowUp':
|
|
4683
|
+
if ($event.altKey) {
|
|
4684
|
+
this.service.switchMark(-1);
|
|
4685
|
+
}
|
|
4686
|
+
break;
|
|
4687
|
+
case 'ArrowDown':
|
|
4688
|
+
if ($event.altKey) {
|
|
4689
|
+
this.service.switchMark(1);
|
|
4690
|
+
}
|
|
4691
|
+
break;
|
|
4692
|
+
case 'KeyC':
|
|
4693
|
+
if ($event.ctrlKey) {
|
|
4694
|
+
const selection = window.getSelection();
|
|
4695
|
+
if (selection?.toString()) {
|
|
4696
|
+
return;
|
|
4697
|
+
}
|
|
4698
|
+
this.copyMarkConfig();
|
|
4699
|
+
}
|
|
4700
|
+
break;
|
|
4701
|
+
case 'KeyV':
|
|
4702
|
+
if ($event.ctrlKey) {
|
|
4703
|
+
this.pasteMarkConfig();
|
|
4704
|
+
}
|
|
4705
|
+
break;
|
|
4706
|
+
case 'Escape':
|
|
4707
|
+
this.exitPasteMode();
|
|
4708
|
+
break;
|
|
4709
|
+
}
|
|
4710
|
+
if (this.mouseInViewer && $event.ctrlKey && $event.key === '0') {
|
|
4711
|
+
$event.preventDefault();
|
|
4712
|
+
this.scale(0);
|
|
4713
|
+
}
|
|
4714
|
+
}
|
|
4715
|
+
constructor(service, wordDesignerService, viewContainerRef, modalService) {
|
|
4716
|
+
this.service = service;
|
|
4717
|
+
this.wordDesignerService = wordDesignerService;
|
|
4718
|
+
this.viewContainerRef = viewContainerRef;
|
|
4719
|
+
this.modalService = modalService;
|
|
4720
|
+
this.needUpload = false;
|
|
4721
|
+
this.pasteMode = false;
|
|
4722
|
+
this.mouseInViewer = false;
|
|
4723
|
+
this.loading = false;
|
|
4724
|
+
this.retainMarkConfig = false;
|
|
4725
|
+
}
|
|
4726
|
+
ngOnInit() {
|
|
4727
|
+
this.service.tenant = this.tenant;
|
|
4728
|
+
this.service.templateClassName = this.className;
|
|
4729
|
+
this.service.templateOid = this.oid;
|
|
4730
|
+
this.service.instanceClassName = this.instanceClassName;
|
|
4731
|
+
this.service.params = this.params;
|
|
4732
|
+
this.service.tabViewContainerRef = this.tabViewContainerRef;
|
|
4733
|
+
this.loading = true;
|
|
4734
|
+
this.wordDesignerService.loadTemplate(this.tenant, this.className, this.oid).subscribe(response => {
|
|
4735
|
+
this.loadTemplateAndConfig(response);
|
|
4736
|
+
this.loading = false;
|
|
4737
|
+
});
|
|
4738
|
+
}
|
|
4739
|
+
loadTemplateAndConfig(response) {
|
|
4740
|
+
this.sections = response.sections || [];
|
|
4741
|
+
if (this.sections.length === 0) {
|
|
4742
|
+
this.needUpload = true;
|
|
4743
|
+
this.loading = false;
|
|
4744
|
+
return;
|
|
4745
|
+
}
|
|
4746
|
+
this.needUpload = false;
|
|
4747
|
+
this.service.marks = response.marks.map((mark) => {
|
|
4748
|
+
mark.config = mark.config || {};
|
|
4749
|
+
return mark;
|
|
4750
|
+
});
|
|
4751
|
+
if (this.service.marks.length > 0) {
|
|
4752
|
+
this.service.activeMark = this.service.marks[0];
|
|
4753
|
+
}
|
|
4754
|
+
}
|
|
4755
|
+
scaleByMouse($event) {
|
|
4756
|
+
if ($event.ctrlKey) {
|
|
4757
|
+
$event.preventDefault();
|
|
4758
|
+
this.scale($event.deltaY < 0 ? 0.1 : -0.1);
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4761
|
+
scale(type) {
|
|
4762
|
+
if (type === 0) {
|
|
4763
|
+
this.service.scale = 1;
|
|
4764
|
+
}
|
|
4765
|
+
else {
|
|
4766
|
+
this.service.scale += type;
|
|
4767
|
+
}
|
|
4768
|
+
}
|
|
4769
|
+
upload() {
|
|
4770
|
+
this.loading = true;
|
|
4771
|
+
this.wordDesignerService.uploadTemplateFile(this.tenant, this.className, this.oid, this.retainMarkConfig, this.uploadInput.nativeElement.files[0]).subscribe(response => {
|
|
4772
|
+
this.uploadInput.nativeElement.value = '';
|
|
4773
|
+
this.loadTemplateAndConfig(response);
|
|
4774
|
+
this.loading = false;
|
|
4775
|
+
});
|
|
4776
|
+
}
|
|
4777
|
+
openReplaceTemplateFileModal() {
|
|
4778
|
+
this.replaceFileModal = this.modalService.open(this.tabViewContainerRef, '替换文件', 'default', this.replaceFileModalTemplate, {});
|
|
4779
|
+
}
|
|
4780
|
+
replaceTemplateFile(retainMarkConfig) {
|
|
4781
|
+
this.retainMarkConfig = retainMarkConfig;
|
|
4782
|
+
this.uploadInput.nativeElement.click();
|
|
4783
|
+
this.replaceFileModal?.hide();
|
|
4784
|
+
}
|
|
4785
|
+
downloadTemplateFile() {
|
|
4786
|
+
this.loading = true;
|
|
4787
|
+
this.wordDesignerService.downloadTemplateFile(this.tenant, this.className, this.oid, () => {
|
|
4788
|
+
this.loading = false;
|
|
4789
|
+
});
|
|
4790
|
+
}
|
|
4791
|
+
preview() {
|
|
4792
|
+
for (let mark of this.service.marks) {
|
|
4793
|
+
mark.value = undefined;
|
|
4794
|
+
}
|
|
4795
|
+
this.previewModal = this.modalService.open(this.tabViewContainerRef, '预览', 'full', this.previewTemplate, {}, this.previewFooterTemplate);
|
|
4796
|
+
}
|
|
4797
|
+
saveConfig() {
|
|
4798
|
+
this.loading = true;
|
|
4799
|
+
this.service.marks.map(mark => {
|
|
4800
|
+
delete mark.value;
|
|
4801
|
+
});
|
|
4802
|
+
this.wordDesignerService.save(this.tenant, this.className, this.oid, {
|
|
4803
|
+
templateConfig: JSON.stringify({
|
|
4804
|
+
sections: this.sections,
|
|
4805
|
+
marks: this.service.marks
|
|
4806
|
+
})
|
|
4807
|
+
}).subscribe(response => {
|
|
4808
|
+
if (response.success) {
|
|
4809
|
+
notifySuccess('保存成功');
|
|
4810
|
+
this.loading = false;
|
|
4811
|
+
}
|
|
4812
|
+
});
|
|
4813
|
+
}
|
|
4814
|
+
copyMarkConfig() {
|
|
4815
|
+
this.service.copiedMark = deepClone(this.service.activeMark);
|
|
4816
|
+
this.pasteMode = true;
|
|
4817
|
+
}
|
|
4818
|
+
exitPasteMode() {
|
|
4819
|
+
this.service.copiedMark = {};
|
|
4820
|
+
this.service.readyPasteMarkNames = [];
|
|
4821
|
+
this.service.lastClickToPasteMarkName = '';
|
|
4822
|
+
this.pasteMode = false;
|
|
4823
|
+
}
|
|
4824
|
+
pasteMarkConfig() {
|
|
4825
|
+
let readyPasteMark;
|
|
4826
|
+
for (let readyPasteMarkName of this.service.readyPasteMarkNames) {
|
|
4827
|
+
readyPasteMark = this.service.getMark(readyPasteMarkName);
|
|
4828
|
+
const display = readyPasteMark.display;
|
|
4829
|
+
Object.assign(readyPasteMark, deepClone(this.service.copiedMark));
|
|
4830
|
+
readyPasteMark.name = readyPasteMarkName;
|
|
4831
|
+
readyPasteMark.display = display;
|
|
4832
|
+
}
|
|
4833
|
+
this.service.activeMark = readyPasteMark || this.service.activeMark;
|
|
4834
|
+
this.exitPasteMode();
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
WordDesignerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerComponent, deps: [{ token: SectionService }, { token: WordDesignerService }, { token: i0.ViewContainerRef }, { token: ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4838
|
+
WordDesignerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WordDesignerComponent, selector: "rs-word-designer", inputs: { tenant: "tenant", className: "className", oid: "oid", instanceClassName: "instanceClassName", filterCategories: "filterCategories", params: "params", tabViewContainerRef: "tabViewContainerRef" }, host: { listeners: { "window:keydown": "handleKeyDown($event)" } }, providers: [WordDesignerService], viewQueries: [{ propertyName: "uploadInput", first: true, predicate: ["uploadInput"], descendants: true, static: true }, { propertyName: "replaceFileModalTemplate", first: true, predicate: ["replaceFileModalTemplate"], descendants: true, static: true }, { propertyName: "previewTemplate", first: true, predicate: ["previewTemplate"], descendants: true, static: true }, { propertyName: "previewFooterTemplate", first: true, predicate: ["previewFooterTemplate"], descendants: true, static: true }], ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\" [visible]=\"loading\">\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\n</dx-load-panel>\n<input #uploadInput type=\"file\" name=\"file\"\n accept=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" (change)=\"upload()\"\n style=\"display: none;\"/>\n<div class=\"coast-card\">\n <div class=\"coast-card-content\">\n <div class=\"content-main\" [class.show-upload-btn]=\"needUpload\">\n <ng-container *ngIf=\"needUpload\">\n <dx-button type=\"success\" text=\"\u4E0A\u4F20\u6587\u4EF6\" (onClick)=\"uploadInput.click()\"></dx-button>\n </ng-container>\n <div *ngIf=\"!needUpload\" class=\"left-panel\">\n <div *ngIf=\"pasteMode\" class=\"paste-mode-bar\">\n <span\n class=\"message\">\u5DF2\u8FDB\u5165\u6279\u91CF\u7C98\u8D34\u914D\u7F6E\u6A21\u5F0F\uFF0C\u652F\u6301Ctrl\u3001Shift\u952E\u5FEB\u6377\u9009\u62E9\uFF0C\u6309Ctrl+V\u7EC4\u5408\u952E\u7C98\u8D34\u914D\u7F6E\uFF0C\u6309Esc\u952E\u53D6\u6D88\u64CD\u4F5C\u5E76\u9000\u51FA\u8BE5\u6A21\u5F0F</span>\n <dx-button [width]=\"48\" text=\"\u9000\u51FA\" (onClick)=\"exitPasteMode()\"></dx-button>\n </div>\n <div class=\"content\"\n (mouseenter)=\"mouseInViewer = true;\"\n (mouseleave)=\"mouseInViewer = false;\"\n (mousewheel)=\"scaleByMouse($event)\">\n <div *ngIf=\"!needUpload\" class=\"viewer\">\n <ng-container *ngFor=\"let section of sections\">\n <rs-section [section]=\"section\" [editMode]=\"true\" [pasteMode]=\"pasteMode\"></rs-section>\n </ng-container>\n </div>\n </div>\n </div>\n <div *ngIf=\"!needUpload\" class=\"right-panel\">\n <div class=\"header\">\n <dx-button type=\"default\" text=\"\u66FF\u6362\u6587\u4EF6\" (onClick)=\"openReplaceTemplateFileModal()\"\n [disabled]=\"loading\"></dx-button>\n <dx-button icon=\"coast-icon coast-icon-download\" hint=\"\u4E0B\u8F7D\u6587\u4EF6\"\n (onClick)=\"downloadTemplateFile()\" [disabled]=\"loading\"></dx-button>\n <dx-button icon=\"coast-icon coast-icon-direction-up\" hint=\"\u4E0A\u4E00\u4E2A(Alt + \u2191)\"\n (onClick)=\"service.switchMark(-1)\" [disabled]=\"loading\"></dx-button>\n <dx-button icon=\"coast-icon coast-icon-direction-down\" hint=\"\u4E0B\u4E00\u4E2A(Alt + \u2193)\"\n (onClick)=\"service.switchMark(1)\" [disabled]=\"loading\"></dx-button>\n <dx-button [type]=\"pasteMode ? 'success' : 'default'\" text=\"\u590D\u5236\" hint=\"\u590D\u5236(Ctrl + c)\"\n (onClick)=\"copyMarkConfig()\"></dx-button>\n <dx-button type=\"danger\" text=\"\u7C98\u8D34\" hint=\"\u7C98\u8D34(Ctrl + v)\" (onClick)=\"pasteMarkConfig()\"\n [disabled]=\"loading || !pasteMode\"></dx-button>\n </div>\n <div class=\"config\" *ngIf=\"service.activeMark\">\n <rs-mark-config [tenant]=\"tenant\"\n [templateClassName]=\"className\"\n [templateOid]=\"oid\"\n [instanceClassName]=\"instanceClassName\"\n [filterCategories]=\"filterCategories\"\n [mark]=\"service.activeMark\"\n [marks]=\"service.marks\"></rs-mark-config>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"!needUpload\" class=\"footer\">\n <div class=\"left\">\n <dx-button text=\"\u653E\u5927\" (onClick)=\"scale(0.1)\"></dx-button>\n <dx-button text=\"\u8FD8\u539F\" (onClick)=\"scale(0)\"></dx-button>\n <dx-button text=\"\u7F29\u5C0F\" (onClick)=\"scale(-0.1)\"></dx-button>\n </div>\n <div class=\"right\">\n <dx-button type=\"default\" text=\"\u9884\u89C8\" (onClick)=\"preview()\" [disabled]=\"needUpload || loading\"></dx-button>\n <dx-button type=\"success\" text=\"\u4FDD\u5B58\" (onClick)=\"saveConfig()\" [disabled]=\"needUpload || loading\"></dx-button>\n </div>\n </div>\n</div>\n<ng-template #replaceFileModalTemplate>\n <div class=\"confirm-message\">\n <span>\u66FF\u6362\u6587\u4EF6\u53EF\u4EE5\u6309\u7167\u4E66\u7B7E\u6807\u8BC6\u7EE7\u627F\u5DF2\u4FDD\u5B58\u7684\u4E66\u7B7E\u914D\u7F6E\uFF0C\u8BF7\u9009\u62E9\u64CD\u4F5C\uFF1A</span>\n </div>\n <div class=\"form-buttons\">\n <div class=\"buttons-wrapper\">\n <dx-button type=\"default\" text=\"\u7EE7\u627F\u914D\u7F6E\" (onClick)=\"replaceTemplateFile(true)\"></dx-button>\n <dx-button type=\"danger\" text=\"\u6E05\u9664\u914D\u7F6E\" (onClick)=\"replaceTemplateFile(false)\"></dx-button>\n <dx-button type=\"normal\" text=\"\u53D6\u6D88\" (onClick)=\"replaceFileModal?.hide()\"></dx-button>\n </div>\n </div>\n</ng-template>\n<ng-template #previewTemplate>\n <div class=\"preview-viewer\">\n <div class=\"viewer-container\">\n <div class=\"viewer\">\n <ng-container *ngFor=\"let section of sections\">\n <rs-section [section]=\"section\"></rs-section>\n </ng-container>\n </div>\n </div>\n </div>\n</ng-template>\n<ng-template #previewFooterTemplate>\n <div class=\"form-buttons\">\n <div class=\"buttons-wrapper\">\n <dx-button type=\"normal\" text=\"\u5173\u95ED\" (onClick)=\"previewModal?.hide()\"></dx-button>\n </div>\n </div>\n</ng-template>\n", styles: [":host{flex:1;display:flex;flex-flow:column nowrap}:host .coast-card{flex:1;padding:0}:host .coast-card .content-main{display:flex;flex-flow:row nowrap;padding:16px 0 0 16px;margin:0}:host .coast-card .content-main.show-upload-btn{padding:16px;background-color:var(--coast-empty-color, rgb(229, 229, 229));align-items:center;justify-content:center}:host .coast-card .content-main .left-panel{flex:auto;width:0;overflow-x:auto;background-color:var(--coast-empty-color, rgb(229, 229, 229));display:flex;flex-flow:column nowrap}:host .coast-card .content-main .left-panel .paste-mode-bar{flex:none;padding:8px;background-color:var(--coast-base-bg-color, rgb(255, 255, 255));border:1px solid var(--coast-border-color, rgb(221, 221, 221));display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:center}:host .coast-card .content-main .left-panel .paste-mode-bar .message{font-weight:700}:host .coast-card .content-main .left-panel .content{flex:auto;height:0;overflow-y:auto;padding:8px 16px 0;display:flex;flex-flow:row nowrap}:host .coast-card .content-main .left-panel .content .viewer{margin:auto;display:flex;flex-flow:column nowrap;align-items:center;z-index:0}:host .coast-card .content-main .right-panel{flex:0 0 320px;display:flex;flex-flow:column nowrap;border-left:1px solid var(--coast-border-color, rgb(221, 221, 221))}:host .coast-card .content-main .right-panel .header{flex:none;border-bottom:1px solid var(--coast-border-color, rgb(221, 221, 221));padding:0 16px 16px}:host .coast-card .content-main .right-panel .header>dx-button:not(:last-child){margin-right:8px}:host .coast-card .content-main .right-panel .config{flex:auto;height:0;overflow:auto;padding:24px;display:flex;flex-flow:column nowrap}:host .coast-card .footer{flex:none;border-top:1px solid var(--coast-border-color, rgb(221, 221, 221));padding:12px 24px;display:flex;flex-flow:row nowrap;justify-content:space-between}:host .coast-card .footer dx-button{width:80px}:host .coast-card .footer dx-button:not(:last-child){margin-right:8px}.confirm-message{padding:24px;margin-bottom:12px;border-bottom:1px solid var(--coast-border-color, rgb(221, 221, 221))}.confirm-message span{font-size:14px}.preview-viewer{flex:auto;height:0;overflow-y:auto;margin:0 16px;background-color:var(--coast-empty-color, rgb(229, 229, 229));display:flex;flex-flow:column nowrap}.preview-viewer .viewer-container{flex:auto;height:0;overflow-x:auto;padding:8px 16px 0;display:flex;flex-flow:row nowrap}.preview-viewer .viewer-container .viewer{margin:auto;display:flex;flex-flow:column nowrap;align-items:center;z-index:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i3.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$1.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: SectionComponent, selector: "rs-section", inputs: ["section", "editMode", "pasteMode", "readonly"] }, { kind: "component", type: MarkConfigComponent, selector: "rs-mark-config", inputs: ["tenant", "templateClassName", "templateOid", "instanceClassName", "filterCategories", "mark", "marks"] }] });
|
|
4839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerComponent, decorators: [{
|
|
4840
|
+
type: Component,
|
|
4841
|
+
args: [{ selector: 'rs-word-designer', providers: [WordDesignerService], template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\" [visible]=\"loading\">\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\n</dx-load-panel>\n<input #uploadInput type=\"file\" name=\"file\"\n accept=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" (change)=\"upload()\"\n style=\"display: none;\"/>\n<div class=\"coast-card\">\n <div class=\"coast-card-content\">\n <div class=\"content-main\" [class.show-upload-btn]=\"needUpload\">\n <ng-container *ngIf=\"needUpload\">\n <dx-button type=\"success\" text=\"\u4E0A\u4F20\u6587\u4EF6\" (onClick)=\"uploadInput.click()\"></dx-button>\n </ng-container>\n <div *ngIf=\"!needUpload\" class=\"left-panel\">\n <div *ngIf=\"pasteMode\" class=\"paste-mode-bar\">\n <span\n class=\"message\">\u5DF2\u8FDB\u5165\u6279\u91CF\u7C98\u8D34\u914D\u7F6E\u6A21\u5F0F\uFF0C\u652F\u6301Ctrl\u3001Shift\u952E\u5FEB\u6377\u9009\u62E9\uFF0C\u6309Ctrl+V\u7EC4\u5408\u952E\u7C98\u8D34\u914D\u7F6E\uFF0C\u6309Esc\u952E\u53D6\u6D88\u64CD\u4F5C\u5E76\u9000\u51FA\u8BE5\u6A21\u5F0F</span>\n <dx-button [width]=\"48\" text=\"\u9000\u51FA\" (onClick)=\"exitPasteMode()\"></dx-button>\n </div>\n <div class=\"content\"\n (mouseenter)=\"mouseInViewer = true;\"\n (mouseleave)=\"mouseInViewer = false;\"\n (mousewheel)=\"scaleByMouse($event)\">\n <div *ngIf=\"!needUpload\" class=\"viewer\">\n <ng-container *ngFor=\"let section of sections\">\n <rs-section [section]=\"section\" [editMode]=\"true\" [pasteMode]=\"pasteMode\"></rs-section>\n </ng-container>\n </div>\n </div>\n </div>\n <div *ngIf=\"!needUpload\" class=\"right-panel\">\n <div class=\"header\">\n <dx-button type=\"default\" text=\"\u66FF\u6362\u6587\u4EF6\" (onClick)=\"openReplaceTemplateFileModal()\"\n [disabled]=\"loading\"></dx-button>\n <dx-button icon=\"coast-icon coast-icon-download\" hint=\"\u4E0B\u8F7D\u6587\u4EF6\"\n (onClick)=\"downloadTemplateFile()\" [disabled]=\"loading\"></dx-button>\n <dx-button icon=\"coast-icon coast-icon-direction-up\" hint=\"\u4E0A\u4E00\u4E2A(Alt + \u2191)\"\n (onClick)=\"service.switchMark(-1)\" [disabled]=\"loading\"></dx-button>\n <dx-button icon=\"coast-icon coast-icon-direction-down\" hint=\"\u4E0B\u4E00\u4E2A(Alt + \u2193)\"\n (onClick)=\"service.switchMark(1)\" [disabled]=\"loading\"></dx-button>\n <dx-button [type]=\"pasteMode ? 'success' : 'default'\" text=\"\u590D\u5236\" hint=\"\u590D\u5236(Ctrl + c)\"\n (onClick)=\"copyMarkConfig()\"></dx-button>\n <dx-button type=\"danger\" text=\"\u7C98\u8D34\" hint=\"\u7C98\u8D34(Ctrl + v)\" (onClick)=\"pasteMarkConfig()\"\n [disabled]=\"loading || !pasteMode\"></dx-button>\n </div>\n <div class=\"config\" *ngIf=\"service.activeMark\">\n <rs-mark-config [tenant]=\"tenant\"\n [templateClassName]=\"className\"\n [templateOid]=\"oid\"\n [instanceClassName]=\"instanceClassName\"\n [filterCategories]=\"filterCategories\"\n [mark]=\"service.activeMark\"\n [marks]=\"service.marks\"></rs-mark-config>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"!needUpload\" class=\"footer\">\n <div class=\"left\">\n <dx-button text=\"\u653E\u5927\" (onClick)=\"scale(0.1)\"></dx-button>\n <dx-button text=\"\u8FD8\u539F\" (onClick)=\"scale(0)\"></dx-button>\n <dx-button text=\"\u7F29\u5C0F\" (onClick)=\"scale(-0.1)\"></dx-button>\n </div>\n <div class=\"right\">\n <dx-button type=\"default\" text=\"\u9884\u89C8\" (onClick)=\"preview()\" [disabled]=\"needUpload || loading\"></dx-button>\n <dx-button type=\"success\" text=\"\u4FDD\u5B58\" (onClick)=\"saveConfig()\" [disabled]=\"needUpload || loading\"></dx-button>\n </div>\n </div>\n</div>\n<ng-template #replaceFileModalTemplate>\n <div class=\"confirm-message\">\n <span>\u66FF\u6362\u6587\u4EF6\u53EF\u4EE5\u6309\u7167\u4E66\u7B7E\u6807\u8BC6\u7EE7\u627F\u5DF2\u4FDD\u5B58\u7684\u4E66\u7B7E\u914D\u7F6E\uFF0C\u8BF7\u9009\u62E9\u64CD\u4F5C\uFF1A</span>\n </div>\n <div class=\"form-buttons\">\n <div class=\"buttons-wrapper\">\n <dx-button type=\"default\" text=\"\u7EE7\u627F\u914D\u7F6E\" (onClick)=\"replaceTemplateFile(true)\"></dx-button>\n <dx-button type=\"danger\" text=\"\u6E05\u9664\u914D\u7F6E\" (onClick)=\"replaceTemplateFile(false)\"></dx-button>\n <dx-button type=\"normal\" text=\"\u53D6\u6D88\" (onClick)=\"replaceFileModal?.hide()\"></dx-button>\n </div>\n </div>\n</ng-template>\n<ng-template #previewTemplate>\n <div class=\"preview-viewer\">\n <div class=\"viewer-container\">\n <div class=\"viewer\">\n <ng-container *ngFor=\"let section of sections\">\n <rs-section [section]=\"section\"></rs-section>\n </ng-container>\n </div>\n </div>\n </div>\n</ng-template>\n<ng-template #previewFooterTemplate>\n <div class=\"form-buttons\">\n <div class=\"buttons-wrapper\">\n <dx-button type=\"normal\" text=\"\u5173\u95ED\" (onClick)=\"previewModal?.hide()\"></dx-button>\n </div>\n </div>\n</ng-template>\n", styles: [":host{flex:1;display:flex;flex-flow:column nowrap}:host .coast-card{flex:1;padding:0}:host .coast-card .content-main{display:flex;flex-flow:row nowrap;padding:16px 0 0 16px;margin:0}:host .coast-card .content-main.show-upload-btn{padding:16px;background-color:var(--coast-empty-color, rgb(229, 229, 229));align-items:center;justify-content:center}:host .coast-card .content-main .left-panel{flex:auto;width:0;overflow-x:auto;background-color:var(--coast-empty-color, rgb(229, 229, 229));display:flex;flex-flow:column nowrap}:host .coast-card .content-main .left-panel .paste-mode-bar{flex:none;padding:8px;background-color:var(--coast-base-bg-color, rgb(255, 255, 255));border:1px solid var(--coast-border-color, rgb(221, 221, 221));display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:center}:host .coast-card .content-main .left-panel .paste-mode-bar .message{font-weight:700}:host .coast-card .content-main .left-panel .content{flex:auto;height:0;overflow-y:auto;padding:8px 16px 0;display:flex;flex-flow:row nowrap}:host .coast-card .content-main .left-panel .content .viewer{margin:auto;display:flex;flex-flow:column nowrap;align-items:center;z-index:0}:host .coast-card .content-main .right-panel{flex:0 0 320px;display:flex;flex-flow:column nowrap;border-left:1px solid var(--coast-border-color, rgb(221, 221, 221))}:host .coast-card .content-main .right-panel .header{flex:none;border-bottom:1px solid var(--coast-border-color, rgb(221, 221, 221));padding:0 16px 16px}:host .coast-card .content-main .right-panel .header>dx-button:not(:last-child){margin-right:8px}:host .coast-card .content-main .right-panel .config{flex:auto;height:0;overflow:auto;padding:24px;display:flex;flex-flow:column nowrap}:host .coast-card .footer{flex:none;border-top:1px solid var(--coast-border-color, rgb(221, 221, 221));padding:12px 24px;display:flex;flex-flow:row nowrap;justify-content:space-between}:host .coast-card .footer dx-button{width:80px}:host .coast-card .footer dx-button:not(:last-child){margin-right:8px}.confirm-message{padding:24px;margin-bottom:12px;border-bottom:1px solid var(--coast-border-color, rgb(221, 221, 221))}.confirm-message span{font-size:14px}.preview-viewer{flex:auto;height:0;overflow-y:auto;margin:0 16px;background-color:var(--coast-empty-color, rgb(229, 229, 229));display:flex;flex-flow:column nowrap}.preview-viewer .viewer-container{flex:auto;height:0;overflow-x:auto;padding:8px 16px 0;display:flex;flex-flow:row nowrap}.preview-viewer .viewer-container .viewer{margin:auto;display:flex;flex-flow:column nowrap;align-items:center;z-index:0}\n"] }]
|
|
4842
|
+
}], ctorParameters: function () { return [{ type: SectionService }, { type: WordDesignerService }, { type: i0.ViewContainerRef }, { type: ModalService }]; }, propDecorators: { tenant: [{
|
|
4843
|
+
type: Input
|
|
4844
|
+
}], className: [{
|
|
4845
|
+
type: Input
|
|
4846
|
+
}], oid: [{
|
|
4847
|
+
type: Input
|
|
4848
|
+
}], instanceClassName: [{
|
|
4849
|
+
type: Input
|
|
4850
|
+
}], filterCategories: [{
|
|
4851
|
+
type: Input
|
|
4852
|
+
}], params: [{
|
|
4853
|
+
type: Input
|
|
4854
|
+
}], tabViewContainerRef: [{
|
|
4855
|
+
type: Input
|
|
4856
|
+
}], uploadInput: [{
|
|
4857
|
+
type: ViewChild,
|
|
4858
|
+
args: ['uploadInput', { static: true }]
|
|
4859
|
+
}], replaceFileModalTemplate: [{
|
|
4860
|
+
type: ViewChild,
|
|
4861
|
+
args: ['replaceFileModalTemplate', { static: true }]
|
|
4862
|
+
}], previewTemplate: [{
|
|
4863
|
+
type: ViewChild,
|
|
4864
|
+
args: ['previewTemplate', { static: true }]
|
|
4865
|
+
}], previewFooterTemplate: [{
|
|
4866
|
+
type: ViewChild,
|
|
4867
|
+
args: ['previewFooterTemplate', { static: true }]
|
|
4868
|
+
}], handleKeyDown: [{
|
|
4869
|
+
type: HostListener,
|
|
4870
|
+
args: ['window:keydown', ['$event']]
|
|
4871
|
+
}] } });
|
|
4872
|
+
|
|
4873
|
+
class WordDesignerModule {
|
|
4874
|
+
}
|
|
4875
|
+
WordDesignerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4876
|
+
WordDesignerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerModule, declarations: [WordDesignerComponent,
|
|
4877
|
+
MarkConfigComponent], imports: [CommonModule,
|
|
4878
|
+
DevExtremeModule,
|
|
4879
|
+
SectionModule], exports: [WordDesignerComponent] });
|
|
4880
|
+
WordDesignerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerModule, imports: [CommonModule,
|
|
4881
|
+
DevExtremeModule,
|
|
4882
|
+
SectionModule] });
|
|
4883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordDesignerModule, decorators: [{
|
|
4884
|
+
type: NgModule,
|
|
4885
|
+
args: [{
|
|
4886
|
+
declarations: [
|
|
4887
|
+
WordDesignerComponent,
|
|
4888
|
+
MarkConfigComponent
|
|
4889
|
+
],
|
|
4890
|
+
imports: [
|
|
4891
|
+
CommonModule,
|
|
4892
|
+
DevExtremeModule,
|
|
4893
|
+
SectionModule
|
|
4894
|
+
],
|
|
4895
|
+
exports: [
|
|
4896
|
+
WordDesignerComponent
|
|
4897
|
+
]
|
|
4898
|
+
}]
|
|
4899
|
+
}] });
|
|
4900
|
+
|
|
4901
|
+
class WordEditorService {
|
|
4902
|
+
constructor(http) {
|
|
4903
|
+
this.http = http;
|
|
4904
|
+
}
|
|
4905
|
+
loadTemplate(tenant, className, oid) {
|
|
4906
|
+
return this.http.get('api/data/' + className + '/' + oid, {
|
|
4907
|
+
params: {
|
|
4908
|
+
tenant
|
|
4909
|
+
}
|
|
4910
|
+
}).pipe(map(response => {
|
|
4911
|
+
if (response.data?.templateConfig) {
|
|
4912
|
+
return JSON.parse(response.data.templateConfig);
|
|
4913
|
+
}
|
|
4914
|
+
return {};
|
|
4915
|
+
}));
|
|
4916
|
+
}
|
|
4917
|
+
save(tenant, className, oid, model) {
|
|
4918
|
+
return this.http.post('api/data/' + className + '/' + oid, model, {
|
|
4919
|
+
params: {
|
|
4920
|
+
tenant
|
|
4921
|
+
}
|
|
4922
|
+
});
|
|
4923
|
+
}
|
|
4924
|
+
reloadTemplate(tenant, className, oid, templateClassName) {
|
|
4925
|
+
return this.http.get('api/data/custom', {
|
|
4926
|
+
params: {
|
|
4927
|
+
executor: 'com.cs.system.word.editor.ReloadTemplate',
|
|
4928
|
+
tenant,
|
|
4929
|
+
className,
|
|
4930
|
+
oid,
|
|
4931
|
+
templateClassName
|
|
4932
|
+
}
|
|
4933
|
+
});
|
|
4934
|
+
}
|
|
4935
|
+
pullData(tenant, className, oid, marks) {
|
|
4936
|
+
return this.http.post('api/data/custom', marks, {
|
|
4937
|
+
params: {
|
|
4938
|
+
executor: 'com.cs.system.word.editor.PullData',
|
|
4939
|
+
tenant,
|
|
4940
|
+
className,
|
|
4941
|
+
oid
|
|
4942
|
+
}
|
|
4943
|
+
});
|
|
4944
|
+
}
|
|
4945
|
+
generateFile(tenant, className, oid, generateFileAttribute, generateFileName, model) {
|
|
4946
|
+
return this.http.post('api/data/custom', model, {
|
|
4947
|
+
params: {
|
|
4948
|
+
executor: 'com.cs.system.word.editor.GenerateFile',
|
|
4949
|
+
tenant,
|
|
4950
|
+
className,
|
|
4951
|
+
oid,
|
|
4952
|
+
generateFileAttribute,
|
|
4953
|
+
generateFileName
|
|
4954
|
+
}
|
|
4955
|
+
});
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
WordEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4959
|
+
WordEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorService });
|
|
4960
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorService, decorators: [{
|
|
4961
|
+
type: Injectable
|
|
4962
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
|
|
4963
|
+
|
|
4964
|
+
class WordEditorComponent {
|
|
4965
|
+
constructor(service, wordEditorService, viewContainerRef) {
|
|
4966
|
+
this.service = service;
|
|
4967
|
+
this.wordEditorService = wordEditorService;
|
|
4968
|
+
this.viewContainerRef = viewContainerRef;
|
|
4969
|
+
this.showPullTemplateButton = true;
|
|
4970
|
+
this.showPullDataButton = true;
|
|
4971
|
+
this.showCalcButton = true;
|
|
4972
|
+
this.showValidateButton = true;
|
|
4973
|
+
this.showGenerateFileButton = true;
|
|
4974
|
+
this.showCloseButton = true;
|
|
4975
|
+
this.readonly = false;
|
|
4976
|
+
this.onSaved = new EventEmitter();
|
|
4977
|
+
this.onGenerated = new EventEmitter();
|
|
4978
|
+
this.onClosed = new EventEmitter();
|
|
4979
|
+
this.loading = false;
|
|
4980
|
+
}
|
|
4981
|
+
ngOnInit() {
|
|
4982
|
+
if (!this.oid) {
|
|
4983
|
+
return;
|
|
4984
|
+
}
|
|
4985
|
+
this.service.tenant = this.tenant;
|
|
4986
|
+
this.service.templateClassName = this.templateClassName;
|
|
4987
|
+
this.service.instanceClassName = this.className;
|
|
4988
|
+
this.service.instanceOid = this.oid;
|
|
4989
|
+
this.service.params = this.params;
|
|
4990
|
+
this.service.tabViewContainerRef = this.tabViewContainerRef;
|
|
4991
|
+
this.service.readonly = this.readonly;
|
|
4992
|
+
this.loading = true;
|
|
4993
|
+
this.wordEditorService.loadTemplate(this.tenant, this.className, this.oid).subscribe(response => {
|
|
4994
|
+
this.sections = response.sections || [];
|
|
4995
|
+
this.service.marks = response.marks;
|
|
4996
|
+
this.loading = false;
|
|
4997
|
+
});
|
|
4998
|
+
}
|
|
4999
|
+
pullTemplate() {
|
|
5000
|
+
if (confirm('该操作会清除已录入的数据,确定重新拉取模板配置?')) {
|
|
5001
|
+
this.loading = true;
|
|
5002
|
+
this.wordEditorService.reloadTemplate(this.tenant, this.className, this.oid, this.templateClassName).subscribe(response => {
|
|
5003
|
+
this.sections = response.data?.sections || [];
|
|
5004
|
+
this.service.marks = response.data.marks;
|
|
5005
|
+
this.loading = false;
|
|
5006
|
+
});
|
|
5007
|
+
}
|
|
5008
|
+
}
|
|
5009
|
+
pullData() {
|
|
5010
|
+
this.loading = true;
|
|
5011
|
+
this.wordEditorService.pullData(this.tenant, this.className, this.oid, {
|
|
5012
|
+
marks: JSON.stringify(this.service.marks)
|
|
5013
|
+
}).subscribe(response => {
|
|
5014
|
+
for (let mark of this.service.marks) {
|
|
5015
|
+
if (response.data.hasOwnProperty(mark.name)) {
|
|
5016
|
+
mark.value = response.data[mark.name];
|
|
5017
|
+
}
|
|
5018
|
+
}
|
|
5019
|
+
this.service.valueUpdated.emit();
|
|
5020
|
+
this.loading = false;
|
|
5021
|
+
notifySuccess('拉取完成');
|
|
5022
|
+
});
|
|
5023
|
+
}
|
|
5024
|
+
calc() {
|
|
5025
|
+
}
|
|
5026
|
+
validate() {
|
|
5027
|
+
validateGroup(this.validator).then();
|
|
5028
|
+
}
|
|
5029
|
+
save() {
|
|
5030
|
+
this.loading = true;
|
|
5031
|
+
this.wordEditorService.save(this.tenant, this.className, this.oid, {
|
|
5032
|
+
templateConfig: JSON.stringify({
|
|
5033
|
+
sections: this.sections,
|
|
5034
|
+
marks: this.service.marks
|
|
5035
|
+
})
|
|
5036
|
+
}).subscribe(response => {
|
|
5037
|
+
this.loading = false;
|
|
5038
|
+
if (response.success) {
|
|
5039
|
+
notifySuccess('保存成功');
|
|
5040
|
+
this.onSaved.emit();
|
|
5041
|
+
}
|
|
5042
|
+
});
|
|
5043
|
+
}
|
|
5044
|
+
generateFile() {
|
|
5045
|
+
this.loading = true;
|
|
5046
|
+
this.wordEditorService.generateFile(this.tenant, this.className, this.oid, this.generateFileAttribute || 'file', this.generateFileName || '', {
|
|
5047
|
+
templateConfig: JSON.stringify({
|
|
5048
|
+
sections: this.sections,
|
|
5049
|
+
marks: this.service.marks
|
|
5050
|
+
})
|
|
5051
|
+
}).subscribe(response => {
|
|
5052
|
+
this.loading = false;
|
|
5053
|
+
if (response.success) {
|
|
5054
|
+
notifySuccess('生成附件成功');
|
|
5055
|
+
this.onGenerated.emit();
|
|
5056
|
+
}
|
|
5057
|
+
});
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
5060
|
+
WordEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorComponent, deps: [{ token: SectionService }, { token: WordEditorService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5061
|
+
WordEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WordEditorComponent, selector: "rs-word-editor", inputs: { tenant: "tenant", className: "className", oid: "oid", templateClassName: "templateClassName", params: "params", tabViewContainerRef: "tabViewContainerRef", showPullTemplateButton: "showPullTemplateButton", showPullDataButton: "showPullDataButton", showCalcButton: "showCalcButton", showValidateButton: "showValidateButton", showGenerateFileButton: "showGenerateFileButton", generateFileAttribute: "generateFileAttribute", generateFileName: "generateFileName", showCloseButton: "showCloseButton", readonly: "readonly" }, outputs: { onSaved: "onSaved", onGenerated: "onGenerated", onClosed: "onClosed" }, providers: [WordEditorService], viewQueries: [{ propertyName: "validator", first: true, predicate: ["validator"], descendants: true }], ngImport: i0, template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\" [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<div *ngIf=\"!readonly\" class=\"bar header\">\r\n <dx-button *ngIf=\"showPullTemplateButton\" type=\"success\" text=\"\u66F4\u65B0\u6A21\u677F\" (onClick)=\"pullTemplate()\"\r\n [disabled]=\"loading\"></dx-button>\r\n <dx-button *ngIf=\"showPullDataButton\" type=\"success\" text=\"\u586B\u5145\u6570\u636E\" (onClick)=\"pullData()\"\r\n [disabled]=\"loading\"></dx-button>\r\n <!-- <dx-button *ngIf=\"showCalcButton\" type=\"default\" text=\"\u6267\u884C\u8BA1\u7B97\" (onClick)=\"calc()\"\r\n [disabled]=\"loading\"></dx-button>-->\r\n <dx-button *ngIf=\"showValidateButton\" type=\"default\" text=\"\u6267\u884C\u6821\u9A8C\" (onClick)=\"validate()\"\r\n [disabled]=\"loading\"></dx-button>\r\n</div>\r\n<dx-validation-group [class.validation-group]=\"true\" #validator>\r\n <div class=\"viewer-container\">\r\n <div class=\"viewer\">\r\n <ng-container *ngFor=\"let section of sections\">\r\n <rs-section [section]=\"section\"></rs-section>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</dx-validation-group>\r\n<div class=\"bar footer\">\r\n <dx-button *ngIf=\"!readonly\" type=\"default\" text=\"\u4FDD\u5B58\" (onClick)=\"save()\" [disabled]=\"loading\"></dx-button>\r\n <dx-button *ngIf=\"!readonly && showGenerateFileButton\" type=\"success\" text=\"\u751F\u6210\u9644\u4EF6\" (onClick)=\"generateFile()\"\r\n [disabled]=\"loading\"></dx-button>\r\n <dx-button *ngIf=\"showCloseButton\" type=\"normal\" text=\"\u5173\u95ED\" (onClick)=\"onClosed.emit()\"></dx-button>\r\n</div>\r\n", styles: [":host{flex:1;display:flex;flex-flow:column nowrap;background-color:#f5f5f5}:host .bar{flex:none;padding:12px 24px;background-color:var(--coast-base-bg-color, rgb(255, 255, 255));z-index:1;display:flex;flex-flow:row nowrap}:host .bar>dx-button{width:80px}:host .bar>dx-button:not(:last-child){margin-right:8px}:host .header{border-bottom:1px solid var(--coast-border-color, rgb(221, 221, 221));position:sticky;top:0}:host .validation-group{flex:auto;height:0;overflow-y:auto;background-color:var(--coast-empty-color, rgb(229, 229, 229));display:flex;flex-flow:column nowrap}:host .validation-group .viewer-container{flex:auto;height:0;overflow-x:auto;padding:8px 16px 0;display:flex;flex-flow:row nowrap}:host .validation-group .viewer-container .viewer{margin:auto;display:flex;flex-flow:column nowrap;align-items:center;z-index:0}:host .footer{justify-content:flex-end;border-top:1px solid var(--coast-border-color, rgb(221, 221, 221));position:sticky;bottom:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i3.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$1.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$1.DxValidationGroupComponent, selector: "dx-validation-group", inputs: ["elementAttr", "height", "width"], outputs: ["onDisposing", "onInitialized", "onOptionChanged", "elementAttrChange", "heightChange", "widthChange"] }, { kind: "component", type: SectionComponent, selector: "rs-section", inputs: ["section", "editMode", "pasteMode", "readonly"] }] });
|
|
5062
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorComponent, decorators: [{
|
|
5063
|
+
type: Component,
|
|
5064
|
+
args: [{ selector: 'rs-word-editor', providers: [WordEditorService], template: "<dx-load-panel [container]=\"viewContainerRef.element.nativeElement\" [showPane]=\"false\" [visible]=\"loading\">\r\n <dxo-position [of]=\"viewContainerRef.element.nativeElement\"></dxo-position>\r\n</dx-load-panel>\r\n<div *ngIf=\"!readonly\" class=\"bar header\">\r\n <dx-button *ngIf=\"showPullTemplateButton\" type=\"success\" text=\"\u66F4\u65B0\u6A21\u677F\" (onClick)=\"pullTemplate()\"\r\n [disabled]=\"loading\"></dx-button>\r\n <dx-button *ngIf=\"showPullDataButton\" type=\"success\" text=\"\u586B\u5145\u6570\u636E\" (onClick)=\"pullData()\"\r\n [disabled]=\"loading\"></dx-button>\r\n <!-- <dx-button *ngIf=\"showCalcButton\" type=\"default\" text=\"\u6267\u884C\u8BA1\u7B97\" (onClick)=\"calc()\"\r\n [disabled]=\"loading\"></dx-button>-->\r\n <dx-button *ngIf=\"showValidateButton\" type=\"default\" text=\"\u6267\u884C\u6821\u9A8C\" (onClick)=\"validate()\"\r\n [disabled]=\"loading\"></dx-button>\r\n</div>\r\n<dx-validation-group [class.validation-group]=\"true\" #validator>\r\n <div class=\"viewer-container\">\r\n <div class=\"viewer\">\r\n <ng-container *ngFor=\"let section of sections\">\r\n <rs-section [section]=\"section\"></rs-section>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</dx-validation-group>\r\n<div class=\"bar footer\">\r\n <dx-button *ngIf=\"!readonly\" type=\"default\" text=\"\u4FDD\u5B58\" (onClick)=\"save()\" [disabled]=\"loading\"></dx-button>\r\n <dx-button *ngIf=\"!readonly && showGenerateFileButton\" type=\"success\" text=\"\u751F\u6210\u9644\u4EF6\" (onClick)=\"generateFile()\"\r\n [disabled]=\"loading\"></dx-button>\r\n <dx-button *ngIf=\"showCloseButton\" type=\"normal\" text=\"\u5173\u95ED\" (onClick)=\"onClosed.emit()\"></dx-button>\r\n</div>\r\n", styles: [":host{flex:1;display:flex;flex-flow:column nowrap;background-color:#f5f5f5}:host .bar{flex:none;padding:12px 24px;background-color:var(--coast-base-bg-color, rgb(255, 255, 255));z-index:1;display:flex;flex-flow:row nowrap}:host .bar>dx-button{width:80px}:host .bar>dx-button:not(:last-child){margin-right:8px}:host .header{border-bottom:1px solid var(--coast-border-color, rgb(221, 221, 221));position:sticky;top:0}:host .validation-group{flex:auto;height:0;overflow-y:auto;background-color:var(--coast-empty-color, rgb(229, 229, 229));display:flex;flex-flow:column nowrap}:host .validation-group .viewer-container{flex:auto;height:0;overflow-x:auto;padding:8px 16px 0;display:flex;flex-flow:row nowrap}:host .validation-group .viewer-container .viewer{margin:auto;display:flex;flex-flow:column nowrap;align-items:center;z-index:0}:host .footer{justify-content:flex-end;border-top:1px solid var(--coast-border-color, rgb(221, 221, 221));position:sticky;bottom:0}\n"] }]
|
|
5065
|
+
}], ctorParameters: function () { return [{ type: SectionService }, { type: WordEditorService }, { type: i0.ViewContainerRef }]; }, propDecorators: { tenant: [{
|
|
5066
|
+
type: Input
|
|
5067
|
+
}], className: [{
|
|
5068
|
+
type: Input
|
|
5069
|
+
}], oid: [{
|
|
5070
|
+
type: Input
|
|
5071
|
+
}], templateClassName: [{
|
|
5072
|
+
type: Input
|
|
5073
|
+
}], params: [{
|
|
5074
|
+
type: Input
|
|
5075
|
+
}], tabViewContainerRef: [{
|
|
5076
|
+
type: Input
|
|
5077
|
+
}], showPullTemplateButton: [{
|
|
5078
|
+
type: Input
|
|
5079
|
+
}], showPullDataButton: [{
|
|
5080
|
+
type: Input
|
|
5081
|
+
}], showCalcButton: [{
|
|
5082
|
+
type: Input
|
|
5083
|
+
}], showValidateButton: [{
|
|
5084
|
+
type: Input
|
|
5085
|
+
}], showGenerateFileButton: [{
|
|
5086
|
+
type: Input
|
|
5087
|
+
}], generateFileAttribute: [{
|
|
5088
|
+
type: Input
|
|
5089
|
+
}], generateFileName: [{
|
|
5090
|
+
type: Input
|
|
5091
|
+
}], showCloseButton: [{
|
|
5092
|
+
type: Input
|
|
5093
|
+
}], readonly: [{
|
|
5094
|
+
type: Input
|
|
5095
|
+
}], onSaved: [{
|
|
5096
|
+
type: Output
|
|
5097
|
+
}], onGenerated: [{
|
|
5098
|
+
type: Output
|
|
5099
|
+
}], onClosed: [{
|
|
5100
|
+
type: Output
|
|
5101
|
+
}], validator: [{
|
|
5102
|
+
type: ViewChild,
|
|
5103
|
+
args: ['validator']
|
|
5104
|
+
}] } });
|
|
5105
|
+
|
|
5106
|
+
class WordEditorModule {
|
|
5107
|
+
}
|
|
5108
|
+
WordEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5109
|
+
WordEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: WordEditorModule, declarations: [WordEditorComponent], imports: [CommonModule,
|
|
5110
|
+
DevExtremeModule,
|
|
5111
|
+
SectionModule], exports: [WordEditorComponent] });
|
|
5112
|
+
WordEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorModule, imports: [CommonModule,
|
|
5113
|
+
DevExtremeModule,
|
|
5114
|
+
SectionModule] });
|
|
5115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WordEditorModule, decorators: [{
|
|
5116
|
+
type: NgModule,
|
|
5117
|
+
args: [{
|
|
5118
|
+
declarations: [
|
|
5119
|
+
WordEditorComponent
|
|
5120
|
+
],
|
|
5121
|
+
imports: [
|
|
5122
|
+
CommonModule,
|
|
5123
|
+
DevExtremeModule,
|
|
5124
|
+
SectionModule
|
|
5125
|
+
],
|
|
5126
|
+
exports: [
|
|
5127
|
+
WordEditorComponent
|
|
5128
|
+
]
|
|
5129
|
+
}]
|
|
5130
|
+
}] });
|
|
5131
|
+
|
|
4119
5132
|
/**
|
|
4120
5133
|
* Generated bundle index. Do not edit.
|
|
4121
5134
|
*/
|
|
4122
5135
|
|
|
4123
|
-
export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, CamundaBpmnViewerComponent, CamundaBpmnViewerModule, CellComponentBase, CellConfigBase, ChangeFilter, CodeEditorComponent, CodeEditorModule, CustomTemplateDirective, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DxNativeElementPipe, DynamicParamsComponent, DynamicParamsModule, FieldSelectorComponent, FormComponent, FormItemComponentBase, FormItemConfigBase, FormModule, FormService, FullscreenDirective, IconSelectorComponent, IconSelectorModule, ItemConfigComponent, ItemStyleComponent, ModalComponent, ModalComponentBase, ModalConfigBase, ModalModule, ModalService, PageItemComponentBase, PageItemConfigBase, PdfViewerComponent, PluginManager, RowButtonsTemplateDirective, TooltipContentTemplateDirective, WebsocketModule, WebsocketService, addWatermark, deepClone,
|
|
5136
|
+
export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, CamundaBpmnViewerComponent, CamundaBpmnViewerModule, CellComponentBase, CellConfigBase, ChangeFilter, CodeEditorComponent, CodeEditorModule, CustomTemplateDirective, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DxNativeElementPipe, DynamicParamsComponent, DynamicParamsModule, FieldSelectorComponent, FormComponent, FormItemComponentBase, FormItemConfigBase, FormModule, FormService, FullscreenDirective, IconSelectorComponent, IconSelectorModule, ItemConfigComponent, ItemStyleComponent, MarkItemComponentBase, MarkItemConfigBase, ModalComponent, ModalComponentBase, ModalConfigBase, ModalModule, ModalService, NodeComponent, PageItemComponentBase, PageItemConfigBase, PdfViewerComponent, PluginManager, RowButtonsTemplateDirective, SectionComponent, SectionModule, SectionService, TooltipContentTemplateDirective, WebsocketModule, WebsocketService, WordDesignerComponent, WordDesignerModule, WordEditorComponent, WordEditorModule, addWatermark, deepClone, downloadFile, evaluateFilter, fileTypeIcon, filenameFromDisposition, formatFileSize, localeSortMethod, notifyError, notifySuccess, notifyWarning, openBrowserTab, supportPreviewExt, validate, validateGroup, validateGroupByName };
|
|
4124
5137
|
//# sourceMappingURL=ngx-rs-ant.mjs.map
|