Browse Source

修改提示信息

FinalYu 1 year ago
parent
commit
3c75970c55

+ 63 - 155
chuanyi_client2/src/components/HeaderMain/index.vue

@@ -186,15 +186,17 @@
                 </el-radio-group>
               </el-form-item>
               <!-- 条件读取 -->
-              <el-form-item v-if="groupRateForm.readMode == 2" label='' prop="modeValue">
-                <el-input v-model="groupRateForm.modeValue" placeholder="请输入条件值" maxlength="6" style="width: 120px;margin-right: 20px;"></el-input>
+              <el-form-item v-if="groupRateForm.readMode == 2" label='' prop="modeValue" class="cy-cltj">
+                <el-button size="mini" type="info" @click="addEventDataItem"
+                           style="float: left;width: 95px;margin-top: 4px;margin-right: 10px;">选择数据项</el-button>
                 <el-radio-group v-model="groupRateForm.eventMode">
                   <el-radio :label="0">大于</el-radio>
                   <el-radio :label="1">小于</el-radio>
                   <el-radio :label="2">等于</el-radio>
                 </el-radio-group>
-                <el-button size="mini" type="info" @click="addEventDataItem" style="float: right;width: 95px;margin-top: 4px;">选择数据项</el-button>
-                <span style="float: right;color: #8a8888;font-size: 12px;line-height: 12px;">{{reportEventConfigForm.itemName}}</span>
+                <el-input v-model="groupRateForm.modeValue" placeholder="请输入条件值" maxlength="6"
+                          style="width: 120px;float: right;"></el-input>
+                <span style="float: left;color: #8a8888;font-size: 12px;line-height: 12px;">{{reportEventConfigForm.itemName}}</span>
               </el-form-item>
               <el-form-item label='日期设置' prop="daySetting" style="margin-top: 20px;">
                 <el-checkbox-group v-model="groupRateForm.daySetting">
@@ -487,7 +489,7 @@ import {getDictByKey} from "@/api/basic";
 import {
   customCompare,
   deepTreeFilter,
-  deepTreeKey,
+  deepTreeKey, showAlertMsgWin,
   showAlertWin, showConfirmWin,
   showLoading, showPromptWin,
   traverseNode,
@@ -959,10 +961,7 @@ export default {
     addEventDataItem() {
       let itemList = this.groupBasicForm.itemList
       if (itemList && itemList.length == 0) {
-        this.$message({
-          message: '请先添加数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请先添加数据项!')
         return
       }
       this.getEventReportList()
@@ -1013,7 +1012,7 @@ export default {
       saveOrUpdateItemGroup(params).then(res => {
         loading.close()
         if (res.data) {
-          showAlertWin(this, type + '成功!', (action) => {
+          showAlertWin(this, null, type + '成功!', (action) => {
             this.handleCancel()
             this.chooseItemDataList = []
             this.chooseItemDataListF = []
@@ -1028,13 +1027,10 @@ export default {
           })
           return
         }
-        this.$message({
-          message: type + '失败!',
-          type: 'error'
-        })
+        showAlertMsgWin(this, null, type + '失败!')
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 运行、停止运行接口 */
@@ -1052,23 +1048,17 @@ export default {
         sessionStorage.setItem('GROUP_ID', id)
         // sessionStorage.removeItem('GROUP_ID')
         this.gotoPageByName('/groupItem')
-        this.$message({
-          message: res.data,
-          type: 'success'
-        })
+        showAlertMsgWin(this, null, res.data)
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 数据组运行 */
     runOrStopGroup(state) {
       let id = this.chooseGroupData.id
       if (!id) {
-        this.$message({
-          message: '运行失败,请刷新后重试!',
-          type: 'error'
-        })
+        showAlertMsgWin(this, null, '运行失败,请刷新后重试!')
         return
       }
       this.runGroupById(id, state)
@@ -1077,10 +1067,7 @@ export default {
     updateGroup() {
       let id = this.chooseGroupData.id
       if (!id) {
-        this.$message({
-          message: '修改失败,请刷新后重试!',
-          type: 'error'
-        })
+        showAlertMsgWin(this, null, '修改失败,请刷新后重试!')
         return
       }
       const loading = showLoading(this, '加载中,请稍候···')
@@ -1091,10 +1078,7 @@ export default {
         let item = res.data
         let runState = item.runState
         if (runState == 1) {
-          this.$message({
-            message: '该数据组正在运行中,禁止修改!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '该数据组正在运行中,禁止修改!')
           return
         }
         this.createGroupEvent()
@@ -1113,7 +1097,7 @@ export default {
         this.groupRateForm.daySetting = item.readWeek ? item.readWeek.split(',') : []
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 处理模式不同值显示不同 */
@@ -1172,7 +1156,7 @@ export default {
         this.getChooseItemData(item)
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 选择的数据项值初始化 */
@@ -1202,10 +1186,7 @@ export default {
     delGroup() {
       let _this = this
       if (!this.chooseGroupData) {
-        _this.$message({
-          message: '删除失败!',
-          type: 'error'
-        })
+        showAlertMsgWin(_this, null, '删除失败!')
         return
       }
       showConfirmWin(_this, null, '您确定要删除该数据组吗?', () => {
@@ -1217,13 +1198,10 @@ export default {
           // 刷新右侧数据
           sessionStorage.removeItem('GROUP_ID')
           _this.gotoPageByName('/groupItem')
-          _this.$message({
-            message: res.data,
-            type: 'success'
-          })
+          showAlertMsgWin(_this, null, res.data)
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1243,10 +1221,7 @@ export default {
     /** 修改报表模板标题 */
     updateReportName() {
       if (!this.chooseReportData || !this.chooseReportData.id) {
-        this.$message({
-          message: cqcyCode[201],
-          type: 'error'
-        })
+        showAlertMsgWin(this, null, cqcyCode[201])
         return
       }
       showPromptWin(this, '修改报表模板名称', '请输入报表模板名称', this.chooseReportData.reportName, (val) => {
@@ -1265,26 +1240,20 @@ export default {
         updateTableTemplateNameById(params).then(res => {
           loading.close()
           let msg = res.data ? '修改成功!' : '修改失败!'
-          let msgType = res.data ? 'success' : 'warning'
-          this.$message({
-            message: msg,
-            type: msgType
+          showAlertMsgWin(this, null, msg, () => {
+            this.refreshReportData()
+            this.gotoPageByName('/reportTemplate', this.chooseReportData.id)
           })
-          this.refreshReportData()
-          this.gotoPageByName('/reportTemplate', this.chooseReportData.id)
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
     /** 删除报表信息 */
     delReport() {
       if (!this.chooseReportData || !this.chooseReportData.id) {
-        this.$message({
-          message: cqcyCode[201],
-          type: 'error'
-        })
+        showAlertMsgWin(this, null, cqcyCode[201])
         return
       }
       showConfirmWin(this, null, '您确定要删除该报表模板吗?', () => {
@@ -1292,26 +1261,19 @@ export default {
         delTableTemplateById(this.chooseReportData.id).then(res => {
           loading.close()
           let msg = res.data ? '删除成功!' : '删除失败!'
-          let msgType = res.data ? 'success' : 'error'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           this.refreshReportData()
           this.gotoPageByName('/index')
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
     /** 导出模板报表 */
     exportReport() {
       if (!this.chooseReportData || !this.chooseReportData.id) {
-        this.$message({
-          message: cqcyCode[201],
-          type: 'error'
-        })
+        showAlertMsgWin(this, null, cqcyCode[201])
         return
       }
       localStorage.setItem('__export', 'export')
@@ -1370,7 +1332,7 @@ export default {
       getAllDataSource().then(res => {
         this.dataSourceList = res.data
       }).catch((e) => {
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 查询字典表:记录模式 */
@@ -1380,17 +1342,14 @@ export default {
       }).then(res => {
         this.readModeList = res.data
       }).catch((e) => {
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 添加数据项 */
     addDataItem() {
       let id = this.groupBasicForm.dataSourceId
       if (!id) {
-        this.$message({
-          message: '请选择数据源!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据源!')
         return
       }
       this.isSelectAllItem = false
@@ -1423,7 +1382,7 @@ export default {
         this.dataItemDialogVisible = true
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 数据项点击事件 */
@@ -1442,88 +1401,55 @@ export default {
     /** 参数检查 */
     checkParams() {
       if (!this.groupBasicForm.groupName) {
-        this.$message({
-          message: '组名称不能为空!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '组名称不能为空!')
         return false
       }
       if (this.groupBasicForm.itemList.length == 0) {
-        this.$message({
-          message: '请添加数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请添加数据项!')
         return false
       }
       if (!this.groupRateForm.readMode) {
-        this.$message({
-          message: '策略设置中记录模式不能为空!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '策略设置中记录模式不能为空!')
         return false
       }
       let _mv = parseFloat(this.groupRateForm.modeValue)
       // 周期读取
       if (this.groupRateForm.readMode == 0 && (isNaN(_mv) || _mv == 0)) {
-        this.$message({
-          message: '策略设置中周期读取值不能为0!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '策略设置中周期读取值不能为0!')
         return false
       }
       // 值改变读取
       if (this.groupRateForm.readMode == 1) {
         if (isNaN(parseInt(this.groupRateForm.readModeType))) {
-          this.$message({
-            message: '请选择策略设置中值改变的读取方式!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '请选择策略设置中值改变的读取方式!')
           return false
         }
         if (isNaN(_mv)) {
-          this.$message({
-            message: '策略设置中值改变读取的偏差值或偏差率不合法!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '策略设置中值改变读取的偏差值或偏差率不合法!')
           return false
         }
       }
       // 条件读取
       if (this.groupRateForm.readMode == 2) {
         if (isNaN(parseInt(this.groupRateForm.eventMode))) {
-          this.$message({
-            message: '请选择策略设置中条件读取值的方式!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '请选择策略设置中条件读取值的方式!')
           return false
         }
         if (isNaN(_mv)) {
-          this.$message({
-            message: '策略设置中条件读取的条件值不合法!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '策略设置中条件读取的条件值不合法!')
           return false
         }
         if (!this.reportEventConfigForm.itemName) {
-          this.$message({
-            message: '策略设置中条件读取的数据项不能为空!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '策略设置中条件读取的数据项不能为空!')
           return false
         }
       }
       if (!this.groupRateForm.modeValue) {
-        this.$message({
-          message: '策略设置中记录模式值不能为空!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '策略设置中记录模式值不能为空!')
         return false
       }
       if (!this.groupBasicForm.dataSourceId) {
-        this.$message({
-          message: '请选择数据源!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据源!')
         return false
       }
       return true
@@ -1556,10 +1482,7 @@ export default {
       // WinCC数据项处理
       if (this.hasLeavesFlag === 1) {
         if (this.leavesChooseList.length == 0) {
-          this.$message({
-            message: '请选择数据项!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '请选择数据项!')
           return
         }
         const nodeId = this.$refs.itemTree.getCurrentNode().$treeNodeId
@@ -1580,10 +1503,7 @@ export default {
       else {
         let checkedNodes = this.$refs.itemTree.getCheckedNodes(false, true)
         if (checkedNodes.length == 0) {
-          this.$message({
-            message: '请选择数据项!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '请选择数据项!')
           return
         }
         for (let i in checkedNodes) {
@@ -1605,10 +1525,7 @@ export default {
         }
       }
       if (chooseChannelNameList.length == 0) {
-        this.$message({
-          message: '请选择子数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择子数据项!')
       }
       // 去重
       let arr = JSON.parse(JSON.stringify(this.chooseItemDataListByTree))
@@ -1649,10 +1566,7 @@ export default {
     removeCheckNodesBtnEvent() {
       let checkedNodes = this.$refs.chooseItemTree.getCheckedNodes(false, true)
       if (checkedNodes.length == 0) {
-        this.$message({
-          message: '请选择数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据项!')
         return
       }
       // 移除当前选择项
@@ -1670,10 +1584,7 @@ export default {
     /** 选择数据项弹出层保存事件:第一步 */
     itemDialogSave1() {
       if (this.chooseItemDataListByTree.length == 0) {
-        this.$message({
-          message: '请选择数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据项!')
         return
       }
       this.dataItemDialogTitle = '数据项表达式设置'
@@ -1768,7 +1679,7 @@ export default {
         })
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 查询所有事件驱动报表 */
@@ -1800,7 +1711,7 @@ export default {
         // })
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /**按条件读取选择数据项 */
@@ -1908,10 +1819,7 @@ export default {
     /** 批量选择数据模型 */
     multipleSetting() {
       if (this.dataLineListSelections.length == 0) {
-        this.$message({
-          message: '请至少选择一项数据项',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请至少选择一项数据项!')
         return
       }
       this.chooseDataItemIndex = '-1'
@@ -1920,10 +1828,7 @@ export default {
     },
     multipleSettingEventReport() {
       if (this.dataLineListSelections.length == 0) {
-        this.$message({
-          message: '请至少选择一项数据项',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请至少选择一项数据项!')
         return
       }
       this.chooseDataItemIndex = '-1'
@@ -1956,11 +1861,7 @@ export default {
         delTableTemplateById(data.id).then(res => {
           loading.close()
           let msg = res.data ? '删除成功!' : '删除失败!'
-          let msgType = res.data ? 'success' : 'error'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           setTimeout(() => {
             this.gotoPageByName('/reportTemplate')
             this.$router.go(0)
@@ -1969,7 +1870,7 @@ export default {
           // node.parent.expand()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -2239,4 +2140,11 @@ export default {
     }
   }
 }
+
+.cy-cltj {
+  .el-form-item__error {
+    top: auto;
+    left: calc(100% - 120px);
+  }
+}
 </style>

+ 8 - 29
chuanyi_client2/src/components/HeaderPersonal/index.vue

@@ -149,7 +149,7 @@ import {mapGetters} from 'vuex'
 import {updatePwd} from '@/api/user'
 import {getPubKey} from '@/utils/auth'
 import {encrypt} from '@/utils/jsencrypt'
-import {customCompare, showAlertWin, showConfirmWin, showLoading} from '@/utils/cqcy'
+import {customCompare, showAlertMsgWin, showAlertWin, showConfirmWin, showLoading} from '@/utils/cqcy'
 import {getAllMessageNotice} from "@/api/basic";
 import {clearMessage, deleteMessageNoticeById, delMesNotByIdList} from "@/api/datasource";
 
@@ -261,25 +261,16 @@ export default {
           }
           if (this.userPwdForm.password == this.userPwdForm.newPassword) {
             loading.close()
-            this.$message({
-              message: '修改失败,新密码与原密码不能相同!',
-              type: 'error'
-            })
+            showAlertMsgWin(this, null, '修改失败,新密码与原密码不能相同!')
             return
           }
           updatePwd(data).then(res => {
             loading.close()
             if (res.code != 200) {
-              this.$message({
-                message: res.msg,
-                type: 'error'
-              })
+              showAlertMsgWin(this, null, res.msg)
               return
             }
-            this.$message({
-              message: '密码修改成功!',
-              type: 'success'
-            })
+            showAlertMsgWin(this, null, '密码修改成功!')
             this.$store.dispatch('user/Logout').then(() => {
               // location.href = '/index';
               this.$router.push({path: '/', query: {}})
@@ -344,10 +335,7 @@ export default {
         const loading = showLoading(this, '删除中,请稍候···')
         deleteMessageNoticeById(row.id).then(res => {
           loading.close()
-          this.$message({
-            message: '删除成功!',
-            type: 'success'
-          })
+          showAlertMsgWin(this, null, '删除成功!')
           this.tablePage = 1
           this.getWarnInfo()
         }).catch((e) => {
@@ -363,10 +351,7 @@ export default {
     /** 批量删除报警信息 */
     multipleDelMsgEvent() {
       if (this.multipleSelectionMsg.length == 0) {
-        this.$message({
-          message: '请至少选择一项报警信息',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请至少选择一项报警信息!')
         return
       }
       showConfirmWin(this, null, '您确定要删除选中的' + this.multipleSelectionMsg.length + '条报警信息吗?', () => {
@@ -374,10 +359,7 @@ export default {
         let ids = Array.from(this.multipleSelectionMsg, ({ id }) => id)
         delMesNotByIdList(ids).then(res => {
           loading.close()
-          this.$message({
-            message: '删除成功!',
-            type: 'success'
-          })
+          showAlertMsgWin(this, null, '删除成功!')
           this.tablePage = 1
           this.getWarnInfo()
         }).catch((e) => {
@@ -392,10 +374,7 @@ export default {
         const loading = showLoading(this, '清除中,请稍候···')
         clearMessage().then(res => {
           loading.close()
-          this.$message({
-            message: '清除成功!',
-            type: 'success'
-          })
+          showAlertMsgWin(this, null, '清除成功!')
           this.tablePage = 1
           this.getWarnInfo()
         }).catch((e) => {

+ 6 - 21
chuanyi_client2/src/components/LeftMenu/index.vue

@@ -181,7 +181,7 @@ import {
   saveOrUpdateDataSource,
   testConnect
 } from "@/api/datasource";
-import {showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
+import {showAlertMsgWin, showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
 import {encrypt} from "@/utils/jsencrypt";
 import {getPubKey} from "@/utils/auth";
 import {mapGetters} from "vuex";
@@ -352,10 +352,7 @@ export default {
     delConnServer(data) {
       let _this = this
       if (!data) {
-        _this.$message({
-          message: '删除失败!',
-          type: 'error'
-        })
+        showAlertMsgWin(_this, null, '删除失败!')
         return
       }
       showConfirmWin(_this, null, '您确定要删除该数据源吗?', () => {
@@ -363,10 +360,7 @@ export default {
         delDataSourceById(data.id).then(res => {
           loading.close()
           this.chooseDatasourceType = ''
-          _this.$message({
-            message: res.data,
-            type: 'success'
-          })
+          showAlertMsgWin(_this, null, res.data)
           this.resetAllDataSource()
         }).catch((e) => {
           loading.close()
@@ -525,10 +519,7 @@ export default {
     },
     showMsg(msg, type) {
       type = type ? type : 'warning'
-      this.$message({
-        message: msg,
-        type: type
-      })
+      showAlertMsgWin(this, null, msg)
     },
     /** 连接事件:type 1 测试连接 2 确定 3 保存 */
     handleConnect(type) {
@@ -601,10 +592,7 @@ export default {
           })
           return
         }
-        this.$message({
-          message: '保存失败!',
-          type: 'error'
-        })
+        showAlertMsgWin(this, null, '保存失败!')
       }).catch((e) => {
         loading.close()
         showAlertWin(this, null, e)
@@ -650,10 +638,7 @@ export default {
           getDriverList(data).then(res => {
             loading.close()
             this.driverList = res.data
-            this.$message({
-              message: '驱动获取成功!',
-              type: 'success'
-            })
+            showAlertMsgWin(this, null, '驱动获取成功!')
           }).catch((e) => {
             loading.close()
             showAlertWin(this, null, e)

+ 18 - 0
chuanyi_client2/src/utils/cqcy.js

@@ -472,6 +472,24 @@ export function showAlertWin(_this, title, e, callback) {
 }
 
 /**
+ * 显示消息提示
+ * @param _this
+ * @param title
+ * @param msg
+ * @param callback
+ */
+export function showAlertMsgWin(_this, title, msg, callback) {
+    _this.$alert(msg, title ? title : cqcyCode[100], {
+        confirmButtonText: '确定',
+        showClose: false,
+        callback: action => {
+            resetConfirmWinPosition()
+            if (callback) callback(action)
+        }
+    })
+}
+
+/**
  * 显示询问框
  * @param _this
  * @param title

+ 2 - 2
chuanyi_client2/src/utils/cqcyCode.js

@@ -18,8 +18,8 @@ export default {
     '901': '数据正在处理,请勿重复提交',
     '902': '下载文件出现错误,请联系管理员',
     '903': '正在下载文件,请稍候',
-    '904': '系统接口连接异常',
-    '905': '系统接口请求超时',
+    '904': '连接异常,请稍候再试!',
+    '905': '请求超时,请稍候再试!',
 
     'default': '系统未知错误,请反馈给管理员'
 }

+ 6 - 21
chuanyi_client2/src/views/data_model/index.vue

@@ -106,7 +106,7 @@
 <script>
 import BreadcrumbView from '@/components/BreadcrumbView'
 import {
-  customCompare,
+  customCompare, showAlertMsgWin,
   showAlertWin,
   showConfirmWin,
   showLoading,
@@ -219,10 +219,7 @@ export default {
       let txt = this.dataModelForm.operationRule
       this.validateCalc(null, txt, (e) => {
         if (e) {
-          this.$message({
-            message: e.message,
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, e.message)
           return
         }
         this.handleTest(null, null, txt)
@@ -281,10 +278,7 @@ export default {
         const loading = showLoading(this, '删除中,请稍候···')
         delDataModelById(row.id).then(res => {
           loading.close()
-          this.$message({
-            message: '删除成功!',
-            type: 'success'
-          })
+          showAlertMsgWin(this, null, '删除成功!')
           this.tablePage = 1
           this.getAllDataModel()
         }).catch((e) => {
@@ -301,10 +295,7 @@ export default {
           if (this.dataModelForm.id) {
             updateDataModel(this.dataModelForm).then(res => {
               loading.close()
-              this.$message({
-                message: '修改成功!',
-                type: 'success'
-              })
+              showAlertMsgWin(this, null, '修改成功!')
               this.dialogDataModelVisible = false
               this.dataModelForm.id = ''
               this.$refs['dataModelForm'].resetFields()
@@ -317,10 +308,7 @@ export default {
           }
           addDataModel(this.dataModelForm).then(res => {
             loading.close()
-            this.$message({
-              message: '保存成功!',
-              type: 'success'
-            })
+            showAlertMsgWin(this, null, '保存成功!')
             this.dialogDataModelVisible = false
             this.$refs['dataModelForm'].resetFields()
             this.getAllDataModel()
@@ -360,10 +348,7 @@ export default {
       getAllDataModel(params).then(res => {
         loading.close()
         if (!res || !res.data) {
-          this.$message({
-            message: '数据查询失败!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '数据查询失败!')
           return
         }
         this.tableTotal = res.data.count

+ 9 - 36
chuanyi_client2/src/views/group_item/index.vue

@@ -211,7 +211,7 @@ import {
   getItemValueById,
   updateItem
 } from "@/api/datasource";
-import {customCompare, showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
+import {customCompare, showAlertMsgWin, showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
 import cqcyCode from "@/utils/cqcyCode";
 
 export default {
@@ -401,10 +401,7 @@ export default {
     handleClickByEdit(row) {
       let _this = this
       if (!row || !row.id) {
-        _this.$message({
-          message: cqcyCode[201],
-          type: 'warning'
-        })
+        showAlertMsgWin(_this, null, cqcyCode[201])
         return
       }
       _this.getAllDataModel(status => {
@@ -486,11 +483,7 @@ export default {
       updateItem(params).then(res => {
         loading.close()
         let msg = res.data ? '编辑成功!' : '编辑失败!'
-        let msgType = res.data ? 'success' : 'error'
-        this.$message({
-          message: msg,
-          type: msgType
-        })
+        showAlertMsgWin(this, null, msg)
         this.dialogItemVisible = false
         this.getGroupById(this.chooseGroupId)
       }).catch((e) => {
@@ -501,21 +494,14 @@ export default {
     /** 删除数据项 */
     delItems(ids) {
       if (ids.length === this.itemDataListF.length) {
-        this.$message({
-          message: '至少保留一项数据项信息!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '至少保留一项数据项信息!')
         return
       }
       const loading = showLoading(this, '删除中,请稍候···')
       deleteItemByIdList(ids).then(res => {
         loading.close()
         let msg = res.data ? '删除成功!' : '删除失败!'
-        let msgType = res.data ? 'success' : 'error'
-        this.$message({
-          message: msg,
-          type: msgType
-        })
+        showAlertMsgWin(this, null, msg)
         this.getGroupById(this.chooseGroupId)
       }).catch((e) => {
         loading.close()
@@ -525,10 +511,7 @@ export default {
     /** 删除 */
     handleClickByDel(row) {
       if (!row || !row.id) {
-        this.$message({
-          message: cqcyCode[201],
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, cqcyCode[201])
         return
       }
       showConfirmWin(this, null, '您确定要删除该数据项吗?', () => {
@@ -542,10 +525,7 @@ export default {
     /** 批量设置组数据中数据项表达式 */
     multipleModelItemEvent() {
       if (!this.selectionItems || this.selectionItems.length == 0) {
-        this.$message({
-          message: '请至少选择一项数据',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请至少选择一项数据!')
         return
       }
       this.getAllDataModel(status => {
@@ -570,11 +550,7 @@ export default {
       batchSetExpresses(params).then(res => {
         loading.close()
         let msg = res.data ? '设置成功!' : '设置失败!'
-        let msgType = res.data ? 'success' : 'error'
-        this.$message({
-          message: msg,
-          type: msgType
-        })
+        showAlertMsgWin(this, null, msg)
         this.dialogDataModelVisible = false
         this.selectionItems = []
         this.chooseDataModel = null
@@ -587,10 +563,7 @@ export default {
     /** 批量删除组数据中数据项 */
     multipleDelItemEvent() {
       if (!this.selectionItems || this.selectionItems.length == 0) {
-        this.$message({
-          message: '请至少选择一项数据',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请至少选择一项数据!')
         return
       }
       showConfirmWin(this, null, '您确定要删除已选择数据项吗?', () => {

+ 4 - 8
chuanyi_client2/src/views/login.vue

@@ -89,8 +89,7 @@
 <script>
 import cqcyCode from '@/utils/cqcyCode'
 import {getCode} from '@/api/user'
-import {Message} from 'element-ui'
-import {showAlertWin, showLoading, showPromptWin, testHost} from '@/utils/cqcy'
+import {showAlertMsgWin, showAlertWin, showLoading, showPromptWin, testHost} from '@/utils/cqcy'
 
 export default {
   name: "Login",
@@ -240,8 +239,8 @@ export default {
           if (!_this.loginForm.publicKey) {
             _this.getCode((result) => {
               if (!result) {
-                const msg = cqcyCode[900];
-                Message.error(msg)
+                // const msg = cqcyCode[900];
+                // Message.error(msg)
                 return
               }
               _this.withLogin()
@@ -276,10 +275,7 @@ export default {
       }, (value) => {
         localStorage.setItem('SYS_HOST', value)
         // localStorage.setItem('SYS_HOST_BASE', value)
-        this.$message({
-          type: 'success',
-          message: '设置成功 '
-        })
+        showAlertMsgWin(this, null, '设置成功!')
         setTimeout(() => {
           window.location.reload()
         }, 500)

+ 20 - 66
chuanyi_client2/src/views/my_report/index.vue

@@ -435,7 +435,7 @@ import BreadcrumbView from '@/components/BreadcrumbView'
 import {
   customCompare,
   getLuckysheetConfig,
-  getNowFormatDate,
+  getNowFormatDate, showAlertMsgWin,
   showAlertWin, showConfirmWin,
   showLoading, showPromptWin
 } from '@/utils/cqcy'
@@ -725,17 +725,11 @@ export default {
     chooseCronEvent() {
       this.cronVal = this.getCron()
       if (!this.cronVal) {
-        this.$message({
-          message: '请指定定时任务类型或运行时间!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请指定定时任务类型或运行时间!')
         return
       }
       if (!this.validCron(this.cronVal)) {
-        this.$message({
-          message: '定时任务表达式格式不正确,请检查!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '定时任务表达式格式不正确!')
         return
       }
       const loading = showLoading(this, '请稍候···')
@@ -807,10 +801,7 @@ export default {
           getTableTemplateById(this.reportForm.reportTemplate).then(res => {
             if (!res.data) {
               loading.close()
-              this.$message({
-                message: '选择的报表模板不存在!',
-                type: 'warning'
-              })
+              showAlertMsgWin(this, null, '选择的报表模板不存在!')
               return
             }
             this.showMainView = true
@@ -839,10 +830,7 @@ export default {
       getDataModelById(this.reportForm.operationRule).then(res => {
         loading.close()
         if (!res.data) {
-          this.$message({
-            message: '选择的四则运算表达式不存在!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '选择的四则运算表达式不存在!')
           return
         }
         let luckyData = JSON.parse(reportData.templateData)
@@ -1141,10 +1129,7 @@ export default {
     /** 设置用户组信息 */
     setUserGroupEvent(data) {
       if (data.userId != this.uid) {
-        this.$message({
-          message: '您没有权限进行设置!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '您没有权限进行设置!')
         return
       }
       this.reportId = data.id
@@ -1184,10 +1169,7 @@ export default {
       }
       tableAssignUserById(params).then(res => {
         if (this.hasUserGroup || this.userGroupInfo) {
-          this.$message({
-            message: '保存成功!',
-            type: 'success'
-          })
+          showAlertMsgWin(this, null, '保存成功!')
           this.hasUserGroup = false
         }
         this.dialogClose()
@@ -1248,10 +1230,7 @@ export default {
       getReportTableById(data.id).then(res => {
         loading.close()
         if (!res.data) {
-          this.$message({
-            message: '选择的报表不存在!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '选择的报表不存在!')
           return
         }
         this.showMainView = true
@@ -1396,16 +1375,12 @@ export default {
         updateTableNameById(params).then(res => {
           loading.close()
           let msg = res.data ? '修改成功!' : '修改失败!'
-          let msgType = res.data ? 'success' : 'warning'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           this.reportPage = 1
           this.loadReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1416,11 +1391,7 @@ export default {
         delReportTableById(data.id).then(res => {
           loading.close()
           let msg = res.data ? '删除成功!' : '删除失败!'
-          let msgType = res.data ? 'success' : 'warning'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           if (type == 'record') {
             this.reportHistoryPage = 1
             this.historyReport()
@@ -1431,7 +1402,7 @@ export default {
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1579,10 +1550,7 @@ export default {
         }
       }, (value) => {
         if (!this.chooseReportTemplate) {
-          this.$message({
-            message: '请重新选择报表模板',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '请重新选择报表模板!')
           return
         }
         const loading = showLoading(this, '保存中,请稍候···')
@@ -1598,17 +1566,13 @@ export default {
         saveReport(data).then(res => {
           loading.close()
           let msg = res.data ? '保存成功!' : '保存失败!'
-          let msgType = res.data ? 'success' : 'error'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           this.showMainView = false
           this.loadReport()
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1616,10 +1580,7 @@ export default {
     updateReport() {
       console.log(this.chooseMyReport)
       if (!this.chooseMyReport || !this.chooseMyReport.id) {
-        this.$message({
-          message: '保存失败,请刷新后重试!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '保存失败,请刷新后重试!')
         return
       }
       showPromptWin(this, '保存', '请输入报表名称', this.chooseMyReport.reportTableName, (val) => {
@@ -1643,17 +1604,13 @@ export default {
         updateReportTable(data).then(res => {
           loading.close()
           let msg = res.data ? '保存成功!' : '保存失败!'
-          let msgType = res.data ? 'success' : 'error'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           this.showMainView = false
           this.loadReport()
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1664,10 +1621,7 @@ export default {
     /** 报表下载事件 */
     downloadReportEvent() {
       if (!this.chooseMyReport) {
-        this.$message({
-          message: '请选择报表',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择报表!')
         return
       }
       let reportName = this.chooseMyReport.reportTableName ? this.chooseMyReport.reportTableName : '统计报表'
@@ -1703,7 +1657,7 @@ export default {
         this.reportHistoryTotal = res.data.count
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     getPrintSheetArea() {

+ 4 - 4
chuanyi_client2/src/views/my_report/index_block.vue

@@ -1138,7 +1138,7 @@ export default {
         this.btnType = 'show'
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 修改报表信息 */
@@ -1168,7 +1168,7 @@ export default {
           this.loadReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1189,7 +1189,7 @@ export default {
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1367,7 +1367,7 @@ export default {
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },

+ 78 - 121
chuanyi_client2/src/views/report_template/index.vue

@@ -13,7 +13,7 @@
             <ruler-view ruler-position="vertical"></ruler-view>
           </div>
           <div class="cy-box-main">
-            <el-input type="text" placeholder="请输入报表模板标题" v-model="templateName" maxlength="20" size="mini" show-word-limit></el-input>
+            <el-input type="text" placeholder="请输入报表模板名称" v-model="templateName" maxlength="20" size="mini" show-word-limit></el-input>
             <div id="luckysheet"
                  style="margin:0px;padding:0px;position:relative;height:calc(100% - 40px);width:100%;left: 0px;top: 0px;bottom:0px;">
             </div>
@@ -391,7 +391,7 @@ import {
 } from "@/api/datasource";
 import {
   getLuckysheetConfig,
-  handleTree,
+  handleTree, showAlertMsgWin,
   showAlertWin,
   showLoading, showPromptWin,
   traverseNode,
@@ -687,70 +687,72 @@ export default {
       if (type == 'saveAs') {
         this.templateName = '副本_' + _templateName
         _title = '另存为'
+        showPromptWin(this, _title, '请输入/确认报表模板名称', this.templateName, (val) => {
+          if (!val) {
+            return '模板名称不能为空'
+          }
+          if (val.length > 20) {
+            return '模板名称必须在20字以内'
+          }
+        }, (value) => {
+          this.saveReportTemplateData(type, value, _templateName, _title)
+        }, () => {
+          this.templateName = _templateName
+        })
+        return
       }
-      showPromptWin(this, _title, '请输入/确认报表模板名称', this.templateName, (val) => {
-        if (!val) {
-          return '模板名称不能为空'
-        }
-        if (val.length > 20) {
-          return '模板名称必须在20字以内'
-        }
-      }, (value) => {
-        const loading = showLoading(this, '保存中,请稍候···')
-        let option = JSON.parse(JSON.stringify(this.luckysheetOption))
-        let _data = JSON.parse(getLuckysheetConfig())
-        let excelData = _data[0].data
-        this.withDateData(excelData)
-        this.spliceToolTable()
-        let result = {
-          'charts': this.toolChart,
-          'tables': this.toolTable,
-          'option': option,
-          'data': _data
-        }
-        let data = {
-          'templateName': value,
-          'templateData': JSON.stringify(result)
-        }
-        if (this.templateId && type != 'saveAs') {
-          data.id = this.templateId
-          data.version = this.templateVersion
-          updateReportTemplate(data).then(res => {
-            loading.close()
-            let msg = res.data ? '修改成功!' : '修改失败!'
-            let msgType = res.data ? 'success' : 'error'
-            this.$message({
-              message: msg,
-              type: msgType
-            })
+      if (!this.templateName || this.templateName.length > 20) {
+        showAlertMsgWin(this, null, '模板名称不能为空且必须在20字以内!')
+        return
+      }
+      this.saveReportTemplateData(type, this.templateName, _templateName, _title)
+    },
+    saveReportTemplateData(type, templateName, _templateName, _title) {
+      const loading = showLoading(this, '保存中,请稍候···')
+      let option = JSON.parse(JSON.stringify(this.luckysheetOption))
+      let _data = JSON.parse(getLuckysheetConfig())
+      let excelData = _data[0].data
+      this.withDateData(excelData)
+      this.spliceToolTable()
+      let result = {
+        'charts': this.toolChart,
+        'tables': this.toolTable,
+        'option': option,
+        'data': _data
+      }
+      let data = {
+        'templateName': templateName,
+        'templateData': JSON.stringify(result)
+      }
+      if (this.templateId && type != 'saveAs') {
+        data.id = this.templateId
+        data.version = this.templateVersion
+        updateReportTemplate(data).then(res => {
+          loading.close()
+          let msg = res.data ? '修改成功!' : '修改失败!'
+          showAlertMsgWin(this, null, msg, () => {
             this.resetReport(true)
             this.getTableTemplate(this.$route.query.id, this.$route.query.type)
             this.$emit('refreshReportTemplateData', new Date().getTime())
-          }).catch((e) => {
-            loading.close()
-            this.templateName = _templateName
-            showAlertWin(this, null, e)
-          })
-        } else {
-          saveReportTemplate(data).then(res => {
-            loading.close()
-            let msg = res.data ? '保存成功!' : '保存失败!'
-            let msgType = res.data ? 'success' : 'error'
-            this.$message({
-              message: msg,
-              type: msgType
-            })
-            this.resetReport(true)
-            this.$emit('refreshReportTemplateData', new Date().getTime())
-          }).catch((e) => {
-            loading.close()
-            this.templateName = _templateName
-            showAlertWin(this, null, e)
           })
-        }
-      }, () => {
-        this.templateName = _templateName
-      })
+        }).catch((e) => {
+          loading.close()
+          this.templateName = _templateName
+          showAlertWin(this, null, e)
+        })
+      } else {
+        saveReportTemplate(data).then(res => {
+          loading.close()
+          let msg = res.data ? _title + '成功!' : _title + '失败!'
+          showAlertMsgWin(this, null, msg)
+          this.resetReport(true)
+          this.$emit('refreshReportTemplateData', new Date().getTime())
+        }).catch((e) => {
+          loading.close()
+          this.templateName = _templateName
+          showAlertWin(this, null, e)
+        })
+      }
     },
     /** 重置报表信息 */
     resetReport(clearFlag) {
@@ -791,10 +793,7 @@ export default {
       let _this = this
       const files = evt.target.files
       if (files == null || files.length == 0) {
-        _this.$message({
-          message: '请选择文件',
-          type: 'warning'
-        })
+        showAlertMsgWin(_this, null, '请选择文件!')
         return
       }
       console.log(files)
@@ -804,10 +803,7 @@ export default {
       let suffixArr = name.split("."),
           suffix = suffixArr[suffixArr.length - 1]
       if (suffix != 'xlsx') {
-        _this.$message({
-          message: '只能导入xlsx格式文件!',
-          type: 'warning'
-        })
+        showAlertMsgWin(_this, null, '只能导入xlsx格式文件!')
         return
       }
       const loading = showLoading(this, '文件导入中,请稍候···')
@@ -815,10 +811,7 @@ export default {
       LuckyExcel.transformExcelToLucky(files[0], function (exportJson, luckysheetfile) {
         if (exportJson.sheets == null || exportJson.sheets.length == 0) {
           loading.close()
-          _this.$message({
-            message: '无法读取excel文件的内容,当前不支持xls文件!',
-            type: 'warning'
-          })
+          showAlertMsgWin(_this, null, '无法读取excel文件的内容,当前不支持xls文件!')
           return
         }
         console.log('exportJson', exportJson)
@@ -927,10 +920,7 @@ export default {
     addDataItem() {
       let id = this.chooseDataGroup
       if (!id) {
-        this.$message({
-          message: '请选择数据组!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据组!')
         return
       }
       this.isSelectAllItem = false
@@ -963,10 +953,7 @@ export default {
     chooseItemTreeEvent() {
       let checkedNodes = this.$refs.itemTree.getCheckedNodes(false, true)
       if (checkedNodes.length == 0) {
-        this.$message({
-          message: '请选择数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据项!')
         return
       }
       let chooseList = []
@@ -1042,10 +1029,7 @@ export default {
     /** 保存数据模型事件 */
     saveDataModelEvent() {
       if (!this.chooseDataModel) {
-        this.$message({
-          message: '请选择表达式!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择表达式!')
         return
       }
       let item = {}
@@ -1147,10 +1131,7 @@ export default {
     commReportEvent(flag) {
       let _this = this
       if (!_this.commTemplate) {
-        _this.$message({
-          message: '请选择模板!',
-          type: 'warning'
-        })
+        showAlertMsgWin(_this, null, '请选择模板!')
         return
       }
       const loading = showLoading(_this, '加载中,请稍候···')
@@ -1186,10 +1167,7 @@ export default {
     dataEvent(type) {
       let rangeWithFlatten = luckysheet.getRangeWithFlatten()
       if (!rangeWithFlatten || rangeWithFlatten.length != 1) {
-        this.$message({
-          message: '请选择一项单元格!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择一项单元格!')
         return
       }
       // 基础数据项
@@ -1222,10 +1200,7 @@ export default {
     /** 基础数据项插入 */
     baseItemEvent(flag) {
       if (!this.chooseBaseData) {
-        this.$message({
-          message: '请选择基础数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择基础数据项!')
         return
       }
       let rangeWithFlatten = luckysheet.getRangeWithFlatten()
@@ -1237,10 +1212,7 @@ export default {
     /** 动态数据项插入 */
     itemEvent(flag) {
       if (this.chooseGroupItemList.length == 0) {
-        this.$message({
-          message: '请选择数据组项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据组项!')
         return
       }
       let rangeWithFlatten = luckysheet.getRangeWithFlatten()
@@ -1318,10 +1290,7 @@ export default {
       // 当前选择范围
       let rangeWithFlatten = luckysheet.getRangeWithFlatten()
       if (!rangeWithFlatten || rangeWithFlatten.length <= 1) {
-        _this.$message({
-          message: '请选择多项单元格!',
-          type: 'warning'
-        })
+        showAlertMsgWin(_this, null, '请选择多项单元格!')
         return
       }
       this.chooseDataGroup = null
@@ -1343,32 +1312,20 @@ export default {
     /** 柱状图图表插入 */
     insertBarChartForm(flag) {
       if (this.barChartForm.showTitle == '1' && !this.barChartForm.title) {
-        this.$message({
-          message: '标题不能为空!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '标题不能为空!')
         return
       }
       if (!this.chooseDataGroup) {
-        this.$message({
-          message: '请选择数据组!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据组!')
         return
       }
       if (this.chooseItemData.length == 0) {
-        this.$message({
-          message: '请选择数据组项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择数据组项!')
         return
       }
       if ((this.barChartForm.legendType == '0' && this.chooseItemData.length > 1)
           || (this.barChartForm.type == 'pie' && this.chooseItemData.length > 1)) {
-        this.$message({
-          message: '请选择一项数据项!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择一项数据项!')
         return
       }
       // 图表参数

+ 38 - 89
chuanyi_client2/src/views/run_config/index.vue

@@ -528,7 +528,7 @@ import BreadcrumbView from '@/components/BreadcrumbView'
 import {
   customCompare,
   getLuckysheetConfig,
-  getNowFormatDate,
+  getNowFormatDate, showAlertMsgWin,
   showAlertWin, showConfirmWin,
   showLoading, showPromptWin
 } from '@/utils/cqcy'
@@ -878,17 +878,11 @@ export default {
     chooseCronEvent() {
       this.cronVal = this.getCron()
       if (!this.cronVal) {
-        this.$message({
-          message: '请指定定时任务类型或运行时间!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请指定定时任务类型或运行时间!')
         return
       }
       if (!this.validCron(this.cronVal)) {
-        this.$message({
-          message: '定时任务表达式格式不正确,请检查!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '定时任务表达式格式不正确!')
         return
       }
       const loading = showLoading(this, '请稍候···')
@@ -903,7 +897,7 @@ export default {
         this.loadReport()
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     resetRadioVal() {
@@ -918,10 +912,8 @@ export default {
     },
     chooseReportTypeEvent() {
       if (!this.reportType) {
-        this.$message({
-          message: '请选择报表类型!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择报表类型!')
+        return
       }
       // 自动报表
       if (this.reportType == '1') {
@@ -931,7 +923,7 @@ export default {
           this.cronVal = res.data.cron
           this.analysisCron()
         }).catch((e) => {
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
         return
       }
@@ -946,7 +938,7 @@ export default {
         this.loadReport()
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     switchChangeEvent(val, data) {
@@ -958,7 +950,7 @@ export default {
           this.cronVal = res.data.cron
           this.analysisCron()
         }).catch((e) => {
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
         return
       }
@@ -998,10 +990,7 @@ export default {
           getTableTemplateById(this.reportForm.reportTemplate).then(res => {
             if (!res.data) {
               loading.close()
-              this.$message({
-                message: '选择的报表模板不存在!',
-                type: 'warning'
-              })
+              showAlertMsgWin(this, null, '选择的报表模板不存在!')
               return
             }
             this.showMainView = true
@@ -1019,7 +1008,7 @@ export default {
             })
           }).catch((e) => {
             loading.close()
-            showAlertWin(this, e)
+            showAlertWin(this, null, e)
           })
         }
       })
@@ -1032,10 +1021,7 @@ export default {
       getDataModelById(this.reportForm.operationRule).then(res => {
         loading.close()
         if (!res.data) {
-          this.$message({
-            message: '选择的四则运算表达式不存在!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '选择的四则运算表达式不存在!')
           return
         }
         let luckyData = JSON.parse(reportData.templateData)
@@ -1044,7 +1030,7 @@ export default {
         this.dialogReportTemplateVisible = false
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 绘制 Excel 表 */
@@ -1087,7 +1073,7 @@ export default {
         if (callback) callback(res.data)
       }).catch((e) => {
         if (callback) callback([])
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 获取表格数据 */
@@ -1100,7 +1086,7 @@ export default {
         if (callback) callback(res.data)
       }).catch((e) => {
         if (callback) callback([])
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 向 Excel 插入表格 */
@@ -1294,7 +1280,7 @@ export default {
         this.reportTemplateList = res.data.tableTemplateList
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 查询所有数据模型 */
@@ -1309,7 +1295,7 @@ export default {
         }
         this.dataModelList = res.data.dataModelList
       }).catch((e) => {
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 查询我的报表列表 */
@@ -1335,16 +1321,13 @@ export default {
         this.reportDataList = res.data.reportTableList
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 设置用户组信息 */
     setUserGroupEvent(data) {
       if (data.userId != this.uid) {
-        this.$message({
-          message: '您没有权限进行设置!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '您没有权限进行设置!')
         return
       }
       this.reportId = data.id
@@ -1362,16 +1345,13 @@ export default {
           }
         })
       }).catch((e) => {
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     getUserGroupEvent(data) {
       this.groupUserData = []
       if (!data.userGroupList || data.userGroupList.length == 0) {
-        this.$message({
-          message: '该报表还未进行授权操作!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '该报表还未进行授权操作!')
         return
       }
       let _this = this
@@ -1385,7 +1365,7 @@ export default {
             })
           })
         }).catch((e) => {
-          showAlertWin(_this, e)
+          showAlertWin(_this, null, e)
         })
       })
       this.dialogGroupUserVisible = true
@@ -1409,16 +1389,13 @@ export default {
       }
       tableAssignUserById(params).then(res => {
         if (this.hasUserGroup || this.userGroupInfo) {
-          this.$message({
-            message: '保存成功!',
-            type: 'success'
-          })
+          showAlertMsgWin(this, null, '保存成功!')
           this.hasUserGroup = false
         }
         this.dialogClose()
         this.loadReport()
       }).catch((e) => {
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 处理自动报表数据信息 */
@@ -1473,10 +1450,7 @@ export default {
       getReportTableById(data.id).then(res => {
         loading.close()
         if (!res.data) {
-          this.$message({
-            message: '选择的报表不存在!',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '选择的报表不存在!')
           return
         }
         this.showMainView = true
@@ -1501,7 +1475,7 @@ export default {
         this.setLuckysheetStatus(luckyData, type === 'history' || type === 'deny', type)
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     /** 设置工作表状态 */
@@ -1645,16 +1619,12 @@ export default {
         updateTableNameById(params).then(res => {
           loading.close()
           let msg = res.data ? '修改成功!' : '修改失败!'
-          let msgType = res.data ? 'success' : 'warning'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           this.reportPage = 1
           this.loadReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1665,11 +1635,7 @@ export default {
         delReportTableById(data.id).then(res => {
           loading.close()
           let msg = res.data ? '删除成功!' : '删除失败!'
-          let msgType = res.data ? 'success' : 'warning'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           if (type == 'record') {
             this.reportHistoryPage = 1
             this.historyReport()
@@ -1680,7 +1646,7 @@ export default {
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1832,10 +1798,7 @@ export default {
         }
       }, (value) => {
         if (!this.chooseReportTemplate) {
-          this.$message({
-            message: '请重新选择报表模板',
-            type: 'warning'
-          })
+          showAlertMsgWin(this, null, '请重新选择报表模板!')
           return
         }
         const loading = showLoading(this, '保存中,请稍候···')
@@ -1859,17 +1822,13 @@ export default {
         saveReport(data).then(res => {
           loading.close()
           let msg = res.data ? '保存成功!' : '保存失败!'
-          let msgType = res.data ? 'success' : 'error'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           this.showMainView = false
           this.loadReport()
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1877,10 +1836,7 @@ export default {
     updateReport() {
       console.log(this.chooseMyReport)
       if (!this.chooseMyReport || !this.chooseMyReport.id) {
-        this.$message({
-          message: '保存失败,请刷新后重试!',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '保存失败,请刷新后重试!')
         return
       }
       showPromptWin(this, '保存', '请输入报表名称', this.chooseMyReport.reportTableName, (val) => {
@@ -1910,17 +1866,13 @@ export default {
         updateReportTable(data).then(res => {
           loading.close()
           let msg = res.data ? '保存成功!' : '保存失败!'
-          let msgType = res.data ? 'success' : 'error'
-          this.$message({
-            message: msg,
-            type: msgType
-          })
+          showAlertMsgWin(this, null, msg)
           this.showMainView = false
           this.loadReport()
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          showAlertWin(this, e)
+          showAlertWin(this, null, e)
         })
       })
     },
@@ -1931,10 +1883,7 @@ export default {
     /** 报表下载事件 */
     downloadReportEvent() {
       if (!this.chooseMyReport) {
-        this.$message({
-          message: '请选择报表',
-          type: 'warning'
-        })
+        showAlertMsgWin(this, null, '请选择报表!')
         return
       }
       let reportName = this.chooseMyReport.reportTableName ? this.chooseMyReport.reportTableName : '统计报表'
@@ -1970,7 +1919,7 @@ export default {
         this.reportHistoryTotal = res.data.count
       }).catch((e) => {
         loading.close()
-        showAlertWin(this, e)
+        showAlertWin(this, null, e)
       })
     },
     getPrintSheetArea() {

+ 4 - 13
chuanyi_client2/src/views/user_group/index.vue

@@ -104,7 +104,7 @@
 
 <script>
 import BreadcrumbView from '@/components/BreadcrumbView'
-import {customCompare, showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
+import {customCompare, showAlertMsgWin, showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
 import {
   addUserGroup,
   delUserGroupById,
@@ -203,10 +203,7 @@ export default {
         const loading = showLoading(this, '删除中,请稍候···')
         delUserGroupById(row.id).then(res => {
           loading.close()
-          this.$message({
-            message: '删除成功!',
-            type: 'success'
-          })
+          showAlertMsgWin(this, null, '删除成功!')
           this.getAllUserGroup()
         }).catch((e) => {
           loading.close()
@@ -303,10 +300,7 @@ export default {
           if (this.userGroupForm.id) {
             updateUserGroup(this.userGroupForm).then(res => {
               loading.close()
-              this.$message({
-                message: '修改成功!',
-                type: 'success'
-              })
+              showAlertMsgWin(this, null, '修改成功!')
               this.dialogAddUserGroup = false
               this.userGroupForm.id = null
               this.$refs['userGroupForm'].resetFields()
@@ -319,10 +313,7 @@ export default {
           }
           addUserGroup(this.userGroupForm).then(res => {
             loading.close()
-            this.$message({
-              message: '保存成功!',
-              type: 'success'
-            })
+            showAlertMsgWin(this, null, '保存成功!')
             this.dialogAddUserGroup = false
             this.$refs['userGroupForm'].resetFields()
             this.getAllUserGroup()