<template>
  <view class="emergency_add_page">
    <view class="card_form" v-if="useModel?.formData?.value?.type === '申请关闭'">
      <hs-cell-textarea
        required
        title="处理结果"
        placeholder="请输入处理结果"
        v-model:valueModel="useModel.formData.value.handled_result"
      />
      <hs-cell-textarea
        borderTop
        title="反思与总结"
        placeholder="请输入反思与总结"
        v-model:valueModel="useModel.formData.value.introspection"
      />
    </view>
    <view class="card_form" v-if="useModel?.formData?.value?.type === '更新进度'">
      <hs-cell-textarea
        required
        title="跟进内容"
        placeholder="请输入跟进内容"
        v-model:valueModel="useModel.formData.value.content"
      />
      <hs-upload
        title="上传图片"
        :count="10"
        borderTop
        v-model:valueModel="useModel.formData.value.attachments"
      />
    </view>
    <hs-footer btnParimaryName="提交" @handleParmaryClick="method?.handleSubmit" />
  </view>
</template>
<script setup lang="ts">
import useModel from './model'
import method from './method'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { EmergencyEventsCompensationTypeEnum } from '@/gen/Enums'

onLoad(e => {
  useModel.formData.value = { type: e?.type, id: e?.id, emergency_events_id: e?.id }
  uni.setNavigationBarTitle({
    title: e?.type
  })
})

onShow(() => {
  method?.init()
})
</script>
<style lang="scss">
@import './style.scss';
</style>
