<template>
  <view>
    <uv-form-item
      :labelWidth="100"
      :label="item?.taskFiledValue"
      :borderBottom="false"
      labelPosition="left"
      :required="item?.isMustfill == '1'"
      @click="mapFn"
    >
      <uv-input
        input-align="right"
        v-model="propsMessage"
        disabled
        disabledColor="#ffffff"
        :placeholder="`请选择${item?.taskFiledValue}`"
        border="none"
      />
      <template v-slot:right>
        <uv-icon name="arrow-right"></uv-icon>
      </template>
    </uv-form-item>
  </view>
</template>

<script setup lang="ts">
import { computed } from 'vue'

const emmits = defineEmits(['update:mapValue'])

let props = defineProps({
  item: Object,
  index: Number,
  mapValue: String
})

const mapFn = () => {
  console.log('props', props.item)
  const id = props.item?.taskTypeId

  let arr = ['2', '3', '4', '5', '12', '19']
  if (arr.includes(id)) {
    uni.navigateTo({
      url: `/pages-sub-task/location-select/index2?taskFiledKey=${props?.item?.taskFiledKey}`
    })
  } else {
    uni.navigateTo({
      url: `/pages-sub-task/location-select/index?taskFiledKey=${props?.item?.taskFiledKey}`
    })
  }
}

const propsMessage = computed({
  get: () => {
    return props.mapValue
  },
  set: (val) => {
    emmits('update:mapValue', val)
  }
})
</script>

<style lang="scss" scoped></style>
