Просмотр исходного кода

Merge branch 'master' of http://git.fmode.cn:3000/bin/edu-textbook

MetaPunkGames 7 месяцев назад
Родитель
Сommit
174461c2c7

+ 1 - 1
projects/textbook/src/app/textbook/textbook.component.html

@@ -513,7 +513,7 @@
 </div>
 <!-- 全选操作:批量操作 -->
 @if (filterObj.isCheck && setOfCheckedId.size) {
-<div class="batch-toolbar-modal">
+<div class="batch-toolbar-modal" [style.left]="'calc(50% - '+ calc+'px)'">
   <div class="batch-toolbar">
     <div class="styles_counter__18S08">
       <span>已选</span>

+ 2 - 1
projects/textbook/src/app/textbook/textbook.component.scss

@@ -26,7 +26,8 @@
   display: flex;
   justify-content: center;
   bottom: 80px;
-  left: calc(50% - 134px);
+  // left: calc(50% - 134px);
+  left: calc(50% - 328px);
   -webkit-transform: translate(0);
   transform: translate(0);
 }

+ 13 - 6
projects/textbook/src/app/textbook/textbook.component.ts

@@ -149,7 +149,7 @@ export class TextbookComponent implements OnInit {
   setOfCheckedId = new Set<string>();
   searchValue: string = '';
   manage: boolean = false;
-
+  calc:number = 120
   constructor(
     public tbookSer: textbookServer,
     private route: Router,
@@ -161,8 +161,9 @@ export class TextbookComponent implements OnInit {
   ngOnInit() {
     this.activeRoute.paramMap.subscribe(async (params) => {
       // this.eduProcessId = params.get('id');
+      this.calc += Object.values(this.filterObj?.btns).length * 70
       this.getTextbook();
-      if (Object.values(this.filterObj.btns).some((item) => item)) {
+      if (Object.values(this.filterObj?.btns).some((item) => item)) {
         this.manage = true;
       }
       if (this.filterObj.showMore) {
@@ -579,10 +580,16 @@ export class TextbookComponent implements OnInit {
   }
   //导出
   async exportProcess(data?: Parse.Object) {
-    let processId = await this.getEduProcess(
-      this.tbookSer.profile.user?.department?.objectId
-    );
-    Parse.Cloud.run('tbookExportReport', { processId: processId }).then(
+    let bookList: Array<string> = []
+    if(data?.id){
+      bookList = [data?.id]
+    }else{
+      bookList = Array.from(this.setOfCheckedId)
+    }
+    // let processId = await this.getEduProcess(
+    //   this.tbookSer.profile.user?.department?.objectId
+    // );
+    Parse.Cloud.run('tbookExportReport', { bookList: bookList }).then(
       (data) => {
         console.log(data);
         let url = data.zipUrl;

+ 3 - 0
projects/textbook/src/modules/login/account-info/account-info.component.ts

@@ -261,6 +261,9 @@ export class AccountInfoComponent implements OnInit {
         nzOnOk: () =>
           this.router.navigate(['/user/login'], { replaceUrl: true }),
       });
+      Parse.Cloud.run('aliSmsSend',{
+        "mobileList": [params.phone],"templateCode":"SMS_469060724","params":{},"signName":"普通高等教育教材网"
+      })
     } catch (err: any) {
       this.loading = false
       console.log(err?.message);

+ 0 - 59
projects/textbook/src/modules/nav-admin/page-process/process-list/process-list.component.ts

@@ -488,63 +488,4 @@ export class ProcessListComponent implements OnInit {
       this.getEduProcess();
     }
   }
-
-  /* 批量预设(临时) */
-  // async saveProcess() {
-  //   let count = 0;
-  //   let query = new Parse.Query('EduProcess')
-  //   query.equalTo('status', null)
-  //   query.limit(2000);
-  //   query.exists('startDate')
-  //   let r = await query.find()
-  //   console.log(r);
-  //   for (let index = 0; index < r.length; index++) {
-  //     const element = r[index];
-  //     element.set('status', '200')
-  //     await element.save()
-  //     count++
-  //     console.log(count);
-  //   }
-  //   let query = new Parse.Query('Department')
-  //   query.equalTo('parent',null)
-  //   query.equalTo('name','省级教育行政部门')
-  //   let r = await query.find()
-  //   for (let index = 0; index < r.length; index++) {
-  //     const element = r[index];
-  //     let queryPareet = new Parse.Query('Department')
-  //     queryPareet.equalTo('parent', element.id)
-  //     queryPareet.limit(2000)
-  //     let prents = await queryPareet.find()
-  //     for (let index = 0; index < prents.length; index++) {
-  //       let item = prents[index];
-  //       let obj = Parse.Object.extend('EduProcess');
-  //       let eduProcess = new obj()
-  //       eduProcess?.set('company', {
-  //         __type: 'Pointer',
-  //         className: 'Company',
-  //         objectId: 'RbIKpmuaMC',
-  //       });
-  //       eduProcess?.set('branch', {
-  //         __type: 'Pointer',
-  //         className: 'Department',
-  //         objectId:element.id,
-  //       });
-  //       eduProcess?.set('department', {
-  //         __type: 'Pointer',
-  //         className: 'Department',
-  //         objectId: item.id,
-  //       });
-  //       eduProcess?.set('name', item.get('name'));
-  //       eduProcess?.set('desc', item.get('name') + '流程');
-  //       eduProcess?.set('code', item.get('code') || item.id);
-  //       if(element.get('name') == '全国出版单位') {
-  //         eduProcess?.set('startDate', new Date('2024-07-20 18:00'));
-  //         eduProcess?.set('deadline', new Date('2024-09-20 18:00'));
-  //       }
-  //       await eduProcess?.save();
-  //       count ++
-  //       console.log(count);
-  //     }
-  //   }
-  // }
 }

+ 3 - 0
projects/textbook/src/modules/nav-admin/page-role/page-role.component.ts

@@ -553,6 +553,9 @@ export class PageRoleComponent implements OnInit {
       this.isLoadingOne = false
       this.accountIsVisible = false;
       this.account = null;
+      Parse.Cloud.run('aliSmsSend',{
+        "mobileList": [this.account?.phone],"templateCode":"SMS_469060724","params":{},"signName":"普通高等教育教材网"
+      })
       this.modal.success({
         nzTitle: '添加成功',
         nzContent: '',

+ 6 - 0
projects/textbook/src/modules/nav-admin/page-user/page-user.component.ts

@@ -238,6 +238,9 @@ export class PageUserComponent implements OnInit {
           switch (type) {
             case '通过认证':
               r?.set('accountState', '已认证');
+              Parse.Cloud.run('aliSmsSend',{
+                "mobileList": [data?.get('user')?.get('phone')],"templateCode":"SMS_468870790","params":{},"signName":"普通高等教育教材网"
+              })
               await r?.save();
               break;
             case '禁用':
@@ -477,6 +480,9 @@ export class PageUserComponent implements OnInit {
       this.isLoadingOne = false
       this.accountIsVisible = false;
       this.account = null;
+      Parse.Cloud.run('aliSmsSend',{
+        "mobileList": [this.account?.phone],"templateCode":"SMS_469060724","params":{},"signName":"普通高等教育教材网"
+      })
       this.modal.success({
         nzTitle: '添加成功',
         nzContent: '',

+ 3 - 0
projects/textbook/src/modules/nav-admin/user-edit/user-edit.component.ts

@@ -104,6 +104,9 @@ export class UserEditComponent implements OnInit {
     switch (type) {
       case '已认证':
         this.user.set('accountState', '已认证');
+        Parse.Cloud.run('aliSmsSend',{
+          "mobileList": [this.user?.get('phone')],"templateCode":"SMS_468870790","params":{},"signName":"普通高等教育教材网"
+        })
         break;
       case '已禁用':
         this.user.set('accountState', '已禁用');

+ 9 - 10
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -185,9 +185,9 @@ export class AttachmentComponent implements OnInit {
     //   msgList.push('申报单位承诺意见')
     //   isNull = true
     // }
-    if (isNull) {
-      // this.msg.create('error', `请上传完整 ${msgList.join()}`)
-    }
+    // if (isNull) {
+    //   this.msg.create('error', `请上传完整 ${msgList.join()}`)
+    // }
     return isNull
   }
 
@@ -230,7 +230,7 @@ export class AttachmentComponent implements OnInit {
       return
     })
     if (isVrifly) {
-      this.msg.warning('存在未填项')
+      // this.msg.warning('存在未填项')
       return true
     } else {
       return false
@@ -249,18 +249,16 @@ export class AttachmentComponent implements OnInit {
       examine: this.examine,
       // unitMaterial: this.unitMaterial,
     }
-    await this.saveEduTextbook(params, true);
+    let isPageNull = this.examineNull()//检查本页空项
+    let isIgnoreFiled = this.isIgnoreFiledNull()//检查数据空项
+    // console.log(isPageNull, isIgnoreFiled);
     if (event == 'pre') {//上一步
       this.state.emit({ type: 'pre' });
       return;
     }
-
+    await this.saveEduTextbook(params, (!isPageNull || !isIgnoreFiled));
     if (event == 'complete') {
       this.state.emit({ type: 'complete', textBook: this.eduTextbook });
-
-      let isPageNull = this.examineNull()//检查本页空项
-      let isIgnoreFiled = this.isIgnoreFiledNull()//检查数据空项
-
       if (isPageNull || isIgnoreFiled) {
       } else {
         this.eduTextbook.set('complete', true)
@@ -280,6 +278,7 @@ export class AttachmentComponent implements OnInit {
   }
 
   async saveEduTextbook(params: any, isComplete: boolean) {
+    console.log(isComplete);
     if (!this.eduTextbook) {
       this.msg.error('请先创建教材');
       return;

+ 4 - 3
projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.ts

@@ -155,9 +155,7 @@ export class PageRoleComponent implements OnInit {
         title: this.tbookSer.profile.user.department.name,
         key: this.tbookSer.profile.user.department?.objectId,
         children: [
-          ...(await this.getDepart(
-            this.tbookSer.profile.user.department?.objectId
-          )),
+          ...(await this.getDepart(this.tbookSer.profile.user.department?.objectId)),
         ],
         isParent: !r?.get('hasChildren'),
         isLeaf: !r?.get('hasChildren'),
@@ -592,6 +590,9 @@ export class PageRoleComponent implements OnInit {
       this.isLoadingOne = false
       this.accountIsVisible = false;
       this.account = null;
+      Parse.Cloud.run('aliSmsSend',{
+        "mobileList": [this.account?.phone],"templateCode":"SMS_469060724","params":{},"signName":"普通高等教育教材网"
+      })
       this.modal.success({
         nzTitle: '添加成功',
         nzContent: '',

+ 58 - 0
projects/textbook/src/services/textbook.ts

@@ -102,4 +102,62 @@ export class textbookServer {
       }).catch(()=> res(true))
     })
   }
+  
+  /* 批量预设(临时) */
+  async saveProcess() {
+    // let count = 0;
+    // let query = new Parse.Query('Department')
+    // query.equalTo('branch', '中央有关部门教育司')
+    // query.limit(2000);
+    // let r = await query.find()
+    // console.log(r);
+    // for (let index = 0; index < r.length; index++) {
+    //   const element = r[index];
+    //   element.set('branch', '有关部门(单位)教育司(局)')
+    //   await element.save()
+    //   count++
+    //   console.log(count);
+    // }
+  //   let query = new Parse.Query('Department')
+  //   query.equalTo('parent',null)
+  //   query.equalTo('name','省级教育行政部门')
+  //   let r = await query.find()
+  //   for (let index = 0; index < r.length; index++) {
+  //     const element = r[index];
+  //     let queryPareet = new Parse.Query('Department')
+  //     queryPareet.equalTo('parent', element.id)
+  //     queryPareet.limit(2000)
+  //     let prents = await queryPareet.find()
+  //     for (let index = 0; index < prents.length; index++) {
+  //       let item = prents[index];
+  //       let obj = Parse.Object.extend('EduProcess');
+  //       let eduProcess = new obj()
+  //       eduProcess?.set('company', {
+  //         __type: 'Pointer',
+  //         className: 'Company',
+  //         objectId: 'RbIKpmuaMC',
+  //       });
+  //       eduProcess?.set('branch', {
+  //         __type: 'Pointer',
+  //         className: 'Department',
+  //         objectId:element.id,
+  //       });
+  //       eduProcess?.set('department', {
+  //         __type: 'Pointer',
+  //         className: 'Department',
+  //         objectId: item.id,
+  //       });
+  //       eduProcess?.set('name', item.get('name'));
+  //       eduProcess?.set('desc', item.get('name') + '流程');
+  //       eduProcess?.set('code', item.get('code') || item.id);
+  //       if(element.get('name') == '全国出版单位') {
+  //         eduProcess?.set('startDate', new Date('2024-07-20 18:00'));
+  //         eduProcess?.set('deadline', new Date('2024-09-20 18:00'));
+  //       }
+  //       await eduProcess?.save();
+  //       count ++
+  //       console.log(count);
+  //     }
+  //   }
+  }
 }