{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\stManager\\components\\components\\dataMoutnDay.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\stManager\\components\\components\\dataMoutnDay.vue","mtime":1684458239606},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.number.constructor\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport moment from 'moment'; // 导入日期插件\n\nexport default {\n props: {\n // 默认值\n dateDefault: {\n type: String\n },\n // 居中排列\n placeholder: {\n type: String,\n default: '选择日期'\n },\n // 默认年份,闰年\n year: {\n type: String,\n default: '2020'\n },\n // 宽度\n width: {\n type: String,\n default: ''\n }\n },\n data: function data() {\n return {\n visible: false,\n monthShow: false,\n monthFormat: {\n 1: '一月',\n 2: '二月',\n 3: '三月',\n 4: '四月',\n 5: '五月',\n 6: '六月',\n 7: '七月',\n 8: '八月',\n 9: '九月',\n 10: '十月',\n 11: '十一月',\n 12: '十二月'\n },\n dateVal: '',\n monthVal: '',\n dayVal: ''\n };\n },\n computed: {\n getMonthFormat: function getMonthFormat() {\n return this.monthVal ? this.monthFormat[Number(this.monthVal)] : '';\n },\n // 默认选中天\n activeDay: function activeDay() {\n return function (item) {\n return Number(this.dayVal) == item ? 'active' : '';\n };\n },\n // 默认选中月\n activeMonth: function activeMonth() {\n return function (item) {\n return this.monthVal == item ? 'active' : '';\n };\n },\n // 获取当前月的天数\n getDays: function getDays() {\n var days = 30;\n var bigMonth = [1, 3, 5, 7, 8, 10, 12];\n\n if (this.monthVal && bigMonth.includes(Number(this.monthVal))) {\n days = 31;\n } else if (this.monthVal && Number(this.monthVal) == 2) {\n days = 28;\n\n if (Number(this.year) % 4 === 0) {\n days = 29;\n }\n }\n\n return days;\n },\n // 获取月份\n getMonths: function getMonths() {\n var mon = [];\n\n for (var m in this.monthFormat) {\n mon.push({\n key: m < 10 ? '0' + m : '' + m,\n value: this.monthFormat[m]\n });\n }\n\n return mon;\n }\n },\n watch: {\n dateDefault: {\n handler: function handler(newVal, oldVal) {\n if (newVal) {\n var defaultDate = this.year + '-' + this.dateDefault;\n this.dateVal = moment(defaultDate).format('MM-DD');\n this.monthVal = moment(defaultDate).format('MM');\n this.dayVal = moment(defaultDate).format('DD');\n } else {\n this.dateVal = moment().format('MM-DD');\n this.monthVal = moment().format('MM');\n this.dayVal = moment().format('DD');\n this.$emit('update:date', this.dateVal);\n }\n },\n immediate: true // immediate选项可以开启首次赋值监听\n\n },\n visible: {\n handler: function handler(newVal, oldVal) {\n if (newVal) {\n if (this.dateDefault) {\n // 按照闰年来算,防止出现29号,算到1号\n var defaultDate = this.year + '-' + this.dateDefault;\n this.dateVal = moment(defaultDate).format('MM-DD');\n this.monthVal = moment(defaultDate).format('MM');\n this.dayVal = moment(defaultDate).format('DD');\n } else {\n this.dateVal = moment().format('MM-DD');\n this.monthVal = moment().format('MM');\n this.dayVal = moment().format('DD');\n this.$emit('update:date', this.dateVal);\n }\n } else {\n this.monthShow = false;\n }\n },\n immediate: true // immediate选项可以开启首次赋值监听\n\n }\n },\n methods: {\n dirClick: function dirClick(type) {\n if (type == 'left') {\n if (Number(this.monthVal) == 1) {\n this.monthVal = '12';\n } else {\n this.monthVal = moment(this.monthVal).subtract(1, 'M').format('MM');\n }\n }\n\n if (type == 'right') {\n if (Number(this.monthVal) == 12) {\n this.monthVal = '01';\n } else {\n this.monthVal = moment(this.monthVal).add(1, 'M').format('MM');\n }\n } // 默认选中\n\n\n var month = moment().format('MM'),\n day = moment().format('DD');\n\n if (this.dateDefault) {\n console.log(this.dateDefault);\n month = moment(this.dateDefault).format('MM');\n day = moment(this.dateDefault).format('DD');\n }\n\n if (month == this.monthVal) {\n this.dayVal = Number(day);\n } else {\n this.dayVal = '';\n }\n },\n monthTile: function monthTile() {\n this.monthShow = true;\n },\n monthClick: function monthClick(month) {\n this.monthVal = month.key;\n this.dirClick();\n this.monthShow = false;\n },\n dayClick: function dayClick(item) {\n this.dayVal = item;\n var day = this.dayVal < 10 ? '0' + this.dayVal : '' + this.dayVal;\n var val = {\n day: day,\n month: this.monthVal,\n date: this.monthVal + '-' + day\n };\n this.$emit('update:date', val.date);\n this.$emit('changeDay', val);\n this.visible = false;\n }\n }\n};",null]}