From 512d5d7e79e0a64b36e24cbe5d7c5f8d0adc0b94 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 26 九月 2024 17:46:48 +0800
Subject: [PATCH] 1.升级了element-plus版本 2.对外支持模块新设备匹配工地功能完成 3.新增设备匹配模块单挑匹配记录编辑功能(未完成)

---
 src/views/fysp/config/DeviceMatch.vue |   65 ++++++++++++++++++++++++++++++--
 1 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/src/views/fysp/config/DeviceMatch.vue b/src/views/fysp/config/DeviceMatch.vue
index 82eafd2..2bf5f74 100644
--- a/src/views/fysp/config/DeviceMatch.vue
+++ b/src/views/fysp/config/DeviceMatch.vue
@@ -1,5 +1,5 @@
 <template>
-  <FYTable @search="onSearch" :pagination="true" ref="tableRef">
+  <FYTable @search="onSearch" :pagination="false" ref="tableRef" size="small">
     <template #options>
       <!-- 鍖哄幙 -->
       <FYOptionLocation
@@ -24,11 +24,48 @@
       </el-form>
     </template>
 
-    <template #table-column> 
-      <el-table-column prop="sceneName" :show-overflow-tooltip="true" label="鍚嶇О">
+    <!-- <template #options-expand2>
+      <CompDeviceMatchEdit :area="area"></CompDeviceMatchEdit>
+    </template> -->
+
+    <template #table-column>
+      <el-table-column fixed="left" type="index" label="#" width="40" index="1"></el-table-column>
+      <el-table-column
+        prop="deviceCode"
+        :show-overflow-tooltip="true"
+        label="鐩戞祴璁惧缂栧彿"
+        width="160"
+      >
+      </el-table-column>
+      <el-table-column prop="deviceName" :show-overflow-tooltip="true" label="鐩戞祴璁惧鍚嶇О">
+      </el-table-column>
+      <el-table-column prop="svUserName" :show-overflow-tooltip="true" label="鐩戠鐢ㄦ埛鍚嶇О">
+      </el-table-column>
+      <el-table-column prop="tzUserName" :show-overflow-tooltip="true" label="瀹堟硶鑷姪鐢ㄦ埛鍚嶇О">
+      </el-table-column>
+      <el-table-column
+        prop="createTime"
+        :show-overflow-tooltip="true"
+        label="鍒涘缓鏃堕棿"
+        :formatter="timeFormat"
+      >
+      </el-table-column>
+      <el-table-column fixed="right" label="鎿嶄綔" width="100">
+        <template #default="{ row }">
+          <el-button type="primary" size="small" @click="itemEdit(row)">缂栬緫</el-button>
+        </template>
       </el-table-column>
     </template>
   </FYTable>
+  <el-drawer
+    v-model="drawerShow"
+    title="璁惧鍖归厤璁板綍缂栬緫"
+    direction="btt"
+    size="80%"
+    destroy-on-close
+  >
+    <CompDeviceMatchEdit :data="selectedItem" :area="area"></CompDeviceMatchEdit>
+  </el-drawer>
 </template>
 <script setup>
 /**
@@ -37,10 +74,13 @@
 import dayjs from 'dayjs';
 import { ref, reactive, computed, getCurrentInstance } from 'vue';
 import userMapApi from '@/api/fysp/userMapApi';
-import CompQuickSet from '@/views/fysp/evaluation/components/CompQuickSet.vue';
 
+import CompDeviceMatchEdit from '@/views/fysp/config/device/CompDeviceMatchEdit.vue';
+
+// fixme 2024.9.26 鍚庣画鍙互鐢╲ueuse涓殑鏃堕棿鏍煎紡鍖栨柟娉曟潵浠f浛
 const { $fm } = getCurrentInstance().appContext.config.globalProperties;
 
+/******** 鍖归厤璁板綍鏌ヨ ********/
 const tableRef = ref();
 const formSearch = reactive({
   locations: {},
@@ -78,4 +118,21 @@
   // formSearch.sourceType = param.sourceType;
   tableRef.value.onSearch();
 }
+
+function timeFormat(row) {
+  const time = row.createTime;
+  if (time) {
+    return $fm.formatYMDH(time);
+  } else {
+    return '';
+  }
+}
+
+/******** 鍖归厤璁板綍缂栬緫 ********/
+const drawerShow = ref(false);
+const selectedItem = ref(null);
+function itemEdit(row) {
+  selectedItem.value = row;
+  drawerShow.value = true;
+}
 </script>

--
Gitblit v1.9.3