Browse Source

pms 设备属性模板详情

zhangcl 4 tháng trước cách đây
mục cha
commit
fe3b7ba854

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

@@ -70,6 +70,28 @@ const remainingRouter: AppRouteRecordRaw[] = [
       }
     ]
   },
+  {
+    path: '/deviceattrstemplate',
+    component: Layout,
+    name: 'DeviceAttrsTemplate',
+    meta: {
+      hidden: true
+    },
+    children: [
+      {
+        path: 'template/detail/:id',
+        component: () => import('@/views/pms/devicetemplate/detail/index.vue'),
+        name: 'DeviceAttrTemplateDetail',
+        meta: {
+          title: '设备属性模板详情',
+          noCache: false,
+          hidden: true,
+          canTo: true,
+          activeMenu: ''
+        }
+      }
+    ]
+  },
   {
     path: '/iotpms/iotdevicepms', // 商品中心
     component: Layout,
@@ -855,7 +877,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
         component: () => import('@/views/iot/plugin/detail/index.vue')
       }
     ]
-  }
+  },
+
 ]
 
 export default remainingRouter

+ 1 - 1
src/views/pms/devicetemplate/detail/index.vue

@@ -27,7 +27,7 @@ import { useTagsViewStore } from '@/store/modules/tagsView'
 import { useRouter } from 'vue-router'
 import { IOT_PROVIDE_KEY } from '@/views/iot/utils/constants'
 
-defineOptions({ name: 'IoTProductDetail' })
+defineOptions({ name: 'DeviceAttrTemplateDetail' })
 
 const { delView } = useTagsViewStore() // 视图操作
 const { currentRoute } = useRouter()

+ 14 - 0
src/views/pms/devicetemplate/index.vue

@@ -119,6 +119,13 @@
           <el-table-column label="操作" align="center" width="160">
             <template #default="scope">
               <div class="flex items-center justify-center">
+                <el-button
+                  type="primary"
+                  link
+                  @click="openDetail(scope.row.id)"
+                >
+                  <Icon icon="ep:edit" />查看
+                </el-button>
                 <el-button
                   type="primary"
                   link
@@ -178,6 +185,7 @@ const treeStore = useTreeStore();
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 
+const { push } = useRouter()
 const loading = ref(true) // 列表的加载中
 const total = ref(0) // 列表的总页数
 const list = ref([]) // 列表的数
@@ -231,6 +239,12 @@ const openForm = (type: string, id?: number) => {
   formRef.value.open(type, id)
 }
 
+/** 打开详情 */
+const openDetail = (id: number) => {
+  debugger
+  push({ name: 'DeviceAttrTemplateDetail', params: { id } })
+}
+
 /** 修改 设备属性模板 状态 */
 const handleStatusChange = async (row: DeviceTemplateApi.DeviceAttrTemplateVO) => {
   try {