'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../utils/index.js');
var formatTime = require('../../../utils/comm/formatTime.js');

var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{
    name: "Fmdatepicker"
  },
  __name: "index",
  props: /* @__PURE__ */ vue.mergeModels({
    dateType: {
      type: String,
      default: "bdate"
    },
    adddaynum: {
      type: Number,
      default: 0
    }
  }, {
    "modelValue": {},
    "modelModifiers": {}
  }),
  emits: ["update:modelValue"],
  setup(__props) {
    const modeValue = vue.useModel(__props, "modelValue");
    const props = __props;
    vue.onMounted(() => {
      vue.nextTick(() => {
        initdate();
      });
    });
    const initdate = () => {
      if (props.dateType === "bdate" && (modeValue.value == null || modeValue.value == void 0 || modeValue.value == "")) {
        modeValue.value = formatTime.getBdate(props.adddaynum);
      } else if (props.dateType === "edate" && (modeValue.value == null || modeValue.value == void 0 || modeValue.value == "")) {
        modeValue.value = formatTime.getEdate(props.adddaynum);
      } else if (props.dateType === "curday" && (modeValue.value == null || modeValue.value == void 0 || modeValue.value == "")) {
        modeValue.value = formatTime.formatDate(/* @__PURE__ */ new Date(), "YYYY-mm-dd");
      }
    };
    initdate();
    return (_ctx, _cache) => {
      const _component_el_date_picker = vue.resolveComponent("el-date-picker");
      return vue.openBlock(), vue.createBlock(_component_el_date_picker, {
        class: "fmdatepicker",
        modelValue: modeValue.value,
        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValue.value = $event),
        type: "date",
        format: "YYYY-MM-DD",
        "value-format": "YYYY-MM-DD"
      }, null, 8, ["modelValue"]);
    };
  }
});

exports.default = _sfc_main;
