FinalYu 2 vuotta sitten
vanhempi
commit
a77300e23b

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

@@ -66,7 +66,7 @@
     <ul v-show="visibleGroupMenu"
         :style="{ left: menuLeft + 'px', top: menuTop + 'px' }"
         class="contextmenu contextmenu-black">
-      <li @click="createGroupEvent">添加组</li>
+      <li @click="createGroupEvent">添加数据组</li>
     </ul>
 
     <!-- 数据组列表右键操作 -->
@@ -361,7 +361,7 @@ export default {
   name: "HeaderMain",
   data() {
     return {
-      groupDialogTitle: '添加组',
+      groupDialogTitle: '添加数据组',
       groupDialogVisible: false,
       dataItemDialogTitle: '选择数据项',
       dataItemDialogVisible: false,
@@ -642,6 +642,7 @@ export default {
     },
     /** 添加数据组事件 */
     createGroupEvent() {
+      this.groupDialogTitle = '添加数据组'
       this.closeMenu()
       this.currTabs = 'base-setting'
       this.groupBasicForm = {
@@ -722,8 +723,10 @@ export default {
         })
         return
       }
+      const loading = showLoading(this, '加载中,请稍候···')
       this.chooseItemDataList = []
       getItemGroupById(id).then(res => {
+        loading.close()
         this.createGroupEvent()
         let item = res.data
         this.updateGroupData = item
@@ -734,11 +737,18 @@ export default {
         this.groupBasicForm.itemList = item.itemList
         this.getChooseItemData(item)
         this.chooseItemDataView = true
+        this.groupDialogTitle = '修改数据组'
         this.groupRateForm.readMode = item.readMode + ''
         this.groupRateForm.modeValue = item.modeValue
         this.groupRateForm.valueMode = item.valueCondition + ''
         this.groupRateForm.valuePeriod = [item.startReadTime, item.endReadTime]
       }).catch((e) => {
+        loading.close()
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 选择的数据项值初始化 */
@@ -785,9 +795,10 @@ export default {
           })
         }).catch((e) => {
           loading.close()
-          _this.$message({
-            message: '删除失败!',
-            type: 'error'
+          _this.$alert(e, '删除失败!', {
+            confirmButtonText: '确定',
+            callback: action => {
+            }
           })
         })
       }).catch(() => {
@@ -875,10 +886,10 @@ export default {
         this.dataItemDialogVisible = true
       }).catch((e) => {
         loading.close()
-        console.error(e)
-        this.$message({
-          message: '连接失败!',
-          type: 'error'
+        this.$alert(e, '连接失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },
@@ -1197,6 +1208,11 @@ export default {
           // node.parent.expand()
         }).catch((e) => {
           loading.close()
+          this.$alert(e, '删除失败!', {
+            confirmButtonText: '确定',
+            callback: action => {
+            }
+          })
         })
       }).catch(() => {
       })

+ 0 - 1
chuanyi_client2/src/components/LeftMenu/index.vue

@@ -636,7 +636,6 @@ export default {
             })
           }).catch((e) => {
             loading.close()
-            console.error(e)
             this.$alert(e, '驱动获取失败!', {
               confirmButtonText: '确定',
               callback: action => {

+ 18 - 10
chuanyi_client2/src/views/data_model/index.vue

@@ -184,6 +184,11 @@ export default {
         this.dialogDataModelVisible = true
       }).catch((e) => {
         loading.close()
+        this.$alert(e, '操作失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 测试数据模型值 */
@@ -194,7 +199,7 @@ export default {
         customClass: 'close_confirm',
         closeOnClickModal: false,
         inputValidator: (val) => {
-          if (!/^[0-9]+(.[0-9]{1,2})?$/.test(val)) {
+          if (!/^(\-)?\d+(\.\d{1,2})?$/.test(val)) {
             return '请输入正确的数字'
           }
           if (val.length > 6) {
@@ -220,9 +225,10 @@ export default {
           })
         }).catch((e) => {
           loading.close()
-          this.$message({
-            message: '计算失败!',
-            type: 'warning'
+          this.$alert(e, '计算失败!', {
+            confirmButtonText: '确定',
+            callback: action => {
+            }
           })
         })
       }).catch(() => {
@@ -247,9 +253,10 @@ export default {
           this.getAllDataModel()
         }).catch((e) => {
           loading.close()
-          this.$message({
-            message: '删除失败!',
-            type: 'warning'
+          this.$alert(e, '删除失败!', {
+            confirmButtonText: '确定',
+            callback: action => {
+            }
           })
         })
       }).catch(() => {
@@ -332,9 +339,10 @@ export default {
         this.tableData = res.data.dataModelList
       }).catch((e) => {
         loading.close()
-        this.$message({
-          message: '数据查询失败!',
-          type: 'warning'
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },

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

@@ -142,6 +142,11 @@ export default {
         this.itemDataList = this.chooseGroup.itemList
       }).catch((e) => {
         loading.close()
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 编辑 */

+ 31 - 22
chuanyi_client2/src/views/my_report/index.vue

@@ -65,9 +65,9 @@
       </div>
     </div>
 
-    <!-- 报表模板选择 -->
+    <!-- 新增报表 -->
     <el-dialog
-        title="选择报表模板"
+        title="新增报表"
         width="80%"
         top="10vh"
         center
@@ -320,9 +320,10 @@ export default {
         this.loadReport()
       }).catch((e) => {
         loading.close()
-        this.$message({
-          message: '保存失败!',
-          type: 'warning'
+        this.$alert(e, '操作失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },
@@ -347,9 +348,10 @@ export default {
         this.loadReport()
       }).catch((e) => {
         loading.close()
-        this.$message({
-          message: '保存失败!',
-          type: 'warning'
+        this.$alert(e, '操作失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },
@@ -383,10 +385,10 @@ export default {
             })
           }).catch((e) => {
             loading.close()
-            console.log(e)
-            this.$message({
-              message: '数据查询失败!',
-              type: 'warning'
+            this.$alert(e, '查询失败!', {
+              confirmButtonText: '确定',
+              callback: action => {
+              }
             })
           })
         }
@@ -412,9 +414,10 @@ export default {
         this.dialogReportTemplateVisible = false
       }).catch((e) => {
         loading.close()
-        this.$message({
-          message: '数据查询失败!',
-          type: 'warning'
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },
@@ -670,6 +673,11 @@ export default {
         this.reportDataList = res.data.reportTableList
       }).catch((e) => {
         loading.close()
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 设置用户组信息 */
@@ -846,11 +854,11 @@ export default {
         luckysheet.create(option)
         this.btnType = 'show'
       }).catch((e) => {
-        console.log(e)
         loading.close()
-        this.$message({
-          message: '加载失败!',
-          type: 'warning'
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },
@@ -876,9 +884,10 @@ export default {
           this.cancelSaveReport()
         }).catch((e) => {
           loading.close()
-          this.$message({
-            message: '删除失败!',
-            type: 'warning'
+          this.$alert(e, '删除失败!', {
+            confirmButtonText: '确定',
+            callback: action => {
+            }
           })
         })
       }).catch(() => {

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

@@ -629,6 +629,11 @@ export default {
             this.$emit('refreshReportTemplateData', true)
           }).catch((e) => {
             loading.close()
+            this.$alert(e, '操作失败!', {
+              confirmButtonText: '确定',
+              callback: action => {
+              }
+            })
           })
         } else {
           saveReportTemplate(data).then(res => {
@@ -745,9 +750,10 @@ export default {
       getAllItemGroup().then(res => {
         this.dataGroupList = res.data
       }).catch((e) => {
-        this.$message({
-          message: '数据组查询失败!',
-          type: 'error'
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },
@@ -784,11 +790,11 @@ export default {
         }
         this.dialogDataItemVisible = true
       }).catch((e) => {
-        console.error(e)
         loading.close()
-        this.$message({
-          message: '连接失败!',
-          type: 'error'
+        this.$alert(e, '连接失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
         })
       })
     },
@@ -862,6 +868,11 @@ export default {
         }
       }).catch((e) => {
         loading.close()
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 选择数据模型 */

+ 15 - 0
chuanyi_client2/src/views/run_config/index.vue

@@ -101,6 +101,11 @@ export default {
         this.groupDataList = res.data
       }).catch((e) => {
         loading.close()
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 根据ID查询组信息 */
@@ -121,6 +126,11 @@ export default {
         this.itemDataList = res.data.itemList
       }).catch((e) => {
         loading.close()
+        this.$alert(e, '查询失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 修改数据状态 */
@@ -157,6 +167,11 @@ export default {
         })
       }).catch((e) => {
         loading.close()
+        this.$alert(e, '操作失败!', {
+          confirmButtonText: '确定',
+          callback: action => {
+          }
+        })
       })
     },
     /** 运行事件 */

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

@@ -202,9 +202,10 @@ export default {
           this.getAllUserGroup()
         }).catch((e) => {
           loading.close()
-          this.$message({
-            message: '删除失败!',
-            type: 'warning'
+          this.$alert(e, '删除失败!', {
+            confirmButtonText: '确定',
+            callback: action => {
+            }
           })
         })
       }).catch(() => {
@@ -303,9 +304,10 @@ export default {
               this.getAllUserGroup()
             }).catch((e) => {
               loading.close()
-              this.$message({
-                message: '修改失败!',
-                type: 'warning'
+              this.$alert(e, '操作失败!', {
+                confirmButtonText: '确定',
+                callback: action => {
+                }
               })
             })
             return