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