|
@@ -9,7 +9,9 @@ export class textbookServer {
|
|
|
company: string = localStorage.getItem('company')!;
|
|
|
theme: boolean = false;
|
|
|
profile: any = JSON.parse(localStorage.getItem('profile')!);
|
|
|
- constructor() {}
|
|
|
+ constructor(
|
|
|
+ private http:HttpClient
|
|
|
+ ) {}
|
|
|
authMobile(mobile: string): boolean {
|
|
|
let a = /^1[3456789]\d{9}$/;
|
|
|
if (!String(mobile).match(a)) {
|
|
@@ -160,10 +162,33 @@ export class textbookServer {
|
|
|
|
|
|
|
|
|
}
|
|
|
-tbookExportReport(options:{processId?:string,bookList?:any[]}){
|
|
|
+async tbookExportReport(options:{processId?:string,bookList?:any[]}){
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ let url = Parse.serverURL + "/api/tbook/export"
|
|
|
+
|
|
|
+ let response = await fetch(url, {
|
|
|
+ method: 'POST',
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
+ 'X-Parse-Application-Id': 'edu-textbook'
|
|
|
+ },
|
|
|
+ body: JSON.stringify(options)
|
|
|
+ })
|
|
|
+ let result = await response.json()
|
|
|
+ let zipUrl = result?.result?.zipUrl;
|
|
|
+ if(result?.code==200){
|
|
|
+ zipUrl = zipUrl.replaceAll("http://","https://");
|
|
|
+ const a = document.createElement('a');
|
|
|
+ a.href = zipUrl;
|
|
|
+ a.download = '报送流程';
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result
|
|
|
+
|
|
|
+
|
|
|
Parse.Cloud.run('tbookExportReport', options).then(
|
|
|
(data) => {
|
|
|
console.log(data);
|