Browse Source

Merge branch 'master' of http://116.63.33.55/git/industry-data-platform

lry 1 year ago
parent
commit
230f3cf964

+ 18 - 1
industry-admin/src/api/source/dataSource.js

@@ -61,6 +61,23 @@ export function saveOrUpdateDataSource(data) {
     })
 }
 
+
+/**
+ * 修改数据源信息
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function updateDataSourceNameAndDescribe(data) {
+  return request({
+    url: '/dataSource/updateDataSourceNameAndDescribe',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data
+  })
+}
+
 /**
  * 通过id删除数据源配置
  * @param id
@@ -106,4 +123,4 @@ export function getNextAllItem(id, label) {
         },
         method: 'get'
     })
-}
+}

+ 5 - 1
industry-admin/src/views/report/reportTable/reportDetail.vue

@@ -66,6 +66,8 @@ export default
         return {
             reportId: this.$route.query.id,
             reportTableName:this.$route.query.reportname,
+            isRefresh: this.$route.query.isRefresh,
+            refreshTime: this.$route.query.refreshTime,
             type:'',
             reportInterval:3,
             iframeSrc: process.env.VUE_APP_BASE_API + '/reportSheet/report-history.html',
@@ -82,7 +84,9 @@ export default
                     token: getToken(),
                     url: process.env.VUE_APP_BASE_API,
                     reportId: this.reportId,
-                    type:this.type
+                    type:this.type,
+                    isRefresh: this.isRefresh,
+                    refreshTime: this.refreshTime
                 }
             })
             window.addEventListener('message', function (event) {

+ 6 - 1
industry-admin/src/views/report/runConfig/index.vue

@@ -259,7 +259,12 @@ export default {
         reportNameClick(data) {
             this.$router.push({
                 path: '/reportTable/reportDetail'
-                , query: { id: data.id,reportname:data.reportTableName}
+                , query: {
+                  id: data.id,
+                  reportname:data.reportTableName,
+                  isRefresh: false,
+                  refreshTime: 10000
+                }
             })
         },
         /** 运行记录 */

+ 35 - 10
industry-admin/src/views/source/dataSource/index.vue

@@ -11,15 +11,15 @@
     <el-table :data="tableData" stripe border header-row-class-name="headBackground">
 <!--      <el-table-column type="selection" width="55" align="left" />-->
       <!-- <el-table-column type="index" label="序号" width="60" fixed align="center" /> -->
-      <el-table-column align="left" sortable label="数据源" prop="dataSourceName" />
-      <el-table-column align="left" sortable label="通讯协议" prop="dataSourceTypeName" />
-      <el-table-column align="left" sortable label="IP地址" prop="ipAddress" />
-      <el-table-column align="left" sortable label="端口" prop="ipPort">
+      <el-table-column align="left" label="数据源" prop="dataSourceName" />
+      <el-table-column align="left" label="通讯协议" prop="dataSourceTypeName" />
+      <el-table-column align="left" label="IP地址" prop="ipAddress" />
+      <el-table-column align="left" label="端口" prop="ipPort">
         <template slot-scope="scope">
           <span style="margin-left: 10px">{{ scope.row.ipPort !="" ? scope.row.ipPort  : "-"}}</span>
         </template>
       </el-table-column>>
-      <el-table-column align="left" label="备注" sortable prop="dataSourceDescribe" width="180" /><el-table-column label="操作"
+      <el-table-column align="left" label="备注" prop="dataSourceDescribe" width="180" /><el-table-column label="操作"
         align="left" width="300">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="editConnServer(scope.row)">修改</el-button>
@@ -69,12 +69,12 @@
                 </el-tag>
               </el-form-item>
             </el-form>
-            <div slot='footer' style="text-align: right">
-              <el-button type="primary" size="mini" @click='winSave()'>保存</el-button>
-              <el-button @click='winClose' size="mini">取消</el-button>
-            </div>
           </div>
         </div>
+        <div slot='footer' style="text-align: right">
+          <el-button type="primary" size="mini" @click="winSave">确定</el-button>
+          <el-button size="mini" @click="winClose">取消</el-button>
+        </div>
       </el-dialog>
 
       <!-- 数据源连接基础配置弹出层 -->
@@ -147,6 +147,7 @@ import {
   getAllDataSource,
   getDataSourceTree, getDriverList,
   saveOrUpdateDataSource,
+  updateDataSourceNameAndDescribe,
   testConnect
 } from "@/api/source/dataSource";
 import { encrypt, decrypt } from "@/utils/jsencrypt";
@@ -190,6 +191,7 @@ export default {
       dataSourceForm: {
         id: null,
         dataSourceName: '',
+        dataSourceDescribe: '',
         desc: '',
         ipAddress: '',
         ipPort: '',
@@ -376,6 +378,7 @@ export default {
       this.dataSourceForm.id = row.id
       this.dataSourceForm.dataSourceName = row.dataSourceName
       this.dataSourceForm.desc = row.dataSourceDescribe
+      this.dataSourceForm.dataSourceDescribe = row.dataSourceDescribe
       this.dataSourceForm.ipAddress = row.ipAddress
       this.dataSourceForm.ipPort = row.ipPort
       this.dataSourceForm.ipUserName = row.ipUserName
@@ -405,6 +408,8 @@ export default {
         this.dataSourceForm.label = data.label
         this.dataSourceForm.type = data.labelKey
         this.dataSourceForm.typeId = data.id
+
+        this.$refs.dataSourceForm.validateField('label')
       }
       this.initDataSourceForm()
     },
@@ -413,6 +418,7 @@ export default {
       this.dataSourceForm = {
         id: null,
         dataSourceName: '',
+        dataSourceDescribe: '',
         desc: '',
         ipAddress: '',
         ipPort: '',
@@ -474,6 +480,7 @@ export default {
             'description': this.dataSourceForm.driverDescribe,
             'progId': this.dataSourceForm.progId
           })
+          this.dataSourceForm.dataSourceDescribe = this.dataSourceForm.desc
           this.configVisible = true
         }
       })
@@ -567,7 +574,25 @@ export default {
       this.datasourceDialogVisible = false
     },
     winSave(){
-      //只修改名称和备注
+      this.$refs['dataSourceForm'].validate(valid => {
+        if (valid) {
+          this.dataSourceForm.dataSourceDescribe = this.dataSourceForm.desc
+          let data = {
+            dataSourceName: this.dataSourceForm.dataSourceName,
+            dataSourceDescribe: this.dataSourceForm.desc,
+            id: this.dataSourceForm.id,
+            typeId: this.dataSourceForm.typeId
+          }
+          //只修改名称和备注
+          updateDataSourceNameAndDescribe(data).then(res => {
+            if (res.data) {
+              this.showMsg('保存成功!', true)
+              this.handleClose()
+              this.getAllDataSource()
+            }
+          })
+        }
+      })
     },
     /** 配置弹出层关闭事件 */
     handleConfigClose() {

+ 200 - 163
industry-admin/src/views/source/itemGroup/itemConfigModel.vue

@@ -1,182 +1,219 @@
 <template>
-    <div>
-        <!-- 数据项表达式配置 -->
-        <el-dialog :title="title" width="80%" top="5vh" center :before-close="dialogClose" :visible.sync="visible"
-            @open="handleOpen" @close="handleClose">
-            <el-form label-width="100px">
-                <el-row>
-                    <el-col :span="6">
-                        <el-form-item label="数据源:" style="margin-bottom: 5px; width: 100%">
-                            <el-select v-model="dataSourceId" disabled>
-                                <el-option v-for="dict in dataSourceList" :key="dict.id" :label="dict.dataSourceName"
-                                    :value="dict.id"></el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="6">
-                        <el-form-item label="点位:" style="margin-bottom: 5px; width: 100%">
-                            <el-input placeholder="请输入点位进行过滤" style="" @input="chooseItemChangeEvent"
-                                v-model="filterChooseItemText"></el-input>
-                        </el-form-item>
-                    </el-col>
-                </el-row>
-            </el-form>
-            <el-button type="primary" size="small" @click="multipleModel"
-                style="position: absolute; right: 30px; top: 80px">批量设置表达式</el-button>
-            <CommonTable ref="itemConfigTable" :tableHeaderTitle="tableHeaderTitle" :tableData="tableData"
-                :isShowCheckbox="isShowCheckbox" :isShowIndex="isShowIndex" :tableHight="tableHight"
-                :tableOperate="tableOperate" @receiveCheckedData="receiveCheckedData" @chooseModel="chooseModel">
-            </CommonTable>
-            <span slot="footer">
+  <div>
+    <!-- 数据项表达式配置 -->
+    <el-dialog :title="title" width="80%" top="5vh" center :before-close="dialogClose" :visible.sync="visible"
+               @open="handleOpen" @close="handleClose">
+      <el-form label-width="100px">
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="数据源:" style="margin-bottom: 5px; width: 100%">
+              <el-select v-model="dataSourceId" disabled>
+                <el-option v-for="dict in dataSourceList" :key="dict.id" :label="dict.dataSourceName"
+                           :value="dict.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="点位:" style="margin-bottom: 5px; width: 100%">
+              <el-input placeholder="请输入点位进行过滤" style="" @input="chooseItemChangeEvent"
+                        v-model="filterChooseItemText"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <el-button type="primary" size="small" @click="multipleModel"
+                 style="position: absolute; right: 30px; top: 80px" title="未勾选点位则设置所有点位的表达式">批量设置表达式
+      </el-button>
+      <CommonTable ref="itemConfigTable" :tableHeaderTitle="tableHeaderTitle" :tableData="tablePageData"
+                   :isShowCheckbox="isShowCheckbox" :isShowIndex="isShowIndex" :tableHight="tableHight"
+                   :tableOperate="tableOperate" @receiveCheckedData="receiveCheckedData" @chooseModel="chooseModel">
+      </CommonTable>
+      <!-- 分页信息 -->
+      <pagination v-show="tableTotal > 0" small :total="tableTotal" :page.sync="queryParams.page"
+                  :limit.sync="queryParams.limit" align="right" @pagination="pageChangeEvent"/>
+      <span slot="footer">
                 <el-button type="primary" @click="saveItemChoose" size="small">确定</el-button>
                 <el-button @click="dialogClose" size="small">取消</el-button>
             </span>
-        </el-dialog>
+    </el-dialog>
 
-        <!-- 选择表达式 -->
-        <ChooseModel ref="chooseModel" @saveDataModelEvent="saveDataModelEvent"></ChooseModel>
-    </div>
+    <!-- 选择表达式 -->
+    <ChooseModel ref="chooseModel" @saveDataModelEvent="saveDataModelEvent"></ChooseModel>
+  </div>
 </template>
 
 <script>
 import CommonTable from '@/components/CommonTable/index.vue'
 import ChooseModel from './chooseModel.vue'
+import {showConfirmWin} from "@/utils/cqcy";
 
 export default {
-    components: {
-        CommonTable,
-        ChooseModel
-    },
-    data() {
-        return {
-            visible: false,
-            title: '点位表达式设置',
-            dataSourceId: null,
-            filterChooseItemText: null,
-            dataSourceList: [],
-            dataModelList: [],
-            leavesChooseList: [],
-            checkItemList: [],
-            // 是否展示复选框列
-            isShowCheckbox: true,
-            // 是否展示序号索引列
-            isShowIndex: true,
-            tableHight: '68vh',
-            tableHeaderTitle: [
-                {
-                    propName: "itemName",
-                    labelName: "点位名称",
-                },
-                {
-                    propName: "remark",
-                    labelName: "四则运算表达式",
-                }
-            ],
-            tableDataF: [],
-            tableData: [],
-            tableOperate: [
-                {
-                    btnName: '选择表达式',
-                    size: "mini",
-                    style: '',
-                    icon: 'el-icon-edit',
-                    methodName: "chooseModel",
-                }
-            ],
-            queryParams: {
-                page: 1,
-                limit: 10
-            },
-            tableTotal: 0
+  components: {
+    CommonTable,
+    ChooseModel
+  },
+  data() {
+    return {
+      visible: false,
+      title: '点位表达式设置',
+      dataSourceId: null,
+      filterChooseItemText: null,
+      dataSourceList: [],
+      dataModelList: [],
+      leavesChooseList: [],
+      checkItemList: [],
+      // 是否展示复选框列
+      isShowCheckbox: true,
+      // 是否展示序号索引列
+      isShowIndex: true,
+      tableHight: '68vh',
+      tableHeaderTitle: [
+        {
+          propName: "itemName",
+          labelName: "点位名称",
+        },
+        {
+          propName: "remark",
+          labelName: "数据计算模型",
+        }
+      ],
+      tableDataF: [],
+      tableData: [],
+      tablePageData: [],
+      tableOperate: [
+        {
+          btnName: '选择表达式',
+          size: "mini",
+          style: '',
+          icon: 'el-icon-edit',
+          methodName: "chooseModel",
         }
+      ],
+      queryParams: {
+        page: 1,
+        limit: 10
+      },
+      tableTotal: 0
+    }
+  },
+  methods: {
+    /** 弹窗打开事件 */
+    handleOpen() {
+      this.tableDataF = this.tableData
+      this.initTablePage(this.tableData)
     },
-    methods: {
-        /** 弹窗打开事件 */
-        handleOpen() {
-            this.tableDataF = this.tableData
-        },
-        /** 弹窗关闭事件 */
-        handleClose() {
-            this.dataSourceId = null
-            this.filterChooseItemText = null
-            this.tableData = []
-        },
-        /** 关闭弹出层 */
-        dialogClose() {
-            this.visible = false
-        },
-        // 接收子组件勾选的行的数据
-        receiveCheckedData(checked) {
-            this.checkItemList = checked
-        },
-        /** 确定数据项的设置 */
-        saveItemChoose() {
-            this.$emit('saveItemChoose', this.tableDataF)
-            this.dialogClose()
-            this.$emit('dialogClose')
-        },
-        /** 选择数据项表达式 */
-        chooseModel(row) {
-            this.$refs.chooseModel.title = '选择表达式'
-            this.$refs.chooseModel.visible = true
-            this.$refs.chooseModel.dataModelList = this.dataModelList
-            this.$refs.chooseModel.chooseDataModelId = row.dataModelId
-            let arr = [];
-            arr.push(row.itemName)
-            this.$refs.chooseModel.itemNameList = arr
-        },
-        /** 批量设置表达式 */
-        multipleModel() {
-            if (this.checkItemList.length == 0) {
-                this.$message({
-                    message: '请至少选择一个点位!',
-                    type: 'warning'
-                })
-                return;
-            }
-            this.$refs.chooseModel.title = '选择表达式'
-            this.$refs.chooseModel.visible = true
-            this.$refs.chooseModel.dataModelList = this.dataModelList
-            let arr = [];
-            for (let i = 0; i < this.checkItemList.length; i++) {
-                arr.push(this.checkItemList[i].itemName)
-            }
-            this.$refs.chooseModel.itemNameList = arr
-        },
-        /** 过滤数据项事件 */
-        chooseItemChangeEvent(val) {
-            let arr = JSON.parse(JSON.stringify(this.tableDataF));
-            if (!val || !val.trim()) {
-                this.tableData = arr;
-                return;
-            }
-            this.tableData = arr.filter((v) => v.itemName.indexOf(val) !== -1)
-        },
-        /** 保存数据模型事件 */
-        saveDataModelEvent(itemNameList, dataModelId) {
-            let remark = '';
-            for (let i = 0; i < this.dataModelList.length; i++) {
-                if (this.dataModelList[i].id == dataModelId) {
-                    remark = this.dataModelList[i].remark
-                    break
-                }
-            }
+    /** 弹窗关闭事件 */
+    handleClose() {
+      this.dataSourceId = null
+      this.filterChooseItemText = null
+      this.tableData = []
+      this.tablePageData = []
+      this.tableTotal = 0
+    },
+    /** 关闭弹出层 */
+    dialogClose() {
+      this.visible = false
+    },
+    // 接收子组件勾选的行的数据
+    receiveCheckedData(checked) {
+      this.checkItemList = checked
+    },
+    initTablePage(array) {
+      if(array == null){
+        array = this.tableData
+      }
+      this.queryParams = {
+        page: 1,
+        limit: 10
+      }
+      this.tableTotal = array.length
+      this.tablePageData = this.paginate(array, this.queryParams.limit, this.queryParams.page)
+    },
+    pageChangeEvent(){
+      this.tablePageData = this.paginate(this.tableData, this.queryParams.limit, this.queryParams.page)
+    },
+    paginate(array, page_size, page_number) {
+      // 计算分页开始的索引
+      const start = (page_number - 1) * page_size;
+      // 使用slice方法获取当前页的数据
+      return array.slice(start, start + page_size);
+    },
+    /** 确定数据项的设置 */
+    saveItemChoose() {
+      this.$emit('saveItemChoose', this.tableDataF)
+      this.dialogClose()
+      this.$emit('dialogClose')
+    },
+    /** 选择数据项表达式 */
+    chooseModel(row) {
+      this.$refs.chooseModel.title = '选择表达式'
+      this.$refs.chooseModel.visible = true
+      this.$refs.chooseModel.dataModelList = this.dataModelList
+      this.$refs.chooseModel.chooseDataModelId = row.dataModelId
+      let arr = [];
+      arr.push(row.itemName)
+      this.$refs.chooseModel.itemNameList = arr
+    },
+    /** 批量设置表达式 */
+    multipleModel() {
+      if (this.checkItemList.length == 0) {
+        showConfirmWin(this, null, '您确定要对所有点位设置表达式吗?', () => {
+          this.$refs.chooseModel.title = '选择表达式'
+          this.$refs.chooseModel.visible = true
+          this.$refs.chooseModel.dataModelList = this.dataModelList
+          let arr = [];
+          for (let i = 0; i < this.tableDataF.length; i++) {
+            arr.push(this.tableDataF[i].itemName)
+          }
+          this.$refs.chooseModel.itemNameList = arr
+        })
+        return;
+      }
+      this.$refs.chooseModel.title = '选择表达式'
+      this.$refs.chooseModel.visible = true
+      this.$refs.chooseModel.dataModelList = this.dataModelList
+      let arr = [];
+      for (let i = 0; i < this.checkItemList.length; i++) {
+        arr.push(this.checkItemList[i].itemName)
+      }
+      this.$refs.chooseModel.itemNameList = arr
+    },
+    /** 过滤数据项事件 */
+    chooseItemChangeEvent(val) {
+      let arr = JSON.parse(JSON.stringify(this.tableDataF));
+      if (!val || !val.trim()) {
+        this.tableData = arr;
+        this.initTablePage(this.tableData)
+        return;
+      }
+      this.tableData = arr.filter((v) => v.itemName.indexOf(val) !== -1)
+      this.initTablePage(this.tableData)
+    },
+    /** 保存数据模型事件 */
+    saveDataModelEvent(itemNameList, dataModelId) {
+      let remark = '';
+      for (let i = 0; i < this.dataModelList.length; i++) {
+        if (this.dataModelList[i].id == dataModelId) {
+          remark = this.dataModelList[i].remark
+          break
+        }
+      }
 
-            let arr = []
-            for (let i = 0; i < this.tableDataF.length; i++) {
-                let temp = this.tableDataF[i]
-                for (let j = 0; j < itemNameList.length; j++) {
-                    if (itemNameList[j] == temp.itemName) {
-                        temp.dataModelId = dataModelId
-                        temp.remark = remark
-                        break
-                    }
-                }
-                arr.push(temp)
-            }
-            this.tableDataF = arr
-            this.chooseItemChangeEvent(this.filterChooseItemText)
+      let arr = []
+      for (let i = 0; i < this.tableDataF.length; i++) {
+        let temp = this.tableDataF[i]
+        for (let j = 0; j < itemNameList.length; j++) {
+          if (itemNameList[j] == temp.itemName) {
+            temp.dataModelId = dataModelId
+            temp.remark = remark
+            break
+          }
         }
+        arr.push(temp)
+      }
+      this.tableDataF = arr
+      this.chooseItemChangeEvent(this.filterChooseItemText)
     }
+  }
 }
 </script>

+ 17 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/controller/DataSourceController.java

@@ -53,6 +53,23 @@ public class DataSourceController {
     }
 
     /**
+     * 修改数据源名称和备注
+     *
+     * @param dataSource
+     * @return
+     */
+    @PostMapping("/updateDataSourceNameAndDescribe")
+    @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.DATASOURCE, OperationEnum = OperationEnum.UPDATE)
+    public Result updateDataSourceNameAndDescribe(@RequestBody DataSource dataSource) {
+        if (Blank.isEmpty(dataSource,dataSource.getTypeId(), dataSource.getDataSourceName())) {
+            return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "数据源名称不能为空");
+        }
+        return dataSourceService.updateDataSourceNameAndDescribe(dataSource);
+    }
+
+
+
+    /**
      * 获取Da下面的所有驱动
      *
      * @param dataSource

+ 3 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/DataSourceDao.java

@@ -32,6 +32,9 @@ public interface DataSourceDao {
 
     Integer updateDataSource(DataSource dataSource);
 
+    Integer updateDataSourceNameAndDescribe(DataSource dataSource);
+
+
     DataSourceDriver getDataSourceDriver(DataSourceDriver dataSourceDriver);
 
     Integer addDataSourceDriver(DataSourceDriver dataSourceDriver);

+ 2 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/DataSourceService.java

@@ -10,6 +10,8 @@ public interface DataSourceService {
 
     Result addDataSource(DataSource dataSource);
 
+    Result updateDataSourceNameAndDescribe(DataSource dataSource);
+
     Result testConnect(DataSource dataSource);
 
     Result getAllDataSource(Integer page, Integer limit);

+ 16 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/DataSourceServiceImpl.java

@@ -72,6 +72,22 @@ public class DataSourceServiceImpl implements DataSourceService {
     }
 
     @Override
+    public Result updateDataSourceNameAndDescribe(DataSource dataSource) {
+        String currentUserId = userUtil.getCurrentUserId();
+        dataSource.setUserId(currentUserId);
+        if(Blank.isEmpty(dataSource.getId())){
+            if (dataSourceDao.addDataSource(dataSource) <= 0) {
+                return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "添加数据源配置失败");
+            }
+            return Result.ok("添加数据源配置成功");
+        }
+        if (dataSourceDao.updateDataSourceNameAndDescribe(dataSource) <= 0) {
+            return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "修改数据源配置失败");
+        }
+        return Result.ok("修改数据源配置成功");
+    }
+
+    @Override
     public Result testConnect(DataSource dataSource) {
         //将加密密码转换为正常密码
         if (Blank.isNotEmpty(dataSource.getIpPassword())) {

+ 7 - 0
industry-system/industry-da/src/main/resources/mapper/DataSourceDao.xml

@@ -75,6 +75,13 @@
         where id = #{id}
     </update>
 
+    <update id="updateDataSourceNameAndDescribe">
+        update t_data_source
+        set data_source_name=#{dataSourceName},
+            data_source_describe=#{dataSourceDescribe}
+        where id = #{id}
+    </update>
+
     <update id="updateDataSourceDriver">
         update t_data_source_driver
         set driver_name=#{driverName},

+ 18 - 12
industry-system/industry-da/src/main/resources/mapper/ItemGroupDao.xml

@@ -8,8 +8,8 @@
     </sql>
 
     <sql id="item">
-        id
-        , item_group_id, item_name, item_read_name, item_type, node_index , data_type, upper_limit, lower_limit, `describe`, unit, data_model_id
+        ti.id
+        , ti.item_group_id, ti.item_name, ti.item_read_name, ti.item_type, ti.node_index , ti.data_type, ti.upper_limit, ti.lower_limit, ti.`describe`, ti.unit, ti.data_model_id
     </sql>
 
     <insert id="addItemGroup" parameterType="com.example.opc_common.entity.ItemGroup" useGeneratedKeys="true"
@@ -228,7 +228,13 @@
     <select id="getItemValuePageByGroupId" resultType="com.example.opc_common.entity.Item">
         select
         <include refid="item"/>
+        ,tdm.operation_rule
+        ,tdm.remark as operation_rule_name
+        ,tds.data_source_name
         from t_item ti
+        LEFT JOIN t_data_model tdm ON ti.data_model_id = tdm.id
+        LEFT JOIN t_item_group tig ON ti.item_group_id = tig.id
+        LEFT JOIN t_data_source tds ON tig.data_source_id=tds.id
         where ti.item_group_id = #{itemGroupId}
         <if test="itemType != null">
             and ti.item_type = #{itemType,jdbcType=INTEGER}
@@ -244,9 +250,9 @@
     <select id="getPublicItemList" resultType="com.example.opc_common.entity.Item">
         select
         <include refid="item"/>
-        from t_item
-        where item_group_id=#{itemGroupId} and
-        item_name in
+        from t_item ti
+        where ti.item_group_id=#{itemGroupId} and
+        ti.item_name in
         <foreach collection="itemList" item="item" index="index" open="(" close=")" separator=",">
             #{item.itemName}
         </foreach>
@@ -261,9 +267,9 @@
     <select id="getItemByGroupIdName" resultType="com.example.opc_common.entity.Item">
         select
         <include refid="item"/>
-        from t_item
-        where item_group_id = #{itemGroupId}
-        and item_name = #{itemName}
+        from t_item ti
+        where ti.item_group_id = #{itemGroupId}
+        and ti.item_name = #{itemName}
     </select>
 
     <select id="getItemGroupByDataSourceId" resultType="com.example.opc_common.entity.ItemGroup">
@@ -275,8 +281,8 @@
     <select id="getItemById" resultType="com.example.opc_common.entity.Item">
         select
         <include refid="item"/>
-        from t_item
-        where id = #{id}
+        from t_item ti
+        where ti.id = #{id}
     </select>
 
     <select id="getItemDescribe" resultType="java.lang.String">
@@ -319,8 +325,8 @@
     <select id="getItemListByGidList" resultType="com.example.opc_common.entity.Item">
         select
         <include refid="item"/>
-        from t_item
-        where item_group_id in
+        from t_item ti
+        where ti.item_group_id in
         <foreach collection="itemGroupList" item="itemGroup" separator="," open="(" close=")">
             #{itemGroup.id}
         </foreach>

+ 12 - 0
industry-system/industry-da/src/main/resources/static/reportSheet/js/report-history.js

@@ -35,6 +35,7 @@ layui.use(['_$', 'rightMenu'], function() {
 	}
 })
 
+let refreshIntervalId = null
 window.onload = function() {
 	window.addEventListener('message', function(e) {
 		const json = e.data;
@@ -44,6 +45,14 @@ window.onload = function() {
 			setTimeout(() => {
 				indexFn.initPage(json.data)
 			}, 500)
+			if(json.data.isRefresh){
+				if(!json.data.refreshTime){
+					json.data.refreshTime = 1000
+				}
+				refreshIntervalId = setInterval(() => {
+					indexFn.initPage(json.data)
+				}, json.data.refreshTime)
+			}
 		} else if (json.cmd == 'show') {
 			indexFn.initPage(json.data)
 		} else if(json.cmd=='print'){
@@ -52,6 +61,9 @@ window.onload = function() {
 	})
 }
 window.onbeforeunload = function() {
+	if(refreshIntervalId){
+		clearInterval(refreshIntervalId)
+	}
 	window.removeEventListener('message', function(e) {
 		console.log(e)
 	});