yanghao 1 天之前
父節點
當前提交
0257b97c12

+ 11 - 8
src/views/pms/device/allotlog/DeviceAllot.vue

@@ -1,12 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" v-if="treeShow">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -150,7 +146,13 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          v-loading="loading"
+          :data="list"
+          height="calc(85vh - 173px)"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('monitor.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
@@ -213,7 +215,7 @@
 import download from '@/utils/download'
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
 import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
 import DeviceAllotLogDrawer from '@/views/pms/device/allotlog/DeviceAllotLogDrawer.vue'
 import { rangeShortcuts } from '@/utils/formatTime'
@@ -230,6 +232,7 @@ const ifShow = ref(false)
 const isDetail = ref(false) // 是否查看详情
 const list = ref<IotDeviceVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,

+ 11 - 8
src/views/pms/device/completeSet/DeviceCompleteSet.vue

@@ -1,12 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" v-if="treeShow">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -50,7 +46,13 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          v-loading="loading"
+          height="calc(85vh - 130px)"
+          :data="list"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('monitor.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
@@ -226,7 +228,7 @@
 
 <script setup lang="ts">
 import { IotDeviceApi } from '@/api/pms/device'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { defaultProps, handleTree } from '@/utils/tree'
 import * as DeptApi from '@/api/system/dept'
 import { ElMessageBox } from 'element-plus'
@@ -238,6 +240,7 @@ defineOptions({ name: 'IotDeviceComplete' })
 const loading = ref(true) // 列表的加载中
 
 const { t } = useI18n()
+let isLeftContentCollapsed = ref(false)
 
 const list = ref([]) // 列表的数据
 const total = ref(0) // 列表的总页数

+ 5 - 9
src/views/pms/device/index.vue

@@ -1,13 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <!--      <div><Icon icon="ep:edit" @click="shou(treeShow)"/> </div>-->
-      <ContentWrap class="h-1/1" v-if="treeShow">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -171,7 +166,7 @@
           :data="list"
           :stripe="true"
           :show-overflow-tooltip="true"
-          height="65vh"
+          height="calc(85vh - 215px)"
           @sort-change="handleSortChange"
         >
           <el-table-column :label="t('iotDevice.serial')" width="70" align="center" fixed="left">
@@ -696,7 +691,7 @@
 import download from '@/utils/download'
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
 import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 
 import { buildSortingField } from '@/utils'
 import { defaultProps, handleTree } from '@/utils/tree'
@@ -720,6 +715,7 @@ const isDetail = ref(false) // 是否查看详情
 const list = ref<IotDeviceVO[]>([]) // 列表的数据
 const productClassifyList = ref<Tree[]>([]) // 树形结构
 const total = ref(0) // 列表的总页数
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,

+ 4 - 7
src/views/pms/device/monitor/index.vue

@@ -1,12 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap v-loading="loading">
         <ContentWrap>
           <!-- 搜索工作栏 -->
@@ -295,7 +291,7 @@ import { DICT_TYPE, getDictLabel, getStrDictOptions } from '@/utils/dict'
 import { dateFormatter } from '@/utils/formatTime'
 import { DeviceApi, DeviceVO } from '@/api/iot/device/device'
 import download from '@/utils/download'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { IotDeviceApi } from '@/api/pms/device'
 /** IoT 设备列表 */
 defineOptions({ name: 'IoTDeviceMonitor' })
@@ -306,6 +302,7 @@ const { t } = useI18n() // 国际化
 const loading = ref(true) // 列表加载中
 const list = ref<DeviceVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 12,

+ 11 - 8
src/views/pms/device/personlog/DevicePerson.vue

@@ -1,12 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" v-if="treeShow">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -105,7 +101,13 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          height="calc(85vh - 175px)"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('monitor.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
@@ -155,7 +157,7 @@
 <script setup lang="ts">
 import download from '@/utils/download'
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
 import DevicePersonLogDrawer from '@/views/pms/device/personlog/DevicePersonLogDrawer.vue'
 import { rangeShortcuts } from '@/utils/formatTime'
@@ -171,6 +173,7 @@ const loading = ref(true) // 列表的加载中
 const ifShow = ref(false)
 const list = ref<IotDeviceVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,

+ 11 - 8
src/views/pms/device/statuslog/DeviceStatus.vue

@@ -1,12 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" v-if="treeShow">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -145,7 +141,13 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          height="calc(85vh - 175px)"
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('monitor.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
@@ -208,7 +210,7 @@
 import download from '@/utils/download'
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
 import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
 import DeviceStatusLogDrawer from '@/views/pms/device/statuslog/DeviceStatusLogDrawer.vue'
 import { rangeShortcuts } from '@/utils/formatTime'
@@ -225,6 +227,7 @@ const ifShow = ref(false)
 const list = ref<IotDeviceVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
 const currentDeviceId = ref() // 设备id
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,

+ 68 - 31
src/views/pms/failure/index.vue

@@ -1,11 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -15,15 +11,15 @@
           :inline="true"
           label-width="68px"
         >
-<!--          <el-form-item label="故障编码" prop="failureCode">-->
-<!--            <el-input-->
-<!--              v-model="queryParams.failureCode"-->
-<!--              placeholder="请输入故障编码"-->
-<!--              clearable-->
-<!--              @keyup.enter="handleQuery"-->
-<!--              class="!w-200px"-->
-<!--            />-->
-<!--          </el-form-item>-->
+          <!--          <el-form-item label="故障编码" prop="failureCode">-->
+          <!--            <el-input-->
+          <!--              v-model="queryParams.failureCode"-->
+          <!--              placeholder="请输入故障编码"-->
+          <!--              clearable-->
+          <!--              @keyup.enter="handleQuery"-->
+          <!--              class="!w-200px"-->
+          <!--            />-->
+          <!--          </el-form-item>-->
           <el-form-item :label="t('fault.faultTitle')" label-width="70px" prop="failureName">
             <el-input
               v-model="queryParams.failureName"
@@ -34,7 +30,12 @@
             />
           </el-form-item>
           <el-form-item :label="t('fault.status')" label-width="40px" prop="status">
-            <el-select v-model="queryParams.status" :placeholder="t('fault.status')" clearable class="!w-200px">
+            <el-select
+              v-model="queryParams.status"
+              :placeholder="t('fault.status')"
+              clearable
+              class="!w-200px"
+            >
               <el-option
                 v-for="dict in getStrDictOptions(DICT_TYPE.PMS_FAILURE_STATUS)"
                 :key="dict.value"
@@ -112,8 +113,7 @@
           </el-form-item>
           <el-form-item>
             <el-button v-if="!ifShow" @click="moreQuery(true)" type="warning"
-              ><Icon icon="ep:search" class="mr-5px" />
-              {{ t('fault.moreSearch') }}</el-button
+              ><Icon icon="ep:search" class="mr-5px" /> {{ t('fault.moreSearch') }}</el-button
             >
             <el-button v-if="ifShow" @click="moreQuery(false)" type="danger"
               ><Icon icon="ep:search" class="mr-5px" /> {{ t('fault.closeSearch') }}</el-button
@@ -142,27 +142,58 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          height="calc(85vh - 130px)"
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('fault.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
             </template>
           </el-table-column>
           <!--        <el-table-column label="故障编码" align="center" prop="failureCode" />-->
-          <el-table-column :label="t('fault.faultTitle')" align="left" prop="failureName" min-width="350"/>
-          <el-table-column :label="t('iotMaintain.deviceCode')" align="center" prop="deviceCode" min-width="220" />
-          <el-table-column :label="t('fault.deviceName')" align="center" prop="deviceName" min-width="240"/>
+          <el-table-column
+            :label="t('fault.faultTitle')"
+            align="left"
+            prop="failureName"
+            min-width="350"
+          />
+          <el-table-column
+            :label="t('iotMaintain.deviceCode')"
+            align="center"
+            prop="deviceCode"
+            min-width="220"
+          />
+          <el-table-column
+            :label="t('fault.deviceName')"
+            align="center"
+            prop="deviceName"
+            min-width="240"
+          />
           <el-table-column :label="t('fault.status')" align="center" prop="status" min-width="110">
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_FAILURE_STATUS" :value="scope.row.status" />
             </template>
           </el-table-column>
-          <el-table-column :label="t('faultForm.failureType')" align="center" prop="failureType" min-width="110">
+          <el-table-column
+            :label="t('faultForm.failureType')"
+            align="center"
+            prop="failureType"
+            min-width="110"
+          >
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.FAILURE_TYPE" :value="scope.row.failureType" />
             </template>
           </el-table-column>
-          <el-table-column :label="t('fault.approvalStatus')"  align="center" prop="auditStatus" min-width="130">
+          <el-table-column
+            :label="t('fault.approvalStatus')"
+            align="center"
+            prop="auditStatus"
+            min-width="130"
+          >
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.CRM_AUDIT_STATUS" :value="scope.row.auditStatus" />
             </template>
@@ -179,9 +210,9 @@
             :formatter="dateFormatter"
             min-width="180px"
           />
-          <el-table-column :label="t('fault.solveTime')" align="center" prop="dealHour" >
+          <el-table-column :label="t('fault.solveTime')" align="center" prop="dealHour">
             <template #default="scope">
-              {{ scope.row.dealHour&&scope.row.dealHour>0?scope.row.dealHour+'H':"" }}
+              {{ scope.row.dealHour && scope.row.dealHour > 0 ? scope.row.dealHour + 'H' : '' }}
             </template>
           </el-table-column>
           <el-table-column
@@ -191,7 +222,12 @@
             :formatter="dateFormatter"
             min-width="180px"
           />
-          <el-table-column :label="t('fault.operation')" align="center" min-width="120px" fixed="right">
+          <el-table-column
+            :label="t('fault.operation')"
+            align="center"
+            min-width="120px"
+            fixed="right"
+          >
             <template #default="scope">
               <el-button
                 link
@@ -199,7 +235,7 @@
                 @click="openForm('detail', scope.row.id, true)"
                 v-hasPermi="['rq:iot-failure-report:query']"
               >
-                {{t('fault.view')}}
+                {{ t('fault.view') }}
               </el-button>
               <el-button
                 link
@@ -208,7 +244,7 @@
                 @click="openForm('update', scope.row.id, false)"
                 v-hasPermi="['rq:iot-failure-report:update']"
               >
-                {{t('fault.edit')}}
+                {{ t('fault.edit') }}
               </el-button>
               <el-button
                 link
@@ -217,7 +253,7 @@
                 @click="handleDelete(scope.row.id)"
                 v-hasPermi="['rq:iot-failure-report:delete']"
               >
-                {{t('fault.del')}}
+                {{ t('fault.del') }}
               </el-button>
             </template>
           </el-table-column>
@@ -242,7 +278,7 @@ import download from '@/utils/download'
 import { IotFailureReportApi, IotFailureReportVO } from '@/api/pms/failure'
 import IotFailureReportForm from './IotFailureReportForm.vue'
 import { DICT_TYPE, getBoolDictOptions, getStrDictOptions } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 
 /** 故障上报 列表 */
 defineOptions({ name: 'IotFailureReport' })
@@ -253,6 +289,7 @@ const ifShow = ref(false)
 const loading = ref(true) // 列表的加载中
 const list = ref<IotFailureReportVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,

+ 138 - 131
src/views/pms/inspect/item/index.vue

@@ -1,134 +1,141 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-  <el-col :span="20" :xs="24">
-  <ContentWrap>
-    <!-- 搜索工作栏 -->
-    <el-form
-      class="-mb-15px"
-      :model="queryParams"
-      ref="queryFormRef"
-      :inline="true"
-      label-width="68px"
-    >
-      <el-form-item :label="t('deviceForm.category')" prop="deviceClassify" style="width: 15vw" >
-        <el-tree-select
-          v-model="queryParams.deviceClassify"
-          :data="productClassifyList"
-          :props="defaultProps"
-          check-strictly
-          node-key="id"
-          :placeholder="t('deviceForm.categoryHolder')"
-          filterable
-        />
-      </el-form-item>
-      <el-form-item :label="t('inspect.InspectionItems')" prop="item" style="margin-left: 30px">
-        <el-input
-          v-model="queryParams.item"
-          :placeholder="t('inspect.itemHolder')"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item :label="t('common.createTime')" prop="createTime" label-width="100px">
-        <el-date-picker
-          v-model="queryParams.createTime"
-          value-format="YYYY-MM-DD HH:mm:ss"
-          type="daterange"
-          :start-placeholder="t('operationFill.start')"
-          :end-placeholder="t('operationFill.end')"
-          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-          class="!w-220px"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" />
-          {{ t('operationFill.search') }}</el-button>
-        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> {{ t('operationFill.reset') }}</el-button>
-        <el-button
-          type="primary"
-          plain
-          @click="openForm('create')"
-          v-hasPermi="['rq:iot-inspect-item:create']"
-        >
-          <Icon icon="ep:plus" class="mr-5px" /> {{ t('operationFill.add') }}
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          @click="handleExport"
-          :loading="exportLoading"
-          v-hasPermi="['rq:iot-inspect-item:export']"
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
+      <ContentWrap>
+        <!-- 搜索工作栏 -->
+        <el-form
+          class="-mb-15px"
+          :model="queryParams"
+          ref="queryFormRef"
+          :inline="true"
+          label-width="68px"
         >
-          <Icon icon="ep:download" class="mr-5px" /> 导出
-        </el-button>
-      </el-form-item>
-    </el-form>
-  </ContentWrap>
+          <el-form-item :label="t('deviceForm.category')" prop="deviceClassify" style="width: 15vw">
+            <el-tree-select
+              v-model="queryParams.deviceClassify"
+              :data="productClassifyList"
+              :props="defaultProps"
+              check-strictly
+              node-key="id"
+              :placeholder="t('deviceForm.categoryHolder')"
+              filterable
+            />
+          </el-form-item>
+          <el-form-item :label="t('inspect.InspectionItems')" prop="item" style="margin-left: 30px">
+            <el-input
+              v-model="queryParams.item"
+              :placeholder="t('inspect.itemHolder')"
+              clearable
+              @keyup.enter="handleQuery"
+              class="!w-240px"
+            />
+          </el-form-item>
+          <el-form-item :label="t('common.createTime')" prop="createTime" label-width="100px">
+            <el-date-picker
+              v-model="queryParams.createTime"
+              value-format="YYYY-MM-DD HH:mm:ss"
+              type="daterange"
+              :start-placeholder="t('operationFill.start')"
+              :end-placeholder="t('operationFill.end')"
+              :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
+              class="!w-220px"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button @click="handleQuery"
+              ><Icon icon="ep:search" class="mr-5px" /> {{ t('operationFill.search') }}</el-button
+            >
+            <el-button @click="resetQuery"
+              ><Icon icon="ep:refresh" class="mr-5px" /> {{ t('operationFill.reset') }}</el-button
+            >
+            <el-button
+              type="primary"
+              plain
+              @click="openForm('create')"
+              v-hasPermi="['rq:iot-inspect-item:create']"
+            >
+              <Icon icon="ep:plus" class="mr-5px" /> {{ t('operationFill.add') }}
+            </el-button>
+            <el-button
+              type="success"
+              plain
+              @click="handleExport"
+              :loading="exportLoading"
+              v-hasPermi="['rq:iot-inspect-item:export']"
+            >
+              <Icon icon="ep:download" class="mr-5px" /> 导出
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </ContentWrap>
 
-  <!-- 列表 -->
-  <ContentWrap>
-    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-<!--      <el-table-column label="主键id" align="center" prop="id" />-->
-      <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
-        <template #default="scope">
-          {{ scope.$index + 1 }}
-        </template>
-      </el-table-column>
-      <el-table-column :label="t('monitor.category')" align="center" prop="deviceClassifyName" />
-      <el-table-column :label="t('iotDevice.brand')" align="center" prop="brandName" />
-      <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" />
-      <el-table-column :label="t('monitor.deviceName')" align="center" prop="deviceName" />
-      <el-table-column :label="t('inspect.InspectionItems')" align="center" prop="item" />
-      <el-table-column :label="t('inspect.InspectionStandards')" align="center" prop="standard" />
-      <el-table-column :label="t('inspect.createName')" align="center" prop="createName" />
-<!--      <el-table-column :label="t('common.sort')" align="center" prop="sort" />-->
-<!--      <el-table-column :label="t('form.remark')" align="center" prop="remark" />-->
+      <!-- 列表 -->
+      <ContentWrap>
+        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+          <!--      <el-table-column label="主键id" align="center" prop="id" />-->
+          <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
+            <template #default="scope">
+              {{ scope.$index + 1 }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            :label="t('monitor.category')"
+            align="center"
+            prop="deviceClassifyName"
+          />
+          <el-table-column :label="t('iotDevice.brand')" align="center" prop="brandName" />
+          <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" />
+          <el-table-column :label="t('monitor.deviceName')" align="center" prop="deviceName" />
+          <el-table-column :label="t('inspect.InspectionItems')" align="center" prop="item" />
+          <el-table-column
+            :label="t('inspect.InspectionStandards')"
+            align="center"
+            prop="standard"
+          />
+          <el-table-column :label="t('inspect.createName')" align="center" prop="createName" />
+          <!--      <el-table-column :label="t('common.sort')" align="center" prop="sort" />-->
+          <!--      <el-table-column :label="t('form.remark')" align="center" prop="remark" />-->
 
-      <el-table-column
-        :label="t('common.createTime')"
-        align="center"
-        prop="createTime"
-        :formatter="dateFormatter"
-        width="180px"
-      />
-<!--      <el-table-column label="部门id" align="center" prop="deptId" />-->
-      <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
-        <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            @click="openForm('update', scope.row.id)"
-            v-hasPermi="['rq:iot-inspect-item:update']"
-          >
-            {{ t('fault.edit') }}
-          </el-button>
-          <el-button
-            link
-            type="danger"
-            @click="handleDelete(scope.row.id)"
-            v-hasPermi="['rq:iot-inspect-item:delete']"
-          >
-            {{ t('fault.del') }}
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <!-- 分页 -->
-    <Pagination
-      :total="total"
-      v-model:page="queryParams.pageNo"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-  </ContentWrap>
-  </el-col>
-    </el-row>
+          <el-table-column
+            :label="t('common.createTime')"
+            align="center"
+            prop="createTime"
+            :formatter="dateFormatter"
+            width="180px"
+          />
+          <!--      <el-table-column label="部门id" align="center" prop="deptId" />-->
+          <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
+            <template #default="scope">
+              <el-button
+                link
+                type="primary"
+                @click="openForm('update', scope.row.id)"
+                v-hasPermi="['rq:iot-inspect-item:update']"
+              >
+                {{ t('fault.edit') }}
+              </el-button>
+              <el-button
+                link
+                type="danger"
+                @click="handleDelete(scope.row.id)"
+                v-hasPermi="['rq:iot-inspect-item:delete']"
+              >
+                {{ t('fault.del') }}
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!-- 分页 -->
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </ContentWrap>
+    </el-col>
+  </el-row>
 
   <!-- 表单弹窗:添加/修改 -->
   <IotInspectItemForm ref="formRef" @success="getList" />
@@ -139,16 +146,16 @@ import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { IotInspectItemApi, IotInspectItemVO } from '@/api/pms/inspect/item'
 import IotInspectItemForm from './IotInspectItemForm.vue'
-import {defaultProps, handleTree} from "@/utils/tree";
-import * as ProductClassifyApi from "@/api/pms/productclassify";
-import DeptTree from "@/views/system/user/DeptTree.vue";
+import { defaultProps, handleTree } from '@/utils/tree'
+import * as ProductClassifyApi from '@/api/pms/productclassify'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 
 /** 巡检项 列表 */
 defineOptions({ name: 'IotInspectItem' })
 
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
-
+let isLeftContentCollapsed = ref(false)
 const loading = ref(true) // 列表的加载中
 const list = ref<IotInspectItemVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
@@ -161,7 +168,7 @@ const queryParams = reactive({
   sort: undefined,
   remark: undefined,
   createTime: [],
-  deptId: undefined,
+  deptId: undefined
 })
 const productClassifyList = ref<Tree[]>([]) // 树形结构
 const queryFormRef = ref() // 搜索的表单

+ 5 - 8
src/views/pms/inspect/order/index.vue

@@ -1,11 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -93,7 +89,7 @@
           v-loading="loading"
           :data="list"
           :stripe="true"
-          height="65vh"
+          height="calc(85vh - 175px)"
           :show-overflow-tooltip="true"
         >
           <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
@@ -251,7 +247,7 @@ import download from '@/utils/download'
 import { IotInspectOrderApi, IotInspectOrderVO } from '@/api/pms/inspect/order'
 import IotInspectOrderForm from './IotInspectOrderForm.vue'
 import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 
 const { push } = useRouter()
 const { params } = useRoute()
@@ -266,6 +262,7 @@ const status = params.status
 const deptId = params.deptId
 const createTime = params.createTime
 const total = ref(0) // 列表的总页数
+let isLeftContentCollapsed = ref(false)
 const dialogVisible = ref(false)
 const queryParams = reactive({
   pageNo: 1,

+ 115 - 90
src/views/pms/inspect/plan/index.vue

@@ -1,22 +1,8 @@
 <template>
   <el-row :gutter="20">
-    <el-col :class="{'leftcontent': true, 'collapsed': isLeftContentCollapsed}" :span="isLeftContentCollapsed ? 0 : 4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
 
-    <el-col class="rightcontent" :span="isLeftContentCollapsed ? 24 : 20" :xs="24" style="position: relative;height: 100vh;">
-        <div
-            class="toggle-button"
-            :style="{ left: isLeftContentCollapsed ? '0px' : '-13px' }"
-            @click="toggleLeftContent"
-            @mouseover="handleMouseOver"
-            @mouseout="handleMouseOut"
-            :title="hoverText"
-          >
-            <span style="font-size: 5px;" :class="{'triangle': true, 'rotated': isLeftContentCollapsed}"></span>
-        </div>
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -56,8 +42,12 @@
             />
           </el-form-item>
           <el-form-item>
-            <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> {{ t('operationFill.search') }}</el-button>
-            <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />  {{ t('operationFill.reset') }}</el-button>
+            <el-button @click="handleQuery"
+              ><Icon icon="ep:search" class="mr-5px" /> {{ t('operationFill.search') }}</el-button
+            >
+            <el-button @click="resetQuery"
+              ><Icon icon="ep:refresh" class="mr-5px" /> {{ t('operationFill.reset') }}</el-button
+            >
             <el-button
               type="primary"
               plain
@@ -87,10 +77,30 @@
               {{ scope.$index + 1 }}
             </template>
           </el-table-column>
-          <el-table-column :label="t('route.planTitle')" align="center" prop="planTitle" min-width="240" />
-          <el-table-column :label="t('route.planNumber')" align="center" prop="planCode" min-width="200" />
-          <el-table-column :label="t('route.cycle')" align="center" prop="planCycle"  min-width="80"/>
-          <el-table-column :label="t('workOrderMaterial.unit')" align="center" prop="planUnit" min-width="80">
+          <el-table-column
+            :label="t('route.planTitle')"
+            align="center"
+            prop="planTitle"
+            min-width="240"
+          />
+          <el-table-column
+            :label="t('route.planNumber')"
+            align="center"
+            prop="planCode"
+            min-width="200"
+          />
+          <el-table-column
+            :label="t('route.cycle')"
+            align="center"
+            prop="planCycle"
+            min-width="80"
+          />
+          <el-table-column
+            :label="t('workOrderMaterial.unit')"
+            align="center"
+            prop="planUnit"
+            min-width="80"
+          >
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_INSPECT_UNIT" :value="scope.row.planUnit" />
             </template>
@@ -119,9 +129,24 @@
             :formatter="dateFormatter"
             min-width="180px"
           />
-          <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" min-width="130"/>
-          <el-table-column :label="t('inspect.createName')" align="center" prop="createName" min-width="130"/>
-          <el-table-column :label="t('operationFill.operation')" align="center" min-width="180" fixed="right">
+          <el-table-column
+            :label="t('iotDevice.dept')"
+            align="center"
+            prop="deptName"
+            min-width="130"
+          />
+          <el-table-column
+            :label="t('inspect.createName')"
+            align="center"
+            prop="createName"
+            min-width="130"
+          />
+          <el-table-column
+            :label="t('operationFill.operation')"
+            align="center"
+            min-width="180"
+            fixed="right"
+          >
             <template #default="scope">
               <el-button
                 link
@@ -157,26 +182,26 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, onMounted } from 'vue';
-import { dateFormatter } from '@/utils/formatTime';
-import download from '@/utils/download';
-import { IotInspectPlanApi, IotInspectPlanVO } from '@/api/pms/inspect/plan';
-import IotInspectPlanForm from './IotInspectPlanForm.vue';
-import { CommonStatusEnum } from '@/utils/constants';
-import { DICT_TYPE } from "@/utils/dict";
-import DeptTree from "@/views/system/user/DeptTree.vue";
-import { useRouter } from 'vue-router';
-import { useI18n } from 'vue-i18n';
+import { ref, reactive, onMounted } from 'vue'
+import { dateFormatter } from '@/utils/formatTime'
+import download from '@/utils/download'
+import { IotInspectPlanApi, IotInspectPlanVO } from '@/api/pms/inspect/plan'
+import IotInspectPlanForm from './IotInspectPlanForm.vue'
+import { CommonStatusEnum } from '@/utils/constants'
+import { DICT_TYPE } from '@/utils/dict'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
+import { useRouter } from 'vue-router'
+import { useI18n } from 'vue-i18n'
 
 defineOptions({ name: 'IotInspectPlan' })
 const message = useMessage() // 消息弹窗
 
-const { push } = useRouter();
-const { t } = useI18n();
+const { push } = useRouter()
+const { t } = useI18n()
 
-const loading = ref(true);
-const list = ref<IotInspectPlanVO[]>([]);
-const total = ref(0);
+const loading = ref(true)
+const list = ref<IotInspectPlanVO[]>([])
+const total = ref(0)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -189,57 +214,58 @@ const queryParams = reactive({
   remark: undefined,
   createTime: [],
   deptId: undefined
-});
-const queryFormRef = ref();
-const exportLoading = ref(false);
+})
+const queryFormRef = ref()
+const exportLoading = ref(false)
 
-const isLeftContentCollapsed = ref(false);
-const hoverText = ref('');
+const isLeftContentCollapsed = ref(false)
+const hoverText = ref('')
 const selectedDept = ref<{ id: number; name: string }>()
 
 const handleDeptNodeClick = async (row) => {
   selectedDept.value = { id: row.id, name: row.name }
-  queryParams.deptId = row.id;
-  await getList();
-};
+  queryParams.deptId = row.id
+  await getList()
+}
 
 const handleStatusChange = async (row: IotInspectPlanVO) => {
   try {
-    const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用';
-    await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?');
-    await IotInspectPlanApi.updateIotInspectStatus(row.id, row.status);
-    await getList();
+    const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
+    await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?')
+    await IotInspectPlanApi.updateIotInspectStatus(row.id, row.status)
+    await getList()
   } catch {
-    row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
+    row.status =
+      row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
   }
-};
+}
 
 const getList = async () => {
-  loading.value = true;
+  loading.value = true
   try {
-    const data = await IotInspectPlanApi.getIotInspectPlanPage(queryParams);
-    list.value = data.list;
-    total.value = data.total;
+    const data = await IotInspectPlanApi.getIotInspectPlanPage(queryParams)
+    list.value = data.list
+    total.value = data.total
   } finally {
-    loading.value = false;
+    loading.value = false
   }
-};
+}
 
 const handleQuery = () => {
-  queryParams.pageNo = 1;
-  getList();
-};
+  queryParams.pageNo = 1
+  getList()
+}
 
 const resetQuery = () => {
-  queryFormRef.value.resetFields();
+  queryFormRef.value.resetFields()
   selectedDept.value = undefined
-  handleQuery();
-};
+  handleQuery()
+}
 
 const openForm = (type: string, id?: number) => {
   if (typeof id === 'number') {
-    push({ name: 'InspectPlanEdit', params: { id } });
-    return;
+    push({ name: 'InspectPlanEdit', params: { id } })
+    return
   }
   push({
     name: 'InspectPlanAdd',
@@ -248,44 +274,44 @@ const openForm = (type: string, id?: number) => {
       deptName: selectedDept.value?.name
     }
   })
-};
+}
 
 const handleDelete = async (id: number) => {
   try {
-    await message.delConfirm();
-    await IotInspectPlanApi.deleteIotInspectPlan(id);
-    message.success(t('common.delSuccess'));
-    await getList();
+    await message.delConfirm()
+    await IotInspectPlanApi.deleteIotInspectPlan(id)
+    message.success(t('common.delSuccess'))
+    await getList()
   } catch {}
-};
+}
 
 const handleExport = async () => {
   try {
-    await message.exportConfirm();
-    exportLoading.value = true;
-    const data = await IotInspectPlanApi.exportIotInspectPlan(queryParams);
-    download.excel(data, '巡检计划.xls');
+    await message.exportConfirm()
+    exportLoading.value = true
+    const data = await IotInspectPlanApi.exportIotInspectPlan(queryParams)
+    download.excel(data, '巡检计划.xls')
   } catch {
   } finally {
-    exportLoading.value = false;
+    exportLoading.value = false
   }
-};
+}
 
 const toggleLeftContent = () => {
-  isLeftContentCollapsed.value = !isLeftContentCollapsed.value;
-};
+  isLeftContentCollapsed.value = !isLeftContentCollapsed.value
+}
 
 const handleMouseOver = () => {
-  hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起';
-};
+  hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起'
+}
 
 const handleMouseOut = () => {
-  hoverText.value = '';
-};
+  hoverText.value = ''
+}
 
 onMounted(() => {
-  getList();
-});
+  getList()
+})
 </script>
 
 <style scoped>
@@ -306,7 +332,7 @@ onMounted(() => {
 .toggle-button {
   position: absolute;
   top: 44%;
-  transform: translate(-65%,-50%);
+  transform: translate(-65%, -50%);
   width: 12px;
   height: 40px;
   background-color: #f0f0f0;
@@ -324,7 +350,6 @@ onMounted(() => {
   background-color: #afafaf;
 }
 
-
 .triangle {
   width: 0;
   height: 0;

+ 135 - 132
src/views/pms/inspect/route/index.vue

@@ -1,133 +1,136 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
-  <ContentWrap>
-    <!-- 搜索工作栏 -->
-    <el-form
-      class="-mb-15px"
-      :model="queryParams"
-      ref="queryFormRef"
-      :inline="true"
-      label-width="68px"
-    >
-      <el-form-item :label="t('route.RouteName')" prop="routeName" style="margin-left: 25px">
-        <el-input
-          v-model="queryParams.routeName"
-          :placeholder="t('route.nHolder')"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-<!--      <el-form-item :label="t('monitor.category')" prop="deviceClassify">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.deviceClassify"-->
-<!--          :placeholder="t('deviceForm.categoryHolder')"-->
-<!--          clearable-->
-<!--          @keyup.enter="handleQuery"-->
-<!--          class="!w-240px"-->
-<!--        />-->
-<!--      </el-form-item>-->
-      <el-form-item :label="t('monitor.category')" prop="deviceClassify" style="width: 15vw" >
-        <el-tree-select
-          v-model="queryParams.deviceClassify"
-          :data="productClassifyList"
-          :props="defaultProps"
-          check-strictly
-          node-key="id"
-          :placeholder="t('deviceForm.categoryHolder')"
-          filterable
-        />
-      </el-form-item>
-      <el-form-item :label="t('monitor.deviceName')"  prop="deviceName">
-        <el-input
-          v-model="queryParams.deviceName"
-          :placeholder="t('iotDevice.nameHolder')"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" />
-          {{t('file.search')}}</el-button>
-        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> {{t('file.reset')}}</el-button>
-        <el-button
-          type="primary"
-          plain
-          @click="openForm('create')"
-          v-hasPermi="['rq:iot-inspect-route:create']"
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
+      <ContentWrap>
+        <!-- 搜索工作栏 -->
+        <el-form
+          class="-mb-15px"
+          :model="queryParams"
+          ref="queryFormRef"
+          :inline="true"
+          label-width="68px"
         >
-          <Icon icon="ep:plus" class="mr-5px" /> {{t('fault.added')}}
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          @click="handleExport"
-          :loading="exportLoading"
-          v-hasPermi="['rq:iot-inspect-route:export']"
-        >
-          <Icon icon="ep:download" class="mr-5px" /> 导出
-        </el-button>
-      </el-form-item>
-    </el-form>
-  </ContentWrap>
+          <el-form-item :label="t('route.RouteName')" prop="routeName" style="margin-left: 25px">
+            <el-input
+              v-model="queryParams.routeName"
+              :placeholder="t('route.nHolder')"
+              clearable
+              @keyup.enter="handleQuery"
+              class="!w-240px"
+            />
+          </el-form-item>
+          <!--      <el-form-item :label="t('monitor.category')" prop="deviceClassify">-->
+          <!--        <el-input-->
+          <!--          v-model="queryParams.deviceClassify"-->
+          <!--          :placeholder="t('deviceForm.categoryHolder')"-->
+          <!--          clearable-->
+          <!--          @keyup.enter="handleQuery"-->
+          <!--          class="!w-240px"-->
+          <!--        />-->
+          <!--      </el-form-item>-->
+          <el-form-item :label="t('monitor.category')" prop="deviceClassify" style="width: 15vw">
+            <el-tree-select
+              v-model="queryParams.deviceClassify"
+              :data="productClassifyList"
+              :props="defaultProps"
+              check-strictly
+              node-key="id"
+              :placeholder="t('deviceForm.categoryHolder')"
+              filterable
+            />
+          </el-form-item>
+          <el-form-item :label="t('monitor.deviceName')" prop="deviceName">
+            <el-input
+              v-model="queryParams.deviceName"
+              :placeholder="t('iotDevice.nameHolder')"
+              clearable
+              @keyup.enter="handleQuery"
+              class="!w-240px"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button @click="handleQuery"
+              ><Icon icon="ep:search" class="mr-5px" /> {{ t('file.search') }}</el-button
+            >
+            <el-button @click="resetQuery"
+              ><Icon icon="ep:refresh" class="mr-5px" /> {{ t('file.reset') }}</el-button
+            >
+            <el-button
+              type="primary"
+              plain
+              @click="openForm('create')"
+              v-hasPermi="['rq:iot-inspect-route:create']"
+            >
+              <Icon icon="ep:plus" class="mr-5px" /> {{ t('fault.added') }}
+            </el-button>
+            <el-button
+              type="success"
+              plain
+              @click="handleExport"
+              :loading="exportLoading"
+              v-hasPermi="['rq:iot-inspect-route:export']"
+            >
+              <Icon icon="ep:download" class="mr-5px" /> 导出
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </ContentWrap>
 
-  <!-- 列表 -->
-  <ContentWrap>
-    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-      <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
-        <template #default="scope">
-          {{ scope.$index + 1 }}
-        </template>
-      </el-table-column>
-      <el-table-column :label="t('route.RouteName')" align="center" prop="routeName" />
-      <el-table-column :label="t('monitor.category')" align="center" prop="deviceClassifyName" />
-      <el-table-column :label="t('monitor.deviceName')" align="center" prop="deviceName" />
-<!--      <el-table-column label="巡检项" align="center" prop="itemJson" />-->
-      <el-table-column :label="t('iotDevice.brand')" align="center" prop="brandName" />
-      <el-table-column
-        :label="t('common.createTime')"
-        align="center"
-        prop="createTime"
-        :formatter="dateFormatter"
-        width="180px"
-      />
-<!--      <el-table-column label="部门id" align="center" prop="deptId" />-->
-      <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
-        <template #default="scope">
-          <el-button
-            link
-            type="primary"
-            @click="openForm('update', scope.row.id)"
-            v-hasPermi="['rq:iot-inspect-route:update']"
-          >
-            {{ t('fault.edit') }}
-          </el-button>
-          <el-button
-            link
-            type="danger"
-            @click="handleDelete(scope.row.id)"
-            v-hasPermi="['rq:iot-inspect-route:delete']"
-          >
-            {{ t('fault.del') }}
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <!-- 分页 -->
-    <Pagination
-      :total="total"
-      v-model:page="queryParams.pageNo"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-  </ContentWrap>
+      <!-- 列表 -->
+      <ContentWrap>
+        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+          <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
+            <template #default="scope">
+              {{ scope.$index + 1 }}
+            </template>
+          </el-table-column>
+          <el-table-column :label="t('route.RouteName')" align="center" prop="routeName" />
+          <el-table-column
+            :label="t('monitor.category')"
+            align="center"
+            prop="deviceClassifyName"
+          />
+          <el-table-column :label="t('monitor.deviceName')" align="center" prop="deviceName" />
+          <!--      <el-table-column label="巡检项" align="center" prop="itemJson" />-->
+          <el-table-column :label="t('iotDevice.brand')" align="center" prop="brandName" />
+          <el-table-column
+            :label="t('common.createTime')"
+            align="center"
+            prop="createTime"
+            :formatter="dateFormatter"
+            width="180px"
+          />
+          <!--      <el-table-column label="部门id" align="center" prop="deptId" />-->
+          <el-table-column :label="t('operationFill.operation')" align="center" min-width="120px">
+            <template #default="scope">
+              <el-button
+                link
+                type="primary"
+                @click="openForm('update', scope.row.id)"
+                v-hasPermi="['rq:iot-inspect-route:update']"
+              >
+                {{ t('fault.edit') }}
+              </el-button>
+              <el-button
+                link
+                type="danger"
+                @click="handleDelete(scope.row.id)"
+                v-hasPermi="['rq:iot-inspect-route:delete']"
+              >
+                {{ t('fault.del') }}
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!-- 分页 -->
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </ContentWrap>
     </el-col>
   </el-row>
 
@@ -140,15 +143,15 @@ import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { IotInspectRouteApi, IotInspectRouteVO } from '@/api/pms/inspect/route'
 import IotInspectRouteForm from './IotInspectRouteForm.vue'
-import DeptTree from "@/views/system/user/DeptTree.vue";
-import {defaultProps} from "@/utils/tree";
+import DeptTree from '@/views/system/user/DeptTree2.vue'
+import { defaultProps } from '@/utils/tree'
 const { push } = useRouter() // 路由跳转
 /** 巡检路线 列表 */
 defineOptions({ name: 'IotInspectRoute' })
 
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
-
+let isLeftContentCollapsed = ref(false)
 const loading = ref(true) // 列表的加载中
 const list = ref<IotInspectRouteVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
@@ -164,7 +167,7 @@ const queryParams = reactive({
   itemJson: undefined,
   remark: undefined,
   createTime: [],
-  deptId: undefined,
+  deptId: undefined
 })
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
@@ -201,11 +204,11 @@ const resetQuery = () => {
 const openForm = (type: string, id?: number) => {
   //修改
   if (typeof id === 'number') {
-    push({ name: 'RouteEdit', params: {id } })
+    push({ name: 'RouteEdit', params: { id } })
     return
   }
   // 新增
-  push({ name: 'RouteAdd', params:{} })
+  push({ name: 'RouteAdd', params: {} })
 }
 
 /** 删除按钮操作 */

+ 11 - 9
src/views/pms/iotmainworkorder/IotDeviceMainAlarm.vue

@@ -1,12 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" v-if="treeShow">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -57,7 +53,13 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          height="calc(85vh - 135px)"
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('monitor.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
@@ -154,10 +156,10 @@ import download from '@/utils/download'
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
 import { IotMainWorkOrderApi } from '@/api/pms/iotmainworkorder'
 import { DICT_TYPE } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { useCache } from '@/hooks/web/useCache'
 import DeviceAlarmBomList from '@/views/pms/iotmainworkorder/DeviceAlarmBomList.vue'
-
+let isLeftContentCollapsed = ref(false)
 const showRunTime = computed(() => {
   const all = list.value?.map((item) => item.totalRunTime)
   return all.some((item) => Boolean(item))

+ 4 - 21
src/views/pms/iotmainworkorder/index.vue

@@ -1,20 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col
-      :class="{ leftcontent: true, collapsed: isLeftContentCollapsed }"
-      :span="isLeftContentCollapsed ? 1 : 4"
-      :xs="24"
-    >
-      <ContentWrap class="h-1/1">
-        <DeptTree v-model:collapsed="isLeftContentCollapsed" @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col
-      class="rightcontent"
-      :span="isLeftContentCollapsed ? 23 : 20"
-      :xs="24"
-      style="position: relative; height: 100vh"
-    >
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -95,6 +82,7 @@
           :stripe="true"
           style="width: 100%"
           ref="tableRef"
+          height="calc(85vh - 175px)"
         >
           <el-table-column
             :label="t('iotDevice.serial')"
@@ -289,7 +277,7 @@ import download from '@/utils/download'
 import { IotMainWorkOrderApi, IotMainWorkOrderVO } from '@/api/pms/iotmainworkorder'
 import IotMainWorkOrderForm from './IotMainWorkOrderForm.vue'
 import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { useUserStore } from '@/store/modules/user'
 const { push } = useRouter() // 路由跳转
 
@@ -338,7 +326,6 @@ const queryParams = reactive({
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
 
-
 // 定义表单验证规则
 const delayReasonRules = {
   delayReason: [
@@ -661,8 +648,6 @@ const getDistanceClass = (distance: number | string | null) => {
   return ''
 }
 
-
-
 /** 添加/修改操作 */
 const formRef = ref()
 const openForm = (type: string, id?: number) => {
@@ -836,8 +821,6 @@ watch(isLeftContentCollapsed, () => {
   width: 100% !important;
 }
 
-
-
 /* 延时原因 必填星号样式 */
 :deep(.required-item .el-form-item__label:before) {
   content: '*';

+ 5 - 9
src/views/pms/iotopeationfill/index.vue

@@ -1,11 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -84,7 +80,7 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true">
+        <el-table v-loading="loading" :data="list" :stripe="true" height="calc(85vh - 175px)">
           <el-table-column :label="t('common.index')" min-width="60" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
@@ -347,7 +343,7 @@ import download from '@/utils/download'
 import { IotInspectOrderApi, IotInspectOrderVO } from '@/api/pms/inspect/order'
 //import IotInspectOrderForm from './IotInspectOrderForm.vue'
 import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { onMounted, ref } from 'vue'
 import { IotOpeationFillApi, IotOpeationFillVO } from '@/api/pms/iotopeationfill'
 import { useUserStore } from '@/store/modules/user'
@@ -361,7 +357,7 @@ defineOptions({ name: 'IotOpeationFill1' })
 const dialogVisible = ref(false)
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
-
+let isLeftContentCollapsed = ref(false)
 const loading = ref(true) // 列表的加载中
 const list = ref<IotOpeationFillVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数

+ 117 - 91
src/views/pms/iotopeationfill/plan/index.vue

@@ -1,22 +1,8 @@
 <template>
   <el-row :gutter="20">
-    <el-col :class="{'leftcontent': true, 'collapsed': isLeftContentCollapsed}" :span="isLeftContentCollapsed ? 0 : 4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
 
-    <el-col class="rightcontent" :span="isLeftContentCollapsed ? 24 : 20" :xs="24" style="position: relative;height: 100vh;">
-        <div
-            class="toggle-button"
-            :style="{ left: isLeftContentCollapsed ? '0px' : '-13px' }"
-            @click="toggleLeftContent"
-            @mouseover="handleMouseOver"
-            @mouseout="handleMouseOut"
-            :title="hoverText"
-          >
-            <span style="font-size: 5px;" :class="{'triangle': true, 'rotated': isLeftContentCollapsed}"></span>
-        </div>
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -56,8 +42,12 @@
             />
           </el-form-item>
           <el-form-item>
-            <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> {{ t('operationFill.search') }}</el-button>
-            <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />  {{ t('operationFill.reset') }}</el-button>
+            <el-button @click="handleQuery"
+              ><Icon icon="ep:search" class="mr-5px" /> {{ t('operationFill.search') }}</el-button
+            >
+            <el-button @click="resetQuery"
+              ><Icon icon="ep:refresh" class="mr-5px" /> {{ t('operationFill.reset') }}</el-button
+            >
             <el-button
               type="primary"
               plain
@@ -81,16 +71,37 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+          height="calc(85vh - 175px)"
+        >
           <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
             </template>
           </el-table-column>
-          <el-table-column :label="t('route.planTitle')" align="center" prop="planTitle" min-width="240" />
-<!--          <el-table-column :label="t('route.planNumber')" align="center" prop="planCode" min-width="200" />-->
-          <el-table-column :label="t('route.cycle')" align="center" prop="planCycle"  min-width="80"/>
-          <el-table-column :label="t('workOrderMaterial.unit')" align="center" prop="planUnit" min-width="80">
+          <el-table-column
+            :label="t('route.planTitle')"
+            align="center"
+            prop="planTitle"
+            min-width="240"
+          />
+          <!--          <el-table-column :label="t('route.planNumber')" align="center" prop="planCode" min-width="200" />-->
+          <el-table-column
+            :label="t('route.cycle')"
+            align="center"
+            prop="planCycle"
+            min-width="80"
+          />
+          <el-table-column
+            :label="t('workOrderMaterial.unit')"
+            align="center"
+            prop="planUnit"
+            min-width="80"
+          >
             <template #default="scope">
               <dict-tag :type="DICT_TYPE.PMS_INSPECT_UNIT" :value="scope.row.planUnit" />
             </template>
@@ -119,9 +130,24 @@
             :formatter="dateFormatter"
             min-width="180px"
           />
-          <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" min-width="130"/>
-          <el-table-column :label="t('inspect.createName')" align="center" prop="createName" min-width="130"/>
-          <el-table-column :label="t('operationFill.operation')" align="center" min-width="180" fixed="right">
+          <el-table-column
+            :label="t('iotDevice.dept')"
+            align="center"
+            prop="deptName"
+            min-width="130"
+          />
+          <el-table-column
+            :label="t('inspect.createName')"
+            align="center"
+            prop="createName"
+            min-width="130"
+          />
+          <el-table-column
+            :label="t('operationFill.operation')"
+            align="center"
+            min-width="180"
+            fixed="right"
+          >
             <template #default="scope">
               <el-button
                 link
@@ -157,26 +183,26 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, onMounted } from 'vue';
-import { dateFormatter } from '@/utils/formatTime';
-import download from '@/utils/download';
-import { IotOperationPlanApi, IotOperationPlanVO } from '@/api/pms/iotopeationfill/plan';
-import IotOperationPlanForm from './IotOperationPlanForm.vue';
-import { CommonStatusEnum } from '@/utils/constants';
-import { DICT_TYPE } from "@/utils/dict";
-import DeptTree from "@/views/system/user/DeptTree.vue";
-import { useRouter } from 'vue-router';
-import { useI18n } from 'vue-i18n';
+import { ref, reactive, onMounted } from 'vue'
+import { dateFormatter } from '@/utils/formatTime'
+import download from '@/utils/download'
+import { IotOperationPlanApi, IotOperationPlanVO } from '@/api/pms/iotopeationfill/plan'
+import IotOperationPlanForm from './IotOperationPlanForm.vue'
+import { CommonStatusEnum } from '@/utils/constants'
+import { DICT_TYPE } from '@/utils/dict'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
+import { useRouter } from 'vue-router'
+import { useI18n } from 'vue-i18n'
 
 defineOptions({ name: 'iotOperationPlan' })
 const message = useMessage() // 消息弹窗
 
-const { push } = useRouter();
-const { t } = useI18n();
+const { push } = useRouter()
+const { t } = useI18n()
 
-const loading = ref(true);
-const list = ref<IotOperationPlanVO[]>([]);
-const total = ref(0);
+const loading = ref(true)
+const list = ref<IotOperationPlanVO[]>([])
+const total = ref(0)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -189,57 +215,58 @@ const queryParams = reactive({
   remark: undefined,
   createTime: [],
   deptId: undefined
-});
-const queryFormRef = ref();
-const exportLoading = ref(false);
+})
+const queryFormRef = ref()
+const exportLoading = ref(false)
 
-const isLeftContentCollapsed = ref(false);
-const hoverText = ref('');
+const isLeftContentCollapsed = ref(false)
+const hoverText = ref('')
 const selectedDept = ref<{ id: number; name: string }>()
 
 const handleDeptNodeClick = async (row) => {
   selectedDept.value = { id: row.id, name: row.name }
-  queryParams.deptId = row.id;
-  await getList();
-};
+  queryParams.deptId = row.id
+  await getList()
+}
 
 const handleStatusChange = async (row: IotOperationPlanVO) => {
   try {
-    const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用';
-    await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?');
-    await IotOperationPlanApi.updateIotOperationStatus(row.id, row.status);
-    await getList();
+    const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
+    await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?')
+    await IotOperationPlanApi.updateIotOperationStatus(row.id, row.status)
+    await getList()
   } catch {
-    row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
+    row.status =
+      row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
   }
-};
+}
 
 const getList = async () => {
-  loading.value = true;
+  loading.value = true
   try {
-    const data = await IotOperationPlanApi.getIotOperationPlanPage(queryParams);
-    list.value = data.list;
-    total.value = data.total;
+    const data = await IotOperationPlanApi.getIotOperationPlanPage(queryParams)
+    list.value = data.list
+    total.value = data.total
   } finally {
-    loading.value = false;
+    loading.value = false
   }
-};
+}
 
 const handleQuery = () => {
-  queryParams.pageNo = 1;
-  getList();
-};
+  queryParams.pageNo = 1
+  getList()
+}
 
 const resetQuery = () => {
-  queryFormRef.value.resetFields();
+  queryFormRef.value.resetFields()
   selectedDept.value = undefined
-  handleQuery();
-};
+  handleQuery()
+}
 
 const openForm = (type: string, id?: number) => {
   if (typeof id === 'number') {
-    push({ name: 'OperationPlanEdit', params: { id } });
-    return;
+    push({ name: 'OperationPlanEdit', params: { id } })
+    return
   }
   push({
     name: 'OperationPlanAdd',
@@ -248,44 +275,44 @@ const openForm = (type: string, id?: number) => {
       deptName: selectedDept.value?.name
     }
   })
-};
+}
 
 const handleDelete = async (id: number) => {
   try {
-    await message.delConfirm();
-    await IotOperationPlanApi.deleteIotOperationPlan(id);
-    message.success(t('common.delSuccess'));
-    await getList();
+    await message.delConfirm()
+    await IotOperationPlanApi.deleteIotOperationPlan(id)
+    message.success(t('common.delSuccess'))
+    await getList()
   } catch {}
-};
+}
 
 const handleExport = async () => {
   try {
-    await message.exportConfirm();
-    exportLoading.value = true;
-    const data = await IotOperationPlanApi.exportIotOperationPlan(queryParams);
-    download.excel(data, '巡检计划.xls');
+    await message.exportConfirm()
+    exportLoading.value = true
+    const data = await IotOperationPlanApi.exportIotOperationPlan(queryParams)
+    download.excel(data, '巡检计划.xls')
   } catch {
   } finally {
-    exportLoading.value = false;
+    exportLoading.value = false
   }
-};
+}
 
 const toggleLeftContent = () => {
-  isLeftContentCollapsed.value = !isLeftContentCollapsed.value;
-};
+  isLeftContentCollapsed.value = !isLeftContentCollapsed.value
+}
 
 const handleMouseOver = () => {
-  hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起';
-};
+  hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起'
+}
 
 const handleMouseOut = () => {
-  hoverText.value = '';
-};
+  hoverText.value = ''
+}
 
 onMounted(() => {
-  getList();
-});
+  getList()
+})
 </script>
 
 <style scoped>
@@ -306,7 +333,7 @@ onMounted(() => {
 .toggle-button {
   position: absolute;
   top: 44%;
-  transform: translate(-65%,-50%);
+  transform: translate(-65%, -50%);
   width: 12px;
   height: 40px;
   background-color: #f0f0f0;
@@ -324,7 +351,6 @@ onMounted(() => {
   background-color: #afafaf;
 }
 
-
 .triangle {
   width: 0;
   height: 0;

+ 5 - 8
src/views/pms/maintain/index.vue

@@ -1,11 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -172,9 +168,9 @@
         <el-table
           v-loading="loading"
           :data="list"
-          height="65vh"
           :stripe="true"
           :show-overflow-tooltip="true"
+          height="calc(85vh - 175px)"
         >
           <el-table-column :label="t('maintain.serial')" min-width="70" align="center">
             <template #default="scope">
@@ -354,7 +350,7 @@
 import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { IotMaintainApi, IotMaintainVO } from '@/api/pms/maintain'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { DICT_TYPE, getBoolDictOptions, getStrDictOptions } from '@/utils/dict'
 import { useUserStore } from '@/store/modules/user'
 
@@ -369,6 +365,7 @@ const loading = ref(true) // 列表的加载中
 const list = ref<IotMaintainVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
 const dialogVisible = ref(false)
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,

+ 11 - 9
src/views/pms/maintenance/index.vue

@@ -1,11 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form
@@ -74,7 +70,13 @@
 
       <!-- 列表 -->
       <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+        <el-table
+          height="calc(85vh - 175px)"
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}
@@ -141,7 +143,7 @@
 import { dateFormatter2 } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { IotMaintenancePlanApi, IotMaintenancePlanVO } from '@/api/pms/maintenance'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { CommonStatusEnum } from '@/utils/constants'
 const { push } = useRouter() // 路由跳转
 
@@ -150,7 +152,7 @@ defineOptions({ name: 'IotMaintenancePlan' })
 
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
-
+let isLeftContentCollapsed = ref(false)
 const loading = ref(true) // 列表的加载中
 const list = ref<IotMaintenancePlanVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数

+ 21 - 14
src/views/pms/monitor/index.vue

@@ -1,12 +1,8 @@
 <template>
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" style="border: 0" v-if="treeShow">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <ContentWrap style="border: 0">
         <!-- 搜索工作栏 -->
         <el-form
@@ -37,8 +33,8 @@
       </ContentWrap>
 
       <!-- 列表(卡片) -->
-      <ContentWrap style="border: 0">
-        <div v-loading="loading">
+      <ContentWrap style="border: 0" class="h-[78vh] overflow-y-auto">
+        <div v-loading="loading" class="h-[75vh] overflow-x-hidden">
           <el-row :gutter="20">
             <el-col
               v-for="(item, index) in list"
@@ -73,7 +69,7 @@
                       <el-image
                         v-if="item.type === '1'"
                         :src="img1"
-                        style="width: 40px; height: 40px; margin-left: 40px"
+                        style="width: 30px; height: 30px; margin-left: 40px"
                       />
                       <el-image
                         v-else
@@ -102,7 +98,6 @@
                       {{ item.ifOnline ? '在线' : '离线' }}
                     </el-tag>
                   </div>
-                  <!-- <div class="card-row"><span class="muted">描述:</span> {{ item.remark }}</div> -->
                 </div>
                 <template #footer>
                   <el-button type="primary" link @click="handleEdit(item)"
@@ -129,10 +124,10 @@
 
 <script setup lang="ts">
 import { IotDeviceApi } from '@/api/pms/device'
-import DeptTree from '@/views/system/user/DeptTree.vue'
-import { defaultProps, handleTree } from '@/utils/tree'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
+import { handleTree } from '@/utils/tree'
 import * as DeptApi from '@/api/system/dept'
-import { DICT_TYPE, getDictLabel, getStrDictOptions } from '@/utils/dict'
+import { DICT_TYPE } from '@/utils/dict'
 
 import img1 from '../../../assets/imgs/300.png'
 import img2 from '../../../assets/imgs/other.png'
@@ -148,6 +143,7 @@ const { t } = useI18n()
 
 const list = ref([]) // 列表的数据
 const total = ref(0) // 列表的总页数
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -519,7 +515,7 @@ onMounted(async () => {
 .device-card .card-row {
   display: flex;
   align-items: center;
-  padding: 10px 0;
+  padding: 2px 0;
 }
 
 .device-card .card-row:last-child {
@@ -561,4 +557,15 @@ onMounted(async () => {
   font-size: 12px;
   font-size: 12px;
 }
+
+::-webkit-scrollbar {
+  width: 5px; /* 设置滚动条宽度 */
+}
+::-webkit-scrollbar-thumb {
+  background-color: darkgrey; /* 设置滚动条颜色 */
+  border-radius: 10px; /* 设置圆角 */
+}
+::-webkit-scrollbar-track {
+  background: transparent; /* 设置轨道颜色 */
+}
 </style>

+ 8 - 2
src/views/pms/qhse/certificate.vue

@@ -51,8 +51,14 @@
       </ContentWrap>
 
       <!-- 列表 -->
-      <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+      <ContentWrap class="flex-1 overflow-hidden mt-15px">
+        <el-table
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          height="calc(85vh - 130px)"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('monitor.serial')" width="70" align="center">
             <template #default="scope">
               {{ scope.$index + 1 }}

+ 8 - 3
src/views/pms/qhse/faultReport/index.vue

@@ -34,7 +34,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="24" :xs="24" :sm="24" :md="12">
-              <el-form-item style="display: block">
+              <el-form-item style="display: block; padding-left: 50px">
                 <el-button type="primary" @click="handleQuery" :icon="Search">搜索</el-button>
                 <el-button @click="resetQuery" :icon="Refresh">重置</el-button>
                 <el-button
@@ -54,7 +54,7 @@
         </el-form>
       </ContentWrap>
 
-      <ContentWrap style="border: 0">
+      <ContentWrap class="flex-1 overflow-hidden mt-15px">
         <el-table
           v-loading="loading"
           :data="list"
@@ -63,7 +63,7 @@
           style="width: 100%"
           :header-cell-style="{ background: '#f5f7fa', color: '#333', height: '50px' }"
           :cell-style="{ padding: '12px 8px' }"
-          height="70vh"
+          height="calc(85vh - 115px)"
           :max-height="tableHeight"
         >
           <el-table-column prop="actualTime" label="事件时间" align="center" min-width="150">
@@ -300,6 +300,11 @@ const tableHeight = computed(() => {
   return '90vh'
 })
 
+const handleDeptNodeClick = async (row) => {
+  queryParams.value.deptId = row.id
+  await getList()
+}
+
 // Methods
 const getList = async () => {
   loading.value = true

+ 8 - 2
src/views/pms/qhse/index.vue

@@ -35,8 +35,14 @@
       </ContentWrap>
 
       <!-- 列表 -->
-      <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+      <ContentWrap class="flex-1 overflow-hidden mt-15px">
+        <el-table
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          height="calc(85vh - 130px)"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column :label="t('monitor.serial')" width="70" align="center" fixed="left">
             <template #default="scope">
               {{ scope.$index + 1 }}

+ 16 - 100
src/views/pms/qhse/iotmeasuredetect/index.vue

@@ -1,36 +1,8 @@
 <template>
   <el-row :gutter="20">
-    <el-col
-      :class="{ leftcontent: true, collapsed: isLeftContentCollapsed }"
-      :span="isLeftContentCollapsed ? 0 : 4"
-      :xs="24"
-    >
-      <ContentWrap class="h-1/1">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-
-    <el-col
-      class="rightcontent"
-      :span="isLeftContentCollapsed ? 24 : 20"
-      :xs="24"
-      style="position: relative; height: 100vh"
-    >
-      <!-- 图片形式的切换按钮 -->
-      <div
-        class="toggle-button"
-        :style="{ left: isLeftContentCollapsed ? '0px' : '-13px' }"
-        @click="toggleLeftContent"
-        @mouseover="handleMouseOver"
-        @mouseout="handleMouseOut"
-      >
-        <img
-          :src="isLeftContentCollapsed ? hideimage : showimage"
-          alt="切换按钮"
-          class="toggle-icon"
-        />
-      </div>
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
 
+    <el-col :span="isLeftContentCollapsed ? 24 : 20" :xs="24">
       <ContentWrap>
         <!-- 搜索工作栏 -->
         <el-form :model="queryParams" ref="queryFormRef" :inline="true">
@@ -92,8 +64,14 @@
       </ContentWrap>
 
       <!-- 列表 -->
-      <ContentWrap>
-        <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+      <ContentWrap class="flex-1 overflow-hidden mt-15px">
+        <el-table
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          height="calc(85vh - 187px)"
+          :show-overflow-tooltip="true"
+        >
           <el-table-column label="计量器具名称" align="center" prop="measureName" min-width="160" />
           <el-table-column label="证书编码" align="center" prop="measureCertNo" min-width="160" />
           <el-table-column label="检测/校准日期" align="center" prop="detectDate" width="140">
@@ -155,16 +133,14 @@ import download from '@/utils/download'
 import { IotMeasureDetectApi, IotMeasureDetectVO } from '@/api/pms/qhse/index'
 import IotMeasureDetectForm from './IotMeasureDetectForm.vue'
 import { formatDate } from '@/utils/formatTime'
-import DeptTree from '@/views/system/user/DeptTree.vue'
-import hideimage from '@/assets/imgs/leftTree-hide.png'
-import showimage from '@/assets/imgs/leftTree-show.png'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
+
 /** 计量器具-检测校准明细 列表 */
 defineOptions({ name: 'IotMeasureDetect' })
 
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 const isLeftContentCollapsed = ref(false)
-const hoverText = ref('')
 
 const loading = ref(true) // 列表的加载中
 const list = ref<IotMeasureDetectVO[]>([]) // 列表的数据
@@ -210,17 +186,6 @@ const handleDeptNodeClick = async (row) => {
   await getList()
 }
 
-const toggleLeftContent = () => {
-  isLeftContentCollapsed.value = !isLeftContentCollapsed.value
-}
-
-const handleMouseOver = () => {
-  hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起'
-}
-
-const handleMouseOut = () => {
-  hoverText.value = ''
-}
 const formatDateCorrectly = (timestamp) => {
   if (!timestamp) return ''
 
@@ -294,59 +259,10 @@ onMounted(() => {
 </script>
 
 <style scoped>
-.leftcontent {
-  transition: width 0.3s ease;
-  position: relative;
-}
-
-.leftcontent.collapsed {
-  width: 0;
-  overflow: hidden;
-}
-
-.rightcontent {
-  position: relative;
-}
-
-.toggle-button {
-  position: absolute;
-  top: 44%;
-  transform: translate(6%, -50%);
-  /* width: 18px;
-  height: 40px;
-  cursor: pointer;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  z-index: 1;
-
-  border-radius: 8px;
-  background-color: #f0f0f0;
-  transition: all 0.3s ease; */
+::deep(.el-tree--highlight-current) {
+  height: 200px !important;
 }
-
-/* 图片样式 - 保持原始尺寸 */
-.toggle-icon {
-  width: auto; /* 自动宽度 */
-  height: auto; /* 自动高度 */
-  max-width: 100%; /* 不超过容器宽度 */
-  max-height: 100%; /* 不超过容器高度 */
-  /* filter: brightness(1); */
-  transition: all 0.3s ease;
-  z-index: 999;
-  cursor: pointer;
-}
-
-/* 鼠标悬停时图片颜色变深 */
-.toggle-button:hover .toggle-icon {
-  filter: brightness(0.9);
-}
-
-/* 确保图片在容器内居中 */
-.toggle-button img {
-  display: block;
-  margin: auto;
-  width: auto;
-  height: auto;
+::deep(.el-transfer-panel__body) {
+  height: 700px !important;
 }
 </style>

+ 4 - 8
src/views/report-statistics/device_book/index2.vue

@@ -1,12 +1,8 @@
 <template style="background-color: #edf4ff">
   <el-row :gutter="20">
     <!-- 左侧部门树 -->
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" v-if="treeShow" style="border: 0; height: 87.5vh">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="contentSpan" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <!-- 统计卡片 -->
       <el-row :gutter="21" class="mb-4">
         <el-col :span="9">
@@ -289,7 +285,7 @@
 <script setup lang="ts">
 import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
 import { DICT_TYPE } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { buildSortingField } from '@/utils'
 import { useRefreshStore } from '@/store/modules/pms/refreshStore'
 import Echart from '@/components/Echart/src/Echart.vue'
@@ -298,7 +294,7 @@ import { formatDate } from '@/utils/formatTime'
 import { nextTick, watch } from 'vue'
 import download from '@/utils/download'
 const message = useMessage() // 消息弹窗
-
+let isLeftContentCollapsed = ref(false)
 /** 设备台账 列表 */
 defineOptions({ name: 'IotDevicePms' })
 

+ 5 - 9
src/views/report-statistics/fault_report/index.vue

@@ -1,11 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" style="border: 0">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <!-- 统计卡片 -->
       <el-row :gutter="18" class="mb-4">
         <el-col :span="4">
@@ -177,7 +173,7 @@
         <el-table
           v-loading="loading"
           :data="list"
-          height="48vh"
+          height="45.6vh"
           :stripe="true"
           :show-overflow-tooltip="true"
         >
@@ -277,7 +273,7 @@ import { IotInspectOrderApi, IotInspectOrderVO } from '@/api/pms/inspect/order'
 import { watch } from 'vue'
 
 import { DICT_TYPE } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { dateFormatter } from '@/utils/formatTime'
 
 const message = useMessage() // 消息弹窗
@@ -293,7 +289,7 @@ const list = ref<IotInspectOrderVO[]>([]) // 列表的数据
 const deptId = params.deptId
 const createTime = params.createTime
 const total = ref(0) // 列表的总页数
-
+let isLeftContentCollapsed = ref(false)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,

+ 4 - 8
src/views/report-statistics/inspection_order/index.vue

@@ -1,11 +1,7 @@
 <template>
   <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1" style="border: 0">
-        <DeptTree @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
+    <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
+    <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
       <!-- 统计卡片 -->
       <el-row :gutter="18" class="mb-4">
         <el-col :span="4">
@@ -331,12 +327,12 @@
 <script setup lang="ts">
 import { IotInspectOrderApi, IotInspectOrderVO } from '@/api/pms/inspect/order'
 import { DICT_TYPE } from '@/utils/dict'
-import DeptTree from '@/views/system/user/DeptTree.vue'
+import DeptTree from '@/views/system/user/DeptTree2.vue'
 import { IotInspectItemVO, IotInspectOrderDetailApi } from '@/api/pms/inspect/order/detail'
 const message = useMessage() // 消息弹窗
 import { watch } from 'vue'
 import download from '@/utils/download'
-
+let isLeftContentCollapsed = ref(false)
 const { push } = useRouter()
 const { params } = useRoute()
 /** 巡检工单 列表 */

+ 30 - 3
src/views/system/user/DeptTree2.vue

@@ -5,7 +5,11 @@
     :xs="24"
   >
     <ContentWrap class="h-[85vh]">
-      <div class="dept-tree" :class="{ 'is-collapsed': isCollapsed }" style="overflow-y: auto">
+      <div
+        class="dept-tree"
+        :class="{ 'is-collapsed': isCollapsed }"
+        style="overflow-y: auto; overflow-x: auto"
+      >
         <div class="head-container" style="display: flex; flex-direction: row">
           <el-input
             v-model="deptName"
@@ -177,8 +181,12 @@ onUnmounted(() => {
 </script>
 <style lang="scss" scoped>
 .dept-tree {
-  max-height: 100%;
+  height: 85vh;
   overflow-y: auto;
+
+  &.is-collapsed {
+    overflow-y: hidden;
+  }
 }
 .custom-menu {
   position: fixed;
@@ -201,7 +209,7 @@ onUnmounted(() => {
 }
 .tree-container {
   overflow-y: auto;
-  max-height: 100%;
+  max-height: calc(85vh - 100px);
   min-width: 100%;
   // border: 1px solid #e4e7ed;
   border-radius: 4px;
@@ -270,4 +278,23 @@ onUnmounted(() => {
   width: 0 !important;
   overflow: hidden;
 }
+
+// 小屏幕下隐藏按钮
+@media (max-width: 768px) {
+  .tree-toggle--outside,
+  .tree-toggle--outside2 {
+    display: none;
+  }
+}
+
+::-webkit-scrollbar {
+  width: 5px; /* 设置滚动条宽度 */
+}
+::-webkit-scrollbar-thumb {
+  background-color: darkgrey; /* 设置滚动条颜色 */
+  border-radius: 10px; /* 设置圆角 */
+}
+::-webkit-scrollbar-track {
+  background: transparent; /* 设置轨道颜色 */
+}
 </style>