quick-admin-vue3-core
Version:
以快(计算机执行效率、开发效率)为核心的后台管理系统开发模板
44 lines (43 loc) • 1.39 kB
JavaScript
import { defineComponent as u, createElementBlock as f, openBlock as l, normalizeClass as p } from "vue";
import { D as m } from "./platform-DsTwHxm6.js";
import { _ as d } from "./_plugin-vue_export-helper-CHgC5LLL.js";
function _(r) {
const t = m(r).diff() / 1e3, o = Math.floor(t / (60 * 60 * 24)), s = Math.floor(t % (60 * 60 * 24) / (60 * 60)), e = Math.floor(t % (60 * 60) / 60), n = `${o > 0 ? o + "天" : ""}${s > 0 ? s + "小时" : ""}${e > 0 ? e + "分钟" : ""}`, a = o >= 1 ? "success" : "danger";
return { text: n, type: a };
}
const y = /* @__PURE__ */ u({
__name: "UserItem",
props: {
data: {},
active: { type: Boolean },
userDataKey: { default: "user_data" },
isSearchResult: { type: Boolean }
},
setup(r) {
const t = r;
o();
function o() {
return t.isSearchResult ? { type: "", text: "" } : s(t.data);
}
function s(e) {
const { status: n, endTime: a } = e;
if (n === 0) {
const { text: c, type: i } = _(a);
return {
text: "好友:" + c,
type: i
};
} else
return {
text: "失效会话",
type: "info"
};
}
return (e, n) => (l(), f("div", {
class: p(["user-item f-sb-s", { active: e.active }])
}, null, 2));
}
}), g = /* @__PURE__ */ d(y, [["__scopeId", "data-v-b49e8942"]]);
export {
g as default
};