|
@@ -335,187 +335,3 @@ func appendBasePatchClass() {
|
|
|
}
|
|
|
`)
|
|
|
}
|
|
|
-
|
|
|
-// public Patchs() {
|
|
|
-
|
|
|
-// const patchs = {
|
|
|
-// AddMethods: [],
|
|
|
-// AddSamples: [],
|
|
|
-// AddCaracterizations: [],
|
|
|
-// RemoveMethods: [],
|
|
|
-// RemoveSamples: [],
|
|
|
-// RemoveCaracterizations: [],
|
|
|
-// $set: this.$set,
|
|
|
-// };
|
|
|
-
|
|
|
-// console.log('paths', this);
|
|
|
-
|
|
|
-// this.__set(this._samples, patchs.AddSamples, patchs.RemoveSamples);
|
|
|
-// this.__set(this._methods, patchs.AddMethods, patchs.RemoveMethods);
|
|
|
-
|
|
|
-// patchs.RemoveSamples.map(s => {
|
|
|
-// this.RemoveCaracterizations(this._form.caracterizations.filter(c => {
|
|
|
-// return c.sample === s.id;
|
|
|
-// }));
|
|
|
-// });
|
|
|
-
|
|
|
-// patchs.RemoveMethods.map(m => {
|
|
|
-// this.RemoveCaracterizations(this._form.caracterizations.filter(c => {
|
|
|
-// return c.method === m.id;
|
|
|
-// }));
|
|
|
-// });
|
|
|
-
|
|
|
-// this.__set(this._caracterizations, patchs.AddCaracterizations, patchs.RemoveCaracterizations);
|
|
|
-
|
|
|
-// return patchs;
|
|
|
-// }
|
|
|
-// public Patchs(patchs) {
|
|
|
-// const patchs = {
|
|
|
-// AddMethods: [],
|
|
|
-// AddSamples: [],
|
|
|
-// AddCaracterizations: [],
|
|
|
-// RemoveMethods: [],
|
|
|
-// RemoveSamples: [],
|
|
|
-// RemoveCaracterizations: [],
|
|
|
-// $set: this.$set,
|
|
|
-// };
|
|
|
-
|
|
|
-// console.log('paths', this);
|
|
|
-
|
|
|
-// this.__set(this._samples, patchs.AddSamples, patchs.RemoveSamples);
|
|
|
-// this.__set(this._methods, patchs.AddMethods, patchs.RemoveMethods);
|
|
|
-
|
|
|
-// patchs.RemoveSamples.map(s => {
|
|
|
-// this.RemoveCaracterizations(this._form.caracterizations.filter(c => {
|
|
|
-// return c.sample === s.id;
|
|
|
-// }));
|
|
|
-// });
|
|
|
-
|
|
|
-// patchs.RemoveMethods.map(m => {
|
|
|
-// this.RemoveCaracterizations(this._form.caracterizations.filter(c => {
|
|
|
-// return c.method === m.id;
|
|
|
-// }));
|
|
|
-// });
|
|
|
-
|
|
|
-// this.__set(this._caracterizations, patchs.AddCaracterizations, patchs.RemoveCaracterizations);
|
|
|
-
|
|
|
-// return patchs;
|
|
|
-// }
|
|
|
-
|
|
|
-// export class FormPatch {
|
|
|
-
|
|
|
-// $set = {};
|
|
|
-// _form: CaracterizationForm;
|
|
|
-// _samples = new Map<string, { item: Sample, action: string, type: string }>();
|
|
|
-// _methods = new Map<string, { item: CaracterizationMethod, action: string, type: string }>();
|
|
|
-// _caracterizations = new Map<string, { item: Caracterization, action: string, type: string }>();
|
|
|
-
|
|
|
-// setSolicitation(form: CaracterizationForm) {
|
|
|
-// // this._set(this._methods, form.methods.map(m => { return { id: m.id } }), '');
|
|
|
-// this._form = form;
|
|
|
-// this._set(this._samples, form.samples, '');
|
|
|
-// this._set(this._methods, form.methods, '');
|
|
|
-// this._set(this._caracterizations, form.caracterizations, '');
|
|
|
-// }
|
|
|
-
|
|
|
-// protected __set(list, add, rem) {
|
|
|
-// list.forEach((i) => {
|
|
|
-// switch (i.action) {
|
|
|
-// case 'add':
|
|
|
-// add.push(i.item);
|
|
|
-// break;
|
|
|
-// case 'remove':
|
|
|
-// (i.type !== 'new') && rem.push(i.item);
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// });
|
|
|
-// }
|
|
|
-
|
|
|
-// public Patchs() {
|
|
|
-
|
|
|
-// const patchs = {
|
|
|
-// AddMethods: [],
|
|
|
-// AddSamples: [],
|
|
|
-// AddCaracterizations: [],
|
|
|
-// RemoveMethods: [],
|
|
|
-// RemoveSamples: [],
|
|
|
-// RemoveCaracterizations: [],
|
|
|
-// $set: this.$set,
|
|
|
-// };
|
|
|
-
|
|
|
-// console.log('paths', this);
|
|
|
-
|
|
|
-// this.__set(this._samples, patchs.AddSamples, patchs.RemoveSamples);
|
|
|
-// this.__set(this._methods, patchs.AddMethods, patchs.RemoveMethods);
|
|
|
-
|
|
|
-// patchs.RemoveSamples.map(s => {
|
|
|
-// this.RemoveCaracterizations(this._form.caracterizations.filter(c => {
|
|
|
-// return c.sample === s.id;
|
|
|
-// }));
|
|
|
-// });
|
|
|
-
|
|
|
-// patchs.RemoveMethods.map(m => {
|
|
|
-// this.RemoveCaracterizations(this._form.caracterizations.filter(c => {
|
|
|
-// return c.method === m.id;
|
|
|
-// }));
|
|
|
-// });
|
|
|
-
|
|
|
-// this.__set(this._caracterizations, patchs.AddCaracterizations, patchs.RemoveCaracterizations);
|
|
|
-
|
|
|
-// return patchs;
|
|
|
-// }
|
|
|
-
|
|
|
-// protected _set(_map: Map<string, any>, itens, action) {
|
|
|
-// (itens || []).map(item => {
|
|
|
-// const id = item.id || (item.method + item.sample);
|
|
|
-// const has = _map.has(id)
|
|
|
-// , el = _map.get(id);
|
|
|
-
|
|
|
-// switch (action) {
|
|
|
-// case 'add':
|
|
|
-// if (!has) {
|
|
|
-// _map.set(id, {
|
|
|
-// item: item,
|
|
|
-// action: 'add',
|
|
|
-// type: 'new',
|
|
|
-// });
|
|
|
-// } else if (el.action === 'remove') {
|
|
|
-// el.action = 'add';
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// case 'remove':
|
|
|
-// if (has) {
|
|
|
-// el.action = 'remove';
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// default:
|
|
|
-// _map.set(id, {
|
|
|
-// item: item,
|
|
|
-// action: '',
|
|
|
-// type: '',
|
|
|
-// });
|
|
|
-// }
|
|
|
-// });
|
|
|
-// }
|
|
|
-
|
|
|
-// AddMethods(itens) {
|
|
|
-// this._set(this._methods, itens, 'add');
|
|
|
-// }
|
|
|
-
|
|
|
-// AddSamples(itens) {
|
|
|
-// this._set(this._samples, itens, 'add');
|
|
|
-// }
|
|
|
-// AddCaracterizations(itens) {
|
|
|
-// this._set(this._caracterizations, itens, 'add');
|
|
|
-// }
|
|
|
-// RemoveMethods(itens) {
|
|
|
-// this._set(this._methods, itens, 'remove');
|
|
|
-// }
|
|
|
-// RemoveSamples(itens) {
|
|
|
-// this._set(this._samples, itens, 'remove');
|
|
|
-// }
|
|
|
-// RemoveCaracterizations(itens) {
|
|
|
-// this._set(this._caracterizations, itens, 'remove');
|
|
|
-// }
|
|
|
-
|
|
|
-// }
|