|
@@ -549,6 +549,7 @@ export default {
|
|
|
reportDialogTitle: '新增报表',
|
|
|
showMainView: false,
|
|
|
chooseMyReport: null,
|
|
|
+ chooseCurrMyReport: null,
|
|
|
dialogReportTemplateVisible: false,
|
|
|
dialogDownloadReportTypeVisible: false,
|
|
|
dialogAutoReportVisible: false,
|
|
@@ -684,6 +685,7 @@ export default {
|
|
|
watch: {},
|
|
|
beforeDestroy() {
|
|
|
this.chooseMyReport = null
|
|
|
+ this.chooseCurrMyReport = null
|
|
|
},
|
|
|
mounted() {
|
|
|
let _this = this
|
|
@@ -865,11 +867,11 @@ export default {
|
|
|
let times = this.radioByCronValD.split(':')
|
|
|
result = '每天#{cron3}:#{cron2}:#{cron1}执行一次'
|
|
|
result = result.replace('#{cron1}',
|
|
|
- parseInt(times[2]) < 10 ? ('0' + times[2]) : times[2])
|
|
|
+ (times[2].length < 2 && parseInt(times[2]) < 10) ? ('0' + times[2]) : times[2])
|
|
|
result = result.replace('#{cron2}',
|
|
|
- parseInt(times[1]) < 10 ? ('0' + times[1]) : times[1])
|
|
|
+ (times[1].length < 2 && parseInt(times[1]) < 10) ? ('0' + times[1]) : times[1])
|
|
|
result = result.replace('#{cron3}',
|
|
|
- parseInt(times[0]) < 10 ? ('0' + times[0]) : times[0])
|
|
|
+ (times[0].length < 2 && parseInt(times[0]) < 10) ? ('0' + times[0]) : times[0])
|
|
|
// result = result.replace(/00/g, '0')
|
|
|
}
|
|
|
break
|
|
@@ -879,11 +881,11 @@ export default {
|
|
|
let times = this.radioByCronValMoD.split(':')
|
|
|
result = '每月#{cron4}号的#{cron3}:#{cron2}:#{cron1}执行一次'
|
|
|
result = result.replace('#{cron1}',
|
|
|
- parseInt(times[2]) < 10 ? ('0' + times[2]) : times[2])
|
|
|
+ (times[2].length < 2 && parseInt(times[2]) < 10) ? ('0' + times[2]) : times[2])
|
|
|
result = result.replace('#{cron2}',
|
|
|
- parseInt(times[1]) < 10 ? ('0' + times[1]) : times[1])
|
|
|
+ (times[1].length < 2 && parseInt(times[1]) < 10) ? ('0' + times[1]) : times[1])
|
|
|
result = result.replace('#{cron3}',
|
|
|
- parseInt(times[0]) < 10 ? ('0' + times[0]) : times[0])
|
|
|
+ (times[0].length < 2 && parseInt(times[0]) < 10) ? ('0' + times[0]) : times[0])
|
|
|
result = result.replace('#{cron4}', this.radioByCronValMo)
|
|
|
// result = result.replace(/00/g, '0')
|
|
|
}
|
|
@@ -895,12 +897,12 @@ export default {
|
|
|
},
|
|
|
/** 选择定时任务表达式 */
|
|
|
chooseCronEvent() {
|
|
|
- this.reportForm.cron = this.getCron()
|
|
|
- this.reportForm.cronLabel = this.getCronLabel()
|
|
|
- if (!this.reportForm.cron) {
|
|
|
+ if (!this.getCron()) {
|
|
|
showAlertMsgWin(this, null, '请指定定时任务类型或运行时间!')
|
|
|
return
|
|
|
}
|
|
|
+ this.reportForm.cron = this.getCron()
|
|
|
+ this.reportForm.cronLabel = this.getCronLabel()
|
|
|
if (!this.validCron(this.reportForm.cron)) {
|
|
|
showAlertMsgWin(this, null, '定时任务表达式格式不正确!')
|
|
|
return
|
|
@@ -1521,13 +1523,13 @@ export default {
|
|
|
}
|
|
|
this.showMainView = true
|
|
|
this.breadcrumbList = [_data.reportTableName]
|
|
|
+ this.chooseCurrMyReport = _data
|
|
|
// 判断是否运行记录
|
|
|
if (type === 'history') {
|
|
|
this.dialogHistoryReportVisible = false
|
|
|
this.btnType = 'showChild'
|
|
|
} else {
|
|
|
this.chooseMyReport = res.data
|
|
|
- console.log(this.chooseMyReport)
|
|
|
this.btnType = 'showShared'
|
|
|
}
|
|
|
this.setLuckysheetStatus(_data, true, type, loading)
|
|
@@ -1873,7 +1875,6 @@ export default {
|
|
|
},
|
|
|
/** 更新报表信息 */
|
|
|
updateReport() {
|
|
|
- console.log(this.chooseMyReport)
|
|
|
if (!this.chooseMyReport || !this.chooseMyReport.id) {
|
|
|
showAlertMsgWin(this, null, '保存失败,请刷新后重试!')
|
|
|
return
|
|
@@ -1921,11 +1922,11 @@ export default {
|
|
|
},
|
|
|
/** 报表下载事件 */
|
|
|
downloadReportEvent() {
|
|
|
- if (!this.chooseMyReport) {
|
|
|
+ if (!this.chooseCurrMyReport) {
|
|
|
showAlertMsgWin(this, null, '请选择报表!')
|
|
|
return
|
|
|
}
|
|
|
- let reportName = this.chooseMyReport.reportTableName ? this.chooseMyReport.reportTableName : '统计报表'
|
|
|
+ let reportName = this.chooseCurrMyReport.reportTableName ? this.chooseCurrMyReport.reportTableName : '统计报表'
|
|
|
if (this.downloadType == '1') {
|
|
|
// exportExcel(luckysheet, reportName, ExcelJS).then((res) => {
|
|
|
// console.log("result==>", res)
|