refactor: migrate to Tencent Cloud backend
这个提交包含在:
@@ -9,7 +9,7 @@
|
||||
placeholder-class="input-placeholder"
|
||||
/>
|
||||
<button class="btn-primary btn-sm" @click="onSearch">搜索</button>
|
||||
<button class="btn-default btn-sm">导出</button>
|
||||
<button class="btn-default btn-sm" @click="onExport">导出</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
<script>
|
||||
import { get } from '../../utils/request'
|
||||
import { exportCSV } from '../../utils/export'
|
||||
import AdminLayout from '../../components/AdminLayout.vue'
|
||||
|
||||
export default {
|
||||
@@ -97,6 +98,23 @@ export default {
|
||||
},
|
||||
formatDate(d) {
|
||||
return d ? d.slice(0, 19).replace('T', ' ') : '-'
|
||||
},
|
||||
async onExport() {
|
||||
try {
|
||||
var params = { page: 1, page_size: 9999 }
|
||||
if (this.filters.type) params.type = this.filters.type
|
||||
const data = await get('/api/v1/admin/logs', params)
|
||||
const records = data.records || []
|
||||
exportCSV('logs_' + new Date().toISOString().slice(0, 10) + '.csv',
|
||||
['时间', '操作类型', '操作详情', '操作者'],
|
||||
records.map(function (r) {
|
||||
return [r.created_at ? r.created_at.slice(0, 19).replace('T', ' ') : '', r.action || '', r.detail || '', r.openid || '']
|
||||
})
|
||||
)
|
||||
uni.showToast({ title: '导出成功', icon: 'success' })
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '导出失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户