CommitteeNoticeListDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. <!-- 委员会通知公告详情 -->
  2. <template>
  3. <div class="autoBox box1" style="position: relative; background: #f5f5f5">
  4. <div class="center" style="margin-top: -20px">
  5. <div class="left">
  6. <div class="centerLeft1">
  7. <div class="top">
  8. <div class="top1"></div>
  9. <div class="top2"></div>
  10. <div class="allApplication">
  11. <!-- <span>{{ $t("common.commentsDetail") }}</span> -->
  12. <!--<span>{{ $t("common.noticeDetail") }}</span>-->
  13. </div>
  14. </div>
  15. <div class="content">
  16. <div class="title" style="text-align: center">
  17. <span>{{ this.documentListForDetails.title }}</span>
  18. </div>
  19. <div class="nav" style=" margin-top: 10px">
  20. <div class="navLeft">
  21. <span>{{ $t("common.releasePeople") }}:</span>
  22. <span style="margin-left: 10px">{{
  23. this.documentListForDetails.releasePeopleName
  24. }}</span>
  25. </div>
  26. <div class="navRight" style="margin-left:50px">
  27. <span>{{ $t("common.releaseTime") }}:</span>
  28. <span style="margin-left: 10px">{{
  29. this.documentListForDetails.releaseTime
  30. }}</span>
  31. </div>
  32. </div>
  33. <div class="line"></div>
  34. <div class="text">
  35. <p :title="this.documentListForDetails.content">
  36. {{ this.documentListForDetails.content }}
  37. <!-- <span v-if="this.documentListForDetails.content.length > 500">...</span>-->
  38. </p>
  39. </div>
  40. <div class="attachment">
  41. <div class="mainBody1">
  42. <span>{{ $t("common.enclosure") }} :</span>
  43. </div>
  44. <div class="upload1" style="dispaly: flex">
  45. <!-- <ul>
  46. <li v-for="(item, index) in documentList" :key="item.id">
  47. <div>
  48. <img
  49. style="display: inline-block; width: 20px; height: 20px"
  50. src="@/assets/img/committeeWorkSpace/Frame@2x.png"
  51. alt=""
  52. />
  53. <span
  54. style="
  55. color: #569af8;
  56. text-decoration: underline;
  57. cursor: pointer;
  58. "
  59. >{{ item.fileNameDisplay }}</span
  60. >
  61. </div>
  62. </li>
  63. </ul> -->
  64. <div
  65. class="uploadContent"
  66. style=""
  67. >
  68. <!-- /api/nationregioncomittee-service/nrc/nrcApplys/uploadFile -->
  69. <el-upload
  70. style="margin-left: 24px"
  71. class="upload-demo"
  72. disabled
  73. action="/api/nationregioncomittee-service/nrc/nrcCommitteeDocumentAnnouncements/uploadFile"
  74. :on-preview="handlePreview"
  75. :on-remove="handleRemove"
  76. :before-remove="beforeRemove"
  77. :before-upload="beforeUpload"
  78. :on-success="handleAvatarSuccessAnnex"
  79. multiple
  80. :limit="3"
  81. :on-exceed="handleExceed"
  82. :file-list="filesList"
  83. >
  84. </el-upload>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="close">
  90. <el-button
  91. @click="close"
  92. style="width: 120px; height: 40px"
  93. type="primary"
  94. >{{ $t("common.close") }}</el-button
  95. >
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. </template>
  102. <script>
  103. import {
  104. getNotificationDetail,
  105. uploadfile,
  106. } from "@/api/committee/committeeWorkSpace";
  107. import Screen from "@/components/screen";
  108. export default {
  109. name: "CommitteeNoticeListDetail",
  110. props: ["detailID", "category"],
  111. components: {
  112. Screen,
  113. },
  114. data() {
  115. return {
  116. documentListForDetails: [],
  117. documentList: [],
  118. fileList: [],
  119. showContent: null,
  120. filesList: [],
  121. };
  122. },
  123. watch: {
  124. "$i18n.locale"() {},
  125. },
  126. mounted() {
  127. window.scrollTo(0, 0);
  128. this.initData();
  129. },
  130. destroyed() {},
  131. methods: {
  132. // 上传相关
  133. handleRemove(file, fileList) {
  134. console.log(file, fileList);
  135. this.filename.forEach((item, index) => {
  136. if (file.name == item.fileNameDisplay) {
  137. this.filename.splice(index, 1);
  138. }
  139. });
  140. console.log(this.filename);
  141. },
  142. beforeRemove(file, fileList) {
  143. return this.$confirm(`确定移除 ${file.name}?`);
  144. },
  145. beforeUpload(file) {
  146. var FileExt = file.name.replace(/.+\./, "");
  147. if (
  148. ["zip", "pdf", "doc", "docx", "excel", "xls", "xlsx"].indexOf(
  149. FileExt.toLowerCase()
  150. ) === -1
  151. ) {
  152. this.$message({
  153. type: "warning",
  154. message: "请上传zip,pdf,word,excel的附件!",
  155. });
  156. this.fileList.splice(this.fileList.indexOf(file), 1);
  157. return false;
  158. }
  159. this.isLt2k = file.size / 1024 / 1024 < 10 ? "1" : "0";
  160. if (this.isLt2k === "0") {
  161. if (this.$i18n.locale.toUpperCase() == "ZH") {
  162. this.$message({
  163. message: "上传文件大小不能超过10M!",
  164. type: "error",
  165. });
  166. } else {
  167. this.$message({
  168. message: "Upload file size cannot exceed 10m!",
  169. type: "error",
  170. });
  171. }
  172. return false;
  173. }
  174. },
  175. handleAvatarSuccessAnnex(res, file) {
  176. let obj = {};
  177. obj.fileNameDisplay = file.name;
  178. obj.filePath = res.data.filePath;
  179. obj.type = 2;
  180. this.filename.push(obj);
  181. console.log(this.filename);
  182. },
  183. handleExceed(files, fileList) {
  184. this.$message.warning(
  185. `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
  186. files.length + fileList.length
  187. } 个文件`
  188. );
  189. },
  190. initData() {
  191. this.accessToDocumentsNoticeDetails();
  192. },
  193. // 获取公文通知详情
  194. accessToDocumentsNoticeDetails() {
  195. var params = this.detailID;
  196. getNotificationDetail(params).then((res) => {
  197. console.log(res);
  198. this.documentListForDetails = res.data.nrcCommitteeDocumentAnnouncement;
  199. this.documentListForDetails.releaseTime = this.documentListForDetails.releaseTime.substr(0,10);
  200. res.data.files.forEach((item) => {
  201. let obj = {};
  202. obj.name = item.fileNameDisplay;
  203. obj.url = item.filePath;
  204. obj.type = item.type;
  205. this.filesList.push(obj);
  206. });
  207. });
  208. },
  209. funClear() {
  210. this.textarea = "";
  211. },
  212. close() {
  213. if (this.category === "1") {
  214. this.$emit("noticeDetail", "documentList");
  215. } else if (this.category === "2") {
  216. this.$emit("noticeDetail", "noticeList");
  217. } else {
  218. var params = {
  219. name: "workspace",
  220. type: true,
  221. };
  222. this.$emit("applicationType", params);
  223. }
  224. },
  225. handleCurrentChange() {},
  226. back() {
  227. this.$router.back();
  228. },
  229. screenBack() {},
  230. changeTitle(i) {
  231. this.titleIndex = i;
  232. },
  233. // 上传相关
  234. handleRemove(file, fileList) {
  235. console.log(file, fileList);
  236. this.filename.forEach((item, index) => {
  237. if (file.name == item.fileNameDisplay) {
  238. this.filename.splice(index, 1);
  239. }
  240. });
  241. console.log(this.filename);
  242. },
  243. beforeRemove(file, fileList) {
  244. return this.$confirm(`确定移除 ${file.name}?`);
  245. },
  246. beforeUpload(file) {
  247. var FileExt = file.name.replace(/.+\./, "");
  248. if (
  249. ["zip", "pdf", "doc", "docx", "excel", "xls", "xlsx"].indexOf(
  250. FileExt.toLowerCase()
  251. ) === -1
  252. ) {
  253. this.$message({
  254. type: "warning",
  255. message: "请上传zip,pdf,word,excel的附件!",
  256. });
  257. this.fileList.splice(this.fileList.indexOf(file), 1);
  258. return false;
  259. }
  260. this.isLt2k = file.size / 1024 / 1024 < 10 ? "1" : "0";
  261. if (this.isLt2k === "0") {
  262. if (this.$i18n.locale.toUpperCase() == "ZH") {
  263. this.$message({
  264. message: "上传文件大小不能超过10M!",
  265. type: "error",
  266. });
  267. } else {
  268. this.$message({
  269. message: "Upload file size cannot exceed 10m!",
  270. type: "error",
  271. });
  272. }
  273. return false;
  274. }
  275. },
  276. handleAvatarSuccessAnnex(res, file) {
  277. let obj = {};
  278. obj.fileNameDisplay = file.name;
  279. obj.filePath = res.data.filePath;
  280. obj.type = 2;
  281. this.filename.push(obj);
  282. console.log(this.filename);
  283. },
  284. handleExceed(files, fileList) {
  285. this.$message.warning(
  286. `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
  287. files.length + fileList.length
  288. } 个文件`
  289. );
  290. },
  291. handlePreview(file, fileList) {
  292. console.log(file, fileList);
  293. let param = {
  294. fileName: file.name,
  295. filePath: file.url,
  296. };
  297. uploadfile(param).then((res) => {
  298. const content = res;
  299. if (content) {
  300. const blob = new Blob([content]); //构造一个blob对象来处理数据
  301. const fileName = decodeURIComponent(res.fileName);
  302. //对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
  303. //IE10以上支持blob但是依然不支持download
  304. if ("download" in document.createElement("a")) {
  305. //支持a标签download的浏览器
  306. const link = document.createElement("a"); //创建a标签
  307. link.download = file.name; //a标签添加属性
  308. link.style.display = "none";
  309. link.href = URL.createObjectURL(blob);
  310. document.body.appendChild(link);
  311. link.click(); //执行下载
  312. URL.revokeObjectURL(link.href); //释放url
  313. document.body.removeChild(link); //释放标签
  314. } else {
  315. //其他浏览器
  316. navigator.msSaveBlob(blob, fileName);
  317. }
  318. } else {
  319. this.$message.error("服务器繁忙");
  320. }
  321. });
  322. },
  323. },
  324. };
  325. </script>
  326. <style scoped>
  327. ::v-deep .el-upload-list__item-name {
  328. color: #4790f7;
  329. text-decoration: underline;
  330. }
  331. /* ::v-deep .el-upload-list__item-name i {
  332. display: none;
  333. } */
  334. .content .title {
  335. width: 600px;
  336. height: 40px;
  337. line-height: 40px;
  338. overflow: hidden;
  339. text-overflow: ellipsis;
  340. white-space: nowrap;
  341. position: absolute;
  342. left: 290px;
  343. top: 100px;
  344. font-family: "PingFang SC";
  345. font-style: normal;
  346. font-weight: 700;
  347. font-size: 20px;
  348. line-height: 22px;
  349. font-feature-settings: "tnum" on, "lnum" on;
  350. color: rgba(0, 0, 0, 0.85);
  351. }
  352. .content .nav {
  353. width: 1180px;
  354. display: flex;
  355. flex-direction: row;
  356. flex-wrap: nowrap;
  357. justify-content: center;
  358. font-family: "PingFang SC";
  359. font-style: normal;
  360. font-weight: 400;
  361. font-size: 14px;
  362. line-height: 14px;
  363. font-feature-settings: "tnum" on, "lnum" on;
  364. color: rgba(0, 0, 0, 0.65);
  365. }
  366. .content .line {
  367. position: absolute;
  368. left: 20px;
  369. top: 196px;
  370. width: 1159px;
  371. border: 1px solid rgba(0, 0, 0, 0.1);
  372. }
  373. .content .text {
  374. position: absolute;
  375. left: 59px;
  376. top: 209px;
  377. width: 1087px;
  378. text-indent: 2em;
  379. font-family: "PingFang SC";
  380. font-style: normal;
  381. font-weight: 400;
  382. font-size: 14px;
  383. line-height: 25px;
  384. font-feature-settings: "tnum" on, "lnum" on;
  385. color: rgba(0, 0, 0, 0.65);
  386. }
  387. .attachment .mainBody {
  388. position: absolute;
  389. left: 59px;
  390. top: 318px;
  391. font-family: "PingFang SC";
  392. font-style: normal;
  393. font-weight: 400;
  394. font-size: 16px;
  395. line-height: 0px;
  396. display: flex;
  397. align-items: center;
  398. text-indent: 30px;
  399. font-feature-settings: "tnum" on, "lnum" on;
  400. color: rgba(0, 0, 0, 0.95);
  401. }
  402. .attachment .upload {
  403. position: absolute;
  404. left: 107px;
  405. top: 350px;
  406. }
  407. .attachment .upload1 {
  408. position: absolute;
  409. left: 107px;
  410. top: 400px;
  411. }
  412. .attachment .upload2 {
  413. position: absolute;
  414. left: 107px;
  415. top: 380px;
  416. }
  417. .attachment .mainBody1 {
  418. position: absolute;
  419. left: 59px;
  420. top: 410px;
  421. font-family: "PingFang SC";
  422. font-style: normal;
  423. font-weight: 400;
  424. font-size: 16px;
  425. line-height: 0px;
  426. display: flex;
  427. align-items: center;
  428. text-indent: 30px;
  429. font-feature-settings: "tnum" on, "lnum" on;
  430. color: rgba(0, 0, 0, 0.95);
  431. }
  432. .top2 {
  433. position: absolute;
  434. top: 603px;
  435. }
  436. .top3 {
  437. position: absolute;
  438. top: 896px;
  439. }
  440. .table {
  441. width: 1123px;
  442. background: #ddd;
  443. position: absolute;
  444. left: 33px;
  445. top: 680px;
  446. }
  447. .box1 {
  448. padding: 0 0 20px 0;
  449. position: absolute;
  450. }
  451. .center {
  452. display: flex;
  453. }
  454. .topImg img {
  455. display: inline-block;
  456. width: 1200px;
  457. height: 324px;
  458. }
  459. .centerLeft1 {
  460. height: 650px;
  461. width: 1200px;
  462. border-radius: 0px;
  463. background: #fff;
  464. }
  465. .centerLeft1 .tab {
  466. position: absolute;
  467. right: 100px;
  468. top: 70px;
  469. display: flex;
  470. align-items: center;
  471. }
  472. .centerLeft1 .nav {
  473. position: absolute;
  474. top: 139px;
  475. left: 19px;
  476. }
  477. .list .title {
  478. font-family: "PingFang SC";
  479. font-style: normal;
  480. font-weight: 700;
  481. font-size: 20px;
  482. line-height: 22px;
  483. align-items: center;
  484. color: rgba(0, 0, 0, 0.85);
  485. font-feature-settings: "tnum" on, "lnum" on;
  486. }
  487. .list .center {
  488. font-weight: 400;
  489. color: rgba(0, 0, 0, 0.85);
  490. font-size: 14px;
  491. text-indent: 2em;
  492. }
  493. .left {
  494. position: relative;
  495. }
  496. .top .top1 {
  497. position: absolute;
  498. width: 5.5px;
  499. height: 10.5px;
  500. left: 20px;
  501. top: 35px;
  502. background: #376ac7;
  503. z-index: 1;
  504. }
  505. .top .top2 {
  506. position: absolute;
  507. width: 5.5px;
  508. height: 15px;
  509. left: 20px;
  510. top: 35px;
  511. background: #83bd50;
  512. }
  513. .top .allApplication {
  514. position: absolute;
  515. height: 22px;
  516. left: 34px;
  517. top: 31px;
  518. }
  519. .top2 .top1 {
  520. position: absolute;
  521. width: 5.5px;
  522. height: 10.5px;
  523. left: 20px;
  524. top: 35px;
  525. background: #376ac7;
  526. z-index: 1;
  527. }
  528. .top2 .top2 {
  529. position: absolute;
  530. width: 5.5px;
  531. height: 15px;
  532. left: 20px;
  533. top: 35px;
  534. background: #83bd50;
  535. }
  536. .top2 .allApplication {
  537. position: absolute;
  538. height: 22px;
  539. left: 34px;
  540. top: 15px;
  541. }
  542. .top2 .allApplication p {
  543. width: 180px;
  544. font-family: "PingFang SC";
  545. font-style: normal;
  546. font-weight: 600;
  547. font-size: 16px;
  548. line-height: 22px;
  549. color: #375586;
  550. }
  551. /* */
  552. .top3 .top1 {
  553. position: absolute;
  554. width: 5.5px;
  555. height: 10.5px;
  556. left: 20px;
  557. top: 35px;
  558. background: #376ac7;
  559. z-index: 1;
  560. }
  561. .top3 .top2 {
  562. position: absolute;
  563. width: 5.5px;
  564. height: 15px;
  565. left: 20px;
  566. top: 35px;
  567. background: #83bd50;
  568. }
  569. .top3 .allApplication {
  570. position: absolute;
  571. height: 22px;
  572. left: 34px;
  573. top: 15px;
  574. }
  575. .top3 .allApplication p {
  576. width: 80px;
  577. font-family: "PingFang SC";
  578. font-style: normal;
  579. font-weight: 600;
  580. font-size: 16px;
  581. line-height: 22px;
  582. color: #375586;
  583. }
  584. /* */
  585. .replyInput {
  586. width: 1123px;
  587. height: 146px;
  588. position: absolute;
  589. top: 970px;
  590. left: 33px;
  591. /* background: #ddd; */
  592. }
  593. .replyText {
  594. position: absolute;
  595. left: 67px;
  596. top: 1115px;
  597. }
  598. .replyText .textImg {
  599. /* position: absolute;
  600. left: 49px;
  601. top: 1115px; */
  602. margin-top: 17px;
  603. margin-right: 5px;
  604. }
  605. .replyText p {
  606. font-family: "Noto Sans SC";
  607. font-style: normal;
  608. font-weight: 400;
  609. font-size: 12px;
  610. line-height: 22px;
  611. font-feature-settings: "tnum" on, "lnum" on;
  612. color: rgba(0, 0, 0, 0.45);
  613. }
  614. .close {
  615. position: absolute;
  616. top: 567px;
  617. left: 535px;
  618. }
  619. .top .allApplication span {
  620. font-family: "PingFang SC";
  621. font-style: normal;
  622. font-weight: 600;
  623. font-size: 16px;
  624. line-height: 22px;
  625. color: #375586;
  626. }
  627. .top .notice {
  628. position: absolute;
  629. height: 22px;
  630. left: 160px;
  631. top: 32px;
  632. }
  633. .top .notice span {
  634. font-family: "PingFang SC";
  635. font-style: normal;
  636. font-weight: 600;
  637. font-size: 16px;
  638. line-height: 22px;
  639. color: rgba(10, 10, 10, 0.85);
  640. }
  641. .top .more span {
  642. font-family: "Roboto";
  643. font-style: normal;
  644. font-weight: 500;
  645. font-size: 14px;
  646. line-height: 16px;
  647. color: #4790f7;
  648. }
  649. /* ::v-deep .el-input__inner {
  650. height: 146px;
  651. } */
  652. .lowerBotton {
  653. position: absolute;
  654. bottom: 0;
  655. right: 70px;
  656. }
  657. </style>