-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocument.js
125 lines (100 loc) · 2.28 KB
/
Document.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import {WebSystemObject} from './WebSystemObject';
// Clase básica para todo tipo de documentos...
class Document extends WebSystemObject {
constructor(no = 0, clave = "", introduccion = null, desarrollo = null, conclusiones = null) {
super();
// Estructural
this._clave = clave; // tipo de documento
this._no = no; // número o folio
// se construye con tres objetos con determinado formato
if (!introduccion && !desarrollo && !conclusiones) {
console.warn(`El documento (${clave}->${no}), no contiene información.`);
} else {
if (introduccion) {
this._introduccion = {introduccion};
}
if (desarrollo) {
this._desarrollo = {desarrollo};
}
if (conclusiones) {
this._conclusiones = {conclusiones};
}
}
}
// Estructural
get clave() {
return this._clave;
}
set clave(tipo) {
this._clave = tipo;
}
get no() {
return this._no;
}
set no(folio) {
this._no = folio;
}
// De la introducción
get titulo() {
return this._introduccion.titulo;
}
set titulo(v) {
this._introduccion.titulo = v;
}
get subtitulo() {
return this._introduccion.subtitulo;
}
set subtitulo(v) {
this._introduccion.subtitulo = v;
}
get fecha() {
return this._introduccion.fecha;
}
set fecha(v) {
this._introduccion.fecha = v;
}
// Del desarrollo
get contenido() {
return this._desarrollo.contenido;
}
set contenido(v) {
this._desarrollo.contenido = v;
}
get anexos() {
return this._desarrollo.anexos;
}
set anexos(v) {
this._desarrollo.anexos = v;
}
// De las conclusiones
get conclusion() {
return this._conclusiones.conclusion;
}
set conclusion(v) {
this._conclusiones.conclusion = v;
}
get recomendaciones() {
return this._conclusiones.recomendaciones;
}
set recomendaciones(v) {
this._conclusiones.recomendaciones = v;
}
get notas() {
return this._conclusiones.erratas;
}
set notas(v) {
this._conclusiones.erratas = v;
}
get erratas() {
return this._conclusiones.erratas;
}
set erratas(v) {
this._conclusiones.erratas = v;
}
get fuentes() {
return this._conclusiones.fuentes;
}
set fuentes(v) {
this._conclusiones.fuentes = v;
}
}