Pārlūkot izejas kodu

历史数据按照IOT TPM 样式修改并根据情况修改文件位置和引入

yuhan 5 mēneši atpakaļ
vecāks
revīzija
bc10ce4a08

+ 8 - 20
src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

@@ -77,25 +77,12 @@
         @change="handleTableChange">
         <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
 
-        <template slot="htmlSlot" slot-scope="text">
-          <div v-html="text"></div>
-        </template>
-        <template slot="imgSlot" slot-scope="text,record">
-          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
-          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
-        </template>
-        <template slot="fileSlot" slot-scope="text">
-          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
-          <a-button
-            v-else
-            :ghost="true"
-            type="primary"
-            icon="download"
-            size="small"
-            @click="downloadFile(text)">
-            下载
-          </a-button>
-        </template>
+        <!-- 状态标签 -->
+        <span slot="statusTags" slot-scope="text">
+          <a-tag color="orange">
+            {{ text }}
+          </a-tag>
+        </span>
 
         <!-- <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
@@ -180,7 +167,8 @@
           {
             title:'仪表状态',
             align:"center",
-            dataIndex: 'instrumentStatusName'
+            dataIndex: 'instrumentStatusName',
+            scopedSlots: { customRender: 'statusTags' }
           },
           // {
           //   title:'系统id',

+ 24 - 8
src/views/module_interLock/interlockHistoryData/InterlockHistory/InterlockHistoryList.vue

@@ -172,16 +172,10 @@
             title:'联锁名称',
             align:"center",
             dataIndex: 'interlockname',
-            // customRender:function (t,r,index) {
-            //   return {children: t,attrs: {rowSpan:r.rowSpan}};
-            // },
             customRender:(t,record,index)=> {
-              const text = record.interlockname
-              var childrenMore = (
-                <a onClick={() => {this.handleDetail(record)}}>{{ text }}</a>
-              )
-              return {children: childrenMore,attrs: {rowSpan:record.rowSpan}};
+              return {children: record.interlockname,attrs: {rowSpan:record.rowSpan}};
             },
+            customCell: (record, index)=>{ return this.customCellDetail(record, index)}
           },
           {
             title:'联锁条件',
@@ -327,6 +321,28 @@
           }
         }
       },
+      // 单元格点击事件
+      customCellDetail(record, index, columnValue, columnTitle){
+        return {
+          style: {
+            'color': "#008cd6 !important",
+            'cursor': "pointer",
+            'font-size': "16px",
+            'font-weight': "700",
+          },
+          on: {
+            // 点击事件
+            click: (event) => {
+              // this.$router.push({path: '/interLock/detail',query:{summaryid:record.summaryid,interlockSystemId:record.interlockSystemId}})
+              var data = {
+                summaryid: record.summaryid,
+                interlockSystemId: record.interlockSystemId
+              }
+              this.$emit('click', data)
+            },
+          }
+        }
+      },
       // 处理父组件传过来的数据
       getDataList(){
         console.log(111,this.selectData)

+ 3 - 6
src/views/module_interLock/interlockHistoryData/InterlockHistoryIndex.vue

@@ -1,19 +1,16 @@
 <template>
   <div class="iotmenu-content">
     <u-equipment-tree-drag @select="selectEquipment" :treeData="treeData">
-      <interlock-history-list ref="summaryList" :selectData="selectData"></interlock-history-list>
+      <interlock-history-list ref="summaryList" :selectData="selectData" @click="historyListClick"></interlock-history-list>
     </u-equipment-tree-drag>
   </div>
 </template>
 
 <script>
-
-import InterlockSummaryList from '../InterlockSummary/InterlockSummaryList.vue'
-import InterlockHistoryList from './InterlockHistory/InterlockHistoryList.vue'
+  import InterlockHistoryList from './InterlockHistory/InterlockHistoryList.vue'
   export default({
     components: {
-      InterlockHistoryList,
-      InterlockSummaryList
+      InterlockHistoryList
     },
     data () {
       return {

+ 3 - 3
src/views/module_interLock/interlockHistoryData/InterlockTimedReport.vue

@@ -1,15 +1,15 @@
 <template>
   <div class="iotmenu-content">
-    <InterlockDataReportList></InterlockDataReportList>
+    <InterlockTimedReportList></InterlockTimedReportList>
   </div>
 </template>
 
 <script>
-import InterlockDataReportList from './InterlockReport/InterlockDataReportList.vue'
+import InterlockTimedReportList from '../interlockTimedReport/InterlockTimedReportList.vue'
 export default {
   name: '',
   components: {
-    InterlockDataReportList,
+    InterlockTimedReportList,
   },
   data () {
     return {

+ 75 - 33
src/views/module_interLock/interlockHistoryData/index.vue

@@ -1,42 +1,84 @@
 <template>
-  <a-tabs type="card">
-    <a-tab-pane key="historyData">
-      <span slot="tab">
-        <a-icon type="file-text" />
-        历史数据
-      </span>
-      <interlock-history-index></interlock-history-index>
-    </a-tab-pane>
-    <a-tab-pane key="timedReport">
-      <span slot="tab">
-        <a-icon type="file-text" />
-        定时报表
-      </span>
-      <interlock-timedReport></interlock-timedReport>
-    </a-tab-pane>
-  </a-tabs>
+  <div>
+    <template v-if="showPage === 'summary'">
+      <a-tabs type="card">
+        <a-tab-pane key="historyData">
+          <span slot="tab">
+            <a-icon type="file-text" />
+            历史数据
+          </span>
+          <!-- <interlock-history-index></interlock-history-index> -->
+          <div class="iotmenu-content">
+            <u-equipment-tree-drag @select="selectEquipment" :treeData="treeData">
+              <interlock-history-list ref="summaryList" :selectData="selectData" @click="historyListClick"></interlock-history-list>
+            </u-equipment-tree-drag>
+          </div>
+        </a-tab-pane>
+        <a-tab-pane key="timedReport">
+          <span slot="tab">
+            <a-icon type="file-text" />
+            定时报表
+          </span>
+          <interlock-timed-report></interlock-timed-report>
+        </a-tab-pane>
+      </a-tabs>
+    </template>
+    <!-- 详情 -->
+    <interlock-detail-list v-if="showPage === 'detail'" @click="showPage='summary'" ref="summaryDetailRef" :currentData="currentData"></interlock-detail-list>
+  </div>
 </template>
 
 <script>
-import InterlockHistoryIndex from './InterlockHistoryIndex.vue';
-import InterlockTimedReport from './InterlockTimedReport.vue';
-export default {
-  name: '',
-  components: {
-    InterlockTimedReport,
-    InterlockHistoryIndex,
-  },
-  data () {
-    return {
+  // import InterlockHistoryIndex from './InterlockHistoryIndex.vue';
+  import InterlockHistoryList from './InterlockHistory/InterlockHistoryList.vue'
+  import InterlockTimedReport from '../interlockTimedReport/InterlockTimedReportList.vue';
+  import InterlockDetailList from '../InterlockDetail/InterlockDetailList.vue';
+  export default {
+    name: '',
+    components: {
+      // InterlockHistoryIndex,
+      InterlockHistoryList,
+      InterlockTimedReport,
+      InterlockDetailList,
+    },
+    data () {
+      return {
+        showPage: 'summary',
+        treeData: {
+          type: 'history',
+        },
+        selectData: {}
+      }
+    },
+    created () {
+    },
+    mounted () {
+    },
+    methods: {
+      selectEquipment(selectedKeys,e){
+        // console.log(99,selectedKeys,e)
+        if (selectedKeys.length == 0) {
+          this.$nextTick(()=>{
+            this.$refs.summaryList.searchReset();
+          })
+        } else {
+          let interlockType = e.selectedNodes[0].data.props.interlockType
+          let pid = e.selectedNodes[0].data.props.pid
+          // console.log(88,interlockType)
+          this.selectData.interlockType = interlockType
+          this.selectData.pid = pid
+          this.selectData.id = e.selectedNodes[0].data.props.id
+          this.$nextTick(()=>{
+            this.$refs.summaryList.getDataList();
+          })
+        }
+      },
+      historyListClick(data){
+        this.showPage = 'detail'
+        this.currentData = data
+      },
     }
-  },
-  created () {
-  },
-  mounted () {
-  },
-  methods: {
   }
-}
 </script>
 
 <style lang="less" scoped>

+ 3 - 3
src/views/module_interLock/interlockHistoryData/InterlockReport/InterlockDataReportList.vue

@@ -122,7 +122,7 @@
       </a-table>
     </div>
 
-    <interlock-data-report-modal ref="modalForm" @ok="modalFormOk"></interlock-data-report-modal>
+    <interlock-timed-report-modal ref="modalForm" @ok="modalFormOk"></interlock-timed-report-modal>
   </a-card>
 </template>
 
@@ -131,7 +131,7 @@
   import '@/assets/less/TableExpand.less'
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import InterlockDataReportModal from './modules/InterlockDataReportModal'
+  import InterlockTimedReportModal from './modules/InterlockTimedReportModal'
   import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
   import { downFiles_info } from '@api/api'
   import { colAuthFilter } from "@/utils/authFilter"
@@ -140,7 +140,7 @@
     name: 'InterlockDataReportList',
     mixins:[JeecgListMixin, mixinDevice],
     components: {
-      InterlockDataReportModal
+      InterlockTimedReportModal
     },
     data () {
       return {

+ 1 - 1
src/views/module_interLock/interlockHistoryData/InterlockReport/modules/InterlockDataReportForm.vue

@@ -35,7 +35,7 @@
   import { validateDuplicateValue } from '@/utils/util'
 
   export default {
-    name: 'InterlockDataReportForm',
+    name: 'InterlockTimedReportForm',
     components: {
     },
     props: {

+ 4 - 4
src/views/module_interLock/interlockHistoryData/InterlockReport/modules/InterlockDataReportModal.Style#Drawer.vue

@@ -7,7 +7,7 @@
     @close="close"
     destroyOnClose
     :visible="visible">
-    <interlock-data-report-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></interlock-data-report-form>
+    <interlock-timed-report-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></interlock-timed-report-form>
     <div class="drawer-footer">
       <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
       <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
@@ -17,12 +17,12 @@
 
 <script>
 
-  import InterlockDataReportForm from './InterlockDataReportForm'
+  import InterlockTimedReportForm from './InterlockTimedReportForm'
 
   export default {
-    name: 'InterlockDataReportModal',
+    name: 'InterlockTimedReportModal',
     components: {
-      InterlockDataReportForm
+      InterlockTimedReportForm
     },
     data () {
       return {

+ 4 - 4
src/views/module_interLock/interlockHistoryData/InterlockReport/modules/InterlockDataReportModal.vue

@@ -8,17 +8,17 @@
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="关闭">
-    <interlock-data-report-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></interlock-data-report-form>
+    <interlock-timed-report-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></interlock-timed-report-form>
   </j-modal>
 </template>
 
 <script>
 
-  import InterlockDataReportForm from './InterlockDataReportForm'
+  import InterlockTimedReportForm from './InterlockTimedReportForm'
   export default {
-    name: 'InterlockDataReportModal',
+    name: 'InterlockTimedReportModal',
     components: {
-      InterlockDataReportForm
+      InterlockTimedReportForm
     },
     data () {
       return {