zhengyiming
6 天以前 44f10c278aae48b8793ae7309488c24494e69866
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
  <ProDialog title="撤回申报" v-model="visible" @close="onDialogClose" destroy-on-close draggable>
    <ProForm :model="form" ref="dialogForm" label-width="110px">
      <ProFormItemV2
        label="撤回原因"
        prop="reasonForWithdrawal"
        :check-rules="[{ message: '请输入撤回原因' }]"
      >
        <ProFormTextArea
          placeholder="请输入"
          v-model="form.reasonForWithdrawal"
          :maxlength="150"
          show-word-limit
        ></ProFormTextArea>
      </ProFormItemV2>
    </ProForm>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="emit('onCancel')">取 消</el-button>
        <el-button type="primary" @click="handleConfirm">确 定</el-button>
      </span>
    </template>
  </ProDialog>
</template>
 
<script setup lang="ts">
import { FormInstance } from 'element-plus';
import {
  ProDialog,
  ProForm,
  ProFormItemV2,
  ProFormTextArea,
  UploadUserFile,
} from '@bole-core/components';
 
defineOptions({
  name: 'ParkBountyApplyRedoDialog',
});
 
// type Props = {};
 
// const props = withDefaults(defineProps<Props>(), {});
 
const visible = defineModel({ type: Boolean });
 
type Form = {
  title?: string;
  reasonForWithdrawal: string;
  parkBountyApplyId: string;
};
 
const form = defineModel<Form>('form');
 
const emit = defineEmits<{
  (e: 'onConfirm'): void;
  (e: 'onCancel'): void;
}>();
 
const dialogForm = ref<FormInstance>();
 
function onDialogClose() {
  if (!dialogForm.value) return;
  dialogForm.value.resetFields();
}
 
function handleConfirm() {
  if (!dialogForm.value) return;
  dialogForm.value.validate((valid) => {
    if (valid) {
      emit('onConfirm');
    } else {
      return;
    }
  });
}
</script>