hw-ui-vue
Version:
hw-ui, vue3
1,222 lines (1,221 loc) • 42 kB
JavaScript
import { defineComponent as M, openBlock as d, createElementBlock as r, normalizeClass as y, normalizeStyle as g, createElementVNode as l, toDisplayString as v, createCommentVNode as _, pushScopeId as ne, popScopeId as se, ref as h, Fragment as E, renderList as F, createTextVNode as z, resolveComponent as N, renderSlot as ce, createBlock as K, withDirectives as W, vShow as q, reactive as He } from "vue";
const Se = M({
name: "IHB_Alert",
props: {
isShow: {
type: Boolean,
default: !1
},
title: {
type: String,
default: "\u6D88\u606F\u63D0\u793A\u6846"
},
iconStyle: {
type: Object,
default: {}
},
btnOkStyle: {
type: Object,
default: {}
},
btnCancleStyle: {
type: Object,
default: {}
},
bgVisible: {
type: Boolean,
default: !0
}
},
emits: ["ok"],
setup(e, { emit: a }) {
return {
closeIconHandler: function() {
a("ok");
}
};
}
});
const A = (e, a) => {
const s = e.__vccOpts || e;
for (const [i, o] of a)
s[i] = o;
return s;
}, Me = (e) => (ne("data-v-eebdf232"), e = e(), se(), e), Ae = { class: "hw-alert-flex" }, Oe = { class: "hw-alert-box" }, Ye = { class: "hw-alert-header" }, Ve = { class: "hw-alert-text" }, Le = /* @__PURE__ */ Me(() => /* @__PURE__ */ l("div", { class: "hw-alert-body" }, null, -1)), Ue = { class: "hw-alert-footer" };
function Pe(e, a, s, i, o, p) {
return e.isShow ? (d(), r("div", {
key: 0,
"data-attr": "ibh-alert",
class: y(["hw-box-wrapper"]),
style: g(e.bgVisible ? {} : { background: "none" })
}, [
l("div", Ae, [
l("div", Oe, [
l("div", Ye, [
l("p", null, [
l("span", {
class: y(["hw-alert-icon"]),
style: g(e.iconStyle)
}, "!", 4),
l("span", Ve, v(e.title), 1)
]),
l("p", null, [
l("span", {
class: "hw-alert-close",
onClick: a[0] || (a[0] = (...t) => e.closeIconHandler && e.closeIconHandler(...t))
}, "\xD7")
])
]),
Le,
l("div", Ue, [
l("p", null, [
l("button", {
type: "button",
onClick: a[1] || (a[1] = (...t) => e.closeIconHandler && e.closeIconHandler(...t)),
style: g(e.btnCancleStyle)
}, "\u53D6\u6D88", 4)
]),
l("p", null, [
l("button", {
type: "button",
onClick: a[2] || (a[2] = (...t) => e.closeIconHandler && e.closeIconHandler(...t)),
style: g(e.btnOkStyle)
}, "\u786E\u8BA4", 4)
])
])
])
])
], 4)) : _("", !0);
}
const G = /* @__PURE__ */ A(Se, [["render", Pe], ["__scopeId", "data-v-eebdf232"]]);
G.install = function(e) {
e.component(G.name, G);
};
const je = M({
name: "IHB_Button",
props: {
ibh_type: {
type: String,
default: "ibh-btn-default"
},
ibh_label_text: {
type: String,
default: "Button"
},
ibh_btn_class: {
type: Object,
default: {}
},
disabled: {
type: Boolean,
default: !1
},
ibh_btn_icon: {
type: String,
default: ""
}
},
emit: [""],
setup(e, { emit: a }) {
const s = h(e.ibh_btn_icon);
return {
handlerEvent: () => {
a("handler", e);
},
ibh_icon: s
};
}
});
const Re = ["disabled"];
function ze(e, a, s, i, o, p) {
return d(), r("button", {
"data-attr": "ibh-button",
type: "button",
class: y([e.ibh_type, e.ibh_icon ? `ibh-icon-lib ${e.ibh_icon}` : ""]),
style: g(e.ibh_btn_class),
disabled: e.disabled,
onClick: a[0] || (a[0] = (...t) => e.handlerEvent && e.handlerEvent(...t))
}, v(e.ibh_label_text), 15, Re);
}
const J = /* @__PURE__ */ A(je, [["render", ze], ["__scopeId", "data-v-270cbb91"]]);
J.install = function(e) {
e.component(J.name, J);
};
const Ne = M({
name: "IHB_Input",
props: {
data: {
type: Object,
default: {}
}
},
emits: ["inputHandler"],
setup(e, { emit: a }) {
return {
handerinputEvent: (i) => {
e.data.currentVal = i.target.value;
}
};
}
});
const Ke = {
"data-attr": "ibh-input",
class: "ibh-form-input-box"
}, We = ["disabled", "value"];
function qe(e, a, s, i, o, p) {
return d(), r("div", Ke, [
l("input", {
class: y(["ibh-form-input", e.data.disabled ? "ibh-form-input-disabled" : ""]),
type: "text",
disabled: e.data.disabled,
value: e.data.currentVal,
name: "",
onInput: a[0] || (a[0] = (...t) => e.handerinputEvent && e.handerinputEvent(...t))
}, null, 42, We)
]);
}
const Q = /* @__PURE__ */ A(Ne, [["render", qe], ["__scopeId", "data-v-aa5f57ca"]]);
Q.install = function(e) {
e.component(Q.name, Q);
};
const Ge = M({
name: "IHB_Select",
props: {
data: {
type: Object,
dafault: {}
}
},
emits: ["emitChange"],
setup(e, { emit: a }) {
return {
selectHandler: (i) => {
e.data.currentVal = i.target.value;
}
};
}
});
const Je = (e) => (ne("data-v-2484a954"), e = e(), se(), e), Qe = {
"data-attr": "ibh-select",
class: "ibh-form-select-box"
}, Xe = ["disabled"], Ze = /* @__PURE__ */ Je(() => /* @__PURE__ */ l("option", { value: "-1" }, "\u8BF7\u9009\u62E9", -1)), xe = ["value"];
function et(e, a, s, i, o, p) {
return d(), r("div", Qe, [
l("select", {
class: y(["ibh-form-select", e.data.disabled ? "ibh-form-select-disabled" : ""]),
disabled: e.data.disabled,
name: "",
value: "-1",
onChange: a[0] || (a[0] = (...t) => e.selectHandler && e.selectHandler(...t))
}, [
Ze,
(d(!0), r(E, null, F(e.data.data, (t, n) => (d(), r("option", {
value: t.val,
key: n
}, v(t.text), 9, xe))), 128))
], 42, Xe)
]);
}
const X = /* @__PURE__ */ A(Ge, [["render", et], ["__scopeId", "data-v-2484a954"]]);
X.install = function(e) {
e.component(X.name, X);
};
const tt = M({
name: "IHB_TextBox",
props: {
data: {
type: Object,
dafault: {}
}
},
emits: [""],
setup(e, { emit: a }) {
return {
textareaHandler: (i) => {
e.data.currentVal = i.target.value;
}
};
}
});
const lt = {
"data-attr": "ibh-form-textarea",
class: "ibh-form-textarea-box"
}, at = ["disabled"];
function nt(e, a, s, i, o, p) {
return d(), r("div", lt, [
l("textarea", {
size: "15",
class: y(["ibh-form-textarea", e.data.disabled ? "ibh-form-textarea-disabled" : ""]),
name: "",
disabled: e.data.disabled,
onInput: a[0] || (a[0] = (...t) => e.textareaHandler && e.textareaHandler(...t))
}, `\r
` + v(e.data.currentVal) + `\r
`, 43, at)
]);
}
const Z = /* @__PURE__ */ A(tt, [["render", nt], ["__scopeId", "data-v-da730420"]]);
Z.install = function(e) {
e.component(Z.name, Z);
};
const st = M({
name: "IHB_Switch",
props: {
data: {
type: Object,
default: {}
},
textTitle: {
type: Array,
default: ["\u5F00\u542F", "\u5173\u95ED"]
}
},
emits: ["emitSwitch"],
setup(e, { emit: a }) {
return {
switchHandler: () => {
e.data.disabled || (e.data.currentVal = !e.data.currentVal);
}
};
}
});
const ot = {
"data-attr": "ibh-switch",
class: "ibh-form-radius-box"
}, it = ["disabled"], ut = { class: "ibh-switch-text1" }, dt = { class: "ibh-switch-text2" };
function rt(e, a, s, i, o, p) {
return d(), r("div", ot, [
l("div", {
class: y([e.data.currentVal ? "ibh-form-radius-switched" : "ibh-form-radius", e.data.disabled ? "ibh-form-radius-switched-disabled" : ""]),
disabled: e.data.disabled,
onClick: a[0] || (a[0] = (...t) => e.switchHandler && e.switchHandler(...t))
}, [
l("div", ut, v(e.textTitle[0]), 1),
z(" \xA0 "),
l("div", dt, v(e.textTitle[1]), 1)
], 10, it)
]);
}
const x = /* @__PURE__ */ A(st, [["render", rt], ["__scopeId", "data-v-be8755bb"]]);
x.install = function(e) {
e.component(x.name, x);
};
const ct = M({
name: "IHB_File",
props: {
data: {
type: Object,
default: {}
}
},
emits: ["inputHandler"],
setup(e, { emit: a }) {
const s = h(null);
return {
handerFileEvent: (p) => {
console.log(p.target.value);
},
mockFileHandler: (p) => {
e.data.disabled || s.value.click();
},
fileRefUpload: s
};
}
});
const vt = {
"data-attr": "ibh-file",
class: "ibh-form-file-box"
};
function bt(e, a, s, i, o, p) {
return d(), r("div", vt, [
l("input", {
ref: "fileRefUpload",
class: "ibh-form-file",
type: "file",
onChange: a[0] || (a[0] = (...t) => e.handerFileEvent && e.handerFileEvent(...t)),
name: "file"
}, null, 544),
l("div", {
class: y(["ibh-form-file-mock", e.data.disabled ? "ibh-form-file-mock-disabled" : ""]),
onClick: a[1] || (a[1] = (...t) => e.mockFileHandler && e.mockFileHandler(...t))
}, "+", 2)
]);
}
const ee = /* @__PURE__ */ A(ct, [["render", bt], ["__scopeId", "data-v-4de0e419"]]);
ee.install = function(e) {
e.component(ee.name, ee);
};
const pt = M({
name: "IHB_Modal",
components: {
IHB_Input: Q,
IHB_Select: X,
IHB_TextBox: Z,
IHB_Switch: x,
IHB_File: ee
},
props: {
attrFlag: {
type: Object,
default: {
formFileds: {
type: Array,
default: []
},
footer: {
type: Boolean,
default: !0
}
}
}
},
emits: ["callCancleEvent", "callOKEvent"],
setup(e, { emit: a }) {
return {
ibhCancle: (o) => {
a("callCancleEvent");
},
ibhOk: (o) => {
a("callOKEvent");
}
};
}
});
const ht = (e) => (ne("data-v-cfc7e5cd"), e = e(), se(), e), yt = {
key: 0,
"data-attr": "ibh-modal",
class: "ibh-modal-box"
}, ft = { class: "ibh-wrapper" }, mt = { class: "ibh-modal-header" }, _t = { class: "header-text" }, $t = /* @__PURE__ */ ht(() => /* @__PURE__ */ l("div", { class: "ibh-line" }, null, -1)), gt = { for: "" }, kt = { class: "ibh-label-tag" }, It = { class: "ibh-view-left" }, Tt = { for: "" }, Dt = { class: "ibh-label-tag" }, Et = { class: "ibh-view-right" }, Ft = { class: "ibh-line" }, Ct = { class: "ibh-modal-footer" }, wt = { class: "footer-cancle" }, Bt = { class: "footer-confirm" };
function Ht(e, a, s, i, o, p) {
const t = N("IHB_Input"), n = N("IHB_Select"), u = N("IHB_TextBox"), k = N("IHB_Switch"), T = N("IHB_File");
return e.attrFlag.visible ? (d(), r("div", yt, [
l("div", ft, [
l("div", mt, [
l("div", _t, v(e.attrFlag.title), 1),
l("div", {
class: "header-close",
onClick: a[0] || (a[0] = (...c) => e.ibhCancle && e.ibhCancle(...c))
}, "\xD7")
]),
$t,
l("div", {
class: y(["ibh-modal-body", e.attrFlag.title == "VIEW" ? "ibh-modal-body-view" : ""])
}, [
e.attrFlag.title != "VIEW" ? ce(e.$slots, "content", { key: 0 }, () => [
(d(!0), r(E, null, F(e.attrFlag.formFileds, (c, b) => (d(), r("div", {
class: y(["ibh-filed-item", c.type == "textBox" ? "ibh-textarea-box" : ""]),
key: b
}, [
l("div", {
class: y(["ibh-label", c.type == "fileUpload" ? "ibh-file-upload-text" : ""])
}, [
l("label", gt, [
l("span", kt, v(c.require ? "*" : ""), 1),
z(" " + v(c.label) + ":", 1)
])
], 2),
l("div", {
class: y(["ibh-form-item", c.type == "fileUpload" ? "ibh-file-upload" : ""])
}, [
c.type == "input" ? (d(), K(t, {
key: 0,
data: c
}, null, 8, ["data"])) : _("", !0),
c.type == "select" ? (d(), K(n, {
key: 1,
data: c
}, null, 8, ["data"])) : _("", !0),
c.type == "textBox" ? (d(), K(u, {
key: 2,
data: c
}, null, 8, ["data"])) : _("", !0),
c.type == "radiusSwitch" ? (d(), K(k, {
key: 3,
data: c,
textTitle: c.text
}, null, 8, ["data", "textTitle"])) : _("", !0),
c.type == "fileUpload" ? (d(), K(T, {
key: 4,
data: c
}, null, 8, ["data"])) : _("", !0)
], 2)
], 2))), 128))
], !0) : _("", !0),
e.attrFlag.title == "VIEW" ? ce(e.$slots, "content", { key: 1 }, () => [
(d(!0), r(E, null, F(e.attrFlag.formFileds, (c, b) => (d(), r("div", {
class: "ibh-view-box-wrapper",
key: b
}, [
l("div", It, [
l("label", Tt, [
l("span", Dt, v(c.require ? "*" : ""), 1),
z(" " + v(c.label) + ":", 1)
])
]),
l("div", Et, v(c.currentVal), 1)
]))), 128))
], !0) : _("", !0)
], 2),
W(l("div", Ft, null, 512), [
[q, e.attrFlag.footer]
]),
W(l("div", Ct, [
l("div", wt, [
l("button", {
type: "button",
name: "button",
onClick: a[1] || (a[1] = (...c) => e.ibhCancle && e.ibhCancle(...c))
}, "\u53D6\u6D88")
]),
l("div", Bt, [
l("button", {
type: "button",
name: "button",
onClick: a[2] || (a[2] = (...c) => e.ibhOk && e.ibhOk(...c))
}, "\u786E\u8BA4")
])
], 512), [
[q, e.attrFlag.footer]
])
])
])) : _("", !0);
}
const te = /* @__PURE__ */ A(pt, [["render", Ht], ["__scopeId", "data-v-cfc7e5cd"]]);
te.install = function(e) {
e.component(te.name, te);
};
const St = M({
name: "IHB_FileUpload",
props: {
ibh_visible: {
type: Boolean,
default: !1
}
},
emits: ["fileCallBack"],
setup(e, { emit: a }) {
const s = h(!1), i = h(""), o = He([]), p = h(null);
return {
visible: s,
closeIconLoad: () => {
s.value = !s.value, a("fileCallBack", s.value), o.length = 0, i.value = "";
},
fileLoadingImg: p,
ibhSelectEvent: () => {
p.value.click();
},
ibhLoadFileImg: (m) => {
let I = p.value.files.length;
if (I > 0 && I <= 5)
for (let V = 0; V < I; V++) {
let C = p.value.files[V], H = new FileReader();
H.readAsDataURL(C), H.onload = (D) => {
o.push({
name: C.name,
size: `${(C.size / 1024).toFixed(2)}Kb`,
status: 0,
pathImage: H.result
});
};
}
else
i.value = "\u4E00\u6B21\u6700\u591A\u90095\u5F20";
m.target.value = "";
},
nameFileTips: i,
imageFileArray: o,
startUploadFile: () => {
o.map((m) => {
m.status = 2;
});
},
deleteUploadFile: (m) => {
o.splice(m, 1);
},
saveHandler: () => {
if (o.length == 0) {
i.value = "\u6CA1\u6709\u6587\u4EF6\u6570\u636E";
return;
}
a("fileCallBack", s.value), o.length = 0;
},
cancleIconImage: () => {
o.length = 0, i.value = "";
}
};
}
});
const Y = (e) => (ne("data-v-709e042a"), e = e(), se(), e), Mt = {
key: 0,
"data-attr": "fileLoader",
class: /* @__PURE__ */ y(["hw-fileloading-box"])
}, At = { class: "ibh-loading-wrapper" }, Ot = { class: "ibh-file-load-header" }, Yt = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("p", null, [
/* @__PURE__ */ l("span", null, "\u4E0A\u4F20")
], -1)), Vt = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("div", { class: "ibh-file-load-line" }, null, -1)), Lt = { class: "ibh-file-load-body" }, Ut = { class: "ibh-file-tips" }, Pt = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("span", { class: "ibh-loading-icon-tips" }, "\u5355\u4E2A\u6587\u4EF6\u4E0D\u8D85\u8FC720M", -1)), jt = { class: "ibh-tips-message" }, Rt = { class: "ibh-file-table" }, zt = {
border: "0",
cellpadding: "0",
cellspacing: "0"
}, Nt = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("thead", null, [
/* @__PURE__ */ l("tr", null, [
/* @__PURE__ */ l("td", null, "\u7F29\u7565\u56FE"),
/* @__PURE__ */ l("td", null, "\u6587\u4EF6\u540D"),
/* @__PURE__ */ l("td", null, "\u6587\u4EF6\u5927\u5C0F"),
/* @__PURE__ */ l("td", null, "\u72B6\u6001"),
/* @__PURE__ */ l("td", null, "\u64CD\u4F5C")
])
], -1)), Kt = { class: "ibh-file-image" }, Wt = ["src"], qt = { class: "ibh-file-loading-name" }, Gt = { class: "ibh-file-name-box ibh-file-success-tips" }, Jt = {
key: 0,
class: "ibh-loading-img-name-wait"
}, Qt = {
key: 1,
class: "ibh-loading-img-name-success"
}, Xt = {
key: 2,
class: "ibh-loading-img-name-fail"
}, Zt = { key: 3 }, xt = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("span", { class: "ibh-loading-line-wait" }, null, -1)), el = [
xt
], tl = { key: 4 }, ll = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("span", { class: "ibh-loading-line-success" }, null, -1)), al = [
ll
], nl = { key: 5 }, sl = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("span", { class: "ibh-loading-line-fail" }, null, -1)), ol = [
sl
], il = {
key: 0,
class: "ibh-loading-status-wait"
}, ul = {
key: 1,
class: "ibh-loading-status-success"
}, dl = {
key: 2,
class: "ibh-loading-status-fail"
}, rl = ["onClick"], cl = { key: 0 }, vl = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("td", { colSpan: "5" }, "\u6682\u65E0\u6587\u4EF6", -1)), bl = [
vl
], pl = /* @__PURE__ */ Y(() => /* @__PURE__ */ l("div", { class: "ibh-file-load-line" }, null, -1)), hl = { class: "ibh-file-load-footer" };
function yl(e, a, s, i, o, p) {
return e.ibh_visible ? (d(), r("div", Mt, [
l("div", At, [
l("div", Ot, [
Yt,
l("p", null, [
l("span", {
onClick: a[0] || (a[0] = (...t) => e.closeIconLoad && e.closeIconLoad(...t)),
style: { cursor: "pointer" }
}, "\xD7")
])
]),
Vt,
l("div", Lt, [
l("div", Ut, [
l("p", null, [
Pt,
z(" \xA0 "),
l("span", jt, v(e.nameFileTips), 1)
]),
l("p", null, [
l("button", {
class: "ibh-loading-btn",
type: "button",
name: "",
onClick: a[1] || (a[1] = (...t) => e.ibhSelectEvent && e.ibhSelectEvent(...t))
}, "\u9009\u62E9\u6587\u4EF6")
])
]),
l("div", Rt, [
l("table", zt, [
Nt,
l("tbody", null, [
(d(!0), r(E, null, F(e.imageFileArray, (t, n) => (d(), r("tr", { key: n }, [
l("td", null, [
l("div", Kt, [
l("img", {
src: t.pathImage,
alt: "404"
}, null, 8, Wt)
])
]),
l("td", null, [
l("div", qt, [
l("div", Gt, [
t.status == 0 ? (d(), r("p", Jt, v(t.name), 1)) : _("", !0),
t.status == 1 ? (d(), r("p", Qt, v(t.name), 1)) : _("", !0),
t.status == 2 ? (d(), r("p", Xt, v(t.name), 1)) : _("", !0),
t.status == 0 ? (d(), r("p", Zt, el)) : _("", !0),
t.status == 1 ? (d(), r("p", tl, al)) : _("", !0),
t.status == 2 ? (d(), r("p", nl, ol)) : _("", !0)
])
])
]),
l("td", null, v(t.size), 1),
l("td", null, [
t.status == 0 ? (d(), r("span", il, "\u7B49\u5F85\u4E0A\u4F20")) : _("", !0),
t.status == 1 ? (d(), r("span", ul, "\u4E0A\u4F20\u6210\u529F")) : _("", !0),
t.status == 2 ? (d(), r("span", dl, "\u4E0A\u4F20\u5931\u8D25")) : _("", !0)
]),
l("td", null, [
l("span", {
class: "ibh-delete-file",
onClick: (u) => e.deleteUploadFile(n)
}, "\u5220\u9664", 8, rl)
])
]))), 128)),
e.imageFileArray.length == 0 ? (d(), r("tr", cl, bl)) : _("", !0)
])
])
])
]),
pl,
l("div", hl, [
l("p", null, [
l("input", {
ref: "fileLoadingImg",
class: "ibhViewFileLoad",
type: "file",
multiple: "multiple",
name: "file",
onChange: a[2] || (a[2] = (...t) => e.ibhLoadFileImg && e.ibhLoadFileImg(...t))
}, null, 544)
]),
l("button", {
type: "button",
name: "button",
onClick: a[3] || (a[3] = (...t) => e.cancleIconImage && e.cancleIconImage(...t))
}, "\u53D6\u6D88"),
l("button", {
type: "button",
name: "button",
onClick: a[4] || (a[4] = (...t) => e.startUploadFile && e.startUploadFile(...t))
}, "\u5F00\u59CB\u4E0A\u4F20"),
l("button", {
type: "button",
name: "button",
onClick: a[5] || (a[5] = (...t) => e.saveHandler && e.saveHandler(...t))
}, "\u4FDD\u5B58")
])
])
])) : _("", !0);
}
const le = /* @__PURE__ */ A(St, [["render", yl], ["__scopeId", "data-v-709e042a"]]);
le.install = function(e) {
e.component(le.name, le);
};
const fl = function() {
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
}, S = function(e) {
return e < 10 ? "0" + e : e;
}, re = function(e, a, s, i, o, p, t) {
let n = `${a}-${s}-${i}`;
switch (e) {
case "YYYY":
n = `${a}`;
break;
case "MM":
n = S(s);
break;
case "YYYY-MM":
n = `${a}-${S(s)}`;
break;
case "YYYY-MM-DD":
let u = S(s), k = S(i);
n = `${a}-${u}-${k}`;
break;
case "YYYY-MM-DD hh":
n = `${a}-${S(s)}-${S(i)} ${o}`;
break;
case "YYYY-MM-DD hh:mm":
n = `${a}-${S(s)}-${S(i)} ${o}:${p}`;
break;
case "YYYY-MM-DD hh:mm:ss":
let T = S(s), c = S(i);
n = `${a}-${T}-${c} ${o}:${p}:${t}`;
break;
}
return n;
}, ml = function(e) {
let a = e.getFullYear(), s = e.getMonth() + 1;
return {
yearibh: a,
monthibh: s,
resultibh: `${a} / ${s} \u6708`
};
}, ve = function(e) {
let a = new Date(e), s = a.getMonth() + 1;
return a.setMonth(s), a.setDate(0), a.getDate();
}, _l = function(e, a, s, i) {
for (let o = 0; o < e; o++)
s.unshift({
number: i--,
isToday: !1,
cellpre: !0,
eventDisable: !1,
selected: !1
});
for (let o = 1; o <= a; o++)
s.push({
number: o,
isToday: !1,
cellpre: !0,
eventDisable: !1,
selected: !1
});
return s;
}, $l = function(e, a) {
let s = [], i = [];
return e.forEach((o) => {
i.push(o), i.length == a && (s.push(i), i = []);
}), i.length && s.push(i), s;
}, gl = function(e) {
let a = new Date(), s = a.getMonth() + 1, i = a.getFullYear(), o = a.getDate(), p = e.getFullYear(), t = e.getMonth() + 1, n = e.getDate(), u = ve(e), k = ve(new Date(`${p}-${t - 1}-01`)), c = new Date(p, t - 1, 1).getDay(), b = [];
const I = 42 - u;
b[1] = u;
let V = [];
for (let D = 1; D <= u; D++)
V.push({
number: D,
cellpre: !1,
eventDisable: !0,
selected: !1,
isToday: D == n && s == t && i == p && o == n
});
switch (c) {
case 0:
b[0] = 0, b[2] = I - 0;
break;
case 1:
b[0] = 1, b[2] = I - 1;
break;
case 2:
b[0] = 2, b[2] = I - 2;
break;
case 3:
b[0] = 3, b[2] = I - 3;
break;
case 4:
b[0] = 4, b[2] = I - 4;
break;
case 5:
b[0] = 5, b[2] = I - 5;
break;
case 6:
b[0] = 6, b[2] = I - 6;
break;
}
let C = _l(b[0], b[2], V, k);
return $l(C, 7);
}, kl = function() {
let e = [], a = [], s = [], i = [];
for (let o = 0; o < 24; o++)
e.push(o >= 10 ? o + "" : "0" + o);
for (let o = 0; o < 60; o++)
a.push(o >= 10 ? o : "0" + o), s.push(o >= 10 ? o : "0" + o);
return i[0] = [...e], i[1] = [...a], i[2] = [...s], i;
}, R = function(e = new Date()) {
let a = fl(), s = ml(e), i = ve(e), o = gl(e);
return {
weekTitle: a,
currentMonth: s,
currentDays: i,
getTableSoft: o,
timerData: kl()
};
}, Il = M({
name: "IHB_DateTime",
props: {
formate: {
type: String,
default: "YY-MM-DD"
},
showTimer: {
type: Boolean,
default: !1
},
themStyle: {
type: Object,
default: {}
},
inputStyle: {
type: Object,
default: {}
},
placeholderText: {
type: String,
default: "\u8BF7\u9009\u62E9\u65E5\u671F"
},
disPlayFlex: {
type: String,
default: "col"
},
ranger: {
type: Boolean,
default: !1
},
size: {
type: String,
default: "small"
},
nextMonth: {
type: Boolean,
default: !1
}
},
setup(e) {
let a = e.ranger;
h([]);
let { weekTitle: s, currentMonth: i, getTableSoft: o, timerData: p } = R();
h(i.resultibh);
let t = h(i.monthibh), n = h(i.yearibh), u = h(o), k = h("00"), T = h("00"), c = h("00"), b = h(e.showTimer), m = h(""), I = h("activeItemDay"), V = new Date().getDate();
m.value = V;
let C = h([]), H = h(`${m.value}\u65E5-`), D = h([]);
const U = h(!1), L = h(""), oe = h(e.themStyle), he = {
backgroundColor: oe.value.titleColor
}, ye = {
backgroundColor: oe.value.titleColor,
borderRadius: "50%",
color: "rgba(255,255,255,1)"
};
let fe = h(!1), me = h(!1);
h([]);
let ie = h(!1);
const _e = () => {
U.value = !0;
}, $e = () => {
}, ge = () => {
t.value == 1 ? (t.value = 12, n.value--) : t.value--;
let f = new Date().getDate(), { getTableSoft: $ } = R(new Date(`${n.value}-${t.value}-${f}`));
u.value = $;
}, ke = () => {
t.value == 12 ? (t.value = 1, n.value++) : t.value++;
let f = new Date().getDate(), { getTableSoft: $ } = R(new Date(`${n.value}-${t.value}-${f}`));
u.value = $;
}, Ie = () => {
n.value--;
let { getTableSoft: f } = R(new Date(`${n.value}-${t.value}-01`));
u.value = f;
}, Te = () => {
n.value++;
let { getTableSoft: f } = R(new Date(`${n.value}-${t.value}-01`));
u.value = f;
}, De = () => {
let f = new Date(), $ = f.getFullYear(), w = f.getMonth() + 1, P = f.getDate();
n.value = $, t.value = w;
let { getTableSoft: j } = R(new Date(`${$}-${w}-${P}`));
if (u.value = j, b.value) {
m.value = P, I.value = "activeItemDay", H.value = m.value + "\u65E5-", k.value = "00", T.value = "00", c.value = "00";
return;
}
if (a) {
m.value = P, I.value = "activeItemDay", H.value = m.value + "\u65E5-", k.value = "00", T.value = "00", c.value = "00";
return;
}
L.value = re(e.formate, `${$}`, `${w}`, `${P}`), U.value = !1;
}, Ee = (f, $) => {
let w = $.target.innerText;
f == 0 && (k.value = w), f == 1 && (T.value = w), f == 2 && (c.value = w, a && b.value && (ie.value ? D.value[1] = `${n.value}-${t.value}-${C.value[1]} ${k.value}:${T.value}:${c.value}` : (ie.value = !0, H.value = C.value[1] + "\u65E5-", D.value[0] = `${n.value}-${t.value}-${m.value} ${k.value}:${T.value}:${c.value}`, k.value = "00", T.value = "00", c.value = "00")));
}, Fe = () => {
U.value = !1;
}, Ce = () => {
if (a) {
if (b.value) {
if (D.value[0] == null || D.value[1] == null)
return;
console.log(D.value), L.value = `${D.value[0]} - ${D.value[1]}`, D.value = [], k.value = "00", T.value = "00", c.value = "00", be();
}
} else
L.value = re(e.formate, `${n.value}`, `${t.value}`, `${m.value}`, `${k.value}`, `${T.value}`, `${c.value}`);
U.value = !1;
}, be = () => {
let f = u.value.length;
for (let $ = 0; $ < f; $++)
for (let w = 0; w < 7; w++)
u.value[$][w].selected = !1;
};
return {
isVisibale: U,
focusEventInput: _e,
blurEventInput: $e,
weekTitle: s,
yearibh: n,
monthibh: t,
dataTime: u,
monthPreEventHander: ge,
monthNextEventHander: ke,
yearPreEvent: Ie,
yearNextEvent: Te,
timerData: p,
ibh_hours: k,
ibh_minitus: T,
ibh_second: c,
timeHoursEvent: Ee,
ibhTodayaEvent: De,
inputText: L,
closeOpenDate: Fe,
confirmTimeBtn: Ce,
timerhms: b,
tdsEventItems: (f, $, w, P) => {
if (C.value = [], C.value.push($), C.value.push(m.value), f && (m.value = $, I.value = "activeItemDay", b.value || (L.value = re(e.formate, `${n.value}`, `${t.value}`, `${m.value}`), U.value = !1), a && f)) {
let j = C.value.sort((B, O) => B - O), ue = [];
be();
for (let B = j[0]; B <= j[1]; B++)
ue.push(B);
let we = u.value.length, Be = ue.length;
for (let B = 0; B < we; B++)
for (let O = 0; O < 7; O++)
if (u.value[B][O].eventDisable && u.value[B][O].number)
for (let de = 0; de < Be; de++)
u.value[B][O].eventDisable && ue[de] == u.value[B][O].number && (u.value[B][O].selected = !0);
D.value = [], b.value ? (ie.value = !1, H.value = C.value[0] + "\u65E5-") : L.value = `${n.value}-${t.value}-${j[0]} ${n.value}-${t.value}-${j[1]}`;
}
},
isActiveToday: m,
activeItemDay: I,
themStyleColor: oe,
clearInputText: () => {
L.value = "";
},
tdsMouseOverEvent: (f, $, w, P) => {
a && f && m.value;
},
tdStyleThemPre: fe,
tdStyleThemNext: me,
dayView: H,
styleLintThem: he,
styleSelectRanger: ye
};
}
});
const Tl = { class: "ibh-date-input" }, Dl = { class: "ibh-span-input-wrapper" }, El = ["placeholder", "value"], Fl = { class: "ibh-time-table" }, Cl = { class: "ihb-dataTime-grid" }, wl = { class: "dataTime-left-box" }, Bl = { class: "" }, Hl = { class: "" }, Sl = { class: "" }, Ml = { class: "ibh-table-box" }, Al = {
width: "100%",
border: "0",
cellpadding: "0",
cellspacing: "0"
}, Ol = {
valign: "middle",
align: "center"
}, Yl = ["data-key", "onMouseover", "onClick"], Vl = ["data-key", "onMouseover", "onClick"], Ll = ["data-key", "onMouseover", "onClick"], Ul = ["data-key", "onMouseover", "onClick"], Pl = ["data-key", "onMouseover", "onClick"], jl = ["data-key", "onMouseover", "onClick"], Rl = { class: "dataTime-right-box" }, zl = { class: "ibh-dataTime-header" }, Nl = { class: "ibh-dataTime-body" }, Kl = { class: "ibh-hour-item" }, Wl = { class: "ibh-hour-item" }, ql = { class: "ibh-hour-item" }, Gl = { class: "ibh-dataTime-footer" };
function Jl(e, a, s, i, o, p) {
return d(), r("div", {
"data-attr": "time",
class: "ibh-dataTime-box",
style: g({ display: e.disPlayFlex == "row" ? "inline-block" : "block" })
}, [
l("div", Tl, [
ce(e.$slots, "ibh-time-input", {}, () => [
l("span", Dl, [
l("input", {
readonly: "readonly",
placeholder: e.placeholderText,
class: "ibh-input-box",
type: "text",
name: "",
value: e.inputText,
onFocus: a[0] || (a[0] = (...t) => e.focusEventInput && e.focusEventInput(...t)),
onBlur: a[1] || (a[1] = (...t) => e.blurEventInput && e.blurEventInput(...t)),
style: g(e.inputStyle)
}, null, 44, El),
l("span", {
class: "clearText",
onClick: a[2] || (a[2] = (...t) => e.clearInputText && e.clearInputText(...t))
}, "\xD7")
])
], !0),
W(l("div", {
class: "ibh-fixed-box-time",
onClick: a[3] || (a[3] = (...t) => e.closeOpenDate && e.closeOpenDate(...t))
}, null, 512), [
[q, e.isVisibale]
]),
W(l("div", Fl, [
l("div", Cl, [
l("div", wl, [
l("div", {
class: y(["ibh-dataTime-header", e.showTimer ? "" : "ibhborderItem"])
}, [
l("div", Bl, [
l("span", {
class: "spacilTextIcon",
onClick: a[4] || (a[4] = (...t) => e.yearPreEvent && e.yearPreEvent(...t))
}, "\xAB"),
z("\xA0"),
l("span", {
class: "spacilTextIcon",
onClick: a[5] || (a[5] = (...t) => e.monthPreEventHander && e.monthPreEventHander(...t))
}, "\u2039")
]),
l("div", Hl, [
l("span", {
class: y(["ibh-current-time"]),
style: g({ color: e.themStyleColor.titleColor })
}, v(e.yearibh) + " / " + v(e.monthibh) + " \u6708", 5)
]),
l("div", Sl, [
l("span", {
class: "spacilTextIcon",
onClick: a[6] || (a[6] = (...t) => e.monthNextEventHander && e.monthNextEventHander(...t))
}, "\u203A"),
z("\xA0"),
l("span", {
class: "spacilTextIcon",
onClick: a[7] || (a[7] = (...t) => e.yearNextEvent && e.yearNextEvent(...t))
}, "\xBB")
])
], 2),
l("div", {
class: y(["ibh-dataTime-body", e.showTimer ? "" : "ibhborderItem"])
}, [
l("div", Ml, [
l("table", Al, [
l("tbody", Ol, [
l("tr", null, [
(d(!0), r(E, null, F(e.weekTitle, (t, n) => (d(), r("td", {
class: "timerTitleBox",
key: n
}, v(t), 1))), 128))
]),
l("tr", null, [
(d(!0), r(E, null, F(e.dataTime[0], (t, n) => (d(), r("td", { key: n }, [
l("span", {
"data-key": t.number,
onMouseover: (u) => e.tdsMouseOverEvent(t.eventDisable, t.number, n, u),
onClick: (u) => e.tdsEventItems(t.eventDisable, t.number, n, u),
class: y([t.isToday ? "tdToday" : "", t.cellpre ? "tdPreToday" : "", t.number == e.isActiveToday && t.eventDisable ? e.activeItemDay : ""]),
style: g(t.number == e.isActiveToday && t.eventDisable ? e.styleLintThem : t.eventDisable && t.selected ? e.styleSelectRanger : {})
}, v(t.number), 47, Yl)
]))), 128))
]),
l("tr", null, [
(d(!0), r(E, null, F(e.dataTime[1], (t, n) => (d(), r("td", { key: n }, [
l("span", {
"data-key": t.number,
onMouseover: (u) => e.tdsMouseOverEvent(t.eventDisable, t.number, n, u),
onClick: (u) => e.tdsEventItems(t.eventDisable, t.number, n, u),
class: y([t.isToday ? "tdToday" : "", t.cellpre ? "tdPreToday" : "", t.number == e.isActiveToday && t.eventDisable ? e.activeItemDay : ""]),
style: g(t.number == e.isActiveToday && t.eventDisable ? e.styleLintThem : t.eventDisable && t.selected ? e.styleSelectRanger : {})
}, v(t.number), 47, Vl)
]))), 128))
]),
l("tr", null, [
(d(!0), r(E, null, F(e.dataTime[2], (t, n) => (d(), r("td", { key: n }, [
l("span", {
"data-key": t.number,
onMouseover: (u) => e.tdsMouseOverEvent(t.eventDisable, t.number, n, u),
onClick: (u) => e.tdsEventItems(t.eventDisable, t.number, n, u),
class: y([t.isToday ? "tdToday" : "", t.cellpre ? "tdPreToday" : "", t.number == e.isActiveToday && t.eventDisable ? e.activeItemDay : ""]),
style: g(t.number == e.isActiveToday && t.eventDisable ? e.styleLintThem : t.eventDisable && t.selected ? e.styleSelectRanger : {})
}, v(t.number), 47, Ll)
]))), 128))
]),
l("tr", null, [
(d(!0), r(E, null, F(e.dataTime[3], (t, n) => (d(), r("td", { key: n }, [
l("span", {
"data-key": t.number,
onMouseover: (u) => e.tdsMouseOverEvent(t.eventDisable, t.number, n, u),
onClick: (u) => e.tdsEventItems(t.eventDisable, t.number, n, u),
class: y([t.isToday ? "tdToday" : "", t.cellpre ? "tdPreToday" : "", t.number == e.isActiveToday && t.eventDisable ? e.activeItemDay : ""]),
style: g(t.number == e.isActiveToday && t.eventDisable ? e.styleLintThem : t.eventDisable && t.selected ? e.styleSelectRanger : {})
}, v(t.number), 47, Ul)
]))), 128))
]),
l("tr", null, [
(d(!0), r(E, null, F(e.dataTime[4], (t, n) => (d(), r("td", { key: n }, [
l("span", {
"data-key": t.number,
onMouseover: (u) => e.tdsMouseOverEvent(t.eventDisable, t.number, n, u),
onClick: (u) => e.tdsEventItems(t.eventDisable, t.number, n, u),
class: y([t.isToday ? "tdToday" : "", t.cellpre ? "tdPreToday" : "", t.number == e.isActiveToday && t.eventDisable ? e.activeItemDay : ""]),
style: g(t.number == e.isActiveToday && t.eventDisable ? e.styleLintThem : t.eventDisable && t.selected ? e.styleSelectRanger : {})
}, v(t.number), 47, Pl)
]))), 128))
]),
l("tr", null, [
(d(!0), r(E, null, F(e.dataTime[5], (t, n) => (d(), r("td", { key: n }, [
l("span", {
"data-key": t.number,
onMouseover: (u) => e.tdsMouseOverEvent(t.eventDisable, t.number, n, u),
onClick: (u) => e.tdsEventItems(t.eventDisable, t.number, n, u),
class: y([t.isToday ? "tdToday" : "", t.cellpre ? "tdPreToday" : "", t.number == e.isActiveToday && t.eventDisable ? e.activeItemDay : ""]),
style: g(t.number == e.isActiveToday && t.eventDisable ? e.styleLintThem : t.eventDisable && t.selected ? e.styleSelectRanger : {})
}, v(t.number), 47, jl)
]))), 128))
])
])
])
])
], 2),
l("div", {
class: y(["ibh-dataTime-footer", e.showTimer ? "" : "ibhborderItem"])
}, [
l("span", {
onClick: a[8] || (a[8] = (...t) => e.ibhTodayaEvent && e.ibhTodayaEvent(...t)),
style: g({ color: e.themStyle.titleColor })
}, "\u4ECA\u5929", 4)
], 2)
]),
W(l("div", Rl, [
l("div", zl, [
l("div", {
class: "ibh-dateTime-right-top",
style: g({ color: e.themStyle.titleColor })
}, v(e.dayView) + v(e.ibh_hours) + ":" + v(e.ibh_minitus) + ":" + v(e.ibh_second), 5)
]),
l("div", Nl, [
l("div", Kl, [
(d(!0), r(E, null, F(e.timerData[0], (t, n) => (d(), r("span", {
onClick: a[9] || (a[9] = (u) => e.timeHoursEvent(0, u)),
key: n
}, v(t), 1))), 128))
]),
l("div", Wl, [
(d(!0), r(E, null, F(e.timerData[1], (t, n) => (d(), r("span", {
onClick: a[10] || (a[10] = (u) => e.timeHoursEvent(1, u)),
key: n
}, v(t), 1))), 128))
]),
l("div", ql, [
(d(!0), r(E, null, F(e.timerData[2], (t, n) => (d(), r("span", {
onClick: a[11] || (a[11] = (u) => e.timeHoursEvent(2, u)),
key: n
}, v(t), 1))), 128))
])
]),
l("div", Gl, [
l("button", {
onClick: a[12] || (a[12] = (...t) => e.confirmTimeBtn && e.confirmTimeBtn(...t)),
class: "timeBtnConfirm",
type: "`button`",
name: "button",
style: g({ backgroundColor: e.themStyle.titleColor })
}, "\u786E\u5B9A", 4)
])
], 512), [
[q, e.timerhms]
])
])
], 512), [
[q, e.isVisibale]
])
])
], 4);
}
const ae = /* @__PURE__ */ A(Il, [["render", Jl], ["__scopeId", "data-v-eda11fe9"]]);
ae.install = function(e) {
e.component(ae.name, ae);
};
const Ql = {
IHB_Alert: G,
IHB_Button: J,
IHB_Modal: te,
IHB_FileUpload: le,
IHB_DateTime: ae
}, pe = function(e) {
Object.values(Ql).forEach((a) => {
e.component(a.name, a);
});
};
typeof window < "u" && window.Vue && pe(window.Vue);
const ta = { install: pe };
export {
G as IHB_Alert,
J as IHB_Button,
ae as IHB_DateTime,
le as IHB_FileUpload,
te as IHB_Modal,
ta as default
};