apertura allegati
This commit is contained in:
@@ -92,7 +92,7 @@ export default class AlarmDetail extends Vue {
|
||||
|
||||
async openAttach(attach) {
|
||||
if (attach) {
|
||||
// await new MaintenanceService().OpenModal(attach, this.isimage(attach.fileName));
|
||||
await alarmsService.OpenModal(attach, this.isimage(attach.fileName));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { baseRestService } from "src/_base/baseRestService";
|
||||
import { AlarmModel } from "../store";
|
||||
import { ModalHelper } from "src/components/modals";
|
||||
import { ModalIframe, ModalImage } from "src/modules/base-components/index";
|
||||
|
||||
export class AlarmsService extends baseRestService {
|
||||
BASE_URL = "api/alarm/";
|
||||
@@ -38,13 +40,33 @@ export class AlarmsService extends baseRestService {
|
||||
async getAttachment(attachId) { return await this.Get(this.BASE_URL + `attachment/${attachId}`, true); }
|
||||
async deleteAttachments(attachId) { return await this.Delete(this.BASE_URL + `attachment/${attachId}`, true); }
|
||||
async postAttachment(alarmId, file) {
|
||||
|
||||
let result = await this.upload(this.BASE_URL + `${alarmId}/attachment`, file, file.name, {});
|
||||
// let result = await this.upload(this.BASE_URL + "maintenance/" + m.id + "/attachment", file, file.name, {});
|
||||
// maintenanceActions.updateAttachMaintenance(store, result.data);
|
||||
return result;
|
||||
}
|
||||
|
||||
async getContentAttachmentURI(attach) {
|
||||
let result = this.BASE_URL + "attachment/" + attach.attachmentId;
|
||||
return result;
|
||||
}
|
||||
|
||||
async OpenModal(attach, isimage) {
|
||||
debugger
|
||||
if (isimage) {
|
||||
ModalHelper.modalImage.content = await this.getContentAttachmentURI(attach);
|
||||
ModalHelper.modalImage.title = attach.fileName;
|
||||
ModalHelper.ShowModal(ModalImage);
|
||||
}
|
||||
else {
|
||||
ModalHelper.modalIframe.content = await this.getContentAttachmentURI(attach);
|
||||
ModalHelper.modalIframe.title = attach.fileName;
|
||||
ModalHelper.ShowModal(ModalIframe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const alarmsService = new AlarmsService();
|
||||
|
||||
@@ -75,7 +75,7 @@ export class MaintenanceService extends baseRestService {
|
||||
let result = this.BASE_URL + "attachment/" + attach.attachmentId;
|
||||
return result;
|
||||
}
|
||||
async
|
||||
|
||||
async DeleteAttachMaintenance(attach) {
|
||||
let result = await this.Delete<any>(this.BASE_URL + "attachment/" + attach.attachmentId, true);
|
||||
maintenanceActions.deleteAttachMaintenance(store, attach);
|
||||
|
||||
Reference in New Issue
Block a user