浏览代码

Merge remote-tracking branch 'origin/master'

zhoupeng 1 年之前
父节点
当前提交
328fcd9f18
共有 21 个文件被更改,包括 208 次插入159 次删除
  1. 1 1
      chaunyi_opc/opc_da/src/main/resources/mapper/ChartDao.xml
  2. 1 1
      chaunyi_opc/opc_da/src/main/resources/static/page/index.html
  3. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/page/static/css/app.68bacd05.css
  4. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/page/static/css/chunk-1c266168.183a7633.css
  5. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/page/static/js/app.c60763eb.js
  6. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/page/static/js/chunk-0b1e599b.e6bd40cd.js
  7. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/page/static/js/chunk-1c266168.4f75f8f1.js
  8. 0 0
      chaunyi_opc/opc_da/src/main/resources/static/page/static/js/chunk-bf7d2572.54137ea2.js
  9. 1 1
      chuanyi-admin/src/layout/components/Navbar.vue
  10. 1 1
      chuanyi-admin/src/views/dashboard/onlineUsers.vue
  11. 22 3
      chuanyi-admin/src/views/system/driver/index.vue
  12. 23 114
      chuanyi-admin/src/views/system/menu/index.vue
  13. 17 1
      chuanyi_client2/src/api/chart.js
  14. 16 7
      chuanyi_client2/src/components/CustomDialog/DataItem.vue
  15. 1 1
      chuanyi_client2/src/components/CustomDialog/DataSourceItem.vue
  16. 7 4
      chuanyi_client2/src/components/CustomDialog/UserGroup.vue
  17. 6 2
      chuanyi_client2/src/components/HeaderMain/index.vue
  18. 45 13
      chuanyi_client2/src/views/data_model/index.vue
  19. 1 1
      chuanyi_client2/src/views/group_item/index.vue
  20. 65 8
      chuanyi_client2/src/views/home/index.vue
  21. 1 1
      chuanyi_client2/src/views/report_template/index.vue

+ 1 - 1
chaunyi_opc/opc_da/src/main/resources/mapper/ChartDao.xml

@@ -38,7 +38,7 @@
     </insert>
 
     <update id="updateChart">
-        update t_data_model
+        update t_chart
         set chart_type=#{chartType},
             value_type=#{valueType},
             chart_name=#{chartName},

文件差异内容过多而无法显示
+ 1 - 1
chaunyi_opc/opc_da/src/main/resources/static/page/index.html


文件差异内容过多而无法显示
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/page/static/css/app.68bacd05.css


+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/page/static/css/chunk-bf7d2572.183a7633.css → chaunyi_opc/opc_da/src/main/resources/static/page/static/css/chunk-1c266168.183a7633.css


文件差异内容过多而无法显示
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/page/static/js/app.c60763eb.js


文件差异内容过多而无法显示
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/page/static/js/chunk-0b1e599b.e6bd40cd.js


文件差异内容过多而无法显示
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/page/static/js/chunk-1c266168.4f75f8f1.js


文件差异内容过多而无法显示
+ 0 - 0
chaunyi_opc/opc_da/src/main/resources/static/page/static/js/chunk-bf7d2572.54137ea2.js


+ 1 - 1
chuanyi-admin/src/layout/components/Navbar.vue

@@ -205,7 +205,7 @@ export default {
      * @returns {Promise<void>}
      */
     logout() {
-      this.$confirm('是否强制下线此用户?', '系统提示', {
+      this.$confirm('您确定要退出系统吗?', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonClass: 'btn_custom_cancel',

+ 1 - 1
chuanyi-admin/src/views/dashboard/onlineUsers.vue

@@ -49,7 +49,7 @@ export default {
     },
     // 清空用户登录信息
     handelClick({ userId }) {
-      this.$confirm('是否清空用户登录信息?', '系统提示', {
+      this.$confirm('是否强制下线此用户?', '系统提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonClass: 'btn_custom_cancel',

+ 22 - 3
chuanyi-admin/src/views/system/driver/index.vue

@@ -80,7 +80,7 @@
       append-to-body
       :close-on-click-modal="false"
     >
-      <el-form ref="driverForm" :model="driverForm" label-width="100px">
+      <el-form ref="driverForm" :model="driverForm" :rules="rules" label-width="140px">
         <el-row style="margin-bottom: 5px">
           <el-col>
             <el-form-item label="驱动:" prop="driver">
@@ -88,7 +88,7 @@
                 v-if="driverForm.id"
                 v-model="driverForm.driver"
                 placeholder="请选择驱动"
-                style="width: 360px"
+                style="width: 300px"
                 disabled
               >
                 <el-option
@@ -102,7 +102,7 @@
                 v-else
                 v-model="driverForm.driver"
                 placeholder="请选择驱动"
-                style="width: 360px"
+                style="width: 300px"
               >
                 <el-option
                   v-for="dict in driverList"
@@ -182,6 +182,25 @@ export default {
         id: null,
         driver: null,
         items: null
+      },
+      // 表单验证
+      rules: {
+        driver: [
+          {
+            required: true,
+            message: '驱动不能为空',
+            pattern: '[^ \x22]+',
+            trigger: 'change'
+          }
+        ],
+        items: [
+          {
+            required: true,
+            message: '数据项不能为空',
+            pattern: '[^ \x22]+',
+            trigger: 'blur'
+          }
+        ]
       }
     }
   },

+ 23 - 114
chuanyi-admin/src/views/system/menu/index.vue

@@ -4,31 +4,13 @@
       <el-row>
         <el-col :span="24">
           <!-- 表单查询 -->
-          <el-form
-            ref="queryForm"
-            :model="queryParams"
-            :inline="true"
-            size="small"
-          >
+          <el-form ref="queryForm" :model="queryParams" :inline="true" size="small">
             <el-form-item label="菜单名称" prop="menuName">
-              <el-input
-                v-model="queryParams.menuName"
-                placeholder="请输入菜单名称"
-                clear
-              />
+              <el-input v-model="queryParams.menuName" placeholder="请输入菜单名称" clear />
             </el-form-item>
             <el-form-item>
-              <el-button
-                type="primary"
-                icon="el-icon-search"
-                size="mini"
-                @click="handelSearch"
-              >搜索</el-button>
-              <el-button
-                icon="el-icon-refresh"
-                size="mini"
-                @click="handelReset"
-              >重置</el-button>
+              <el-button type="primary" icon="el-icon-search" size="mini" @click="handelSearch">搜索</el-button>
+              <el-button icon="el-icon-refresh" size="mini" @click="handelReset">重置</el-button>
             </el-form-item>
           </el-form>
 
@@ -51,43 +33,11 @@
             stripe
             header-row-class-name="headBackground"
           >
-            <el-table-column
-              key="menuName"
-              label="菜单名称"
-              header-align="center"
-              prop="menuName"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              key="menuIcon"
-              label="菜单图标"
-              prop="menuIcon"
-              align="center"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              key="menuUrl"
-              label="路由地址"
-              prop="menuUrl"
-              align="center"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              key="sortNum"
-              label="排序号"
-              prop="sortNum"
-              align="center"
-              width="100"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              key="hidden"
-              label="显示状态"
-              prop="hidden"
-              align="center"
-              width="100"
-              show-overflow-tooltip
-            >
+            <el-table-column key="menuName" label="菜单名称" header-align="center" prop="menuName" show-overflow-tooltip />
+            <el-table-column key="menuIcon" label="菜单图标" prop="menuIcon" align="center" show-overflow-tooltip />
+            <el-table-column key="menuUrl" label="路由地址" prop="menuUrl" align="center" show-overflow-tooltip />
+            <el-table-column key="sortNum" label="排序号" prop="sortNum" align="center" width="100" show-overflow-tooltip />
+            <el-table-column key="hidden" label="显示状态" prop="hidden" align="center" width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.hidden === 0 ? "显示" : "隐藏" }}
               </template>
@@ -121,32 +71,13 @@
                 }}
               </template>
             </el-table-column>
-            <el-table-column
-              label="操作"
-              align="center"
-              class-name="small-padding fixed-width"
-            >
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
               <template slot-scope="scope">
-                <el-button
-                  size="mini"
-                  type="text"
-                  icon="el-icon-edit"
-                  @click="handelEdit(scope.row.id)"
-                >修改
+                <el-button size="mini" type="text" icon="el-icon-edit" @click="handelEdit(scope.row.id)">修改
                 </el-button>
-                <el-button
-                  size="mini"
-                  type="text"
-                  icon="el-icon-delete"
-                  @click="handelDel(scope.row.id)"
-                >删除
+                <el-button size="mini" type="text" icon="el-icon-delete" @click="handelDel(scope.row.id)">删除
                 </el-button>
-                <el-button
-                  size="mini"
-                  type="text"
-                  icon="el-icon-zoom-in"
-                  @click="handelAuth(scope.row.id)"
-                >分配权限
+                <el-button size="mini" type="text" icon="el-icon-zoom-in" @click="handelAuth(scope.row.id)">分配权限
                 </el-button>
               </template>
             </el-table-column>
@@ -165,12 +96,7 @@
       </el-row>
 
       <!-- 弹出框 -->
-      <el-dialog
-        :title="title"
-        :visible.sync="dialogVisible"
-        width="800px"
-        :close-on-click-modal="false"
-      >
+      <el-dialog :title="title" :visible.sync="dialogVisible" width="800px" :close-on-click-modal="false">
         <el-form ref="form" :model="form" :rules="rules" label-width="90px">
           <el-row>
             <el-col :span="24">
@@ -188,39 +114,24 @@
           <el-row>
             <el-col :span="12">
               <el-form-item label="菜单图标" prop="menuIcon">
-                <el-input
-                  v-model.trim="form.menuIcon"
-                  placeholder="请输入菜单图标"
-                />
+                <el-input v-model.trim="form.menuIcon" placeholder="请输入菜单图标" />
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="菜单名称" prop="menuName">
-                <el-input
-                  v-model.trim="form.menuName"
-                  placeholder="请输入菜单名称"
-                  maxlength="10"
-                />
+                <el-input v-model.trim="form.menuName" placeholder="请输入菜单名称" maxlength="10" />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="12">
               <el-form-item label="路由地址" prop="menuUrl">
-                <el-input
-                  v-model.trim="form.menuUrl"
-                  placeholder="请输入路由地址"
-                />
+                <el-input v-model.trim="form.menuUrl" placeholder="请输入路由地址" />
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="排序号" prop="sortNum">
-                <el-input
-                  v-model.trim="form.sortNum"
-                  placeholder="请输入排序号"
-                  :minlength="1"
-                  :maxlength="5"
-                />
+                <el-input v-model.trim="form.sortNum" placeholder="请输入排序号" :minlength="1" :maxlength="5" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -240,11 +151,7 @@
           </el-row>
         </el-form>
         <span slot="footer" class="dialog-footer">
-          <el-button
-            type="primary"
-            size="mini"
-            @click="handelSubmit('form')"
-          >确定</el-button>
+          <el-button type="primary" size="mini" @click="handelSubmit('form')">确定</el-button>
           <el-button size="mini" @click="handelCancel('form')">取消</el-button>
         </span>
       </el-dialog>
@@ -336,6 +243,9 @@ export default {
             pattern: '[^ \x22]+',
             trigger: 'blur'
           }
+        ],
+        hidden: [
+          { required: true }
         ]
       },
       // 修改菜单id
@@ -500,5 +410,4 @@ export default {
 }
 </script>
 
-<style lang="scss" rel="stylesheet/scss" scoped>
-</style>
+<style lang="scss" rel="stylesheet/scss" scoped></style>

+ 17 - 1
chuanyi_client2/src/api/chart.js

@@ -41,6 +41,22 @@ export function saveIndexChart(data) {
 }
 
 /**
+ * 修改数据图表
+ * @param data
+ * @returns {*}
+ */
+export function updateIndexChart(data) {
+    return request({
+        url: '/chart/updateChart',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data
+    })
+}
+
+/**
  * 根据ID删除图表信息
  * @param id
  * @returns {AxiosPromise}
@@ -61,7 +77,7 @@ export function delIndexChartById(id) {
  * @returns {AxiosPromise}
  */
 export function getIndexChartById(id) {
-    let uri = '/chart/getChartById?id=' + id
+    let uri = '/chart/getChartDetailsById?id=' + id
     return request({
         url: uri,
         headers: {

+ 16 - 7
chuanyi_client2/src/components/CustomDialog/DataItem.vue

@@ -90,12 +90,12 @@ export default {
   },
   methods: {
     /** 显示弹窗 */
-    show() {
+    show(groupId, items) {
       this.isSelectAllItem = false
       this.itemDataListByTree = []
       this.filterItemData = ''
       this.chooseDataGroup = null
-      this.getDataGroupList()
+      this.getDataGroupList(groupId, items)
       this.dialogDataItemVisible = true
     },
     /** 数据项搜索过滤 */
@@ -125,12 +125,12 @@ export default {
       }
     },
     /** 选择数据组值改变事件 */
-    dataGroupChangeEvent(val) {
+    dataGroupChangeEvent(val, items) {
       this.chooseDataGroup = val
-      this.getDataItemByGroup()
+      this.getDataItemByGroup(items)
     },
     /** 根据数据组获取数据项 */
-    getDataItemByGroup() {
+    getDataItemByGroup(items) {
       let id = this.chooseDataGroup
       if (!id) {
         showAlertMsgWin(this, null, '请选择数据组!')
@@ -142,15 +142,24 @@ export default {
       getTableItemGroupById(id, 1).then(res => {
         loading.close()
         this.itemDataListByTree = res.data.itemList
+        if (items) {
+          this.$refs.itemTree.setCheckedKeys(items)
+        }
       }).catch((e) => {
         loading.close()
         showAlertWin(this, null, e)
       })
     },
     /** 获取数据组列表 */
-    getDataGroupList() {
+    getDataGroupList(groupId, items) {
       getAllItemGroup(1).then(res => {
-        this.dataGroupList = res.data
+        this.$nextTick(() => {
+          this.dataGroupList = res.data
+          if (groupId) {
+            this.chooseDataGroup = groupId
+            this.dataGroupChangeEvent(groupId, items)
+          }
+        })
       }).catch((e) => {
         showAlertWin(this, null, e)
       })

+ 1 - 1
chuanyi_client2/src/components/CustomDialog/DataSourceItem.vue

@@ -189,7 +189,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算/值替换表达式"
+        title="选择表达式"
         width="500px"
         top="10vh"
         center

+ 7 - 4
chuanyi_client2/src/components/CustomDialog/UserGroup.vue

@@ -45,15 +45,18 @@ export default {
   },
   methods: {
     /** 显示弹窗 */
-    show() {
+    show(ids) {
       this.dialogUserGroupVisible = true
-      this.getAllUserGroup()
+      this.getAllUserGroup(ids)
     },
     /** 查询所有用户组 */
-    getAllUserGroup() {
+    getAllUserGroup(ids) {
       getAllUserGroup().then(res => {
         this.$nextTick(() => {
           this.userGroupList = res.data
+          if (ids) {
+            this.chooseUserGroup = ids
+          }
         })
       }).catch((e) => {
         showAlertWin(this, null, e)
@@ -80,7 +83,7 @@ export default {
 }
 </script>
 
-<style>
+<style scoped>
 .el-transfer-panel {
   border: 1px solid #e6ebf5;
   border-radius: 4px;

+ 6 - 2
chuanyi_client2/src/components/HeaderMain/index.vue

@@ -444,7 +444,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算/值替换表达式"
+        title="选择表达式"
         width="500px"
         top="10vh"
         center
@@ -1601,8 +1601,12 @@ export default {
       this.leavesChooseList = []
       this.itemDataStep = 1
       this.tempItemList = JSON.parse(JSON.stringify(this.groupBasicForm.itemList))
-
       if (this.tempItemList && this.tempItemList.length > 0) {
+        this.tempItemList.forEach((t) => {
+          t.label = t.itemName
+          t.value = t.itemReadName
+          t.checked = false
+        })
         this.chooseItemDataListByTree = this.tempItemList
       }
       const loading = showLoading(this, '加载中,请稍候···')

+ 45 - 13
chuanyi_client2/src/views/data_model/index.vue

@@ -26,36 +26,49 @@
         </el-table-column>
         <el-table-column
             align="center"
-            label="表达式/值"
-            sortable="custom"
-            prop="operationRule"
-            width="350">
-        </el-table-column>
-        <el-table-column
-            align="center"
             label="类型"
             sortable="custom"
             prop="modelType"
-            width="200">
+            width="120">
           <template slot-scope="scope">
             <span>{{ scope.row.modelType == 0 ? '四则运算' : '值替换' }}</span>
           </template>
         </el-table-column>
         <el-table-column
             align="center"
+            label="表达式/值"
+            sortable="custom"
+            prop="operationRule"
+            width="300">
+        </el-table-column>
+        <el-table-column
+            align="center"
             label="数据值"
             prop="mathParameter"
-            width="150">
+            width="120">
           <template slot-scope="scope">
             <span>{{ scope.row.modelType == 0 ? scope.row.mathParameter : scope.row.replacingValue }}</span>
           </template>
         </el-table-column>
         <el-table-column
             align="center"
+            label="替换值②"
+            sortable="custom"
+            prop="operationRuleTwo"
+            width="120">
+        </el-table-column>
+        <el-table-column
+            align="center"
+            label="数据值②"
+            prop="replacingValueTwo"
+            width="120">
+        </el-table-column>
+        <el-table-column
+            align="center"
             label="创建时间"
             sortable
             prop="createTime"
-            width="200">
+            width="180">
         </el-table-column>
         <el-table-column label="操作" align="center" width="300">
           <template slot-scope="scope">
@@ -142,16 +155,22 @@
         <el-form-item label="名称" prop="remark">
           <el-input v-model="dataModelForm.remark" placeholder="请输入名称" maxlength="20"></el-input>
         </el-form-item>
-        <el-form-item label="替换规则" prop="operationRule">
+        <el-form-item label="替换规则" prop="operationRule">
           <span>当数据项值为</span>
           <el-input v-model="dataModelForm.operationRule" size="mini"
                     placeholder="请输入值" style="width: 110px; margin: 0 10px;"></el-input>
           <span>时,则替换成</span>
-<!--          <el-input v-model="dataModelForm.replacingValue" size="mini"-->
-<!--                    placeholder="请输入替换值" style="width: 110px; margin-left: 10px;"></el-input>-->
           <el-input-number v-model="dataModelForm.replacingValue" size="mini" placeholder="请输入替换值"
                            :min="0" :max="99" :controls="false" :precision="0" style="width: 110px; margin-left: 10px;"></el-input-number>
         </el-form-item>
+        <el-form-item label="替换规则②" prop="operationRuleTwo">
+          <span>当数据项值为</span>
+          <el-input v-model="dataModelForm.operationRuleTwo" size="mini"
+                    placeholder="请输入值" style="width: 110px; margin: 0 10px;"></el-input>
+          <span>时,则替换成</span>
+          <el-input-number v-model="dataModelForm.replacingValueTwo" size="mini" placeholder="请输入替换值"
+                           :min="0" :max="99" :controls="false" :precision="0" style="width: 110px; margin-left: 10px;"></el-input-number>
+        </el-form-item>
         <el-form-item style="text-align: center;">
           <el-button type="primary" @click="saveDataModelEvent">确定</el-button>
           <el-button @click="dialogClose">取消</el-button>
@@ -233,6 +252,8 @@ export default {
         testVal: '',
         modelType: 0,
         replacingValue: '',
+        operationRuleTwo: '',
+        replacingValueTwo: '',
         remark: ''
       },
       dataModelTestForm: {
@@ -325,6 +346,8 @@ export default {
         testVal: '',
         modelType: 0,
         replacingValue: '',
+        operationRuleTwo: '',
+        replacingValueTwo: '',
         remark: ''
       }
       this.calcValResult = ''
@@ -340,6 +363,8 @@ export default {
         testVal: '',
         modelType: 1,
         replacingValue: '',
+        operationRuleTwo: '',
+        replacingValueTwo: '',
         remark: ''
       }
       this.calcValResult = ''
@@ -457,6 +482,13 @@ export default {
     saveDataModelEvent() {
       this.$refs['dataModelForm'].validate((valid) => {
         if (valid) {
+          if (this.dataModelForm.operationRule == this.dataModelForm.operationRuleTwo) {
+            showAlertMsgWin(this, null, '值替换时两个规则不能一致!')
+            return
+          }
+          if (!this.dataModelForm.operationRuleTwo) {
+            this.dataModelForm.replacingValueTwo = null
+          }
           const loading = showLoading(this, '保存中,请稍候···')
           if (this.dataModelForm.id) {
             updateDataModel(this.dataModelForm).then(res => {

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

@@ -183,7 +183,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算/值替换表达式"
+        title="选择表达式"
         width="500px"
         top="10vh"
         center

+ 65 - 8
chuanyi_client2/src/views/home/index.vue

@@ -34,6 +34,11 @@
           <template slot-scope="scope">
             <el-button type="text"
                        size="small"
+                       icon="el-icon-edit"
+                       @click="updateChartItem(scope.row)">修改
+            </el-button>
+            <el-button type="text"
+                       size="small"
                        icon="el-icon-delete"
                        style="color: red;"
                        @click="removeChartItem(scope.row)">删除
@@ -55,7 +60,7 @@
 
     <!-- 新增首页图表 -->
     <el-dialog
-        title="添加图表"
+        :title="addIndexChart ? '添加图表' : '修改图表'"
         width="600px"
         top="5vh"
         center
@@ -129,7 +134,8 @@
         </el-form-item>
       </el-form>
       <span slot='footer'>
-        <el-button type="primary" @click="addIndexChartEvent">添加</el-button>
+        <el-button v-if="addIndexChart" type="primary" @click="addIndexChartEvent">添加</el-button>
+        <el-button v-else type="primary" @click="updateIndexChartEvent">修改</el-button>
         <el-button @click="dialogClose">取消</el-button>
       </span>
     </el-dialog>
@@ -145,9 +151,8 @@
 <script>
 import DataItem from '@/components/CustomDialog/DataItem'
 import UserGroup from '@/components/CustomDialog/UserGroup'
-import {goPage, showAlertMsgWin, showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
-import {delIndexChartById, getIndexChartById, getIndexChartList, saveIndexChart} from "@/api/chart";
-import {delItemGroupById} from "@/api/datasource";
+import { showAlertMsgWin, showAlertWin, showConfirmWin, showLoading} from "@/utils/cqcy";
+import {delIndexChartById, getIndexChartById, getIndexChartList, saveIndexChart, updateIndexChart} from "@/api/chart";
 import {mapGetters} from "vuex";
 
 export default {
@@ -159,6 +164,7 @@ export default {
     return {
       roleCodeList: [],
       dialogIndexChartVisible: false,
+      addIndexChart: true,
       hideMainViewFlag: true,
       chartDataList: [],
       chartTotal: 0,
@@ -239,8 +245,17 @@ export default {
     },
     /** 图表点击事件 */
     handleChartNodeClick(row) {
+    },
+    /** 图表修改事件 */
+    updateChartItem(row) {
       getIndexChartById(row.id).then(res => {
-        console.log(res)
+        if (!res.data) {
+          showAlertMsgWin(this, null, '修改失败!')
+          return
+        }
+        this.chartForm = res.data
+        this.addIndexChart = false
+        this.dialogIndexChartVisible = true
       }).catch((e) => {
         showAlertWin(this, null, e)
       })
@@ -262,6 +277,7 @@ export default {
     },
     /** 保存首页图表添加事件 */
     addIndexChartBtnEvent() {
+      this.addIndexChart = true
       this.dialogIndexChartVisible = true
     },
     /** 查询首页图表信息 */
@@ -294,6 +310,30 @@ export default {
       // this.chartForm.startTime = this.chartForm.dateRange[0]
       // this.chartForm.endTime = this.chartForm.dateRange[1]
       saveIndexChart(this.chartForm).then(res => {
+        this.addIndexChart = true
+        this.dialogIndexChartVisible = false
+        this.getIndexAllChart()
+        showAlertMsgWin(this, null, res.data)
+      }).catch((e) => {
+        showAlertWin(this, null, e)
+      })
+    },
+    /** 修改图表信息 */
+    updateIndexChartEvent() {
+      if (!this.chartForm.chartName || !this.chartForm.chartName.trim()) {
+        showAlertMsgWin(this, null, '图表名称不能为空!')
+        return
+      }
+      if (this.chartForm.chartItemList.length == 0) {
+        showAlertMsgWin(this, null, '数据项不能为空!')
+        return
+      }
+      if (this.chartForm.userGroupList.length == 0) {
+        showAlertMsgWin(this, null, '用户组不能为空!')
+        return
+      }
+      updateIndexChart(this.chartForm).then(res => {
+        this.addIndexChart = true
         this.dialogIndexChartVisible = false
         this.getIndexAllChart()
         showAlertMsgWin(this, null, res.data)
@@ -322,15 +362,32 @@ export default {
     },
     /** 选择数据项 */
     chooseDataItemEvent() {
-      this.$refs.dataItem.show()
+      let chartItemList = this.chartForm.chartItemList
+      let groupId = null
+      let items = []
+      if (chartItemList && chartItemList.length > 0) {
+        groupId = chartItemList[0].itemGroupId
+        chartItemList.forEach((t) => {
+          items.push(t.itemId)
+        })
+      }
+      this.$refs.dataItem.show(groupId, items)
     },
     /** 选择用户组 */
     chooseUserGroupEvent() {
-      this.$refs.userGroup.show()
+      let userGroups = this.chartForm.userGroupList
+      let groups = []
+      if (userGroups && userGroups.length > 0) {
+        userGroups.forEach((t) => {
+          groups.push(t.id)
+        })
+      }
+      this.$refs.userGroup.show(groups)
     },
     /** 弹出层关闭事件 */
     dialogClose(done) {
       Object.assign(this.$data.chartForm, this.$options.data.call(this).chartForm)
+      this.addIndexChart = true
       if (typeof (done) === 'function') {
         done()
       } else {

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

@@ -305,7 +305,7 @@
     </el-dialog>
 
     <el-dialog
-        title="选择四则运算/值替换表达式"
+        title="选择表达式"
         width="500px"
         top="10vh"
         center

部分文件因为文件数量过多而无法显示