This commit is contained in:
Yuri Kuznetsov
2023-06-29 15:12:57 +03:00
parent 025b312a2e
commit 87fd4e7f57
2 changed files with 646 additions and 598 deletions
+55 -54
View File
@@ -26,79 +26,80 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/import/index', ['view'], function (Dep) {
/** @module views/import/index */
return Dep.extend({
import View from 'view';
template: 'import/index',
class IndexImportView extends View {
data: function () {
return {
fromAdmin: this.options.fromAdmin,
};
},
template = 'import/index'
formData: null,
formData = null
fileContents = null
fileContents: null,
data() {
return {
fromAdmin: this.options.fromAdmin,
};
}
setup: function () {
this.entityType = this.options.entityType || null;
setup() {
this.entityType = this.options.entityType || null;
this.startFromStep = 1;
this.startFromStep = 1;
if (this.options.formData || this.options.fileContents) {
this.formData = this.options.formData || {};
this.fileContents = this.options.fileContents || null;
if (this.options.formData || this.options.fileContents) {
this.formData = this.options.formData || {};
this.fileContents = this.options.fileContents || null;
this.entityType = this.formData.entityType || null;
this.entityType = this.formData.entityType || null;
if (this.options.step) {
this.startFromStep = this.options.step;
}
if (this.options.step) {
this.startFromStep = this.options.step;
}
},
}
}
changeStep: function (num, result) {
this.step = num;
changeStep(num, result) {
this.step = num;
if (num > 1) {
this.setConfirmLeaveOut(true);
}
if (num > 1) {
this.setConfirmLeaveOut(true);
}
this.createView('step', 'views/import/step' + num.toString(), {
el: this.options.el + ' > .import-container',
entityType: this.entityType,
formData: this.formData,
result: result
}, (view) => {
view.render();
});
this.createView('step', 'views/import/step' + num.toString(), {
el: this.options.el + ' > .import-container',
entityType: this.entityType,
formData: this.formData,
result: result,
}, view => {
view.render();
});
var url = '#Import';
var url = '#Import';
if (this.options.fromAdmin) {
url = '#Admin/import';
}
if (this.options.fromAdmin) {
url = '#Admin/import';
}
if (this.step > 1) {
url += '/index/step=' + this.step;
}
if (this.step > 1) {
url += '/index/step=' + this.step;
}
this.getRouter().navigate(url, {trigger: false});
},
this.getRouter().navigate(url, {trigger: false});
}
afterRender: function () {
this.changeStep(this.startFromStep);
},
afterRender() {
this.changeStep(this.startFromStep);
}
updatePageTitle: function () {
this.setPageTitle(this.getLanguage().translate('Import', 'labels', 'Admin'));
},
updatePageTitle() {
this.setPageTitle(this.getLanguage().translate('Import', 'labels', 'Admin'));
}
setConfirmLeaveOut: function (value) {
this.getRouter().confirmLeaveOut = value;
},
setConfirmLeaveOut(value) {
this.getRouter().confirmLeaveOut = value;
}
}
});
});
export default IndexImportView;
File diff suppressed because it is too large Load Diff