增加导出记录
This commit is contained in:
parent
3487cf2827
commit
4812bebdc9
@ -100,6 +100,13 @@ export default {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
record:{
|
||||
url: `${config.API_URL}/download.record.list`,
|
||||
name: "下载记录",
|
||||
get: async function (params) {
|
||||
return await http.post(this.url, params);
|
||||
},
|
||||
},
|
||||
export:{
|
||||
url: `${config.API_URL}/user.log.export`,
|
||||
name: "用户日志导出",
|
||||
|
||||
13
src/assets/icons/ExportLog.vue
Normal file
13
src/assets/icons/ExportLog.vue
Normal file
@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<svg t="1754287674404" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5370" width="200" height="200"><path d="M800.64 66.56c44.25216 0 79.13984 34.34496 79.98464 78.36672l0.01536 1.63328V450.56c0 19.2-12.8 32-32 32-18.77504 0-31.42656-12.2368-31.97952-30.73024L816.64 450.56V152.96c0-12.42112-9.04192-21.83168-21.27872-22.3744l-1.12128-0.0256H202.24c-15.55456 0-25.0624 9.07264-25.57952 21.34016l-0.02048 1.05984V872.96c0 15.58016 9.10336 25.088 24.35072 25.57952l1.24928 0.02048h198.4c19.2 0 32 12.8 32 32 0 18.77504-12.2368 31.42656-30.73024 31.97952l-1.26976 0.02048H192.64c-44.25216 0-79.13984-34.34496-79.98464-78.36672l-0.01536-1.63328V146.56c0-44.25216 34.34496-79.13984 78.36672-79.98464l1.63328-0.01536h608z m-46.50496 539.39712l149.02272 148.992a32 32 0 0 1 0 45.28128L754.13504 949.248a32 32 0 0 1-45.25056-45.25056l94.40256-94.39744H464.53248a32 32 0 1 1 0-64h338.75456l-94.40256-94.40256a32 32 0 1 1 45.25056-45.24544zM467.84 418.56c16 0 28.8 12.8 28.8 28.8a28.672 28.672 0 0 1-27.66336 28.7744l-1.13664 0.0256h-166.4a28.68224 28.68224 0 0 1-28.8-28.8 28.672 28.672 0 0 1 27.66336-28.7744l1.13664-0.0256h166.4z m224-153.6c16 0 28.8 12.8 28.8 28.8a28.672 28.672 0 0 1-27.66336 28.7744l-1.13664 0.0256h-390.4a28.68224 28.68224 0 0 1-28.8-28.8 28.672 28.672 0 0 1 27.66336-28.7744l1.13664-0.0256h390.4z" p-id="5371"></path></svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ExportLog"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -20,6 +20,7 @@ export { default as Account } from './Account.vue'
|
||||
export { default as Notice } from './Notice.vue'
|
||||
export { default as Password } from './Password.vue'
|
||||
export { default as Secure } from './Secure.vue'
|
||||
export { default as ExportLog } from './ExportLog.vue'
|
||||
export { default as UserLog } from './Log.vue'
|
||||
export { default as WechartRound } from './WechartRound.vue'
|
||||
export { default as Cost } from './Cost.vue'
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
logs: defineAsyncComponent(() => import('./user/logs')),
|
||||
upToEnterprise: defineAsyncComponent(() => import('./user/upToEnterprise')),
|
||||
bind: defineAsyncComponent(() => import('./user/bind')),
|
||||
ExportLog: defineAsyncComponent(() => import('./user/exportLog')),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -84,6 +85,11 @@
|
||||
{
|
||||
groupName: "数据管理",
|
||||
list: [
|
||||
{
|
||||
icon: "sc-icon-ExportLog",
|
||||
title: "导出记录",
|
||||
component: "exportLog"
|
||||
},
|
||||
{
|
||||
icon: "sc-icon-UserLog",
|
||||
title: "操作日志",
|
||||
|
||||
190
src/views/userCenter/user/exportLog.vue
Normal file
190
src/views/userCenter/user/exportLog.vue
Normal file
@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<el-card class="logCard" shadow="never" header="导出记录">
|
||||
<el-main class="nopadding">
|
||||
<div class="searchMain logSearchMain">
|
||||
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
|
||||
|
||||
<div class="searchItem searchBtn" v-if="searchHeaderShow">
|
||||
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
|
||||
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</div>
|
||||
<div class="exportBtn">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @row-click="rowClick" @columnBack="columnBack">
|
||||
<template #file_url="scope">
|
||||
<span class="tableColor primary" @click="linkExcel(scope.row)"><el-icon><sc-icon-Excel/></el-icon> 立即下载</span>
|
||||
</template>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
name: 'exportLog',
|
||||
components:{
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
size:"small",
|
||||
setMap:{
|
||||
|
||||
},
|
||||
list:{
|
||||
apiObj: this.$API.user.record,
|
||||
column: [],
|
||||
},
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
params: {},
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
filterUploadClick:this.filterClick,
|
||||
filterUploadParams:this.filterParams,
|
||||
filterTagClose:this.tagClose,
|
||||
filterModelParams:this.filterModelParams,
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'list.column':{
|
||||
handler(val){
|
||||
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
|
||||
},
|
||||
immediate:false,
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
filterModelParams(){
|
||||
return this.filterMap
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
/**
|
||||
* 表格检索开始
|
||||
* */
|
||||
columnBack(val){
|
||||
val.forEach(item=>{
|
||||
if(item.prop === "type"){
|
||||
item.data = this.setMap.typeList;
|
||||
}
|
||||
})
|
||||
this.list.column = val;
|
||||
},
|
||||
async filterClick(item) {
|
||||
let {data, params} = item;
|
||||
let filterParams = Object.assign(this.params,params);
|
||||
this.filterMap.data = filterParams;
|
||||
let searchParams = this.$TOOL.objCopy(this.params);
|
||||
searchParams.creator_id = {
|
||||
operator:"in",
|
||||
value:[this.$TOOL.data.get('USER_INFO').id]
|
||||
};
|
||||
searchParams.field = ""
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams);
|
||||
}
|
||||
},
|
||||
filterParams(params){
|
||||
let filterParams = Object.assign(this.params,params);
|
||||
this.filterMap.data = filterParams;
|
||||
this.upSearch();
|
||||
},
|
||||
tagClose(params){
|
||||
let filterParams = Object.assign(this.params,params);
|
||||
this.filterMap.data = filterParams;
|
||||
},
|
||||
searchShowClick(){
|
||||
this.searchShow = !this.searchShow;
|
||||
eventBus.$emit('close-all-popovers');
|
||||
},
|
||||
getHeaderData(params){
|
||||
this.params = params;
|
||||
this.filterMap.data = params;
|
||||
},
|
||||
async getSelectData(item) {
|
||||
let {data, params} = item;
|
||||
this.params = params;
|
||||
this.filterMap.data = params;
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.creator_id = {
|
||||
operator:"in",
|
||||
value:[this.$TOOL.data.get('USER_INFO').id]
|
||||
};
|
||||
searchParams.field = ""
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
async getField(data,searchParams) {
|
||||
const res = await this.$API.system.log.operation.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
res.data.forEach(item => {
|
||||
if (data.prop === 'type') {
|
||||
item.label = item[data.prop+'_text'];
|
||||
item.value = item[data.prop];
|
||||
} else {
|
||||
item.label = item[data.prop];
|
||||
item.value = item[data.prop];
|
||||
}
|
||||
})
|
||||
}
|
||||
this.list.column.forEach(item => {
|
||||
if (item.prop == data.prop) {
|
||||
item.data = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 表格检索结束 */
|
||||
|
||||
linkExcel(row){
|
||||
window.open(row.file_url,'_blank');
|
||||
},
|
||||
upSearch(){
|
||||
this.$refs.table.upData(this.params);
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
rowClick(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.logCard :deep(.el-card__body){padding: 0 !important;}
|
||||
.tableColor.primary{color: var(--el-color-primary);cursor: pointer;display: flex;align-items: center;}
|
||||
.tableColor .el-icon{margin-right: 8px;}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user