|
|
@@ -3,53 +3,53 @@
|
|
|
<div class="white-box">
|
|
|
<el-table :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
- <el-table-column label="ID" prop="ID">
|
|
|
+ <el-table-column :label="$t('article.id')" prop="ID">
|
|
|
<template slot-scope="scope">
|
|
|
<router-link :to="`/article/detail/${scope.row.ID}`" target="_blank" class="islide">
|
|
|
<span>{{ scope.row.ID }}</span>
|
|
|
</router-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="Title" prop="TITLE">
|
|
|
+ <el-table-column :label="$t('article.title')" prop="TITLE">
|
|
|
<template slot-scope="scope">
|
|
|
<router-link :to="`/article/detail/${scope.row.ID}`" target="_blank" class="islide">
|
|
|
<span>{{ scope.row.TITLE }}</span>
|
|
|
</router-link>
|
|
|
</template>
|
|
|
</el-table-column><!--标题-->
|
|
|
- <el-table-column label="Category"><!--分类-->
|
|
|
+ <el-table-column :label="$t('article.category')"><!--分类-->
|
|
|
<template slot-scope="scope">
|
|
|
{{ allData.allCategory[scope.row.CID].CATE_NAME }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="Sort" width="100"> <!-- 排序 -->
|
|
|
+ <el-table-column :label="$t('article.sort')" width="100"> <!-- 排序 -->
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.SORT" min="0" max="99" @change="handleChangeSort(scope.row, scope.row.SORT)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="Creation Time"><!--创建时间-->
|
|
|
+ <el-table-column :label="$t('article.creationTime')"><!--创建时间-->
|
|
|
<template slot-scope="scope">
|
|
|
{{ tool.formatDate(scope.row.CREATED_AT) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="Status"> <!-- 状态 -->
|
|
|
+ <el-table-column :label="$t('article.status')"> <!-- 状态 -->
|
|
|
<template slot-scope="scope">
|
|
|
- <div v-if="scope.row.STATUS === '1'">Show</div>
|
|
|
- <div v-else>Hide</div>
|
|
|
+ <div v-if="scope.row.STATUS === '1'">{{$t('article.show')}}</div>
|
|
|
+ <div v-else>{{$t('common.hide')}}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column fixed="right" label="Action" width="180"><!--操作-->
|
|
|
+ <el-table-column fixed="right" :label="$t('article.action')" width="180"><!--操作-->
|
|
|
<template slot-scope="scope">
|
|
|
<el-dropdown size="small" trigger="click">
|
|
|
<el-button type="primary" size="small" @click.stop="">
|
|
|
- Action<i class="el-icon-arrow-down el-icon--right" />
|
|
|
+ {{$t('article.action')}}<i class="el-icon-arrow-down el-icon--right" />
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="edit" @click.native="handleEdit(scope.row)">Edit</el-dropdown-item>
|
|
|
- <el-dropdown-item command="delete" @click.native="handleDelete(scope.row)">Delete</el-dropdown-item>
|
|
|
- <el-dropdown-item command="hide" @click.native="handleHide(scope.row)">Hide</el-dropdown-item>
|
|
|
- <el-dropdown-item command="un-hide" @click.native="handleUnHide(scope.row)">Unhide</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="edit" @click.native="handleEdit(scope.row)">{{$t('common.edit')}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="delete" @click.native="handleDelete(scope.row)">{{$t('common.delete')}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="hide" @click.native="handleHide(scope.row)">{{$t('common.hide')}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="un-hide" @click.native="handleUnHide(scope.row)">{{$t('common.unhide')}}</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
@@ -58,15 +58,15 @@
|
|
|
<div class="white-box-footer">
|
|
|
<el-dropdown size="small" trigger="click">
|
|
|
<el-button type="primary" size="small">
|
|
|
- Selected data<!--所选数据--><i class="el-icon-arrow-down el-icon--right" />
|
|
|
+ {{$t('common.selectData')}}<!--所选数据--><i class="el-icon-arrow-down el-icon--right" />
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="delete" @click.native="handleMuliDel()">Delete</el-dropdown-item>
|
|
|
- <el-dropdown-item command="hide" @click.native="handleMultiHide()">Hide</el-dropdown-item>
|
|
|
- <el-dropdown-item command="un-hide" @click.native="handleMultiUnHide()">Unhide</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="delete" @click.native="handleMuliDel()">{{$t('common.delete')}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="hide" @click.native="handleMultiHide()">{{$t('common.hide')}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="un-hide" @click.native="handleMultiUnHide()">{{$t('common.unhide')}}</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
- <el-button type="primary" size="small" @click="handleAdd">New article</el-button><!--添加文章-->
|
|
|
+ <el-button type="primary" size="small" @click="handleAdd">{{$t('article.newArticle')}}</el-button><!--添加文章-->
|
|
|
<el-pagination
|
|
|
:current-page="currentPage"
|
|
|
:page-sizes="[20, 50, 100, 200]"
|
|
|
@@ -84,6 +84,7 @@
|
|
|
<script>
|
|
|
import { fetchArticleIndex, fetchChangeArticleSort, fetchArticleHide, fetchArticleUnhide, fetchArticleDel } from '@/api/article'
|
|
|
import tool from '@/utils/tool'
|
|
|
+import ElementUI from 'element-ui'
|
|
|
|
|
|
export default {
|
|
|
name: 'ArticleIndex',
|
|
|
@@ -158,9 +159,9 @@ export default {
|
|
|
},
|
|
|
delData(id = null) {
|
|
|
const obj = this
|
|
|
- obj.$confirm('Are you sure to delete the selected data?', 'Hint', { // 确定删除选定的数据
|
|
|
- confirmButtonText: 'confirm', // 确定
|
|
|
- cancelButtonText: 'cancel', // 取消
|
|
|
+ obj.$confirm(this.$t('common.deleteSelectedData'), this.$t('common.notice'), { // 确定删除选定的数据
|
|
|
+ confirmButtonText: this.$t('common.confirm'), // 确定
|
|
|
+ cancelButtonText: this.$t('common.cancel'), // 取消
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
const selectedIds = []
|
|
|
@@ -177,16 +178,16 @@ export default {
|
|
|
type: 'success'
|
|
|
})
|
|
|
obj.getData(obj.currentPage, obj.pageSize)
|
|
|
- }).catch(response => {
|
|
|
-
|
|
|
+ }).catch((error) => {
|
|
|
+ ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
hideData(id = null) {
|
|
|
const obj = this
|
|
|
- obj.$confirm('Are you sure to hide the selected data?', 'Notice', { // 确定删除选定的数据?
|
|
|
- confirmButtonText: 'confirm', // 确定
|
|
|
- cancelButtonText: 'cancel', // 取消
|
|
|
+ obj.$confirm(this.$t('common.hideSelectedData'), this.$t('common.notice'), { // 确定删除选定的数据?
|
|
|
+ confirmButtonText: this.$t('common.confirm'), // 确定
|
|
|
+ cancelButtonText: this.$t('common.cancel'), // 取消
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
const selectedIds = []
|
|
|
@@ -203,16 +204,16 @@ export default {
|
|
|
type: 'success'
|
|
|
})
|
|
|
obj.getData(obj.currentPage, obj.pageSize)
|
|
|
- }).catch(response => {
|
|
|
-
|
|
|
+ }).catch((error) => {
|
|
|
+ ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
unHideData(id = null) {
|
|
|
const obj = this
|
|
|
- obj.$confirm('Are you sure to un-hide the selected data?', 'Notice', { // 确定删除选定的数据?
|
|
|
- confirmButtonText: 'confirm', // 确定
|
|
|
- cancelButtonText: 'cancel', // 取消
|
|
|
+ obj.$confirm(this.$t('common.unHideSelectedData'), this.$t('common.notice'), { // 确定删除选定的数据?
|
|
|
+ confirmButtonText: this.$t('common.confirm'), // 确定
|
|
|
+ cancelButtonText: this.$t('common.cancel'), // 取消
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
const selectedIds = []
|
|
|
@@ -229,9 +230,9 @@ export default {
|
|
|
type: 'success'
|
|
|
})
|
|
|
obj.getData(obj.currentPage, obj.pageSize)
|
|
|
- }).catch(response => {
|
|
|
-
|
|
|
- })
|
|
|
+ }).catch((error) => {
|
|
|
+ ElementUI.Message({type: 'error', message: error.message, showClose: true, duration: 0})
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|