/**
 * @description: 灾后评估及重建材料编辑和上传
 * @return {
 *  id: 任务id
 *  type: 编辑或上传
 *  disasterAssessMaterials: 灾后评估材料
 *  disasterReconstructMaterials: 灾后重建材料
 * }
 */

import { ref } from 'vue';
import { defineStore } from 'pinia';

export const usePostDisasterMaterial = defineStore('postDisasterMaterial', () => {
  const id = ref<number>();
  const type = ref<'edit' | 'upload'>('upload');
  const disasterAssessMaterials = ref<string>('');
  const disasterReconstructMaterials = ref<string>('');

  const initData = () => {
    id.value = undefined;
    type.value = 'upload';
    disasterAssessMaterials.value = '';
    disasterReconstructMaterials.value = '';
  };

  return {
    id,
    type,
    disasterAssessMaterials,
    disasterReconstructMaterials,
    initData,
  };
});
