|
|
|
@ -1,74 +1,89 @@
@@ -1,74 +1,89 @@
|
|
|
|
|
<template> |
|
|
|
|
<div class="app-container"> |
|
|
|
|
<el-table |
|
|
|
|
v-loading="listLoading" |
|
|
|
|
:data="list" |
|
|
|
|
element-loading-text="Loading" |
|
|
|
|
border |
|
|
|
|
fit |
|
|
|
|
highlight-current-row |
|
|
|
|
> |
|
|
|
|
<el-table-column align="center" label="ID" width="95"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.$index }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="标题"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.title }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="昵称" width="110" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ scope.row.author }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="时间" width="110" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.pageviews }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column class-name="status-col" label="状态" width="110" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" prop="created_at" label="操作" width="200"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i class="el-icon-time" /> |
|
|
|
|
<span>{{ scope.row.display_time }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="subfile_main"> |
|
|
|
|
<div class="block"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="value2" |
|
|
|
|
type="daterange" |
|
|
|
|
align="right" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="至" |
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
:picker-options="pickerOptions"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<el-button type="primary" icon="el-icon-search">搜索</el-button> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
//import { getList } from '@/api/table' |
|
|
|
|
import { mirlist } from '@/api/user' |
|
|
|
|
import defaultSettings from '@/settings.js' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
|
|
|
|
|
watch: { |
|
|
|
|
$route(to, from) { |
|
|
|
|
|
|
|
|
|
let can = {}; |
|
|
|
|
const menusindex = window.location.href |
|
|
|
|
if (menusindex.indexOf('?id') != -1) { |
|
|
|
|
//console.log(menusindex.split('?id=')[1]); |
|
|
|
|
can.id = menusindex.split('?id=')[1] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mirlist(can).then(response => { |
|
|
|
|
let datamain = response.data; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(function (error) { |
|
|
|
|
thiss.$message({ |
|
|
|
|
showClose: true, |
|
|
|
|
message: error, |
|
|
|
|
type: 'error' |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
filters: { |
|
|
|
|
statusFilter(status) { |
|
|
|
|
const statusMap = { |
|
|
|
|
published: 'success', |
|
|
|
|
draft: 'gray', |
|
|
|
|
deleted: 'danger' |
|
|
|
|
} |
|
|
|
|
return statusMap[status] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
list: null, |
|
|
|
|
listLoading: true |
|
|
|
|
} |
|
|
|
|
pickerOptions: { |
|
|
|
|
shortcuts: [{ |
|
|
|
|
text: '最近一周', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date(); |
|
|
|
|
const start = new Date(); |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); |
|
|
|
|
picker.$emit('pick', [start, end]); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
text: '最近一个月', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date(); |
|
|
|
|
const start = new Date(); |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
|
|
|
|
picker.$emit('pick', [start, end]); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
text: '最近三个月', |
|
|
|
|
onClick(picker) { |
|
|
|
|
const end = new Date(); |
|
|
|
|
const start = new Date(); |
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); |
|
|
|
|
picker.$emit('pick', [start, end]); |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
value2: '' |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
|
|
|
|
|