diff --git a/src/pages/screen/screen4/index.vue b/src/pages/screen/screen4/index.vue
index 99d3404..b0bd811 100644
--- a/src/pages/screen/screen4/index.vue
+++ b/src/pages/screen/screen4/index.vue
@@ -25,9 +25,8 @@
-
+
+
{{
props.row.equipmentType
- }}
+ }}
{{
props.row.furnaceNum
- }}
+ }}
{{
props.row.totalRunningTime }}
{{
@@ -175,7 +174,7 @@ const onRequest = (props: any) => {
const pagination = ref(new Pagination(new EquipmentRecord()));
const getPage = () => {
- rangDateRef.value.resetValidation();
+ // rangDateRef.value.resetValidation();
if (rangeDate.value) {
pagination.value.data.begTime = rangeDate.value.from + ' 00:00:00';
pagination.value.data.endTime = rangeDate.value.to + ' 23:59:59';
@@ -267,110 +266,110 @@ const wrapCsvValue = (val: any, formatFn: any) => {
// 导出Excel
const equipmentNoTimeRecord = ref();
const exportTable = () => {
- rangDateRef.value.validate();
- if (!rangDateRef.value.hasError) {
-
- if (rangeDate.value) {
- let begTime = rangeDate.value.from + ' 00:00:00';
- let endTime = rangeDate.value.to + ' 23:59:59';
- const diff = date.getDateDiff(new Date(endTime), new Date(begTime), 'days') // 计算日期差值
- // 判断 时间范围是否大于30天
- if (diff > 30) {
- Notify.create({
- position: 'top',
- message: '日期范围不能大于30天!',
- icon: 'feedback',
- color: 'negative',
- })
- return
- }
- equipmentNoTimeRecord.value = new EquipmentNoTimeRecord();
- equipmentNoTimeRecord.value.begTime = begTime;
- equipmentNoTimeRecord.value.endTime = endTime;
- }
+ // rangDateRef.value.validate();
+ // if (!rangDateRef.value.hasError) {
- Dialog.create({
- title: '系统提示',
- message: '是否导出?',
- class: 'text-h7 text-weight-bold',
- cancel: true,
- persistent: true
- }).onOk(() => {
- Loading.show({
- spinner: QSpinnerIos,
- message: '正在导出,请稍等...',
- boxClass: 'bg-grey-2 text-grey-9',
- spinnerColor: 'primary'
- });
-
- // var d = new Date(); // 获取当前日期时间
- // var monthStart = date.formatDate(new Date(d.getFullYear(), d.getMonth(), 1), 'YYYY-MM-DD'); // 获取本月第一天的日期时间
- // var monthEnd = date.formatDate(new Date(d.getFullYear(), d.getMonth() + 1, 0), 'YYYY-MM-DD'); // 获取本月最后一天的日期时间(时间为23:59:5
-
- let tableData = [
- ['序号', '设备编码', '设备名称', '设备类型', '开炉次数', '总运行时长(小时)', '总报警时长(小时)', '总待机时长(小时)']//导出表头
- ] // 表格表头
-
- equipmentRecordApi.getEquipmentRecordTotalList(equipmentNoTimeRecord.value).then((res: any) => {
-
- res.forEach((item: any, index: any) => {
- console.log(item, item.name)
- let rowData = []
- //导出内容的字段
- rowData = [
- index + 1,
- item.equipmentCode,
- item.equipmentName,
- item.equipmentType,
- item.furnaceNum,
- item.totalRunningTime,
- item.totalAlarmTime,
- item.totalStopTime
- ]
- tableData.push(rowData)
- })
- let workSheet = XLSX.utils.aoa_to_sheet(tableData);
- let bookNew = XLSX.utils.book_new();
- XLSX.utils.book_append_sheet(bookNew, workSheet, 'Sheet1') // 工作簿名称
- let name = '导出数据' + '.xlsx'
- XLSX.writeFile(bookNew, name) // 保存的文件名
-
- // // naive encoding to csv format
- // const content = [columns.value.map(col => wrapCsvValue(col.label))].concat(
- // res.map(row => columns.value.map(col => wrapCsvValue(
- // typeof col.field === 'function'
- // ? col.field(row)
- // : row[col.field === void 0 ? col.name : col.field],
- // col.format,
- // row
- // )).join(','))
- // ).join('\r\n')
-
- // // 'application/vnd.ms-excel'
- // const status = exportFile(
- // 'table-export.csv',
- // content,
- // {
- // mimeType: 'text/csv',
- // byteOrderMark: '\uFEFF', //解决乱码问题
- // encoding: 'utf-8'
- // }
- // )
-
- // if (status !== true) {
- // Notify.create({
- // position: 'top',
- // message: '浏览器拒绝文件下载...',
- // icon: 'warning',
- // color: 'negative',
- // });
- // }
-
- }).finally(() => {
- Loading.hide();
- });
- }).onCancel(() => { })
+ if (rangeDate.value) {
+ let begTime = rangeDate.value.from + ' 00:00:00';
+ let endTime = rangeDate.value.to + ' 23:59:59';
+ //const diff = date.getDateDiff(new Date(endTime), new Date(begTime), 'days') // 计算日期差值
+ // 判断 时间范围是否大于30天
+ // if (diff > 30) {
+ // Notify.create({
+ // position: 'top',
+ // message: '日期范围不能大于30天!',
+ // icon: 'feedback',
+ // color: 'negative',
+ // })
+ // return
+ // }
+ equipmentNoTimeRecord.value = new EquipmentNoTimeRecord();
+ equipmentNoTimeRecord.value.begTime = begTime;
+ equipmentNoTimeRecord.value.endTime = endTime;
}
+
+ Dialog.create({
+ title: '系统提示',
+ message: '是否导出?',
+ class: 'text-h7 text-weight-bold',
+ cancel: true,
+ persistent: true
+ }).onOk(() => {
+ Loading.show({
+ spinner: QSpinnerIos,
+ message: '正在导出,请稍等...',
+ boxClass: 'bg-grey-2 text-grey-9',
+ spinnerColor: 'primary'
+ });
+
+ // var d = new Date(); // 获取当前日期时间
+ // var monthStart = date.formatDate(new Date(d.getFullYear(), d.getMonth(), 1), 'YYYY-MM-DD'); // 获取本月第一天的日期时间
+ // var monthEnd = date.formatDate(new Date(d.getFullYear(), d.getMonth() + 1, 0), 'YYYY-MM-DD'); // 获取本月最后一天的日期时间(时间为23:59:5
+
+ let tableData = [
+ ['序号', '设备编码', '设备名称', '设备类型', '开炉次数', '总运行时长(小时)', '总报警时长(小时)', '总待机时长(小时)']//导出表头
+ ] // 表格表头
+
+ equipmentRecordApi.getEquipmentRecordTotalList(equipmentNoTimeRecord.value).then((res: any) => {
+
+ res.forEach((item: any, index: any) => {
+ console.log(item, item.name)
+ let rowData = []
+ //导出内容的字段
+ rowData = [
+ index + 1,
+ item.equipmentCode,
+ item.equipmentName,
+ item.equipmentType,
+ item.furnaceNum,
+ item.totalRunningTime,
+ item.totalAlarmTime,
+ item.totalStopTime
+ ]
+ tableData.push(rowData)
+ })
+ let workSheet = XLSX.utils.aoa_to_sheet(tableData);
+ let bookNew = XLSX.utils.book_new();
+ XLSX.utils.book_append_sheet(bookNew, workSheet, 'Sheet1') // 工作簿名称
+ let name = '导出数据' + '.xlsx'
+ XLSX.writeFile(bookNew, name) // 保存的文件名
+
+ // // naive encoding to csv format
+ // const content = [columns.value.map(col => wrapCsvValue(col.label))].concat(
+ // res.map(row => columns.value.map(col => wrapCsvValue(
+ // typeof col.field === 'function'
+ // ? col.field(row)
+ // : row[col.field === void 0 ? col.name : col.field],
+ // col.format,
+ // row
+ // )).join(','))
+ // ).join('\r\n')
+
+ // // 'application/vnd.ms-excel'
+ // const status = exportFile(
+ // 'table-export.csv',
+ // content,
+ // {
+ // mimeType: 'text/csv',
+ // byteOrderMark: '\uFEFF', //解决乱码问题
+ // encoding: 'utf-8'
+ // }
+ // )
+
+ // if (status !== true) {
+ // Notify.create({
+ // position: 'top',
+ // message: '浏览器拒绝文件下载...',
+ // icon: 'warning',
+ // color: 'negative',
+ // });
+ // }
+
+ }).finally(() => {
+ Loading.hide();
+ });
+ }).onCancel(() => { })
+ // }
}