Files
----/后端源码/yifan.action-ai.cn/index/js/index.Cu5O_6Z1.js

84 lines
2.7 KiB
JavaScript

import { aw as ElDatePicker } from "./element-plus.CkEW9frc.js";
import { J as defineComponent, S as openBlock, _ as createElementBlock, $ as createVNode } from "./.pnpm.BW3P1y8f.js";
import { _ as _export_sfc } from "./_plugin-vue_export-helper.1tPrXgE0.js";
const _hoisted_1 = { class: "custom-date-picker" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "index",
props: {
modelValue: {
type: Array,
default: () => []
}
},
emits: ["update:model-value"],
setup(__props, { emit: __emit }) {
const emit = __emit;
const shortcuts = [
{
text: "近一天",
value: () => {
const end = /* @__PURE__ */ new Date();
const start = /* @__PURE__ */ new Date();
start.setTime(start.getTime() - 3600 * 1e3 * 24);
return [start, end];
}
},
{
text: "近三天",
value: () => {
const end = /* @__PURE__ */ new Date();
const start = /* @__PURE__ */ new Date();
start.setTime(start.getTime() - 3600 * 1e3 * 24 * 3);
return [start, end];
}
},
{
text: "近一周",
value: () => {
const end = /* @__PURE__ */ new Date();
const start = /* @__PURE__ */ new Date();
start.setTime(start.getTime() - 3600 * 1e3 * 24 * 7);
return [start, end];
}
},
{
text: "近一个月",
value: () => {
const end = /* @__PURE__ */ new Date();
const start = /* @__PURE__ */ new Date();
start.setTime(start.getTime() - 3600 * 1e3 * 24 * 30);
return [start, end];
}
},
{
text: "近三个月",
value: () => {
const end = /* @__PURE__ */ new Date();
const start = /* @__PURE__ */ new Date();
start.setTime(start.getTime() - 3600 * 1e3 * 24 * 90);
return [start, end];
}
}
];
return (_ctx, _cache) => {
const _component_el_date_picker = ElDatePicker;
return openBlock(), createElementBlock("div", _hoisted_1, [
createVNode(_component_el_date_picker, {
"model-value": __props.modelValue,
type: "datetimerange",
format: "YYYY-MM-DD HH:mm:ss",
"range-separator": "至",
"start-placeholder": "开始日期",
"end-placeholder": "结束日期",
shortcuts,
"onUpdate:modelValue": _cache[0] || (_cache[0] = (val) => emit("update:model-value", val))
}, null, 8, ["model-value"])
]);
};
}
});
const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-736552fc"]]);
export {
DatePicker as D
};