Commit afa22ecf authored by neogcg's avatar neogcg

3/8

parents 54d2847f 02281375
import request from '@/utils/request'
const path = {
// 告警管理
exportLeakyCable: 'sysMonitorAlarm/export',
exportConnet: 'sysConnectAlarm/export',
// 配置管理
// 实时状态
exportLeakyCableTime: 'sysLeakyCableStatus/export',
exportConnetTime: 'sysDeviceStatus/export',
// 历史数据
exportLeakyStatusHistory: 'sysHistoryMonitorStatus/export',
exportLeakyMaintainHistory: 'sysHistoryMonitorMaintain/export',
exportConnectStatusHistory: 'sysHistoryConnectStatus/export',
exportConnectMaintainHistory: 'sysHistoryConnectMaintain/export',
// 用户管理
exportLog: 'sysLog/exportLog',
}
const blobConf = { responseType: 'blob' }
function requestBlob(url, params, config = {}) {
return request.post(url, params, {
...config,
...blobConf
})
}
export function exportLeakyCable() {
return requestBlob(path.exportLeakyCable, ...arguments)
}
export function exportConnet() {
return requestBlob(path.exportConnet, ...arguments)
}
export function exportLeakyCableTime() {
return requestBlob(path.exportLeakyCableTime, ...arguments)
}
export function exportConnetTime() {
return requestBlob(path.exportConnetTime, ...arguments)
}
export function exportLeakyStatusHistory() {
return requestBlob(path.exportLeakyStatusHistory, ...arguments)
}
export function exportLeakyMaintainHistory() {
return requestBlob(path.exportLeakyMaintainHistory, ...arguments)
}
export function exportConnectStatusHistory() {
return requestBlob(path.exportConnectStatusHistory, ...arguments)
}
export function exportConnectMaintainHistory() {
return requestBlob(path.exportConnectMaintainHistory, ...arguments)
}
export function exportLog() {
return requestBlob(path.exportLog, ...arguments)
}
\ No newline at end of file
export default function (res, type, fileName = '') {
let blob = new Blob([res], { type: `application/${type}` })
let a = document.createElement('a')
let url = window.URL.createObjectURL(blob)
a.href = url
a.download = fileName
a.click()
}
\ No newline at end of file
...@@ -2,21 +2,15 @@ import request from '@/utils/request' ...@@ -2,21 +2,15 @@ import request from '@/utils/request'
const path = { const path = {
cableTimeList: 'sysMonitorAlarm/selectPage', cableTimeList: 'sysMonitorAlarm/selectPage',
cableExport: 'sysMonitorAlarm/export',
cableConfirm: 'sysMonitorAlarm/confirm', cableConfirm: 'sysMonitorAlarm/confirm',
deviceList: 'sysConnectAlarm/selectPage', deviceList: 'sysConnectAlarm/selectPage',
deviceExport: 'sysConnectAlarm/export'
} }
export function cableTimeList() { export function cableTimeList() {
return request.post(path.cableTimeList, ...arguments) return request.post(path.cableTimeList, ...arguments)
} }
export function cableExport() {
return request.post(path.cableExport, ...arguments)
}
export function cableConfirm() { export function cableConfirm() {
return request.post(path.cableConfirm, ...arguments) return request.post(path.cableConfirm, ...arguments)
} }
...@@ -24,7 +18,3 @@ export function cableConfirm() { ...@@ -24,7 +18,3 @@ export function cableConfirm() {
export function deviceList() { export function deviceList() {
return request.post(path.deviceList, ...arguments) return request.post(path.deviceList, ...arguments)
} }
export function deviceExport() {
return request.post(path.deviceExport, ...arguments)
}
import { alarmLeval } from '@/const/index'
export const tableData = [
{
name: 'STATION2未开通',
object: '漏缆FSU2_R1下行方向',
level: '紧急',
message: {
red: ['距离:0米 驻波比:8.72'],
green: ['距离:18米 驻波比:1.07', '距离:42米 驻波比:1.02'],
black: ['漏缆百米损耗:2.8']
},
uploadDate: '2022/12/18 11:51:12',
updateDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--',
},
{
name: 'STATION2未开通',
object: '漏缆FSU2_R1下行方向',
level: '紧急',
message: {
red: ['距离:0米 驻波比:8.72'],
green: ['距离:18米 驻波比:1.07', '距离:42米 驻波比:1.02'],
black: ['漏缆百米损耗:2.8']
},
uploadDate: '2022/12/18 11:51:12',
updateDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--',
},
{
name: 'STATION2未开通',
object: '漏缆FSU2_R1下行方向',
level: '重要',
message: {
red: ['距离:0米 驻波比:8.72'],
green: ['距离:18米 驻波比:1.07', '距离:42米 驻波比:1.02'],
black: ['漏缆百米损耗:2.8']
},
uploadDate: '2022/12/18 11:51:12',
updateDate: '2022/12/18 11:51:12',
confirmUser: 'admin',
confirmTime: '2022/12/18 17:51:12',
},
{
name: 'STATION2未开通',
object: '漏缆FSU2_R1下行方向',
level: '紧急',
message: {
red: ['距离:0米 驻波比:8.72'],
green: ['距离:18米 驻波比:1.07', '距离:42米 驻波比:1.02'],
black: ['漏缆百米损耗:2.8']
},
uploadDate: '2022/12/18 11:51:12',
updateDate: '2022/12/18 11:51:12',
confirmUser: 'admin',
confirmTime: '2022/12/18 17:51:12',
},
{
name: 'STATION2未开通',
object: '漏缆FSU2_R1下行方向',
level: '重要',
message: {
red: ['距离:0米 驻波比:8.72'],
green: ['距离:18米 驻波比:1.07', '距离:42米 驻波比:1.02'],
black: ['漏缆百米损耗:2.8']
},
uploadDate: '2022/12/18 11:51:12',
updateDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--'
},
]
\ No newline at end of file
...@@ -81,7 +81,8 @@ ...@@ -81,7 +81,8 @@
</template> </template>
<script> <script>
import { cableTimeList, cableExport } from '../api' import { cableTimeList } from '../api'
import { exportLeakyCable } from '@/api/export'
import search from '@/views/monitor/leakageCable/components/search.vue' import search from '@/views/monitor/leakageCable/components/search.vue'
export default { export default {
data() { data() {
...@@ -107,7 +108,8 @@ export default { ...@@ -107,7 +108,8 @@ export default {
key: 0 key: 0
} }
], ],
isQuery: false isQuery: false,
searchOption: {}
}; };
}, },
components: { search }, components: { search },
...@@ -129,12 +131,8 @@ export default { ...@@ -129,12 +131,8 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
let type = '' this.searchOption = option
if(this.confirmStatus == 2) { let type = this.confirmStatus == 2 ? '' : this.confirmStatus
type = ''
} else {
type = this.confirmStatus
}
let param = { let param = {
confirmStatus: type, confirmStatus: type,
...this.params, ...this.params,
...@@ -151,15 +149,21 @@ export default { ...@@ -151,15 +149,21 @@ export default {
this.getTableData() this.getTableData()
}, },
exportList() { exportList() {
cableExport({confirmStatus: this.confirmStatus}).then(res => { let type = this.confirmStatus == 2 ? '' : this.confirmStatus
let param = {
confirmStatus: type,
...this.params,
...this.searchOption
}
exportLeakyCable(param).then(res => {
download(res, 'vnd.ms-excel', `漏缆监测告警.xls`)
}) })
}, },
}, },
mounted() { mounted() {
this.getTableData() this.getTableData()
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
export const tableData = [
{
equipment1: '监控中心LSC',
state1: '连接正常',
equipment2: '现场管理单元 K65+308',
uploadDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--',
},
{
equipment1: '监控中心LSC',
state1: '连接正常',
equipment2: '现场管理单元 K65+308',
uploadDate: '2022/12/18 11:51:12',
confirmUser: 'admin',
confirmTime: '2022/12/18 11:51:12',
},
{
equipment1: '监控中心LSC',
state1: '连接正常',
equipment2: '现场管理单元 K65+308',
uploadDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--',
},
{
equipment1: '监控中心LSC',
state1: '连接正常',
equipment2: '现场管理单元 K65+308',
uploadDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--',
},
{
equipment1: '监控中心LSC',
state1: '连接异常',
equipment2: '现场管理单元 K65+308',
uploadDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--',
},
{
equipment1: '监控中心LSC',
state1: '连接异常',
equipment2: '现场管理单元 K65+308',
uploadDate: '2022/12/18 11:51:12',
confirmUser: '--',
confirmTime: '--',
},
]
\ No newline at end of file
...@@ -51,8 +51,10 @@ ...@@ -51,8 +51,10 @@
</template> </template>
<script> <script>
import { deviceList, deviceExport } from '../api' import { deviceList } from '../api'
import { exportConnet } from '@/api/export'
import search from '@/views/monitor/equipment/components/search.vue' import search from '@/views/monitor/equipment/components/search.vue'
import download from '@/utils/download'
export default { export default {
data() { data() {
return { return {
...@@ -77,8 +79,9 @@ export default { ...@@ -77,8 +79,9 @@ export default {
key: 0 key: 0
} }
], ],
isQuery: false isQuery: false,
}; searchOption: {}
}
}, },
components: { search }, components: { search },
methods: { methods: {
...@@ -100,12 +103,7 @@ export default { ...@@ -100,12 +103,7 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
let type = '' let type = this.confirmStatus == 2 ? '' : this.confirmStatus
if(this.confirmStatus == 2) {
type = ''
} else {
type = this.confirmStatus
}
let param = { let param = {
confirmStatus: type, confirmStatus: type,
...this.params, ...this.params,
...@@ -122,7 +120,14 @@ export default { ...@@ -122,7 +120,14 @@ export default {
this.getTableData() this.getTableData()
}, },
exportList() { exportList() {
deviceExport({confirmStatus: this.confirmStatus}).then(res => { let type = this.confirmStatus == 2 ? '' : this.confirmStatus
let param = {
confirmStatus: type,
...this.params,
...this.searchOption
}
exportConnet(param).then(res => {
download(res, 'vnd.ms-excel', `设备连接告警.xls`)
}) })
}, },
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
>删除</delids> >删除</delids>
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="getTableData">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
<el-button type="primary">清空数据</el-button> <el-button type="primary">清空数据</el-button>
</div> </div>
</div> </div>
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
import { ConnectMaintainList, ConnectMaintainDelete } from '../api' import { ConnectMaintainList, ConnectMaintainDelete } from '../api'
import { ConnectStatusEnum } from '@/const/index' import { ConnectStatusEnum } from '@/const/index'
import search from './components/search.vue' import search from './components/search.vue'
import download from '@/utils/download'
import { exportConnectMaintainHistory } from '@/api/export'
export default { export default {
data() { data() {
return { return {
...@@ -66,7 +67,8 @@ export default { ...@@ -66,7 +67,8 @@ export default {
}, },
total: 14, total: 14,
tableData: [], tableData: [],
isQuery: false isQuery: false,
searchOption: {}
}; };
}, },
components: { components: {
...@@ -83,6 +85,7 @@ export default { ...@@ -83,6 +85,7 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
this.searchOption = option
let params = { let params = {
...this.params, ...this.params,
...option ...option
...@@ -112,11 +115,20 @@ export default { ...@@ -112,11 +115,20 @@ export default {
return "stripe"; return "stripe";
} }
}, },
toExport() {
let params = {
...this.params,
...this.searchOption
}
exportConnectMaintainHistory(params).then(res => {
download(res, 'vnd.ms-excel', `设备连接维修历史.xls`)
})
},
}, },
mounted() { mounted() {
this.getTableData() this.getTableData()
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.leakage-cable { .leakage-cable {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
> >
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="getTableData">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
<el-button type="primary">清空数据</el-button> <el-button type="primary">清空数据</el-button>
</div> </div>
</div> </div>
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
import { ConnectStatusList, ConnectStatusDelete } from '../api' import { ConnectStatusList, ConnectStatusDelete } from '../api'
import { ConnectStatusEnum } from '@/const/index' import { ConnectStatusEnum } from '@/const/index'
import search from './components/search.vue' import search from './components/search.vue'
import { exportConnectStatusHistory } from '@/api/export'
import download from '@/utils/download'
export default { export default {
props: [], props: [],
data() { data() {
...@@ -70,7 +71,8 @@ export default { ...@@ -70,7 +71,8 @@ export default {
}, },
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false isQuery: false,
searchOption: {}
} }
}, },
components: { components: {
...@@ -87,6 +89,7 @@ export default { ...@@ -87,6 +89,7 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
this.searchOption = option
let params = { let params = {
...this.params, ...this.params,
...option ...option
...@@ -116,6 +119,15 @@ export default { ...@@ -116,6 +119,15 @@ export default {
return "stripe"; return "stripe";
} }
}, },
toExport() {
let params = {
...this.params,
...this.searchOption
}
exportConnectStatusHistory(params).then(res => {
download(res, 'vnd.ms-excel', `设备连接历史状态.xls`)
})
}
}, },
mounted() { mounted() {
this.getTableData() this.getTableData()
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
> >
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="getTableData">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
<script> <script>
import { MonitorMaintainList, MonitorMaintainDelete } from '../api' import { MonitorMaintainList, MonitorMaintainDelete } from '../api'
import search from './components/search.vue' import search from './components/search.vue'
import download from '@/utils/download'
import { exportLeakyMaintainHistory } from '@/api/export'
export default { export default {
props: [], props: [],
data() { data() {
...@@ -68,8 +69,9 @@ export default { ...@@ -68,8 +69,9 @@ export default {
}, },
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false isQuery: false,
}; searchOption: {}
}
}, },
components: { components: {
search search
...@@ -85,6 +87,7 @@ export default { ...@@ -85,6 +87,7 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
this.searchOption = option
let params = { let params = {
current: this.params.pageNum, current: this.params.pageNum,
size: this.params.pageSize, size: this.params.pageSize,
...@@ -112,6 +115,15 @@ export default { ...@@ -112,6 +115,15 @@ export default {
return 'stripe' return 'stripe'
} }
}, },
toExport() {
let params = {
...this.params,
...this.searchOption
}
exportLeakyMaintainHistory(params).then(res => {
download(res, 'vnd.ms-excel', `漏缆监测维修历史.xls`)
})
}
}, },
mounted() { this.getTableData() }, mounted() { this.getTableData() },
}; };
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
> >
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="getTableData">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
<el-button type="primary">图形报表</el-button> <el-button type="primary">图形报表</el-button>
</div> </div>
</div> </div>
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
<script> <script>
import { MonitorStatusList, MonitorStatusDelete } from '../api' import { MonitorStatusList, MonitorStatusDelete } from '../api'
import search from './components/search.vue' import search from './components/search.vue'
import download from '@/utils/download'
import { exportLeakyStatusHistory } from '@/api/export'
export default { export default {
data() { data() {
return { return {
...@@ -57,7 +58,8 @@ export default { ...@@ -57,7 +58,8 @@ export default {
total: 10, total: 10,
tableData: [], tableData: [],
multipleSelection: [], multipleSelection: [],
isQuery: false isQuery: false,
searchOption: {}
} }
}, },
components: { components: {
...@@ -81,6 +83,7 @@ export default { ...@@ -81,6 +83,7 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
this.searchOption = option
let params = { let params = {
...this.params, ...this.params,
...option ...option
...@@ -100,6 +103,15 @@ export default { ...@@ -100,6 +103,15 @@ export default {
this.$message.success('删除成功!') this.$message.success('删除成功!')
this.getTableData() this.getTableData()
}) })
},
toExport() {
let params = {
...this.params,
...this.searchOption
}
exportLeakyStatusHistory(params).then(res => {
download(res, 'vnd.ms-excel', `漏缆监测历史状态.xls`)
})
} }
}, },
mounted() { mounted() {
......
...@@ -2,23 +2,14 @@ import request from '@/utils/request' ...@@ -2,23 +2,14 @@ import request from '@/utils/request'
const path = { const path = {
CableStatusList: 'sysLeakyCableStatus/selectPage', CableStatusList: 'sysLeakyCableStatus/selectPage',
CableStatusExport: 'sysLeakyCableStatus/export',
DeviceStatusList: 'sysDeviceStatus/selectPage', DeviceStatusList: 'sysDeviceStatus/selectPage',
DeviceStatusExport: 'sysDeviceStatus/export',
} }
export function CableStatusList() { export function CableStatusList() {
return request.post(path.CableStatusList, ...arguments) return request.post(path.CableStatusList, ...arguments)
} }
export function CableStatusExport() {
return request.post(path.CableStatusExport, ...arguments)
}
export function DeviceStatusList() { export function DeviceStatusList() {
return request.post(path.DeviceStatusList, ...arguments) return request.post(path.DeviceStatusList, ...arguments)
} }
export function DeviceStatusExport() {
return request.post(path.DeviceStatusExport, ...arguments)
}
...@@ -36,9 +36,11 @@ ...@@ -36,9 +36,11 @@
</template> </template>
<script> <script>
import { DeviceStatusList, DeviceStatusExport } from '../api' import { DeviceStatusList } from '../api'
import { ConnectStatusEnum } from '@/const/index' import { ConnectStatusEnum } from '@/const/index'
import search from './components/search.vue' import search from './components/search.vue'
import download from '@/utils/download'
import { exportConnetTime } from '@/api/export'
export default { export default {
data() { data() {
return { return {
...@@ -49,7 +51,8 @@ export default { ...@@ -49,7 +51,8 @@ export default {
}, },
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false isQuery: false,
searchOption: {}
}; };
}, },
components: { search }, components: { search },
...@@ -77,6 +80,7 @@ export default { ...@@ -77,6 +80,7 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
this.searchOption = option
let params = { let params = {
...this.params, ...this.params,
...option ...option
...@@ -92,7 +96,11 @@ export default { ...@@ -92,7 +96,11 @@ export default {
}) })
}, },
toExport() { toExport() {
DeviceStatusExport().then(res => {}) let params = {
...this.params,
...this.searchOption
}
exportConnetTime(params).then(res => { download(res, 'vnd.ms-excel', `设备实时.xls`) })
} }
}, },
mounted() { mounted() {
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
import { CableStatusList, CableStatusExport } from '../api' import { CableStatusList, CableStatusExport } from '../api'
import { ConnectStatusEnum } from '@/const/index' import { ConnectStatusEnum } from '@/const/index'
import search from './components/search.vue' import search from './components/search.vue'
import { exportLeakyCableTime } from '@/api/export'
import download from '@/utils/download'
export default { export default {
data() { data() {
return { return {
...@@ -61,7 +63,8 @@ export default { ...@@ -61,7 +63,8 @@ export default {
}, },
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false isQuery: false,
searchOption: {}
}; };
}, },
components: { search }, components: { search },
...@@ -83,6 +86,7 @@ export default { ...@@ -83,6 +86,7 @@ export default {
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
this.searchOption = option
let params = { let params = {
...this.params, ...this.params,
...option ...option
...@@ -94,7 +98,13 @@ export default { ...@@ -94,7 +98,13 @@ export default {
}) })
}, },
toExport() { toExport() {
CableStatusExport().then(res => {}) let params = {
...this.params,
...this.searchOption
}
exportLeakyCableTime(params).then(res => {
download(res, 'vnd.ms-excel', `漏缆实时.xls`)
})
} }
}, },
mounted() { mounted() {
......
...@@ -6,7 +6,6 @@ const path = { ...@@ -6,7 +6,6 @@ const path = {
updatePwd: 'user/updatePwd', updatePwd: 'user/updatePwd',
updateInfo: 'user/updateUserBaseInfo', updateInfo: 'user/updateUserBaseInfo',
exportLog: 'sysLog/exportLog',
logList: 'sysLog/selectLogPage', logList: 'sysLog/selectLogPage',
} }
...@@ -26,10 +25,6 @@ export function updateInfo() { ...@@ -26,10 +25,6 @@ export function updateInfo() {
return request.post(path.updateInfo, ...arguments) return request.post(path.updateInfo, ...arguments)
} }
export function exportLog() {
return request.post(path.exportLog, ...arguments)
}
export function logList() { export function logList() {
return request.post(path.logList, ...arguments) return request.post(path.logList, ...arguments)
} }
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
<el-table-column prop="creationTime" label="操作时间" align="center" /> <el-table-column prop="creationTime" label="操作时间" align="center" />
</el-table> </el-table>
<Pagination <Pagination
:limit="params.pageSize" :limit="params.size"
:page="params.pageNum" :page="params.current"
:total="total" :total="total"
class="pagination" class="pagination"
@pagination="handlePageChange" @pagination="handlePageChange"
...@@ -45,32 +45,34 @@ ...@@ -45,32 +45,34 @@
<script> <script>
import { exportLog, logList } from '../api' import { exportLog, logList } from '../api'
import search from './components/search.vue' import search from './components/search.vue'
import { exportLog } from '@/api/export'
import download from '@/utils/download'
export default { export default {
data() { data() {
return { return {
params: { params: {
pageNum: 1, current: 1,
pageSize: 10, size: 10,
}, },
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false isQuery: false,
searchOption: {}
}; };
}, },
components: { components: {
search search
}, },
computed: {},
methods: { methods: {
handlePageChange(pageData) { handlePageChange(pageData) {
this.params.pageSize = pageData.size; this.params.size = pageData.size;
this.params.pageNum = pageData.page; this.params.current = pageData.page;
this.getTableData() this.getTableData()
}, },
getTableData(option) { getTableData(option) {
this.searchOption = option
let params = { let params = {
current: this.params.pageNum, ...this.params,
size: this.params.pageSize,
...option ...option
} }
logList(params).then(res => { logList(params).then(res => {
...@@ -84,24 +86,11 @@ export default { ...@@ -84,24 +86,11 @@ export default {
}, },
exportLog() { exportLog() {
let params = { let params = {
current: this.params.pageNum, ...this.params,
size: this.params.pageSize ...this.searchOption
} }
exportLog(params).then(res => { exportLog(params).then(res => {
download(res, 'vnd.ms-excel', `用户日志.xls`)
if (res) {
const xlsx = 'application/vnd.ms-excel'
const blob = new Blob([res], { type: xlsx })
const a = document.createElement('a')
a.download = 'fileName.xls'
a.href = window.URL.createObjectURL(blob)
a.click()
a.remove()
} else {
this.$message.error('导出失败')
}
//
}) })
} }
}, },
...@@ -124,7 +113,7 @@ export default { ...@@ -124,7 +113,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin: 20px 0; margin: 20px 0;
.pageNum { .current {
margin: 0 20px; margin: 0 20px;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment