Commit f117a12a authored by 王飞龙's avatar 王飞龙

设备地区修改

parent 16eb6618
......@@ -87,12 +87,14 @@
>新增设备
</el-button>
<el-button
v-hasPermi="['business:device:export']"
icon="el-icon-finished"
class="fourWordswhiteBtn"
@click="selectAll()"
>选择全部
</el-button>
<el-button
v-hasPermi="['business:device:export']"
icon="el-icon-back"
class="fourWordswhiteBtn"
@click="reverseSelect(deviceList)"
......@@ -685,19 +687,32 @@ export default {
this.$modal.msgSuccess('删除成功')
}).catch(() => {})
},
// 导出日期格式化
exportFormatTime(date) {
// 获取年月日
var year = date.getFullYear()
var month = date.getMonth() + 1 // 月份从0开始,需要加1
var day = date.getDate()
// 将年月日格式化为字符串
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
}
const formattedDate = year.toString() + month.toString() + day.toString()
return formattedDate
},
/** 导出按钮操作 */
handleExport() {
// this.download('business/device/export', {
// ...this.queryParams
// }, `device_${new Date().getTime()}.xlsx`)
if (this.ids.length !== 0) {
const exportTable = {}
exportTable.deviceIdList = this.ids
this.download('business/device/export', exportTable, `use_${new Date().getTime()}.xlsx`).then(res => {
this.download('business/device/export', exportTable, `设备管理_${this.exportFormatTime(new Date())}.xlsx`).then(res => {
this.$refs.table.clearSelection()
})
} else {
this.$modal.msgError('请选择至少一条数据导出')
this.$modal.msgWarning('请选择至少一条数据导出')
return
}
}
......
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