陈鹏飞 3 years ago
parent
commit
bc0f9aeb55
  1. 13
      src/app/babylon/controller/serve-manager.ts
  2. 13
      src/app/babylon/view/mark-window/mark-window.ts
  3. 2
      src/app/pages/oil-station-info/oil-station-info.component.ts
  4. 25
      src/app/service/babylon/building-basic-infos.service.ts

13
src/app/babylon/controller/serve-manager.ts

@ -216,6 +216,19 @@ export class ServeManager {
}
/**
*
*/
deleteSandBoxTemplate(id: number, onSuccess?: () => void) {
this.buildingBISrv.deleteSandBoxTemplate(id).subscribe(data => {
console.log("删除模板" + id, data);
if (onSuccess) {
onSuccess();
}
}, error => {
console.error("deleteSandBoxTemplate", error);
})
}
//#endregion

13
src/app/babylon/view/mark-window/mark-window.ts

@ -1635,11 +1635,22 @@ export class MarkWindow extends UIBase {
let id: number = Math.ceil(new Date().getTime() * 0.001);
let instance = this;
ServeManager.instance.saveOneMarkTemplate(id, name, data, (data: string) => {
instance.getAllSandBoxTemplate();
});
}
/**
*
* @param id
*/
deleteSandBoxTemplate(id: number) {
let instance = this;
ServeManager.instance.deleteSandBoxTemplate(id, () => {
instance.getAllSandBoxTemplate();
});
}
//#endregion

2
src/app/pages/oil-station-info/oil-station-info.component.ts

@ -144,7 +144,7 @@ export class OilStationInfoComponent implements OnInit {
const link = document.createElement('a');
const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '统计信息' + '.xls');
link.setAttribute('download', this.httpBody.stationName + '基本信息' + '.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();

25
src/app/service/babylon/building-basic-infos.service.ts

@ -114,6 +114,14 @@ export class BuildingBasicInfosService {
return this.postInfos(this.api_sandBoxTemplate, data, { name: name, "id": id });
}
/**
*
* @param id
*/
deleteSandBoxTemplate(id: number) {
return this.deleteInfos(this.api_sandBoxTemplate, { "Id": id });
}
@ -127,6 +135,11 @@ export class BuildingBasicInfosService {
*/
readonly c_post = "/PostOrPut";
/**
*
*/
readonly c_delete = "/Delete";
/**
*
*/
@ -163,6 +176,18 @@ export class BuildingBasicInfosService {
catchError((err) => this.handleError(err))
);
}
/**
*
* @param api
* @param params
*/
deleteInfos(api: string, params = {}) {
return this.http.get<string>(api + this.c_delete, { params: params }).pipe(
catchError((err) => this.handleError(err))
);
}
//#endregion

Loading…
Cancel
Save