From 5ad61d6ad3a0ce12c7fe0808527069b09a7c9c0d Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 16 九月 2025 17:31:05 +0800
Subject: [PATCH] 新增基础产品

---
 src/views/fysp/config/DeviceMatch.vue |  122 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 117 insertions(+), 5 deletions(-)

diff --git a/src/views/fysp/config/DeviceMatch.vue b/src/views/fysp/config/DeviceMatch.vue
index 82eafd2..31ce579 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
@@ -14,7 +14,11 @@
         :type="2"
         v-model:value="formSearch.scenetype"
       ></FYOptionScene>
-      <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
+      <FYOptionTime
+        :initValue="false"
+        type="month"
+        v-model:value="formSearch.time"
+      ></FYOptionTime>
     </template>
     <template #buttons> </template>
 
@@ -24,11 +28,79 @@
       </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="150">
+        <template #default="{ row }">
+          <el-button
+            v-show="row.deviceCode"
+            type="primary"
+            size="small"
+            @click="itemEdit(row)"
+            >缂栬緫</el-button
+          >
+          <el-button type="success" size="small" @click="itemAdd(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"
+      @save="onSave"
+    ></CompDeviceMatchEdit>
+  </el-drawer>
 </template>
 <script setup>
 /**
@@ -37,10 +109,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 +153,41 @@
   // 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;
+}
+
+/**
+ * 鍚戠敤鎴锋坊鍔犳柊璁惧
+ * 涓嶄紶閫掍富閿甶d鍜岃澶囦俊鎭紝浠ユ琛ㄧず闇�瑕佹坊鍔犳柊鐨勮澶�
+ * @param row 閫変腑鐨勮鏁版嵁
+ */
+function itemAdd(row) {
+  selectedItem.value = {
+    svUserName: row.svUserName,
+    tzUserName: row.tzUserName,
+    svUserId: row.svUserId,
+    tzUserId: row.tzUserId
+  };
+  drawerShow.value = true;
+}
+
+function onSave() {
+  tableRef.value.onSearch();
+  drawerShow.value = false;
+}
 </script>

--
Gitblit v1.9.3