解决启动时控制台插槽警告问题

This commit is contained in:
BianLzhaoMin 2025-12-12 13:15:03 +08:00
parent 844d783715
commit 4da5e3c219
4 changed files with 574 additions and 585 deletions

View File

@ -12,14 +12,7 @@
<!-- 弹窗内容区域 -->
<div class="app-content">
<!-- 商品管理 -->
<el-form
:model="queryParams"
ref="queryFormRef"
:inline="true"
inline
label-width="auto"
size="small"
>
<el-form :model="queryParams" ref="queryFormRef" :inline="true" inline label-width="auto" size="small">
<!-- 表单搜索 -->
<el-row>
<el-col :span="6">
@ -35,22 +28,9 @@
<el-col :span="5" style="float: right">
<el-form-item>
<el-button class="primary-lease" type="primary" @click="queryTableList">
查询
</el-button>
<el-button
class="primary-lease"
type="primary"
@click="resetTableList"
>
重置
</el-button>
<el-button
class="primary-lease"
type="primary"
@click="equipmentDeployment"
v-show="!isAddVisible"
>
<el-button class="primary-lease" type="primary" @click="queryTableList"> 查询 </el-button>
<el-button class="primary-lease" type="primary" @click="resetTableList"> 重置 </el-button>
<el-button class="primary-lease" type="primary" @click="equipmentDeployment" v-show="!isAddVisible">
新增装备
</el-button>
</el-form-item>
@ -59,94 +39,50 @@
</el-form>
<!-- 表格 -->
<el-table
:data="tableData"
style="width: auto"
show-overflow-tooltip
height="546"
>
<el-table :data="tableData" style="width: auto" show-overflow-tooltip height="546">
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
<el-table-column align="center" label="装备名称">
<template scope="{ row }">
<template slot-scope="{ row }">
{{ `${row.deviceName}` }}
</template>
</el-table-column>
<el-table-column align="center" prop="code" label="装备编号" />
<el-table-column align="center" prop="typeName" label="装备类目">
<template scope="{ row }">
<template slot-scope="{ row }">
<span>
{{ row.proType }} <span v-show="row.proType">/</span>
{{ row.mainGx }}<span v-show="row.mainGx">/</span>
{{ row.childGx }}<span v-show="row.childGx">/</span>
{{ row.devCategory }}<span v-show="row.devCategory">/</span>
{{ row.devSubcategory }}<span v-show="row.devSubcategory">/</span>
{{ row.proType }} <span v-show="row.proType">/</span> {{ row.mainGx }}<span v-show="row.mainGx">/</span>
{{ row.childGx }}<span v-show="row.childGx">/</span> {{ row.devCategory
}}<span v-show="row.devCategory">/</span> {{ row.devSubcategory
}}<span v-show="row.devSubcategory">/</span>
{{ row.devName }}
</span>
</template>
</el-table-column>
<el-table-column align="center" prop="devModel" label="装备型号" />
<el-table-column align="center" prop="nextCheckDate" label="下次检验日期">
<template scope="{ row }">
<span>{{
row.nextCheckDate
}}</span>
<template slot-scope="{ row }">
<span>{{ row.nextCheckDate }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="装备状态">
<template scope="{ row }">
<template slot-scope="{ row }">
<el-tag v-if="row.entryStatus == 0" size="small" type="info">待审批</el-tag>
<el-tag v-if="row.entryStatus == 1" size="small" type="warning">已审批</el-tag>
<el-tag v-if="row.entryStatus == 2" size="small" type="success">审批驳回</el-tag>
<el-tag v-if="row.entryStatus == 3" size="small" type="danger">草稿</el-tag>
</template>
</el-table-column>
<el-table-column
prop="name"
label="操作"
min-width="160px"
align="center"
v-if="!isAddVisible"
>
<template scope="{ row }">
<el-button
size="small"
type="primary"
@click="editRowInfo(row)"
>
编辑
</el-button>
<el-button
size="small"
type="danger"
@click="deleteRowInfo(row)"
>删除
</el-button>
<el-table-column prop="name" label="操作" min-width="160px" align="center" v-if="!isAddVisible">
<template slot-scope="{ row }">
<el-button size="small" type="primary" @click="editRowInfo(row)"> 编辑 </el-button>
<el-button size="small" type="danger" @click="deleteRowInfo(row)">删除 </el-button>
</template>
</el-table-column>
<el-table-column
prop="name"
label="操作"
min-width="160px"
align="center"
v-if="!isApprovalVisible"
>
<template scope="{ row }">
<el-button
size="small"
type="primary"
@click="approval(row,1)"
>
通过
</el-button>
<el-button
size="small"
type="primary"
@click="approval(row,2)"
>
驳回
</el-button>
<el-table-column prop="name" label="操作" min-width="160px" align="center" v-if="!isApprovalVisible">
<template slot-scope="{ row }">
<el-button size="small" type="primary" @click="approval(row, 1)"> 通过 </el-button>
<el-button size="small" type="primary" @click="approval(row, 2)"> 驳回 </el-button>
</template>
</el-table-column>
</el-table>
@ -156,8 +92,6 @@
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
/>
</div>
<!-- 底部按钮区域 -->
@ -168,11 +102,7 @@
</div>
</template>
<EquipmentEntryEditDialog
:is-visible.sync="isEditVisible"
:order-id="orderId"
@getOrderId="getOrderId"
/>
<EquipmentEntryEditDialog :is-visible.sync="isEditVisible" :order-id="orderId" @getOrderId="getOrderId" />
</el-dialog>
</template>
@ -184,7 +114,7 @@ import {
equipmentDraftListApiNew,
equipmentPassAndRejectApiNew,
equipmentSubmitApiNew,
removeDeviceApi
removeDeviceApi,
} from '@/api/EquipmentEntryApply'
export default {
@ -196,21 +126,21 @@ export default {
isVisible: {
type: Boolean,
default: false,
description: '控制弹窗显示与隐藏'
description: '控制弹窗显示与隐藏',
},
isAddVisible: {
type: Boolean,
default: false
default: false,
},
orderId: {
type: String,
default: '',
description: '关联的订单ID字符串'
description: '关联的订单ID字符串',
},
isApprovalVisible: {
type: Boolean,
default: false
}
default: false,
},
},
emits: ['update:isVisible', 'submit'], //
data() {
@ -223,15 +153,15 @@ export default {
orderId: '',
deviceName: '',
pageNum: 1,
pageSize: 10
pageSize: 10,
},
//
formData: {
//
equipmentName: '',
model: '',
quantity: 1
}
quantity: 1,
},
}
},
watch: {
@ -239,15 +169,15 @@ export default {
if (val) {
this.getList()
}
}
},
},
methods: {
async approval(row, status) {
equipmentPassAndRejectApiNew({ devIds: row.maId, status: status, id: this.orderId }).then(res => {
equipmentPassAndRejectApiNew({ devIds: row.maId, status: status, id: this.orderId }).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '操作成功'
message: '操作成功',
})
this.getList()
}
@ -284,22 +214,21 @@ export default {
this.$confirm('是否确定删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
return removeDeviceApi([row.maId])
})
.then(res => {
.then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功'
message: '删除成功',
})
this.getList()
}
})
.catch(() => {
})
.catch(() => {})
},
//
resetTableList() {
@ -318,21 +247,20 @@ export default {
* 处理表单提交
*/
handleSubmit() {
equipmentSubmitApiNew({ id: this.orderId, status: 0 }).then(res => {
equipmentSubmitApiNew({ id: this.orderId, status: 0 }).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '提交成功'
message: '提交成功',
})
this.handleClose()
this.$emit('submit', {
orderId: this.orderId
orderId: this.orderId,
})
}
})
}
}
},
},
}
</script>

View File

@ -1,12 +1,7 @@
<template>
<div class="app-container">
<!-- 寻源需求 -->
<el-form
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="auto" size="small"
>
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="auto" size="small">
<!-- 表单搜索 -->
<el-card class="search-box">
<el-row>
@ -39,38 +34,34 @@
/>
</el-form-item>
</el-col>
<el-col :span="4" style="text-align: right;">
<el-button class="primary-lease" size="mini" icon="el-icon-search" type="primary" @click="getContractListData">查询</el-button>
<el-col :span="4" style="text-align: right">
<el-button
class="primary-lease"
size="mini"
icon="el-icon-search"
type="primary"
@click="getContractListData"
>查询</el-button
>
<el-button class="primary-lease" size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button>
</el-col>
</el-row>
</el-card>
</el-form>
<el-card class="content-box">
<el-row>
<el-col :span="24" style="text-align: right;">
<el-col :span="24" style="text-align: right">
<el-button class="primary-lease" type="primary" size="mini" @click="addContract">协议新建</el-button>
<a :href="uploadUrlTemp" download="安徽省机械化装备共享平台-协议模板">
<el-button
class="primary-lease"
type="primary"
style="margin-left: 20px"
size="mini"
>模板下载</el-button>
<el-button class="primary-lease" type="primary" style="margin-left: 20px" size="mini">模板下载</el-button>
</a>
</el-col>
</el-row>
<div>
<!-- 表格 -->
<el-table
:data="qualityLis"
border stripe height="546"
show-overflow-tooltip
>
<el-table :data="qualityLis" border stripe height="546" show-overflow-tooltip>
<el-table-column align="center" label="协议编码">
<template scope="scope">
<template slot-scope="scope">
<a style="color: blue">
{{ scope.row.contractCode }}
</a>
@ -78,7 +69,7 @@
</el-table-column>
<el-table-column align="center" prop="contractName" label="协议名称" />
<el-table-column align="center" prop="status" label="状态">
<template scope="scope">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
:active-value="1"
@ -88,18 +79,19 @@
</template>
</el-table-column>
<el-table-column align="center" label="协议附件">
<template scope="scope">
<template slot-scope="scope">
<a
:href="scope.row.bmFileInfoList.length > 0 ? scope.row.bmFileInfoList[0].fileUrl : null"
target="_blank"
style="color: #00a288; text-decoration: underline"
>查看</a>
>查看</a
>
</template>
</el-table-column>
<el-table-column align="center" prop="createTime" label="创建时间" />
<el-table-column align="center" prop="updateTime" label="更新时间" />
<el-table-column align="center" label="操作" :width="220">
<template scope="scope">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="onContract(scope.row)">编辑</el-button>
<el-button
size="mini"
@ -107,7 +99,8 @@
icon="el-icon-delete"
@click="onDelete(scope.row.id)"
v-if="scope.row.status == 0"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -186,14 +179,13 @@
</template>
<script>
// API
import {
getContractListApi,
addContractApi,
editContractApi,
delContractApi,
updateStatus
updateStatus,
} from '@/api/contract-manage/index'
import FileUpload from '@/components/FileImageUpload'
@ -215,7 +207,7 @@ export default {
startTime: '',
endTime: '',
pageSize: 10,
pageNum: 1
pageNum: 1,
},
//
@ -227,18 +219,18 @@ export default {
contractName: '',
fileInfoList: [],
fileInfoTempList: [],
bmFileInfoList: []
bmFileInfoList: [],
},
//
addAndEditFormRules: {
contractName: [{ required: true, message: '请输入协议名称', trigger: 'blur' }],
fileInfoList: [{ required: true, message: '请上传协议附件', trigger: 'blur' }]
fileInfoList: [{ required: true, message: '请上传协议附件', trigger: 'blur' }],
},
//
dialogVisibleSettlein: false,
settleinTitle: ''
settleinTitle: '',
}
},
mounted() {
@ -279,7 +271,7 @@ export default {
if (res.code === 200) {
this.$message({
type: 'success',
message: '状态修改成功'
message: '状态修改成功',
})
await this.getContractListData()
}
@ -335,7 +327,7 @@ export default {
this.addAndEditForm.fileInfoTempList = []
const origin = window.location.origin
const fileListTemp = fileList.map(e => {
const fileListTemp = fileList.map((e) => {
let testUrl = ''
if (process.env.VUE_APP_API_URL === '/proxyApi') {
testUrl = e.url
@ -344,7 +336,7 @@ export default {
}
return {
fileName: e.name,
fileUrl: testUrl
fileUrl: testUrl,
}
})
@ -364,7 +356,7 @@ export default {
if (res.code === 200) {
this.$message({
type: 'success',
message: '提交成功'
message: '提交成功',
})
this.dialogVisibleSettlein = false
this.getContractListData()
@ -383,7 +375,7 @@ export default {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功'
message: '删除成功',
})
this.getContractListData()
}
@ -395,8 +387,8 @@ export default {
//
onCancel() {
this.dialogVisibleSettlein = false
}
}
},
},
}
</script>
@ -508,15 +500,15 @@ export default {
//
&.el-table--striped .el-table__body {
tr.el-table__row--striped td {
background-color: #F6FBFA !important; //
background-color: #f6fbfa !important; //
}
}
.el-table__header {
background: #E9F0EE;
background: #e9f0ee;
th {
background: #E9F0EE !important;
background: #e9f0ee !important;
color: #606266;
font-weight: 600;
height: 50px;
@ -524,9 +516,8 @@ export default {
}
&.el-table--striped .el-table__body tr.el-table__row:hover > td.el-table__cell {
background-color: #CCF1E9 !important;
background-color: #ccf1e9 !important;
}
}
}
</style>

View File

@ -4,14 +4,22 @@
<div class="filter-container">
<el-card class="search-box" style="height: 130px">
<el-form-item label="操作人" prop="operaUserName" label-width="60px">
<el-input v-model="listQuery.operaUserName" placeholder="请输入操作人"
style="width: 240px" class="filter-item" :maxlength="30"
<el-input
v-model="listQuery.operaUserName"
placeholder="请输入操作人"
style="width: 240px"
class="filter-item"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item label="IP地址" prop="ip" label-width="60px">
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
style="width: 240px" class="filter-item ml-20" :maxlength="30"
<el-input
v-model="listQuery.ip"
placeholder="请输入IP地址"
style="width: 240px"
class="filter-item ml-20"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
@ -32,36 +40,64 @@
@keyup.enter.native="handleFilter"
/> -->
<el-form-item label="事件结果" prop="result" label-width="80px">
<el-select v-model="listQuery.result" placeholder="请选择事件结果" style="width: 240px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(outcomeList)" :key="item" :value="outcomeList[item]" :label="outcomeList[item]" />
<el-select
v-model="listQuery.result"
placeholder="请选择事件结果"
style="width: 240px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(outcomeList)"
:key="item"
:value="outcomeList[item]"
:label="outcomeList[item]"
/>
</el-select>
</el-form-item>
<el-form-item label="操作类型" prop="operType" label-width="80px">
<el-select v-model="listQuery.operType" placeholder="请选择操作类型" style="width: 240px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(operateList)" :key="item" :value="operateList[item]" :label="operateList[item]" />
<el-select
v-model="listQuery.operType"
placeholder="请选择操作类型"
style="width: 240px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(operateList)"
:key="item"
:value="operateList[item]"
:label="operateList[item]"
/>
</el-select>
</el-form-item>
<el-form-item label="分类" prop="operaUserName" label-width="60px">
<el-select v-model="listQuery.logSort" clearable filterable style="width: 240px" class="filter-item ml-20" placeholder="请选择" >
<el-select
v-model="listQuery.logSort"
clearable
filterable
style="width: 240px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="排序" prop="operaUserName" label-width="60px">
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 240px" class="filter-item ml-20" placeholder="请选择" >
<el-select
v-model="listQuery.logDesc"
clearable
filterable
style="width: 240px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item style="float:right;">
<el-button size="small" class="filter-item" type="primary" @click="handleFilter">
查询
</el-button>
<el-button size="small" class="filter-item" type="primary" @click="resetFilter">
重置
</el-button>
<el-button @click="handleBackups" size="small" class="filter-item" type="warning">
备份
</el-button>
<el-form-item style="float: right">
<el-button size="small" class="filter-item" type="primary" @click="handleFilter"> 查询 </el-button>
<el-button size="small" class="filter-item" type="primary" @click="resetFilter"> 重置 </el-button>
<el-button @click="handleBackups" size="small" class="filter-item" type="warning"> 备份 </el-button>
</el-form-item>
</el-card>
</div>
@ -79,7 +115,7 @@
height="596"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<template slot-scope="scope">
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
@ -101,7 +137,6 @@
</el-table>
<pagination
:total="total"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@ -119,11 +154,10 @@
import { getYwLogs, downloadYwLogs } from '@/api/system/log'
const outcomeList = {
1: '成功',
2:'失败'
};
2: '失败',
}
const operateList = {
1: '新增',
2: '修改',
@ -133,8 +167,8 @@
6: '下载',
7: '备份',
8: '登录',
9:'登出'
};
9: '登出',
}
export default {
components: { Pagination },
@ -147,8 +181,16 @@
listLoading: false,
tableHeight: 650,
operateList: operateList,
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:3,name:'操作模块'},{id:4,name:'ip'},],
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
timeList: [
{ id: 1, name: '时间' },
{ id: 2, name: '操作人' },
{ id: 3, name: '操作模块' },
{ id: 4, name: 'ip' },
],
sortList: [
{ id: 1, name: '倒序' },
{ id: 2, name: '升序' },
],
listQuery: {
pageNum: 1,
pageSize: 10,
@ -169,7 +211,7 @@
// this.getOperate()
},
mounted() {
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
this.listQuery.operTime = this.getCurrentDate() + ' - ' + this.getCurrentDate()
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()]
this.getList()
},
@ -187,10 +229,10 @@
getList() {
this.listLoading = true
if (this.rangeDate && this.rangeDate.length > 0) {
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
this.listQuery.operTime = this.rangeDate[0] + ' - ' + this.rangeDate[1]
}
getYwLogs(this.listQuery).then((response) => {
this.list = response.rows.map(item => {
this.list = response.rows.map((item) => {
return item
})
this.total = response.total
@ -217,37 +259,35 @@
operType: '',
logSort: 1,
logDesc: 1,
};
}
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()]
this.handleFilter()
},
//
handleBackups() {
downloadYwLogs().then(res => {
downloadYwLogs().then((res) => {
downloadFile({ fileName: '业务日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8' })
})
},
//
handleExport() {
// exportCarDetail().then(res => {
// downloadFile({ fileName: '.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
// })
},
getCurrentDate() {
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
let now = new Date()
let year = now.getFullYear()
let month = now.getMonth() + 1
if (month < 10) {
month = '0' + month
}
let day = now.getDate();
let day = now.getDate()
if (day < 10) {
day = '0' + day
}
return year + "-" + month + "-" + day;
}
}
return year + '-' + month + '-' + day
},
},
}
</script>

View File

@ -4,14 +4,22 @@
<div class="filter-container">
<el-card class="search-box" style="height: 130px">
<el-form-item label="操作人" prop="operaUserName" label-width="60px">
<el-input v-model="listQuery.operaUserName" placeholder="请输入操作人"
style="width: 240px" class="filter-item" :maxlength="30"
<el-input
v-model="listQuery.operaUserName"
placeholder="请输入操作人"
style="width: 240px"
class="filter-item"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item label="IP地址" prop="ip" label-width="70px">
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
style="width: 240px" class="filter-item ml-20" :maxlength="30"
<el-input
v-model="listQuery.ip"
placeholder="请输入IP地址"
style="width: 240px"
class="filter-item ml-20"
:maxlength="30"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
@ -35,31 +43,49 @@
<el-option v-for="item in Object.keys(outcomeList)" :key="item" :value="outcomeList[item]" :label="outcomeList[item]" />
</el-select>-->
<el-form-item label="操作类型" prop="operType" label-width="90px">
<el-select v-model="listQuery.operType" placeholder="请选择操作类型" style="width: 240px" class="filter-item ml-20">
<el-option v-for="item in Object.keys(operateList)" :key="item" :value="operateList[item]" :label="operateList[item]" />
<el-select
v-model="listQuery.operType"
placeholder="请选择操作类型"
style="width: 240px"
class="filter-item ml-20"
>
<el-option
v-for="item in Object.keys(operateList)"
:key="item"
:value="operateList[item]"
:label="operateList[item]"
/>
</el-select>
</el-form-item>
<el-form-item label="分类" prop="logSort" label-width="60px">
<el-select v-model="listQuery.logSort" clearable filterable style="width: 240px" class="filter-item ml-20" placeholder="请选择" >
<el-select
v-model="listQuery.logSort"
clearable
filterable
style="width: 240px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="排序" prop="logDesc" label-width="60px">
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 240px" class="filter-item ml-20" placeholder="请选择" >
<el-select
v-model="listQuery.logDesc"
clearable
filterable
style="width: 240px"
class="filter-item ml-20"
placeholder="请选择"
>
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item style="float:right;">
<el-button size="small" class="filter-item" type="primary" @click="handleFilter">
查询
</el-button>
<el-button size="small" class="filter-item" type="primary" @click="resetFilter">
重置
</el-button>
<el-button @click="handleBackups" size="small" class="filter-item" type="warning">
备份
</el-button>
<el-form-item style="float: right">
<el-button size="small" class="filter-item" type="primary" @click="handleFilter"> 查询 </el-button>
<el-button size="small" class="filter-item" type="primary" @click="resetFilter"> 重置 </el-button>
<el-button @click="handleBackups" size="small" class="filter-item" type="warning"> 备份 </el-button>
</el-form-item>
</el-card>
</div>
@ -77,7 +103,7 @@
height="546"
>
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<template slot-scope="scope">
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
@ -99,7 +125,6 @@
</el-table>
<pagination
:total="total"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@ -117,11 +142,10 @@ import { downloadFile } from '@/utils/download'
import { getSysLogs, downloadSysLogs } from '@/api/system/log'
const outcomeList = {
1: '成功',
2:'失败'
};
2: '失败',
}
const operateList = {
1: '新增',
2: '修改',
@ -131,8 +155,8 @@ const operateList = {
6: '下载',
7: '备份',
8: '登录',
9:'登出'
};
9: '登出',
}
export default {
components: { Pagination },
@ -145,8 +169,17 @@ export default {
listLoading: false,
tableHeight: 650,
operateList: operateList,
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:3,name:'操作模块'},{id:4,name:'ip'},{id:5,name:'操作类型'},],
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
timeList: [
{ id: 1, name: '时间' },
{ id: 2, name: '操作人' },
{ id: 3, name: '操作模块' },
{ id: 4, name: 'ip' },
{ id: 5, name: '操作类型' },
],
sortList: [
{ id: 1, name: '倒序' },
{ id: 2, name: '升序' },
],
listQuery: {
pageNum: 1,
pageSize: 10,
@ -167,7 +200,7 @@ export default {
// this.getOperate()
},
mounted() {
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
this.listQuery.operTime = this.getCurrentDate() + ' - ' + this.getCurrentDate()
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()]
this.getList()
},
@ -185,10 +218,10 @@ export default {
getList() {
this.listLoading = true
if (this.rangeDate && this.rangeDate.length > 0) {
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
this.listQuery.operTime = this.rangeDate[0] + ' - ' + this.rangeDate[1]
}
getSysLogs(this.listQuery).then((response) => {
this.list = response.rows.map(item => {
this.list = response.rows.map((item) => {
return item
})
this.total = response.total
@ -215,38 +248,35 @@ export default {
operateType: '',
logSort: 1,
logDesc: 1,
};
}
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()]
this.handleFilter()
},
//
handleBackups() {
downloadSysLogs().then(res => {
downloadSysLogs().then((res) => {
downloadFile({ fileName: '系统日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8' })
})
},
//
handleExport() {
// exportCarDetail().then(res => {
// downloadFile({ fileName: '.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
// })
},
getCurrentDate() {
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
let now = new Date()
let year = now.getFullYear()
let month = now.getMonth() + 1
if (month < 10) {
month = '0' + month
}
let day = now.getDate();
let day = now.getDate()
if (day < 10) {
day = '0' + day
}
return year + "-" + month + "-" + day;
}
}
return year + '-' + month + '-' + day
},
},
}
</script>