Selaa lähdekoodia

添加请求提示信息

FinalYu 2 vuotta sitten
vanhempi
commit
58a60542af

+ 25 - 51
chuanyi_client2/src/components/HeaderMain/index.vue

@@ -364,17 +364,14 @@
 
 <script>
 import {
-  delDataSourceById,
   delItemGroupById, delTableTemplateById, getAllDataModel,
   getAllDataSource,
   getAllItemGroup, getAllTableTemplate,
   getDataSourceItemTree, getItemGroupById,
-  saveOrUpdateDataSource,
-  saveOrUpdateItemGroup, saveReportTemplate
+  saveOrUpdateItemGroup
 } from "@/api/datasource";
 import {getDictByKey} from "@/api/basic";
-import {deepTreeFilter, deepTreeKey, showLoading} from "@/utils/cqcy";
-import errorCode from "@/utils/errorCode";
+import {deepTreeFilter, deepTreeKey, showAlertWin, showLoading} from "@/utils/cqcy";
 
 export default {
   name: "HeaderMain",
@@ -633,6 +630,7 @@ export default {
         resolve(dataList)
       }).catch((e) => {
         resolve([])
+        showAlertWin(this, e)
       })
     },
     /** 懒加载查询组配置文件:组配置列表 */
@@ -646,6 +644,7 @@ export default {
           sessionStorage.setItem('GROUP_LIST', JSON.stringify(res.data))
         }).catch((e) => {
           resolve([])
+          showAlertWin(this, e)
         })
       } else {
         getItemGroupById(node.data.id).then(res => {
@@ -660,6 +659,7 @@ export default {
           resolve(arr)
         }).catch((e) => {
           resolve([])
+          showAlertWin(this, e)
         })
       }
     },
@@ -749,20 +749,17 @@ export default {
       saveOrUpdateItemGroup(params).then(res => {
         loading.close()
         if (res.data) {
-          this.$alert(type + '成功!', errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-              this.handleCancel()
-              this.chooseItemDataList = []
-              this.chooseItemDataListF = []
-              this.leavesChooseList = []
-              this.chooseItemDataView = false
-              // 刷新组列表
-              this.refreshGroupData()
-              // 刷新右侧数据
-              sessionStorage.setItem('GROUP_ID', params.id)
-              this.gotoPageByName('/groupItem')
-            }
+          showAlertWin(this, type + '成功!', (action) => {
+            this.handleCancel()
+            this.chooseItemDataList = []
+            this.chooseItemDataListF = []
+            this.leavesChooseList = []
+            this.chooseItemDataView = false
+            // 刷新组列表
+            this.refreshGroupData()
+            // 刷新右侧数据
+            sessionStorage.setItem('GROUP_ID', params.id)
+            this.gotoPageByName('/groupItem')
           })
           return
         }
@@ -772,11 +769,7 @@ export default {
         })
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 更新组信息 */
@@ -819,11 +812,7 @@ export default {
         }
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 更新组项信息 */
@@ -842,11 +831,7 @@ export default {
         this.getChooseItemData(item)
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 选择的数据项值初始化 */
@@ -897,11 +882,7 @@ export default {
           })
         }).catch((e) => {
           loading.close()
-          _this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch(() => {
       })
@@ -954,7 +935,7 @@ export default {
       getAllDataSource().then(res => {
         this.dataSourceList = res.data
       }).catch((e) => {
-        console.error(e)
+        showAlertWin(this, e)
       })
     },
     /** 查询字典表:读取模式 */
@@ -964,7 +945,7 @@ export default {
       }).then(res => {
         this.readModeList = res.data
       }).catch((e) => {
-        console.error(e)
+        showAlertWin(this, e)
       })
     },
     /** 添加数据项 */
@@ -1005,11 +986,7 @@ export default {
         this.dataItemDialogVisible = true
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 数据项点击事件 */
@@ -1284,6 +1261,7 @@ export default {
         })
       }).catch((e) => {
         loading.close()
+        showAlertWin(this, e)
       })
     },
     /** 保存数据模型事件 */
@@ -1386,11 +1364,7 @@ export default {
           // node.parent.expand()
         }).catch((e) => {
           loading.close()
-          this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch(() => {
       })

+ 3 - 12
chuanyi_client2/src/components/HeaderPersonal/index.vue

@@ -119,9 +119,8 @@ import {mapGetters} from 'vuex'
 import {updatePwd} from '@/api/user'
 import {getPubKey} from '@/utils/auth'
 import {encrypt} from '@/utils/jsencrypt'
-import {showLoading} from '@/utils/cqcy'
+import {showAlertWin, showLoading} from '@/utils/cqcy'
 import {getAllMessageNotice} from "@/api/basic";
-import errorCode from "@/utils/errorCode";
 
 let pkg = require('../../../package.json')
 
@@ -245,11 +244,7 @@ export default {
             this.dialogClose()
           }).catch((e) => {
             loading.close()
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
           })
         }
       })
@@ -282,11 +277,7 @@ export default {
         this.tableNoticeData = res.data.messageNoticeList
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /**

+ 11 - 40
chuanyi_client2/src/components/LeftMenu/index.vue

@@ -175,10 +175,9 @@ import {
   saveOrUpdateDataSource,
   testConnect
 } from "@/api/datasource";
-import {showLoading} from "@/utils/cqcy";
+import {showAlertWin, showLoading} from "@/utils/cqcy";
 import {encrypt} from "@/utils/jsencrypt";
 import {getPubKey} from "@/utils/auth";
-import errorCode from "@/utils/errorCode";
 
 export default {
   name: "LeftMenu",
@@ -358,11 +357,7 @@ export default {
           this.resetAllDataSource()
         }).catch((e) => {
           loading.close()
-          _this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(_this, e)
         })
       }).catch(() => {
       })
@@ -563,25 +558,13 @@ export default {
       testConnect(params).then(res => {
         loading.close()
         if (res.data) {
-          this.$alert('连接成功!', errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, '连接成功!')
           return
         }
-        this.$alert(res.msg, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, res.msg)
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 保存连接 */
@@ -590,12 +573,8 @@ export default {
       saveOrUpdateDataSource(params).then(res => {
         loading.close()
         if (res.data) {
-          this.$alert('保存成功!', errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-              // this.handleCancel()
-              this.resetAllDataSource()
-            }
+          showAlertWin(this, '保存成功!', (action) => {
+            this.resetAllDataSource()
           })
           return
         }
@@ -605,11 +584,7 @@ export default {
         })
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 获取左侧数据源类型列表 */
@@ -620,7 +595,7 @@ export default {
         loading.close()
       }).catch((e) => {
         loading.close()
-        console.error(e)
+        showAlertWin(this, e)
       })
     },
     /** 获取右侧数据源类型列表 */
@@ -631,7 +606,7 @@ export default {
         loading.close()
       }).catch((e) => {
         loading.close()
-        console.error(e)
+        showAlertWin(this, e)
       })
     },
     /** 获取驱动 */
@@ -658,11 +633,7 @@ export default {
             })
           }).catch((e) => {
             loading.close()
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
           })
         }
       })

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

@@ -1,3 +1,5 @@
+import errorCode from "@/utils/errorCode";
+
 /**
  * 通用js方法封装处理
  */
@@ -363,4 +365,18 @@ export function deepTreeKey(list, key) {
             item[key] = true
         }
     })
+}
+
+/**
+ * 显示alert弹出层
+ * @param _this
+ * @param e
+ */
+export function showAlertWin(_this, e, callback) {
+    _this.$alert(e, errorCode[100], {
+        confirmButtonText: '确定',
+        callback: action => {
+            if (callback) callback(action)
+        }
+    })
 }

+ 9 - 40
chuanyi_client2/src/views/data_model/index.vue

@@ -95,16 +95,14 @@
 
 <script>
 import BreadcrumbView from '@/components/BreadcrumbView'
-import { showLoading } from '@/utils/cqcy'
+import {showAlertWin, showLoading} from '@/utils/cqcy'
 import {
   addDataModel,
   delDataModelById,
   getAllDataModel, getDataModelById,
   testDataModelById,
-  updateDataModel,
-  updateItemDescribe
+  updateDataModel
 } from "@/api/datasource";
-import errorCode from "@/utils/errorCode";
 
 export default {
   name: "index",
@@ -194,11 +192,7 @@ export default {
         this.dialogDataModelVisible = true
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 测试数据模型值 */
@@ -228,18 +222,10 @@ export default {
           bds = bds.replaceAll(/calcVal/g, value)
           bds += '='
           bds += res.data
-          this.$alert(bds, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, bds)
         }).catch((e) => {
           loading.close()
-          this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch(() => {
       })
@@ -263,11 +249,7 @@ export default {
           this.getAllDataModel()
         }).catch((e) => {
           loading.close()
-          this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch(() => {
       })
@@ -290,11 +272,7 @@ export default {
               this.getAllDataModel()
             }).catch((e) => {
               loading.close()
-              this.$alert(e, errorCode[100], {
-                confirmButtonText: '确定',
-                callback: action => {
-                }
-              })
+              showAlertWin(this, e)
             })
            return
           }
@@ -309,11 +287,7 @@ export default {
             this.getAllDataModel()
           }).catch((e) => {
             loading.close()
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
           })
         }
       })
@@ -356,13 +330,8 @@ export default {
         this.tableTotal = res.data.count
         this.tableData = res.data.dataModelList
       }).catch((e) => {
-        console.log(e)
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 弹出层关闭事件 */

+ 5 - 7
chuanyi_client2/src/views/group_item/index.vue

@@ -81,8 +81,7 @@
 
 <script>
 import {getItemGroupById, getItemValueById, updateItemDescribe} from "@/api/datasource";
-import {showLoading} from "@/utils/cqcy";
-import errorCode from "@/utils/errorCode";
+import {showAlertWin, showLoading} from "@/utils/cqcy";
 
 export default {
   name: "index",
@@ -166,6 +165,7 @@ export default {
         }
         this.itemDataListF = JSON.parse(JSON.stringify(this.itemDataList))
       }).catch((e) => {
+        showAlertWin(this, e)
       })
       let temp = setInterval(() => {
         getItemValueById(this.chooseGroup.id).then(res => {
@@ -177,6 +177,7 @@ export default {
           }
           this.itemDataListF = JSON.parse(JSON.stringify(this.itemDataList))
         }).catch((e) => {
+          showAlertWin(this, e)
         })
       }, 5 * 1000)
       this.timeInterval = temp
@@ -203,11 +204,7 @@ export default {
         this.itemDataListF = JSON.parse(JSON.stringify(this.itemDataList))
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 编辑 */
@@ -247,6 +244,7 @@ export default {
           })
           this.getGroupById(this.chooseGroupId)
         }).catch((e) => {
+          showAlertWin(this, e)
         })
       }).catch(() => {
       })

+ 2 - 6
chuanyi_client2/src/views/login.vue

@@ -70,7 +70,7 @@
 import errorCode from '@/utils/errorCode'
 import {getCode} from '@/api/user'
 import {Message} from 'element-ui'
-import {testHost} from '@/utils/cqcy'
+import {showAlertWin, testHost} from '@/utils/cqcy'
 
 export default {
   name: "Login",
@@ -181,11 +181,7 @@ export default {
             this.$router.push({path: this.redirect || '/', query: {}})
             this.loading = false
           }).catch((e) => {
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
             this.loading = false
             if (this.captchaEnabled) {
               this.getCode()

+ 18 - 55
chuanyi_client2/src/views/my_report/index.vue

@@ -3,7 +3,7 @@
     <breadcrumb-view :breadcrumbList="breadcrumbList" :show-index="false"></breadcrumb-view>
     <div v-if="btnType != 'show' && btnType != 'add'" class="cy-nav-sx">
       <el-select v-model="searchValue"
-                 style="width: 180px;"
+                 style="width: 280px;"
                  placeholder="请选择报表类型"
                  @change="changeReportTypeEvent">
         <el-option v-for="item in reportOptions"
@@ -221,7 +221,7 @@
 
 <script>
 import BreadcrumbView from '@/components/BreadcrumbView'
-import {getNowFormatDate, showLoading} from '@/utils/cqcy'
+import {getNowFormatDate, showAlertWin, showLoading} from '@/utils/cqcy'
 import {
   delReportTableById,
   getAllDataModel, getAllOkReportTable,
@@ -238,7 +238,6 @@ import {getUsername} from '@/utils/auth'
 import {exportExcel} from '@/utils/export'
 import {getAllUserGroup} from "@/api/user";
 import {mapGetters} from "vuex";
-import errorCode from "@/utils/errorCode";
 
 export default {
   name: "index",
@@ -433,11 +432,7 @@ export default {
         this.loadReport()
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     switchChangeEvent(val, data) {
@@ -447,7 +442,7 @@ export default {
         getReportTableById(data.id).then(res => {
           this.cronVal = res.data.cron
         }).catch((e) => {
-          console.log(e)
+          showAlertWin(this, e)
         })
         return
       }
@@ -461,11 +456,7 @@ export default {
         this.loadReport()
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 新增报表 */
@@ -503,13 +494,8 @@ export default {
               this.breadcrumbList = ['新增报表']
             })
           }).catch((e) => {
-            console.log(e)
             loading.close()
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
           })
         }
       })
@@ -534,11 +520,7 @@ export default {
         this.dialogReportTemplateVisible = false
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 绘制 Excel 表 */
@@ -572,6 +554,7 @@ export default {
         if (callback) callback(res.data)
       }).catch((e) => {
         if (callback) callback([])
+        showAlertWin(this, e)
       })
     },
     /** 获取表格数据 */
@@ -584,6 +567,7 @@ export default {
         if (callback) callback(res.data)
       }).catch((e) => {
         if (callback) callback([])
+        showAlertWin(this, e)
       })
     },
     /** 向 Excel 插入表格 */
@@ -764,11 +748,7 @@ export default {
         this.reportTemplateList = res.data.tableTemplateList
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 查询所有数据模型 */
@@ -783,6 +763,7 @@ export default {
         }
         this.dataModelList = res.data.dataModelList
       }).catch((e) => {
+        showAlertWin(this, e)
       })
     },
     /** 查询我的报表列表 */
@@ -808,11 +789,7 @@ export default {
         this.reportDataList = res.data.reportTableList
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 设置用户组信息 */
@@ -835,6 +812,7 @@ export default {
           }
         })
       }).catch((e) => {
+        showAlertWin(this, e)
       })
     },
     chooseUserGroupEvent() {
@@ -859,6 +837,7 @@ export default {
         this.dialogClose()
         this.loadReport()
       }).catch((e) => {
+        showAlertWin(this, e)
       })
     },
     /** 处理自动报表数据信息 */
@@ -991,11 +970,7 @@ export default {
         this.btnType = 'show'
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 修改报表信息 */
@@ -1032,11 +1007,7 @@ export default {
           this.loadReport()
         }).catch((e) => {
           loading.close()
-          this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch((e) => {
         console.log(e)
@@ -1064,11 +1035,7 @@ export default {
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch(() => {
       })
@@ -1252,11 +1219,7 @@ export default {
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch((e) => {
         console.log(e)

+ 12 - 39
chuanyi_client2/src/views/report_template/index.vue

@@ -412,15 +412,14 @@ import RulerView from '@/components/RulerView'
 import { insertEChart } from 'luckytool'
 import {
   getAllDataModel,
-  getAllItemGroup, getAllTableTemplate, getItemGroupById, getSysTableTemplate, getSysTableTemplateById,
+  getAllItemGroup, getSysTableTemplate, getSysTableTemplateById,
   getTableItemGroupById,
   getTableTemplateById,
   saveReportTemplate,
   updateReportTemplate
 } from "@/api/datasource";
-import {handleTree, showLoading, traverseNode, traverseVisible} from "@/utils/cqcy";
+import {handleTree, showAlertWin, showLoading, traverseNode, traverseVisible} from "@/utils/cqcy";
 import {getDictByKey} from "@/api/basic";
-import errorCode from "@/utils/errorCode";
 
 export default {
   name: 'index',
@@ -686,11 +685,7 @@ export default {
             this.$emit('refreshReportTemplateData', true)
           }).catch((e) => {
             loading.close()
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
           })
         } else {
           saveReportTemplate(data).then(res => {
@@ -705,11 +700,7 @@ export default {
             this.$emit('refreshReportTemplateData', true)
           }).catch((e) => {
             loading.close()
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
           })
         }
       }).catch(() => {
@@ -814,11 +805,7 @@ export default {
       getAllItemGroup().then(res => {
         this.dataGroupList = res.data
       }).catch((e) => {
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 选择数据源值改变事件 */
@@ -862,11 +849,7 @@ export default {
         this.dialogDataItemVisible = true
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 选择的数据项:第一步 */
@@ -940,11 +923,7 @@ export default {
         }
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 选择数据模型 */
@@ -993,6 +972,7 @@ export default {
         this.dialogCommReportVisible = true
         this.handleReportTypeChange([-1])
       }).catch((e) => {
+        showAlertWin(this, e)
       })
     },
     clickCascader() {
@@ -1053,11 +1033,7 @@ export default {
         }
         this.commTemplateList = res.data
       }).catch((e) => {
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 选择模板报表 */
@@ -1091,11 +1067,7 @@ export default {
         luckysheet.create(option)
       }).catch((e) => {
         loading.close()
-        _this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(_this, e)
       })
     },
     /** 数据项 */
@@ -1132,7 +1104,7 @@ export default {
         this.dialogBaseDataVisible = true
         this.baseDataList = res.data
       }).catch((e) => {
-        console.error(e)
+        showAlertWin(this, e)
       })
     },
     /** 基础数据项插入 */
@@ -1468,6 +1440,7 @@ export default {
           this.insertEChartTool(this.toolChart[i].info, false)
         }
       }).catch((e) => {
+        showAlertWin(this, e)
       })
     },
     /** 数据值显示类型事件 */

+ 5 - 17
chuanyi_client2/src/views/run_config/index.vue

@@ -60,8 +60,7 @@
 <script>
 import BreadcrumbView from '@/components/BreadcrumbView'
 import {getAllItemGroup, getItemGroupById, getItemValueById, runGroupById} from "@/api/datasource";
-import {showLoading} from "@/utils/cqcy";
-import errorCode from "@/utils/errorCode";
+import {showAlertWin, showLoading} from "@/utils/cqcy";
 
 export default {
   name: "index",
@@ -105,11 +104,7 @@ export default {
         this.groupDataList = res.data
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 根据ID查询组信息 */
@@ -130,11 +125,7 @@ export default {
         this.itemDataList = res.data.itemList
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 修改数据状态 */
@@ -171,11 +162,7 @@ export default {
         })
       }).catch((e) => {
         loading.close()
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 运行事件 */
@@ -199,6 +186,7 @@ export default {
         getItemValueById(this.chooseGroupId).then(res => {
           this.itemDataList = res.data
         }).catch((e) => {
+          showAlertWin(this, e)
         })
       }, this.chooseGroup.modeValue * 1000)
       this.timeInterval = temp

+ 8 - 23
chuanyi_client2/src/views/user_group/index.vue

@@ -98,7 +98,7 @@
 
 <script>
 import BreadcrumbView from '@/components/BreadcrumbView'
-import {showLoading} from "@/utils/cqcy";
+import {showAlertWin, showLoading} from "@/utils/cqcy";
 import {
   addUserGroup,
   delUserGroupById,
@@ -107,7 +107,6 @@ import {
   getDepartmentTree, getUserByGroupId,
   updateUserGroup
 } from "@/api/user";
-import errorCode from "@/utils/errorCode";
 
 export default {
   name: 'index',
@@ -183,6 +182,7 @@ export default {
         this.dialogAddUserGroup = true
       }).catch((e) => {
         this.dialogAddUserGroup = true
+        showAlertWin(this, e)
       })
     },
     /** 删除 */
@@ -203,11 +203,7 @@ export default {
           this.getAllUserGroup()
         }).catch((e) => {
           loading.close()
-          this.$alert(e, errorCode[100], {
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          })
+          showAlertWin(this, e)
         })
       }).catch(() => {
       })
@@ -256,6 +252,7 @@ export default {
           this.updateChooseUserInfo(userIdList[i], true)
         }
       }).catch((e) => {
+        showAlertWin(this, e)
       })
     },
     /** 选择用户事件 */
@@ -276,6 +273,7 @@ export default {
         }
         this.departments = res.data
       }).catch((e) => {
+        showAlertWin(this, e)
       })
     },
     /** 获取用户组 */
@@ -288,12 +286,7 @@ export default {
           this.groupDataList = res.data
         })
       }).catch((e) => {
-        console.log(e)
-        this.$alert(e, errorCode[100], {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
+        showAlertWin(this, e)
       })
     },
     /** 添加用户组 */
@@ -314,11 +307,7 @@ export default {
               this.getAllUserGroup()
             }).catch((e) => {
               loading.close()
-              this.$alert(e, errorCode[100], {
-                confirmButtonText: '确定',
-                callback: action => {
-                }
-              })
+              showAlertWin(this, e)
             })
             return
           }
@@ -333,11 +322,7 @@ export default {
             this.getAllUserGroup()
           }).catch((e) => {
             loading.close()
-            this.$alert(e, errorCode[100], {
-              confirmButtonText: '确定',
-              callback: action => {
-              }
-            })
+            showAlertWin(this, e)
           })
         }
       })