增加日子检索和导出

This commit is contained in:
龙运模
2024-07-13 19:09:38 +08:00
parent 1d11e683a5
commit 88193f9c57
5 changed files with 67 additions and 36 deletions
+5
View File
@@ -115,6 +115,11 @@ export default {
async getCompanyList(data,params) {
const res = await this.$API.system.company.select.post(params);
if(res.data && res.data.length>0){
res.data.forEach(item=>{
item.label = item.full_name;
})
}
if(res.code == 200){
this.searchList.forEach(item=>{
if(item.code == data.code){
+44 -33
View File
@@ -2,31 +2,12 @@
<el-container class="mainBox mainBoxHeaderNoBorder">
<el-main class="nopadding">
<div class="searchMain">
<div class="searchItem">
<label class="name">时间</label>
<el-date-picker class="input" type="daterange" :size="size" v-model="params.date" :popper-options="{ placement: 'bottom-start' }" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" clearable></el-date-picker>
</div>
<div class="searchItem">
<label class="name">业务端</label>
<el-select class="input" :size="size" v-model="params.id" @visible-change="getCompanyList" placeholder="请选择业务" filterable clearable>
<el-option v-for="item in setMap.name" :key="item" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</div>
<div class="searchItem">
<label class="name">操作功能</label>
<el-select class="input" :size="size" v-model="params.id" @visible-change="getCompanyList" placeholder="请选择功能" filterable clearable>
<el-option v-for="item in setMap.name" :key="item" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</div>
<div class="searchItem">
<label class="name">操作日志</label>
<el-select class="input" :size="size" v-model="params.id" @visible-change="getCompanyList" placeholder="请选择日志" filterable clearable>
<el-option v-for="item in setMap.name" :key="item" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</div>
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
<div class="searchItem searchBtn">
<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>
<scExport :size="size" @exportData="exportData"></scExport>
</div>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow @row-click="rowClick">
@@ -61,27 +42,57 @@
apiObj: this.$API.system.log.list,
column:[]
},
params: {
date:"",
id: "",
}
searchList:[
{name:'操作日期',type:'date',code:'created_at'},
{name:'操作功能',type:'multiple',code:'type', data:[], placeholder:"请选择功能",show:true},
{name:'关键字',type:'text',code:['remark','ip','location','creator_name'],keyword:true,show:true},
],
params: {}
}
},
methods: {
getCompanyList(e){
if(!e) return
getSelectData(item){
let {data,params} = item;
this.params = params;
if(data.code == "type"){
this.getTypeList(data,params)
}
},
async getTypeList(data,params) {
const res = await this.$API.system.log.operation.post(params);
if(res.code == 200){
res.data.forEach(item=>{
item.id = item.type;
item.label = item.log_title;
})
this.searchList.forEach(item=>{
if(item.code == data.code){
item.data = res.data;
}
})
}
},
async exportData() {
const res = await this.$API.system.log.export.post(this.params);
if(res.code == 200){
this.$message.success('开始导出');
}
},
upSearch(){
this.$refs.table.upData(this.params);
},
reset(){
this.params = {};
this.$refs.scSearch.reload();
this.$refs.table.reload();
},
rowClick(row){
this.infoDrawer = true
this.$nextTick(() => {
this.$refs.info.setData(row)
})
rowClick(){
// row
// this.infoDrawer = true
// this.$nextTick(() => {
// this.$refs.info.setData(row)
// })
}
}
}