Răsfoiți Sursa

store增加当前层级部门信息,系统名称拼接单位名

cfort 2 ani în urmă
părinte
comite
2db0b627e4

+ 1 - 1
src/business/platform/bpmn/form/index.vue

@@ -379,7 +379,7 @@
                 this.formModel = formModel
                 // 数据预处理,审批意见数据添加审批人姓名
                 if (data.attributes && data.attributes.opinionList && data.attributes.opinionList.length) {
-                    let users = this.$store.getters.usersList || []
+                    let users = this.$store.getters.userList || []
                     data.attributes.opinionList.forEach(item => {
                         let userInfo = users.find(i => i.userId === item.auditor)
                         item.auditorName = userInfo ? userInfo.userName : null

+ 13 - 1
src/components/jbd-panel/index.vue

@@ -8,7 +8,7 @@
 -->
 <template>
     <div class="jbd-sys-title">
-        <span class="jbd-sys-title-cont-center" style="margin-left: 40px;float: left;">医学实验室标准化智慧管理平台</span>
+        <span class="jbd-sys-title-cont-center" style="margin-left: 40px;float: left;">{{ deptName }}医学实验室标准化智慧管理平台</span>
         <span style="float: right; " class="jbd-sys-title-contact">
             <br>
             深圳市金源信通科技有限公司开发 <i style="margin-left: 10px;" class="el-icon-phone" /> 0755-2642-4403
@@ -16,3 +16,15 @@
         </span>
     </div>
 </template>
+<script>
+export default {
+    data () {
+        const { first = '' } = this.$store.getters.level || {}
+        const { deptList = [] } = this.$store.getters || {}
+        const dept = deptList.find(i => i.positionId === first)
+        return {
+            deptName: dept ? dept.positionName : ''
+        }
+    }
+}
+</script>

+ 2 - 2
src/layout/header-aside/components/header-clean-cache/index.vue

@@ -2,7 +2,7 @@
 <template>
     <el-tooltip effect="dark" :content="cache[type] ? `清除${cache[type].name }缓存`: ''" placement="bottom">
         <el-button type="text" class="ibps-mr btn-text can-hover" @click="cleanCache()">
-            <ibps-icon :name="cache[type] ? cache[type].icon : 'drupail'" style="font-size: 18px;" />
+            <ibps-icon :name="cache[type] ? cache[type].icon : 'drupal'" style="font-size: 18px;" />
         </el-button>
     </el-tooltip>
 </template>
@@ -27,7 +27,7 @@
         office: {
             name: '办公',
             api: cleanOfficeCache,
-            icon: 'drupail'
+            icon: 'drupal'
         }
     }
     export default {

+ 63 - 63
src/layout/header-aside/components/libs/util.menu.js

@@ -7,35 +7,35 @@ import { uniqueId } from 'lodash'
  * @param {Object} menu 菜单项
  * @param {String} indexKey  索引Key
  */
-export function elMenuItem(h, menu, indexKey = 'path',stcss) {
-  let icon = null
-  let css = stcss
-  if (menu.icon) icon = <i class={ `ibps-icon ibps-icon-${menu.icon}` }/>
-  else if (menu.iconSvg) icon = <ibps-icon-svg name={ menu.iconSvg }/>
-  else icon = <i class='ibps-icon ibps-icon-file-o'/>
-  const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
-  return <el-menu-item
-  style="height:37px;line-height:37px;font-weight: bold; font-size:12px;"
-    key={ index }
-    index={ index }>
-   {css} { icon }
-    <span slot='title'>{ menu.name || this.$t('layout.header-aside.menu-item.label-default')}</span>
-  </el-menu-item>
+export function elMenuItem (h, menu, indexKey = 'path', stcss) {
+    let icon = null
+    const css = stcss
+    if (menu.icon) icon = <i class={ `ibps-icon ibps-icon-${menu.icon}` }/>
+    else if (menu.iconSvg) icon = <ibps-icon-svg name={ menu.iconSvg }/>
+    else icon = <i class='ibps-icon ibps-icon-file-o'/>
+    const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
+    return <el-menu-item
+        style='height:37px;line-height:37px;font-weight: bold; font-size:13px;'
+        key={ index }
+        index={ index }>
+        {css} { icon }
+        <span slot='title'>{ menu.name || this.$t('layout.header-aside.menu-item.label-default')}</span>
+    </el-menu-item>
 }
-export function elMenuItem2(menu, indexKey = 'path',stcss) {
-  let icon = null
-  let css = stcss
-  if (menu.icon) icon = <i class={ `ibps-icon ibps-icon-${menu.icon}` }/>
-  else if (menu.iconSvg) icon = <ibps-icon-svg name={ menu.iconSvg }/>
-  else icon = <i class='ibps-icon ibps-icon-file-o'/>
-  const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
-  return <el-menu-item
-  style="height:37px;line-height:37px;font-weight: bold; font-size:12px;"
-    key={ index }
-    index={ index }>
-   {css} { icon }
-    <span slot='title'>{ menu.name || this.$t('layout.header-aside.menu-item.label-default')}</span>
-  </el-menu-item>
+export function elMenuItem2 (menu, indexKey = 'path', stcss) {
+    let icon = null
+    const css = stcss
+    if (menu.icon) icon = <i class={ `ibps-icon ibps-icon-${menu.icon}` }/>
+    else if (menu.iconSvg) icon = <ibps-icon-svg name={ menu.iconSvg }/>
+    else icon = <i class='ibps-icon ibps-icon-file-o'/>
+    const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
+    return <el-menu-item
+        style='height:37px;line-height:37px;font-weight: bold; font-size:13px;'
+        key={ index }
+        index={ index }>
+        {css} { icon }
+        <span slot='title'>{ menu.name || this.$t('layout.header-aside.menu-item.label-default')}</span>
+    </el-menu-item>
 }
 /**
  * @description 创建子菜单
@@ -43,35 +43,35 @@ export function elMenuItem2(menu, indexKey = 'path',stcss) {
  * @param {Object} menu 菜单项
  * @param {String} indexKey  索引Key
  */
-export function elSubmenu(h, menu, indexKey = 'path') {
-  let icon = null
-  if (menu.icon) icon = <i slot='title' class={ `ibps-icon ibps-icon-${menu.icon}` }/>
-  else if (menu.iconSvg) icon = <ibps-icon-svg slot='title' name={ menu.iconSvg }/>
-  else icon = <i slot='title' class='ibps-icon ibps-icon-folder-o'/>
-  const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
-  return <el-submenu
-    key={ index }
-  	style='box-shadow:0 2px 2px rgba(0, 0, 0, .1), 0 0 1px rgba(0, 0, 0, .02);font-weight: bold;'
-    index={ index }>
-    { icon }
-    <span slot='title' style="font-size:12px">{menu.name || this.$t('layout.header-aside.menu-item.label-default') }</span>
-    { menu.children.map(child => createMenu.call(this, h, child, indexKey,"|")) }
-  </el-submenu>
+export function elSubmenu (h, menu, indexKey = 'path') {
+    let icon = null
+    if (menu.icon) icon = <i slot='title' class={ `ibps-icon ibps-icon-${menu.icon}` }/>
+    else if (menu.iconSvg) icon = <ibps-icon-svg slot='title' name={ menu.iconSvg }/>
+    else icon = <i slot='title' class='ibps-icon ibps-icon-folder-o'/>
+    const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
+    return <el-submenu
+        key={ index }
+  	    style='box-shadow:0 2px 2px rgba(0, 0, 0, .1), 0 0 1px rgba(0, 0, 0, .02);font-weight: bold;'
+        index={ index }>
+        { icon }
+        <span slot='title' style='font-size:13px'>{menu.name || this.$t('layout.header-aside.menu-item.label-default') }</span>
+        { menu.children.map(child => createMenu.call(this, h, child, indexKey, '|')) }
+    </el-submenu>
 }
-export function elSubmenu2(menu, indexKey = 'path') {
-  let icon = null
-  if (menu.icon) icon = <i slot='title' class={ `ibps-icon ibps-icon-${menu.icon}` }/>
-  else if (menu.iconSvg) icon = <ibps-icon-svg slot='title' name={ menu.iconSvg }/>
-  else icon = <i slot='title' class='ibps-icon ibps-icon-folder-o'/>
-  const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
-  return <el-submenu
-    key={ index }
-  	style='box-shadow:0 2px 2px rgba(0, 0, 0, .1), 0 0 1px rgba(0, 0, 0, .02);font-weight: bold;'
-    index={ index }>
-    { icon }
-    <span slot='title' style="font-size:12px">{menu.name || this.$t('layout.header-aside.menu-item.label-default') }</span>
-    { menu.children.map(child => createMenu.call(this,child, indexKey,"|")) }
-  </el-submenu>
+export function elSubmenu2 (menu, indexKey = 'path') {
+    let icon = null
+    if (menu.icon) icon = <i slot='title' class={ `ibps-icon ibps-icon-${menu.icon}` }/>
+    else if (menu.iconSvg) icon = <ibps-icon-svg slot='title' name={ menu.iconSvg }/>
+    else icon = <i slot='title' class='ibps-icon ibps-icon-folder-o'/>
+    const index = menu[indexKey] || uniqueId('ibps-menu-empty-')
+    return <el-submenu
+        key={ index }
+        style='box-shadow:0 2px 2px rgba(0, 0, 0, .1), 0 0 1px rgba(0, 0, 0, .02);font-weight: bold;'
+        index={ index }>
+        { icon }
+        <span slot='title' style='font-size:13px'>{menu.name || this.$t('layout.header-aside.menu-item.label-default') }</span>
+        { menu.children.map(child => createMenu.call(this, child, indexKey, '|')) }
+    </el-submenu>
 }
 /**
  * @description 在组件中调用此方法渲染菜单项目
@@ -79,12 +79,12 @@ export function elSubmenu2(menu, indexKey = 'path') {
  * @param {Object} menu 菜单项
  * @param {String} indexKey  索引Key
  */
-export function createMenu(h, menu, indexKey = 'path',stcss) {
-  if (menu.children === undefined || menu.children === null) return elMenuItem.call(this, h, menu, indexKey,stcss)
-  return elSubmenu.call(this, h, menu, indexKey)
+export function createMenu (h, menu, indexKey = 'path', stcss) {
+    if (menu.children === undefined || menu.children === null) return elMenuItem.call(this, h, menu, indexKey, stcss)
+    return elSubmenu.call(this, h, menu, indexKey)
 }
 
-export function createMenu2(menu, indexKey = 'path',stcss) {
-  if (menu.children === undefined || menu.children === null) return elMenuItem.call(this, menu, indexKey,stcss)
-  return elSubmenu.call(this, menu, indexKey)
-}
+export function createMenu2 (menu, indexKey = 'path', stcss) {
+    if (menu.children === undefined || menu.children === null) return elMenuItem.call(this, menu, indexKey, stcss)
+    return elSubmenu.call(this, menu, indexKey)
+}

+ 3 - 1
src/layout/header-aside/layout.vue

@@ -95,7 +95,9 @@
                     <ibps-header-tenant /> -->
 
                     <ibps-header-clean-cache v-if="isSuper && account === 'jinyuan'" type="platform" />
-                    <ibps-header-clean-cache v-if="isSuper && account === 'jinyuan'" type="form"/>
+                    <ibps-header-clean-cache v-if="isSuper && account === 'jinyuan'" type="form" />
+                    <!-- <ibps-header-clean-cache v-if="isSuper && account === 'jinyuan'" type="oauth" />
+                    <ibps-header-clean-cache v-if="isSuper && account === 'jinyuan'" type="office" /> -->
 
                     <span style="font-size: 12px; cursor: pointer;" @click="goToMain()">首页</span>
                     <span style="margin: 0 10px;">|</span>

+ 3 - 1
src/store/getters.js

@@ -33,7 +33,9 @@ export default {
     permissions: state => state.ibps.menu.permissions, //  拥有的权限
     myform: state => state.ibps.myform ? state.ibps.myform : '',
     // 获取所有用户信息
-    usersList: state => state.ibps.param && state.ibps.param.usersList ? state.ibps.param.usersList : [],
+    userList: state => state.ibps.param && state.ibps.param.userList ? state.ibps.param.userList : [],
+    // 获取所有部门信息
+    deptList: state => state.ibps.param && state.ibps.param.deptList ? state.ibps.param.deptList : [],
     // 获取用户最高层级
     level: state => state.ibps.param && state.ibps.param.level ? state.ibps.param.level : []
 }

+ 13 - 5
src/store/modules/ibps/modules/param.js

@@ -4,7 +4,9 @@ export default {
         // 所有菜单
         myform: '',
         // 所有用户信息
-        usersList: [],
+        userList: [],
+        // 所有部门信息
+        deptList: [],
         // 当前用户层级
         level: {
             first: '',
@@ -15,16 +17,22 @@ export default {
         myformSet (state, myform) {
             state.myform = myform.myform || ''
         },
-        usersList (state, data) {
-            state.usersList = data.length ? data : []
+        userList (state, data) {
+            state.userList = data.length ? data : []
+        },
+        deptList (state, data) {
+            state.deptList = data.length ? data : []
         },
         level (state, data) {
             state.level = data || { first: '', second: '' }
         }
     },
     actions: {
-        setUsersList ({ commit }, data) {
-            commit('usersList', data)
+        setUserList ({ commit }, data) {
+            commit('userList', data)
+        },
+        setDeptList ({ commit }, data) {
+            commit('deptList', data)
         },
         setLevel ({ commit }, data) {
             console.log(data)

+ 25 - 5
src/store/modules/ibps/modules/user.js

@@ -57,8 +57,7 @@ export default {
                 await dispatch('getAccount')
                 // 获取切换用户账号
                 await dispatch('getSwitchAccount')
-                // 获取所有用户列表
-                await dispatch('getUserList')
+                
 
                 // 获取注册用户账号
                 dispatch('getRegister').then((r) => {
@@ -76,10 +75,11 @@ export default {
                         await dispatch('ibps/user/set', info, {
                             root: true
                         })
+                        let level = {}
                         if (info.positions && info.positions.length) {
                             // 当存在第二级为空时,说明具备最高级权限
                             const hasFirst = info.positions.some(obj => obj.path.split('.')[1] === '')
-                            const level = {
+                            level = {
                                 first: [...new Set(info.positions.map(obj => obj.path.split('.')[0]))].join(','),
                                 second: hasFirst ? '' : [...new Set(info.positions.map(obj => obj.path.split('.')[1]))].join(',')
                             }
@@ -87,6 +87,10 @@ export default {
                                 root: true
                             })
                         }
+                        // 获取所有用户信息
+                        await dispatch('getUserList', level)
+                        // 获取所有部门信息
+                        await dispatch('getDeptList', level)
                         // 获取当前子系统
                         await dispatch('ibps/system/loadSystem', null, {
                             root: true
@@ -163,11 +167,11 @@ export default {
         /**
          * 获取所有系统用户账号
          */
-        getUserList ({ state, dispatch }) {
+        getUserList ({ state, dispatch }, { first, second }) {
             const sql = `select id_ as userId, name_ as userName, mobile_ as phone from ibps_party_employee`
             common.request('sql', sql).then(res => {
                 const { data = [] } = res.variables || {}
-                dispatch('ibps/param/setUsersList', data, {
+                dispatch('ibps/param/setUserList', data, {
                     root: true
                 })
             }).catch(error => {
@@ -175,6 +179,22 @@ export default {
                 alert('获取所有用户信息失败!')
             })
         },
+        /**
+         * 获取所有系统部门信息
+         */
+        getDeptList ({ state, dispatch }, { first, second }) {
+            const params = second ? ` and path_ like '%${second}%'` : first ? ` and path_ like '%${first}%'` : ''
+            const sql = `select id_ as positionId, name_ as positionName, path_ as path from ibps_party_entity where party_type_ = 'position'${params}`
+            common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                dispatch('ibps/param/setDeptList', data, {
+                    root: true
+                })
+            }).catch(error => {
+                console.log(error)
+                alert('获取所有部门信息失败!')
+            })
+        },
         /**
          * 获取切换用户账号
          * @param {*} param0