|
|
@@ -6,6 +6,7 @@ import androidx.fragment.app.viewModels
|
|
|
import com.drake.brv.BindingAdapter
|
|
|
import com.drake.brv.annotaion.DividerOrientation
|
|
|
import com.drake.brv.utils.dividerSpace
|
|
|
+import com.drake.brv.utils.grid
|
|
|
import com.drake.brv.utils.linear
|
|
|
import com.drake.brv.utils.setup
|
|
|
import com.google.android.flexbox.AlignItems
|
|
|
@@ -243,7 +244,11 @@ class SlotsManageFragment : BaseFragment<FragmentSlotsManageBinding>() {
|
|
|
viewModel.exceptionKeyData.find { it.keyNfc == itemKey.rfid } != null ||
|
|
|
viewModel.exceptionSlotsData.find {
|
|
|
it.row?.toInt() == itemKey.row && it.col?.toInt() == (modelPosition + 1)
|
|
|
- }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find { it.dictLabel == I18nManager.t("abnormal") }?.dictValue
|
|
|
+ }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find {
|
|
|
+ it.dictLabel == I18nManager.t(
|
|
|
+ "abnormal"
|
|
|
+ )
|
|
|
+ }?.dictValue
|
|
|
itemKeyBinding.ivKey.isSelected = itemKey.isExist
|
|
|
itemKeyBinding.switchLayout.isVisible =
|
|
|
MainDomainData.roleKeys?.contains(RoleEnum.ADMIN.roleKey) == true ||
|
|
|
@@ -309,12 +314,7 @@ class SlotsManageFragment : BaseFragment<FragmentSlotsManageBinding>() {
|
|
|
lockDock: DockData.LockDock,
|
|
|
) {
|
|
|
val itemBinding = getBinding<ItemDeviceRegistrationLockLayoutBinding>()
|
|
|
- itemBinding.rvLockLayout.layoutManager = FlexboxLayoutManager(context).apply {
|
|
|
- flexDirection = FlexDirection.ROW // 横向
|
|
|
- justifyContent = JustifyContent.SPACE_EVENLY // 等间距居中
|
|
|
- alignItems = AlignItems.CENTER // 垂直居中对齐
|
|
|
- }
|
|
|
- itemBinding.rvLockLayout.setup {
|
|
|
+ itemBinding.rvLockLayout.grid(10).dividerSpace(10, DividerOrientation.GRID).setup {
|
|
|
addType<DockBean.LockBean>(R.layout.item_device_slot_manage_lock)
|
|
|
onBind {
|
|
|
val itemLockBinding = getBinding<ItemDeviceSlotManageLockBinding>()
|
|
|
@@ -323,7 +323,11 @@ class SlotsManageFragment : BaseFragment<FragmentSlotsManageBinding>() {
|
|
|
viewModel.exceptionLockData.find { it.lockNfc == itemLock.rfid } != null ||
|
|
|
viewModel.exceptionSlotsData.find {
|
|
|
it.row?.toInt() == itemLock.row && it.col?.toInt() == (modelPosition + 1)
|
|
|
- }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find { it.dictLabel == I18nManager.t("abnormal") }?.dictValue
|
|
|
+ }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find {
|
|
|
+ it.dictLabel == I18nManager.t(
|
|
|
+ "abnormal"
|
|
|
+ )
|
|
|
+ }?.dictValue
|
|
|
itemLockBinding.root.isSelected = itemLock.isExist
|
|
|
itemLockBinding.switchLayout.isVisible =
|
|
|
MainDomainData.roleKeys?.contains(RoleEnum.ADMIN.roleKey) == true ||
|
|
|
@@ -404,7 +408,11 @@ class SlotsManageFragment : BaseFragment<FragmentSlotsManageBinding>() {
|
|
|
viewModel.exceptionKeyData.find { it.keyNfc == itemPortable.rfid } != null ||
|
|
|
viewModel.exceptionSlotsData.find {
|
|
|
it.row?.toInt() == itemPortable.row && it.col?.toInt() == (modelPosition + 1)
|
|
|
- }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find { it.dictLabel == I18nManager.t("abnormal") }?.dictValue
|
|
|
+ }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find {
|
|
|
+ it.dictLabel == I18nManager.t(
|
|
|
+ "abnormal"
|
|
|
+ )
|
|
|
+ }?.dictValue
|
|
|
itemKeyBinding.ivKey.isSelected = itemPortable.isExist
|
|
|
itemKeyBinding.switchLayout.isVisible =
|
|
|
MainDomainData.roleKeys?.contains(RoleEnum.ADMIN.roleKey) == true ||
|
|
|
@@ -473,7 +481,11 @@ class SlotsManageFragment : BaseFragment<FragmentSlotsManageBinding>() {
|
|
|
viewModel.exceptionLockData.find { it.lockNfc == itemPortable.rfid } != null ||
|
|
|
viewModel.exceptionSlotsData.find {
|
|
|
it.row?.toInt() == itemPortable.row && it.col?.toInt() == (modelPosition + 1)
|
|
|
- }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find { it.dictLabel == I18nManager.t("abnormal") }?.dictValue
|
|
|
+ }?.status == CommonDictDataEnum.SLOT_STATUS.commonDictRes.find {
|
|
|
+ it.dictLabel == I18nManager.t(
|
|
|
+ "abnormal"
|
|
|
+ )
|
|
|
+ }?.dictValue
|
|
|
itemLockBinding.root.isSelected = itemPortable.isExist
|
|
|
itemLockBinding.switchLayout.isVisible =
|
|
|
MainDomainData.roleKeys?.contains(RoleEnum.ADMIN.roleKey) == true ||
|