app/src/main/java/cn/flightfeather/thirdapp/module/inspection/MenuCameraActivity.kt
@@ -56,6 +56,8 @@
    private val viewList = mutableListOf<View>()
    private val listMap = mutableMapOf<MediaFileType, RecyclerView>()
    var subTask: Subtask? = null
    var inspection: Inspection? = null
    var scene: Scense? = null
@@ -181,6 +183,10 @@
                }
            }))
            if (!listMap.containsKey(type)) {
                listMap[type] = this
            }
        }
        viewList.add(view)
@@ -230,22 +236,38 @@
    }
    private fun addPhoto(mediaFile: Mediafile) {
        getDataSet(currentType).run {
            first.value?.add(mediaFile)
            second.adapter?.run {
                notifyDataSetChanged()
        if (listMap.containsKey(currentType)) {
            viewModel.fileList.value?.forEach {
                if (it.type == currentType) {
                    it.dataList.add(mediaFile)//第一个数据为拍照按钮
                    listMap[currentType]?.adapter?.notifyDataSetChanged()
            }
        }
        }
//        getDataSet(currentType).run {
//            first.value?.add(mediaFile)
//            second.adapter?.run {
//                notifyDataSetChanged()
//            }
//        }
    }
    private fun deletePhoto(pos: Int) {
        getDataSet(currentType).run {
            first.value?.removeAt(pos + 1)//第一个数据为拍照按钮
            second.adapter?.run {
                notifyDataSetChanged()
        if (listMap.containsKey(currentType)) {
            viewModel.fileList.value?.forEach {
                if (it.type == currentType) {
                    it.dataList.removeAt(pos + 1)//第一个数据为拍照按钮
                    listMap[currentType]?.adapter?.notifyDataSetChanged()
            }
        }
    }
//        getDataSet(currentType).run {
//            first.value?.removeAt(pos + 1)//第一个数据为拍照按钮
//            second.adapter?.run {
//                notifyDataSetChanged()
//            }
//        }
    }
    private fun getDataSet(type: MediaFileType) = when (type) {
        MediaFileType.RoutineRecord -> Pair(viewModel.routineRecordList, rv_photo_list_1)