lipenghui 3 hónapja
szülő
commit
115211686d

+ 1 - 1
package.json

@@ -64,7 +64,7 @@
     "pinia-plugin-persistedstate": "^3.2.1",
     "qrcode": "^1.5.3",
     "qs": "^6.12.0",
-    "sortablejs": "^1.15.3",
+    "sortablejs": "1.15.0",
     "steady-xml": "^0.1.0",
     "url": "^0.11.3",
     "v3-jsoneditor": "^0.0.6",

+ 49 - 1
src/router/modules/remaining.ts

@@ -313,7 +313,55 @@ const remainingRouter: AppRouteRecordRaw[] = [
       },
     ]
   },
-
+  {
+    path: '/iotpms/iotinspectroute',
+    component: Layout,
+    name: 'PmsInspectRouteCenter',
+    meta: {
+      hidden: true
+    },
+    children: [
+      {
+        path: 'route/add',
+        component: () => import('@/views/pms/inspect/route/IotInspectRoute.vue'),
+        name: 'RouteAdd',
+        meta: {
+          noCache: false,
+          hidden: true,
+          canTo: true,
+          icon: 'ep:add',
+          title: '巡检路线添加',
+          activeMenu: '/route/add'
+        }
+      },
+      {
+        path: 'route/edit/:id(\\d+)',
+        component: () => import('@/views/pms/inspect/route/IotInspectRoute.vue'),
+        name: 'RouteEdit',
+        meta: {
+          noCache: true,
+          hidden: true,
+          canTo: true,
+          icon: 'ep:edit',
+          title: '巡检路线编辑',
+          activeMenu: '/route/edit'
+        }
+      // }
+        // ,{
+      //   path: 'route/detail/:id(\\d+)',
+      //   component: () => import('@/views/pms/maintain/IotMaintainDetail.vue'),
+      //   name: 'InspectRouteDetail',
+      //   meta: {
+      //     noCache: false,
+      //     hidden: true,
+      //     canTo: true,
+      //     icon: 'ep:add',
+      //     title: '巡检路线详情',
+      //     activeMenu: '/route/detail'
+      //   }
+      },
+    ]
+  },
   {
     path: '/failure',
     component: Layout,

+ 4 - 0
src/views/pms/inspect/item/IotInspectItemForm.vue

@@ -64,6 +64,7 @@ import { IotInspectItemApi, IotInspectItemVO } from '@/api/pms/inspect/item'
 import {defaultProps, handleTree} from "@/utils/tree";
 import * as ProductClassifyApi from "@/api/pms/productclassify";
 import DeviceList from "@/views/pms/failure/DeviceList.vue";
+import {CACHE_KEY, useCache} from "@/hooks/web/useCache";
 
 /** 巡检项 表单 */
 defineOptions({ name: 'IotInspectItemForm' })
@@ -134,12 +135,15 @@ const openForm = () => {
 
 /** 提交表单 */
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+const { wsCache } = useCache()
 const submitForm = async () => {
   // 校验表单
   await formRef.value.validate()
   // 提交请求
   formLoading.value = true
   try {
+    const user = wsCache.get(CACHE_KEY.USER)
+    formData.value.deptId = user.user.deptId;
     const data = formData.value as unknown as IotInspectItemVO
     if (formType.value === 'create') {
       await IotInspectItemApi.createIotInspectItem(data)

+ 181 - 0
src/views/pms/inspect/route/InspectItemList.vue

@@ -0,0 +1,181 @@
+<template>
+  <Dialog v-model="dialogVisible" title="选择巡检项" style="width: 1100px; max-height: 100%">
+    <ContentWrap>
+      <el-form
+        class="-mb-15px"
+        :model="queryParams"
+        ref="queryFormRef"
+        :inline="true"
+        label-width="68px"
+      >
+        <el-form-item label="巡检项" prop="item">
+          <el-input
+            v-model="queryParams.item"
+            placeholder="请输入巡检项"
+            clearable
+            @keyup.enter="handleQuery"
+            class="!w-240px"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+          <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
+          <el-button @click="handleConfirm" type="danger"><Icon icon="ep:check" class="mr-5px" /> 确认选择</el-button>
+        </el-form-item>
+      </el-form>
+    </ContentWrap>
+    <ContentWrap>
+      <el-table
+        ref="tableRef"
+        v-loading="loading"
+        :data="list"
+        :stripe="true"
+        :show-overflow-tooltip="true"
+        @row-click="handleRowClick"
+      >
+        <el-table-column width="60" label="选择">
+          <template #default="{ row }">
+            <el-checkbox
+              :model-value="selectedRows.some(item => item.id === row.id)"
+              @click.stop="toggleRow(row)"
+              class="no-label-radio"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column label="巡检项" align="center" prop="item" />
+        <el-table-column label="巡检标准" align="center" prop="standard" />
+        <el-table-column
+          label="创建时间"
+          align="center"
+          prop="createTime"
+          :formatter="dateFormatter"
+        />
+      </el-table>
+      <!-- 分页 -->
+      <Pagination
+        :total="total"
+        v-model:page="queryParams.pageNo"
+        v-model:limit="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </ContentWrap>
+  </Dialog>
+</template>
+
+<script setup lang="ts">
+import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
+import { DICT_TYPE } from '@/utils/dict'
+import { dateFormatter } from '@/utils/formatTime'
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+import {IotInspectItemApi, IotInspectItemVO} from "@/api/pms/inspect/item";
+import * as MaterialApi from "@/api/pms/material";
+
+const emit = defineEmits(['choose']) // 定义 success 事件,用于操作成功后的回调
+const dialogVisible = ref(false) // 弹窗的是否展示
+const loading = ref(true) // 列表的加载中
+const queryFormRef = ref() // 搜索的表单
+const list = ref<IotDeviceVO[]>([]) // 列表的数据
+const total = ref(0) // 列表的总页数
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 20,
+  item: undefined,
+  deptId: undefined,
+  deviceClassify: undefined,
+  deviceId: undefined,
+})
+
+const selectedRows = ref<IotInspectItemVO[]>([]); // 多选数据(存储所有选中行的数组)
+const tableRef = ref();
+// 处理单选逻辑
+const selectRow = (row) => {
+  selectedRow.value = selectedRow.value?.id === row.id ? null : row
+  emit('choose', row)
+  dialogVisible.value = false
+}
+
+// 多选 切换行选中状态
+const toggleRow = (row) => {
+  const index = selectedRows.value.findIndex(item => item.id === row.id);
+  if (index > -1) {
+    selectedRows.value.splice(index, 1); // 取消选中
+  } else {
+    selectedRows.value.push(row); // 选中
+  }
+};
+
+// 点击整行选中
+const handleRowClick = (row) => {
+  toggleRow(row)
+}
+const open = async (classify, id) => {
+  dialogVisible.value = true
+  if (id) {
+    queryParams.deviceId = id;
+  } else {
+    queryParams.deviceClassify = classify
+  }
+  await getList()
+}
+defineExpose({ open })
+const { wsCache } = useCache()
+const getList = async () => {
+  loading.value = true
+  try {
+    const user = wsCache.get(CACHE_KEY.USER)
+    queryParams.deptId = user.user.deptId
+    console.log(JSON.stringify(queryParams))
+    debugger
+    const data = await IotInspectItemApi.getIotInspectItemPage(queryParams)
+    list.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+const handleConfirm = () => {
+  if (selectedRows.value.length === 0) {
+    ElMessage.warning('请至少选择一个巡检项')
+    return
+  }
+  // emit('choose', selectedRows.value);
+  emit('choose', selectedRows.value.map(row => ({
+    ...row,
+    // 确保返回必要字段
+    code: row.item,
+    name: row.standard,
+  })))
+  dialogVisible.value = false;
+  handleClose()
+};
+
+// 关闭时清空选择
+const handleClose = () => {
+  tableRef.value?.clearSelection();
+  selectedRows.value = []
+  emit('close')
+};
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.pageNo = 1
+  getList()
+}
+const choose = (row: DictDataVO) => {
+  emit('choose', row)
+  dialogVisible.value = false
+}
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+</script>
+<style lang="scss">
+.no-label-radio .el-radio__label {
+  display: none;
+}
+.no-label-radio .el-radio__inner {
+  margin-right: 0;
+}
+</style>

+ 420 - 0
src/views/pms/inspect/route/IotInspectRoute.vue

@@ -0,0 +1,420 @@
+<template>
+  <ContentWrap v-loading="formLoading">
+    <el-form
+      ref="formRef"
+      :model="formData"
+      :rules="formRules"
+      v-loading="formLoading"
+      style="margin-right: 4em; margin-left: 0.5em; margin-top: 1em"
+      label-width="130px"
+    >
+      <div class="base-expandable-content">
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="路线名称" prop="routeName">
+              <el-input v-model="formData.routeName" placeholder="路线名称" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="设备类别" prop="deviceClassify">
+              <el-tree-select
+                v-model="formData.deviceClassify"
+                :data="productClassifyList"
+                :props="defaultProps"
+                check-strictly
+                node-key="id"
+                placeholder="请选择设备类别"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="设备" prop="deviceId">
+              <el-select
+                v-model="formData.deviceId"
+                :model-value="deviceLabel"
+                placeholder="请输入设备"
+                @click="openDevice"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+    </el-form>
+  </ContentWrap>
+  <ContentWrap>
+    <!-- 列表 -->
+    <ContentWrap>
+      <ContentWrap>
+        <el-form
+          class="-mb-15px"
+          :model="queryParams"
+          ref="queryFormRef"
+          :inline="true"
+          label-width="68px"
+        >
+          <el-form-item>
+            <el-button @click="openForm" type="primary"
+              ><Icon icon="ep:plus" class="mr-5px" /> 选择巡检项</el-button
+            >
+          </el-form-item>
+        </el-form>
+      </ContentWrap>
+      <draggable
+        v-model="items"
+        item-key="id"
+        tag="div"
+        class="sortable-container"
+        handle=".sortable-item"
+        :animation="150"
+        @start="dragStart"
+        @end="dragEnd"
+      >
+        <template #item="{ element, index }">
+          <div class="sortable-item">
+            <!-- 序号显示 -->
+            <div class="order-number">{{ index + 1 }}</div>
+
+            <!-- 拖动手柄 -->
+            <span class="drag-handle">≡</span>
+
+            <!-- 组件内容 -->
+            <div class="component-content">
+              巡检项:{{ element.item }}  巡检标准:{{element.standard}}
+            </div>
+            <div>
+              <el-button type="warning" @click="deleteDraggable(index)">删除</el-button>
+            </div>
+          </div>
+        </template>
+      </draggable>
+    </ContentWrap>
+  </ContentWrap>
+  <ContentWrap>
+    <el-form>
+      <el-form-item style="float: right">
+        <el-button @click="submitForm" type="primary" :disabled="formLoading">保 存</el-button>
+        <el-button @click="close">取 消</el-button>
+      </el-form-item>
+    </el-form>
+  </ContentWrap>
+  <InspectItemList
+    ref="inspectItemFormRef"
+    :classify="formData.deviceClassify"
+    :deviceId="formData.deviceId"
+    @choose="inspectItemChoose"
+  />
+  <DeviceList ref="deviceFormRef" @choose="deviceChoose" />
+</template>
+<script setup lang="ts">
+import { IotMaintainApi } from '@/api/pms/maintain'
+import * as UserApi from '@/api/system/user'
+import { useUserStore } from '@/store/modules/user'
+import { ref } from 'vue'
+import { IotMaintainMaterialVO } from '@/api/pms/maintain/material'
+import { useTagsViewStore } from '@/store/modules/tagsView'
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+import { defaultProps, handleTree } from '@/utils/tree'
+import * as ProductClassifyApi from '@/api/pms/productclassify'
+import draggable from 'vuedraggable'
+import InspectItemList from '@/views/pms/inspect/route/InspectItemList.vue'
+import DeviceList from '@/views/pms/failure/DeviceList.vue'
+import {IotInspectRouteApi, IotInspectRouteVO} from "@/api/pms/inspect/route";
+
+/** 维修工单 表单 */
+defineOptions({ name: 'IotMaintainAe' })
+
+const { t } = useI18n() // 国际化
+const message = useMessage() // 消息弹窗
+const { delView } = useTagsViewStore() // 视图操作
+const { currentRoute, push } = useRouter()
+const deptUsers = ref<UserApi.UserVO[]>([]) // 用户列表
+const dialogTitle = ref('') // 弹窗的标题
+const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
+const formType = ref('') // 表单的类型:create - 新增;update - 修改
+const deviceLabel = ref('') // 表单的类型:create - 新增;update - 修改
+const drawerVisible = ref<boolean>(false)
+const showDrawer = ref()
+const list = ref<IotMaintainMaterialVO[]>([]) // 列表的数据
+const { params, name } = useRoute() // 查询参数
+const id = params.id
+const productClassifyList = ref<Tree[]>([]) // 树形结构
+const formData = ref({
+  id: undefined,
+  routeName: undefined,
+  deviceClassify: undefined,
+  deviceId: undefined,
+  deviceClassifyName: undefined,
+  deviceName: undefined,
+  itemJson: undefined,
+  remark: undefined,
+  deptId: undefined
+})
+// 拖动状态管理
+const dragStart = () => {
+  document.body.style.cursor = 'grabbing';
+};
+const deleteDraggable = async (index) => {
+  await message.delConfirm()
+  items.value.splice(index, 1)
+}
+const dragEnd = (event) => {
+  document.body.style.cursor = '';
+  console.log('新顺序:', items.value.map(c => c.id));
+  console.log('拖拽后的新位置:', event.newIndex+1)
+};
+const items = ref([])
+const deviceChoose = (row) => {
+  formData.value.deviceId = row.id
+  formData.value.deviceName = row.deviceName
+  formData.value.deptId = row.deptId
+  deviceLabel.value = row.deviceName
+}
+const formRules = reactive({
+  routeName: [{ required: true, message: '路线名称不能为空', trigger: 'blur' }],
+  deviceClassify: [{ required: true, message: '设备类别不能为空', trigger: 'blur' }]
+})
+
+const formRef = ref() // 表单 Ref
+const inspectItemChoose = (rows) => {
+  items.value = rows
+}
+const inspectItemFormRef = ref()
+const openForm = () => {
+  if (formData.value.deviceId===undefined) {
+    message.error("请选择设备类别或设备")
+    return;
+  }
+  inspectItemFormRef.value.open(formData.value.deviceClassify, formData.value.deviceId)
+}
+const deviceFormRef = ref()
+const openDevice = () => {
+  deviceFormRef.value.open(formData.value.deviceClassify)
+}
+
+const close = () => {
+  delView(unref(currentRoute))
+  push({
+    name: 'IotInspectRoute',
+    query: {
+      date: new Date().getTime()
+    }
+  })
+}
+const itemsWithIndex = computed(() => {
+  return items.value.map((item, index) => ({
+    itemId: item.id,
+    item: item.item,
+    standard: item.standard,
+    index: index + 1 // 序号从1开始
+  }))
+})
+const { wsCache } = useCache()
+/** 提交表单 */
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+const submitForm = async () => {
+  // 校验表单
+  await formRef.value.validate()
+  // 提交请求
+  formLoading.value = true
+  try {
+    const newitems = itemsWithIndex
+    debugger
+    formData.value.itemJson = JSON.stringify(newitems.value)
+    const user = wsCache.get(CACHE_KEY.USER)
+    formData.value.deptId = user.user.deptId
+    const data = formData.value as unknown as IotInspectRouteVO
+    if (formType.value === 'create') {
+      await IotInspectRouteApi.createIotInspectRoute(data)
+      message.success(t('common.createSuccess'))
+      close()
+    } else {
+      await IotInspectRouteApi.updateIotInspectRoute(data)
+      message.success(t('common.updateSuccess'))
+      close()
+    }
+    // 发送操作成功的事件
+    emit('success')
+  } finally {
+    formLoading.value = false
+  }
+}
+
+/** 重置表单 */
+const resetForm = () => {
+  formData.value = {
+    id: undefined,
+    failureCode: undefined,
+    failureName: undefined,
+    deviceId: undefined,
+    status: undefined,
+    ifStop: undefined,
+    failureTime: undefined,
+    failureInfluence: undefined,
+    failureSystem: undefined,
+    description: undefined,
+    pic: undefined,
+    solution: undefined,
+    maintainStartTime: undefined,
+    maintainEndTime: undefined,
+    remark: undefined,
+    deviceName: undefined,
+    processInstanceId: undefined,
+    auditStatus: undefined,
+    deptId: undefined
+  }
+  formRef.value?.resetFields()
+}
+onMounted(async () => {
+  const deptId = useUserStore().getUser.deptId
+  deptUsers.value = await UserApi.getDeptUsersByDeptId(deptId)
+  debugger
+  if (id) {
+    formType.value = 'update'
+    const iotInspectRoute = await IotInspectRouteApi.getIotInspectRoute(id)
+    deviceLabel.value = iotInspectRoute.deviceName
+    formData.value = iotInspectRoute
+    items.value = JSON.parse(iotInspectRoute.itemJson)
+  } else {
+    formData.value.type = 'in'
+    formType.value = 'create'
+    const { wsCache } = useCache()
+    const userInfo = wsCache.get(CACHE_KEY.USER)
+    formData.value.maintainPerson = userInfo.user.id
+  }
+  productClassifyList.value = handleTree(
+    await ProductClassifyApi.IotProductClassifyApi.getSimpleProductClassifyList()
+  )
+})
+const handleDelete = async (id: number) => {
+  try {
+    const index = list.value.findIndex((item) => item.code === id)
+    debugger
+    if (index !== -1) {
+      // 通过 splice 删除元素
+      list.value.splice(index, 1)
+    }
+  } catch {}
+}
+</script>
+<style scoped>
+.base-expandable-content {
+  overflow: hidden; /* 隐藏溢出的内容 */
+  transition: max-height 0.3s ease; /* 平滑过渡效果 */
+}
+/* 横向布局容器 */
+.horizontal-list {
+  display: flex;
+  gap: 16px;
+  padding: 20px;
+  overflow-x: auto;
+  flex-wrap: nowrap; /* 禁止换行:ml-citation{ref="5" data="citationList"} */
+}
+
+/* 拖拽项样式 */
+.horizontal-item {
+  flex: 0 0 auto;
+  min-width: 150px;
+  padding: 20px;
+  background: #d3a137;
+  border: 2px solid #e0e0e0;
+  border-radius: 8px;
+  cursor: move;
+  user-select: none; /* 防止文字选中:ml-citation{ref="7" data="citationList"} */
+  transition:
+    transform 0.3s,
+    box-shadow 0.3s;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+
+/* 拖拽手柄样式 */
+.drag-handle {
+  opacity: 0.5;
+  cursor: move;
+  transition: opacity 0.3s;
+}
+.drag-handle:hover {
+  opacity: 1;
+}
+
+/* 拖拽时的悬停效果 */
+.horizontal-item:hover {
+  transform: translateY(-2px);
+  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
+}
+
+/* 滚动条样式 */
+.horizontal-list::-webkit-scrollbar {
+  height: 8px;
+}
+.horizontal-list::-webkit-scrollbar-thumb {
+  background: #888;
+  border-radius: 4px;
+}
+
+
+
+
+.sortable-container {
+  cursor: move;
+  display: flex;
+  flex-direction: column;
+  gap: 12px;
+  //max-height: 80vh;
+  overflow-y: auto;
+  padding: 8px;
+}
+
+.sortable-item {
+  display: flex;
+  align-items: center;
+  padding: 16px;
+  background: #fff;
+  border: 1px solid #ebeef5;
+  border-radius: 8px;
+  transition: transform 0.3s, box-shadow 0.3s;
+  user-select: none;
+}
+
+.sortable-item:hover {
+  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
+}
+
+.order-number {
+  width: 32px;
+  height: 32px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background: #409eff;
+  color: white;
+  border-radius: 50%;
+  margin-right: 12px;
+  font-weight: bold;
+}
+
+.drag-handle {
+  padding: 0 12px;
+  opacity: 0.4;
+  transition: opacity 0.3s;
+}
+
+.drag-handle:hover {
+  opacity: 1;
+}
+
+.component-content {
+  flex: 1;
+  min-width: 0;
+}
+
+/* 优化滚动条 */
+.sortable-container::-webkit-scrollbar {
+  width: 8px;
+}
+.sortable-container::-webkit-scrollbar-thumb {
+  background: #c0c4cc;
+  border-radius: 4px;
+}
+</style>

+ 11 - 65
src/views/pms/inspect/route/index.vue

@@ -26,24 +26,6 @@
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="设备id" prop="deviceId">
-        <el-input
-          v-model="queryParams.deviceId"
-          placeholder="请输入设备id"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="设备分类名称" prop="deviceClassifyName">
-        <el-input
-          v-model="queryParams.deviceClassifyName"
-          placeholder="请输入设备分类名称"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
       <el-form-item label="设备名称" prop="deviceName">
         <el-input
           v-model="queryParams.deviceName"
@@ -53,44 +35,6 @@
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="巡检项" prop="itemJson">
-        <el-input
-          v-model="queryParams.itemJson"
-          placeholder="请输入巡检项"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="备注" prop="remark">
-        <el-input
-          v-model="queryParams.remark"
-          placeholder="请输入备注"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createTime">
-        <el-date-picker
-          v-model="queryParams.createTime"
-          value-format="YYYY-MM-DD HH:mm:ss"
-          type="daterange"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-          class="!w-220px"
-        />
-      </el-form-item>
-      <el-form-item label="部门id" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门id"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
       <el-form-item>
         <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
         <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
@@ -118,13 +62,10 @@
   <!-- 列表 -->
   <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="路线名称" align="center" prop="routeName" />
-      <el-table-column label="设备分类" align="center" prop="deviceClassify" />
-      <el-table-column label="设备id" align="center" prop="deviceId" />
-      <el-table-column label="设备分类名称" align="center" prop="deviceClassifyName" />
+      <el-table-column label="设备分类" align="center" prop="deviceClassifyName" />
       <el-table-column label="设备名称" align="center" prop="deviceName" />
-      <el-table-column label="巡检项" align="center" prop="itemJson" />
+<!--      <el-table-column label="巡检项" align="center" prop="itemJson" />-->
       <el-table-column label="备注" align="center" prop="remark" />
       <el-table-column
         label="创建时间"
@@ -133,7 +74,7 @@
         :formatter="dateFormatter"
         width="180px"
       />
-      <el-table-column label="部门id" align="center" prop="deptId" />
+<!--      <el-table-column label="部门id" align="center" prop="deptId" />-->
       <el-table-column label="操作" align="center" min-width="120px">
         <template #default="scope">
           <el-button
@@ -173,7 +114,7 @@ import { dateFormatter } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { IotInspectRouteApi, IotInspectRouteVO } from '@/api/pms/inspect/route'
 import IotInspectRouteForm from './IotInspectRouteForm.vue'
-
+const { push } = useRouter() // 路由跳转
 /** 巡检路线 列表 */
 defineOptions({ name: 'IotInspectRoute' })
 
@@ -224,9 +165,14 @@ const resetQuery = () => {
 }
 
 /** 添加/修改操作 */
-const formRef = ref()
 const openForm = (type: string, id?: number) => {
-  formRef.value.open(type, id)
+  //修改
+  if (typeof id === 'number') {
+    push({ name: 'RouteEdit', params: {id } })
+    return
+  }
+  // 新增
+  push({ name: 'RouteAdd', params:{} })
 }
 
 /** 删除按钮操作 */