소스 검색

优化界面显示

wenningning 2 달 전
부모
커밋
add61d5712

+ 64 - 0
src/components/AgGridCellRender/ButtonDropdownCellRenderList.vue

@@ -0,0 +1,64 @@
+<template>
+  <div>
+      <el-button-group v-if="show" class="container">
+        <el-button v-for="(item, index) in buttonList" :key="index" :type="item.buttonType" :size="item.buttonSize"
+                   :disabled="item.disabled" @click="buttonClick(index)">{{ item.label }}
+        </el-button>
+        <el-dropdown v-if="dropdownList.length > 0">
+          <el-button size="mini" type="">
+            {{ $t('action.more') }}<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item :command="i" v-for="(t, i) in dropdownList" :key="i" v-if="!t.show">
+              <el-button type="text" @click="dropdownClick(i)">{{ t.label }}</el-button>
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-button-group>
+
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'ButtonCellRender',
+  data() {
+    return {
+      buttonType: 'primary',
+      buttonSize: 'mini',
+      label: 'button',
+      disabled: false,
+      show: true,
+      buttonList: [],
+      dropdownList: []
+    }
+  },
+  beforeMount() {
+  },
+  mounted() {
+    const _this = this
+    _this.buttonList = this.params.list
+    _this.dropdownList = this.params.list2
+  },
+  methods: {
+    buttonClick(index) {
+      if (typeof this.buttonList[index].onClick === 'function') {
+        this.buttonList[index].onClick(this.params.node.data)
+      }
+    },
+    dropdownClick(index) {
+      if (typeof this.dropdownList[index].onClick === 'function') {
+        this.dropdownList[index].onClick(this.params.node.data)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+.container {
+  display: flex;
+  justify-content: center; /* 水平居中 */
+  align-items: center;     /* 垂直居中 */
+}
+</style>

+ 3 - 1
src/layout/components/Navbar.vue

@@ -8,7 +8,7 @@
       <template v-if="device!=='mobile'">
         <!--        <search id="header-search" class="right-menu-item" />-->
         <div class="right-menu-item" style="color: #409EFF">{{ partInfo.full_name }} {{ partInfo.part_name }}</div>
-        <div class="right-menu-item" style="color: #ff4949;font-size: 14px">{{ licence }}</div>
+        <div class="right-menu-item" style="color: #ff4949;font-size: 14px">{{ licence }}-{{uiVersion === 1 ? '医院版' : uiVersion === 2 ? '月子中心版' : '养老院版'}}</div>
         <error-log class="errLog-container right-menu-item hover-effect" />
 
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
@@ -62,6 +62,7 @@
 </template>
 
 <script>
+const uiVersion = domain.uiVersion
 import { mapGetters } from 'vuex'
 import Breadcrumb from '@/components/Breadcrumb'
 import Hamburger from '@/components/Hamburger'
@@ -83,6 +84,7 @@ export default {
   },
   data() {
     return {
+      uiVersion: uiVersion,
       avator: avator,
       licence: '',
       value: this.$i18n.locale,

+ 58 - 36
src/views/customer/components/patientManager.vue

@@ -40,8 +40,8 @@
         </ag-grid-layout>
 
         <!-- 用户信息 -->
-        <el-dialog :visible.sync="customerFormVisible" :title="this.$t('customerManage.customerInfo')" class="customer-dialog" width="60%">
-            <el-tabs v-model="activeName" type="border-card" tab-position="bottom" width="50%" @tab-click="handleClick">
+        <el-dialog :visible.sync="customerFormVisible" class="customer-dialog" width="60%">
+            <el-tabs v-model="activeName" type="border-card" tab-position="top" width="50%" @tab-click="handleClick">
                 <el-tab-pane :label="this.$t('customerManage.baseInfo')" name="customerBaseInfo">
                     <div>
                         <el-form ref="editForm" :model="formmodel" :rules="rules" :label-width="this.$i18n.locale === 'zh' ? '120px' : '145px'">
@@ -359,9 +359,9 @@
 
                 </el-tab-pane>
 
-                <el-tab-pane v-if="formmodel.id" :label="this.$t('customerManage.vital')" name="customer-vital-sign">
-                    <vital-sign-log :member-id="formmodel.member_id+''" :active-name="'vital_signs1'"/>
-                </el-tab-pane>
+<!--                <el-tab-pane v-if="formmodel.id" :label="this.$t('customerManage.vital')" name="customer-vital-sign">-->
+<!--                    <vital-sign-log :member-id="formmodel.member_id+''" :active-name="'vital_signs1'"/>-->
+<!--                </el-tab-pane>-->
 
                 <el-tab-pane v-if="formmodel.id" :label="this.$t('customerManage.remark')" name="customerRemark">
                     <div style="height: 450px;display: flex;flex-direction: column;">
@@ -432,10 +432,6 @@
                     </div>
                 </el-tab-pane>
 
-              <el-tab-pane v-if="formmodel.id" :label="this.$t('customerManage.footprint')" name="footprint">
-<!--                <my-map-html :map-url="mapUrl" style="width: 100%; height: 670px;"></my-map-html>-->
-              </el-tab-pane>
-
               <el-tab-pane v-if="formmodel.id" :label="this.$t('customerManage.fee')" name="customer-fee">
                 <customer-fee :customer-id="formmodel.id" :active-name="'customer_fee'"/>
               </el-tab-pane>
@@ -444,9 +440,9 @@
                 <advice :customer-id="formmodel.id" :part-id="formmodel.part_id" :active-name="'customer_advice'"/>
               </el-tab-pane>
 
-                <el-tab-pane  :label="this.$t('sleepData.SleepData')" name="sleepData">
-                  <sleep-detect-data :member-id="formmodel.member_id"></sleep-detect-data>
-                </el-tab-pane>
+<!--                <el-tab-pane  :label="this.$t('sleepData.SleepData')" name="sleepData">-->
+<!--                  <sleep-detect-data :member-id="formmodel.member_id"></sleep-detect-data>-->
+<!--                </el-tab-pane>-->
 
             </el-tabs>
         </el-dialog>
@@ -517,6 +513,15 @@
             </el-form>
         </el-dialog>
         <!-- 用户换床-->
+
+<!--      体征-->
+      <el-drawer
+          :title="this.$t('customerManage.vital')"
+          :visible.sync="vitalDrawer"
+          size="40%">
+        <vital-sign-log :member-id="formmodel.member_id+''" :active-name="'vital_signs1'"/>
+      </el-drawer>
+      <!--      体征-->
     </div>
 
 </template>
@@ -526,6 +531,7 @@
     import {AG_GRID_LOCALE_CN} from '@/utils/AgGridVueLocaleCn'
     import ButtonCellRender from '@/components/AgGridCellRender/ButtonCellRender'
     import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
+    import ButtonDropdownCellRenderList from '@/components/AgGridCellRender/ButtonDropdownCellRenderList'
     import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
     import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
     import * as API_Customer from '@/api/ncs_customer'
@@ -556,7 +562,7 @@
     const serverUrl = domain.serverUrl
     export default {
         name: 'PatientManager',
-        components: {SleepDetectData, ButtonCellRenderList, ButtonCellRender, ListFilter, RadioFilter, vitalSignLog, vueQr, myMapHtml, customerFee, advice },
+        components: {SleepDetectData, ButtonCellRenderList, ButtonDropdownCellRenderList, ButtonCellRender, ListFilter, RadioFilter, vitalSignLog, vueQr, myMapHtml, customerFee, advice },
         filters: {
             unixDateFilter(val) {
                 return unixToDate(val)
@@ -715,6 +721,7 @@
                 mapUrl: null,
               relativeNameTypeEnum: RELATIVE_NAME_TYPE.getValueList(),
               isChild: false,
+              vitalDrawer: false
             }
         },
         computed: {
@@ -830,7 +837,7 @@
                     }
                 },
               { headerName: this.$t('action.handle'), field: 'id',
-                cellRendererFramework: 'ButtonCellRenderList',
+                cellRendererFramework: 'ButtonDropdownCellRenderList',
                 cellRendererParams: param => {
                   return {
                     list: [
@@ -841,33 +848,38 @@
                         buttonSize: 'mini'
                       },
                       {
-                        onClick: this.handleOut,
-                        label: this.$t('customerManage.outBed'),
-                        buttonType: 'warning',
+                        onClick: this.deleteSingle,
+                        label: this.$t('action.delete'),
+                        buttonType: 'danger',
                         buttonSize: 'mini',
-                        disabled: param.data['status'] !== 0
+                        disabled: param.data['member_name'] === 'superadmin'
                       },
+                    ],
+                    list2: [
                       {
                         onClick: this.handleChangeBed,
                         label: this.$t('customerManage.changeBed'),
-                        buttonType: 'success',
-                        buttonSize: 'mini',
-                        disabled: param.data['status'] !== 0
+                        show: param.data['status'] !== 0
                       },
                       {
-                        onClick: this.deleteSingle,
-                        label: this.$t('action.delete'),
-                        buttonType: 'danger',
-                        buttonSize: 'mini',
-                        disabled: param.data['member_name'] === 'superadmin'
+                        onClick: this.handleOut,
+                        label: this.$t('customerManage.outBed'),
+                        show: param.data['status'] !== 0
+                      },
+                      {
+                        onClick: this.advice,
+                        label: this.$t('customerManage.advice')
+                      },
+                      {
+                        onClick: this.lookLocation,
+                        label: this.$t('customerManage.footprint')
+                      },
+                      {
+                        onClick: this.lookVitalSigns,
+                        label: this.$t('customerManage.vital')
                       },
-                      // {
-                      //   onClick: this.advice,
-                      //   label: this.$t('customerManage.advice'),
-                      //   buttonType: 'primary',
-                      //   buttonSize: 'mini',
-                      // },
-                    ]}
+                    ]
+                  }
                 },
                 filter: false,
                 pinned: 'right',
@@ -890,11 +902,11 @@
             this.rowSelection = 'multiple'
         },
         mounted() {
-            
+
             window.onresize = this.windowResize()
             this.gridApi = this.gridOptions.api
             this.gridColumnApi = this.gridOptions.columnApi
-            
+
             this.gridColumnApi.applyColumnState({
                 state: [
                     {
@@ -903,7 +915,7 @@
                     }
                 ]
             })
-           
+
           this.getShop(this.$store.getters.partId)
 
             this.getCloud()
@@ -1672,7 +1684,17 @@
           },
           advice(row) {
             this.$router.push({ name: 'advice', params: { id: row.id, callback: this.getList() }})
+
           },
+          lookLocation(row) {
+            this.$router.push({path:'/device/map', query: {mapUrl: this.mapUrl, uuid: row.uuid, frameId: row.frame_id}})
+          },
+          lookVitalSigns(row) {
+              this.formmodel = {
+                ...row
+              }
+              this.vitalDrawer = true
+          }
         }
     }
 </script>

+ 12 - 18
src/views/vital-sign/log.vue

@@ -1,18 +1,8 @@
 <template>
   <div class="formwrap">
-    <el-tabs
-      v-model="InnerActiveName"
-      type="border-card"
-    >
-      <el-tab-pane
-        v-for="group in vitalSignsLogs" :key="group.id"
-        :label="group.vital_signs_name"
-        :name="'vital_signs'+group.id"
-      >
-        <div
-          :id="`chart${group.id}`"
-          style="height: 600px; width:650px;"
-        />
+    <el-tabs v-model="InnerActiveName" type="border-card">
+      <el-tab-pane v-for="group in vitalSignsLogs" :key="group.id" :label="group.vital_signs_name" :name="'vital_signs'+group.id">
+        <div :id="`chart${group.id}`" style="height: 600px; width:650px;"/>
       </el-tab-pane>
     </el-tabs>
 
@@ -173,12 +163,12 @@ export default {
       groupId: null
     }
   },
-  mounted() {
-    this.InnerActiveName = this.activeName
-    this.GET_VitalSingsGroupParamLogs()
-    this.GET_VitalSignsParams()
-  },
   watch: {
+    memberId() {
+      this.InnerActiveName = this.activeName
+      this.GET_VitalSingsGroupParamLogs()
+      this.GET_VitalSignsParams()
+    },
     vitalSignsLogs(val) {
       if (this.activeName === '' && val.length > 0) {
         this.InnerActiveName = 'vital_signs' + val[0].id
@@ -193,6 +183,10 @@ export default {
     GET_VitalSingsGroupParamLogs() {
       API_Params.getVitalSignsGroupParamLog(this.memberId).then((response) => {
         this.vitalSignsLogs = response
+        if (response.length > 0) {
+          this.groupId = response[0].id
+          this.GET_LogListPage()
+        }
         const option = {// 图表选项option对象
           color: this.colors, // 颜色集合
           title: {