RealTimeInfoGEIWeekly.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. <template>
  2. <div class="autoBox box">
  3. <div class="weeklyContent">
  4. <div>
  5. <img v-if="$i18n.locale == 'zh'" src="@/assets/img/realTimeInfo/weeklyzh.png" alt="" style="width: 100%;height: 110px">
  6. <img v-else src="@/assets/img/realTimeInfo/weeklyen.png" alt="" style="width: 100%;height: 110px">
  7. </div>
  8. <div class="pageTurn">
  9. <div class="pagequery">
  10. <div class="pageQu">
  11. <div style="float: left">{{$t('common.InfoClass')}}:</div>
  12. <el-select v-model="classSelect" :placeholder="$t('common.PleaseSelect')">
  13. <el-option
  14. v-for="item in options"
  15. :key="item.dictName"
  16. :value="item.value"
  17. :label="item.dictName"
  18. >
  19. </el-option>
  20. </el-select>
  21. </div>
  22. <div class="pageQu">
  23. <div style="float: left">{{$t('common.SearchIssue')}}:</div>
  24. <el-input v-model="issue" :placeholder="$t('common.Enterperiodnumber')"></el-input>
  25. </div>
  26. <el-button class="queryBtn" @click="queryData">{{$t('common.WeeklySerch')}}</el-button>
  27. </div>
  28. <div class="pageTitle" v-if="isShow">
  29. <div style="display: inline-block;font-weight: 600">
  30. <span>{{currentTitle}}</span>
  31. <!-- <span v-if="$i18n.locale == 'zh'">{{data[0]}}年{{data[1]}}月{{data[2]}}日</span>-->
  32. <!-- <span v-if="$i18n.locale == 'en'">{{data[1]}}/{{data[2]}}/{{data[0]}}</span>-->
  33. <!-- <div v-if="$i18n.locale == 'zh'" style="display: inline-block;margin: 0 10px">第<span style="color: red">{{currentPer}}</span>期</div>-->
  34. <!-- <div v-if="$i18n.locale == 'en'" style="display: inline-block;margin: 0 10px"> Order by <span style="color: red">{{currentPer}}</span></div>-->
  35. <!-- <div v-if="$i18n.locale == 'zh'" style="display: inline-block">总<span>{{totalPri}}</span>期</div>-->
  36. <!-- <div v-if="$i18n.locale == 'en'" style="display: inline-block">total of <span>{{totalPri}}</span> period</div>-->
  37. </div>
  38. <div class="upAndDownload" v-if="isShow">
  39. <div class="pageBtn" @click="upPage">
  40. {{$t('common.PreviousArticle')}}
  41. </div>
  42. <div class="pageBtn" @click="downPage">
  43. {{$t('common.NextArticle')}}
  44. </div>
  45. </div>
  46. </div>
  47. <div style="clear: both"></div>
  48. </div>
  49. <div class="content">
  50. <div class="leftList">
  51. <div class="weekgei" v-if="isweekly">
  52. <div class="weeklyBox">
  53. <i class="el-icon-document-copy"></i>
  54. {{$t('common.GEIWeekly')}}
  55. </div>
  56. <div v-if="total1 == '0'" style="margin: 30px auto;text-align: center">
  57. {{$t('common.NoData')}}
  58. </div>
  59. <div v-if="total1 != '0'">
  60. <div class="GEIlist" v-for="(weeklyItem,weeklyIndex) in weeklyList" @click="showGEIdetail(weeklyItem)">
  61. <img v-if="$i18n.locale == 'zh' && !weeklyItem.pictureUrl" src="@/assets/img/realTimeInfo/weeklyBackzh.png" alt="" style="width: 100%;height: 100%">
  62. <img v-if="$i18n.locale == 'en' && !weeklyItem.pictureUrl" src="@/assets/img/realTimeInfo/weeklyBacken.png" alt="" style="width: 100%;height: 100%">
  63. <img v-if="weeklyItem.pictureUrl" :src="'api/file/pub/' + weeklyItem.pictureUrl" alt="" style="width: 100%;height: 100%">
  64. <div class="newTip">
  65. <span>new</span>
  66. </div>
  67. <div class="GEItext">
  68. {{weeklyItem.name}}
  69. </div>
  70. </div>
  71. </div>
  72. <div class="pagination" v-if="total1 != '0'">
  73. <el-pagination
  74. @current-change="handleCurrentChange1"
  75. :page-size="4"
  76. layout="prev, pager, next, jumper"
  77. :total="total1">
  78. </el-pagination>
  79. </div>
  80. </div>
  81. <div class="weekgei" v-if="isvision">
  82. <div class="weeklyBox">
  83. <i class="el-icon-document-copy"></i>
  84. {{$t('common.GEIVision')}}
  85. </div>
  86. <div v-if="total2 == '0'" style="margin: 30px auto;text-align: center">
  87. {{$t('common.NoData')}}
  88. </div>
  89. <div v-if="total2 != '0'">
  90. <div class="GEIlist" v-for="(geiItem,geiIndex) in visionList" @click="showGEIdetail(geiItem)">
  91. <img v-if="$i18n.locale == 'zh' && !geiItem.pictureUrl" src="@/assets/img/realTimeInfo/weeklyBackzh.png" alt="" style="width: 100%;height: 100%">
  92. <img v-if="$i18n.locale == 'en' && !geiItem.pictureUrl" src="@/assets/img/realTimeInfo/weeklyBacken.png" alt="" style="width: 100%;height: 100%">
  93. <img v-if="geiItem.pictureUrl" :src="'api/file/pub/' + geiItem.pictureUrl" alt="" style="width: 100%;height: 100%">
  94. <div class="newTip">
  95. <span>new</span>
  96. </div>
  97. <div class="GEItext">
  98. {{geiItem.name}}
  99. </div>
  100. </div>
  101. </div>
  102. <div class="pagination" v-if="total2 != '0'">
  103. <el-pagination
  104. @current-change="handleCurrentChange2"
  105. :page-size="4"
  106. layout="prev, pager, next, jumper"
  107. :total="total2">
  108. </el-pagination>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="rightBox">
  113. <iframe v-if="pdfSrc" id="iframe_id" width="100%" height="100%" :src="pdfSrc + '#toolbar=0'" frameborder="0"></iframe>
  114. <div v-if="!pdfSrc" style="text-align: center;margin: 50px 0">{{$t('common.NoData')}}</div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </template>
  120. <script>
  121. import {geiWeeklyReportViews, getGeiWeeklyReportByButton, weeklyClassificationEntitys} from '@/api/operation/baseAdvertisement'
  122. import {sysAttachmentInfos} from "../../api/cooperation/baseCooperationUnit";
  123. export default {
  124. name:'RealTimeInfoGEIWeekly',
  125. data(){
  126. return {
  127. data:'',
  128. options: [],
  129. classSelect: '',
  130. issue:'',
  131. GEIlist:[],
  132. currentPage:1,
  133. currentId:'',
  134. currentPic:'',
  135. inputPage:1,
  136. pageTotal:'',
  137. totalPri:'',
  138. currentPer:'',
  139. pdfSrc:null,
  140. showPdfDeta:{},
  141. isShow:true,
  142. currentTitle:'',
  143. currentDerails:{},
  144. weeklyList:[],
  145. visionList:[],
  146. isweekly:true,
  147. isvision:true,
  148. total1:'',
  149. total2:'',
  150. }
  151. },
  152. mounted() {
  153. // this.getGeiData();
  154. this.getDict()
  155. },
  156. watch:{
  157. '$i18n.locale'(){
  158. // this.getGeiData()
  159. this.getDict()
  160. }
  161. },
  162. methods:{
  163. iniTime(temTime){
  164. temTime = this.formatDate(temTime);
  165. temTime = temTime.split('-');
  166. this.data = temTime;
  167. },
  168. upPage(){
  169. let that = this;
  170. let list = that.currentDerails;
  171. console.log('that.currentDerails')
  172. console.log(that.currentDerails.typeDict)
  173. let params = {
  174. periodNumber:list.period,
  175. typeDict:list.typeDict,
  176. buttonType:'previous',
  177. languageDict:this.$i18n.locale.toUpperCase()
  178. }
  179. getGeiWeeklyReportByButton(params).then(res=>{
  180. if( res.data.geiWeeklyReportViews){
  181. let data = res.data.geiWeeklyReportViews[0];
  182. that.currentDerails = data;
  183. that.currentTitle = data.name;
  184. that.getData(data.id)
  185. }else{
  186. if(this.$i18n.locale == 'zh'){
  187. this.$message({
  188. message: res.data,
  189. type: "warring",
  190. });
  191. }else{
  192. this.$message({
  193. message:'NoData',
  194. type: "warring",
  195. });
  196. }
  197. }
  198. })
  199. },
  200. downPage(){
  201. let that = this;
  202. let list = that.currentDerails;
  203. console.log('that.currentDerails')
  204. console.log(that.currentDerails.typeDict)
  205. let params = {
  206. periodNumber:list.period,
  207. typeDict:list.typeDict,
  208. buttonType:'next',
  209. languageDict:this.$i18n.locale.toUpperCase()
  210. }
  211. getGeiWeeklyReportByButton(params).then(res=>{
  212. if( res.data.geiWeeklyReportViews){
  213. let data = res.data.geiWeeklyReportViews[0];
  214. that.currentTitle = data.name;
  215. that.currentDerails = data
  216. that.getData(data.id)
  217. }else{
  218. if(this.$i18n.locale == 'zh'){
  219. this.$message({
  220. message: res.data,
  221. type: "warring",
  222. });
  223. }else{
  224. this.$message({
  225. message:'NoData',
  226. type: "warring",
  227. });
  228. }
  229. }
  230. })
  231. },
  232. showGEIdetail(item){
  233. this.currentDerails = item;
  234. this.current = item.id;
  235. this.currentPer = item.period;
  236. this.currentTitle = item.name;
  237. this.iniTime(item.createDate);
  238. this.getData(item.id);
  239. },
  240. handleCurrentChangeLeft() {
  241. const that = this;
  242. if (that.currentPage>1){
  243. --that.currentPage
  244. --that.inputPage
  245. }
  246. this.getData(that.current)
  247. },
  248. inputPageChange(){
  249. if(0<this.inputPage-0<this.fileVisiblePages-0){
  250. this.currentPage = this.inputPage-0;
  251. }else{
  252. this.inputPage = this.currentPage+'';
  253. }
  254. },
  255. handleCurrentChangeRight(){
  256. const that = this;
  257. if (that.currentPage<that.pageTotal){
  258. ++that.currentPage
  259. ++that.inputPage
  260. }
  261. this.getData(that.current)
  262. },
  263. queryData(){
  264. let period = this.issue;
  265. if(this.classSelect == 'eef06c88a06d11ec99100894ef7fd169'){
  266. this.isweekly = true;
  267. this.isvision = false;
  268. }else if(this.classSelect == 'f6a6d6afa06d11ec99100894ef7fd169'){
  269. this.isweekly = false;
  270. this.isvision = true;
  271. }else{
  272. this.isweekly = true;
  273. this.isvision = true;
  274. }
  275. this.getDict(period)
  276. },
  277. getData(id){
  278. const that =this;
  279. let list={
  280. attachmentBusinessId:id,
  281. attachmentBusinessType:'gei_weekly_report'
  282. };
  283. sysAttachmentInfos(list).then((res)=>{
  284. if(res.data.attachmentInfos){
  285. that.showPdfDeta = res.data.attachmentInfos[0] || {};
  286. that.pdfSrc = 'api/file/pub/' + that.showPdfDeta.attachmentSavePath;
  287. }else{
  288. that.pdfSrc = ''
  289. }
  290. });
  291. },
  292. getDict(period,pageno1,pageno2){
  293. pageno1 = pageno1? pageno1 : '1';
  294. pageno2 = pageno2? pageno2 : '1';
  295. weeklyClassificationEntitys().then(res=>{
  296. let data = res.data.weeklyClassificationEntitys || [];
  297. if(data){
  298. data.forEach(item=>{
  299. if(item.categoryName === 'GEI周报'){
  300. this.getweeklylist(item.id,period,pageno1)
  301. }else if(item.categoryName === 'GEI视野'){
  302. this.getVisionlist(item.id,period,pageno2)
  303. }
  304. })
  305. }else{
  306. if(this.$i18n.locale == 'zh'){
  307. this.$message({
  308. message: '暂无数据',
  309. type: "warring",
  310. });
  311. }else{
  312. this.$message({
  313. message:'NoData',
  314. type: "warring",
  315. });
  316. }
  317. }
  318. })
  319. },
  320. getweeklylist(type,period,pageno){
  321. let that = this;
  322. this.options = [];
  323. let param = {};
  324. if(period){
  325. param = {
  326. typeDict:type,
  327. typeLanguage:that.$i18n.locale.toUpperCase(),
  328. pageNo:pageno,
  329. pageSize:4,
  330. period:period
  331. }
  332. }else{
  333. param = {
  334. typeDict:type,
  335. typeLanguage:that.$i18n.locale.toUpperCase(),
  336. pageNo:pageno,
  337. pageSize:4
  338. }
  339. }
  340. geiWeeklyReportViews(param).then(res=>{
  341. if(res.data.geiWeeklyReportViews){
  342. that.isShow = true;
  343. that.weeklyList = res.data.geiWeeklyReportViews;
  344. if(that.isweekly){
  345. let time = that.weeklyList[0].createDate;
  346. that.iniTime(time);
  347. that.currentDerails = that.weeklyList[0];
  348. that.current = that.weeklyList[0].id;
  349. that.currentTitle = that.weeklyList[0].name;
  350. that.currentPer = that.weeklyList[0].period;
  351. that.currentDerails = that.weeklyList[0];
  352. that.totalPri = Number(res.data.total);
  353. that.getData(that.current)
  354. }
  355. }else{
  356. console.log(that.isweekly)
  357. if(that.isweekly){
  358. that.currentPic = '';
  359. that.pdfSrc = '';
  360. that.classSelect = '';
  361. that.currentTitle = '';
  362. that.isShow = false;
  363. if(that.$i18n.locale == 'zh'){
  364. that.$message({
  365. message: 'GEI周报暂无数据',
  366. type: "warring",
  367. });
  368. }else{
  369. that.$message({
  370. message:'GEI Weekly No Data',
  371. type: "warring",
  372. });
  373. }
  374. }
  375. that.weeklyList = [];
  376. }
  377. if(that.isweekly){
  378. if( res.data.dict){
  379. let dictTem = res.data.dict;
  380. dictTem.forEach(item=>{
  381. if(item.dictName){
  382. that.options.push(item)
  383. }
  384. })
  385. }else{
  386. that.options = [];
  387. that.classSelect = '';
  388. }
  389. }
  390. if(res.data.page){
  391. let page = res.data.page;
  392. that.total1 = Number(page.totalCount)
  393. }else{
  394. that.total1 = '0'
  395. }
  396. })
  397. },
  398. getVisionlist(type,period,pageno){
  399. let that = this;
  400. let param = {}
  401. if(period){
  402. param = {
  403. typeDict:type,
  404. typeLanguage:that.$i18n.locale.toUpperCase(),
  405. pageNo:pageno,
  406. pageSize:4,
  407. period:period
  408. }
  409. }else{
  410. param = {
  411. typeDict:type,
  412. typeLanguage:that.$i18n.locale.toUpperCase(),
  413. pageNo:pageno,
  414. pageSize:4
  415. }
  416. }
  417. geiWeeklyReportViews(param).then(res=>{
  418. if(res.data.geiWeeklyReportViews){
  419. that.isShow = true;
  420. that.visionList = res.data.geiWeeklyReportViews
  421. if(!that.isweekly){
  422. let time = that.visionList[0].createDate;
  423. that.iniTime(time);
  424. that.currentDerails = that.visionList[0];
  425. that.current = that.visionList[0].id;
  426. that.currentTitle = that.visionList[0].name;
  427. that.currentPer = that.visionList[0].period;
  428. that.currentDerails = that.visionList[0];
  429. that.totalPri = Number(res.data.total);
  430. that.getData(that.current)
  431. }
  432. }else{
  433. console.log(that.isweekly)
  434. if(!that.isweekly){
  435. that.currentPic = '';
  436. that.pdfSrc = '';
  437. that.classSelect = '';
  438. that.isShow = false;
  439. that.currentTitle = '';
  440. if(that.$i18n.locale == 'zh'){
  441. that.$message({
  442. message: 'GEI视野报暂无数据',
  443. type: "warring",
  444. });
  445. }else{
  446. that.$message({
  447. message:'GEI Vision No Data',
  448. type: "warring",
  449. });
  450. }
  451. }
  452. that.visionList = []
  453. }
  454. if(!that.isweekly){
  455. if( res.data.dict){
  456. let dictTem = res.data.dict;
  457. dictTem.forEach(item=>{
  458. if(item.dictName){
  459. that.options.push(item)
  460. }
  461. })
  462. }else{
  463. that.options = [];
  464. that.classSelect = '';
  465. }
  466. }
  467. if(res.data.page){
  468. let page = res.data.page;
  469. that.total2 = Number(page.totalCount)
  470. }else{
  471. that.total2 = '0'
  472. }
  473. })
  474. },
  475. handleCurrentChange1(val) {
  476. console.log(`当前页: ${val}`);
  477. this.getDict('',val)
  478. },
  479. handleCurrentChange2(val) {
  480. console.log(`当前页: ${val}`);
  481. this.getDict('','',val)
  482. },
  483. }
  484. }
  485. </script>
  486. <style scoped>
  487. .weeklyContent{
  488. padding: 20px;
  489. }
  490. .pageTurn{
  491. padding: 0 10px;
  492. height: 62px;
  493. line-height: 62px;
  494. background: #e8eef5;
  495. margin: 20px 0;
  496. }
  497. .pageTitle{
  498. text-align: center;
  499. }
  500. .upAndDownload{
  501. float: right;
  502. }
  503. .pageBtn{
  504. display: inline-block;
  505. margin-right: 20px;
  506. cursor: pointer;
  507. }
  508. .pagequery{
  509. float: left;
  510. }
  511. .pageQu{
  512. float: left;
  513. margin-right: 20px;
  514. }
  515. >>>.el-input__inner{
  516. width: 100px!important;
  517. height: 30px;
  518. }
  519. >>>.el-input{
  520. width: 100px!important;
  521. }
  522. .content{
  523. padding: 0 10px;
  524. height: 100%;
  525. display: flex;
  526. justify-content: space-between;
  527. margin-bottom: 50px;
  528. }
  529. .leftList{
  530. width: 33%;
  531. border-right: 1px solid #ccc;
  532. /*display: flex;*/
  533. /*justify-content: space-between;*/
  534. /*flex-wrap: wrap;*/
  535. }
  536. .GEIlist{
  537. width: 43%;
  538. border: 1px solid #ccc;
  539. height: 210px;
  540. margin: 0 10px;
  541. margin-top: 20px;
  542. cursor: pointer;
  543. position: relative;
  544. display: inline-block;
  545. }
  546. .newTip{
  547. position: absolute;
  548. top: 0;
  549. background-image: linear-gradient(#ff817b,#ff4443);
  550. color: #fff;
  551. padding: 2px 15px 5px 10px;
  552. border-bottom-right-radius: 50px;
  553. }
  554. .GEItext{
  555. position: absolute;
  556. bottom: 0;
  557. color: #fff;
  558. width: 100%;
  559. text-align: center;
  560. }
  561. .rightBox{
  562. width: 64%;
  563. /*height: 700px;*/
  564. border: 1px solid #ccc;
  565. position: relative;
  566. }
  567. /deep/::-webkit-scrollbar {
  568. width: 4px!important;
  569. }
  570. .bottomPage{
  571. display: inline-block;
  572. width:154px;
  573. height: 50px;
  574. text-align: center;
  575. position: absolute;
  576. left: 50%;
  577. bottom: 20px;
  578. transform: translate(-50%,0);
  579. }
  580. .bottomPage .rightBtn{
  581. display: inline-block;
  582. width: 32px;
  583. height: 32px;
  584. background-color: white;
  585. border: 1px solid #ddd;
  586. position: absolute;
  587. top: 0;
  588. left: 0;
  589. cursor: pointer;
  590. }
  591. .bottomPage button:active{
  592. border-color: #0ab8ed;
  593. outline: 1px solid #0ab8ed;
  594. }
  595. .bottomPage button:focus{
  596. border-color: #0ab8ed;
  597. outline: 1px solid #0ab8ed;
  598. }
  599. .bottomPage input:focus{
  600. outline: none;
  601. border:none;
  602. box-shadow: none;
  603. }
  604. .queryBtn{
  605. height: 30px;
  606. margin-top: 18px;
  607. line-height: 5px;
  608. background: #0ab8ed;
  609. color: #fff;
  610. cursor: pointer;
  611. }
  612. .weekgei{
  613. width: 95%;
  614. margin: 0 auto 20px;
  615. }
  616. .weeklyBox{
  617. height: 30px;
  618. color: #fff;
  619. line-height: 30px;
  620. background: #134d96;
  621. font-size: 16px;
  622. padding-left: 10px;
  623. }
  624. .pagination{
  625. width: 100%;
  626. margin-top: 10px;
  627. }
  628. /deep/.el-pagination__editor.el-input {
  629. width: 50px!important;
  630. }
  631. /deep/.el-pagination__editor.el-input .el-input__inner {
  632. width: 50px!important;
  633. }
  634. </style>