Browse Source

update admin

cehn 8 months ago
parent
commit
286e2afe54

+ 2 - 1
projects/textbook/src/app/app.routes.ts

@@ -4,7 +4,8 @@ import { CompUserComponent } from './comp-user/comp-user.component';
 import { ProfileComponent } from '../modules/user/profile/profile.component'
 import { CompManageComponent } from './comp-manage/comp-manage.component'
 export const routes: Routes = [
-  { path: '',loadComponent:()=>import('../modules/textbook/page-home/page-home.component').then(m=>m.PageHomeComponent) }, // 默认跳转到 ''
+  { path: '', redirectTo:'user/login', pathMatch: "full",}, // 默认跳转到 ''
+  // { path: '',loadComponent:()=>import('../modules/textbook/page-home/page-home.component').then(m=>m.PageHomeComponent) }, // 默认跳转到 ''
   {
     path: 'user', // 用户登录/注册
     component: CompUserComponent,

+ 7 - 0
projects/textbook/src/app/comp-user/comp-user.component.html

@@ -1,4 +1,11 @@
 <div class="page">
+      <!--logo标识-->
+      <div class="logo-box">
+        <div class="logo-content" routerLink="/startup/home">
+            <img class="logo-img" src="/img/book.png" alt="feima-contest-logo">
+            <div class="logo-font">“十四五”高等教育国家规划教材申报系统</div>
+          </div>
+    </div>
   <div class="login-content">
     <router-outlet></router-outlet>
   </div>

+ 55 - 24
projects/textbook/src/app/comp-user/comp-user.component.scss

@@ -1,30 +1,61 @@
-.page{
-  position: fixed;
-  top: 0px;
-  left: 0px;
-  background: #fff;
-  width: 100%;
-  height: 100%;
-  z-index: 100;
-  overflow: auto;
-  background: url('../../../public//img/banner.png') no-repeat;
+.page {
+  position       : fixed;
+  top            : 0px;
+  left           : 0px;
+  background     : #fff;
+  width          : 100%;
+  height         : 100%;
+  z-index        : 100;
+  overflow       : auto;
+  background     : url('../../../public//img/banner.png') no-repeat;
   background-size: 100% 100%;
 }
-.title{
-  font-size: 1.5rem !important;
+
+//logo标识样式
+.logo-box {
+  display       : flex;
+  flex-direction: row;
+  padding       : 20px;
+  align-items   : center;
+
+  .logo-content {
+    display: flex;
+    cursor : pointer;
+
+    .logo-img {
+      padding-right: 5px;
+      width        : 50px;
+      object-fit   : contain;
+    }
+
+    .logo-font {
+      display    : flex;
+      align-items: center;
+      font-size  : 25px;
+      font-weight: bold;
+      font-style : italic;
+      // color      : #143383;
+      color: #ffffff;
+    }
+  }
+}
+
+.title {
+  font-size : 1.5rem !important;
   text-align: left;
 }
-.login-content{
-  position: absolute;
-  transform:translateY(-50%);
-  top: 50%;
-  right: 100px;
-  padding:10px 50px;
-  text-align: center;
-  width:448px;
-  min-height: 536px;
-  margin: 0 auto;
-  background: #fff;
+
+.login-content {
+  position     : absolute;
+  transform    : translateY(-50%);
+  top          : 50%;
+  right        : 100px;
+  padding      : 10px 50px;
+  text-align   : center;
+  width        : 448px;
+  min-height   : 536px;
+  margin       : 0 auto;
+  background   : #fff;
   border-radius: 8px;
-  overflow: hidden;
+  overflow     : hidden;
 }

+ 2 - 2
projects/textbook/src/modules/login/account-info/account-info.component.html

@@ -228,7 +228,7 @@
     >
       提交
     </button>
-    <div class="menu">
+    <!-- <div class="menu">
       <a nz-dropdown [nzDropdownMenu]="menu">
         <span style="color: #231c1f99">English</span>
         <span
@@ -243,6 +243,6 @@
           <li nz-menu-item>中文简体</li>
         </ul>
       </nz-dropdown-menu>
-    </div>
+    </div> -->
   </div>
 </div>

+ 1 - 0
projects/textbook/src/modules/login/modules.routes.ts

@@ -5,6 +5,7 @@ import { LoginComponent } from './login/login.component';
 import { RegisterComponent } from './register/register.component';
 import { AccountInfoComponent } from './account-info/account-info.component'
 const routes: Routes = [
+  { path: '', redirectTo:'login', pathMatch: "full",}, // 默认跳转到 ''
   {
     path: 'login',
     component: LoginComponent,

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

@@ -71,7 +71,7 @@
                 nzType="link"
                 style="color: #231c1f"
               >
-                <span nz-icon nzType="edit" nzTheme="outline"></span>设为管理员
+                <span nz-icon nzType="edit" nzTheme="outline"></span>设为联系人
               </button>
               }
             </li>

+ 5 - 3
projects/textbook/src/modules/nav-admin/page-process/process-create/process-create.component.html

@@ -190,7 +190,7 @@
               [nzNoColon]="true"
               [nzSm]="18"
               [nzXs]="18"
-              nzRequired
+              [nzRequired]="eduProcess?.id"
               >推荐限额</nz-form-label
             >
             <nz-form-control
@@ -365,7 +365,7 @@
             @for (data of parentMap; track data.title) {
             <span style="margin: 0 10px">/</span>
             @if($index == 0){
-            <a>{{ data.title }}</a>
+            <a style="color: #86909c">{{ data.title }}</a>
             }@else {
             <a (click)="onCheck(data)">{{ data.title }}</a>
             } }
@@ -380,7 +380,9 @@
                 (click)="onCheckedDepart(data, true)"
                 >{{ data.get("name") }}</label
               >
-              <span nz-icon nzType="right" nzTheme="outline"></span>
+              @if (data.get("type") != '单位') {
+                <span nz-icon nzType="right" nzTheme="outline"></span>
+              }
             </div>
             }
           </div>

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

@@ -56,7 +56,7 @@ export class ProcessCreateComponent implements OnInit {
     name: ['', [Validators.required]],
     desc: ['', [Validators.required]],
     code: ['', [Validators.required]],
-    num: ['', [Validators.required]],
+    num: ['',],
     branch: ['', [Validators.required]],
     startDate: [new Date('2024/07/20'), [Validators.required]],
     deadline: [new Date('2024-09-20'), [Validators.required]],
@@ -190,7 +190,7 @@ export class ProcessCreateComponent implements OnInit {
     this.eduProcess?.set('name', params.name);
     this.eduProcess?.set('desc', params.desc);
     this.eduProcess?.set('code', params.code);
-    this.eduProcess?.set('num', params.num);
+    params.num && this.eduProcess?.set('num', params.num);
     this.eduProcess?.set('startDate', params.startDate);
     this.eduProcess?.set('deadline', params.deadline);
     if (!this.eduProcess?.get('profileSubmitted')) {

+ 6 - 3
projects/textbook/src/modules/nav-admin/page-role/page-role.component.html

@@ -30,6 +30,7 @@
             nz-input
             placeholder="搜索"
             [(ngModel)]="searchValue"
+            (ngModelChange)="onSearchNodes($event)"
           />
         </nz-input-group>
         <ng-template #prefixTemplateUser
@@ -91,7 +92,7 @@
       <nz-tree
         [nzData]="nodes"
         nzAsyncData
-        [nzSearchValue]="searchValue"
+        [nzSearchValue]="searchValueNode"
         (nzClick)="nzEvent($event)"
         (nzExpandChange)="nzEvent($event)"
         (nzSearchValueChange)="onSearch($event)"
@@ -279,12 +280,14 @@
             <div class="li" (click)="onCheckedDepart(data)">
               <label
                 nz-radio
-                ngModel
+                [ngModel]="data.key == radio"
                 [nzValue]="data.key"
                 (click)="onCheckedDepart(data, true)"
                 >{{ data.title }}</label
               >
-              <span nz-icon nzType="right" nzTheme="outline"></span>
+              @if (!data.isLeaf) {
+                <span nz-icon nzType="right" nzTheme="outline"></span>
+              }
             </div>
             }
           </div>

+ 17 - 4
projects/textbook/src/modules/nav-admin/page-role/page-role.component.ts

@@ -69,6 +69,7 @@ export class PageRoleComponent implements OnInit {
   queryParams: any | undefined;
   fieldsArray: Array<any> | undefined;
   searchValue: string = ''; //搜索内容
+  searchValueNode:string = ''
   nodes: Array<nodes | any> = [];
   currentDepart: nodes | any = null;
 
@@ -92,6 +93,7 @@ export class PageRoleComponent implements OnInit {
   };
   parentMap: Array<any> = [];
   parentList: Array<any> = [];
+  radio:string = ''
 
   constructor(
     private route: Router,
@@ -124,11 +126,14 @@ export class PageRoleComponent implements OnInit {
   }
   async getDepart(
     parent?: string,
-    searchValue?: string
+    searchValue?: string,
+    filter?:boolean
   ): Promise<Array<nodes>> {
     let nodes: any = [];
     let query = new Parse.Query('Department');
-    query.equalTo('parent', parent ? parent : undefined);
+    if(!filter){
+      query.equalTo('parent', parent ? parent : undefined);
+    }
     searchValue && query.contains('name', searchValue);
     query.notEqualTo('isDeleted', true);
     query.select('code', 'name', 'branch', 'parent','type');
@@ -141,11 +146,15 @@ export class PageRoleComponent implements OnInit {
         key: item.id,
         children: [],
         isParent: item.get('type') =='单位' ? true : false, //是否是最下级
-        isLeaf: false,
+        isLeaf: item.get('type') =='单位' ? true : false,
       });
     });
     return nodes;
   }
+  //搜索
+  async onSearchNodes(e:string){
+    this.nodes = await this.getDepart('',e, e ? true : false);
+  }
   //添加成员
   addMember() {
     this.message.warning('权限灰度中')
@@ -278,7 +287,8 @@ export class PageRoleComponent implements OnInit {
   }
   //选择所属类别下级列表
   async onCheckedDepart(e: any, checked?: boolean) {
-    console.log(e);
+    this.radio = e.key
+    console.log(this.radio);
     if (checked) {
       this.editObject = {
         name: e.title,
@@ -289,6 +299,9 @@ export class PageRoleComponent implements OnInit {
       };
       return;
     }
+    if(e.isLeaf){
+      return
+    }
     this.parentMap.push({
       title: e.title,
       key: e.key,

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

@@ -170,7 +170,8 @@
                   >通过认证
                 </button>
               </li>
-              } @if (data?.user.accountState != '已禁用') {
+              } 
+              <!-- @if (data?.user.accountState != '已禁用') {
               <li nz-menu-item>
                 <button
                   nz-button
@@ -181,7 +182,7 @@
                   <span nz-icon nzType="stop" nzTheme="outline"></span>禁用账号
                 </button>
               </li>
-              }
+              } -->
               <li nz-menu-item>
                 <button
                   (click)="updateUser(data, '删除')"

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

@@ -61,7 +61,8 @@
                   >通过认证
                 </button>
               </li>
-              } @if (user?.get('accountState') != '已禁用') {
+              } 
+              <!-- @if (user?.get('accountState') != '已禁用') {
               <li nz-menu-item>
                 <button
                   nz-button
@@ -72,7 +73,7 @@
                   <span nz-icon nzType="stop" nzTheme="outline"></span>禁用账号
                 </button>
               </li>
-              }
+              } -->
               <li nz-menu-item>
                 <button
                   (click)="updateUser('删除')"