|
|
@ -1,74 +1,89 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<div class="subfile_main"> |
|
|
|
<el-table |
|
|
|
<div class="block"> |
|
|
|
v-loading="listLoading" |
|
|
|
<el-date-picker |
|
|
|
:data="list" |
|
|
|
v-model="value2" |
|
|
|
element-loading-text="Loading" |
|
|
|
type="daterange" |
|
|
|
border |
|
|
|
align="right" |
|
|
|
fit |
|
|
|
unlink-panels |
|
|
|
highlight-current-row |
|
|
|
range-separator="至" |
|
|
|
> |
|
|
|
start-placeholder="开始日期" |
|
|
|
<el-table-column align="center" label="ID" width="95"> |
|
|
|
end-placeholder="结束日期" |
|
|
|
<template slot-scope="scope"> |
|
|
|
:picker-options="pickerOptions"> |
|
|
|
{{ scope.$index }} |
|
|
|
</el-date-picker> |
|
|
|
</template> |
|
|
|
<el-button type="primary" icon="el-icon-search">搜索</el-button> |
|
|
|
</el-table-column> |
|
|
|
</div> |
|
|
|
<el-table-column label="标题"> |
|
|
|
<div> |
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
{{ scope.row.title }} |
|
|
|
</div> |
|
|
|
</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> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
|
|
|
|
|
|
|
|
//import { getList } from '@/api/table' |
|
|
|
import { mirlist } from '@/api/user' |
|
|
|
|
|
|
|
import defaultSettings from '@/settings.js' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
|
|
|
|
|
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
$route(to, from) { |
|
|
|
$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: { |
|
|
|
filters: { |
|
|
|
statusFilter(status) { |
|
|
|
|
|
|
|
const statusMap = { |
|
|
|
|
|
|
|
published: 'success', |
|
|
|
|
|
|
|
draft: 'gray', |
|
|
|
|
|
|
|
deleted: 'danger' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return statusMap[status] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
list: null, |
|
|
|
pickerOptions: { |
|
|
|
listLoading: true |
|
|
|
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() { |
|
|
|
created() { |
|
|
|
|
|
|
|
|
|
|
|