ZaiZai 1 年之前
父節點
當前提交
887fc71620
共有 1 個文件被更改,包括 41 次插入2 次删除
  1. 41 2
      src/views/tentative/acquisition/model/equipment-data.vue

+ 41 - 2
src/views/tentative/acquisition/model/equipment-data.vue

@@ -40,7 +40,16 @@
                         </div>
                         <el-button type="primary" @click="searchClick">搜索</el-button>
                     </template>
-                    还在开发中...
+                    <template #extra>
+                        <el-button @click="toBackClick">
+                            <hc-icon name="arrow-go-back" />
+                            <span>返回</span>
+                        </el-button>
+                    </template>
+                    <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :is-index="false" :is-current-row="false" />
+                    <template #action>
+                        <hc-pages :pages="searchForm" @change="pageChange" />
+                    </template>
                 </hc-card>
             </div>
         </div>
@@ -80,12 +89,34 @@ const getInfoData = () => {
 }
 
 //搜索表单
-const searchForm = ref({ nodeId: -1, startTime: '', endTime: '', deviceAddr: null })
+const searchForm = ref({ nodeId: -1, startTime: '', endTime: '', deviceAddr: null, current: 1, size: 20, total: 0 })
 const searchClick = () => {
     console.log(searchForm.value)
     console.log(dateTimeArr.value)
 }
 
+//分页被点击
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//历史记录表格
+const tableColumn = [
+    { key: 'name', name: '设备地址' },
+    { key: 'text', name: '温度' },
+    { key: 'color', name: '湿度' },
+    { key: 'time', name: '记录时间' },
+]
+const tableData = ref([])
+
+//获取历史记录数据
+const tableLoading = ref(false)
+const getTableData = async () => {
+
+}
+
 //日期时间选择
 const dateTimeArr = ref('')
 const shortcuts = [
@@ -250,6 +281,14 @@ const setChartsData = () => {
         },
     }
 }
+
+//返回
+const toBackClick = () => {
+    isShow.value = false
+    tableData.value = []
+    dateTimeArr.value = ''
+    setChartsOption.value = {}
+}
 </script>
 
 <style lang="scss">