var h = (T, r, d) => new Promise((R, _) => { var $ = (s) => { try { p(d.next(s)); } catch (w) { _(w); } }, e = (s) => { try { p(d.throw(s)); } catch (w) { _(w); } }, p = (s) => s.done ? R(s.value) : Promise.resolve(s.value).then($, e); p((d = d.apply(T, r)).next()); }); import { ref as D, reactive as N, onMounted as j, resolveComponent as K, openBlock as Y, createBlock as k, withCtx as n, createVNode as o, createElementVNode as y, toDisplayString as u, createCommentVNode as S } from "vue"; import { I as A, dE as F, dF as G, dG as H, dH as L, dI as O, dB as q, dC as x, ai as b } from "./index2.js"; import { T as z, _ as J } from "./index11.js"; import { R as Q } from "./dayjs.js"; const W = ["onClick"], X = !1, oe = { __name: "message", setup(T) { const r = D(null), d = D(0), R = D(0), _ = D(0), $ = D(0), e = N({ activeKey: "1", searchValue: "", startRange: [], beginDate: "", endDate: "", completeRange: [], completeBeginDate: "", completeEndDate: "", contentTitle: "" }), p = D([]), s = [ { title: window.$l("标题"), dataIndex: "contentTitle", ellipsis: !0, template: !0 }, { title: window.$l("接收日期"), dataIndex: "createDate", ellipsis: !0, width: "10%", template: !1 } ], w = [ { title: window.$l("标题"), dataIndex: "contentTitle", ellipsis: !0, template: !0 }, { title: window.$l("接收日期"), dataIndex: "createDate", ellipsis: !0, width: "10%" }, { title: window.$l("完成日期"), dataIndex: "finishedTime", ellipsis: !0, width: "10%", template: !1 } ], U = () => r.value.reload(), I = (t) => { t === "1" || t === "2" ? (e.completeRange = [], e.completeBeginDate = "", e.completeEndDate = "", p.value = s) : p.value = w, U(); }, E = () => h(this, null, function* () { try { const t = yield F(); d.value = t.toDealCount || 0, R.value = t.toReadCount || 0, _.value = t.isDealCount || 0, $.value = t.isReadCount || 0; } catch (t) { console.warn("[message] 消息数量获取失败:", t); } }), M = (t = {}) => e.activeKey === "1" ? G(e, t) : e.activeKey === "2" ? H(e, t) : e.activeKey === "3" ? L(e, t) : O(e, t), C = () => { e.startRange.length > 0 ? (e.beginDate = b(e.startRange[0]).format("YYYY-MM-DD 00:00:00"), e.endDate = b(e.startRange[1]).format("YYYY-MM-DD 23:59:59")) : (e.beginDate = "", e.endDate = ""), e.completeRange.length > 0 ? (e.completeBeginDate = b(e.completeRange[0]).format("YYYY-MM-DD 00:00:00"), e.completeEndDate = b(e.completeRange[1]).format("YYYY-MM-DD 23:59:59")) : (e.completeBeginDate = "", e.completeEndDate = ""), r.value.reload(); }, B = () => { e.activeKey = "1", e.searchValue = "", e.startRange = [], e.endDate = "", e.beginDate = "", e.completeRange = [], e.completeBeginDate = "", e.completeEndDate = "", r.value.reload(); }, V = (t = {}) => { if (e.activeKey === "2" && q([t.id]), t.clientId === "flow") { const a = { client_id: `${window.$utils.env.VITE_APP_CLIENT_ID}`, scope: "snsapi_base" }; x(a).then((g) => { const v = g && typeof g == "object" ? g.data : g; if (!v) { location.reload(); return; } const m = `code=${v}`, f = a.state ? `&state=${a.state}` : ""; let l = ""; if (t.messageTypeCode === "toDeal" && e.activeKey === "1" ? l = t.toDealUrl : t.messageTypeCode === "toRead" && e.activeKey === "2" ? l = t.toReadUrl : (t.messageTypeCode === "Deal" && e.activeKey, l = t.browseUrl), l && l.includes("?")) { let c = `${m}${f}`; c && (c = `&${m}${f}`), window.open(l + c); } else { let c = `${m}${f}`; c && (c = `?${m}${f}`), window.open(l + c); } }); } else { let a = ""; t.messageTypeCode === "toDeal" && e.activeKey === "1" ? a = t.toDealUrl : t.messageTypeCode === "toRead" && e.activeKey === "2" ? a = t.toReadUrl : (t.messageTypeCode === "Deal" && e.activeKey, a = t.browseUrl), window.open(a); } }; return j(() => { E(), p.value = s; }), (t, a) => { const g = A, v = K("s-filter-item"), m = Q, f = K("s-filter-wrap"), l = J, c = z, P = K("s-list-layout"); return Y(), k(P, { ref_key: "layout", ref: r, buttons: [], onReset: B, columns: p.value, loadData: M, isSelection: X, title: t.$l("我的消息") }, { filter: n(() => [ o(f, null, { default: n(() => [ o(v, { label: t.$l("关键字") }, { default: n(() => [ o(g, { value: e.searchValue, "onUpdate:value": a[0] || (a[0] = (i) => e.searchValue = i), style: { width: "200px" }, placeholder: t.$l("请输入关键字"), onPressEnter: C }, null, 8, ["value", "placeholder"]) ]), _: 1 }, 8, ["label"]), o(v, { label: t.$l("接收日期") }, { default: n(() => [ o(m, { value: e.startRange, "onUpdate:value": a[1] || (a[1] = (i) => e.startRange = i), onChange: C }, null, 8, ["value"]) ]), _: 1 }, 8, ["label"]), e.activeKey === "3" || e.activeKey === "4" ? (Y(), k(v, { key: 0, label: t.$l("完成日期") }, { default: n(() => [ o(m, { value: e.completeRange, "onUpdate:value": a[2] || (a[2] = (i) => e.completeRange = i), onChange: C }, null, 8, ["value"]) ]), _: 1 }, 8, ["label"])) : S("", !0) ]), _: 1 }) ]), contentTitle: n(({ record: i }) => [ y("div", null, [ y("a", { href: "javascript:void(0)", onClick: (Z) => V(i) }, u(i.contentTitle), 9, W) ]) ]), tabs: n(() => [ o(c, { activeKey: e.activeKey, "onUpdate:activeKey": a[3] || (a[3] = (i) => e.activeKey = i), onChange: I }, { default: n(() => [ o(l, { key: "1" }, { tab: n(() => [ y("span", null, u(t.$l("待处理")) + "(" + u(d.value) + ")", 1) ]), _: 1 }), o(l, { key: "2" }, { tab: n(() => [ y("span", null, u(t.$l("待阅读")) + "(" + u(R.value) + ")", 1) ]), _: 1 }), o(l, { key: "3" }, { tab: n(() => [ y("span", null, u(t.$l("已处理")) + "(" + u(_.value) + ")", 1) ]), _: 1 }), o(l, { key: "4" }, { tab: n(() => [ y("span", null, u(t.$l("已阅读")) + "(" + u($.value) + ")", 1) ]), _: 1 }) ]), _: 1 }, 8, ["activeKey"]) ]), _: 1 }, 8, ["columns", "title"]); }; } }; export { oe as default };