diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt index 39351c6..7984479 100644 --- a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt +++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show class TargetCheckManifestFragment( - private val scene: String, private val target: String + private val sceneDicValue: String, private val target: String ) : KotlinBaseFragment() { private val kTag = "CheckManifestFragment" @@ -29,22 +29,6 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - //target转为字典值 - configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java] - configViewModel.getDictionaryByCode(requireContext(), "inspectionObject") - configViewModel.dictionary.observe(this) { - if (it.code == 200) { - for (dic in it.data) { - if (dic.name == target) { - checkManifestViewModel.getCheckManifestByTarget( - requireContext(), scene, dic.value - ) - return@observe - } - } - } - } - checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java] checkManifestViewModel.targetManifestResult.observe(this) { if (it.code == 200) { @@ -93,6 +77,22 @@ } } } + + //target转为字典值 + configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java] + configViewModel.getDictionaryByCode(requireContext(), "inspectionObject") + configViewModel.dictionary.observe(this) { + if (it.code == 200) { + for (dic in it.data) { + if (dic.name == target) { + checkManifestViewModel.getCheckManifestByTarget( + requireContext(), sceneDicValue, dic.value + ) + break + } + } + } + } } override fun initViewBinding( diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt index 39351c6..7984479 100644 --- a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt +++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show class TargetCheckManifestFragment( - private val scene: String, private val target: String + private val sceneDicValue: String, private val target: String ) : KotlinBaseFragment() { private val kTag = "CheckManifestFragment" @@ -29,22 +29,6 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - //target转为字典值 - configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java] - configViewModel.getDictionaryByCode(requireContext(), "inspectionObject") - configViewModel.dictionary.observe(this) { - if (it.code == 200) { - for (dic in it.data) { - if (dic.name == target) { - checkManifestViewModel.getCheckManifestByTarget( - requireContext(), scene, dic.value - ) - return@observe - } - } - } - } - checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java] checkManifestViewModel.targetManifestResult.observe(this) { if (it.code == 200) { @@ -93,6 +77,22 @@ } } } + + //target转为字典值 + configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java] + configViewModel.getDictionaryByCode(requireContext(), "inspectionObject") + configViewModel.dictionary.observe(this) { + if (it.code == 200) { + for (dic in it.data) { + if (dic.name == target) { + checkManifestViewModel.getCheckManifestByTarget( + requireContext(), sceneDicValue, dic.value + ) + break + } + } + } + } } override fun initViewBinding( diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt index 0fe0e0f..c3ae770 100644 --- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt +++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt @@ -130,7 +130,22 @@ //非居 val NON_RESIDENTIAL_SCENE_ARRAY = arrayListOf( - "三通", "人", "切断阀", "喉箍", "熄火保护", "风管", "软管", "报警装置", "接头" + "三通", + "人", + "切断阀", + "喉箍", + "熄火保护", + "风管", + "软管", + "专用软管", + "非专用软管", + "报警装置", + "接头", + "调压器", + "阀门", + "压力表", + "流量计", + "过滤器" ) /** diff --git a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt index 39351c6..7984479 100644 --- a/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt +++ b/app/src/main/java/com/casic/br/app/fragment/TargetCheckManifestFragment.kt @@ -17,7 +17,7 @@ import com.pengxh.kt.lite.extensions.show class TargetCheckManifestFragment( - private val scene: String, private val target: String + private val sceneDicValue: String, private val target: String ) : KotlinBaseFragment() { private val kTag = "CheckManifestFragment" @@ -29,22 +29,6 @@ } override fun initOnCreate(savedInstanceState: Bundle?) { - //target转为字典值 - configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java] - configViewModel.getDictionaryByCode(requireContext(), "inspectionObject") - configViewModel.dictionary.observe(this) { - if (it.code == 200) { - for (dic in it.data) { - if (dic.name == target) { - checkManifestViewModel.getCheckManifestByTarget( - requireContext(), scene, dic.value - ) - return@observe - } - } - } - } - checkManifestViewModel = ViewModelProvider(this)[CheckManifestViewModel::class.java] checkManifestViewModel.targetManifestResult.observe(this) { if (it.code == 200) { @@ -93,6 +77,22 @@ } } } + + //target转为字典值 + configViewModel = ViewModelProvider(this)[ConfigViewModel::class.java] + configViewModel.getDictionaryByCode(requireContext(), "inspectionObject") + configViewModel.dictionary.observe(this) { + if (it.code == 200) { + for (dic in it.data) { + if (dic.name == target) { + checkManifestViewModel.getCheckManifestByTarget( + requireContext(), sceneDicValue, dic.value + ) + break + } + } + } + } } override fun initViewBinding( diff --git a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt index 0fe0e0f..c3ae770 100644 --- a/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt +++ b/app/src/main/java/com/casic/br/app/utils/LocaleConstant.kt @@ -130,7 +130,22 @@ //非居 val NON_RESIDENTIAL_SCENE_ARRAY = arrayListOf( - "三通", "人", "切断阀", "喉箍", "熄火保护", "风管", "软管", "报警装置", "接头" + "三通", + "人", + "切断阀", + "喉箍", + "熄火保护", + "风管", + "软管", + "专用软管", + "非专用软管", + "报警装置", + "接头", + "调压器", + "阀门", + "压力表", + "流量计", + "过滤器" ) /** diff --git a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt index 68ed48a..67ff17e 100644 --- a/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt +++ b/app/src/main/java/com/casic/br/app/view/CheckManifestByTargetActivity.kt @@ -45,7 +45,6 @@ val topViewPagerAdapter = TopViewPagerAdapter( supportFragmentManager, subPageTitles.toTypedArray(), fragmentPages ) - binding.viewPager.offscreenPageLimit = fragmentPages.size binding.viewPager.adapter = topViewPagerAdapter binding.tabLayout.setupWithViewPager(binding.viewPager) return@observe