Browse Source

Merge remote-tracking branch 'origin/demo_' into demo_

2 years ago
parent
commit
cbedbb3625

+ 14 - 0
src/api/remote/opc.js

@@ -49,6 +49,20 @@ export function updateRemoteOpc (parameter) {
   })
 }
 
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addToServerRemoteOpcs (parameter) {
+  return axios({
+    url: '/remote/opcs/group/addAll',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * update func
  * parameter: { }

+ 23 - 1
src/views/remote/opc/RemoteOpc.vue

@@ -64,6 +64,13 @@
               <a-icon type="upload" />
               新增导入
             </a-button>
+            <a-button
+              style="margin-left: 8px"
+              v-if="$auth('remote-opcs-add')"
+              type="primary"
+              icon="download"
+              @click="doAddAll">全部采集
+            </a-button>
             <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('remote-opcs-del')">
               <a-menu slot="overlay">
                 <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
@@ -146,6 +153,7 @@ import {
   getRemoteOpcPage,
   deleteRemoteOpcs,
   updateRemoteOpcs,
+  addToServerRemoteOpcs,
   fetchRemoteOpc,
   exportRemoteOpc
 } from '@/api/remote/opc'
@@ -351,6 +359,15 @@ export default {
         ...this.$route.query
       })
     },
+    doAddAll () {
+      const parameter = {
+        ...this.queryParam,
+        sbIds: this.selectedRowKeys
+      }
+      addToServerRemoteOpcs(parameter).then(res => {
+        this.$message.info('已添加,100秒后自动采集')
+      })
+    },
     handleEdit (record) {
       fetchRemoteOpc({ id: record.id }).then(res => {
         const modal = this.$refs.baseModal
@@ -380,7 +397,12 @@ export default {
     },
     doExport () {
       const parameter = {
-        ...this.queryParam
+        ...this.queryParam,
+        ids: this.selectedRowKeys,
+        dataScope: {
+          sortBy: 'asc',
+          sortName: 'no'
+        }
       }
       exportRemoteOpc(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)

+ 0 - 4
src/views/remote/opc/modules/BaseForm.vue

@@ -515,10 +515,6 @@ export default {
           this.$message.error('请确认opc页面是否已经配置位置,并保存后,再发起')
           return
         }
-        if (res.data.createdFlag == null || res.data.createdFlag === 0) {
-          this.$message.error('请确认opc服务器上是否已经创建,并保存后,再发起')
-          return
-        }
         addRemoteOpcGroup(res.data.positionNum)
           .then((res) => {
             this.$message.info(res.data)

+ 0 - 1
src/views/sb/info/SbInfo.vue

@@ -877,7 +877,6 @@ export default {
           sortName: 'no'
         }
       }
-      console.log(parameter)
       exportSbInfo(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })