Browse Source

feat: [操作日志] 导出

lkf
memorylkf 2 months ago
parent
commit
061f236d42
2 changed files with 33 additions and 13 deletions
  1. +7
    -0
      src/api/business/systemLog/systemLog.js
  2. +26
    -13
      src/views/business/systemLog/comp/czrz.vue

+ 7
- 0
src/api/business/systemLog/systemLog.js View File

@ -7,3 +7,10 @@ export function systemLog_list(query) {
params: query
})
}
export function systemLog_czlxList(query) {
return request({
url: '/system/business/systemLog/czlxList',
method: 'get',
params: query
})
}

+ 26
- 13
src/views/business/systemLog/comp/czrz.vue View File

@ -4,7 +4,7 @@
<el-form :model="searchForm" ref="searchForm" :inline="true" label-width="80px">
<el-form-item :label="$t('page.system.systemLog.czr')" prop="qmrMc">
<el-input v-model="searchForm.qmrMc" :placeholder="$t('form.placeholderInput')" clearable
style="width: 150px" />
style="width: 120px" />
</el-form-item>
<el-form-item :label="$t('page.system.systemLog.czsj')">
<el-date-picker v-model="daterange" clearable type="daterange" range-separator="-" :start-placeholder="$t('page.business.study.study.startDate')"
@ -16,29 +16,27 @@
:placeholder="$t('form.placeholderSelect')"
clearable
style="width: 150px"
filterable
@change="search"
>
<el-option :label="$t('page.business.study.study.sqgd')" :value="$t('page.business.study.study.sqgd')" />
<el-option :label="$t('page.business.study.study.tygd')" :value="$t('page.business.study.study.tygd')" />
<el-option :label="$t('page.business.study.study.jjgd')" :value="$t('page.business.study.study.jjgd')" />
<el-option :label="$t('page.business.study.study.sqjd')" :value="$t('page.business.study.study.sqjd')" />
<el-option :label="$t('page.business.study.study.tyjd')" :value="$t('page.business.study.study.tyjd')" />
<el-option :label="$t('page.business.study.study.jjjd')" :value="$t('page.business.study.study.jjjd')" />
<el-option :label="$t('page.business.study.study.sqjy')" :value="$t('page.business.study.study.sqjy')" />
<el-option :label="$t('page.business.study.study.tyjy')" :value="$t('page.business.study.study.tyjy')" />
<el-option :label="$t('page.business.study.study.jjjy')" :value="$t('page.business.study.study.jjjy')" />
<el-option :label="$t('page.business.study.study.qrgh')" :value="$t('page.business.study.study.qrgh')" />
<template v-if="$i18n.locale === 'zh_CN'">
<el-option v-for="(item,index) in czlxList" :key="index" :label="item" :value="item" />
</template>
<template v-else>
<el-option v-for="(item,index) in czlxListEn" :key="index" :label="item" :value="item" />
</template>
</el-select>
</el-form-item>
<el-form-item :label="$t('page.system.systemLog.czxq')" prop="jcnr">
<el-input v-model="searchForm.jcnr" :placeholder="$t('form.placeholderInput')" clearable
style="width: 200px" />
style="width: 120px" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search">{{ $t('page.business.study.study.search') }}</el-button>
<el-button icon="el-icon-refresh" @click="reset">{{ $t('form.reset') }}</el-button>
<el-button type="warning" plain icon="el-icon-download" @click="handleExport" v-hasPermi="['business:systemLog:operate:export']">{{$t('form.export')}}</el-button>
</el-form-item>
</el-form>
</div>
@ -61,7 +59,7 @@
</template>
<script>
import { systemLog_list } from "@/api/business/systemLog/systemLog"
import { systemLog_list,systemLog_czlxList } from "@/api/business/systemLog/systemLog"
export default {
name: 'Czrz',
props: {
@ -71,6 +69,8 @@ export default {
data() {
return {
daterange:[],
czlxList:[],
czlxListEn:[],
searchForm: {
pageNum: 1,
pageSize: 10,
@ -86,9 +86,16 @@ export default {
}
},
created() {
this.getCzlxList()
this.getList()
},
methods: {
getCzlxList(){
systemLog_czlxList().then(response => {
this.czlxList = _.map(response.data,'jcmc')
this.czlxListEn = _.map(response.data,'jcmcEn')
})
},
search() {
this.searchForm.pageNum = 1
this.getList()
@ -153,6 +160,12 @@ export default {
} catch (e) {
return false;
}
},
handleExport(){
this.saveSimpleLog({name:'',nameEn:'',jcmc:'操作日志导出',jcmcEn:'User Action Log Export'})
this.searchForm.startDate = this.daterange && this.daterange.length > 0 ? this.daterange[0] : ''
this.searchForm.endDate = this.daterange && this.daterange.length > 1 ? this.daterange[1] : ''
this.download('system/business/systemLog/export', this.searchForm, `userActionLog_${new Date().getTime()}.xlsx`)
}
}
}

Loading…
Cancel
Save