瀏覽代碼

fixed img bug

amr 5 年之前
父節點
當前提交
377f0a540f

+ 1 - 1
src/app/External-Page/external-page-content/external-page-content.component.html

@@ -12,7 +12,7 @@
                     </ul>
                     <div class="carousel-inner">
                         <div class="carousel-item" *ngFor="let report of reports; let i = index" [ngClass]="i == 0 ? 'active' : ''">
-                          <img src="{{authSer.pathImg + report['photo'].photo}}" />
+                          <img src="{{report['photo'].photo != 'null' || '' ?  authSer.pathImg + report['photo'].photo : 'not found'  }}" />
                           <div class="carousel-caption d-md-block">
                               <h5>{{report.title}}</h5>
                               <p [innerHtml] = "report.description"></p>

+ 5 - 0
src/app/External-Page/external-page-content/external-page-content.component.ts

@@ -81,7 +81,12 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
             this.reports[i].description = this.reports[i].description.substring(0,300) + '.......';
             this.reports[i].description_en = this.reports[i].description_en.substring(0,300) + '.......';
           }
+          if(this.reports[i].photo == null){
+            this.reports[i].photo = 'notfound.png'
+          }
         }
+        console.log(this.reports);
+        
         this.events = responce['data'].events;
         this.services = responce['data'].external_services;
         this.firstAdvertisiment = responce['data'].first_advertising_services_row;

二進制
src/app/External-Page/external-page-content/notfound.png


+ 15 - 4
src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.html

@@ -17,7 +17,7 @@
       </div>
       <div class="col-12 col-sm-12 col-md-6 col-lg-6">
         <div class="form-group">
-          <input type="text" placeholder="البحث (اسم التصنيف	)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
+          <input type="text" placeholder="البحث (اسم العهدة	)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>
@@ -37,6 +37,17 @@
             </span>
           </div>
         </div>
+        <div class="col-12 col-sm-12 col-md-12 col-lg-6">
+          <div class="form-group">
+            <span class="spanSelect-w" style="margin-right:10px;">
+              <select [ngModel]="type" class="form-control selectButton-w" (input)="getCategories($event.target.value)" >
+                <option  value="all">الكل</option>
+                <option *ngFor="let item of categories" [value]="item.id">{{item.name}}</option>   
+              </select>
+              تصنيف العهدة
+            </span>
+          </div>
+        </div>
         
     </div>
 
@@ -49,8 +60,8 @@
             </div>
           </th>
          
-          <th>اسم التصنيف</th>
-          <th>اسم المادة او العهدة</th>
+          <th>اسم العهدة</th>
+          <th *ngIf="showItime">اسم التصنيف</th>
           <th>العدد الموجود</th>
           <th>فعال</th>
 
@@ -66,7 +77,7 @@
             </div>
           </td>
           <td>{{data.name}}</td>
-          <td>{{data.category_name}}</td>
+          <td *ngIf="showItime">{{data.category_name}}</td>
           <td>{{data.amount}}</td>
           <td>{{data.status == '0' ? 'غير فعال' : data.status == '1' ? ' فعال' : 'not found'}}</td>
         <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>

+ 60 - 25
src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.ts

@@ -20,6 +20,8 @@ export class DefinitionOfCovenantsListComponent implements OnInit {
   pages= [];
   pageId: number;
   Ids = [];
+  categories = [];
+  type: any = 'all';
   count: number;
   perPagePagenation: number;
   currentPage:number = 1;
@@ -30,6 +32,7 @@ export class DefinitionOfCovenantsListComponent implements OnInit {
   dataTableNumber: number = 5;
   absorpationListIds = [];
   dataListIds = [];
+  showItime: boolean = true;
 
   constructor(
     private route: ActivatedRoute,
@@ -69,7 +72,18 @@ export class DefinitionOfCovenantsListComponent implements OnInit {
        );
 
 
+       this.http.get(this.authSer.pathApi + '/get_covenant_categories_list')
+       .subscribe(
+         res => {
+           console.log('gg', res);
+           this.categories = res[('covenant_categories')];
+         },
+         err =>{
+           console.log(err);
 
+           
+         }
+       );
        this.route.parent.params.subscribe(
         (params:Params) => {
             this.userLoginId = params['userID'];
@@ -101,7 +115,7 @@ export class DefinitionOfCovenantsListComponent implements OnInit {
         );
 
         console.log('current page',this.pageId)
-        this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+        this.dashboardSer.getListDataNew(this.pageId, this.currentPage ,this.dataTableNumber, this.type).subscribe(
           res => {
             console.log(res);
           this.dataList = res['covenants'];
@@ -158,7 +172,28 @@ export class DefinitionOfCovenantsListComponent implements OnInit {
     this.absorpationListIds = [];
     console.log(pagenationNumber);
     console.log(this.pageId);
-    this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+    this.dashboardSer.getListDataNew(this.pageId, this.currentPage ,this.dataTableNumber, this.type).subscribe(
+      res => {
+        console.log(res);
+        this.dataList = res['covenants'];
+        this.count = res['count'];
+        this.perPagePagenation = res['per_page'];
+        console.log('FFFFFF', this.absorpationListIds);
+        this.spinner.hide();
+      },
+      err => {
+        console.log(err);
+        this.spinner.hide();
+      }
+    );
+  }
+  getCategories(event){
+    this.showItime = true;
+    this.type = event;
+    if(event != 'all'){
+      this.showItime = false;
+    }
+    this.dashboardSer.getListDataNew(this.pageId, this.currentPage ,this.dataTableNumber, this.type).subscribe(
       res => {
         console.log(res);
         this.dataList = res['covenants'];
@@ -179,7 +214,7 @@ onGetValue(event) {
   this.spinner.show();
   this.absorpationListIds = [];
   this.dataTableNumber = event.target.value;
-  this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+  this.dashboardSer.getListDataNew(this.pageId, this.currentPage ,this.dataTableNumber, this.type).subscribe(
     res => {
       console.log(res);
       this.absorpationListIds = res['covenants'];
@@ -193,27 +228,27 @@ onGetValue(event) {
     }
   );
 };
-onGetValueFiltter(event) {
-  console.log(event.target.value)
-  this.spinner.show();
-  this.dataList = [];
-  const typeId = event.target.value;
-  this.filtterStatus = event.target.value;
-  console.log(this.filtterStatus);
-  this.http.get(this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId).subscribe(
-    res => {
-      console.log(res);
-      this.dataList = res['covenants'];
-      this.count = res['count'];
-      this.perPagePagenation = res['per_page'];
-      this.spinner.hide();
-      console.log('UrL>>', this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId)
-    },
-    err=> {
-      console.log(err);
-    }
-  );
-}
+// onGetValueFiltter(event) {
+//   console.log(event.target.value)
+//   this.spinner.show();
+//   this.dataList = [];
+//   const typeId = event.target.value;
+//   this.filtterStatus = event.target.value;
+//   console.log(this.filtterStatus);
+//   this.http.get(this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + this.type + '/' + typeId).subscribe(
+//     res => {
+//       console.log(res);
+//       this.dataList = res['covenants'];
+//       this.count = res['count'];
+//       this.perPagePagenation = res['per_page'];
+//       this.spinner.hide();
+//       console.log('UrL>>', this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId)
+//     },
+//     err=> {
+//       console.log(err);
+//     }
+//   );
+// }
 
 
 onDelete() {
@@ -245,7 +280,7 @@ onDelete() {
             this.spinner.show();
             this.dataList = [];
              //get list data
-            this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+            this.dashboardSer.getListDataNew(this.pageId, this.currentPage ,this.dataTableNumber, this.type).subscribe(
               (responce) => {
                 console.log(responce);
                 this.dataList = responce['covenants'];

+ 1 - 1
src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.html

@@ -18,7 +18,7 @@
           <div class="col-12 col-sm-12 col-md-4">
             <div class="form-group">
               <label for="complex_number" style="float: right; margin-right: 5px">رقم المجمع السكني<span class="spanReqired-w">*</span></label>
-              <input type="number" class="form-control" id="complex_number" name="complex_number" placeholder="رقم المجمع السكني" ngModel [(ngModel)]="formData.complex_number" required/>
+              <input type="number" class="form-control" id="complex_number" name="complex_number"  min="1" placeholder="رقم المجمع السكني" ngModel [(ngModel)]="formData.complex_number" required/>
             </div>
           </div>
 

+ 6 - 1
src/app/shared/dashboard.service.ts

@@ -49,7 +49,12 @@ export class DashboardService {
         console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
         return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
     }
-
+    getListDataNew(pageId: number, currentPage: number, dataTableNumber: number , type: any){
+      this.spinner.show();
+        console.log('services ', currentPage);
+        console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + type);
+        return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/' +type);
+    }
      //get data user from searchBar
      getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
       if(pageId == 40) {