import { defineComponent, toRefs, ref, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString } from "vue";
import _sfc_main$1 from "../../../NComponents/configCommon/refConfig.mjs";
import img1 from "./images/time.mjs";
import moment from "moment";
import "./index.vue_vue_type_style_index_0_scoped_true_lang.mjs";
import _export_sfc from "../../../../_virtual/plugin-vue_export-helper.mjs";
const _hoisted_1 = { class: "weather" };
const __default__ = defineComponent({ name: "EHeaderTime" });
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    var _a;
    const props = __props;
    let option = {
      timeImageConfig: {
        imgSrc: img1,
        width: 68,
        height: 68
      },
      timeTitleConfig: {
        fontSize: 53,
        fontWeight: "bold",
        fontFamily: "Bureau Agency FB",
        gradient: {
          from: "RGBA(206, 233, 246, 1)",
          to: "RGBA(246, 251, 253, 1)"
        }
      },
      dateConfig: {
        fontSize: 53,
        fontWeight: "bold",
        gradient: {
          from: "RGBA(206, 233, 246, 1)",
          to: "RGBA(246, 251, 253, 1)"
        }
      },
      weekConfig: {
        fontSize: 44,
        fontWeight: "bold",
        fontFamily: "SourceHanSansSC",
        gradient: {
          from: "RGBA(206, 233, 246, 1)",
          to: "RGBA(246, 251, 253, 1)"
        }
      }
    };
    const { timeTitleConfig, timeImageConfig, dateConfig, weekConfig } = toRefs(
      ((_a = props.chartConfig) == null ? void 0 : _a.option) || option
    );
    const weekText = ref("");
    const timeText = ref("");
    const dateText = ref("");
    let setInter = (s) => {
      let timeOut = (s2) => {
        setTimeout(() => {
          weekText.value = getWeek();
          timeText.value = moment().format("HH:mm:ss");
          dateText.value = moment().format("YYYY-MM-DD");
          timeOut(s2);
        }, s2);
      };
      timeOut(s);
    };
    setInter(1e3);
    const getWeek = () => {
      const week = moment().day();
      switch (week) {
        case 1:
          return "\u661F\u671F\u4E00";
        case 2:
          return "\u661F\u671F\u4E8C";
        case 3:
          return "\u661F\u671F\u4E09";
        case 4:
          return "\u661F\u671F\u56DB";
        case 5:
          return "\u661F\u671F\u4E94";
        case 6:
          return "\u661F\u671F\u516D";
        case 0:
          return "\u661F\u671F\u65E5";
      }
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", null, [
          createVNode(_sfc_main$1, {
            config: unref(timeImageConfig),
            type: "img",
            class: "img"
          }, null, 8, ["config"]),
          createVNode(_sfc_main$1, {
            config: unref(timeTitleConfig),
            type: "text"
          }, {
            text: withCtx(() => [
              createTextVNode(toDisplayString(timeText.value), 1)
            ]),
            _: 1
          }, 8, ["config"])
        ]),
        createElementVNode("div", null, [
          createVNode(_sfc_main$1, {
            config: unref(dateConfig),
            type: "text"
          }, {
            text: withCtx(() => [
              createTextVNode(toDisplayString(dateText.value), 1)
            ]),
            _: 1
          }, 8, ["config"])
        ]),
        createElementVNode("div", null, [
          createVNode(_sfc_main$1, {
            config: unref(weekConfig),
            type: "text"
          }, {
            text: withCtx(() => [
              createTextVNode(toDisplayString(weekText.value), 1)
            ]),
            _: 1
          }, 8, ["config"])
        ])
      ]);
    };
  }
});
var _EHeaderTime = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-09a21fbe"]]);
export { _EHeaderTime as default };
