|
@@ -78,13 +78,15 @@ class OtherHostFragment : BaseFragment<OtherHostPresenter, FragmentOtherHostBind
|
|
group_host.setOnCheckedChangeListener { group, checkedId ->
|
|
group_host.setOnCheckedChangeListener { group, checkedId ->
|
|
if (checkedId == R.id.rb_other_host) {
|
|
if (checkedId == R.id.rb_other_host) {
|
|
//加载所有护士主机
|
|
//加载所有护士主机
|
|
|
|
+ otherHostAdapter!!.data.clear()
|
|
if (Constants.part_id != -1) {
|
|
if (Constants.part_id != -1) {
|
|
presenter.loadAllHostDevice(Constants.part_id)
|
|
presenter.loadAllHostDevice(Constants.part_id)
|
|
}
|
|
}
|
|
} else if (checkedId == R.id.rb_manager_host) {
|
|
} else if (checkedId == R.id.rb_manager_host) {
|
|
//加载总控主机
|
|
//加载总控主机
|
|
|
|
+ otherHostAdapter!!.data.clear()
|
|
if (Constants.hospital_id != -1) {
|
|
if (Constants.hospital_id != -1) {
|
|
- presenter.loadHostDevice(DeviceTypeEnum.NURSE_HOST.value(), Constants.hospital_id)
|
|
|
|
|
|
+ presenter.loadManageDevice(DeviceTypeEnum.NURSE_HOST.value(), Constants.hospital_id)
|
|
} else {
|
|
} else {
|
|
showMessage("hospital_id is null")
|
|
showMessage("hospital_id is null")
|
|
}
|
|
}
|
|
@@ -107,30 +109,28 @@ class OtherHostFragment : BaseFragment<OtherHostPresenter, FragmentOtherHostBind
|
|
/**
|
|
/**
|
|
*显示数据
|
|
*显示数据
|
|
*/
|
|
*/
|
|
- override fun showDevice(devices: ArrayList<DeviceDO>) {
|
|
|
|
- otherHostAdapter!!.data.clear()
|
|
|
|
|
|
+ override fun showManageDevice(devices: ArrayList<DeviceDO>) {
|
|
otherHostAdapter!!.data.addAll(devices)
|
|
otherHostAdapter!!.data.addAll(devices)
|
|
- //Log.i(TAG,"其它主机数量 " + devices.size)
|
|
|
|
otherHostAdapter!!.notifyDataSetChanged()
|
|
otherHostAdapter!!.notifyDataSetChanged()
|
|
}
|
|
}
|
|
|
|
|
|
override fun showAllHostDevice(devices: ArrayList<DeviceDO>) {
|
|
override fun showAllHostDevice(devices: ArrayList<DeviceDO>) {
|
|
- //先后所有护士主机,排除自己
|
|
|
|
|
|
+ //显示所有护士主机,排除自己
|
|
if (devices.size > 0) {
|
|
if (devices.size > 0) {
|
|
- otherHostAdapter!!.data.clear()
|
|
|
|
for (hostDevice in devices) {
|
|
for (hostDevice in devices) {
|
|
if (hostDevice.id != Constants.ids) {
|
|
if (hostDevice.id != Constants.ids) {
|
|
otherHostAdapter!!.data.add(hostDevice)
|
|
otherHostAdapter!!.data.add(hostDevice)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //Log.i(TAG, "其它主机数量 " + devices.size)
|
|
|
|
- otherHostAdapter!!.notifyDataSetChanged()
|
|
|
|
}
|
|
}
|
|
|
|
+ //Log.i(TAG, "其它主机数量 " + devices.size)
|
|
|
|
+ otherHostAdapter!!.notifyDataSetChanged()
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
*处理错误信息
|
|
*处理错误信息
|
|
*/
|
|
*/
|
|
override fun onError(message: String, type: Int) {
|
|
override fun onError(message: String, type: Int) {
|
|
|
|
+ otherHostAdapter!!.notifyDataSetChanged()
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
*耗时加载完成
|
|
*耗时加载完成
|