message.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. var h = (T, r, d) => new Promise((R, _) => {
  2. var $ = (s) => {
  3. try {
  4. p(d.next(s));
  5. } catch (w) {
  6. _(w);
  7. }
  8. }, e = (s) => {
  9. try {
  10. p(d.throw(s));
  11. } catch (w) {
  12. _(w);
  13. }
  14. }, p = (s) => s.done ? R(s.value) : Promise.resolve(s.value).then($, e);
  15. p((d = d.apply(T, r)).next());
  16. });
  17. 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 A } from "vue";
  18. import { I as S, dD as F, dE as G, dF as H, dG as L, dH as O, dA as q, dB as x, ai as b } from "./index2.js";
  19. import { T as z, _ as J } from "./index11.js";
  20. import { R as Q } from "./dayjs.js";
  21. const W = ["onClick"], X = !1, oe = {
  22. __name: "message",
  23. setup(T) {
  24. const r = D(null), d = D(0), R = D(0), _ = D(0), $ = D(0), e = N({
  25. activeKey: "1",
  26. searchValue: "",
  27. startRange: [],
  28. beginDate: "",
  29. endDate: "",
  30. completeRange: [],
  31. completeBeginDate: "",
  32. completeEndDate: "",
  33. contentTitle: ""
  34. }), p = D([]), s = [
  35. {
  36. title: window.$l("标题"),
  37. dataIndex: "contentTitle",
  38. ellipsis: !0,
  39. template: !0
  40. },
  41. {
  42. title: window.$l("接收日期"),
  43. dataIndex: "createDate",
  44. ellipsis: !0,
  45. width: "10%",
  46. template: !1
  47. }
  48. ], w = [
  49. {
  50. title: window.$l("标题"),
  51. dataIndex: "contentTitle",
  52. ellipsis: !0,
  53. template: !0
  54. },
  55. {
  56. title: window.$l("接收日期"),
  57. dataIndex: "createDate",
  58. ellipsis: !0,
  59. width: "10%"
  60. },
  61. {
  62. title: window.$l("完成日期"),
  63. dataIndex: "finishedTime",
  64. ellipsis: !0,
  65. width: "10%",
  66. template: !1
  67. }
  68. ], U = () => r.value.reload(), I = (t) => {
  69. t === "1" || t === "2" ? (e.completeRange = [], e.completeBeginDate = "", e.completeEndDate = "", p.value = s) : p.value = w, U();
  70. }, E = () => h(this, null, function* () {
  71. const t = yield F();
  72. d.value = t.toDealCount || 0, R.value = t.toReadCount || 0, _.value = t.isDealCount || 0, $.value = t.isReadCount || 0;
  73. }), M = (t = {}) => e.activeKey === "1" ? G(e, t) : e.activeKey === "2" ? H(e, t) : e.activeKey === "3" ? L(e, t) : O(e, t), C = () => {
  74. 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();
  75. }, B = () => {
  76. e.activeKey = "1", e.searchValue = "", e.startRange = [], e.endDate = "", e.beginDate = "", e.completeRange = [], e.completeBeginDate = "", e.completeEndDate = "", r.value.reload();
  77. }, V = (t = {}) => {
  78. if (e.activeKey === "2" && q([t.id]), t.clientId === "flow") {
  79. const a = {
  80. client_id: `${window.$utils.env.VITE_APP_CLIENT_ID}`,
  81. scope: "snsapi_base"
  82. };
  83. x(a).then((g) => {
  84. const v = g && typeof g == "object" ? g.data : g;
  85. if (!v) {
  86. location.reload();
  87. return;
  88. }
  89. const m = `code=${v}`, f = a.state ? `&state=${a.state}` : "";
  90. let l = "";
  91. 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("?")) {
  92. let c = `${m}${f}`;
  93. c && (c = `&${m}${f}`), window.open(l + c);
  94. } else {
  95. let c = `${m}${f}`;
  96. c && (c = `?${m}${f}`), window.open(l + c);
  97. }
  98. });
  99. } else {
  100. let a = "";
  101. 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);
  102. }
  103. };
  104. return j(() => {
  105. E(), p.value = s;
  106. }), (t, a) => {
  107. const g = S, v = K("s-filter-item"), m = Q, f = K("s-filter-wrap"), l = J, c = z, P = K("s-list-layout");
  108. return Y(), k(P, {
  109. ref_key: "layout",
  110. ref: r,
  111. buttons: [],
  112. onReset: B,
  113. columns: p.value,
  114. loadData: M,
  115. isSelection: X,
  116. title: t.$l("我的消息")
  117. }, {
  118. filter: n(() => [
  119. o(f, null, {
  120. default: n(() => [
  121. o(v, {
  122. label: t.$l("关键字")
  123. }, {
  124. default: n(() => [
  125. o(g, {
  126. value: e.searchValue,
  127. "onUpdate:value": a[0] || (a[0] = (i) => e.searchValue = i),
  128. style: { width: "200px" },
  129. placeholder: t.$l("请输入关键字"),
  130. onPressEnter: C
  131. }, null, 8, ["value", "placeholder"])
  132. ]),
  133. _: 1
  134. }, 8, ["label"]),
  135. o(v, {
  136. label: t.$l("接收日期")
  137. }, {
  138. default: n(() => [
  139. o(m, {
  140. value: e.startRange,
  141. "onUpdate:value": a[1] || (a[1] = (i) => e.startRange = i),
  142. onChange: C
  143. }, null, 8, ["value"])
  144. ]),
  145. _: 1
  146. }, 8, ["label"]),
  147. e.activeKey === "3" || e.activeKey === "4" ? (Y(), k(v, {
  148. key: 0,
  149. label: t.$l("完成日期")
  150. }, {
  151. default: n(() => [
  152. o(m, {
  153. value: e.completeRange,
  154. "onUpdate:value": a[2] || (a[2] = (i) => e.completeRange = i),
  155. onChange: C
  156. }, null, 8, ["value"])
  157. ]),
  158. _: 1
  159. }, 8, ["label"])) : A("", !0)
  160. ]),
  161. _: 1
  162. })
  163. ]),
  164. contentTitle: n(({ record: i }) => [
  165. y("div", null, [
  166. y("a", {
  167. href: "javascript:void(0)",
  168. onClick: (Z) => V(i)
  169. }, u(i.contentTitle), 9, W)
  170. ])
  171. ]),
  172. tabs: n(() => [
  173. o(c, {
  174. activeKey: e.activeKey,
  175. "onUpdate:activeKey": a[3] || (a[3] = (i) => e.activeKey = i),
  176. onChange: I
  177. }, {
  178. default: n(() => [
  179. o(l, { key: "1" }, {
  180. tab: n(() => [
  181. y("span", null, u(t.$l("待处理")) + "(" + u(d.value) + ")", 1)
  182. ]),
  183. _: 1
  184. }),
  185. o(l, { key: "2" }, {
  186. tab: n(() => [
  187. y("span", null, u(t.$l("待阅读")) + "(" + u(R.value) + ")", 1)
  188. ]),
  189. _: 1
  190. }),
  191. o(l, { key: "3" }, {
  192. tab: n(() => [
  193. y("span", null, u(t.$l("已处理")) + "(" + u(_.value) + ")", 1)
  194. ]),
  195. _: 1
  196. }),
  197. o(l, { key: "4" }, {
  198. tab: n(() => [
  199. y("span", null, u(t.$l("已阅读")) + "(" + u($.value) + ")", 1)
  200. ]),
  201. _: 1
  202. })
  203. ]),
  204. _: 1
  205. }, 8, ["activeKey"])
  206. ]),
  207. _: 1
  208. }, 8, ["columns", "title"]);
  209. };
  210. }
  211. };
  212. export {
  213. oe as default
  214. };