Forráskód Böngészése

整理科室菜单及权限应用

allen 1 éve
szülő
commit
c182e542f6

+ 44 - 0
develop.md

@@ -0,0 +1,44 @@
+# 关于路由配置
+## 规则
+- path 使用下划线,全部小写
+- name 使用中线,全部小写
+以下为例子进行说明
+```
+//这里写明注释是什么功能
+{
+    path: '/frame', // URL 第一部分
+    component: Layout,  //顶级菜单必须
+    redirect: '/frame/tree',    //在顶部的面包屑中点击节点时去到的链接
+    name: 'part-frame-tree',    //权限管理匹配的字符串,对应 menu 表中的 identifier 字段
+    meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true },    //菜单文字、图标及缓存开关
+    children: [{    //子菜单项,注释写功能名称。<<<注意>>>最多三层
+        path: 'tree',   // URL 第二部分。<<<注意>>>这里不能加前缀 / ,否则会变成顶格 URL
+        component: () => import('@/views/hospitalFrame/frameTreeView'),
+        name: 'part-frame-tree',    //权限匹配字符串
+        meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true }
+      },{
+        path: 'clerk_frame_manage',
+        component: () => import('@/views/ncs-clerk-frame-manage/index'),
+        name: 'clerk-frame-manage',
+        meta: { title: i18n.t('tab.staffManageFrames'), icon: 'frame_manage', noCache: true }
+      },{
+        path: 'device',
+        name: 'part-device',
+        component: () => import('@/views/ncs-device/index'),    //<<<注意>>>此处引用的 index 内容
+        redirect: '/frame/device/list',
+        meta: {
+          title: i18n.t('deviceManage.deviceManage'),
+          icon: 'devices'
+        },
+        children: [
+          {
+            path: 'list',
+            component: () => import('@/views/ncs-device/deviceManagement'),
+            name: 'device-list',
+            meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true }
+          }
+        ]
+      }
+    ]
+}
+```

+ 3 - 1
languages/en.js

@@ -1023,6 +1023,7 @@ module.exports = {
     channelImHistory: 'Channel message history',
     remarkManage: 'Note management',
     taskManage: 'Task management',
+    interaction: 'Interaction',
     interactionHistory: 'Interaction History',
     frameGroupManage: 'Region management',
     frameGroupEdit: 'Edit area information',
@@ -1034,7 +1035,8 @@ module.exports = {
     eventManage: 'Button event management',
     hisManage: 'His query',
     interactionChars: 'Interaction statistics',
-    partSetting: 'Organization settings',
+    settings: 'settings',
+    partSettings: 'Organization settings',
     functionRoleMapping: 'Component Permissions',
     countdownConfig: 'Countdown Component Configuration',
     screentip: 'ScreenTip Component Configuration',

+ 3 - 1
languages/es.js

@@ -1023,6 +1023,7 @@ module.exports = {
     channelImHistory: 'Historial del intercomunicador',
     remarkManage: 'Gestión de notas',
     taskManage: 'Gestión de tareas',
+    interaction: 'interacción',
     interactionHistory: 'Historial de interacción',
     frameGroupManage: 'Gestión de regional',
     frameGroupEdit: 'Editar la región',
@@ -1034,7 +1035,8 @@ module.exports = {
     eventManage: 'Botón de gestión de eventos',
     hisManage: 'Su consulta',
     interactionChars: 'Interacción Estadísticas',
-    partSetting: 'Organización construir',
+    settings: 'construir',
+    partSettings: 'Organización construir',
     functionRoleMapping: 'Permisos de componentes',
     countdownConfig: 'Configuración del componente de cuenta atrás',
     screentip: 'Configuración del componente de recordatorio de pantalla',

+ 3 - 1
languages/ru-RU.js

@@ -1022,6 +1022,7 @@ module.exports = {
     channelImHistory: 'История сообщений канала',
     remarkManage: 'Управление заметками',
     taskManage: 'Управление задачами',
+    interaction: 'История',
     interactionHistory: 'История взаимодействия',
     frameGroupManage: 'Управление регионами',
     frameGroupEdit: 'Редактировать информацию об области',
@@ -1033,7 +1034,8 @@ module.exports = {
     eventManage: 'Управление событиями кнопки',
     hisManage: 'Его запрос',
     interactionChars: 'Статистика взаимодействия',
-    partSetting: 'Институциональные параметры',
+    settings: 'параметры',
+    partSettings: 'Институциональные параметры',
     interactionChain: 'Интерактивный порядок приема',
     functionRoleMapping: 'Права компонентов',
     countdownConfig: 'Настройка компонентов обратного отсчета',

+ 4 - 2
languages/zh-CN.js

@@ -1009,7 +1009,7 @@ module.exports = {
     hisNurseOptionsKeyval: '护理项分类his主键'
   },
   tab: {
-    home: '首页',
+    home: '首页',    
     frameManage: '空间位置',
     deviceManage: '所有设备',
     clerkManage: '员工管理',
@@ -1025,6 +1025,7 @@ module.exports = {
     channelImHistory: '频道留言历史',
     remarkManage: '便签管理',
     taskManage: '任务管理',
+    interaction: '交互信息',
     interactionHistory: '交互历史',
     frameGroupManage: '区域管理',
     frameGroupEdit: '编辑区域信息',
@@ -1036,7 +1037,8 @@ module.exports = {
     eventManage: '按钮事件管理',
     hisManage: 'his查询',
     interactionChars: '交互统计',
-    partSetting: '机构设置',
+    settings: '设置',
+    partSettings: '机构设置',
     interactionChain: '交互接收顺序',
     functionRoleMapping: '组件权限配置',
     countdownConfig: '倒计时组件配置',

+ 8 - 2
public/domain.js

@@ -1,9 +1,15 @@
 const domain = {
-  serverUrl: 'http://8.129.220.143:8005',
+  serverUrl: 'http://192.168.1.186:8005',
   DeviceUrl: 'http://8.129.220.143:8006',
   mediaUrl: 'http://8.129.220.143:8004',
   OnlineSystemUrl: 'http://api.base.wdklian.com',
   apiMode: 'dev',
-  uiVersion: 1 // 1 医院版,2 月子中心版,3养老院版
+  uiVersion: 1, // 1 医院版,2 月子中心版,3养老院版
+  enableBroadcast: false, //广播使能
+  enableMobile: false,  //手机使能
+  enableEntraceguard: false,  //门禁使能
+  enableNBiot: false,  //NB设备 
+  enableCustomerDevice: false,  //用户设备 
+  enableSosDevice: false  //报警设备 
 }
 

+ 261 - 480
src/router/index.js

@@ -9,33 +9,12 @@ Vue.use(Router)
 import Layout from '@/layout'
 
 const uiVersion = domain.uiVersion
-
-/* Router Modules */
-// import componentsRouter from './modules/components'
-// import chartsRouter from './modules/charts'
-// import tableRouter from './modules/table'
-// import nestedRouter from './modules/nested'
-
-/**
- * Note: sub-menu only appear when route children.length >= 1
- * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
- *
- * hidden: true                   if set true, item will not show in the sidebar(default is false)
- * alwaysShow: true               if set true, will always show the root menu
- *                                if not set alwaysShow, when item has more than one children route,
- *                                it will becomes nested mode, otherwise not show the root menu
- * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
- * name:'router-name'             the name is used by <keep-alive> (must set!!!)
- * meta : {
-    roles: ['admin','editor']    control the page roles (you can set multiple roles)
-    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
-    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
-    noCache: true                if set true, the page will no be cached(default is false)
-    affix: true                  if set true, the tag will affix in the tags-view
-    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
-    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
-  }
- */
+const enableBroadcast = domain.enableBroadcast
+const enableMobile = domain.enableMobile
+const enableEntraceguard = domain.enableEntraceguard
+const enableNBiot = domain.enableNBiot
+const enableCustomerDevice = domain.enableCustomerDevice
+const enableSosDevice = domain.enableSosDevice
 
 /**
  * constantRoutes
@@ -95,187 +74,160 @@ export const constantRoutes = [
 ]
 // 科室级页面
 export const partRoutes = [
+  //空间设备相关
   {
-    path: '/frameTreeView',
+    path: '/frame',
     component: Layout,
-    redirect: '/hospitalFrame/frameTreeView',
-    children: [
-      {
-        path: 'frameTreeView',
+    redirect: '/frame/tree',
+    name: 'part-frame-tree',
+    meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true },
+    children: [{
+        path: 'tree',
         component: () => import('@/views/hospitalFrame/frameTreeView'),
-        name: 'hospitalFrame',
+        name: 'part-frame-tree',
         meta: { title: i18n.t('tab.frameManage'), icon: 'tree', noCache: true } // 空间位置
-      }
-    ]
-  },
-  {
-    path: '/device',
-    component: Layout,
-    name: 'part-device',
-    meta: {
-      title: i18n.t('deviceManage.deviceManage'),
-      icon: 'devices'
-    },
-    children: [
-      {
-        path: 'ncs-device',
-        component: () => import('@/views/ncs-device/deviceManagement'),
-        name: 'CallingDevice',
-        meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true } // 所有设备
-      },
-      {
-        path: 'ncs-nurse-watch',
-        component: () => import('@/views/ncs-device/nurse_watch'),
-        name: 'nurse_watch',
-        meta: { title: i18n.t('tab.mobileDeviceManage'), icon: 'el-icon-watch', noCache: true } // 移动设备
-      },
-      {
-        path: 'ncs-user-watch',
-        component: () => import('@/views/ncs-device/user_watch'),
-        name: 'user_watch',
-        meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch-1', noCache: true } // 用户设备
-      },
-      {
-        path: 'ncs-sos-device',
-        component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'),
-        name: 'sos-device-setting',
-        meta: { title: i18n.t('tab.sosDeviceSettingManage'), icon: 'el-icon-s-help', noCache: true } // 报警设备
-      },
-      {
-        path: 'myMapHtml',
-        component: () => import('@/views/customer/myMapHtml'),
-        name: 'myMapHtml',
-        meta: { title: i18n.t('customerManage.footprint'), icon: 'area', noCache: true }, // 足迹
-        hidden: true
-      },
-      {
-        path: 'nbdevice-condition',
-        component: () => import('@/views/ncs-device/nbDeviceCondition'),
-        name: 'NbdeviceCondition',
-        meta: { title: i18n.t('tab.nbiotDeviceStatus'), icon: 'iot', noCache: true },
-        hidden: uiVersion === 2
-      },
-      {
-        path: 'information-board',
-        component: () => import('@/views/calling-board/index'),
-        name: 'CallingBoard',
-        meta: { title: i18n.t('tab.boardManage'), icon: 'infomation_board', noCache: true },
-        hidden: uiVersion === 2
-      },
-      {
-        path: 'custom-infoboard',
-        component: () => import('@/views/custom-infoboard/board-title'),
-        name: 'BoardTitle',
-        meta: { title: i18n.t('tab.customBoardManage'), icon: 'designer', noCache: true },
-        hidden: uiVersion === 2
-      },
-      {
-        path: 'device-menu',
-        component: () => import('@/views/ncs-device-menu/index'),
-        name: 'DeviceMenu',
-        meta: { title: i18n.t('tab.deviceMenuManager'), icon: 'el-icon-menu', noCache: true }
-      },
-      {
-        path: 'led-deviceManager',
-        component: () => import('@/views/ncs-led/ledDeviceManagement'),
-        name: 'LedDeviceManager',
-        meta: { title: i18n.t('tab.ledDeviceManager'), icon: 'led', noCache: true },
-        hidden: uiVersion === 2
-      },
-      {
-        path: 'led-control',
-        component: () => import('@/views/ncs-led/ledControl'),
-        name: 'LedControl',
-        meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }, // LED点阵屏
-        hidden: uiVersion === 2
-      }
-    ]
-  },
-  // {
-  //   path: '/ncs-device',
-  //   component: Layout,
-  //   redirect: '/ncs-device/index',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       // component: () => import('@/views/ncs-device/index'),
-  //       component: () => import('@/views/ncs-device/deviceManagement'),
-  //       name: 'CallingDevice',
-  //       meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true } // 所有设备
-  //     }
-  //   ]
-  // },
-  {
-    path: '/ncs-clerk',
-    component: Layout,
-    redirect: '/ncs-clerk/clerkList',
+      },{
+        path: 'clerk_frame_manage',
+        component: () => import('@/views/ncs-clerk-frame-manage/index'),
+        name: 'clerk-frame-manage',
+        meta: { title: i18n.t('tab.staffManageFrames'), icon: 'frame_manage', noCache: true }
+      },{
+        path: 'device',
+        name: 'part-device',
+        component: () => import('@/views/ncs-device/index'),
+        redirect: '/frame/device/list',
+        meta: {
+          title: i18n.t('deviceManage.deviceManage'),
+          icon: 'devices'
+        },
+        children: [
+          {
+            path: 'list',
+            component: () => import('@/views/ncs-device/deviceManagement'),
+            name: 'device-list',
+            meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true } // 所有设备
+          },
+          {
+            path: 'mobile',
+            component: () => import('@/views/ncs-device/nurse_watch'),
+            name: 'device-mobile',
+            hidden: !enableMobile,
+            meta: { title: i18n.t('tab.mobileDeviceManage'), icon: 'el-icon-watch', noCache: true } // 移动设备
+          },
+          {
+            path: 'user_watch',
+            component: () => import('@/views/ncs-device/user_watch'),
+            name: 'user-watch',
+            hidden: !enableCustomerDevice,
+            meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch-1', noCache: true } // 用户设备
+          },
+          {
+            path: 'sos',
+            component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'),
+            name: 'sos-device',
+            hidden: !enableSosDevice,
+            meta: { title: i18n.t('tab.sosDeviceSettingManage'), icon: 'el-icon-s-help', noCache: true } // 报警设备
+          },
+          {
+            path: 'map',
+            component: () => import('@/views/customer/myMapHtml'),
+            name: 'device-map',
+            meta: { title: i18n.t('customerManage.footprint'), icon: 'area', noCache: true }, // 足迹
+            hidden: true
+          },
+          {
+            path: 'nbdevice_condition',
+            component: () => import('@/views/ncs-device/nbDeviceCondition'),
+            name: 'nbdevice-condition',
+            meta: { title: i18n.t('tab.nbiotDeviceStatus'), icon: 'iot', noCache: true },
+            hidden: !enableNBiot
+          },
+          {
+            path: 'information_board',
+            component: () => import('@/views/calling-board/index'),
+            name: 'information-board',
+            meta: { title: i18n.t('tab.boardManage'), icon: 'infomation_board', noCache: true },
+            hidden: uiVersion === 2
+          },
+          {
+            path: 'custom_infoboard',
+            component: () => import('@/views/custom-infoboard/board-title'),
+            name: 'board-title',
+            meta: { title: i18n.t('tab.customBoardManage'), icon: 'designer', noCache: true },
+            hidden: uiVersion === 2
+          },
+          {
+            path: 'device_menu',
+            component: () => import('@/views/ncs-device-menu/index'),
+            name: 'device-menu',
+            meta: { title: i18n.t('tab.deviceMenuManager'), icon: 'el-icon-menu', noCache: true }
+          },
+          {
+            path: 'led',
+            component: () => import('@/views/ncs-led/ledDeviceManagement'),
+            name: 'led-manager',
+            meta: { title: i18n.t('tab.ledDeviceManager'), icon: 'led', noCache: true },
+            hidden: uiVersion === 2
+          },
+          {
+            path: 'led-control',
+            component: () => import('@/views/ncs-led/ledControl'),
+            name: 'led-control',
+            meta: { title: i18n.t('tab.ledDevice'), icon: 'el-icon-message-solid', noCache: true }, // LED点阵屏
+            hidden: true
+          }
+        ]
+      }
+    ]
+  },
+  //职员相关
+  {
+    path: '/clerk',
+    component: Layout,
+    redirect: '/clerk/list',
     name: 'part-clerk',
     meta: { title: i18n.t('tab.clerkManage'), icon: 'peoples', noCache: true },
     children: [
       {
-        path: 'clerkList',
+        path: 'list',
         component: () => import('@/views/ncs-clerk/clerkManagement'),
-        name: 'clerkList',
+        name: 'clerk-list',
         meta: { title: i18n.t('tab.clerkManage'), icon: 'el-icon-user-solid', noCache: true }
       },
       {
-        path: 'nfcInteractionList',
+        path: 'nfc_interaction_list',
         component: () => import('@/views/nfc-interaction/index'),
-        name: 'nfcInteractionList',
+        name: 'nfc-interaction-list',
         meta: { title: i18n.t('tab.clerkCalendar'), icon: 'el-icon-date', noCache: true }
       }
     ]
   },
+  //门禁
   {
-    path: '/entrace-guard',
+    path: '/entrace_guard',
     component: Layout,
-    redirect: '/entrace-guard/users',
+    name: 'entrace-guard',
+    hidden: !enableEntraceguard,
     children: [
       {
         path: 'users',
         component: () => import('@/views/entrace-guard/users'),
-        name: 'users',
-        meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true }
+        name: 'entrace-guard',
+        meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true },
+        hidden: !enableEntraceguard
       }]
-
   },
+  //客户信息
   {
-    path: '/ncs-clerk-frame-manage',
+    path: '/customer',
     component: Layout,
-    redirect: '/ncs-clerk-frame-manage/index',
+    redirect: '/customer/list',
+    name: 'customer',
     children: [
       {
-        path: 'clerkList',
-        component: () => import('@/views/ncs-clerk-frame-manage/index'),
-        name: 'clerkList',
-        meta: { title: i18n.t('tab.staffManageFrames'), icon: 'frame_manage', noCache: true }
-
-      }
-    ]
-  },
-
-  // {
-  //   path: '/customer',
-  //   component: Layout,
-  //   redirect: '/customer/list',
-  //   children: [
-  //     {
-  //       path: 'customer',
-  //       component: () => import('@/views/customer/list'),
-  //       name: 'customerList',
-  //       meta: { title: '入住人管理', icon: 'el-icon-s-custom', noCache: true }
-  //     }
-  //   ]
-  // },
-  {
-    path: '/customerlist',
-    component: Layout,
-    redirect: '/customerlist/index',
-    children: [
-      {
-        path: 'index',
+        path: 'list',
         component: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : uiVersion === 2 ? import('@/views/customer/customerManagement') : import('@/views/customer/elderlyCareManagement'),
-        name: uiVersion === 1 ? 'patientManagement' : uiVersion === 2 ? 'customerManager' : 'elderlyCareManager',
+        name: 'customer-manager',
         meta: {
           title: uiVersion === 1 ? i18n.t('tab.patientManage') : i18n.t('tab.customerManage'),
           icon: 'el-icon-s-custom',
@@ -283,9 +235,9 @@ export const partRoutes = [
         }
       },
       {
-        path: '/allMap',
+        path: 'map',
         component: () => import('@/views/customer/allMap'),
-        name: 'allMap',
+        name: 'map',
         meta: { title: '用户分布', icon: 'area', noCache: true },
         hidden: true
       },
@@ -298,345 +250,190 @@ export const partRoutes = [
       }
     ]
   },
-  // {
-  //   path: '/ncs-nurse-watch',
-  //   component: Layout,
-  //   redirect: '/ncs-device/nurse_watch',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/ncs-device/nurse_watch'),
-  //       name: 'nurse_watch',
-  //       meta: { title: i18n.t('tab.mobileDeviceManage'), icon: 'el-icon-watch', noCache: true } // 移动设备
-  //     },
-  //     {
-  //       path: '/myMapHtml',
-  //       component: () => import('@/views/customer/myMapHtml'),
-  //       name: 'myMapHtml',
-  //       meta: { title: i18n.t('customerManage.footprint'), icon: 'area', noCache: true },
-  //       hidden: true
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/ncs-user-watch',
-  //   component: Layout,
-  //   redirect: '/ncs-device/user_watch',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/ncs-device/user_watch'),
-  //       name: 'user_watch',
-  //       meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch', noCache: true }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/ncs-sos-device',
-  //   component: Layout,
-  //   redirect: '/ncs-device/sos_device',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'),
-  //       name: 'sos-device-setting',
-  //       meta: { title: i18n.t('tab.sosDeviceSettingManage'), icon: 'el-icon-s-help', noCache: true }
-  //     }
-  //   ]
-  // },
-  {
-    path: '/ncs-channel',
-    component: Layout,
-    redirect: '/ncs-channel/index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/ncs-channel/index'),
-        name: 'ncsChannel',
-        meta: { title: i18n.t('tab.channelManage'), icon: 'el-icon-mobile-phone', noCache: true }
-      },
-      {
-        path: '/ncs-channel/history/:id?',
-        component: () => import('@/views/ncs-channel/channelImHistory'),
-        name: 'channelImHistory',
-        meta: { title: i18n.t('tab.channelImHistory'), icon: 'area', noCache: true },
-        hidden: true
-      }
-    ]
-  },
+  //便签
   {
     path: '/remark',
     component: Layout,
-    redirect: '/remark/index',
+    name: 'remark-list',
     children: [
       {
-        path: 'remark',
+        path: 'list',
         component: () => import('@/views/ncs-remark/index'),
-        name: 'remarkList',
+        name: 'remark-list',
         meta: { title: i18n.t('tab.remarkManage'), icon: 'el-icon-s-order', noCache: true }
       }
     ]
   },
+  //任务
   {
     path: '/task',
     component: Layout,
-    redirect: '/task/index',
+    name: 'task-list',
     children: [
       {
-        path: 'task',
+        path: 'list',
         component: () => import('@/views/ncs-task/index'),
-        name: 'taskList',
+        name: 'task-list',
         meta: { title: i18n.t('tab.taskManage'), icon: 'table', noCache: true }
       }
     ]
   },
+  //交互信息
   {
-    path: '/ncs-interaction',
+    path: '/interaction',
     component: Layout,
-    redirect: '/ncs-interaction/index',
+    redirect: '/interaction/history',
+    name: 'interaction',
+    meta: { title: i18n.t('tab.interaction'), icon: 'list', noCache: true },
     children: [
       {
-        path: 'index',
+        path: 'history',
         component: () => import('@/views/ncs-interaction/index'),
-        name: 'CallingList',
+        name: 'interaction-history',
         meta: { title: i18n.t('tab.interactionHistory'), icon: 'list', noCache: true }
+      },{
+        path: 'chars',
+        component: () => import('@/views/ncs-chars/index'),
+        name: 'interaction-chars',
+        meta: { title: i18n.t('tab.interactionChars'), icon: 'el-icon-pie-chart', noCache: true }
       }
     ]
   },
-
-  // {
-  //   path: '/calling-message',
-  //   component: Layout,
-  //   redirect: '/calling-message/index',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/calling-message/index'),
-  //       name: 'CallingMessage',
-  //       meta: { title: '留言设置', icon: 'email', noCache: true }
-  //     }
-  //   ]
-  // },
-
-  {
-    path: '',
-    component: Layout,
-    redirect: '/frameGroup/index',
-    name: 'frameGroup',
-    children: [
-      {
-        path: '/frameGroup/index',
-        component: () => import('@/views/hospitalFrame/frameGroup'),
-        name: 'frameGroup',
-        meta: { title: i18n.t('tab.frameGroupManage'), icon: 'area', noCache: true }
-      },
-      {
-        path: '/frameGroup/edit/:id?',
-        component: () => import('@/views/hospitalFrame/frameGroupEdit'),
-        name: 'frameGroupEdit',
-        meta: { title: i18n.t('tab.frameGroupEdit'), icon: 'area', noCache: true },
-        hidden: true
-      },
-      {
-        path: 'nurse_watch_frame/:id?',
-        component: () => import('@/views/hospitalFrame/nurse_watch_frame'),
-        name: 'nurseWatchFrame',
-        meta: { title: i18n.t('tab.watchFrameManage'), icon: 'area', noCache: true },
-        hidden: true
-      }
-    ]
-  },
+  //广播
   {
-    path: '',
+    path: '/broadcast',
     component: Layout,
-    redirect: '/broadcast/index',
+    name: 'broadcast',
+    hidden: !enableBroadcast || uiVersion !== 1,
     children: [
       {
-        path: '/broadcast/index',
+        path: 'index',
         component: () => import('@/views/ncs-broadcast/index'),
-        name: 'Broadcast',
-        meta: { title: i18n.t('tab.broadcastManage'), icon: 'el-icon-headset', noCache: true } // 广播设置
+        name: 'broadcast',
+        meta: { title: i18n.t('tab.broadcastManage'), icon: 'el-icon-headset', noCache: true }, // 广播设置
+        hidden: !enableBroadcast || uiVersion !== 1
       },
       {
-        path: '/broadcast/edit/:id?',
+        path: 'edit/:id?',
         component: () => import('@/views/ncs-broadcast/broadcastEdit'),
-        name: 'broadcastEdit',
+        name: 'broadcast-edit',
         meta: { title: i18n.t('tab.broadcastEdit'), icon: 'area', noCache: true },
         hidden: true
       }
-    ],
-    hidden: uiVersion !== 1
-  },
-  {
-    path: '/ncs-nurse-config',
+    ]
+  },{
+    path: '/infoboard_designer',
     component: Layout,
-    redirect: '/ncs-nurse-config/index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/ncs-nurse-config/index'),
-        name: 'NcsNurseConfig',
-        meta: { title: i18n.t('tab.nurseConfig'), icon: 'care1', noCache: true } // 护理参数
-      }
-    ],
-    hidden: uiVersion !== 1
-  },
-  // {
-  //   path: '/calling-board',
-  //   component: Layout,
-  //   redirect: '/calling-board/index',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/calling-board/index'),
-  //       name: 'CallingBoard',
-  //       meta: { title: i18n.t('tab.boardManage'), icon: 'el-icon-data-board', noCache: true }
-  //     }
-  //   ],
-  //
-  // },
-
-  // {
-  //   path: '/board-title',
-  //   component: Layout,
-  //   redirect: '/custom-infoboard/board-title',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/custom-infoboard/board-title'),
-  //       name: 'BoardTitle',
-  //       meta: { title: i18n.t('tab.customBoardManage'), icon: 'designer', noCache: true }
-  //     }
-  //   ],
-  //   hidden: uiVersion === 2
-  // },
-  {
-    path: '/calling-board-designer',
-    component: Layout,
-    redirect: '/custom-infoboard/screen-designer',
+    name: 'infoboard-designer',
     children: [
       {
         path: 'index/:id?',
         component: () => import('@/views/custom-infoboard/infoboard-designer'), // 自定义看板 component: () => import('@/views/custom-infoboard/infoboard-designer'),资阳 component: () => import('@/views/custom-infoboard/screen-designer')
-        name: 'BoardDesigner',
+        name: 'infoboard-designer',
         meta: { title: i18n.t('tab.customBoardDesigner'), icon: 'el-icon-data-board', noCache: true }
       }
     ],
     hidden: true
-  },
-
-  {
-    path: '/ncs-event',
-    component: Layout,
-    redirect: '/ncs-event/index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/ncs-event/index'),
-        name: 'eventList',
-        meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true }
-      }
-    ]
-  },
-  // {
-  //   path: '/calling-deviceregisterparams',
-  //   component: Layout,
-  //   redirect: '/deviceregisterparams/index',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/calling-deviceRegisterParam/index'),
-  //       name: 'deviceRegisterParam',
-  //       meta: { title: '设备自动注册参数', icon: 'params', noCache: true }
-  //     }
-  //   ]
-  // },
-  {
-    path: '/ncs-interaction-chars',
-    component: Layout,
-    redirect: '/ncs-interaction-chars/index',
-    children: [
-      {
-        path: 'index',
-        component: () => import('@/views/ncs-chars/index'),
-        name: 'interactionChars',
-        meta: { title: i18n.t('tab.interactionChars'), icon: 'el-icon-pie-chart', noCache: true }
-      }
-    ]
-  },
-  // {
-  //   path: '/function-mapping',
-  //   component: Layout,
-  //   redirect: '/function-mapping/index',
-  //   children: [
-  //
-  //   ]
-  // },
-  {
-    path: '/components',
+  },{
+    path: '/settings',
     component: Layout,
+    redirect: '/settings/index',
+    name: 'part-settings',
     meta: {
-      title: i18n.t('tab.bedsideInteration'),
-      icon: 'component'
+      title: i18n.t('tab.settings'),
+      icon: 'el-icon-s-tools'
     },
     children: [
       {
-        path: '/function-mapping/index',
-        component: () => import('@/views/function-mapping/index'),
-        name: 'functionMapping',
-        meta: { title: i18n.t('tab.functionRoleMapping'), icon: 'function', noCache: true }
-      },
-      {
-        path: '/interaction-chain/index',
-        component: () => import('@/views/interaction-chain/index'),
-        name: 'interactionChain',
-        meta: { title: i18n.t('tab.interactionChain'), icon: 'squence', noCache: true } // 交互接收顺序
-      },
-      {
-        path: '/countdonw/index',
-        component: () => import('@/views/ncs-countdown-config/index'),
-        name: 'countdownConfig',
-        meta: { title: i18n.t('tab.countdownConfig'), icon: 'countdown', noCache: true }
-      },
-      {
-        path: '/screentip/index',
-        component: () => import('@/views/ncs-screentip/index'),
-        name: 'screenTip',
-        meta: { title: i18n.t('tab.screentip'), icon: 'screen_tip', noCache: true }
-      }
-    ]
-  },
-  // {
-  //   path: '/screen-tip',
-  //   component: Layout,
-  //   redirect: '/ncs-screentip/index',
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/ncs-screentip/index'),
-  //       name: 'screenTip',
-  //       meta: { title: i18n.t('tab.screentip'), icon: 'screen_tip', noCache: true }
-  //     }
-  //   ]
-  // },
-  // {
-  //   path: '/interaction-chain',
-  //   component: Layout,
-  //   redirect: '/interaction-chain/index',
-  //   children: [
-  //
-  //   ]
-  // },
-  {
-    path: '/calling-setting',
-    component: Layout,
-    redirect: '/calling-setting/index',
-    children: [
-      {
         path: 'index',
         component: () => import('@/views/calling-setting/index'),
-        name: 'CallingSetting',
-        meta: { title: i18n.t('tab.partSetting'), icon: 'el-icon-s-tools', noCache: true } // 机构设置
+        name: 'part-settings',
+        meta: { title: i18n.t('tab.partSettings'), icon: 'el-icon-s-tools', noCache: true } // 机构设置
+      },{
+        path: 'nurse_config',
+        component: () => import('@/views/ncs-nurse-config/index'),
+        name: 'nurse-config',
+        meta: { title: i18n.t('tab.nurseConfig'), icon: 'care1', noCache: true }, // 护理参数
+        hidden: uiVersion !== 1
+      },{
+        path: 'channel',
+        component: () => import('@/views/ncs-channel/index'),
+        name: 'channel',
+        meta: { title: i18n.t('tab.channelManage'), icon: 'el-icon-mobile-phone', noCache: true },
+        children: [{
+            path: 'history/:id?',
+            component: () => import('@/views/ncs-channel/channelImHistory'),
+            name: 'channel-im-history',
+            meta: { title: i18n.t('tab.channelImHistory'), icon: 'area', noCache: true },
+            hidden: true
+          }
+        ]
+      },{
+        path: 'event_list',
+        component: () => import('@/views/ncs-event/index'),
+        name: 'event-list',
+        meta: { title: i18n.t('tab.eventManage'), icon: 'el-icon-notebook-2', noCache: true }
+      },{
+        path: 'components',
+        component: () => import('@/views/hospitalFrame/index'),
+        redirect: '/settings/components/function_mapping',
+        name: 'beds-side',
+        meta: {
+          title: i18n.t('tab.bedsideInteration'),
+          icon: 'component'
+        },
+        children: [
+          {
+            path: 'function_mapping',
+            component: () => import('@/views/function-mapping/index'),
+            name: 'function-mapping',
+            meta: { title: i18n.t('tab.functionRoleMapping'), icon: 'function', noCache: true }
+          },
+          {
+            path: 'interaction_chain',
+            component: () => import('@/views/interaction-chain/index'),
+            name: 'interaction-chain',
+            meta: { title: i18n.t('tab.interactionChain'), icon: 'squence', noCache: true } // 交互接收顺序
+          },
+          {
+            path: 'countdonw',
+            component: () => import('@/views/ncs-countdown-config/index'),
+            name: 'countdown-config',
+            meta: { title: i18n.t('tab.countdownConfig'), icon: 'countdown', noCache: true }
+          },
+          {
+            path: 'screentip',
+            component: () => import('@/views/ncs-screentip/index'),
+            name: 'screen-tip',
+            meta: { title: i18n.t('tab.screentip'), icon: 'screen_tip', noCache: true }
+          }
+        ]
+      },{
+        path: '/frame_group',
+        component: () => import('@/views/hospitalFrame/index'),
+        name: 'frame-group',
+        children: [
+          {
+            path: 'index',
+            component: () => import('@/views/hospitalFrame/frameGroup'),
+            name: 'frame-group',
+            meta: { title: i18n.t('tab.frameGroupManage'), icon: 'area', noCache: true }
+          },
+          {
+            path: 'edit/:id?',
+            component: () => import('@/views/hospitalFrame/frameGroupEdit'),
+            name: 'frame-group-edit',
+            meta: { title: i18n.t('tab.frameGroupEdit'), icon: 'area', noCache: true },
+            hidden: true
+          },
+          {
+            path: 'watch_frame/:id?',
+            component: () => import('@/views/hospitalFrame/nurse_watch_frame'),
+            name: 'nurse-watch-frame',
+            meta: { title: i18n.t('tab.watchFrameManage'), icon: 'area', noCache: true },
+            hidden: true
+          }
+        ]
       }
     ]
   },
@@ -663,7 +460,6 @@ export const hospitalRoutes = [
     children: [
       {
         path: 'index',
-        // component: () => import('@/views/hospital/ncs_device/deviceManager'),
         component: () => import('@/views/hospital/deviceManagement'),
         name: 'hospital_deviceList',
         meta: { title: i18n.t('tab.deviceManage'), icon: 'component', noCache: true }
@@ -691,11 +487,8 @@ export const hospitalRoutes = [
       {
         path: 'index',
         component: () => import('@/views/hospital/customerManagement'),
-        name: 'hospital_customerList',
+        name: 'customer-list',
         meta: { title: i18n.t('tab.customerManage'), icon: 'el-icon-s-custom', noCache: true }
-        // component: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : import('@/views/customer/customerManagement'),
-        // name: uiVersion === 1 ? 'hospital_patientList' : 'hospital_customerList',
-        // meta: { title: uiVersion === 1 ? '入住人管理' : '用户管理', icon: 'el-icon-s-custom', noCache: true }
       }
     ]
   },
@@ -945,18 +738,6 @@ export const adminRoutes = [
       }
     ]
   },
-  // {
-  //   path: '/ncs-linux-version',
-  //   component: Layout,
-  //   children: [
-  //     {
-  //       path: 'index',
-  //       component: () => import('@/views/ncs-linux-version/linuxVersionSetting'),
-  //       name: 'linuxVersion',
-  //       meta: { title: i18n.t('tab.linuxVersion'), icon: 'nested', noCache: true }
-  //     }
-  //   ]
-  // },
   {
     path: '/device-frame',
     component: Layout,

+ 20 - 37
src/store/modules/permission.js

@@ -46,12 +46,6 @@ const mutations = {
     state.routes = constantRoutes.concat(routes)
   }
 }
-
-function getUserRoutes(role_id, routes) {
-  getUserRolesPermissions(role_id).then(response => {
-    return filterRoleRouter(routes, response)
-  })
-}
 const actions = {
   async generateRoutes({ commit }) {
     return new Promise(resolve => {
@@ -60,48 +54,38 @@ const actions = {
       const userInfo = store.getters.userInfo
       if (userInfo.username === 'superadmin') { // 超级管理员
         lastRoutes = accessedRoutes.concat(adminRoutes)
+        commit('SET_ROUTES', lastRoutes)
+        resolve(lastRoutes)
       } else {
         const shopInfo = store.getters.organization // 机构信息
         if (shopInfo.shop_type === '6') { // 为医院
-          if (userInfo && userInfo.founder === 1) { // 科室管理
+          if (userInfo && userInfo.founder === 1) { // 医院管理
             lastRoutes = accessedRoutes.concat(hospitalRoutes)
+            commit('SET_ROUTES', lastRoutes)
+            resolve(lastRoutes)
           } else {
-            lastRoutes = accessedRoutes.concat(getUserRoutes(userInfo.role_id, hospitalRoutes))
+            getUserRolesPermissions(userInfo.role_id).then(response => {
+              const userRoutes = filterRoleRouter(hospitalRoutes, response)
+              lastRoutes = accessedRoutes.concat(userRoutes)
+              commit('SET_ROUTES', lastRoutes)
+              resolve(lastRoutes)
+            })
           }
         } else if (shopInfo.shop_type === '5') { // 为科室
           if (userInfo && userInfo.founder === 1) { // 科室管理
             lastRoutes = accessedRoutes.concat(partRoutes)
+            commit('SET_ROUTES', lastRoutes)
+            resolve(lastRoutes)
           } else {
-            lastRoutes = accessedRoutes.concat(getUserRoutes(userInfo.role_id, partRoutes))
-          }
+            getUserRolesPermissions(userInfo.role_id).then(response => {
+              const userRoutes = filterRoleRouter(partRoutes, response)
+              lastRoutes = accessedRoutes.concat(userRoutes)
+              commit('SET_ROUTES', lastRoutes)
+              resolve(lastRoutes)
+            })
+          }          
         }
       }
-      commit('SET_ROUTES', lastRoutes)
-      resolve(lastRoutes)
-      // if (userInfo && userInfo.founder === 1) { // 机构管理
-      //   if (userInfo.username === 'superadmin') { // 超级管理员
-      //     lastRoutes = accessedRoutes.concat(adminRoutes)
-      //   } else { // 普通机构管理员
-      //     lastRoutes = accessedRoutes.concat(partRoutes)
-      //   }
-      //   commit('SET_ROUTES', lastRoutes)
-      //   resolve(lastRoutes)
-      // } else if (userInfo) { // 普通医护人员
-      //   getUserRolesPermissions(userInfo.role_id).then(response => {
-      //     const filtered = filterRoleRouter(partRoutes, response)
-      //     console.log(filtered)
-      //     // 过滤路由之后,因为首页不会匹配,需要根据店铺类型加入不同首页
-      //     // let lastAccessedRouters = []
-      //     // if (shopt.getters.shopInfo.shop_type !== '3' && shopt.getters.shopInfo.shop_type !== '2') {
-      //     //   lastAccessedRouters = careIndexRouter.concat(accessedRouters)
-      //     // } else {
-      //     //   lastAccessedRouters = shopDashboardRouter.concat(accessedRouters)
-      //     // }
-      //     lastRoutes = accessedRoutes.concat(filtered)
-      //     commit('SET_ROUTES', lastRoutes)
-      //     resolve(lastRoutes)
-      //   })
-      // }
     })
   },
   /** 退出时清除 动态挂载的路由 */
@@ -126,7 +110,6 @@ function filterRoleRouter(routers, names) {
       _routers.push(item)
     }
   })
-
   return _routers
 }
 

+ 13 - 0
src/views/hospitalFrame/index.vue

@@ -0,0 +1,13 @@
+<template>
+    <transition name="fade-transform" mode="out-in">
+      <keep-alive :include="cachedViews">
+        <router-view></router-view>
+      </keep-alive>
+    </transition>
+  </template>
+  
+  <script>
+    export default {
+      name: 'frameGroup'
+    }
+  </script>

+ 295 - 0
src/views/ncs-device/device-list.vue

@@ -0,0 +1,295 @@
+<template>
+  <div class="app-container">
+
+    <en-table-layout
+      toolbar
+      pagination
+      :table-data="tableData"
+      :height="tableHeight"
+      :loading="loading"
+      @selection-change="selectFun"
+      @sort-change="tableSort"
+    >
+      <!--工具栏-->
+      <div slot="toolbar" class="inner-toolbar">
+        <div class="toolbar-search">
+          <en-table-search :placeholder="this.$t('action.keywords')" @search="handlerSearch" />
+        </div>
+        <div class="toolbar-btns">
+          <el-switch
+            v-model="editLock"
+            active-text="打开编辑"
+            inactive-text="关闭编辑"
+            style="margin-right: 20px;"
+            @change="editLockChange"
+          />
+          <!--          <el-button v-if="editLock" type="primary" @click="handlerAdd">新增设备</el-button>-->
+          <el-button v-if="editLock" type="danger" @click="batchDelete">批量删除</el-button>
+        </div>
+      </div>
+      <!--表头-->
+      <template slot="table-columns">
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+        />
+        <el-table-column prop="id" sortable="custom" label="ID" width="100" align="center" />
+        <el-table-column prop="device_type" sortable="custom" label="设备类型" width="160" align="center" :formatter="formatterDeviceType" />
+        <el-table-column prop="name" sortable="custom" label="设备别名" width="160" align="center" />
+        <el-table-column prop="status" sortable="custom" label="设备状态" width="120" align="center" :formatter="formatterStatus">
+          <template slot-scope="scope">
+            <span :class="scope.row.status===1?'green-text':'red-text'">{{ scope.row.status===1?'已启用':'未启用' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="full_name" sortable="custom" label="部署位置" width="140" align="center" />
+        <el-table-column prop="eth_mac" sortable="custom" label="有线物理地址" width="160" align="center" />
+        <el-table-column prop="eth_ip" sortable="custom" label="有线IP地址" width="160" align="center" />
+        <el-table-column prop="model" sortable="custom" label="设备型号" width="160" align="center" />
+        <el-table-column prop="code" sortable="custom" label="出厂编号" width="160" align="center" />
+        <el-table-column prop="soft_ver" sortable="custom" label="软件版本" width="160" align="center" />
+        <el-table-column prop="hard_ver" sortable="custom" label="硬件版本" width="160" align="center" />
+        <el-table-column prop="wifi_mac" sortable="custom" label="WIFI物理地址" width="160" align="center" />
+        <el-table-column prop="wifi_ip" sortable="custom" label="WIFIIP地址" width="160" align="center" />
+        <el-table-column prop="sip_id" sortable="custom" label="SIP账号" width="160" align="center" />
+        <el-table-column prop="update_time" sortable="custom" label="最后修改时间" width="160" align="center" />
+        <el-table-column v-if="editLock" label="操作" align="center" fixed="right" width="160">
+          <template slot-scope="scope">
+            <el-button type="success" size="mini" @click="handlerEdit(scope.$index,scope.row)">编辑</el-button>
+            <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">删除</el-button>
+          </template>
+        </el-table-column>
+      </template>
+
+      <!--翻页-->
+      <el-pagination
+        v-if="pageData"
+        slot="pagination"
+        :current-page="pageData.page_no"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageData.page_size"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="pageData.data_total"
+        @size-change="handlePageSizeChange"
+        @current-change="handlePageCurrentChange"
+      />
+    </en-table-layout>
+
+    <el-dialog title.sync="修改设备" :visible.sync="formshow" width="70%">
+      <device-edit :device-id="deviceId" @saved="handlePatientFinished" />
+    </el-dialog>
+
+    <el-dialog title="开启设备编辑" :visible.sync="formshow1" width="30%">
+      <div>
+        <el-form ref="editform1" label-width="120px" :model="formmodel1">
+          <el-form-item label="管理密码" prop="manager_password">
+            <el-input v-model="formmodel1.manager_password" clearable type="password" placeholder="请输入管理密码" />
+          </el-form-item>
+        </el-form>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="formshow1 = false">取 消</el-button>
+        <el-button type="primary" @click.native.prevent="validEditPassword">确 定</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import * as API_Device from '@/api/ncs_device'
+import DeviceEdit from '@/views/ncs-device/device-edit'
+import { returnDeviceType } from '@/utils/device_type'
+export default {
+  name: 'Index',
+  components: { DeviceEdit },
+  data: function() {
+    return {
+      /** 表格数据 */
+      tableData: [],
+      /** 表单数据 */
+      formmodel1: {
+        manager_password: null
+      },
+      /** 弹出窗口标题信息 */
+      formshow: false, // 编辑表单显示开关
+      formshow1: false,
+      /** 列表参数 */
+      params: {
+        page_size: 20,
+        page_no: 1,
+        fixedCondition: ' part_id=' + this.$store.getters.partId,
+        sort: 'id',
+        dir: 'desc'
+      },
+      /** 翻页数据*/
+      pageData: [],
+      loading: false,
+      /** 表格选中记录 */
+      multipleSelection: [],
+      editLock: this.$store.getters.editLock === 'true',
+      deviceId: null
+    }
+  },
+  computed: {
+    tableHeight() {
+      return this.mainAreaHeight - 130
+    }
+  },
+  async mounted() {
+    this.getList()
+  },
+  methods: {
+    /** 编辑按钮 */
+    async handlerEdit(index, row) {
+      this.deviceId = row.id
+      this.formshow = true
+    },
+    handlePatientFinished() {
+      this.formshow = false
+      this.GET_List()
+    },
+    /** 表格行选择变化记录选中行数据*/
+    selectFun: function(val) {
+      this.multipleSelection = val
+    },
+    /** 删除单条数据 */
+    handlerDelete(ids) {
+      this.$confirm(this.$t('action.sureDelete'), this.$t('action.waring'), {
+        confirmButtonText: this.$t('action.yes'),
+        cancelButtonText: this.$t('action.cancel'),
+        type: 'warning'
+      }).then(() => {
+        API_Device.remove(ids).then(
+          response => {
+            this.getList()
+            this.$message({
+              type: 'success',
+              message: this.$t('action.deleted')
+            })
+          }
+        ).catch(response => {
+          this.$message({
+            type: 'info',
+            message: response.message
+          })
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: this.$t('action.cancelDelete')
+        })
+      })
+    },
+    /** 批量数据删除处理(删除选中的行) */
+    batchDelete: function() {
+      if (this.multipleSelection.length === 0) {
+        this.$alert('没有选择任何记录!', '系统提示', {
+          confirmButtonText: this.$t('action.yes'),
+          callback: action => {
+          }
+        })
+      } else {
+        const ids = []
+        this.multipleSelection.forEach(function(item) {
+          ids.push(item.id)
+        })
+        this.handlerDelete(ids.join(','))
+      }
+    },
+    /** 分页大小发生改变 */
+    handlePageSizeChange(size) {
+      this.params.page_size = size
+      this.getList()
+    },
+    /** 分页页数发生改变 */
+    handlePageCurrentChange(page) {
+      this.params.page_no = page
+      this.getList()
+    },
+    /** 加载列表数据 */
+    getList() {
+      this.loading = true
+      const param = this.MixinClone(this.params)
+      API_Device.getList(param).then(response => {
+        this.loading = false
+        this.tableData = [...response.data]
+        this.pageData = {
+          page_no: response.page_no,
+          page_size: response.page_size,
+          data_total: response.data_total
+        }
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+    formatterDeviceType(row, column, cellValue) {
+      return returnDeviceType(cellValue)
+    },
+    formatterStatus(row, column, cellValue) {
+      return cellValue === 1 ? '<span class="text">已启用</span>' : '未启用'
+    },
+    /** 处理搜索 */
+    handlerSearch(keywords) {
+      this.params.filerStr = keywords
+      this.getList()
+    },
+    /** 处理字段排序 */
+    tableSort(column) {
+      if (column.order !== null) {
+        this.params.sort = column.prop
+        this.params.dir = column.order === 'ascending' ? 'asc' : 'desc'
+      } else {
+        this.params.sort = null
+        this.params.dir = null
+      }
+      this.getList()
+    },
+    editLockChange(val) {
+      this.formshow1 = true
+      this.editLock = false
+    },
+    validEditPassword() {
+      if (this.formmodel1.manager_password === 'wdkl2020') {
+        this.formshow1 = false
+        this.editLock = true
+        this.$store.dispatch('user/toggleEditLock', true)
+      } else {
+        this.$message.error('密码错误!')
+      }
+    }
+  }
+}
+</script>
+
+<style scoped type="text/scss">
+  /deep/ .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+  }
+  .avatar {
+    width: 178px;
+    height: 178px;
+    display: block;
+  }
+  .green-text{
+    color: green;
+  }
+  .red-text{
+    color:red;
+  }
+</style>

+ 11 - 293
src/views/ncs-device/index.vue

@@ -1,295 +1,13 @@
 <template>
-  <div class="app-container">
-
-    <en-table-layout
-      toolbar
-      pagination
-      :table-data="tableData"
-      :height="tableHeight"
-      :loading="loading"
-      @selection-change="selectFun"
-      @sort-change="tableSort"
-    >
-      <!--工具栏-->
-      <div slot="toolbar" class="inner-toolbar">
-        <div class="toolbar-search">
-          <en-table-search :placeholder="this.$t('action.keywords')" @search="handlerSearch" />
-        </div>
-        <div class="toolbar-btns">
-          <el-switch
-            v-model="editLock"
-            active-text="打开编辑"
-            inactive-text="关闭编辑"
-            style="margin-right: 20px;"
-            @change="editLockChange"
-          />
-          <!--          <el-button v-if="editLock" type="primary" @click="handlerAdd">新增设备</el-button>-->
-          <el-button v-if="editLock" type="danger" @click="batchDelete">批量删除</el-button>
-        </div>
-      </div>
-      <!--表头-->
-      <template slot="table-columns">
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-        />
-        <el-table-column prop="id" sortable="custom" label="ID" width="100" align="center" />
-        <el-table-column prop="device_type" sortable="custom" label="设备类型" width="160" align="center" :formatter="formatterDeviceType" />
-        <el-table-column prop="name" sortable="custom" label="设备别名" width="160" align="center" />
-        <el-table-column prop="status" sortable="custom" label="设备状态" width="120" align="center" :formatter="formatterStatus">
-          <template slot-scope="scope">
-            <span :class="scope.row.status===1?'green-text':'red-text'">{{ scope.row.status===1?'已启用':'未启用' }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="full_name" sortable="custom" label="部署位置" width="140" align="center" />
-        <el-table-column prop="eth_mac" sortable="custom" label="有线物理地址" width="160" align="center" />
-        <el-table-column prop="eth_ip" sortable="custom" label="有线IP地址" width="160" align="center" />
-        <el-table-column prop="model" sortable="custom" label="设备型号" width="160" align="center" />
-        <el-table-column prop="code" sortable="custom" label="出厂编号" width="160" align="center" />
-        <el-table-column prop="soft_ver" sortable="custom" label="软件版本" width="160" align="center" />
-        <el-table-column prop="hard_ver" sortable="custom" label="硬件版本" width="160" align="center" />
-        <el-table-column prop="wifi_mac" sortable="custom" label="WIFI物理地址" width="160" align="center" />
-        <el-table-column prop="wifi_ip" sortable="custom" label="WIFIIP地址" width="160" align="center" />
-        <el-table-column prop="sip_id" sortable="custom" label="SIP账号" width="160" align="center" />
-        <el-table-column prop="update_time" sortable="custom" label="最后修改时间" width="160" align="center" />
-        <el-table-column v-if="editLock" label="操作" align="center" fixed="right" width="160">
-          <template slot-scope="scope">
-            <el-button type="success" size="mini" @click="handlerEdit(scope.$index,scope.row)">编辑</el-button>
-            <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">删除</el-button>
-          </template>
-        </el-table-column>
-      </template>
-
-      <!--翻页-->
-      <el-pagination
-        v-if="pageData"
-        slot="pagination"
-        :current-page="pageData.page_no"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="pageData.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="pageData.data_total"
-        @size-change="handlePageSizeChange"
-        @current-change="handlePageCurrentChange"
-      />
-    </en-table-layout>
-
-    <el-dialog title.sync="修改设备" :visible.sync="formshow" width="70%">
-      <device-edit :device-id="deviceId" @saved="handlePatientFinished" />
-    </el-dialog>
-
-    <el-dialog title="开启设备编辑" :visible.sync="formshow1" width="30%">
-      <div>
-        <el-form ref="editform1" label-width="120px" :model="formmodel1">
-          <el-form-item label="管理密码" prop="manager_password">
-            <el-input v-model="formmodel1.manager_password" clearable type="password" placeholder="请输入管理密码" />
-          </el-form-item>
-        </el-form>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="formshow1 = false">取 消</el-button>
-        <el-button type="primary" @click.native.prevent="validEditPassword">确 定</el-button>
-      </div>
-    </el-dialog>
-
-  </div>
-</template>
-
-<script>
-import * as API_Device from '@/api/ncs_device'
-import DeviceEdit from '@/views/ncs-device/device-edit'
-import { returnDeviceType } from '@/utils/device_type'
-export default {
-  name: 'Index',
-  components: { DeviceEdit },
-  data: function() {
-    return {
-      /** 表格数据 */
-      tableData: [],
-      /** 表单数据 */
-      formmodel1: {
-        manager_password: null
-      },
-      /** 弹出窗口标题信息 */
-      formshow: false, // 编辑表单显示开关
-      formshow1: false,
-      /** 列表参数 */
-      params: {
-        page_size: 20,
-        page_no: 1,
-        fixedCondition: ' part_id=' + this.$store.getters.partId,
-        sort: 'id',
-        dir: 'desc'
-      },
-      /** 翻页数据*/
-      pageData: [],
-      loading: false,
-      /** 表格选中记录 */
-      multipleSelection: [],
-      editLock: this.$store.getters.editLock === 'true',
-      deviceId: null
+    <transition name="fade-transform" mode="out-in">
+      <keep-alive :include="cachedViews">
+        <router-view></router-view>
+      </keep-alive>
+    </transition>
+  </template>
+  
+  <script>
+    export default {
+      name: 'deviceIndex'
     }
-  },
-  computed: {
-    tableHeight() {
-      return this.mainAreaHeight - 130
-    }
-  },
-  async mounted() {
-    this.getList()
-  },
-  methods: {
-    /** 编辑按钮 */
-    async handlerEdit(index, row) {
-      this.deviceId = row.id
-      this.formshow = true
-    },
-    handlePatientFinished() {
-      this.formshow = false
-      this.GET_List()
-    },
-    /** 表格行选择变化记录选中行数据*/
-    selectFun: function(val) {
-      this.multipleSelection = val
-    },
-    /** 删除单条数据 */
-    handlerDelete(ids) {
-      this.$confirm(this.$t('action.sureDelete'), this.$t('action.waring'), {
-        confirmButtonText: this.$t('action.yes'),
-        cancelButtonText: this.$t('action.cancel'),
-        type: 'warning'
-      }).then(() => {
-        API_Device.remove(ids).then(
-          response => {
-            this.getList()
-            this.$message({
-              type: 'success',
-              message: this.$t('action.deleted')
-            })
-          }
-        ).catch(response => {
-          this.$message({
-            type: 'info',
-            message: response.message
-          })
-        })
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: this.$t('action.cancelDelete')
-        })
-      })
-    },
-    /** 批量数据删除处理(删除选中的行) */
-    batchDelete: function() {
-      if (this.multipleSelection.length === 0) {
-        this.$alert('没有选择任何记录!', '系统提示', {
-          confirmButtonText: this.$t('action.yes'),
-          callback: action => {
-          }
-        })
-      } else {
-        const ids = []
-        this.multipleSelection.forEach(function(item) {
-          ids.push(item.id)
-        })
-        this.handlerDelete(ids.join(','))
-      }
-    },
-    /** 分页大小发生改变 */
-    handlePageSizeChange(size) {
-      this.params.page_size = size
-      this.getList()
-    },
-    /** 分页页数发生改变 */
-    handlePageCurrentChange(page) {
-      this.params.page_no = page
-      this.getList()
-    },
-    /** 加载列表数据 */
-    getList() {
-      this.loading = true
-      const param = this.MixinClone(this.params)
-      API_Device.getList(param).then(response => {
-        this.loading = false
-        this.tableData = [...response.data]
-        this.pageData = {
-          page_no: response.page_no,
-          page_size: response.page_size,
-          data_total: response.data_total
-        }
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    formatterDeviceType(row, column, cellValue) {
-      return returnDeviceType(cellValue)
-    },
-    formatterStatus(row, column, cellValue) {
-      return cellValue === 1 ? '<span class="text">已启用</span>' : '未启用'
-    },
-    /** 处理搜索 */
-    handlerSearch(keywords) {
-      this.params.filerStr = keywords
-      this.getList()
-    },
-    /** 处理字段排序 */
-    tableSort(column) {
-      if (column.order !== null) {
-        this.params.sort = column.prop
-        this.params.dir = column.order === 'ascending' ? 'asc' : 'desc'
-      } else {
-        this.params.sort = null
-        this.params.dir = null
-      }
-      this.getList()
-    },
-    editLockChange(val) {
-      this.formshow1 = true
-      this.editLock = false
-    },
-    validEditPassword() {
-      if (this.formmodel1.manager_password === 'wdkl2020') {
-        this.formshow1 = false
-        this.editLock = true
-        this.$store.dispatch('user/toggleEditLock', true)
-      } else {
-        this.$message.error('密码错误!')
-      }
-    }
-  }
-}
-</script>
-
-<style scoped type="text/scss">
-  /deep/ .avatar-uploader .el-upload {
-    border: 1px dashed #d9d9d9;
-    border-radius: 6px;
-    cursor: pointer;
-    position: relative;
-    overflow: hidden;
-  }
-  .avatar-uploader .el-upload:hover {
-    border-color: #409EFF;
-  }
-  .avatar-uploader-icon {
-    font-size: 28px;
-    color: #8c939d;
-    width: 178px;
-    height: 178px;
-    line-height: 178px;
-    text-align: center;
-  }
-  .avatar {
-    width: 178px;
-    height: 178px;
-    display: block;
-  }
-  .green-text{
-    color: green;
-  }
-  .red-text{
-    color:red;
-  }
-</style>
+  </script>