timeSetModal.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="time-set">
  3. <a-modal v-model:visible="Visible" width="550px" :title="Title" centered destroyOnClose @ok="handleOk"
  4. @cancel="$emit('handleCancelTime', false)">
  5. <a-form :model="formState" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off">
  6. <a-form-item label="开启时间">
  7. <a-select ref="select" v-model:value="formState.hourS" style="width:130px" placeholder="请选择...">
  8. <a-select-option v-for="(item, index) in hourOption" :key="index" :value="item.value">{{ item.label
  9. }}</a-select-option>
  10. </a-select>
  11. <div class="unit">时</div>
  12. <a-select ref="select" v-model:value="formState.minuteS" style="width:130px" placeholder="请选择...">
  13. <a-select-option v-for="(item, index) in minuteOption" :key="index" :value="item.value">{{ item.label
  14. }}</a-select-option>
  15. </a-select>
  16. <div class="unit">分</div>
  17. </a-form-item>
  18. <a-form-item label="关闭时间">
  19. <a-select ref="select" v-model:value="formState.hourE" style="width:130px" placeholder="请选择...">
  20. <a-select-option v-for="(item, index) in hourOption" :key="index" :value="item.value">{{ item.label
  21. }}</a-select-option>
  22. </a-select>
  23. <div class="unit">时</div>
  24. <a-select ref="select" v-model:value="formState.minuteE" style="width:130px" placeholder="请选择...">
  25. <a-select-option v-for="(item, index) in minuteOption" :key="index" :value="item.value">{{ item.label
  26. }}</a-select-option>
  27. </a-select>
  28. <div class="unit">分</div>
  29. </a-form-item>
  30. <a-form-item label="启动定时">
  31. <a-switch v-model:checked="formState.checked" />
  32. </a-form-item>
  33. <a-form-item label="输入密码">
  34. <a-input v-model:value="formState.passWord" placeholder="请输入" style="width: 240px" />
  35. </a-form-item>
  36. </a-form>
  37. </a-modal>
  38. </div>
  39. </template>
  40. <script setup lang="ts">
  41. import { ref, reactive, watchEffect } from 'vue'
  42. let props = defineProps({
  43. visibleTime: {
  44. type: Boolean,
  45. default: false
  46. },
  47. Title: {
  48. type: String,
  49. default: '设定定时'
  50. }
  51. })
  52. let Visible = ref(false)
  53. let formState = reactive({
  54. hourS: '',
  55. minuteS: '',
  56. hourE: '',
  57. minuteE: '',
  58. checked: true,
  59. passWord: ''
  60. })
  61. let hourOption = ref<any[]>([
  62. { label: '00', value: 0 },
  63. { label: '01', value: 1 },
  64. { label: '02', value: 2 },
  65. { label: '03', value: 3 },
  66. { label: '04', value: 4 },
  67. { label: '05', value: 5 },
  68. { label: '06', value: 6 },
  69. { label: '07', value: 7 },
  70. { label: '08', value: 8 },
  71. { label: '09', value: 9 },
  72. { label: '10', value: 10 },
  73. { label: '11', value: 11 },
  74. { label: '12', value: 12 },
  75. { label: '13', value: 13 },
  76. { label: '14', value: 14 },
  77. { label: '15', value: 15 },
  78. { label: '16', value: 16 },
  79. { label: '17', value: 17 },
  80. { label: '18', value: 18 },
  81. { label: '19', value: 19 },
  82. { label: '20', value: 20 },
  83. { label: '21', value: 21 },
  84. { label: '22', value: 22 },
  85. { label: '23', value: 23 },
  86. ])
  87. let minuteOption = ref<any[]>([
  88. { label: '00', value: 0 },
  89. { label: '01', value: 1 },
  90. { label: '02', value: 2 },
  91. { label: '03', value: 3 },
  92. { label: '04', value: 4 },
  93. { label: '05', value: 5 },
  94. { label: '06', value: 6 },
  95. { label: '07', value: 7 },
  96. { label: '08', value: 8 },
  97. { label: '09', value: 9 },
  98. { label: '10', value: 10 },
  99. { label: '11', value: 11 },
  100. { label: '12', value: 12 },
  101. { label: '13', value: 13 },
  102. { label: '14', value: 14 },
  103. { label: '15', value: 15 },
  104. { label: '16', value: 16 },
  105. { label: '17', value: 17 },
  106. { label: '18', value: 18 },
  107. { label: '19', value: 19 },
  108. { label: '20', value: 20 },
  109. { label: '21', value: 21 },
  110. { label: '22', value: 22 },
  111. { label: '23', value: 23 },
  112. { label: '24', value: 24 },
  113. { label: '25', value: 25 },
  114. { label: '26', value: 26 },
  115. { label: '27', value: 27 },
  116. { label: '28', value: 28 },
  117. { label: '29', value: 29 },
  118. { label: '30', value: 30 },
  119. { label: '31', value: 31 },
  120. { label: '32', value: 32 },
  121. { label: '33', value: 33 },
  122. { label: '34', value: 34 },
  123. { label: '35', value: 35 },
  124. { label: '36', value: 36 },
  125. { label: '37', value: 37 },
  126. { label: '38', value: 38 },
  127. { label: '39', value: 39 },
  128. { label: '40', value: 40 },
  129. { label: '41', value: 41 },
  130. { label: '42', value: 42 },
  131. { label: '43', value: 43 },
  132. { label: '44', value: 44 },
  133. { label: '45', value: 45 },
  134. { label: '46', value: 46 },
  135. { label: '47', value: 47 },
  136. { label: '48', value: 48 },
  137. { label: '49', value: 49 },
  138. { label: '50', value: 50 },
  139. { label: '51', value: 51 },
  140. { label: '52', value: 52 },
  141. { label: '53', value: 53 },
  142. { label: '54', value: 54 },
  143. { label: '55', value: 55 },
  144. { label: '56', value: 56 },
  145. { label: '57', value: 57 },
  146. { label: '58', value: 58 },
  147. { label: '59', value: 59 },
  148. ])
  149. //确定
  150. function handleOk() {
  151. }
  152. watchEffect(() => {
  153. Visible.value = props.visibleTime
  154. })
  155. </script>
  156. <style lang="less" scoped>
  157. .zxm-form {
  158. margin: 20px;
  159. }
  160. .unit {
  161. color: #fff;
  162. margin: 0px 10px;
  163. }
  164. ::v-deep .zxm-form-item-control-input-content {
  165. display: flex;
  166. align-items: center;
  167. }
  168. </style>