文章管理
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
<div class="inner-content">
|
||||||
|
<nz-card nzTitle="文章管理" nzSize="small">
|
||||||
|
<nz-table #table [nzData]="pageList.list" [nzTotal]="pageList.total" [(nzPageIndex)]="page"
|
||||||
|
[nzPageSize]="pageSize"
|
||||||
|
(nzPageIndexChange)="getArticle()" nzFrontPagination="false">
|
||||||
|
<thead>
|
||||||
|
<th>标题</th>
|
||||||
|
<th>发布日期</th>
|
||||||
|
<th>更新日期</th>
|
||||||
|
<th>文章类型</th>
|
||||||
|
<th>阅读量</th>
|
||||||
|
<th>是否可见</th>
|
||||||
|
<th>操作</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let data of table.data">
|
||||||
|
<td nz-typography nzEllipsis="true" [nzTooltipTitle]="data.title" nzTooltipPlacement="right"
|
||||||
|
nz-tooltip>{{data.title}}</td>
|
||||||
|
<td>{{data.publishDateFormat}}</td>
|
||||||
|
<td>{{data.updateDateFormat}}</td>
|
||||||
|
<td>{{data.original ? '原创' : '转载'}}</td>
|
||||||
|
<td>{{data.readingNumber}}</td>
|
||||||
|
<td><input type="checkbox" [checked]="data.open" disabled></td>
|
||||||
|
<td>
|
||||||
|
<a routerLink="/write" [queryParams]="{id:data.id}" class="edit-opr">编辑</a>
|
||||||
|
<nz-divider nzType="vertical"></nz-divider>
|
||||||
|
<a [routerLink]="'/article'+data.id" class="show-opr">查看</a>
|
||||||
|
<nz-divider nzType="vertical"></nz-divider>
|
||||||
|
<a nz-popconfirm nzPopconfirmTitle="确定要删除这篇文章吗?" nzOkText="删除" nzCancelText="点错了"
|
||||||
|
(nzOnConfirm)="deleteArticle(data.id)" class="del-opr">删除</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</nz-table>
|
||||||
|
</nz-card>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
td {
|
||||||
|
max-width: 200px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class AdminArticleComponent implements OnInit {
|
|||||||
page: number = 1;
|
page: number = 1;
|
||||||
pageSize: number = 10;
|
pageSize: number = 10;
|
||||||
|
|
||||||
pageList: PageList<Article>;
|
pageList: PageList<Article> = new PageList<Article>();
|
||||||
|
|
||||||
loading: boolean = true;
|
loading: boolean = true;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,15 @@ import {NgModule} from '@angular/core';
|
|||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import {RouterModule} from '@angular/router';
|
import {RouterModule} from '@angular/router';
|
||||||
import {AdminArticleComponent} from './admin-article.component';
|
import {AdminArticleComponent} from './admin-article.component';
|
||||||
|
import {CommonTableModule} from '../components/common-table/common-table.module';
|
||||||
|
import {
|
||||||
|
NzCardModule,
|
||||||
|
NzDividerModule,
|
||||||
|
NzPopconfirmModule,
|
||||||
|
NzTableModule,
|
||||||
|
NzToolTipModule,
|
||||||
|
NzTypographyModule
|
||||||
|
} from 'ng-zorro-antd';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@@ -9,7 +18,14 @@ import {AdminArticleComponent} from './admin-article.component';
|
|||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
RouterModule.forChild([{path: '', component: AdminArticleComponent}])
|
RouterModule.forChild([{path: '', component: AdminArticleComponent}]),
|
||||||
|
CommonTableModule,
|
||||||
|
NzTableModule,
|
||||||
|
NzTypographyModule,
|
||||||
|
NzToolTipModule,
|
||||||
|
NzCardModule,
|
||||||
|
NzDividerModule,
|
||||||
|
NzPopconfirmModule,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AdminArticleModule {
|
export class AdminArticleModule {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export class AdminComponent implements OnInit {
|
|||||||
|
|
||||||
showEditInfoModal() {
|
showEditInfoModal() {
|
||||||
this.editInfoModalVisible = true;
|
this.editInfoModalVisible = true;
|
||||||
|
this.infoDrawerVisible = false;
|
||||||
this.editInfoFormGroup.patchValue(this.user);
|
this.editInfoFormGroup.patchValue(this.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,3 +6,19 @@
|
|||||||
body {
|
body {
|
||||||
background: #ececec;
|
background: #ececec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inner-content {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-opt {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.show-opr {
|
||||||
|
color: #00aaaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.del-opr {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user