diff --git a/src/api/articles.ts b/src/api/articles.ts
index 6d4aa65..9f44b66 100644
--- a/src/api/articles.ts
+++ b/src/api/articles.ts
@@ -2,21 +2,19 @@ import request from '@/utils/request'
import { IArticleData } from './types'
export const defaultArticleData: IArticleData = {
- id: 0,
- status: 'draft',
+ id: '',
title: '',
content: '',
summary: '',
- sourceURL: '',
- imageURL: '',
- timestamp: '',
- platforms: ['a-platform'],
- disableComment: false,
- importance: 0,
+ source: '',
+ sourceUrl: '',
+ displayTime: '',
+ tags: [],
+ keywords: [],
+ sortno: 0,
author: '',
- reviewer: '',
type: '',
- pageviews: 0
+ attachments: []
}
export const getArticles = (params: any) =>
diff --git a/src/api/types.d.ts b/src/api/types.d.ts
index 08e14cc..875cdeb 100644
--- a/src/api/types.d.ts
+++ b/src/api/types.d.ts
@@ -1,17 +1,15 @@
export interface IArticleData {
- id: number
- status: string
+ id: string
title: string
summary: string
content: string
- sourceURL: string
- imageURL: string
- timestamp: string | number
- platforms: string[]
- disableComment: boolean
- importance: number
+ source: string
+ sourceUrl: string
+ displayTime: string | number
+ tags: string[]
+ keywords: string[]
+ sortno: number
author: string
- reviewer: string
type: string
- pageviews: number
+ attachments: []
}
diff --git a/src/lang/en.ts b/src/lang/en.ts
index 0758076..1c445ff 100644
--- a/src/lang/en.ts
+++ b/src/lang/en.ts
@@ -179,5 +179,8 @@ export default {
admin: {
addAdmin: 'New Admin',
editAdmin: 'Edit Admin'
+ },
+ article: {
+ add: 'New Article'
}
}
diff --git a/src/lang/zh.ts b/src/lang/zh.ts
index 1b3610f..3ee3ae5 100644
--- a/src/lang/zh.ts
+++ b/src/lang/zh.ts
@@ -179,5 +179,8 @@ export default {
admin: {
addAdmin: '新增',
editAdmin: '编辑'
+ },
+ article: {
+ add: '添加'
}
}
diff --git a/src/views/article/components/ArticleDetail.vue b/src/views/article/components/ArticleDetail.vue
index 97d454f..ff647b4 100644
--- a/src/views/article/components/ArticleDetail.vue
+++ b/src/views/article/components/ArticleDetail.vue
@@ -10,9 +10,6 @@
:z-index="10"
:class-name="'sub-navbar '+postForm.status"
>
-
-
-
"2013-06-25 06:59:25"
// frontend need timestamp => 1372114765000
get timestamp() {
- return (+new Date(this.postForm.timestamp))
+ return (+new Date(this.postForm.displayTime))
}
set timestamp(value) {
- this.postForm.timestamp = +new Date(value)
+ this.postForm.displayTime = +new Date(value)
}
created() {
@@ -310,7 +306,6 @@ export default class extends Vue {
type: 'success',
duration: 2000
})
- this.postForm.status = 'published'
// Just to simulate the time of the request
setTimeout(() => {
this.loading = false
@@ -336,7 +331,6 @@ export default class extends Vue {
showClose: true,
duration: 1000
})
- this.postForm.status = 'draft'
}
private async getRemoteUserList(name: string) {
diff --git a/src/views/article/list.vue b/src/views/article/list.vue
index 62fb672..8e03535 100644
--- a/src/views/article/list.vue
+++ b/src/views/article/list.vue
@@ -1,37 +1,56 @@
+
+
+ {{$t('article.add')}}
+
+
+
- {{ row.id }}
+ {{ row.displayTime | parseTime }}
+
+
+
+
+ {{ row.type }}
+
+
+
+
+
+ {{ row.title }}
+
-
- {{ row.timestamp | parseTime }}
-
-
-
-
{{ row.author }}
@@ -39,42 +58,11 @@
-
-
-
-
-
-
-
- {{ row.status }}
-
-
-
-
-
-
-
- {{ row.title }}
-
+ {{ row.source }}
@@ -117,8 +105,14 @@ import Pagination from '@/components/Pagination/index.vue'
name: 'ArticleList',
components: {
Pagination
+ },
+ filters: {
+ parseTime: (timestamp: string) => {
+ return new Date(timestamp).toISOString()
+ }
}
})
+
export default class extends Vue {
private total = 0
private list: IArticleData[] = []
@@ -155,4 +149,5 @@ export default class extends Vue {
right: 15px;
top: 10px;
}
+