From e234a15b428267997c903a4ed42536c5d9f14a1f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 10 十一月 2025 13:10:42 +0800
Subject: [PATCH] 2025.11.10 1. 新增巡查场景历史详情相关数据逻辑; 2. 新增工地施工阶段修改界面;
---
app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuSceneHistoryActivity.kt | 76 ++++++++++++++++++++++++++++++++-----
1 files changed, 65 insertions(+), 11 deletions(-)
diff --git a/app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuSceneHistoryActivity.kt b/app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuSceneHistoryActivity.kt
index f95c5b4..931d99e 100644
--- a/app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuSceneHistoryActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdappmodule/module/inspection/MenuSceneHistoryActivity.kt
@@ -1,15 +1,15 @@
package cn.flightfeather.thirdappmodule.module.inspection
+import android.arch.lifecycle.Observer
import android.arch.lifecycle.ViewModelProviders
-import android.databinding.DataBindingUtil
import android.os.Bundle
import android.view.View
import android.widget.TextView
import cn.flightfeather.thirdappmodule.R
import cn.flightfeather.thirdappmodule.bean.entity.Scense
-import cn.flightfeather.thirdappmodule.databinding.DialogSceneHistory2Binding
import cn.flightfeather.thirdappmodule.databinding.SceneHistoryViewModel
import cn.flightfeather.thirdappmodule.module.base.BaseActivity
+import kotlinx.android.synthetic.main.dialog_scene_history.*
/**
* 鍦烘櫙鍘嗗彶鎯呭喌鎻愮ず鐣岄潰
@@ -21,8 +21,7 @@
// 浼犲叆鐨勫満鏅璞�
private var scene: Scense? = null
-// override fun getLayoutId(): Int = R.layout.dialog_scene_history_2
- override fun getLayoutId(): Int? = null
+ override fun getLayoutId(): Int = R.layout.dialog_scene_history
lateinit var viewModel: SceneHistoryViewModel
@@ -33,14 +32,69 @@
scene = intent.getSerializableExtra("scene") as Scense?
- // 2025.10.31 鍦烘櫙椋庨櫓鎻愮ず
- val dialogSceneHistory2Binding = DataBindingUtil.setContentView<DialogSceneHistory2Binding>(this, R.layout.dialog_scene_history_2)
- dialogSceneHistory2Binding.viewModel = viewModel
- dialogSceneHistory2Binding.fabClose.setOnClickListener { this.finish() }
+ initUI()
+ initObserver()
+ initListener()
+ scene?.let {
+ viewModel.fetchChangeInfoList(it.guid)
+ viewModel.fetchProblemRecurrence(it.guid)
+ viewModel.fetchInspectionKeyPoint(it.guid)
+ }
+ }
-// viewModel.getSceneStatus {
-// scene?.let { viewModel.getSceneDetail(it) }
-// }
+ private fun initUI() {
+ // 榛樿鍏堝皢涓夊潡鍐呭闅愯棌
+ cl_risk_warn.visibility = View.GONE
+ cl_inspection_key_point.visibility = View.GONE
+ cl_temp_inspection.visibility = View.GONE
+ tv_change_rate.visibility = View.GONE
+ tv_change_efficiency.visibility = View.GONE
+ tv_problem_recurrence.visibility = View.GONE
+ }
+
+ private fun initObserver() {
+ // 椋庨櫓鎻愮ず
+ viewModel.changeInfoTxt.observe(this, Observer {
+ it?.let {
+ tv_change_rate.text = it
+ tv_change_rate.visibility = View.VISIBLE
+ cl_risk_warn.visibility = View.VISIBLE
+ }
+ })
+ viewModel.changeEfficiencyTxt.observe(this, Observer {
+ it?.let {
+ tv_change_efficiency.text = it
+ tv_change_efficiency.visibility = View.VISIBLE
+ cl_risk_warn.visibility = View.VISIBLE
+ }
+ })
+ viewModel.problemRecurrenceTxt.observe(this, Observer {
+ it?.let {
+ tv_problem_recurrence.text = it
+ tv_problem_recurrence.visibility = View.VISIBLE
+ cl_risk_warn.visibility = View.VISIBLE
+ }
+ })
+ // 宸℃煡瑕佺偣
+ viewModel.inspectionKeyPointTxt.observe(this, Observer {
+ it?.let {
+ tv_key_point.text = it
+ cl_inspection_key_point.visibility = View.VISIBLE
+ }
+ })
+ // 搴旀�ュ贰鏌�
+ viewModel.tempInspectionTxt.observe(this, Observer {
+ it?.let {
+ tv_temp_inspection.text = it
+ cl_temp_inspection.visibility = View.VISIBLE
+ }
+ })
+ }
+
+ private fun initListener() {
+ fab_close.setOnClickListener {
+ this.finish()
+ }
}
}
--
Gitblit v1.9.3