ExportModal.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <el-dialog v-model="props.visible" width="500px" :show-close="false" :close-on-click-modal="false" top="10vh"
  3. class="exportModal">
  4. <template #header="{ titleId, titleClass }">
  5. <div class="flex justify-between items-center border-b pb-3">
  6. <h4 :id="titleId" :class="titleClass">导出任务</h4>
  7. <div>
  8. <el-button type="primary" :loading="['2'].includes(props.saveLoading)" @click="submit()">
  9. 导出
  10. </el-button>
  11. <el-button @click="closeVisible()">取消</el-button>
  12. </div>
  13. </div>
  14. </template>
  15. <div class="mt-5">
  16. <el-form ref="formRef" :model="form" label-width="6em" class="flex flex-wrap form">
  17. <el-form-item label="优先级:">
  18. <el-select v-model="form.priority" placeholder="请选择" clearable>
  19. <el-option v-for="item in PRIORITY " :key="item.value" :value="item.value" :label="item.label" />
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="执行人:">
  23. <el-select v-model="form.executorId" placeholder="请选择" clearable multiple filterable>
  24. <el-option v-for="item in executorValueData" :key="item.value" :value="item.value" :label="item.label" />
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="开始时间:" class="w50">
  28. <el-date-picker v-model="form.startDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" />
  29. </el-form-item>
  30. <el-form-item label="截止时间:" class="w50">
  31. <el-date-picker v-model="form.endDate" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" />
  32. </el-form-item>
  33. </el-form>
  34. </div>
  35. </el-dialog>
  36. </template>
  37. <script lang="ts" setup>
  38. import { ref, watch } from 'vue';
  39. import { Props, Emits } from "./type"
  40. import { defalutExportForm,PRIORITY } from './api';
  41. const props = defineProps<Props>();
  42. const emits = defineEmits<Emits>();
  43. watch(() => props.visible, (val) => {
  44. if (val) {
  45. form.value = { ...defalutExportForm }
  46. executorValueData.value = [{ label: '执行人1', value: '1' }, { label: '执行人2', value: '2' }];
  47. }
  48. })
  49. function closeVisible() {
  50. emits("close")
  51. }
  52. function submit() {
  53. const { executorId, ...rest } = form.value;
  54. const data = {
  55. ...rest,
  56. executorId: executorId.join(','),
  57. }
  58. emits("submit",data)
  59. }
  60. const formRef = ref();
  61. const form = ref<any>({})
  62. const executorValueData = ref<any>([])
  63. </script>
  64. <style lang="scss">
  65. .el-form-item {
  66. width: 100%;
  67. }
  68. .form {
  69. .w50 {
  70. @apply w-1/2;
  71. }
  72. }
  73. </style>