Quellcode durchsuchen

修改禅道问题

FinalYu vor 1 Jahr
Ursprung
Commit
c88ea0c83f

+ 2 - 2
chuanyi_client2/src/api/datasource.js

@@ -300,7 +300,7 @@ export function getAllDataModel(params) {
     let uriParams = '/dataModel/getAllDataModel'
     uriParams += '?page=' + params.page + '&limit=' + params.limit
     if (params.operationRule) {
-        uriParams += '&operationRule=' + params.operationRule
+        uriParams += '&operationRule=' + encodeURIComponent(params.operationRule)
     }
     return request({
         url: uriParams,
@@ -534,7 +534,7 @@ export function getAllOkReportTable(params) {
         uriParams += '&isAutoReport=' + params.isAutoReport
     }
     if (params.reportTableName) {
-        uriParams += '&reportTableName=' + params.reportTableName
+        uriParams += '&reportTableName=' + encodeURIComponent(params.reportTableName)
     }
     return request({
         url: '/reportTable/getAllOkReportTable' + uriParams,

+ 9 - 4
chuanyi_client2/src/utils/cqcy.js

@@ -630,11 +630,16 @@ export function checkReportChangeStatus() {
 export function checkReportChangeStatusAction(_this, callback, callbackError) {
     let status = checkReportChangeStatus()
     if (status) {
-        showConfirmWin(_this, null, cqcyCode[301], () => {
+        // 判断当前是否在报表模板页面层
+        if (window.location.href.indexOf('reportTemplate') > -1) {
+            showConfirmWin(_this, null, cqcyCode[301], () => {
+                if (callback) callback()
+            }, () => {
+                if (callbackError) callbackError()
+            })
+        } else {
             if (callback) callback()
-        }, () => {
-            if (callbackError) callbackError()
-        })
+        }
     } else {
         if (callback) callback()
     }

+ 5 - 4
chuanyi_client2/src/views/my_report/index.vue

@@ -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
@@ -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)

+ 13 - 7
chuanyi_client2/src/views/report_template/index.vue

@@ -806,6 +806,7 @@ export default {
           }
         }
         luckysheet.create(option)
+        _this.templateName = localStorage.getItem(_this.reportTemplateItem + '_TITLE')
       } else {
         let option = JSON.parse(JSON.stringify(_this.luckysheetOption))
         option.hook = {
@@ -861,12 +862,12 @@ export default {
     },
     /** 数据项配置结果集事件 */
     chooseDataItemConfigEvent() {
+      if (this.templateReportType == 0 && (!this.itemConditionForm.dateRange || this.itemConditionForm.dateRange.length == 0)) {
+        showAlertMsgWin(this, null, '取值时间范围不能为空!')
+        return
+      }
       this.$refs['itemConditionForm'].validate((valid) => {
         if (valid) {
-          if (this.templateReportType == 0 && this.itemConditionForm.dateRange.length == 0) {
-            showAlertMsgWin(this, null, '取值时间范围不能为空!')
-            return
-          }
           this.$nextTick(() => {
             this.chooseGroupItemList.forEach((data) => {
               this.selectionDataItems.forEach((item) => {
@@ -1213,13 +1214,17 @@ export default {
         loading.close()
         this.itemDataListByGroupName = res.data.groupName
         this.itemDataListByTree = res.data.itemList
-        let tempList = this.chooseGroupItemList.length == 0 ? this.chooseItemData : this.chooseGroupItemList
+        let flag = this.chooseGroupItemList.length == 0
+        let tempList = flag ? this.chooseItemData : this.chooseGroupItemList
         if (this.$refs.itemTree) this.$refs.itemTree.setCheckedKeys([])
         if (tempList.length > 0) {
           let idList = Array.from(tempList, ({ id }) => id)
           setTimeout(() => {
-            if (this.$refs.itemTree) this.$refs.itemTree.setCheckedKeys(idList)
-            if (this.itemDataListByTree.length == idList.length) {
+            if (this.$refs.itemTree) {
+              if (flag) this.$refs.itemTree.setCheckedKeys([])
+              else this.$refs.itemTree.setCheckedKeys(idList)
+            }
+            if (this.itemDataListByTree.length == this.chooseGroupItemList.length) {
               this.isSelectAllItem = true
             } else {
               this.isSelectAllItem = false
@@ -1811,6 +1816,7 @@ export default {
             'data': JSON.parse(getLuckysheetConfig())
           }
           localStorage.setItem(_this.reportTemplateItem, JSON.stringify(result))
+          localStorage.setItem(_this.reportTemplateItem + '_TITLE', _this.templateName)
           console.log(new Date().getTime(), 'auto save report template success.')
         }
       }, 5 * 1000)

+ 14 - 13
chuanyi_client2/src/views/run_config/index.vue

@@ -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)