瀏覽代碼

opc优化

408249787 2 年之前
父節點
當前提交
842364549d

+ 15 - 3
src/views/opc/OpcInfo.vue

@@ -23,7 +23,7 @@
           <template slot="title">
             {{ item.description }}
           </template>
-          <div class="info" @click="handleInfo(item)"> {{ item.result }}</div>
+          <div class="info" @click="handleInfo(item)" @click.right.prevent="handleView(item)"> {{ item.result }}</div>
         </a-tooltip>
       </VueDragResize>
     </div>
@@ -63,19 +63,25 @@
       </a-table> -->
     </a-drawer>
     <BaseChartInfo ref="baseChartInfo" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk" />
+
   </div>
 </template>
 
 <script>
 import VueDragResize from 'vue-drag-resize'
 import { getSbPositionTree, fetchSbPosition } from '@/api/sb/position'
-import { queryRemoteOpc, updateRemoteOpc } from '@/api/remote/opc'
+import { queryRemoteOpc, updateRemoteOpc,
+  fetchRemoteOpc
+} from '@/api/remote/opc'
+import Detail from '@/views/remote/opc/modules/Detail.vue'
 import BaseChartInfo from './modules/BaseChartInfo.vue'
 export default {
   name: 'Opc',
   components: {
     VueDragResize,
-    BaseChartInfo
+    BaseChartInfo,
+    Detail
   },
   data () {
     return {
@@ -163,6 +169,12 @@ export default {
       const model = this.$refs.baseChartInfo
       model.base(remoteOpc)
     },
+    handleView (record) {
+      fetchRemoteOpc({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
     handleOk () {
 
     }

+ 5 - 1
src/views/opc/modules/BaseChartInfo.vue

@@ -15,6 +15,7 @@
               <a-col :span="10">
                 <a-form-item label="查询时间" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
                   <a-date-picker
+                    show-time
                     :format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN"
                     v-model="queryParam.createdTimeEnd" />
                 </a-form-item>
@@ -61,7 +62,8 @@ export default {
       visible: false,
       confirmLoading: false,
       queryParam: {
-        searchType: '1'
+        searchType: '1',
+        createdTimeEnd: this.BaseTool.Date.formatter(new Date(), this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
       },
       remoteOpc: null,
       positionNum: null,
@@ -90,6 +92,7 @@ export default {
       this.visible = true
       this.remoteOpc = remoteOpc
       this.queryParam.createdTimeEnd = this.BaseTool.Date.formatter(new Date(), this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+      console.log(this.queryParam.createdTimeEnd)
       this.getInfo()
       /* this.$nextTick(() => {
         this.createChart(this.dataList)
@@ -173,6 +176,7 @@ export default {
       this.chart1 && this.chart1.destroy()
       this.queryParam = {
         searchType: '1'
+
       }
       this.visible = false
     }

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

@@ -358,7 +358,7 @@ export default {
       })
     },
     handleView (record) {
-      this.visible = false
+      // this.visible = false
       fetchRemoteOpc({ id: record.id }).then(res => {
         const modal = this.$refs.detailModal
         modal.base(res.data)

+ 12 - 4
src/views/remote/opc/modules/Detail.vue

@@ -1,12 +1,20 @@
 <template>
-  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
-    <a-row :gutter="48" slot="extra">
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+    :footer="null"
+  >
+    <!-- <a-row :gutter="48" slot="footer">
       <a-col :md="48" :sm="48">
         <span class="table-page-search-submitButtons" style="float: right">
           <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
         </span>
       </a-col>
-    </a-row>
+    </a-row> -->
     <detail-list title="" :col="2">
       <detail-list-item term="opc点位id">{{ model.sbId }}</detail-list-item>
       <detail-list-item term="opc点位名称">{{ model.sbName }}</detail-list-item>
@@ -32,7 +40,7 @@
       <detail-list-item term="更新人">{{ model.updateUserId }}</detail-list-item>
       <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
     </detail-list>
-  </a-card>
+  </a-modal>
 </template>
 
 <script>