Parcourir la source

1.调整护理项显示 2.修改呼叫记录和床位列表加载顺序 3.修改toast显示

weizhengliang il y a 1 an
Parent
commit
a068f48500

+ 5 - 3
android_host/src/main/h10_z3128_1h/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHomeActivity.kt

@@ -184,9 +184,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
             view_title_layout_tv_point.text = "rtc"
         }
 
-        currentFragment = FramePartFragment()
-        supportFragmentManager.beginTransaction().replace(R.id.middle_fralyout, currentFragment, "").commitAllowingStateLoss()
-
+        //呼叫记录
         currentFragmentThree = CallRecordsFragment()
         supportFragmentManager.beginTransaction().replace(R.id.left_framlyout, currentFragmentThree, "").commitAllowingStateLoss()
 
@@ -575,6 +573,10 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
             }
         }
 
+        //床位列表
+        currentFragment = FramePartFragment()
+        supportFragmentManager.beginTransaction().replace(R.id.middle_fralyout, currentFragment, "").commitAllowingStateLoss()
+
         //通过服务端设置语言
         if (SettingConfig.getLanguageMode(activity) == 0) {
             var needReboot = false

+ 33 - 12
android_host/src/main/h10_z3128_1h/java/com/wdkl/ncs/android/component/nursehome/adapter/FrameBedVosConfinementAdapter.kt

@@ -12,6 +12,7 @@ import com.wdkl.ncs.android.component.nursehome.databinding.AdapterHospitalFrame
 import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
 import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
 import com.wdkl.ncs.android.lib.utils.then
+import com.wdkl.ncs.android.middleware.model.dto.NurseConfigDto
 import com.wdkl.ncs.android.middleware.model.vo.FrameBedVO
 import com.wdkl.ncs.android.middleware.utils.StringUtil
 
@@ -104,36 +105,56 @@ class FrameBedVosConfinementAdapter(val data: ArrayList<FrameBedVO>) : BaseDeleg
                     binding.sexImagev.visibility = View.GONE
                 }
 
-                var critical = false
+                var basic = false
+                var basicNurseConfig: NurseConfigDto? = null
                 binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector)
+                binding.tvNurseConfigName.setTextColor(Color.parseColor("#5C5C5C"))
                 if (itemData.nurseConfigDtos != null && itemData.nurseConfigDtos.size > 0) {
                     for (nurseConfig in itemData.nurseConfigDtos) {
-                        if (nurseConfig.boolCritical != null && nurseConfig.boolCritical) {
+                        //如果有危重标识,并且有危重级别数据则高亮背景
+                        if (nurseConfig.boolCritical != null && nurseConfig.boolCritical
+                            && !TextUtils.isEmpty(nurseConfig.nurseOptionName)) {
                             binding.roomNumberTv.setTextColor(Color.WHITE)
-                            //病危标识
-                            binding.tvNurseConfigName.text = nurseConfig.nurseConfigName
+                            binding.tvNurseConfigName.setTextColor(Color.WHITE)
+                            binding.tvCritical.text = nurseConfig.nurseOptionName
                             if (StringUtil.notEmpty(nurseConfig.nurseColorRbg)) {
                                 binding.rlBedInfo.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
-                                binding.tvNurseConfigColor.visibility = View.VISIBLE
-                                binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
-                                binding.tvNurseConfigColor.text = nurseConfig.nurseOptionName
                             } else {
                                 binding.rlBedInfo.setBackgroundResource(R.color.color_critical)
-                                binding.tvNurseConfigColor.text = ""
-                                binding.tvNurseConfigColor.visibility = View.INVISIBLE
                             }
-                            critical = true
                             break
                         }
                     }
 
-                    if (!critical) {
+                    for (nurseConfig in itemData.nurseConfigDtos) {
+                        if (nurseConfig.boolBasic != null && nurseConfig.boolBasic) {
+                            //基本护理项
+                            basic = true
+                            basicNurseConfig = nurseConfig
+                            break
+                        }
+                    }
+
+                    //如果设置了基本护理项,则显示基本护理项,否则默认显示第一个护理项
+                    if (basic && basicNurseConfig != null) {
+                        //显示基本护理项
+                        binding.tvNurseConfigName.text = basicNurseConfig.nurseConfigName
+                        if (StringUtil.notEmpty(basicNurseConfig.nurseColorRbg)) {
+                            binding.tvNurseConfigColor.text = basicNurseConfig.nurseOptionName
+                            binding.tvNurseConfigColor.visibility = View.VISIBLE
+                            binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + basicNurseConfig.nurseColorRbg))
+                        } else {
+                            binding.tvNurseConfigColor.text = ""
+                            binding.tvNurseConfigColor.visibility = View.INVISIBLE
+                        }
+                    } else {
+                        //显示默认第一个护理项
                         val nurseItem = itemData.nurseConfigDtos.get(0)
                         binding.tvNurseConfigName.text = nurseItem.nurseConfigName
                         if (StringUtil.notEmpty(nurseItem.nurseColorRbg)) {
+                            binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
                             binding.tvNurseConfigColor.visibility = View.VISIBLE
                             binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseItem.nurseColorRbg))
-                            binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
                         } else {
                             binding.tvNurseConfigColor.text = ""
                             binding.tvNurseConfigColor.visibility = View.INVISIBLE

+ 28 - 7
android_host/src/main/h10_z3128_1h/res/layout/adapter_hospital_frame_part.xml

@@ -42,18 +42,39 @@
             android:layout_height="match_parent"
             android:layout_above="@id/rl_nurse_item"
             android:padding="4dp">
-            <TextView
-                android:id="@+id/room_number_tv"
+
+            <LinearLayout
+                android:id="@+id/ll_room_view"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:text="--"
-                android:textSize="18sp"
-                android:textColor="#2F9DF1"/>
+                android:layout_height="wrap_content">
+                <TextView
+                    android:id="@+id/room_number_tv"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="2"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:text="--"
+                    android:textSize="18sp"
+                    android:textColor="#2F9DF1"/>
+
+                <TextView
+                    android:id="@+id/tv_critical"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:singleLine="true"
+                    android:ellipsize="end"
+                    android:textColor="@color/color_white"
+                    android:textSize="16sp" />
+
+            </LinearLayout>
 
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_below="@id/room_number_tv">
+                android:layout_below="@id/ll_room_view">
 
                 <ImageView
                     android:id="@+id/patient_imagev"

+ 8 - 2
common/src/main/code/com/wdkl/ncs/android/lib/utils/ExtendMethods.kt

@@ -90,7 +90,13 @@ fun showMessage(message: String) {
         return
     }
 
-    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+    try {
+        Toaster.showShort(message)
+    } catch (ex: Exception) {
+        //
+    }
+
+    /*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
         Toaster.showShort(message)
     } else {
         val messageCallback = {
@@ -109,7 +115,7 @@ fun showMessage(message: String) {
             Looper.prepare()
             messageCallback.invoke()
         }
-    }
+    }*/
 }
 
 fun showMessage(resId: Int) {