Browse Source

wyn6月20号提交

wyn 4 tháng trước cách đây
mục cha
commit
49a4691bea

+ 6 - 8
src/views/hw/hardware/information/HardwareForm.vue

@@ -33,7 +33,7 @@
             <el-tree-select
               v-model="formData.hardwareTypeId"
               :data="hardwareTypeOption"
-              :props="defaultProps"
+              :props="{ value: 'id', label: 'hardwareTypeName', children: 'children' }"
               @change="onSelectChange"
               placeholder="请选择硬件类型"
             />
@@ -189,11 +189,7 @@ const formRules = reactive({
 const formRef = ref() // 表单 Ref
 const hardwareTypeOption = ref([]) // 硬件类型选项
 
-// 树形配置
-const defaultProps = {
-  children: 'children',
-  label: 'label'
-}
+
 
 /** 打开弹窗 */
 const open = async (type: string, id?: number) => {
@@ -283,9 +279,11 @@ const onSelectChange = (selectedId: number) => {
 
 /** 获取硬件类型树形数据 */
 const getHardwareTypeTree = async () => {
-  const data = { pageNo: 1, pageSize: 10000 }
+  const data = { pageNo: 1, pageSize: -1 }
   const response = await HardwareTypeApi.listHardwareType(data)
-  hardwareTypeOption.value = handleTree(response.records)
+  console.log(response,'数据拿到了没')
+  hardwareTypeOption.value = handleTree(response.list,'id', 'parentTypeId')
+
 }
 
 /** 初始化 **/

+ 2 - 2
src/views/hw/hardware/information/index.vue

@@ -173,7 +173,7 @@ import { handleTree } from '@/utils/tree'
 import * as HardwareApi from '@/api/hw/hardware/information/index'
 import * as HardwareTypeApi from '@/api//hw/type/hardwaretype/index'
 import HardwareForm from './HardwareForm.vue'
-import {listHardwareType} from "@/api//hw/type/hardwaretype/index";
+
 
 defineOptions({ name: 'HardwareInfo' })
 
@@ -265,7 +265,7 @@ const handleDelete = async (id?: number) => {
 
 /** 获取硬件类型树形数据 */
 const getHardwareTypeTree = async () => {
-  const data = { pageNo: 1, pageSize: 10000 }
+  const data = { pageNo: 1, pageSize: -1 }
   const response = await HardwareTypeApi.listHardwareType(data)
   hardwareTypeOption.value = handleTree(response.list)
 }

+ 1 - 1
src/views/hw/type/hardwaretype/HardwareTypeForm.vue

@@ -105,7 +105,7 @@ const autoGenFlag = ref(false)
 const getTypeTree = async () => {
   try {
     const data = await HardwareTypeApi.listHardwareType({ pageNo: 1, pageSize: -1 })
-    typeOptions.value  = handleTree(data.list)
+    typeOptions.value  = handleTree(data.list,'id', 'parentTypeId')
   } catch (error) {
     console.error('获取岗位树选项失败:', error)
   }

+ 5 - 5
src/views/hw/type/locksettype/index.vue

@@ -67,10 +67,10 @@
       <el-table-column
         prop="locksetTypeName"
         label="锁具机构类型名称"
-        width="260"
+
         align="center"
       />
-      <el-table-column label="锁具机构类型图标" width="260" align="center">
+      <el-table-column label="锁具机构类型图标"  align="center">
         <template #default="{ row }">
           <el-image
             v-if="row.locksetTypeIcon"
@@ -80,7 +80,7 @@
           <span v-else>-</span>
         </template>
       </el-table-column>
-      <el-table-column label="锁具机构类型图片" width="260" align="center">
+      <el-table-column label="锁具机构类型图片"  align="center">
         <template #default="{ row }">
           <el-image
             v-if="row.locksetTypeImg"
@@ -93,10 +93,10 @@
       <el-table-column
         prop="locksetTypeSpec"
         label="锁具机构类型规格"
-        width="260"
+        
         align="center"
       />
-      <el-table-column label="操作" align="center" width="200">
+      <el-table-column label="操作" align="center" >
         <template #default="scope">
           <el-button
             link