| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- var k = (T, m, d) => new Promise((b, _) => {
- var R = (s) => {
- try {
- p(d.next(s));
- } catch (w) {
- _(w);
- }
- }, e = (s) => {
- try {
- p(d.throw(s));
- } catch (w) {
- _(w);
- }
- }, p = (s) => s.done ? b(s.value) : Promise.resolve(s.value).then(R, e);
- p((d = d.apply(T, m)).next());
- });
- import { ref as D, reactive as N, onMounted as S, onUnmounted as A, resolveComponent as K, openBlock as M, createBlock as I, withCtx as n, createVNode as o, createElementVNode as y, toDisplayString as u, createCommentVNode as O } from "vue";
- import { e2 as L, I as q, ed as x, ee as z, ef as F, eg as G, eh as H, e6 as J, e7 as Q, ai as $ } from "./index2.js";
- import { T as W, _ as X } from "./index12.js";
- import { R as Z } from "./dayjs.js";
- const ee = ["onClick"], te = !1, ce = /* @__PURE__ */ Object.assign({ name: "MessageCenter" }, {
- __name: "message",
- setup(T) {
- const m = D(null), d = D(0), b = D(0), _ = D(0), R = 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
- }
- ], Y = () => m.value.reload(), E = (t) => {
- t === "1" || t === "2" ? (e.completeRange = [], e.completeBeginDate = "", e.completeEndDate = "", p.value = s) : p.value = w, Y();
- }, U = () => k(this, null, function* () {
- try {
- const t = yield x();
- d.value = t.toDealCount || 0, b.value = t.toReadCount || 0, _.value = t.isDealCount || 0, R.value = t.isReadCount || 0;
- } catch (t) {
- console.warn("[message] 消息数量获取失败:", t);
- }
- }), V = (t = {}) => e.activeKey === "1" ? z(e, t) : e.activeKey === "2" ? F(e, t) : e.activeKey === "3" ? G(e, t) : H(e, t), h = () => {
- e.startRange.length > 0 ? (e.beginDate = $(e.startRange[0]).format("YYYY-MM-DD 00:00:00"), e.endDate = $(e.startRange[1]).format("YYYY-MM-DD 23:59:59")) : (e.beginDate = "", e.endDate = ""), e.completeRange.length > 0 ? (e.completeBeginDate = $(e.completeRange[0]).format("YYYY-MM-DD 00:00:00"), e.completeEndDate = $(e.completeRange[1]).format("YYYY-MM-DD 23:59:59")) : (e.completeBeginDate = "", e.completeEndDate = ""), m.value.reload();
- }, B = () => {
- e.activeKey = "1", e.searchValue = "", e.startRange = [], e.endDate = "", e.beginDate = "", e.completeRange = [], e.completeBeginDate = "", e.completeEndDate = "", m.value.reload();
- }, P = (t = {}) => {
- if (e.activeKey === "2" && J([t.id]), t.clientId === "flow") {
- const a = {
- client_id: `${window.$utils.env.VITE_APP_CLIENT_ID}`,
- scope: "snsapi_base"
- };
- Q(a).then((g) => {
- const f = g && typeof g == "object" ? g.data : g;
- if (!f) {
- location.reload();
- return;
- }
- const r = `code=${f}`, v = 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 = `${r}${v}`;
- c && (c = `&${r}${v}`), window.open(l + c);
- } else {
- let c = `${r}${v}`;
- c && (c = `?${r}${v}`), 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);
- }
- };
- let C = null;
- return S(() => {
- U(), p.value = s, C = L(() => {
- U(), Y();
- });
- }), A(() => {
- C && C(), C = null;
- }), (t, a) => {
- const g = q, f = K("s-filter-item"), r = Z, v = K("s-filter-wrap"), l = X, c = W, j = K("s-list-layout");
- return M(), I(j, {
- ref_key: "layout",
- ref: m,
- buttons: [],
- onReset: B,
- columns: p.value,
- loadData: V,
- isSelection: te,
- title: t.$l("我的消息")
- }, {
- filter: n(() => [
- o(v, null, {
- default: n(() => [
- o(f, {
- 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: h
- }, null, 8, ["value", "placeholder"])
- ]),
- _: 1
- }, 8, ["label"]),
- o(f, {
- label: t.$l("接收日期")
- }, {
- default: n(() => [
- o(r, {
- value: e.startRange,
- "onUpdate:value": a[1] || (a[1] = (i) => e.startRange = i),
- onChange: h
- }, null, 8, ["value"])
- ]),
- _: 1
- }, 8, ["label"]),
- e.activeKey === "3" || e.activeKey === "4" ? (M(), I(f, {
- key: 0,
- label: t.$l("完成日期")
- }, {
- default: n(() => [
- o(r, {
- value: e.completeRange,
- "onUpdate:value": a[2] || (a[2] = (i) => e.completeRange = i),
- onChange: h
- }, null, 8, ["value"])
- ]),
- _: 1
- }, 8, ["label"])) : O("", !0)
- ]),
- _: 1
- })
- ]),
- contentTitle: n(({ record: i }) => [
- y("div", null, [
- y("a", {
- href: "javascript:void(0)",
- onClick: (ae) => P(i)
- }, u(i.contentTitle), 9, ee)
- ])
- ]),
- tabs: n(() => [
- o(c, {
- activeKey: e.activeKey,
- "onUpdate:activeKey": a[3] || (a[3] = (i) => e.activeKey = i),
- onChange: E
- }, {
- 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(b.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(R.value) + ")", 1)
- ]),
- _: 1
- })
- ]),
- _: 1
- }, 8, ["activeKey"])
- ]),
- _: 1
- }, 8, ["columns", "title"]);
- };
- }
- });
- export {
- ce as default
- };
|