window.vapp_startTime = new Vue({
    el: ‘#startTime’,
    template: <DatePicker type="datetime" :class="isAdd ? 'inputbg' : ''" v-model="value"></DatePicker>,
    data() {
    return {
    value: moment().format(‘YYYY-MM-DD HH:mm:ss’),
    item: window.vapp_fltplan.item
    }
    },
    computed: {
    change_key() {
    let time = this.item.TRIPTYPE == “1” ? this.item.ARRTIME : this.item.DEPTIME;
    const mtime = moment(this.item.FLTDATE + “ “ + time, “YYYY-MM-DD HH:mm”)

    1. if (this.item.TRIPTYPE == "1") {
    2. if (this.item.CHANNELTYPE == "1") {
    3. return mtime.subtract(0.5, "hours");
    4. } else {
    5. return mtime.subtract(45, "minutes");
    6. }
    7. }
    8. else {
    9. if (this.item.CHANNELTYPE == "1") {
    10. return mtime.subtract(1.5, "hours");
    11. } else {
    12. return mtime.subtract(2, "hours");
    13. }
    14. }
    15. },
    16. isAdd() {
    17. let time = this.item.TRIPTYPE == "1" ? this.item.ARRTIME : this.item.DEPTIME;
    18. const mtime = moment(this.item.FLTDATE + " " + time, "YYYY-MM-DD HH:mm")
    19. return moment(mtime).isAfter(moment(this.value));
    20. }
    21. },
    22. created() {
    23. this.$watchAsObservable('change_key')
    24. //.debounceTime(1e3)
    25. .subscribe(({ newValue, oldValue }) => {
    26. this.value = newValue.format('YYYY-MM-DD HH:mm:ss');
    27. });
    28. }

    })