CommitteeInformationList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  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.allInformationList") }}</span>
  12. </div>
  13. <div @click="back" class="more">
  14. <span>{{ "<" }}{{ $t("common.return") }}</span>
  15. </div>
  16. </div>
  17. <div class="area">
  18. <Screen
  19. v-bind:screen1="screen1s"
  20. :screen2="screen2s"
  21. :screen1def="screen1def"
  22. :screen2Item="screen2Item"
  23. @screenBack="screenBack"
  24. ></Screen>
  25. <div class="choice">
  26. <el-select
  27. clearable
  28. @clear="reset1"
  29. v-model="regionalNationalCommission"
  30. style="width: 150px; height: 20px"
  31. :placeholder="$t('common.select')"
  32. >
  33. <el-option
  34. v-for="item in regionalNationalCommissionList"
  35. :key="item.id"
  36. :label="$i18n.locale === 'en' ? item.committeeNameEn : item.committeeName"
  37. :value="item.id"
  38. >
  39. </el-option>
  40. </el-select>
  41. </div>
  42. <div class="search" style="margin-top: 10px">
  43. <span
  44. style="
  45. margin-right: 20px;
  46. font-size: 14px;
  47. margin-left: 40px;
  48. font-weight: 700;
  49. color: rgb(0, 0, 0);
  50. "
  51. >{{ $t("common.keyWord") }}&nbsp;:</span
  52. >
  53. <el-input
  54. style="width: 200px"
  55. v-model="search"
  56. :placeholder="$t('common.pleaseEnter')"
  57. ></el-input>
  58. <el-button
  59. @click="searchCommittee"
  60. style="margin-left: 20px"
  61. type="primary"
  62. >{{ $t("common.query") }}</el-button
  63. >
  64. <el-button @click="reset">{{ $t("common.reset") }}</el-button>
  65. </div>
  66. </div>
  67. <div v-if="showContent" style="width: 100%" :class="$i18n.locale=='zh'?'content':'contentEn'">
  68. <ul>
  69. <li
  70. v-for="(item, index) in allInformation"
  71. style="margin-left: 25px; margin-right: 15px; float: left"
  72. @click="toDetail(item)"
  73. >
  74. <el-card>
  75. <img
  76. style="width: 208px; height: 288px; display: block"
  77. :src="'data:image/jpeg;base64,'+item.coverBase64"
  78. alt=""
  79. />
  80. </el-card>
  81. <div class="title" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
  82. <span :title="item.title">{{ item.title }}</span>
  83. </div>
  84. <!--<div class="committee">
  85. <span>{{ item.title }}</span>
  86. </div>-->
  87. <div class="committee" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
  88. <span :title="item.reserveFour">{{ item.reserveFour }}</span>
  89. </div>
  90. <div class="Time">
  91. <span>{{
  92. item.createDate | time("YYYY-MM-DD HH:mm:ss")
  93. }}</span>
  94. </div>
  95. </li>
  96. </ul>
  97. </div>
  98. <div v-else :class="$i18n.locale=='zh'?'content':'contentEn'">
  99. <div style="margin-left: 550px">
  100. <el-empty :description="$t('common.noData')"></el-empty>
  101. </div>
  102. </div>
  103. <!-- 分页 -->
  104. <div class="pag">
  105. <el-pagination
  106. type="index"
  107. background
  108. :prev-text= "prevText"
  109. :next-text="nextText"
  110. layout="prev, pager, next, total"
  111. :page-sizes="[8, 20, 50, 100, 200]"
  112. :total="total - 0"
  113. @current-change="handleCurrentChange"
  114. @size-change="handleSizeChange"
  115. ></el-pagination>
  116. </div>
  117. <!--<div class="pag">
  118. <el-pagination
  119. type="index"
  120. background
  121. layout="prev, pager, next"
  122. :page-size="8"
  123. :total="total - 0"
  124. @current-change="handleCurrentChange"
  125. ></el-pagination>
  126. </div>-->
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </template>
  132. <script>
  133. import moment from "moment";
  134. import {
  135. toObtainListAllInformation,
  136. allDataQuery,
  137. queryNationalCommittee,
  138. } from "@/api/committee/committeeWorkSpace";
  139. import Screen from "@/components/screen";
  140. export default {
  141. name: "CommitteeInformationList",
  142. props: ["isDistinguish"],
  143. components: {
  144. Screen,
  145. },
  146. data() {
  147. return {
  148. prevText:"上一页",
  149. nextText:"下一页",
  150. data: [
  151. {
  152. url: "https://img0.baidu.com/it/u=1612726526,4275795108&fm=253&fmt=auto&app=138&f=JPEG?w=717&h=500",
  153. id: 1,
  154. time: "2021-10-31",
  155. type: "哥伦比亚互联网研究",
  156. },
  157. {
  158. url: "https://img0.baidu.com/it/u=1612726526,4275795108&fm=253&fmt=auto&app=138&f=JPEG?w=717&h=500",
  159. id: 2,
  160. time: "2021-10-31",
  161. type: "全球能源互联网解决无电、贫困、健康问题行动计划",
  162. },
  163. {
  164. url: "https://img0.baidu.com/it/u=1612726526,4275795108&fm=253&fmt=auto&app=138&f=JPEG?w=717&h=500",
  165. id: 3,
  166. time: "2021-10-31",
  167. type: "公文",
  168. },
  169. {
  170. url: "https://img0.baidu.com/it/u=1612726526,4275795108&fm=253&fmt=auto&app=138&f=JPEG?w=717&h=500",
  171. id: 4,
  172. time: "2021-10-31",
  173. type: "公文",
  174. },
  175. {
  176. url: "https://img0.baidu.com/it/u=1612726526,4275795108&fm=253&fmt=auto&app=138&f=JPEG?w=717&h=500",
  177. id: 5,
  178. time: "2021-10-31",
  179. type: "公文",
  180. },
  181. {
  182. url: "https://img0.baidu.com/it/u=1612726526,4275795108&fm=253&fmt=auto&app=138&f=JPEG?w=717&h=500",
  183. id: 6,
  184. time: "2021-10-31",
  185. type: "公文",
  186. },
  187. {
  188. url: "https://img0.baidu.com/it/u=1612726526,4275795108&fm=253&fmt=auto&app=138&f=JPEG?w=717&h=500",
  189. id: 7,
  190. time: "2021-10-31",
  191. type: "公文",
  192. },
  193. ],
  194. pageSize:undefined,
  195. search: "",
  196. screen1s: {
  197. value: "common.regionalCommissions",
  198. item: [],
  199. },
  200. screen2s: {
  201. value: "common.Byletter",
  202. item: [
  203. {
  204. value: null,
  205. ifValue: true,
  206. label: "common.All",
  207. },
  208. {
  209. ifValue: false,
  210. value: "A",
  211. label: "A",
  212. },
  213. {
  214. ifValue: false,
  215. value: "B",
  216. label: "B",
  217. },
  218. {
  219. ifValue: false,
  220. value: "C",
  221. label: "C",
  222. },
  223. {
  224. ifValue: false,
  225. value: "D",
  226. label: "D",
  227. },
  228. {
  229. ifValue: false,
  230. value: "E",
  231. label: "E",
  232. },
  233. {
  234. ifValue: false,
  235. value: "F",
  236. label: "F",
  237. },
  238. {
  239. ifValue: false,
  240. value: "G",
  241. label: "G",
  242. },
  243. {
  244. ifValue: false,
  245. value: "H",
  246. label: "H",
  247. },
  248. {
  249. ifValue: false,
  250. value: "I",
  251. label: "I",
  252. },
  253. {
  254. ifValue: false,
  255. value: "J",
  256. label: "J",
  257. },
  258. {
  259. ifValue: false,
  260. value: "K",
  261. label: "K",
  262. },
  263. {
  264. ifValue: false,
  265. value: "L",
  266. label: "L",
  267. },
  268. {
  269. ifValue: false,
  270. value: "M",
  271. label: "M",
  272. },
  273. {
  274. ifValue: false,
  275. value: "N",
  276. label: "N",
  277. },
  278. {
  279. ifValue: false,
  280. value: "O",
  281. label: "O",
  282. },
  283. {
  284. ifValue: false,
  285. value: "P",
  286. label: "P",
  287. },
  288. {
  289. ifValue: false,
  290. value: "Q",
  291. label: "Q",
  292. },
  293. {
  294. ifValue: false,
  295. value: "R",
  296. label: "R",
  297. },
  298. {
  299. ifValue: false,
  300. value: "S",
  301. label: "S",
  302. },
  303. {
  304. ifValue: false,
  305. value: "T",
  306. label: "T",
  307. },
  308. {
  309. ifValue: false,
  310. value: "U",
  311. label: "U",
  312. },
  313. {
  314. ifValue: false,
  315. value: "V",
  316. label: "V",
  317. },
  318. {
  319. ifValue: false,
  320. value: "W",
  321. label: "W",
  322. },
  323. {
  324. ifValue: false,
  325. value: "X",
  326. label: "X",
  327. },
  328. {
  329. ifValue: false,
  330. value: "Y",
  331. label: "Y",
  332. },
  333. {
  334. ifValue: false,
  335. value: "Z",
  336. label: "Z",
  337. },
  338. ],
  339. },
  340. screen1def: null,
  341. screen2Item: null,
  342. allInformation: [],
  343. regionalNationalCommission: "",
  344. regionalNationalCommissionList: [],
  345. regionalNationalCommissionListFull: [],
  346. total: "",
  347. pageNo: "",
  348. committee: "",
  349. letter: "",
  350. showContent: true,
  351. };
  352. },
  353. watch: {
  354. "$i18n.locale"() {
  355. this.accessToNationalCommittee();
  356. this.queryNationalCommittee();
  357. this.toObtainListAllInformation();
  358. if(this.$i18n.locale != 'en'){
  359. this.prevText="上一页";
  360. this.nextText="下一页";
  361. }else{
  362. this.prevText="Previous";
  363. this.nextText="Next";
  364. }
  365. this.regionalNationalCommissionList = new Array();
  366. if(this.$i18n.locale == "en"){
  367. for(let i=0;i<this.regionalNationalCommissionListFull.length;i++){
  368. if(this.regionalNationalCommissionListFull[i].committeeNameEn!="" && this.regionalNationalCommissionListFull[i].committeeNameEn!=null && this.regionalNationalCommissionListFull[i].committeeNameEn!=undefined){
  369. this.regionalNationalCommissionList.push(this.regionalNationalCommissionListFull[i]);
  370. }
  371. }
  372. }else{
  373. this.regionalNationalCommissionList = this.regionalNationalCommissionListFull;
  374. }
  375. },
  376. regionalNationalCommission: {
  377. handler() {
  378. this.committee = this.regionalNationalCommission;
  379. this.toObtainListAllInformation();
  380. },
  381. deep: true,
  382. },
  383. },
  384. filters: {
  385. time(date, type) {
  386. return moment(date).format(type);
  387. },
  388. },
  389. mounted() {
  390. window.scrollTo(0, 0);
  391. this.initData();
  392. if(this.$i18n.locale != 'en'){
  393. this.prevText="上一页";
  394. this.nextText="下一页";
  395. }else{
  396. this.prevText="Previous";
  397. this.nextText="Next";
  398. }
  399. },
  400. destroyed() {},
  401. methods: {
  402. initData() {
  403. this.toObtainListAllInformation();
  404. this.accessToNationalCommittee();
  405. this.queryNationalCommittee();
  406. },
  407. // 查询条件
  408. queryNationalCommittee() {
  409. allDataQuery().then((res) => {
  410. var data = res.data;
  411. if(this.$i18n.locale == 'en'){
  412. for (let i = 0; i < data.length; i++) {
  413. data[i].label = data[i].label2
  414. }
  415. }
  416. console.log(data);
  417. if (data) {
  418. this.screen1s.item = data || [];
  419. let labelmsg = "";
  420. if(this.$i18n.locale == "en"){
  421. labelmsg = "All";
  422. }else{
  423. labelmsg = "全部";
  424. }
  425. let both = {
  426. label: labelmsg,
  427. value: null,
  428. };
  429. this.screen1s.item.unshift(both);
  430. }
  431. });
  432. },
  433. // 获取国家委员会
  434. accessToNationalCommittee() {
  435. var id = this.committee ? this.committee : "";
  436. queryNationalCommittee(id).then((res) => {
  437. this.regionalNationalCommissionListFull = res.data;
  438. // this.regionalNationalCommissionList = res.data;
  439. console.log(res.data);
  440. if(this.$i18n.locale == "en"){
  441. for(let i=0;i<this.regionalNationalCommissionListFull.length;i++){
  442. if(this.regionalNationalCommissionListFull[i].committeeNameEn!="" && this.regionalNationalCommissionListFull[i].committeeNameEn!=null && this.regionalNationalCommissionListFull[i].committeeNameEn!=undefined){
  443. this.regionalNationalCommissionList.push(this.regionalNationalCommissionListFull[i]);
  444. }
  445. }
  446. }else{
  447. this.regionalNationalCommissionList = this.regionalNationalCommissionListFull;
  448. }
  449. });
  450. },
  451. // 获取全部资料列表
  452. toObtainListAllInformation() {
  453. var params = this.pageNo ? this.pageNo : "1";
  454. var pageSize = this.pageSize ? this.pageSize : "8";
  455. var query = this.committee ? this.committee : "";
  456. var query1 = this.letter ? this.letter : "";
  457. var queryConditions = this.search ? this.search : "";
  458. toObtainListAllInformation(params, pageSize, query, query1, queryConditions).then(
  459. (res) => {
  460. var data = res.data;
  461. if (JSON.stringify(data) !== "{}") {
  462. this.showContent = true;
  463. this.allInformation = res.data.nrcMaterialStorehouses;
  464. if(this.$i18n.locale == 'en'){
  465. for (let i = 0; i < this.allInformation.length; i++) {
  466. this.allInformation[i].reserveFour = this.allInformation[i].belongCommitteeEn
  467. }
  468. }
  469. this.total = res.data.page.totalCount;
  470. console.log(res);
  471. } else {
  472. this.showContent = false;
  473. }
  474. }
  475. );
  476. },
  477. handleSizeChange(val) {
  478. this.pageSize = val;
  479. this.toObtainListAllInformation();
  480. console.log(`每页 ${val} 条`);
  481. },
  482. handleCurrentChange(val) {
  483. this.pageNo = val;
  484. this.toObtainListAllInformation();
  485. window.scrollTo(0, 0);
  486. },
  487. toDetail(item) {
  488. this.$router.push({
  489. name: "CommitteeInformationListDetail",
  490. params: { id: item.id },
  491. });
  492. },
  493. searchCommittee() {
  494. this.toObtainListAllInformation();
  495. },
  496. reset() {
  497. this.search = "";
  498. this.toObtainListAllInformation();
  499. },
  500. // 清空选择框
  501. reset1() {
  502. this.toObtainListAllInformation();
  503. },
  504. back() {
  505. var params = {
  506. name: "workspace",
  507. type: false,
  508. };
  509. this.$emit("applicationType", params);
  510. },
  511. screenBack(data) {
  512. this.committee = data.click1;
  513. this.letter = data.click2;
  514. this.regionalNationalCommission = "";
  515. this.toObtainListAllInformation();
  516. this.accessToNationalCommittee();
  517. },
  518. },
  519. };
  520. </script>
  521. <style scoped>
  522. .box1 {
  523. padding: 0 0 20px 0;
  524. position: absolute;
  525. }
  526. .center {
  527. display: flex;
  528. }
  529. .topImg img {
  530. display: inline-block;
  531. width: 1200px;
  532. height: 324px;
  533. }
  534. .centerLeft1 {
  535. height: 1400px;
  536. width: 1200px;
  537. border-radius: 0px;
  538. background: #fff;
  539. }
  540. .left {
  541. position: relative;
  542. }
  543. .top .top1 {
  544. position: absolute;
  545. width: 5.5px;
  546. height: 10.5px;
  547. left: 20px;
  548. top: 35px;
  549. background: #376ac7;
  550. z-index: 1;
  551. }
  552. .top .top2 {
  553. position: absolute;
  554. width: 5.5px;
  555. height: 15px;
  556. left: 20px;
  557. top: 35px;
  558. background: #83bd50;
  559. }
  560. .top .allApplication {
  561. position: absolute;
  562. height: 22px;
  563. left: 34px;
  564. top: 31px;
  565. }
  566. .top .allApplication span {
  567. font-family: "PingFang SC";
  568. font-style: normal;
  569. font-weight: 600;
  570. font-size: 16px;
  571. line-height: 22px;
  572. color: #375586;
  573. }
  574. .top .notice {
  575. position: absolute;
  576. height: 22px;
  577. left: 160px;
  578. top: 32px;
  579. }
  580. .top .notice span {
  581. font-family: "PingFang SC";
  582. font-style: normal;
  583. font-weight: 600;
  584. font-size: 16px;
  585. line-height: 22px;
  586. color: rgba(10, 10, 10, 0.85);
  587. }
  588. .top .more {
  589. position: absolute;
  590. height: 16px;
  591. right: 21px;
  592. top: 31px;
  593. }
  594. .top .more span {
  595. font-family: "Roboto";
  596. font-style: normal;
  597. font-weight: 500;
  598. font-size: 14px;
  599. line-height: 16px;
  600. color: #4790f7;
  601. }
  602. .area {
  603. position: absolute;
  604. top: 100px;
  605. }
  606. .choice {
  607. position: absolute;
  608. right: 0;
  609. top: 55px;
  610. }
  611. .content {
  612. display: flex;
  613. overflow: auto;
  614. position: absolute;
  615. top: 300px;
  616. height: 63%;
  617. }
  618. .contentEn {
  619. display: flex;
  620. overflow: auto;
  621. position: absolute;
  622. top: 400px;
  623. height: 63%;
  624. }
  625. .contentEn .title {
  626. width: 208px;
  627. height: 30px;
  628. text-align: center;
  629. /*text-overflow: -o-ellipsis-lastline;*/
  630. overflow: hidden;
  631. text-overflow: ellipsis;
  632. /*display: -webkit-box;*/
  633. /*-webkit-line-clamp: 2;*/
  634. /*line-clamp: 2;*/
  635. -webkit-box-orient: vertical;
  636. margin-left: 15px;
  637. margin-top: 5px;
  638. }
  639. .contentEn .committee {
  640. height: 30px;
  641. max-width: 230px;
  642. font-family: "PingFang SC";
  643. font-style: normal;
  644. font-weight: 400;
  645. font-size: 16px;
  646. line-height: 25px;
  647. color: rgba(0, 0, 0, 0.65);
  648. text-align: center;
  649. font-feature-settings: "tnum" on, "lnum" on;
  650. }
  651. .contentEn .Time {
  652. /* width: 208px; */
  653. height: 44px;
  654. font-family: "PingFang SC";
  655. font-style: normal;
  656. font-weight: 400;
  657. font-size: 16px;
  658. line-height: 25px;
  659. color: rgba(0, 0, 0, 0.65);
  660. text-align: center;
  661. font-feature-settings: "tnum" on, "lnum" on;
  662. }
  663. .contentEn .title span {
  664. font-family: "PingFang SC";
  665. font-style: normal;
  666. font-weight: 500;
  667. font-size: 18px;
  668. line-height: 22px;
  669. color: rgba(0, 0, 0, 0.85);
  670. }
  671. .content .title {
  672. width: 208px;
  673. height: 30px;
  674. text-align: center;
  675. /*text-overflow: -o-ellipsis-lastline;*/
  676. overflow: hidden;
  677. text-overflow: ellipsis;
  678. /*display: -webkit-box;*/
  679. /*-webkit-line-clamp: 2;*/
  680. /*line-clamp: 2;*/
  681. -webkit-box-orient: vertical;
  682. margin-left: 15px;
  683. margin-top: 5px;
  684. }
  685. .content .committee {
  686. height: 30px;
  687. max-width: 230px;
  688. font-family: "PingFang SC";
  689. font-style: normal;
  690. font-weight: 400;
  691. font-size: 16px;
  692. line-height: 25px;
  693. color: rgba(0, 0, 0, 0.65);
  694. text-align: center;
  695. font-feature-settings: "tnum" on, "lnum" on;
  696. }
  697. .content .Time {
  698. /* width: 208px; */
  699. height: 44px;
  700. font-family: "PingFang SC";
  701. font-style: normal;
  702. font-weight: 400;
  703. font-size: 16px;
  704. line-height: 25px;
  705. color: rgba(0, 0, 0, 0.65);
  706. text-align: center;
  707. font-feature-settings: "tnum" on, "lnum" on;
  708. }
  709. .content .title span {
  710. font-family: "PingFang SC";
  711. font-style: normal;
  712. font-weight: 500;
  713. font-size: 18px;
  714. line-height: 22px;
  715. color: rgba(0, 0, 0, 0.85);
  716. }
  717. .pag {
  718. position: absolute;
  719. bottom: 0;
  720. right: 30%;
  721. }
  722. </style>