浏览代码

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

xll 9 月之前
父节点
当前提交
92229aa592

+ 1 - 1
docker-front

@@ -1 +1 @@
-Subproject commit 13fab33134e89b9b2401ea77a8090298219e724d
+Subproject commit f61efa85124a62b5cfef8c339a20d07830bbadd0

+ 1 - 1
projects/textbook/src/app/comp-manage/comp-manage.component.ts

@@ -161,7 +161,7 @@ export class CompManageComponent implements OnInit {
         path: '/nav-review/profile',
       },
     ],
-    "个人":[
+    "教师":[
       {
         name: '个人空间',
         id: '1',

+ 1 - 1
projects/textbook/src/modules/nav-admin/components/profile/profile.component.html

@@ -37,7 +37,7 @@
         {{ data?.get("user").get("phone") || "-" }}
       </td>
       <td nzEllipsis>
-        {{ data?.get("user").get("phone") || data?.get("email") || "-" }}
+        {{ data?.get("user").get("email") || data?.get("email") || "-" }}
       </td>
       <td nzEllipsis>
         {{ data?.get("user").get("departmentName") || "-" }}

+ 31 - 19
projects/textbook/src/modules/nav-admin/page-role/page-role.component.html

@@ -2,9 +2,9 @@
   <nz-page-header-title
     >申报单位管理
     <br />
-    <div class="subtitle">
+    <!-- <div class="subtitle">
       使用组织机构树管理使用“十四五”高等教育国家规划教材申报系统的所有单位,单位与申报工作流程相关联。
-    </div>
+    </div> -->
   </nz-page-header-title>
   <nz-page-header-extra>
     <nz-space>
@@ -282,18 +282,24 @@
             上级部门 <span style="color: #e8353e">*</span>
           </div>
           <div class="value">
-            <input
-              nz-input
-              placeholder="可击下方选择所属上级"
-              [ngModel]="editObject.parent?.title"
-              (ngModelChange)="onSearchNodes($event, true)"
-              type="text"
-            />
+            <nz-input-group nzSearch [nzAddOnAfter]="suffixIconclear">
+              <input
+                nz-input
+                placeholder="可击下方选择所属上级"
+                [(ngModel)]="modalValue"
+                (ngModelChange)="onSearchNodes($event, true)"
+                (blur)="onblur('editObject')"
+                type="text"
+              />
+            </nz-input-group>
+            <ng-template #suffixIconclear>
+              <button nz-button nzType="primary" nzSearch (click)="reset('editObject')">清空</button>
+            </ng-template>
           </div>
         </div>
         <div class="select">
           <div class="bar">
-            <a style="color: #86909c" (click)="onPre()">教材遴选</a>
+            <a style="color: #86909c" (click)="onPre()">所有部门</a>
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             <a (click)="onPre(data, $index)">{{ data.title }}</a>
@@ -350,18 +356,24 @@
             选择所属部门 <span style="color: #e8353e">*</span>
           </div>
           <div class="value">
-            <input
-              nz-input
-              placeholder="请选择所属部门"
-              [ngModel]="account.department?.title"
-              (ngModelChange)="onSearchNodes($event, true)"
-              type="text"
-            />
+            <nz-input-group nzSearch [nzAddOnAfter]="suffixIconclear">
+              <input
+                nz-input
+                placeholder="请选择所属部门"
+                [(ngModel)]="modalValue"
+                (ngModelChange)="onSearchNodes($event, true)"
+                type="text"
+                (blur)="onblur('account')"
+              />
+            </nz-input-group>
+            <ng-template #suffixIconclear>
+              <button nz-button nzType="primary" nzSearch (click)="reset('account')">清空</button>
+            </ng-template>
           </div>
         </div>
         <div class="select">
           <div class="bar">
-            <a style="color: #86909c" (click)="onPre()">教材遴选</a>
+            <a style="color: #86909c" (click)="onPre()">所有部门</a>
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             <a (click)="onPre(data, $index)">{{ data.title }}</a>
@@ -375,7 +387,7 @@
                 nz-radio
                 [ngModel]="data.key == radio"
                 [nzValue]="data.key"
-                (click)="onCheckedDepart('account', data, true)"
+                (click)="onCheckedDepart('account', data, data?.branch)"
                 >{{ data.title }}</label
               >
               @if (!data.isLeaf) {

+ 48 - 19
projects/textbook/src/modules/nav-admin/page-role/page-role.component.ts

@@ -114,10 +114,10 @@ export class PageRoleComponent implements OnInit {
     department: {},
     companyType: '',
   };
-  userType: Array<string> = ['工作联系人', '评审专家', '高校联系人', '个人'];
+  userType: Array<string> = ['工作联系人', '评审专家', '高校联系人', '教师'];
   parents: Array<any> = []; //所有一级列表
   nzExpandedKeys:any = [] //默认展开节点数
-
+  modalValue:string = ''
   constructor(
     private route: Router,
     private activeRoute: ActivatedRoute,
@@ -187,6 +187,26 @@ export class PageRoleComponent implements OnInit {
     }
     this.nodes = await this.getDepart('', e, e ? true : false);
   }
+  //搜索失去焦点
+  onblur(type:string){
+    console.log(type);
+    if(type == 'account'){
+      this.modalValue = this.account.department?.title
+    }else if(type == 'editObject'){
+      this.modalValue = this.editObject.parent?.title
+    }
+  }
+  reset(type:string){
+    this.modalValue = ''
+    this.parentList = this.nodes;
+    this.parentMap = []
+    if(type == 'account'){
+      this.account.department = {}
+      this.account.identity = ''
+    }else if(type == 'editObject'){
+      this.editObject.parent = {}
+    }
+  }
   //展开/合并
   async nzEvent(event: NzFormatEmitEvent): Promise<void> {
     console.log(event);
@@ -321,6 +341,8 @@ export class PageRoleComponent implements OnInit {
   }
   //添加成员
   addMember() {
+    this.radio = '';
+    this.modalValue = ''
     this.parentList = this.nodes;
     this.account = {
       name: '',
@@ -343,6 +365,8 @@ export class PageRoleComponent implements OnInit {
       parent: '',
       branch: '',
     };
+    this.radio = '';
+    this.modalValue = ''
     if (type == 'edit') {
       let query = new Parse.Query('Department');
       query.include('parent','parent.parent')
@@ -399,26 +423,12 @@ export class PageRoleComponent implements OnInit {
   }
   //选择所属类别下级列表
   async onCheckedDepart(type: string, e: any, checked?: boolean) {
+    console.log(e);
     this.radio = e.key;
     if (type == 'account') this.account.identity = '';
     this.parentMap = await this.tbookSer.formatNode(e.key);
-    if (checked) {
-      // this.editObject.name = e.title
-      if (type == 'account' && e.parent) {
-        this.account.department = { title: e.title, id: e.key };
-        this.account.companyType = e.branch || e.title;
-        this.userType = this.parents.some((item) => e.parent == item.key)
-        ? !e.type ? ['工作联系人', '评审专家', '个人'] : ['评审专家', '工作联系人', '个人']
-        : e.type
-        ? ['评审专家', '高校联系人', '个人']
-        : ['评审专家', '个人'];
-      } else {
-        this.editObject.parent = {
-          title: e.title,
-          id: e.key,
-        };
-        this.editObject.branch = e.branch || e.title;
-      }
+    if (checked || e.isLeaf) {
+      this.pushValue(type,e)
       return;
     }
     if (e.isLeaf) {
@@ -426,6 +436,25 @@ export class PageRoleComponent implements OnInit {
     }
     this.parentList = await this.getDepart(e?.key);
   }
+  //赋值
+  pushValue(type:string, e: any){
+    this.modalValue = e.title
+    if (type == 'account' && e.parent) {
+      this.account.department = { title: e.title, id: e.key };
+      this.account.companyType = e.branch || e.title;
+      this.userType = this.parents.some((item) => e.parent == item.key)
+      ? !e.type ? ['工作联系人'] : ['评审专家', '工作联系人', '教师']
+      : e.type == '单位'
+      ? ['评审专家', '高校联系人', '教师']
+      : ['评审专家', '教师'];
+    } else {
+      this.editObject.parent = {
+        title: e.title,
+        id: e.key,
+      };
+      this.editObject.branch = e.branch || e.title;
+    }
+  }
   async handleOk(): Promise<void> {
     if (!this.editObject?.name || !this.editObject.parent?.id) {
       this.message.error('请填写完整信息');

+ 2 - 2
projects/textbook/src/modules/nav-admin/page-user/page-user.component.html

@@ -255,9 +255,9 @@
         <div class="select">
           <div class="bar">
             @if (this.tbookSer.profile.identity == '国家级管理员') {
-            <a style="color: #86909c" (click)="onPre()">教材遴选</a>
+            <a style="color: #86909c" (click)="onPre()">所有部门</a>
             }@else {
-            <a style="color: #86909c">教材遴选</a>
+            <a style="color: #86909c">所有部门</a>
             } @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             @if (this.tbookSer.profile.identity == '国家级管理员' ||

+ 11 - 10
projects/textbook/src/modules/nav-admin/page-user/page-user.component.ts

@@ -42,7 +42,7 @@ export class PageUserComponent implements OnInit {
         { value: '工作联系人', text: '工作联系人' },
         { value: '高校联系人', text: '高校联系人' },
         { value: '评审专家', text: '评审专家' },
-        { value: '个人', text: '个人' },
+        { value: '教师', text: '教师' },
       ],
     },
     companyType: {
@@ -69,7 +69,7 @@ export class PageUserComponent implements OnInit {
   loading = false;
   searchValue: string = ''; //搜索内容
   setOfCheckedId = new Set<string>();
-  userType: Array<string> = ['工作联系人', '评审专家', '高校联系人', '个人'];
+  userType: Array<string> = ['工作联系人', '评审专家', '高校联系人', '教师'];
   parentMap: Array<any> = [];
   parentList: Array<any> = [];
   radio: string = '';
@@ -101,7 +101,7 @@ export class PageUserComponent implements OnInit {
   ) {
     this.user = Parse.User.current();
     if (this.tbookSer.profile.identity != '国家级管理员') {
-      this.userType = ['评审专家', '高校联系人', '个人'];
+      this.userType = ['评审专家', '高校联系人', '教师'];
     }
   }
 
@@ -144,11 +144,12 @@ export class PageUserComponent implements OnInit {
       },
     };
     if (this.tbookSer.profile.identity != '国家级管理员') {
+      let childrens = await this.tbookSer.getChild(this.tbookSer.profile.user.department?.objectId)
       this.tbookSer.profile.user.department;
       queryParams['where']['$or'][0]['user']['$inQuery']['where'][
         'department'
       ] = {
-        $eq: this.tbookSer.profile.user.department?.objectId,
+        $in: [childrens],
       };
     }
     let query = Parse.Query.fromJSON('Profile', queryParams);
@@ -162,9 +163,9 @@ export class PageUserComponent implements OnInit {
     query.notEqualTo('identity', '国家级管理员');
     query.descending('createdAt');
     if (this.tbookSer.profile.identity == '工作联系人') {
-      query.containedIn('identity', ['个人', '评审专家', '高校联系人']);
+      query.containedIn('identity', ['教师', '评审专家', '高校联系人']);
     } else if (this.tbookSer.profile.identity == '高校联系人') {
-      query.containedIn('identity', ['个人', '评审专家']);
+      query.containedIn('identity', ['教师', '评审专家']);
     }
     this.profileLength = await query.count();
     query.limit(this.pageSize);
@@ -402,10 +403,10 @@ export class PageUserComponent implements OnInit {
       this.account.department = { title: e.title, id: e.key };
       this.account.companyType = e.branch || e.title;
       this.userType = this.parents.some((item) => e.parent == item.key)
-        ? !e.type ? ['工作联系人', '评审专家', '个人'] : ['评审专家', '工作联系人', '个人']
-        : e.type
-        ? ['评审专家', '高校联系人', '个人']
-        : ['评审专家', '个人'];
+        ? !e.type ? ['工作联系人'] : ['评审专家', '工作联系人', '教师']
+        : e.type == '单位'
+        ? ['评审专家', '高校联系人', '教师']
+        : ['评审专家', '教师'];
       return;
     }
     if (e.isLeaf) {

+ 1 - 1
projects/textbook/src/modules/nav-admin/page-user/user-create/user-create.component.html

@@ -399,7 +399,7 @@
         </div>
         <div class="select">
           <div class="bar">
-            <a style="color: #86909c">教材遴选</a>
+            <a style="color: #86909c">所有部门</a>
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             @if($index == 0){

+ 2 - 2
projects/textbook/src/modules/nav-admin/page-user/user-create/user-create.component.ts

@@ -76,7 +76,7 @@ export class UserCreateComponent implements OnInit {
   provinces: Array<string> = provinces.options; //省份
 
   unitTypes: Array<any> = [];
-  userType: Array<string> = ['工作联系人', '评审专家', '高校联系人', '个人'];
+  userType: Array<string> = ['工作联系人', '评审专家', '高校联系人', '教师'];
   identityFile: string = ''; //单位联系人认证文件
   department?: Parse.Object; //所属单位
   parentMap: Array<any> = [];
@@ -95,7 +95,7 @@ export class UserCreateComponent implements OnInit {
 
   async ngOnInit() {
     if (this.tbookSer.profile.identity != '国家级管理员') {
-      this.userType = ['个人'];
+      this.userType = ['教师'];
       this.getUnitTypes(this.tbookSer.profile.companyType);
       return;
     }

+ 3 - 6
projects/textbook/src/modules/nav-admin/user-edit/user-edit.component.html

@@ -271,13 +271,10 @@
           user?.get("department")?.get('name') || user?.get("companyName")
         }}</nz-tag>
       </div> -->
-      <div class="title">原始JSON数据</div>
+      <!-- <div class="title">原始JSON数据</div>
       <div class="fill-template">
         <div nz-row>
           <div nz-col nzSpan="24">
-            <!-- <div class="view-block">
-              {{inputValue}}
-            </div> -->
             <textarea
               rows="4"
               disabled="true"
@@ -287,7 +284,7 @@
             ></textarea>
           </div>
         </div>
-      </div>
+      </div> -->
     </nz-tab>
   </nz-tabset>
 </div>
@@ -331,7 +328,7 @@
         </div>
         <div class="select">
           <div class="bar">
-            <a style="color: #86909c">教材遴选</a>
+            <a style="color: #86909c">所有部门</a>
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             @if($index == 0){ @if (tbookSer.profile.identity != '国家级管理员')

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

@@ -83,13 +83,13 @@ export class UserEditComponent implements OnInit {
           department: this.user.get('department'),
         };
       }
-      let arr = ['个人', '评审专家', '高校联系人'];
+      let arr = ['教师', '评审专家', '高校联系人'];
       if (
         this.tbookSer.profile.identity == '国家级管理员' ||
         (this.tbookSer.profile.identity == '工作联系人' &&
           arr.includes(this.profile.identity)) ||
         (this.tbookSer.profile.identity == '高校联系人' &&
-          this.profile.identity == '个人')
+          this.profile.identity == '教师')
       ) {
         this.edit = true;
       }
@@ -204,6 +204,7 @@ export class UserEditComponent implements OnInit {
   }
   onCheck(e: any) {
     console.log(e);
+    this.userDataJson.department = undefined
     this.provinceChange();
   }
   parent:string = '' //搜索时传入的id

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

@@ -354,7 +354,7 @@ export class AttachmentComponent implements OnInit {
 
   downloadFile(fileName: string) {
     // let fileName = '十四五”普通高等教育本科国家级规划教材第一次遴选推荐申报表.docx'
-    const fileUrl = `../../../../../public/file/${fileName}`;
+    const fileUrl = `/file/${fileName}`;
     this.http.get(fileUrl, { responseType: 'blob' }).subscribe((blob) => {
       const url = window.URL.createObjectURL(blob);
       const a = document.createElement('a');

+ 32 - 20
projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.html

@@ -2,9 +2,9 @@
   <nz-page-header-title
     >申报单位管理
     <br />
-    <div class="subtitle">
+    <!-- <div class="subtitle">
       使用组织机构树管理使用“十四五”高等教育国家规划教材申报系统的所有单位,单位与申报工作流程相关联。
-    </div>
+    </div> -->
   </nz-page-header-title>
   <nz-page-header-extra>
     <nz-space>
@@ -270,22 +270,28 @@
             上级部门 <span style="color: #e8353e">*</span>
           </div>
           <div class="value">
-            <input
-              nz-input
-              placeholder="可击下方选择所属上级"
-              [ngModel]="editObject.parent?.title"
-              (ngModelChange)="onSearchNodes($event, true)"
-              type="text"
-            />
+            <nz-input-group nzSearch [nzAddOnAfter]="suffixIconclear">
+              <input
+                nz-input
+                placeholder="可输入搜索{{editObject.parent?.title || nodes[0]?.title}}下级所属部门"
+                [(ngModel)]="modalValue"
+                (ngModelChange)="onSearchNodes($event, true,editObject.parent?.id)"
+                (blur)="onblur('editObject')"
+                type="text"
+              />
+            </nz-input-group>
+            <ng-template #suffixIconclear>
+               <button nz-button nzType="primary" nzSearch (click)="reset('editObject')">清空</button>
+            </ng-template>
           </div>
         </div>
         <div class="select">
           <div class="bar">
-            <a style="color: #86909c">教材遴选</a>
+            <a style="color: #86909c">所有部门</a>
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             @if ($index !=0 && data?.verify) {
-            <a (click)="onPre(data, $index)">{{ data.title }}</a>
+            <a (click)="onPre('editObject',data, $index)">{{ data.title }}</a>
             }@else {
             <a style="color: #86909c">{{ data.title }}</a>
             } }
@@ -341,22 +347,28 @@
             选择所属部门 <span style="color: #e8353e">*</span>
           </div>
           <div class="value">
-            <input
-              nz-input
-              placeholder="请选择所属部门"
-              [ngModel]="account.department?.title"
-              (ngModelChange)="onSearchNodes($event, true)"
-              type="text"
-            />
+            <nz-input-group nzSearch [nzAddOnAfter]="suffixIconclear">
+              <input
+                nz-input
+                placeholder="可输入搜索{{account.department?.title || nodes[0]?.title}}下级所属部门"
+                [(ngModel)]="modalValue"
+                (ngModelChange)="onSearchNodes($event, true, account.department?.id)"
+                type="text"
+                (blur)="onblur('account')"
+              />
+            </nz-input-group>
+            <ng-template #suffixIconclear>
+               <button nz-button nzType="primary" nzSearch (click)="reset('account')">清空</button>
+            </ng-template>
           </div>
         </div>
         <div class="select">
           <div class="bar">
-            <a style="color: #86909c">教材遴选</a>
+            <a style="color: #86909c">所有部门</a>
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             @if ($index !=0 && data?.verify) {
-            <a (click)="onPre(data, $index)">{{ data.title }}</a>
+            <a (click)="onPre('account', data, $index)">{{ data.title }}</a>
             }@else {
             <a style="color: #86909c">{{ data.title }}</a>
             } }

+ 65 - 37
projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.ts

@@ -113,7 +113,7 @@ export class PageRoleComponent implements OnInit {
     department: {},
     companyType: '',
   };
-  userType: Array<string> = ['个人'];
+  userType: Array<string> = ['教师'];
   parents: Array<any> = []; //所有一级列表
 
   constructor(
@@ -172,23 +172,20 @@ export class PageRoleComponent implements OnInit {
   }
   async getDepart(
     parent?: string,
-    searchValue?: string,
-    filter?: boolean
+    searchValue?: string
   ): Promise<Array<nodes>> {
+    console.log(searchValue);
     let nodes: any = [];
     let query = new Parse.Query('Department');
-    if (!filter) {
-      query.equalTo('parent', parent ? parent : undefined);
-    }
+    query.equalTo('parent', parent ? parent : this.tbookSer.profile.user.department?.objectId);
     searchValue && query.contains('name', searchValue);
     query.notEqualTo('isDeleted', true);
     query.select('code', 'name', 'branch', 'parent', 'type', 'hasChildren');
     query.descending('createdAt');
     query.equalTo('branch', this.tbookSer.profile.companyType);
-    console.log(searchValue);
-    if (searchValue && searchValue != undefined) {
-      query.equalTo('parent', this.tbookSer.profile.user.department?.objectId);
-    }
+    // if (searchValue && searchValue != undefined) {
+    //   query.equalTo('parent', this.tbookSer.profile.user.department?.objectId);
+    // }
     query.limit(100);
     if (this.activeDepart) query.notEqualTo('objectId', this.activeDepart?.id);
     let res = await query.find();
@@ -200,18 +197,38 @@ export class PageRoleComponent implements OnInit {
         branch: item.get('branch'),
         parent: item.get('parent')?.id, //上级
         isLeaf: !item.get('hasChildren') ? true : false, //是否是最下级
-        type: item.get('type'),
+        type: item.get('type')
       });
     });
     return nodes;
   }
   //搜索
-  async onSearchNodes(e: string, modal?: boolean) {
+  async onSearchNodes(e: string, modal?: boolean, id?:string) {
     if (modal) {
-      this.parentList = await this.getDepart('', e, true);
+      this.parentList = await this.getDepart(id, e);
       return;
     }
-    this.nodes = await this.getDepart('', e, e ? true : false);
+    this.nodes = await this.getDepart('', e);
+  }
+  //搜索失去焦点
+  onblur(type:string){
+    console.log(type);
+    if(type == 'account'){
+      this.modalValue = this.account.department?.title
+    }else if(type == 'editObject'){
+      this.modalValue = this.editObject.parent?.title
+    }
+  }
+  reset(type:string){
+    this.modalValue = ''
+    this.parentList = this.nodes;
+    this.parentMap = []
+    if(type == 'account'){
+      this.account.department = {}
+      this.account.identity = ''
+    }else if(type == 'editObject'){
+      this.editObject.parent = {}
+    }
   }
   //添加成员
   addMember() {
@@ -278,9 +295,9 @@ export class PageRoleComponent implements OnInit {
     let query = Parse.Query.fromJSON('Profile', queryParams);
     query.include('user');
     if(this.tbookSer.profile.identity == '工作联系人'){
-      query.containedIn('identity',['个人','高校联系人','评审专家'])
+      query.containedIn('identity',['教师','高校联系人','评审专家'])
     }else if(this.tbookSer.profile.identity == '高校联系人'){
-      query.containedIn('identity',['个人','评审专家'])
+      query.containedIn('identity',['教师','评审专家'])
     }
     query.notEqualTo('identity', '国家级管理员');
     query.notEqualTo('isDeleted', true);
@@ -339,7 +356,6 @@ export class PageRoleComponent implements OnInit {
               await r.save();
             }
             this.message.success('删除成功');
-            // this.nodes = await this.getDepart();
             this.ngOnInit();
             resolve(true);
           }
@@ -420,7 +436,7 @@ export class PageRoleComponent implements OnInit {
     this.isVisible = true;
     this.resetChange()
   }
-  async onPre(data?: any, index?: number) {
+  async onPre(type:string, data?: any, index?: number) {
     console.log(data);
     if (!data?.key || !data.hasChildren) {
       // this.parentList = await this.getDepart();
@@ -429,11 +445,13 @@ export class PageRoleComponent implements OnInit {
     }
     // if(index == this.parentMap.length-1) return
     this.parentMap.splice((index || 0) + 1);
-    this.parentList = await this.getDepart(data?.key);
+    this.radio = '';
+    this.pushValue(type,this.parentMap[this.parentMap.length - 1])
+    this.parentList = this.parentMap[this.parentMap.length - 1].key == this.tbookSer.profile.user.department?.objectId ? this.nodes : await this.getDepart(data?.parent);
   }
   //选择所属类别下级列表
   async onCheckedDepart(type: string, e: any, checked?: boolean) {
-    this.radio = e.key;
+    this.radio = '';
     console.log(e);
     if (type == 'account') this.account.identity = '';
     this.parentMap = await this.tbookSer.formatNode(e.key);
@@ -447,23 +465,8 @@ export class PageRoleComponent implements OnInit {
         }
       });
     }
-    if (checked) {
-      // this.editObject.name = e.title
-      if (type == 'account') {
-        this.account.department = { title: e.title, id: e.key };
-        this.account.companyType = e.branch || e.title;
-        this.userType = this.parents.some((item) => e.parent == item.id)
-          ? ['评审专家', '个人']
-          : e.type
-          ? ['评审专家', '高校联系人', '个人']
-          : ['评审专家', '个人'];
-      } else {
-        this.editObject.parent = {
-          title: e.title,
-          id: e.key,
-        };
-        this.editObject.branch = e.branch || e.title;
-      }
+    if (checked || e.isLeaf) {
+      this.pushValue(type,e)
       return;
     }
     if (e.isLeaf) {
@@ -471,6 +474,30 @@ export class PageRoleComponent implements OnInit {
     }
     this.parentList = await this.getDepart(e?.key);
   }
+  modalValue:string = ''
+  //赋值
+  pushValue(type:string, e: any){
+    console.log(e);
+    this.radio = e.key;
+    this.modalValue = e.title
+    if (type == 'account') {
+      this.account.department = { title: e.title, id: e.key };
+      this.account.companyType = e.branch || e.title;
+      if(this.tbookSer.profile.identity == '工作联系人'){
+        this.userType = this.parents.some((item) => e.parent == item.id)
+        ? ['评审专家', '教师','高校联系人']
+        : e.type == '单位'
+        ? ['评审专家', '高校联系人', '教师']
+        : ['评审专家', '教师'];
+      }
+    } else {
+      this.editObject.parent = {
+        title: e.title,
+        id: e.key,
+      };
+      this.editObject.branch = e.branch || e.title;
+    }
+  }
   async handleOk(): Promise<void> {
     if (!this.editObject?.name || !this.editObject.parent?.id) {
       this.message.error('请填写完整信息');
@@ -535,6 +562,7 @@ export class PageRoleComponent implements OnInit {
   }
   handleCancel(): void {
     console.log('Button cancel clicked!');
+    this.modalValue = ''
     this.isVisible = false;
     this.activatedNode = undefined;
     this.parentMap = [];

+ 1 - 1
projects/textbook/src/services/auth.service.ts

@@ -20,7 +20,7 @@ export class AuthServr {
     "工作联系人": '/nav-province-contact',
     "高校联系人": '/nav-province-school-contact',
     "评审专家": '/nav-review',
-    "个人": '/nav-author/manage/space',
+    "教师": '/nav-author/manage/space',
   };
   constructor(
     public router: Router,

+ 4 - 1
projects/textbook/src/services/textbook.ts

@@ -59,13 +59,16 @@ export class textbookServer {
   //格式化链
   async formatNode(id: string): Promise<Array<any>> {
     let query = new Parse.Query('Department');
-    query.select('name', 'parent', 'hasChildren');
+    query.select('name', 'parent', 'hasChildren','type','branch');
     let r = await query.get(id);
     let arr = [
       {
         title: r.get('name'),
         key: r.id,
         hasChildren: r.get('hasChildren'), //是否是最下级
+        type:r.get('type'),
+        branch: r?.get('branch'),
+        parent: r?.get('parent')?.id, //上级
       },
     ];
     if (r?.get('parent')) {

+ 1 - 1
server/cloud/tbook/func-tbook-export.js

@@ -299,7 +299,7 @@ function renderReportDocsByTextbook(textbook){
         currentY:currentYear,
         currentM:currentMonth,
         currentNum:json?.editionNumber || "",
-        printSum:json?.printSum || "",
+        printSum:json?.printSum?json?.printSum+"万":"" || "",
         isBGJ:circleCheck[(importantProject?.indexOf("本科国家")>-1)?1:0],
         isBSYX:circleCheck[(importantProject?.indexOf("省级优秀")>-1)?1:0],
         isBSGH:circleCheck[(importantProject?.indexOf("省级规划")>-1)?1:0],

二进制
server/cloud/tbook/template/模板-推荐申报表.docx