dialog.stateChange.vue 951 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <van-dialog @confirm="onConfirm" v-model="show" show-cancel-button>
  3. <div style="margin:10px;">
  4. <div>
  5. <div>是否更新{{ stateText }}时间?</div>
  6. </div>
  7. <time-cell required is-row title="更新时间" v-model="time" dateType="time" textFormatter="H时m分"/>
  8. </div>
  9. </van-dialog>
  10. </template>
  11. <script>
  12. import dayjs from 'dayjs'
  13. import TimeCell from '@/components/timeCell'
  14. export default {
  15. components: { TimeCell },
  16. data() {
  17. return {
  18. show: false,
  19. subSystem: {},
  20. stateText: '',
  21. time:dayjs(new Date()) .format("H:m")
  22. }
  23. },
  24. props: {},
  25. methods: {
  26. dayjs,
  27. onConfirm() {
  28. this.$emit('success',this.subSystem,this.state,`${dayjs().format("YYYY-MM-DD")} ${this.time}:00`)
  29. },
  30. open(subSystem,state, stateText) {
  31. this.subSystem = subSystem
  32. this.state=state,
  33. this.stateText = stateText
  34. this.show = true
  35. }
  36. }
  37. }
  38. </script>