warrior 7 months ago
parent
commit
909494cc89

+ 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);
-  //     }
-  //   }
-  // }
 }

+ 1 - 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'),

+ 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);
+  //     }
+  //   }
+  }
 }