|
@@ -1,11 +1,19 @@
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
import { DataImporter } from '../import-book-data';
|
|
|
import { CloudObject, CloudQuery } from 'src/lib/ncloud';
|
|
|
-import { NavController } from '@ionic/angular/standalone';
|
|
|
+import { IonCardSubtitle, NavController } from '@ionic/angular/standalone';
|
|
|
import { DatePipe } from '@angular/common';
|
|
|
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonListHeader, IonLabel, IonItem, IonIcon, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonGrid, IonRow, IonCol, IonBadge, IonFab, IonFabButton } from '@ionic/angular/standalone';
|
|
|
+import {
|
|
|
+ IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonListHeader,
|
|
|
+ IonLabel, IonItem, IonIcon, IonCard, IonCardHeader, IonCardTitle,
|
|
|
+ IonCardContent, IonGrid, IonRow, IonCol, IonBadge, IonFab, IonFabButton,
|
|
|
+ IonButtons, IonBackButton, IonButton, IonSearchbar
|
|
|
+} from '@ionic/angular/standalone';
|
|
|
import { addIcons } from 'ionicons';
|
|
|
-import { documentTextOutline, documentOutline, bookOutline, cloudDownloadOutline } from 'ionicons/icons';
|
|
|
+import {
|
|
|
+ documentTextOutline, documentOutline, bookOutline, cloudDownloadOutline,
|
|
|
+ searchOutline, chevronForwardOutline
|
|
|
+} from 'ionicons/icons';
|
|
|
|
|
|
|
|
|
@Component({
|
|
@@ -13,17 +21,41 @@ import { documentTextOutline, documentOutline, bookOutline, cloudDownloadOutline
|
|
|
templateUrl: './page-book-list.component.html',
|
|
|
styleUrls: ['./page-book-list.component.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonListHeader, IonLabel, IonItem, IonIcon, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonGrid, IonRow, IonCol, IonBadge, IonFab, IonFabButton, DatePipe]
|
|
|
-})
|
|
|
+ imports: [
|
|
|
+ IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonListHeader,
|
|
|
+ IonLabel, IonItem, IonIcon, IonCard, IonCardHeader, IonCardTitle,
|
|
|
+ IonCardContent, IonGrid, IonRow, IonCol, IonBadge, IonFab, IonFabButton,
|
|
|
+ IonButtons, IonCardSubtitle, IonBackButton, IonButton, IonSearchbar,
|
|
|
+ DatePipe
|
|
|
+ ]})
|
|
|
export class PageBookListComponent implements OnInit {
|
|
|
|
|
|
+ // 分类颜色数组
|
|
|
+ categoryColors = [
|
|
|
+ '#3A5FE5', // 蓝色
|
|
|
+ '#00C4A1', // 青色
|
|
|
+ '#FF7043', // 橙色
|
|
|
+ '#9C27B0', // 紫色
|
|
|
+ '#FF4D4F', // 红色
|
|
|
+ '#4CAF50', // 绿色
|
|
|
+ '#607D8B', // 灰色
|
|
|
+ '#FFC107' // 黄色
|
|
|
+ ];
|
|
|
+
|
|
|
constructor(
|
|
|
private navCtrl: NavController
|
|
|
) {
|
|
|
- addIcons({ documentTextOutline, documentOutline, bookOutline, cloudDownloadOutline });
|
|
|
+ addIcons({
|
|
|
+ documentTextOutline,
|
|
|
+ documentOutline,
|
|
|
+ bookOutline,
|
|
|
+ cloudDownloadOutline,
|
|
|
+ searchOutline,
|
|
|
+ chevronForwardOutline
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- ngOnInit() {
|
|
|
+ ngOnInit() {
|
|
|
this.loadBookData();
|
|
|
}
|
|
|
|
|
@@ -54,4 +86,31 @@ export class PageBookListComponent implements OnInit {
|
|
|
DataImporter.executeFullImport();
|
|
|
}
|
|
|
|
|
|
+ // 获取分类颜色
|
|
|
+ getCategoryColor(index: number): string {
|
|
|
+ return this.categoryColors[index % this.categoryColors.length];
|
|
|
+ }
|
|
|
+
|
|
|
+ // 根据文档类型获取颜色
|
|
|
+ getDocTypeColor(docType: string): string {
|
|
|
+ const typeMap: Record<string, string> = {
|
|
|
+ '合同': 'secondary',
|
|
|
+ '诉讼': 'danger',
|
|
|
+ '协议': 'success',
|
|
|
+ '通知': 'warning',
|
|
|
+ '申请': 'tertiary'
|
|
|
+ };
|
|
|
+ return typeMap[docType] || 'primary';
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查看文书详情
|
|
|
+ viewDocument(document: CloudObject) {
|
|
|
+ this.navCtrl.navigateForward(['/document-detail', document.id]);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查看法律知识详情
|
|
|
+ viewKnowledge(knowledge: CloudObject) {
|
|
|
+ this.navCtrl.navigateForward(['/knowledge-detail', knowledge.id]);
|
|
|
+ }
|
|
|
+
|
|
|
}
|