index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. <template>
  2. <!-- notifyShowAll -->
  3. <div class="notify-showall-window">
  4. <div
  5. class="v-layout sds-notify-showall-dialog layout-window-app v-window"
  6. :class="notifyShowAllContant.cls"
  7. style="position: absolute; left: 10px"
  8. :style="{
  9. display: notifyShowAllContant.display,
  10. width: width,
  11. height: height,
  12. top: top,
  13. zIndex: notifyShowAllContant.zIndex,
  14. }"
  15. @click.stop="clickNotifyShowall"
  16. >
  17. <div class="v-window-header-wrapper draggable">
  18. <div class="app-icon"></div>
  19. <div class="v-window-header-text">
  20. <div class="v-window-header-title">消息</div>
  21. </div>
  22. <div class="window-header-tool-wrapper light">
  23. <div
  24. class="tool maximize"
  25. @click.stop="maxWindow"
  26. v-if="!windowIsMax"
  27. ></div>
  28. <div class="tool restore" @click.stop="minWindow" v-else></div>
  29. <div class="tool close" @click.stop="closeNotifyShowall"></div>
  30. </div>
  31. </div>
  32. <div class="v-window-body">
  33. <div class="v-trap-focus-indicator"></div>
  34. <div class="v-trap-focus-body">
  35. <div class="v-trap-focus-indicator"></div>
  36. <div
  37. class="v-layout show-all-panel layout-panel-content v-panel"
  38. style="--svc-layout-height: 100%"
  39. >
  40. <div class="v-spin-wrapper circle v-panel-wrapper">
  41. <div class="v-spin-wrapper-masking" style="display: none"></div>
  42. <div
  43. class="v-layout layout-body-wrapper layout-panel-body"
  44. style="
  45. --panel-in-tabs-padding-top: 8px;
  46. --svc-layout-padding: 16px 20px 6px 20px;
  47. --svc-layout-margin: 0 0 0 0;
  48. "
  49. >
  50. <div class="v-toolbar tbar-wrapper default-tbar">
  51. <button
  52. type="button"
  53. class="v-btn v-btn-grey"
  54. @click.stop="reload"
  55. >
  56. <span> 刷新 </span>
  57. </button>
  58. <button
  59. type="button"
  60. class="v-btn v-btn-grey"
  61. @click.stop="showClearAllNotifyMessage"
  62. >
  63. <span> 清除全部 </span>
  64. </button>
  65. <button type="button" class="v-btn v-btn-grey v-btn-disabled">
  66. <span> 查看 </span>
  67. </button>
  68. <button
  69. type="button"
  70. class="i-filter v-btn v-btn-grey v-btn-dropdown"
  71. >
  72. <div class="v-btn-dropdown-btn"></div>
  73. </button>
  74. <div class="right-wrapper"></div>
  75. </div>
  76. <div class="body-wrapper">
  77. <div class="all-notification-table-wrapper">
  78. <div
  79. class="
  80. all-notification-table
  81. v-spin-wrapper
  82. circle
  83. v-table-wrapper
  84. "
  85. >
  86. <div
  87. class="v-spin-wrapper-masking"
  88. :style="{ display: maskDisplay }"
  89. ></div>
  90. <div class="v-table">
  91. <div class="v-table-header">
  92. <table>
  93. <colgroup>
  94. <col
  95. name="51d8198d-fd9d-4986-9532-b8a0a3962c1f"
  96. width="100"
  97. />
  98. <col
  99. name="5b742784-0a51-436e-89d0-1a0b2f31fed0"
  100. width="160"
  101. />
  102. <col
  103. name="e034d4a6-59d9-4fda-b9d6-e7cbd2293991"
  104. width="380"
  105. />
  106. <col
  107. name="3b0b169b-2410-4f64-b3f9-790f94f9c6db"
  108. width="160"
  109. />
  110. </colgroup>
  111. <thead class="v-table-thead">
  112. <tr class="row">
  113. <th
  114. colspan="1"
  115. rowspan="1"
  116. class="cell-first"
  117. :class="thContant.cls"
  118. v-for="(
  119. thContant, thContantIndex
  120. ) in thContantArray"
  121. :key="thContant.id"
  122. @click.stop="sort(thContantIndex)"
  123. >
  124. <div class="inner-cell">
  125. <div class="head-cell cell">
  126. <span class="cell-title">{{
  127. thContant.text
  128. }}</span>
  129. <span
  130. class="v-table-column-sorter"
  131. :class="thContant.cls1"
  132. ></span>
  133. </div>
  134. </div>
  135. </th>
  136. <!-- <th
  137. colspan="1"
  138. rowspan="1"
  139. class=""
  140. @click.stop="sort"
  141. >
  142. <div class="inner-cell">
  143. <div class="head-cell cell">
  144. <span class="cell-title">类别</span>
  145. <span
  146. class="v-table-column-sorter down"
  147. ></span>
  148. </div>
  149. </div>
  150. </th>
  151. <th
  152. colspan="1"
  153. rowspan="1"
  154. class=""
  155. @click.stop="sort"
  156. >
  157. <div class="inner-cell">
  158. <div class="head-cell cell">
  159. <span class="cell-title">主题</span>
  160. <span
  161. class="v-table-column-sorter down"
  162. ></span>
  163. </div>
  164. </div>
  165. </th>
  166. <th
  167. colspan="1"
  168. rowspan="1"
  169. class="last-th-cell"
  170. @click.stop="sort"
  171. >
  172. <div class="inner-cell">
  173. <div class="head-cell cell">
  174. <span class="cell-title">时间</span>
  175. <span
  176. class="v-table-column-sorter down"
  177. ></span>
  178. </div>
  179. </div>
  180. </th> -->
  181. </tr>
  182. </thead>
  183. </table>
  184. <div class="hd-menu-btn-wrapper"></div>
  185. </div>
  186. <div class="v-ps ps">
  187. <div class="v-table-content">
  188. <div class="v-table-body">
  189. <table>
  190. <colgroup>
  191. <col width="100" />
  192. <col width="160" />
  193. <col width="380" />
  194. <col width="160" />
  195. </colgroup>
  196. <tbody class="v-table-tbody">
  197. <tr
  198. class="row"
  199. @click.stop="clickTr(detailMessageIndex)"
  200. @mouseenter="
  201. mouseenterTr(detailMessageIndex)
  202. "
  203. @mouseleave="
  204. mouseleaveTr(detailMessageIndex)
  205. "
  206. v-for="(
  207. detailMessage, detailMessageIndex
  208. ) in notifyShowallDetail.detailMessageList"
  209. :key="detailMessage.id"
  210. :class="detailMessage.cls1"
  211. >
  212. <td class="cell-first">
  213. <div class="inner-cell">
  214. <div class="cell content-cell">
  215. <div class="level-info">信息</div>
  216. </div>
  217. </div>
  218. </td>
  219. <td class="">
  220. <div class="inner-cell">
  221. <div class="cell content-cell">
  222. <div>{{ detailMessage.title }}</div>
  223. </div>
  224. </div>
  225. </td>
  226. <td class="">
  227. <div class="inner-cell">
  228. <div class="cell content-cell">
  229. <div>
  230. {{ detailMessage.showMessage }}
  231. </div>
  232. </div>
  233. </div>
  234. </td>
  235. <td class="last-td-cell">
  236. <div class="inner-cell">
  237. <div class="cell content-cell">
  238. <div>{{ detailMessage.time1 }}</div>
  239. </div>
  240. </div>
  241. </td>
  242. </tr>
  243. </tbody>
  244. </table>
  245. </div>
  246. </div>
  247. <div
  248. class="ps__rail-x"
  249. style="left: 0px; bottom: 0px"
  250. >
  251. <div
  252. class="ps__thumb-x"
  253. style="left: 0px; width: 0px"
  254. ></div>
  255. </div>
  256. <div class="ps__rail-y" style="top: 0px; right: 0px">
  257. <div
  258. class="ps__thumb-y"
  259. style="top: 0px; height: 0px"
  260. ></div>
  261. </div>
  262. </div>
  263. <div
  264. class="
  265. col-resizable-indicator
  266. col-resizable-indicator--hidden
  267. "
  268. ></div>
  269. <div
  270. class="
  271. col-resizable-indicator
  272. col-resizable-indicator--hidden
  273. "
  274. ></div>
  275. <div
  276. class="
  277. col-resizable-indicator
  278. col-resizable-indicator--hidden
  279. "
  280. ></div>
  281. </div>
  282. <div class="v-pagination">
  283. <div class="v-pagination-left">
  284. <ul class="left-paging">
  285. <li class="v-pagination-first disabled"></li>
  286. <li class="v-pagination-prev disabled"></li>
  287. <li
  288. class="
  289. v-pagination-item
  290. v-pagination-item-1
  291. v-pagination-item-active
  292. "
  293. v-if="
  294. notifyShowallDetail.detailMessageList.length
  295. "
  296. >
  297. 1
  298. </li>
  299. <li class="v-pagination-next disabled"></li>
  300. <li class="v-pagination-last disabled"></li>
  301. </ul>
  302. </div>
  303. <div class="v-pagination-right">
  304. <div class="v-pagination-total">
  305. {{ notifyShowallDetail.detailMessageList.length }}
  306. 个项目
  307. </div>
  308. <div
  309. class="v-pagination-refresh"
  310. @click.stop="reload"
  311. ></div>
  312. </div>
  313. </div>
  314. <div
  315. class="v-spin"
  316. :style="{ display: loading ? 'block' : 'none' }"
  317. >
  318. <div class="v-spin-text has-icon">加载中...</div>
  319. <div class="v-spin-icon">
  320. <i>
  321. <i></i>
  322. </i>
  323. </div>
  324. </div>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. <div
  330. class="
  331. v-layout
  332. layout-panel-fbar
  333. fbar-wrapper fbar-wrapper--fluid
  334. "
  335. >
  336. <div class="pull-right">
  337. <button
  338. type="button"
  339. class="v-btn v-btn-footbar v-btn-grey"
  340. @click.stop="closeNotifyShowall"
  341. >
  342. <span> 关闭 </span>
  343. </button>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </div>
  349. <div class="v-trap-focus-indicator"></div>
  350. </div>
  351. <div class="v-window-resizable">
  352. <div class="handler v-window-resizable-nw"></div>
  353. <div class="handler v-window-resizable-ne"></div>
  354. <div class="handler v-window-resizable-sw"></div>
  355. <div class="handler v-window-resizable-se"></div>
  356. <div class="handler v-window-resizable-n"></div>
  357. <div class="handler v-window-resizable-s"></div>
  358. <div class="handler v-window-resizable-w"></div>
  359. <div class="handler v-window-resizable-e"></div>
  360. </div>
  361. <div
  362. class="v-window-mask"
  363. :style="{ display: clearAllNotifyMessage.clearAllNotifyMessageDisplay}"
  364. @click.stop="WindowClick()"
  365. ></div>
  366. </div>
  367. <div
  368. class="v-window v-message-box-window auto-height"
  369. syno-id="SYNO.SDS.DSMNotify.ShowAll.Window-msgbox"
  370. style="
  371. position: absolute;
  372. width: 480px;
  373. height: auto;
  374. top: 180px;
  375. left: 190px;
  376. "
  377. :style="{
  378. display: clearAllNotifyMessage.clearAllNotifyMessageDisplay,
  379. zIndex: clearAllNotifyMessage.clearAllNotifyMessageZIndex,
  380. }"
  381. :class="clearAllNotifyMessage.clearAllNotifyMessageCls"
  382. @click.stop="clickClearAllNotifyMessage"
  383. >
  384. <div>
  385. <div class="v-trap-focus-indicator"></div>
  386. <div class="v-trap-focus-body">
  387. <div class="v-trap-focus-indicator"></div>
  388. <div class="v-layout layout-panel-content v-panel message-box">
  389. <div class="v-spin-wrapper circle v-panel-wrapper">
  390. <div class="v-spin-wrapper-masking" style="display: none"></div>
  391. <div
  392. class="v-layout layout-body-wrapper layout-panel-body"
  393. style="--panel-in-tabs-padding-top: 0"
  394. >
  395. <div class="body-wrapper">
  396. <div class="message-box-body has-icon">
  397. <div class="dialog-icon-wrapper alarm">
  398. <div class="dialog-icon alarm"></div>
  399. </div>
  400. <div class="dialog-content">
  401. 所有桌面通知都会被清除。是否确定要继续?
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. <div
  407. class="
  408. v-layout
  409. layout-panel-fbar
  410. fbar-wrapper fbar-wrapper--fluid
  411. "
  412. >
  413. <div class="v-status-bar loading" style="display: none">
  414. <div class="status-text">
  415. <div class="v-spin-icon">
  416. <i><i></i></i>
  417. </div>
  418. 加载中...
  419. </div>
  420. </div>
  421. <div class="default pull-right">
  422. <button
  423. type="button"
  424. class="v-btn v-btn-footbar v-btn-cancel"
  425. @click.stop="cancelDeleteAllNotifyMessage"
  426. >
  427. <span>取消</span>
  428. </button>
  429. <button
  430. type="button"
  431. class="v-btn v-btn-footbar v-btn-red"
  432. @click.stop="confirmDeleteAllNotifyMessage"
  433. >
  434. <span>删除</span>
  435. </button>
  436. </div>
  437. </div>
  438. </div>
  439. </div>
  440. </div>
  441. <div class="v-trap-focus-indicator"></div>
  442. </div>
  443. </div>
  444. </div>
  445. </template>
  446. <script>
  447. export default {
  448. props: ["defaultZIndex", "notifyShowAllData"],
  449. data() {
  450. return {
  451. notifyShowAllContant: {
  452. display: "none",
  453. zIndex: 9050,
  454. cls: "active-win",
  455. },
  456. loading: false,
  457. maskDisplay: "none",
  458. width: "840px",
  459. height: "480px",
  460. top: "10px",
  461. clearAllNotifyMessage: {
  462. clearAllNotifyMessageDisplay: "none",
  463. clearAllNotifyMessageCls: "",
  464. clearAllNotifyMessageZIndex: 905,
  465. },
  466. thContantArray: [
  467. {
  468. id: 0,
  469. text: "层级",
  470. cls: "",
  471. cls1: "down",
  472. },
  473. {
  474. id: 1,
  475. text: "类别",
  476. cls: "",
  477. cls1: "down",
  478. },
  479. {
  480. id: 1,
  481. text: "主题",
  482. cls: "",
  483. cls1: "down",
  484. },
  485. {
  486. id: 1,
  487. text: "时间",
  488. cls: "",
  489. cls1: "down",
  490. },
  491. ],
  492. notifyShowallDetail: {
  493. detailMessageList: [],
  494. },
  495. windowIsMax: false,
  496. };
  497. },
  498. mounted() {
  499. this.$bus.on("openNotifyShowall", this.openNotifyShowall);
  500. this.$bus.on("closeNotifyShowall", this.closeNotifyShowall);
  501. this.notifyShowAllContant = this.notifyShowAllData;
  502. },
  503. methods: {
  504. // 打开本页面
  505. openNotifyShowall(detailMessageList) {
  506. this.maskDisplay = "block";
  507. this.loading = true;
  508. this.notifyShowAllContant.display = "block";
  509. setTimeout(() => {
  510. this.maskDisplay = "none";
  511. this.loading = false;
  512. let detailMessageList1 = JSON.parse(JSON.stringify(detailMessageList));
  513. detailMessageList1.forEach((item) => {
  514. item.cls1 = "";
  515. });
  516. this.notifyShowallDetail.detailMessageList = detailMessageList1;
  517. this.clickNotifyShowall();
  518. }, 1000);
  519. },
  520. // 关闭本页面
  521. closeNotifyShowall() {
  522. this.notifyShowAllContant.display = "none";
  523. this.notifyShowAllContant.zIndex = this.defaultZIndex - 10;
  524. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex - 10);
  525. },
  526. // 点击本页面
  527. clickNotifyShowall() {
  528. if (this.notifyShowAllContant.cls === "deactive-win") {
  529. this.notifyShowAllContant.zIndex = this.defaultZIndex + 10;
  530. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex + 10);
  531. }
  532. },
  533. // 重新加载数据
  534. reload() {
  535. this.maskDisplay = "block";
  536. this.loading = true;
  537. setTimeout(() => {
  538. this.maskDisplay = "none";
  539. this.loading = false;
  540. }, 1000);
  541. },
  542. // 点击每一行
  543. clickTr(detailMessageIndex) {
  544. this.notifyShowallDetail.detailMessageList.forEach((item) => {
  545. item.cls1 = "";
  546. });
  547. this.notifyShowallDetail.detailMessageList[detailMessageIndex].cls1 =
  548. "row-selected";
  549. },
  550. // 鼠标移入表格每一行
  551. mouseenterTr(detailMessageIndex) {
  552. if (
  553. !this.notifyShowallDetail.detailMessageList[detailMessageIndex].cls1
  554. ) {
  555. this.notifyShowallDetail.detailMessageList[detailMessageIndex].cls1 =
  556. "row-hover";
  557. }
  558. },
  559. // 鼠标移出表格每一行
  560. mouseleaveTr(detailMessageIndex) {
  561. if (
  562. this.notifyShowallDetail.detailMessageList[
  563. detailMessageIndex
  564. ].cls1.includes("row-hover")
  565. ) {
  566. this.notifyShowallDetail.detailMessageList[detailMessageIndex].cls1 =
  567. "";
  568. }
  569. },
  570. // 排序
  571. sort(thContantIndex) {
  572. this.thContantArray.forEach((item) => {
  573. item.cls = "";
  574. });
  575. if (this.thContantArray[thContantIndex].cls === "") {
  576. this.thContantArray[thContantIndex].cls = "sorting";
  577. }
  578. if (this.thContantArray[thContantIndex].cls1 === "down") {
  579. this.thContantArray[thContantIndex].cls1 = "up";
  580. } else {
  581. this.thContantArray[thContantIndex].cls1 = "down";
  582. }
  583. this.maskDisplay = "block";
  584. this.loading = true;
  585. setTimeout(() => {
  586. this.maskDisplay = "none";
  587. this.loading = false;
  588. }, 1000);
  589. },
  590. // 页面最大化
  591. maxWindow() {
  592. this.top = "40px";
  593. this.width = "100%";
  594. this.height = "calc(100vh - 40px)";
  595. this.windowIsMax = true;
  596. },
  597. // 页面最小化
  598. minWindow() {
  599. this.top = "10px";
  600. this.width = "840px";
  601. this.height = "480px";
  602. this.windowIsMax = false;
  603. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex - 10);
  604. },
  605. // 显示清除全部信息弹出框
  606. showClearAllNotifyMessage() {
  607. console.log(111);
  608. // this.$bus.emit("clearAllNotifyMessage")
  609. this.clearAllNotifyMessage.clearAllNotifyMessageDisplay = "block";
  610. console.log(
  611. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex,
  612. this.defaultZIndex
  613. );
  614. if (
  615. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex <
  616. this.defaultZIndex
  617. ) {
  618. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex =
  619. this.defaultZIndex + 10;
  620. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex + 10);
  621. }
  622. this.$bus.emit("maskShowOrHidden", true);
  623. window.addEventListener("click", this.WindowClick, false);
  624. },
  625. // 点击清除全部信息弹出框
  626. clickClearAllNotifyMessage() {
  627. console.log(
  628. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex,
  629. this.defaultZIndex
  630. );
  631. if (
  632. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex <
  633. this.defaultZIndex
  634. ) {
  635. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex =
  636. this.defaultZIndex + 10;
  637. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex + 10);
  638. }
  639. this.$bus.emit("maskShowOrHidden", true);
  640. },
  641. // 没关闭清除全部信息弹出框时点击页面
  642. WindowClick() {
  643. let el = document.querySelector(
  644. ".notify-showall-window .v-message-box-window active-win"
  645. );
  646. window.removeEventListener("click", this.WindowClick, false);
  647. },
  648. // 取消删除
  649. cancelDeleteAllNotifyMessage(e) {
  650. e.stopPropagation();
  651. console.log("cancel");
  652. this.clearAllNotifyMessage.clearAllNotifyMessageDisplay = "none";
  653. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex = 9050;
  654. this.$bus.emit("changeDefaultZIndex", this.defaultZIndex - 10);
  655. this.$bus.emit("maskShowOrHidden", false);
  656. },
  657. // 确认删除
  658. confirmDeleteAllNotifyMessage(e) {
  659. e.stopPropagation();
  660. this.$bus.emit("clearAllNotifyMessage")
  661. this.notifyShowallDetail.detailMessageList = [];
  662. this.cancelDeleteAllNotifyMessage(e);
  663. },
  664. },
  665. watch: {
  666. defaultZIndex() {
  667. if (
  668. this.clearAllNotifyMessage.clearAllNotifyMessageZIndex <
  669. this.defaultZIndex
  670. ) {
  671. this.clearAllNotifyMessage.clearAllNotifyMessageCls = "deactive-win";
  672. } else {
  673. this.clearAllNotifyMessage.clearAllNotifyMessageCls = "active-win";
  674. }
  675. },
  676. notifyShowAllData() {
  677. this.notifyShowAllContant = this.notifyShowAllData;
  678. },
  679. },
  680. components: {},
  681. name: "NotifyShowall",
  682. };
  683. </script>
  684. <style lang="css" scoped>
  685. .v-window .v-window-body {
  686. height: calc(100% - 40px);
  687. }
  688. </style>