|
|
@@ -6,10 +6,7 @@
|
|
|
<view class="section-header-left">
|
|
|
<text class="section-title">管道设备信息</text>
|
|
|
<view v-if="pipeSetList.length > 0" class="pipe-set-picker">
|
|
|
- <wd-picker
|
|
|
- v-model="currentPipeSetIndexModel"
|
|
|
- :columns="pipeSetColumns"
|
|
|
- />
|
|
|
+ <wd-picker v-model="currentPipeSetIndexModel" :columns="pipeSetColumns" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-if="canEdit" class="action-buttons">
|
|
|
@@ -84,7 +81,9 @@
|
|
|
:disabled="!isEdit"
|
|
|
@change="handlePipeCategoryChange"
|
|
|
>
|
|
|
- <text class="cell-text">{{ pipeCategoryOptions[selectedPipeCategoryIndex]?.label }}</text>
|
|
|
+ <text class="cell-text">
|
|
|
+ {{ pipeCategoryOptions[selectedPipeCategoryIndex]?.label }}
|
|
|
+ </text>
|
|
|
</picker>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -127,14 +126,15 @@
|
|
|
<text class="cell-title">所在行政区</text>
|
|
|
</view>
|
|
|
<view class="table-cell content">
|
|
|
- <view v-if="isEdit" class="edit-input" @click="showCascader = true">
|
|
|
- <text>{{ districtFullName || '请选择' }}</text>
|
|
|
- <image class="arrow-icon" src="/static/images/arrow-right.png" />
|
|
|
+ <text v-if="!isEdit" class="cell-text">
|
|
|
+ {{ areaStore.getDistrictFullName(equipment.equipDistrict) }}
|
|
|
+ </text>
|
|
|
+ <view v-else class="edit-input" @click="showCascader = true">
|
|
|
+ <text>{{ areaStore.getDistrictFullName(equipment.equipDistrict) || '请选择' }}</text>
|
|
|
</view>
|
|
|
- <text v-else class="cell-text">{{ getDistrictFullName(equipment.equipDistrict) }}</text>
|
|
|
<AreaCascader
|
|
|
v-show="isEdit"
|
|
|
- v-model="selectedDistrict"
|
|
|
+ v-model="equipment.equipDistrict"
|
|
|
v-model:visible="showCascader"
|
|
|
title="请选择行政区"
|
|
|
@confirm="handleAreaConfirm"
|
|
|
@@ -148,14 +148,17 @@
|
|
|
<text class="cell-title">所在街道</text>
|
|
|
</view>
|
|
|
<view class="table-cell content">
|
|
|
+ <text v-if="!isEdit" class="cell-text">
|
|
|
+ {{ areaStore.getStreetName(equipment.equipStreet, equipment.equipDistrict) }}
|
|
|
+ </text>
|
|
|
<StreetSelect
|
|
|
- v-if="isEdit"
|
|
|
- v-model="equipment.equipStreet"
|
|
|
+ v-show="isEdit"
|
|
|
+ :isEdit="isEdit"
|
|
|
:districtId="equipment.equipDistrict"
|
|
|
- placeholder="请选择街道"
|
|
|
+ v-model:model-value="equipment.equipStreet"
|
|
|
+ placeholder=""
|
|
|
style="width: 100%"
|
|
|
/>
|
|
|
- <text v-else class="cell-text">{{ streetNameDisplay }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -1344,15 +1347,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, reactive, computed, onMounted, watch } from 'vue'
|
|
|
+import { ref, reactive, computed, watch } from 'vue'
|
|
|
import { updateEquipPipe } from '@/api/pipe/pipeEquip'
|
|
|
-import { getDictOptions, DICT_TYPE } from '@/utils/dictMap'
|
|
|
-import AreaCascader from '@/components/AreaCascader/AreaCascader.vue'
|
|
|
+import { DICT_TYPE } from '@/utils/dictMap'
|
|
|
+import { getDictOptions } from '@/utils/dictStoreUtil'
|
|
|
+import AreaCascader from '@/components/AreaCascader/AreaCascaderV2.vue'
|
|
|
import StreetSelect from '@/components/StreetSelect/StreetSelect.vue'
|
|
|
import { useAreaStore } from '@/store/area'
|
|
|
|
|
|
const areaStore = useAreaStore()
|
|
|
-const getDistrictFullName = areaStore.getDistrictFullName
|
|
|
|
|
|
const pipeCategoryOptions = getDictOptions(DICT_TYPE.PIPE_TYPE)
|
|
|
const useStatusOptions = getDictOptions(DICT_TYPE.SYSTEM_EQUIP_BOILER_STATUS)
|
|
|
@@ -1360,14 +1363,6 @@ const useStatusOptions = getDictOptions(DICT_TYPE.SYSTEM_EQUIP_BOILER_STATUS)
|
|
|
const selectedPipeCategoryIndex = ref(0)
|
|
|
const selectedUseStatusIndex = ref(0)
|
|
|
|
|
|
-const districtFullName = computed(() => {
|
|
|
- return getDistrictFullName(Number(selectedDistrict.value))
|
|
|
-})
|
|
|
-
|
|
|
-const streetNameDisplay = computed(() => {
|
|
|
- return areaStore.getStreetName(Number(equipment.equipStreet), Number(equipment.equipDistrict))
|
|
|
-})
|
|
|
-
|
|
|
interface Props {
|
|
|
dataSource?: any
|
|
|
equipmentData?: any
|
|
|
@@ -1461,14 +1456,17 @@ const equipment = reactive<any>({
|
|
|
categories: '',
|
|
|
})
|
|
|
const pipeList = ref<any[]>([])
|
|
|
-const selectedDistrict = ref<string | number | (string | number)[]>('')
|
|
|
const showCascader = ref(false)
|
|
|
|
|
|
const updateEquipmentFromData = (data: any) => {
|
|
|
if (!data) return
|
|
|
Object.assign(equipment, data)
|
|
|
- selectedPipeCategoryIndex.value = pipeCategoryOptions.findIndex((item: any) => item.value == equipment.pipeCategory)
|
|
|
- selectedUseStatusIndex.value = useStatusOptions.findIndex((item: any) => item.value == equipment.useStatus)
|
|
|
+ selectedPipeCategoryIndex.value = pipeCategoryOptions.value.findIndex(
|
|
|
+ (item: any) => item.value == equipment.pipeCategory,
|
|
|
+ )
|
|
|
+ selectedUseStatusIndex.value = useStatusOptions.value.findIndex(
|
|
|
+ (item: any) => item.value == equipment.useStatus,
|
|
|
+ )
|
|
|
pipeList.value = !data?.detailSaveReqVOS
|
|
|
? []
|
|
|
: data.detailSaveReqVOS.map((item: any) => ({
|
|
|
@@ -1539,14 +1537,13 @@ watch(
|
|
|
if (props.currentPipeSet) return
|
|
|
updateEquipmentFromData(newVal)
|
|
|
},
|
|
|
- { immediate: true, deep: true }
|
|
|
+ { immediate: true, deep: true },
|
|
|
)
|
|
|
|
|
|
function handleAreaConfirm(data: {
|
|
|
value: string | number | (string | number)[]
|
|
|
selectedOptions: any[]
|
|
|
}) {
|
|
|
- selectedDistrict.value = data.value
|
|
|
if (data.selectedOptions.length > 0) {
|
|
|
const lastOption = data.selectedOptions[data.selectedOptions.length - 1]
|
|
|
if (equipment.equipDistrict !== lastOption.id) {
|
|
|
@@ -1562,11 +1559,6 @@ const handleCollapseChange = (detail: any) => {
|
|
|
}
|
|
|
|
|
|
const isEdit = ref(false)
|
|
|
-watch(isEdit, (editing) => {
|
|
|
- if (editing) {
|
|
|
- selectedDistrict.value = equipment.equipDistrict || ''
|
|
|
- }
|
|
|
-})
|
|
|
const originalData = ref<any>(null)
|
|
|
const handleEdit = () => {
|
|
|
if (isEdit.value) {
|
|
|
@@ -1580,8 +1572,12 @@ const handleEdit = () => {
|
|
|
const handleCancel = () => {
|
|
|
if (originalData.value) {
|
|
|
Object.assign(equipment, originalData.value)
|
|
|
- selectedPipeCategoryIndex.value = pipeCategoryOptions.findIndex((item: any) => item.value == equipment.pipeCategory)
|
|
|
- selectedUseStatusIndex.value = useStatusOptions.findIndex((item: any) => item.value == equipment.useStatus)
|
|
|
+ selectedPipeCategoryIndex.value = pipeCategoryOptions.value.findIndex(
|
|
|
+ (item: any) => item.value == equipment.pipeCategory,
|
|
|
+ )
|
|
|
+ selectedUseStatusIndex.value = useStatusOptions.value.findIndex(
|
|
|
+ (item: any) => item.value == equipment.useStatus,
|
|
|
+ )
|
|
|
}
|
|
|
isEdit.value = false
|
|
|
}
|