From accebdce93486d3b4f26e55ffdea047549cce20c Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期一, 28 七月 2025 21:12:38 +0800
Subject: [PATCH] Merge branch 'master' of http://125.76.225.53:18448/r/xhj/vue_mdc_xhj

---
 src/views/mdc/base/modules/DeviceLog/LogList.vue |  222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 222 insertions(+), 0 deletions(-)

diff --git a/src/views/mdc/base/modules/DeviceLog/LogList.vue b/src/views/mdc/base/modules/DeviceLog/LogList.vue
new file mode 100644
index 0000000..4888611
--- /dev/null
+++ b/src/views/mdc/base/modules/DeviceLog/LogList.vue
@@ -0,0 +1,222 @@
+<template>
+  <a-card :bordered="false">
+    <!-- table鍖哄煙-begin -->
+    <div class="table_logList">
+      <a-table ref="table" bordered size="middle" :rowKey="(record,index)=>{return index}" :columns="columns"
+               :dataSource="dataList" :pagination="ipagination" :loading="loadingequip" @change="handleTableChange"
+               :customRow="rowClick">
+        <template slot="status" slot-scope="status">
+          <div v-if="status == '3' || status ==  '23'" style="color: #00ee00;width: 100%; height: 100%;">杩愯</div>
+          <div v-else-if="status == '1' || status == '2'" style="color: #ffea91;width: 100%; height: 100%;">寰呮満</div>
+          <div v-else-if="status == '0'" style="color: #A8A8A8;width: 100%; height: 100%;">鍏虫満</div>
+          <div v-else-if="status == '22'" style="color: red;width: 100%; height: 100%;">鎶ヨ</div>
+        </template>
+      </a-table>
+    </div>
+  </a-card>
+</template>
+
+<script>
+  import JDictSelectTag from '@/components/dict/JDictSelectTag'
+  import {
+    requestPut,
+    deleteAction
+  } from '@/api/manage'
+
+  import JInput from '@/components/jeecg/JInput'
+  import JEllipsis from '@/components/jeecg/JEllipsis'
+  import Tooltip from 'ant-design-vue/es/tooltip'
+  import {
+    JeecgListMixin
+  } from '@/mixins/JeecgListMixin'
+  import moment from 'moment'
+
+  export default {
+    name: 'LogList',
+    mixins: [JeecgListMixin],
+    components: {
+      Tooltip,
+      JDictSelectTag,
+      JInput,
+      JEllipsis
+    },
+    props: {
+      dataList: {
+        type: Array,
+        required: true,
+        default: []
+      },
+      loadingequip: {
+        type: Boolean,
+        default: false
+      }
+    },
+    watch: {},
+    data() {
+      return {
+        statusName: '',
+        disabled: true,
+        disableMixinCreated: true,
+        loading: false,
+        ipagination: {
+          current: 1,
+          pageSize: 100,
+          pageSizeOptions: ['100', '500', '1000'],
+          showTotal: (total, range) => {
+            return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
+        columns: [
+          {
+            title: '鐘舵��',
+            align: 'center',
+            dataIndex: 'status',
+            scopedSlots: { customRender: 'status' }
+          },
+          {
+            title: '寮�濮嬫椂闂�',
+            align: 'center',
+            dataIndex: 'startTime'
+            // defaultSortOrder:'descend',
+            // sorter: (a, b) => {return a.startTime>b.startTime?1:-1}
+          },
+          {
+            title: '缁撴潫鏃堕棿',
+            align: 'center',
+            dataIndex: 'endTime'
+            // defaultSortOrder:'descend',
+            // sorter: (a, b) => {return a.endTime>b.endTime?1:-1}
+          },
+          {
+            title: '鎸佺画鏃堕棿',
+            align: 'center',
+            dataIndex: 'duration',
+            customRender: (t, r, index) => {
+              // console.log(t)
+              var ss = parseInt(t)
+              if (ss >= 3600) {
+                // 鏍规嵁绉掓暟杞崲鎴愬搴旂殑鏃跺垎绉�
+                const hour = parseInt(ss / 3600) < 10 ? '0' + parseInt(ss / 3600) : parseInt(ss / 3600)
+                const min = parseInt(ss % 3600 / 60) < 10 ? '0' + parseInt(ss % 3600 / 60) : parseInt(ss % 3600 / 60)
+                const sec = parseInt(ss % 3600 % 60) < 10 ? '0' + parseInt(ss % 3600 % 60) : parseInt(ss % 3600 % 60)
+                if (min == '00') {
+                  if (sec == '00') {
+                    return hour + '灏忔椂'
+                  } else {
+                    return hour + '灏忔椂' + sec + '绉�'
+                  }
+
+                } else {
+                  if (sec == '00') {
+                    return hour + '灏忔椂' + min + '鍒�'
+                  } else {
+                    return hour + '灏忔椂' + min + '鍒�' + sec + '绉�'
+                  }
+                }
+                // if(sec == '00'){
+                //   return hour + '灏忔椂' + min + '鍒�'
+                // }
+                // if(min == '00' && sec == '00'){
+                //   return hour + '灏忔椂'
+                // }
+                // return hour + '灏忔椂' + min + '鍒�' + sec + '绉�'
+
+              } else if (60 < ss && ss < 3600) {
+                const min1 = parseInt(ss % 3600 / 60) < 10 ? '0' + parseInt(ss % 3600 / 60) : parseInt(ss % 3600 / 60)
+                const sec1 = parseInt(ss % 3600 % 60) < 10 ? '0' + parseInt(ss % 3600 % 60) : parseInt(ss % 3600 % 60)
+                return min1 + '鍒�' + sec1 + '绉�'
+              } else {
+                const sec2 = parseInt(ss % 3600 % 60) < 10 ? '0' + parseInt(ss % 3600 % 60) : parseInt(ss % 3600 % 60)
+                return sec2 + '绉�'
+              }
+            }
+            // defaultSortOrder:'descend',
+            // sorter: (a, b) => {return a.duration>b.duration?1:-1}
+          },
+          {
+            title: '绋嬪簭鍙�',
+            align: 'center',
+            dataIndex: 'sequenceNumber'
+          }
+        ]
+      }
+    },
+    methods: {
+      handleTableChange(pagination, filters, sorter) {
+        //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂
+        //TODO 绛涢��
+        if (Object.keys(sorter).length > 0) {
+          this.isorter.column = sorter.field
+          this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
+        }
+        this.ipagination = pagination
+        // this.loadData();
+      },
+      /**
+       * 缁欒澶囨棩蹇楄〃鏍间腑鐨勮娣诲姞鐐瑰嚮浜嬩欢
+       * @param record 鐐瑰嚮鐨勫綋鍓嶈鏁版嵁
+       * @returns {{on: {click: on.click}}} 娣诲姞浜嬩欢瀵硅薄
+       */
+      rowClick(record) {
+        return {
+          on: {
+            click: () => {
+              // 鍏虫満鐘舵�佽澶囨棩蹇椾笉寮瑰嚭宸ヤ綔鏇茬嚎
+              if (record.status === 0) return
+              const timeObj = {
+                start: moment(record.startTime),
+                end: moment(record.endTime)
+              }
+              this.$bus.$emit('tableRowRecord', timeObj)
+            }
+          }
+        }
+      }
+    },
+    created() {
+    }
+
+  }
+</script>
+
+<style lang="less" scoped>
+  @import '~@assets/less/common.less';
+
+  @media screen and (min-width: 1920px) {
+    .table_logList {
+      height: 417px !important;
+      overflow: scroll;
+    }
+  }
+
+  @media screen and (min-width: 1680px) and (max-width: 1920px) {
+    .table_logList {
+      height: 417px !important;
+      overflow: scroll;
+    }
+  }
+
+  @media screen and (min-width: 1400px) and (max-width: 1680px) {
+    .table_logList {
+      height: 266px !important;
+      overflow: scroll;
+    }
+  }
+
+  @media screen and (min-width: 1280px) and (max-width: 1400px) {
+    .table_logList {
+      height: 360px !important;
+      overflow: scroll;
+    }
+  }
+
+  @media screen and (max-width: 1280px) {
+    .table_logList {
+      height: 170px !important;
+      overflow: scroll;
+    }
+  }
+</style>

--
Gitblit v1.9.3