Bladeren bron

增加用户信息页展示用户教材

cehn 1 maand geleden
bovenliggende
commit
ddefa4cc10

+ 2 - 0
projects/textbook/src/app/textbook/textbook.component.ts

@@ -522,6 +522,7 @@ export class TextbookComponent implements OnInit {
         if (data?.id) {
           data.set('status', '300');
           data.set('render', null);
+          data.set('recommend', null);
           // data.set('code', null);
           await data.save();
         } else {
@@ -532,6 +533,7 @@ export class TextbookComponent implements OnInit {
             return new Promise((resolve) => {
               item.set('status', '300');
               item.set('render', null);
+              item.set('recommend', null);
               // item.set('code', null);
               item.save().then(() => resolve(true));
             });

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

@@ -47,12 +47,12 @@
     </nz-tab>
 
     <nz-tab nzTitle="教材文件">
-      <!-- @if (active == 2) { -->
+      @if (eduProcess?.id) {
       <app-collect-textbook
         #collect
         [eduProcess]="eduProcess"
       ></app-collect-textbook>
-      <!-- } -->
+      }
     </nz-tab>
   </nz-tabset>
 </div>

+ 30 - 23
projects/textbook/src/modules/nav-admin/user-edit/user-edit.component.html

@@ -391,14 +391,11 @@
           [nzColor]="'#efefef'"
           >{{ userDataJson.companyType }}</nz-tag
         >
-        @for (item of userDataJson.node; track $index) {
-          @if($index > 0){
-            /<nz-tag [nzBordered]="false" [nzColor]="'geekblue'">{{
-              item.title
-            }}</nz-tag>
-          }
-        }
-        }@else { 待选择 }
+        @for (item of userDataJson.node; track $index) { @if($index > 0){
+        /<nz-tag [nzBordered]="false" [nzColor]="'geekblue'">{{
+          item.title
+        }}</nz-tag>
+        } } }@else { 待选择 }
       </div>
       <!-- <div class="title">所属组织部门</div>
       <div class="fill-template">
@@ -432,6 +429,16 @@
         </div>
       </div> -->
     </nz-tab>
+    @if(tbookSer.profile.identity == '国家级管理员'){
+    <nz-tab nzTitle="用户教材">
+      @if(user?.id){
+      <app-textbook
+        [filterObj]="submitTextBook"
+        [uid]="user?.id"
+      ></app-textbook>
+      }
+    </nz-tab>
+    })
   </nz-tabset>
 </div>
 
@@ -502,22 +509,22 @@
           </div> -->
           <div class="tree">
             @if(parentList.length > 0){ @for (data of parentList; track $index)
-              {
-              <div class="li" (click)="onCheckedDepart(data)">
-                <label
-                  nz-radio
-                  [ngModel]="data.key == radio"
-                  [nzValue]="data.key"
-                  (click)="onCheckedDepart(data, true)"
-                  >{{ data.title }}</label
-                >
-                @if (!data.isLeaf) {
-                <span nz-icon nzType="right" nzTheme="outline"></span>
-                }
-              </div>
-              } }@else {
-              <nz-empty nzNotFoundContent="暂无下级部门"></nz-empty>
+            {
+            <div class="li" (click)="onCheckedDepart(data)">
+              <label
+                nz-radio
+                [ngModel]="data.key == radio"
+                [nzValue]="data.key"
+                (click)="onCheckedDepart(data, true)"
+                >{{ data.title }}</label
+              >
+              @if (!data.isLeaf) {
+              <span nz-icon nzType="right" nzTheme="outline"></span>
               }
+            </div>
+            } }@else {
+            <nz-empty nzNotFoundContent="暂无下级部门"></nz-empty>
+            }
             <!-- @for (data of parentList; track $index) {
             <div class="li" (click)="onCheckedDepart(data)">
               <label

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

@@ -20,6 +20,8 @@ import { MatButtonModule } from '@angular/material/button';
 import { provinces } from '../../../services/provinces';
 import { NzModalService } from 'ng-zorro-antd/modal';
 import { Observable, of } from 'rxjs';
+import { TextbookComponent } from '../../../app/textbook/textbook.component';
+
 @Component({
   selector: 'app-user-edit',
   templateUrl: './user-edit.component.html',
@@ -38,6 +40,7 @@ import { Observable, of } from 'rxjs';
     NzImageModule,
     NzSelectModule,
     MatButtonModule,
+    TextbookComponent
   ],
   standalone: true,
 })
@@ -49,6 +52,15 @@ export class UserEditComponent implements OnInit {
     }
     callback(null, user, context)
   }`;
+
+  submitTextBook = {
+    status:['102','103','200','201','300','400'],
+    btns:{
+      review:true,//查阅
+      // uploadPDF:true
+    }
+  }
+
   isVisible: boolean = false;
   user: Parse.Object | any;
   profile: Parse.Object | any;