Pārlūkot izejas kodu

修改表达式和数据项

FinalYu 2 gadi atpakaļ
vecāks
revīzija
1a88f7cce8

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

@@ -74,6 +74,42 @@
       </div>
     </el-dialog>
 
+    <!-- 报警信息 -->
+    <el-dialog
+        title="报警信息"
+        width="80vw"
+        class="cy-warn-dialog"
+        center
+        :before-close="dialogClose"
+        :visible.sync="dialogNoticeVisible"
+        :close-on-click-modal="true"
+        :append-to-body="true">
+      <el-table
+          :data="tableNoticeData" border :stripe="true"
+          :header-cell-style="{background: '#E8E8E8'}"
+          style="width: 100%; height: calc(100% - 50px); overflow: auto;">
+        <el-table-column label="序号" align="center" width="80">
+          <template slot-scope="scope">
+            {{ scope.$index + 1 }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="标题" prop="noticeTitle" width="350">
+        </el-table-column>
+        <el-table-column align="center" label="报警内容" prop="noticeContent">
+        </el-table-column>
+        <el-table-column align="center" label="报警时间" prop="createTime" width="200">
+        </el-table-column>
+      </el-table>
+      <el-pagination
+          style="margin-top: 20px;"
+          background
+          layout="prev, pager, next, total"
+          :current-page="tablePage"
+          @size-change="sizeChangeEvent"
+          @current-change="currentChangeEvent"
+          :total="tableTotal">
+      </el-pagination>
+    </el-dialog>
   </div>
 </template>
 
@@ -107,7 +143,12 @@ export default {
       avatarDefault: avatarDefault,
       dialogPwdVisible: false,
       dialogAboutVisible: false,
+      dialogNoticeVisible: false,
       appVersion: '',
+      tableNoticeData: [],
+      tablePage: 1,
+      tableLimit: 10,
+      tableTotal: 0,
       userPwdForm: {
         password: '',
         newPassword: '',
@@ -210,14 +251,27 @@ export default {
         }
       })
     },
+    /** 数据条数改变 */
+    sizeChangeEvent(val) {
+      this.tablePage = 1
+      this.tableLimit = val
+      this.getWarnInfo()
+    },
+    /** 页码改变 */
+    currentChangeEvent(val) {
+      this.tablePage = val
+      this.getWarnInfo()
+    },
     /** 获取报警信息 */
     getWarnInfo() {
       let params = {
-        'page': 1,
-        'limit': 10,
+        'page': this.tablePage,
+        'limit': this.tableLimit,
       }
       getAllMessageNotice(params).then(res => {
-        console.log(res)
+        this.dialogNoticeVisible = true
+        this.tableTotal = res.data.count
+        this.tableNoticeData = res.data.messageNoticeList
       }).catch((e) => {
         console.log(e)
       })
@@ -285,4 +339,13 @@ export default {
 .el-avatar {
   margin-right: 5px;
 }
+
+.cy-warn-dialog {
+  .el-dialog {
+    height: 70vh;
+    .el-dialog__body {
+      height: calc(100% - 60px);
+    }
+  }
+}
 </style>

+ 1 - 1
chuanyi_client2/src/views/data_model/index.vue

@@ -193,7 +193,7 @@ export default {
     },
     /** 测试数据模型值 */
     handleTest(index, row) {
-      this.$prompt('请输入数值', '温馨提示', {
+      this.$prompt('请输入数值', '四则运算表达式验证', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         customClass: 'close_confirm',

+ 1 - 1
chuanyi_client2/src/views/my_report/index.vue

@@ -142,7 +142,7 @@
 
     <!-- 自动报表CRON定时表达式 -->
     <el-dialog
-        title="请输入定时任务表达式"
+        title="编辑定时任务表达式"
         width="80%"
         top="10vh"
         center

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

@@ -168,11 +168,15 @@
         width="80%"
         top="10vh"
         center
-        :before-close="dialogClose"
+        :before-close="dialogItemClose"
         :visible.sync="dialogDataItemVisible"
         :close-on-click-modal="false"
         :append-to-body="true">
       <div>
+        <div style="margin-bottom: 10px;">
+          <span>组名称:{{ itemDataListByGroupName }}</span>
+          <el-checkbox v-model="isSelectAllItem" @change="selectAllItem" style="float: right;">全选</el-checkbox>
+        </div>
         <el-input placeholder="请输入关键字进行过滤" v-model="filterItemData"></el-input>
         <div style="height: 50vh; margin-top: 10px; overflow: auto;">
           <el-tree class="cy-item-tree"
@@ -184,14 +188,15 @@
                    :check-on-click-node="true"
                    :filter-node-method="filterItemDataNode"
                    :highlight-current="true"
-                   :default-expand-all="true">
+                   :default-expand-all="true"
+                   @check-change="handleItemCheckChange">
               <span class="custom-tree-node" slot-scope="{ node, data }">
                 <svg-icon v-if="!data.children || data.children.length == 0" icon-class="file"/>
                 <svg-icon v-else-if="node.expanded" icon-class="folder-open"/>
                 <svg-icon v-else icon-class="folder"/>
                 <span :title='data.itemName || "-"' style="margin-left: 2px;">
                   {{ data.describe
-                    ? ((data.itemName ? data.itemName : '') + '【' + data.describe + '】')
+                    ? ((data.itemName ? data.itemName : '') + '(' + data.describe + ')')
                     : data.itemName ? data.itemName : '' }}
                 </span>
               </span>
@@ -294,7 +299,7 @@
 
     <!-- 选择数据组数据 -->
     <el-dialog
-        title="选择数据项"
+        title="数据项配置"
         width="80%"
         top="10vh"
         center
@@ -323,7 +328,6 @@
                    :data="chooseGroupItemList"
                    :indent="10"
                    node-key="id"
-                   show-checkbox
                    :check-on-click-node="true"
                    :filter-node-method="filterItemDataNode"
                    :highlight-current="true"
@@ -346,8 +350,9 @@
         </div>
         <div v-if="chooseGroupItemList.length > 0">
           <template>
-            <el-divider content-position="left">数据显示方式</el-divider>
+            <el-divider content-position="left">数据显示</el-divider>
             <div class="cy-line custom-tree">
+              <label>显示方式:</label>
               <el-radio v-model="itemShowParams.fieldType" label="1">横向</el-radio>
               <el-radio v-model="itemShowParams.fieldType" label="2">纵向</el-radio>
             </div>
@@ -356,7 +361,7 @@
             <el-divider content-position="left">值显示</el-divider>
             <div class="cy-line custom-tree" style="display: flex; align-items: center;">
               <div style="width: 50%;">
-                <label>显示类型:</label>
+                <label>显示方式:</label>
                 <el-radio v-model="itemShowParams.valType" label="1">横向</el-radio>
                 <el-radio v-model="itemShowParams.valType" label="2">纵向</el-radio>
               </div>
@@ -410,6 +415,7 @@ export default {
       dialogCommReportVisible: false,
       dialogGroupItemVisible: false,
       dialogBaseDataVisible: false,
+      isSelectAllItem: false,
       menuLeft: 0,
       menuTop: 0,
       visibleChartMenu: false,
@@ -437,6 +443,7 @@ export default {
       chooseBaseData: null,
       dataGroupList: [],
       itemDataListByTree: [],
+      itemDataListByGroupName: '',
       itemDataListByCalc: [],
       chooseGroupItemList: [],
       dataModelList: [],
@@ -588,6 +595,49 @@ export default {
     }
   },
   methods: {
+    traverseNode(node) {
+      if (Object.prototype.toString.call(node) === '[object Array]') {
+        return node.map(t => this.traverseNode(t))
+      }
+      let data = node.data
+      data.visible = node.visible
+      return data
+    },
+    traverseVisible(arr) {
+      return arr.filter(t => {
+        let visible = t.visible
+        if (!visible) {
+          return false
+        }
+        if (t.children) {
+          t.children = this.traverseVisible(t.children)
+        }
+        delete t.visible
+        return visible
+      })
+    },
+    /** 数据项全选事件 */
+    selectAllItem() {
+      const data = this.traverseNode(this.$refs.itemTree.store.root.childNodes)
+      if (this.isSelectAllItem) {
+        // this.$refs.itemTree.setCheckedNodes(this.itemDataListByTree)
+        let arr = this.traverseVisible(data)
+        let ids = Array.from(arr, ({ id }) => id)
+        this.$refs.itemTree.setCheckedKeys(ids)
+      } else {
+        this.$refs.itemTree.setCheckedNodes([])
+      }
+    },
+    /**数据项单项选择判断 */
+    handleItemCheckChange(data, checked, indeterminate) {
+      const tdata = this.traverseNode(this.$refs.itemTree.store.root.childNodes)
+      let arr = this.traverseVisible(tdata)
+      if (arr.length == this.$refs.itemTree.getCheckedNodes().length) {
+        this.isSelectAllItem = true
+      } else {
+        this.isSelectAllItem = false
+      }
+    },
     /** 保存模版信息 */
     saveReportTemplate() {
       this.$prompt('请输入/确认报表模板名称', '保存', {
@@ -786,16 +836,28 @@ export default {
         })
         return
       }
+      this.itemDataListByTree = []
       const loading = showLoading(this, '加载中,请稍候···')
       getTableItemGroupById(id).then(res => {
         loading.close()
+        this.itemDataListByGroupName = res.data.groupName
         this.itemDataListByTree = res.data.itemList
-        if (this.chooseItemData.length > 0) {
-          let idList = []
-          for (let i in this.chooseItemData) {
-            idList.push(this.chooseItemData[i].id)
-          }
+        // if (this.chooseItemData.length > 0) {
+        //   let idList = []
+        //   for (let i in this.chooseItemData) {
+        //     idList.push(this.chooseItemData[i].id)
+        //   }
+        //   this.$refs.itemTree.setCheckedKeys(idList)
+        // }
+        this.$refs.itemTree.setCheckedKeys([])
+        if (this.chooseGroupItemList.length > 0) {
+          let idList = Array.from(this.chooseGroupItemList, ({ id }) => id)
           this.$refs.itemTree.setCheckedKeys(idList)
+          if (this.itemDataListByTree.length == idList.length) {
+            this.isSelectAllItem = true
+          } else {
+            this.isSelectAllItem = false
+          }
         }
         this.dialogDataItemVisible = true
       }).catch((e) => {
@@ -830,6 +892,7 @@ export default {
       if (this.dialogGroupItemVisible) {
         this.initGroupItem()
       }
+      this.filterItemData = ''
       // this.getAllDataModel(chooseList)
     },
     initGroupItem() {
@@ -1333,6 +1396,11 @@ export default {
     },
     /** 弹出层关闭事件 */
     dialogClose(done) {
+      this.chooseDataGroup = null
+      this.chooseItemData = []
+      this.chooseGroupItemList = []
+      this.filterItemData = ''
+
       this.commTemplate = null
       if (typeof(done) === 'function') {
         done()
@@ -1346,6 +1414,16 @@ export default {
       }
     },
     /** 弹出层关闭事件 */
+    dialogItemClose(done) {
+      this.itemDataListByTree = []
+      this.filterItemData = ''
+      if (typeof(done) === 'function') {
+        done()
+      } else {
+        this.dialogDataItemVisible = false
+      }
+    },
+    /** 弹出层关闭事件 */
     dialogDataModelClose() {
       if (typeof(done) === 'function') {
         done()

+ 1 - 1
chuanyi_client2/src/views/run_config/index.vue

@@ -69,7 +69,7 @@ export default {
   },
   data() {
     return {
-      breadcrumbList: ['运行'],
+      breadcrumbList: ['运行配置'],
       groupDataList: [],
       itemDataList: [],
       runStatus: -1,