Ver Fonte

优化医生、药师端前端目录结构

cgp há 2 dias atrás
pai
commit
f1bb7b3fb1

+ 1 - 0
java/fs-doctor-app/src/main/java/com/fs/app/controller/DoctorController.java

@@ -293,6 +293,7 @@ public class DoctorController extends  AppBaseController {
         map.put("doctor", doctor);
         map.put("roles", fsDoctorPermissionService.getRolePermission(doctorId));
         map.put("permissions", fsDoctorPermissionService.getMenuPermission(doctorId));
+        map.put("routers", fsDoctorPermissionService.getRouters(doctorId));
         return R.ok(map);
     }
 

+ 5 - 5
java/fs-service/src/main/resources/db/tenant-initData.sql

@@ -6922,11 +6922,11 @@ WHERE NOT EXISTS (SELECT 1 FROM lobster_user_segment WHERE company_id = 0 AND se
 INSERT INTO `tenant_doctor_menu`
 (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `remark`)
 VALUES
-    (1, 'IM问诊', 0, 1, 'consult', 'doctor/consultWorkbench/index', 1, 0, 'C', '0', '0', 'doctor:consult:list', 'form', 'admin', NOW(), 'IM问诊'),
-    (2, '患者管理', 0, 2, 'patient', 'doctor/patientRecord/index', 1, 0, 'C', '0', '0', 'doctor:patient:list', 'user', 'admin', NOW(), '患者管理'),
-    (3, '电子处方', 0, 3, 'prescribe', 'doctor/prescribeCreate/index', 1, 0, 'C', '0', '0', 'doctor:prescribe:list', 'edit', 'admin', NOW(), '电子处方'),
-    (4, '用药咨询', 0, 2, 'medicineAdvice', 'doctor/medicineAdvice/index', 1, 0, 'C', '0', '0', 'doctor:medicineAdvice:list', 'user', 'admin', NOW(), '用药咨询'),
-    (5, '处方审核', 0, 3, 'prescriptionAudit', 'doctor/prescriptionAudit/index', 1, 0, 'C', '0', '0', 'doctor:prescriptionAudit:list', 'edit', 'admin', NOW(), '处方审核')
+    (1, 'IM问诊', 0, 1, 'consult', 'im/IMConsultation/index', 1, 0, 'C', '0', '0', 'doctor:consult:list', 'form', 'admin', NOW(), 'IM问诊'),
+    (2, '患者管理', 0, 2, 'patient', 'patient/patientRecord/index', 1, 0, 'C', '0', '0', 'doctor:patient:list', 'user', 'admin', NOW(), '患者管理'),
+    (3, '电子处方', 0, 3, 'prescribe', 'electronicPrescribe/prescribe/index', 1, 0, 'C', '0', '0', 'doctor:prescribe:list', 'edit', 'admin', NOW(), '电子处方'),
+    (4, '用药咨询', 0, 2, 'medicineAdvice', 'medicat/medicatConsultation/index', 1, 0, 'C', '0', '0', 'doctor:medicineAdvice:list', 'user', 'admin', NOW(), '用药咨询'),
+    (5, '处方审核', 0, 3, 'prescriptionAudit', 'electronicPrescribe/prescribeAudit/index', 1, 0, 'C', '0', '0', 'doctor:prescriptionAudit:list', 'edit', 'admin', NOW(), '处方审核')
 ON DUPLICATE KEY UPDATE
                      `menu_name` = VALUES(`menu_name`),
                      `parent_id` = VALUES(`parent_id`),

+ 60 - 40
ylrz-doctorui/src/store/modules/permission.js

@@ -2,54 +2,75 @@ import { constantRoutes } from '@/router'
 import Layout from '@/layout/index'
 
 /**
- * 根据医生类型(1医生/2药师)生成菜单路由。
- * 医生:处方列表 + 开方;药师:处方审核。
+ * 根据后端返回的医生菜单树(登录/会话接口的 routers)动态生成路由。
+ * 支持「目录(M) + 菜单(C)」两级嵌套:
+ *  - 目录(M):包一层 Layout,children 递归生成子路由
+ *  - 顶层叶子菜单(C):包一层 Layout + 单个空 path 子路由
  */
-function buildDoctorRoutes(doctorType) {
-  if (Number(doctorType) === 2) {
-    return [
-      {
-        path: '/audit',
-        component: Layout,
-        redirect: 'noRedirect',
-        name: '处方审核',
-        meta: { title: '处方审核', icon: 'form' },
-        children: [
-          {
-            path: 'list',
-            component: () => import('@/views/audit/list'),
-            name: '处方审核列表',
-            meta: { title: '处方审核', icon: 'form' }
-          }
-        ]
-      }
-    ]
+function buildDoctorRoutes(menus) {
+  return (menus || [])
+    .filter(menu => menu.menuType !== 'F')
+    .map(menu => buildTopRoute(menu))
+    .filter(Boolean)
+}
+
+// 顶层菜单:包一层 Layout,渲染在布局内(带侧边栏)
+function buildTopRoute(menu) {
+  const children = (menu.children || []).filter(c => c.menuType !== 'F')
+  if (menu.menuType === 'M' || children.length > 0) {
+    return {
+      path: '/' + menu.path,
+      component: Layout,
+      hidden: menu.visible === '1',
+      meta: { title: menu.menuName, icon: menu.icon || '#' },
+      children: children.map(buildChildRoute).filter(Boolean)
+    }
   }
-  return [
-    {
-      path: '/prescribe',
+  if (menu.component) {
+    return {
+      path: '/' + menu.path,
       component: Layout,
-      redirect: 'noRedirect',
-      name: '处方管理',
-      meta: { title: '处方管理', icon: 'form' },
+      hidden: menu.visible === '1',
+      meta: { title: menu.menuName, icon: menu.icon || '#' },
       children: [
         {
-          path: 'list',
-          component: () => import('@/views/prescribe/list'),
-          name: '处方列表',
-          meta: { title: '处方列表', icon: 'list' }
-        },
-        {
-          path: 'create',
-          component: () => import('@/views/prescribe/create'),
-          name: '开方',
-          meta: { title: '开方', icon: 'edit' }
+          path: '',
+          name: menu.menuName,
+          component: loadView(menu.component),
+          meta: { title: menu.menuName, icon: menu.icon || '#' }
         }
       ]
     }
-  ]
+  }
+  return null
+}
+
+// 子级菜单:挂在 Layout 的 children 下,普通路由(path 相对父级)
+function buildChildRoute(menu) {
+  const children = (menu.children || []).filter(c => c.menuType !== 'F')
+  if (menu.menuType === 'M' || children.length > 0) {
+    return {
+      path: menu.path,
+      component: Layout,
+      hidden: menu.visible === '1',
+      meta: { title: menu.menuName, icon: menu.icon || '#' },
+      children: children.map(buildChildRoute).filter(Boolean)
+    }
+  }
+  if (menu.component) {
+    return {
+      path: menu.path,
+      name: menu.menuName,
+      component: loadView(menu.component),
+      meta: { title: menu.menuName, icon: menu.icon || '#' }
+    }
+  }
+  return null
 }
 
+// 路由组件懒加载
+const loadView = (view) => (resolve) => require([`@/views/${view}`], resolve)
+
 const permission = {
   state: {
     routes: [],
@@ -76,8 +97,7 @@ const permission = {
   actions: {
     GenerateRoutes({ commit, rootState }) {
       return new Promise(resolve => {
-        const doctorType = rootState.user.doctorType
-        const routes = buildDoctorRoutes(doctorType)
+        const routes = buildDoctorRoutes(rootState.user.routers)
         routes.push({ path: '*', redirect: '/404', hidden: true })
         commit('SET_ROUTES', routes)
         commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(routes))

+ 7 - 2
ylrz-doctorui/src/store/modules/user.js

@@ -9,6 +9,7 @@ const user = {
     avatar: '',
     roles: [],
     permissions: [],
+    routers: [],
     doctorType: null
   },
 
@@ -19,7 +20,8 @@ const user = {
     SET_USER: (state, user) => { state.user = user },
     SET_ROLES: (state, roles) => { state.roles = roles },
     SET_PERMISSIONS: (state, permissions) => { state.permissions = permissions },
-    SET_DOCTOR_TYPE: (state, doctorType) => { state.doctorType = doctorType }
+    SET_DOCTOR_TYPE: (state, doctorType) => { state.doctorType = doctorType },
+    SET_ROUTERS: (state, routers) => { state.routers = routers }
   },
 
   actions: {
@@ -38,6 +40,7 @@ const user = {
           commit('SET_ROLES', res.roles || [])
           commit('SET_PERMISSIONS', res.permissions || [])
           commit('SET_DOCTOR_TYPE', doctor ? doctor.doctorType : null)
+          commit('SET_ROUTERS', res.routers || [])
           resolve(res)
         }).catch(error => {
           reject(error)
@@ -56,7 +59,8 @@ const user = {
           commit('SET_ROLES', res.roles || [])
           commit('SET_PERMISSIONS', res.permissions || [])
           commit('SET_DOCTOR_TYPE', doctor ? doctor.doctorType : null)
-          resolve({ user: doctor, roles: res.roles, permissions: res.permissions })
+          commit('SET_ROUTERS', res.routers || [])
+          resolve({ user: doctor, roles: res.roles, permissions: res.permissions, routers: res.routers })
         }).catch(error => {
           reject(error)
         })
@@ -69,6 +73,7 @@ const user = {
         commit('SET_TOKEN', '')
         commit('SET_ROLES', [])
         commit('SET_PERMISSIONS', [])
+        commit('SET_ROUTERS', [])
         commit('SET_USER', undefined)
         commit('SET_DOCTOR_TYPE', null)
         removeToken()

+ 0 - 18
ylrz-doctorui/src/store/store/getters.js

@@ -1,18 +0,0 @@
-const getters = {
-  sidebar: state => state.app.sidebar,
-  size: state => state.app.size,
-  device: state => state.app.device,
-  visitedViews: state => state.tagsView.visitedViews,
-  cachedViews: state => state.tagsView.cachedViews,
-  token: state => state.user.token,
-  avatar: state => state.user.avatar,
-  name: state => state.user.name,
-  introduction: state => state.user.introduction,
-  roles: state => state.user.roles,
-  permissions: state => state.user.permissions,
-  permission_routes: state => state.permission.routes,
-  topbarRouters:state => state.permission.topbarRouters,
-  defaultRoutes:state => state.permission.defaultRoutes,
-  sidebarRouters:state => state.permission.sidebarRouters,
-}
-export default getters

+ 0 - 23
ylrz-doctorui/src/store/store/index.js

@@ -1,23 +0,0 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import app from './modules/app'
-import user from './modules/user'
-import tagsView from './modules/tagsView'
-import permission from './modules/permission'
-import settings from './modules/settings'
-import getters from './getters'
-
-Vue.use(Vuex)
-
-const store = new Vuex.Store({
-  modules: {
-    app,
-    user,
-    tagsView,
-    permission,
-    settings
-  },
-  getters
-})
-
-export default store

+ 0 - 56
ylrz-doctorui/src/store/store/modules/app.js

@@ -1,56 +0,0 @@
-import Cookies from 'js-cookie'
-
-const state = {
-  sidebar: {
-    opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
-    withoutAnimation: false
-  },
-  device: 'desktop',
-  size: Cookies.get('size') || 'medium'
-}
-
-const mutations = {
-  TOGGLE_SIDEBAR: state => {
-    state.sidebar.opened = !state.sidebar.opened
-    state.sidebar.withoutAnimation = false
-    if (state.sidebar.opened) {
-      Cookies.set('sidebarStatus', 1)
-    } else {
-      Cookies.set('sidebarStatus', 0)
-    }
-  },
-  CLOSE_SIDEBAR: (state, withoutAnimation) => {
-    Cookies.set('sidebarStatus', 0)
-    state.sidebar.opened = false
-    state.sidebar.withoutAnimation = withoutAnimation
-  },
-  TOGGLE_DEVICE: (state, device) => {
-    state.device = device
-  },
-  SET_SIZE: (state, size) => {
-    state.size = size
-    Cookies.set('size', size)
-  }
-}
-
-const actions = {
-  toggleSideBar({ commit }) {
-    commit('TOGGLE_SIDEBAR')
-  },
-  closeSideBar({ commit }, { withoutAnimation }) {
-    commit('CLOSE_SIDEBAR', withoutAnimation)
-  },
-  toggleDevice({ commit }, device) {
-    commit('TOGGLE_DEVICE', device)
-  },
-  setSize({ commit }, size) {
-    commit('SET_SIZE', size)
-  }
-}
-
-export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}

+ 0 - 115
ylrz-doctorui/src/store/store/modules/permission.js

@@ -1,115 +0,0 @@
-import { constantRoutes } from '@/router'
-import { getRouters } from '@/api/menu'
-import Layout from '@/layout/index'
-import ParentView from '@/components/ParentView';
-import InnerLink from '@/layout/components/InnerLink'
-
-const permission = {
-  state: {
-    routes: [],
-    addRoutes: [],
-    defaultRoutes: [],
-    topbarRouters: [],
-    sidebarRouters: []
-  },
-  mutations: {
-    SET_ROUTES: (state, routes) => {
-      state.addRoutes = routes
-      state.routes = constantRoutes.concat(routes)
-    },
-    SET_DEFAULT_ROUTES: (state, routes) => {
-      state.defaultRoutes = constantRoutes.concat(routes)
-    },
-    SET_TOPBAR_ROUTES: (state, routes) => {
-      // 顶部导航菜单默认添加统计报表栏指向首页
-      // const index = [{
-      //   path: 'index',
-      //   meta: { title: '统计报表', icon: 'dashboard'}
-      // }]
-      // state.topbarRouters = routes.concat(index);
-
-      state.topbarRouters = routes;
-    },
-    SET_SIDEBAR_ROUTERS: (state, routes) => {
-      state.sidebarRouters = routes
-    },
-  },
-  actions: {
-    // 生成路由
-    GenerateRoutes({ commit }) {
-      return new Promise(resolve => {
-        // 向后端请求路由数据
-        getRouters().then(res => {
-          const sdata = JSON.parse(JSON.stringify(res.data))
-          const rdata = JSON.parse(JSON.stringify(res.data))
-          const sidebarRoutes = filterAsyncRouter(sdata)
-          const rewriteRoutes = filterAsyncRouter(rdata, false, true)
-          rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
-          commit('SET_ROUTES', rewriteRoutes)
-          commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
-          commit('SET_DEFAULT_ROUTES', sidebarRoutes)
-          commit('SET_TOPBAR_ROUTES', sidebarRoutes)
-          resolve(rewriteRoutes)
-        })
-      })
-    }
-  }
-}
-
-// 遍历后台传来的路由字符串,转换为组件对象
-function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
-  return asyncRouterMap.filter(route => {
-    if (type && route.children) {
-      route.children = filterChildren(route.children)
-    }
-    if (route.component) {
-      // Layout ParentView 组件特殊处理
-      if (route.component === 'Layout') {
-        route.component = Layout
-      } else if (route.component === 'ParentView') {
-        route.component = ParentView
-      } else if (route.component === 'InnerLink') {
-        route.component = InnerLink
-      } else {
-        route.component = loadView(route.component)
-      }
-    }
-    if (route.children != null && route.children && route.children.length) {
-      route.children = filterAsyncRouter(route.children, route, type)
-    } else {
-      delete route['children']
-      delete route['redirect']
-    }
-    return true
-  })
-}
-
-function filterChildren(childrenMap, lastRouter = false) {
-  var children = []
-  childrenMap.forEach((el, index) => {
-    if (el.children && el.children.length) {
-      if (el.component === 'ParentView') {
-        el.children.forEach(c => {
-          c.path = el.path + '/' + c.path
-          if (c.children && c.children.length) {
-            children = children.concat(filterChildren(c.children, c))
-            return
-          }
-          children.push(c)
-        })
-        return
-      }
-    }
-    if (lastRouter) {
-      el.path = lastRouter.path + '/' + el.path
-    }
-    children = children.concat(el)
-  })
-  return children
-}
-
-export const loadView = (view) => { // 路由懒加载
-  return (resolve) => require([`@/views/${view}`], resolve)
-}
-
-export default permission

+ 0 - 42
ylrz-doctorui/src/store/store/modules/settings.js

@@ -1,42 +0,0 @@
-import defaultSettings from '@/settings'
-
-const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
-
-const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
-const state = {
-  title: '',
-  theme: storageSetting.theme || '#006CFF',
-  sideTheme: storageSetting.sideTheme || sideTheme,
-  showSettings: showSettings,
-  topNav:  storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
-  tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
-  fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
-  sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
-  dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
-}
-const mutations = {
-  CHANGE_SETTING: (state, { key, value }) => {
-    if (state.hasOwnProperty(key)) {
-      state[key] = value
-    }
-  }
-}
-
-const actions = {
-  // 修改布局设置
-  changeSetting({ commit }, data) {
-    commit('CHANGE_SETTING', data)
-  },
-  // 设置网页标题
-  setTitle({ commit }, title) {
-    state.title = title
-  }
-}
-
-export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}
-

+ 0 - 207
ylrz-doctorui/src/store/store/modules/tagsView.js

@@ -1,207 +0,0 @@
-const state = {
-  visitedViews: [],
-  cachedViews: []
-}
-
-const mutations = {
-  ADD_VISITED_VIEW: (state, view) => {
-    if (state.visitedViews.some(v => v.path === view.path)) return
-    state.visitedViews.push(
-      Object.assign({}, view, {
-        title: view.meta.title || 'no-name'
-      })
-    )
-  },
-  ADD_CACHED_VIEW: (state, view) => {
-    if (state.cachedViews.includes(view.name)) return
-    if (!view.meta.noCache) {
-      state.cachedViews.push(view.name)
-    }
-  },
-
-  DEL_VISITED_VIEW: (state, view) => {
-    for (const [i, v] of state.visitedViews.entries()) {
-      if (v.path === view.path) {
-        state.visitedViews.splice(i, 1)
-        break
-      }
-    }
-  },
-  DEL_CACHED_VIEW: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
-    index > -1 && state.cachedViews.splice(index, 1)
-  },
-
-  DEL_OTHERS_VISITED_VIEWS: (state, view) => {
-    state.visitedViews = state.visitedViews.filter(v => {
-      return v.meta.affix || v.path === view.path
-    })
-  },
-  DEL_OTHERS_CACHED_VIEWS: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
-    if (index > -1) {
-      state.cachedViews = state.cachedViews.slice(index, index + 1)
-    } else {
-      state.cachedViews = []
-    }
-  },
-
-  DEL_ALL_VISITED_VIEWS: state => {
-    // keep affix tags
-    const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
-    state.visitedViews = affixTags
-  },
-  DEL_ALL_CACHED_VIEWS: state => {
-    state.cachedViews = []
-  },
-
-  UPDATE_VISITED_VIEW: (state, view) => {
-    for (let v of state.visitedViews) {
-      if (v.path === view.path) {
-        v = Object.assign(v, view)
-        break
-      }
-    }
-  },
-  
-  DEL_RIGHT_VIEWS: (state, view) => {
-    const index = state.visitedViews.findIndex(v => v.path === view.path)
-    if (index === -1) {
-      return
-    }
-    state.visitedViews = state.visitedViews.filter((item, idx) => {
-      if (idx <= index || (item.meta && item.meta.affix)) {
-        return true
-      }
-      const i = state.cachedViews.indexOf(item.name)
-      if (i > -1) {
-        state.cachedViews.splice(i, 1)
-      }
-      return false
-    })
-  },
-
-  DEL_LEFT_VIEWS: (state, view) => {
-    const index = state.visitedViews.findIndex(v => v.path === view.path)
-    if (index === -1) {
-      return
-    }
-    state.visitedViews = state.visitedViews.filter((item, idx) => {
-      if (idx >= index || (item.meta && item.meta.affix)) {
-        return true
-      }
-      const i = state.cachedViews.indexOf(item.name)
-      if (i > -1) {
-        state.cachedViews.splice(i, 1)
-      }
-      return false
-    })
-  }
-}
-
-const actions = {
-  addView({ dispatch }, view) {
-    dispatch('addVisitedView', view)
-    dispatch('addCachedView', view)
-  },
-  addVisitedView({ commit }, view) {
-    commit('ADD_VISITED_VIEW', view)
-  },
-  addCachedView({ commit }, view) {
-    commit('ADD_CACHED_VIEW', view)
-  },
-
-  delView({ dispatch, state }, view) {
-    return new Promise(resolve => {
-      dispatch('delVisitedView', view)
-      dispatch('delCachedView', view)
-      resolve({
-        visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews]
-      })
-    })
-  },
-  delVisitedView({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_VISITED_VIEW', view)
-      resolve([...state.visitedViews])
-    })
-  },
-  delCachedView({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_CACHED_VIEW', view)
-      resolve([...state.cachedViews])
-    })
-  },
-
-  delOthersViews({ dispatch, state }, view) {
-    return new Promise(resolve => {
-      dispatch('delOthersVisitedViews', view)
-      dispatch('delOthersCachedViews', view)
-      resolve({
-        visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews]
-      })
-    })
-  },
-  delOthersVisitedViews({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_OTHERS_VISITED_VIEWS', view)
-      resolve([...state.visitedViews])
-    })
-  },
-  delOthersCachedViews({ commit, state }, view) {
-    return new Promise(resolve => {
-      commit('DEL_OTHERS_CACHED_VIEWS', view)
-      resolve([...state.cachedViews])
-    })
-  },
-
-  delAllViews({ dispatch, state }, view) {
-    return new Promise(resolve => {
-      dispatch('delAllVisitedViews', view)
-      dispatch('delAllCachedViews', view)
-      resolve({
-        visitedViews: [...state.visitedViews],
-        cachedViews: [...state.cachedViews]
-      })
-    })
-  },
-  delAllVisitedViews({ commit, state }) {
-    return new Promise(resolve => {
-      commit('DEL_ALL_VISITED_VIEWS')
-      resolve([...state.visitedViews])
-    })
-  },
-  delAllCachedViews({ commit, state }) {
-    return new Promise(resolve => {
-      commit('DEL_ALL_CACHED_VIEWS')
-      resolve([...state.cachedViews])
-    })
-  },
-
-  updateVisitedView({ commit }, view) {
-    commit('UPDATE_VISITED_VIEW', view)
-  },
-
-  delRightTags({ commit }, view) {
-    return new Promise(resolve => {
-      commit('DEL_RIGHT_VIEWS', view)
-      resolve([...state.visitedViews])
-    })
-  },
-
-  delLeftTags({ commit }, view) {
-    return new Promise(resolve => {
-      commit('DEL_LEFT_VIEWS', view)
-      resolve([...state.visitedViews])
-    })
-  },
-}
-
-export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}

+ 0 - 105
ylrz-doctorui/src/store/store/modules/user.js

@@ -1,105 +0,0 @@
-import { login, logout, getInfo } from '@/api/login'
-import { getToken, setToken, removeToken } from '@/utils/auth'
-
-const user = {
-  state: {
-    token: getToken(),
-    name: '',
-    user:undefined,
-    avatar: '',
-    roles: [],
-    permissions: []
-  },
-
-  mutations: {
-    SET_TOKEN: (state, token) => {
-      state.token = token
-    },
-    SET_NAME: (state, name) => {
-      state.name = name
-    },
-    SET_AVATAR: (state, avatar) => {
-      state.avatar = avatar
-    },
-    SET_USER: (state, user) => {
-      state.user = user
-    },
-    SET_ROLES: (state, roles) => {
-      state.roles = roles
-    },
-    SET_PERMISSIONS: (state, permissions) => {
-      state.permissions = permissions
-    }
-  },
-
-  actions: {
-    // 登录
-    Login({ commit }, userInfo) {
-      const username = userInfo.username.trim()
-      const password = userInfo.password
-      const code = userInfo.code
-      const uuid = userInfo.uuid
-      return new Promise((resolve, reject) => {
-        login(username, password, code, uuid).then(res => {
-          setToken(res.token)
-          commit('SET_TOKEN', res.token)
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-
-    // 获取用户信息
-    GetInfo({ commit, state }) {
-      return new Promise((resolve, reject) => {
-        getInfo().then(res => {
-          const user = res.user
-          const avatar = user.avatar == ""
-            ? require("@/assets/images/profile.jpg")
-            : (user.avatar.startsWith('http://') || user.avatar.startsWith('https://')
-              ? user.avatar
-              : process.env.VUE_APP_BASE_API + user.avatar);
-          if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
-            commit('SET_ROLES', res.roles)
-            commit('SET_PERMISSIONS', res.permissions)
-          } else {
-            commit('SET_ROLES', ['ROLE_DEFAULT'])
-          }
-          commit('SET_NAME', user.userName)
-          commit('SET_AVATAR', avatar)
-          commit('SET_USER', user)
-          resolve(res)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-    
-    // 退出系统
-    LogOut({ commit, state }) {
-      return new Promise((resolve, reject) => {
-        logout(state.token).then(() => {
-          commit('SET_TOKEN', '')
-          commit('SET_ROLES', [])
-          commit('SET_PERMISSIONS', [])
-          removeToken()
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
-
-    // 前端 登出
-    FedLogOut({ commit }) {
-      return new Promise(resolve => {
-        commit('SET_TOKEN', '')
-        removeToken()
-        resolve()
-      })
-    }
-  }
-}
-
-export default user

+ 0 - 8
ylrz-doctorui/src/views/prescribe/list.vue → ylrz-doctorui/src/views/electronicPrescribe/prescribe/index.vue

@@ -1,10 +1,5 @@
 <template>
   <div class="app-container">
-    <el-form :inline="true" class="search-form">
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-plus" @click="goCreate">开方</el-button>
-      </el-form-item>
-    </el-form>
 
     <el-table v-loading="loading" :data="list">
       <el-table-column label="处方编号" prop="prescribeCode" min-width="160" />
@@ -72,9 +67,6 @@ export default {
         this.loading = false
       })
     },
-    goCreate() {
-      this.$router.push('/prescribe/create')
-    },
     handleView(row) {
       getPrescribe(row.prescribeId).then(res => {
         this.detail = res.data || { prescribe: {}, drugs: [] }

+ 0 - 0
ylrz-doctorui/src/views/audit/list.vue → ylrz-doctorui/src/views/electronicPrescribe/prescribeAudit/index.vue


+ 11 - 0
ylrz-doctorui/src/views/im/IMConsultation/index.vue

@@ -0,0 +1,11 @@
+<script setup>
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped>
+
+</style>

+ 11 - 0
ylrz-doctorui/src/views/index/consultWorkbench/index.vue

@@ -0,0 +1,11 @@
+<script setup>
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped>
+
+</style>

+ 11 - 0
ylrz-doctorui/src/views/medicat/medicatConsultation/index.vue

@@ -0,0 +1,11 @@
+<script setup>
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped>
+
+</style>

+ 11 - 0
ylrz-doctorui/src/views/patient/patientRecord/index.vue

@@ -0,0 +1,11 @@
+<script setup>
+
+</script>
+
+<template>
+
+</template>
+
+<style scoped>
+
+</style>

+ 0 - 191
ylrz-doctorui/src/views/prescribe/create.vue

@@ -1,191 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-form ref="form" :model="form" :rules="rules" label-width="90px">
-      <el-row>
-        <el-col :span="8">
-          <el-form-item label="患者姓名" prop="patientName">
-            <el-input v-model="form.patientName" placeholder="请输入患者姓名" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="处方类型">
-            <el-select v-model="form.prescribeType" placeholder="请选择">
-              <el-option label="中药" :value="1" />
-              <el-option label="西药" :value="2" />
-            </el-select>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="20">
-          <el-form-item label="诊断/医嘱" prop="diagnose">
-            <el-input v-model="form.diagnose" type="textarea" :rows="2" placeholder="请输入诊断/医嘱" />
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-
-    <div class="drug-toolbar">
-      <el-button type="primary" plain icon="el-icon-plus" @click="openDrugDialog">选择药品</el-button>
-    </div>
-
-    <el-table :data="form.drugs" border>
-      <el-table-column label="药品名称" prop="drugName" min-width="140" />
-      <el-table-column label="规格" prop="drugSpec" width="120" />
-      <el-table-column label="数量" width="100">
-        <template slot-scope="scope">
-          <el-input-number v-model="scope.row.drugNum" :min="1" size="mini" />
-        </template>
-      </el-table-column>
-      <el-table-column label="用法" width="120">
-        <template slot-scope="scope">
-          <el-input v-model="scope.row.usageMethod" size="mini" placeholder="如口服/外用" />
-        </template>
-      </el-table-column>
-      <el-table-column label="每次用量" width="120">
-        <template slot-scope="scope">
-          <el-input v-model="scope.row.usagePerUseCount" size="mini" placeholder="如1" />
-        </template>
-      </el-table-column>
-      <el-table-column label="频次" width="120">
-        <template slot-scope="scope">
-          <el-input v-model="scope.row.usageFrequencyUnit" size="mini" placeholder="如每日3次" />
-        </template>
-      </el-table-column>
-      <el-table-column label="天数" width="100">
-        <template slot-scope="scope">
-          <el-input v-model="scope.row.usageDays" size="mini" placeholder="如7" />
-        </template>
-      </el-table-column>
-      <el-table-column label="医嘱" min-width="140">
-        <template slot-scope="scope">
-          <el-input v-model="scope.row.instructions" size="mini" placeholder="用药医嘱" />
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" width="70" align="center">
-        <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="removeDrug(scope.$index)">移除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <div class="footer-toolbar">
-      <el-button @click="goBack">返回</el-button>
-      <el-button type="primary" :loading="submitting" @click="submitPrescribe">保存处方</el-button>
-    </div>
-
-    <!-- 选择药品对话框 -->
-    <el-dialog title="选择药品" :visible.sync="drugDialogOpen" width="700px" append-to-body>
-      <el-form :inline="true">
-        <el-form-item>
-          <el-input v-model="drugQuery.keyword" placeholder="药品名称" @keyup.enter.native="searchDrug" />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="el-icon-search" @click="searchDrug">搜索</el-button>
-        </el-form-item>
-      </el-form>
-      <el-table :data="drugList" height="360" @row-click="pickDrug">
-        <el-table-column label="药品名称" prop="productName" />
-        <el-table-column label="规格" prop="sku" width="120" />
-        <el-table-column label="价格" prop="price" width="100" />
-      </el-table>
-      <pagination v-show="drugTotal > 0" :total="drugTotal" :page.sync="drugQuery.pageNum" :limit.sync="drugQuery.pageSize" @pagination="searchDrug" />
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { savePrescribe } from '@/api/prescribe'
-import { getStoreProductList } from '@/api/storeProduct'
-
-export default {
-  name: 'PrescribeCreate',
-  data() {
-    return {
-      submitting: false,
-      form: {
-        patientName: '',
-        prescribeType: 2,
-        diagnose: '',
-        drugs: []
-      },
-      rules: {
-        patientName: [{ required: true, message: '患者姓名不能为空', trigger: 'blur' }],
-        diagnose: [{ required: true, message: '诊断不能为空', trigger: 'blur' }]
-      },
-      drugDialogOpen: false,
-      drugQuery: { pageNum: 1, pageSize: 10, keyword: '' },
-      drugList: [],
-      drugTotal: 0
-    }
-  },
-  methods: {
-    openDrugDialog() {
-      this.drugDialogOpen = true
-      this.searchDrug()
-    },
-    searchDrug() {
-      getStoreProductList(this.drugQuery).then(res => {
-        this.drugList = res.data.list || []
-        this.drugTotal = res.data.total || 0
-      })
-    },
-    pickDrug(row) {
-      const exists = this.form.drugs.some(d => d.productId === row.productId)
-      if (exists) {
-        this.$message.warning('该药品已添加')
-        return
-      }
-      this.form.drugs.push({
-        productId: row.productId,
-        productAttrValueId: row.id,
-        drugName: row.productName,
-        drugSpec: row.sku,
-        drugPrice: row.price,
-        drugImgUrl: row.image,
-        drugNum: 1,
-        drugUnit: '盒',
-        usageMethod: '口服',
-        usageFrequencyUnit: '每日1次',
-        usagePerUseCount: '1',
-        usagePerUseUnit: '片',
-        usageDays: '1',
-        instructions: ''
-      })
-      this.drugDialogOpen = false
-    },
-    removeDrug(index) {
-      this.form.drugs.splice(index, 1)
-    },
-    submitPrescribe() {
-      if (this.form.drugs.length === 0) {
-        this.$message.warning('请先选择药品')
-        return
-      }
-      this.$refs.form.validate(valid => {
-        if (!valid) return
-        this.submitting = true
-        savePrescribe(this.form).then(() => {
-          this.$message.success('保存成功')
-          this.goBack()
-        }).catch(() => {
-          this.submitting = false
-        })
-      })
-    },
-    goBack() {
-      this.$router.push('/prescribe/list')
-    }
-  }
-}
-</script>
-
-<style scoped>
-.drug-toolbar {
-  margin: 12px 0;
-}
-.footer-toolbar {
-  margin-top: 16px;
-  text-align: center;
-}
-</style>