NationalregionalCommissionsDetailds.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <div>
  3. <div class="autoBox box">
  4. <div style="margin-left: 20px;">
  5. <el-breadcrumb separator="/" style="float: left;margin-left:15px; ">
  6. <el-breadcrumb-item :to="{ path: 'home' }">{{$t('common.Home')}}</el-breadcrumb-item>
  7. <el-breadcrumb-item :to="{ path: 'nationalregionalCommittees' }">{{$t('common.NationalregionalCommissions')}}</el-breadcrumb-item>
  8. <el-breadcrumb-item :to="{ path: 'nationalregionalCommittees', name:'nationalregionalCommittees', params: { key: 'activities',lable: 'common.Committeeactivities' }}">{{$t(Screens)}}</el-breadcrumb-item>
  9. <el-breadcrumb-item >{{committeeActivityInfo.activityTypeDict== '1'? $t('common.ActivitiesInfo'):$t('common.DynamicInfo')}}</el-breadcrumb-item>
  10. </el-breadcrumb>
  11. <!-- <el-breadcrumb separator="/" style="float: right;margin:0px 15px 15px 0" >
  12. <span class="cursor" :class="screenIndex == item.value?'screen1':'screen2'" @click="realTimeInfoScreen(item,index)"
  13. v-for="(item,index) in realTimeInfoScreens">
  14. &nbsp;&nbsp;{{$t(item.lable)}} &nbsp;&nbsp;
  15. </span>
  16. </el-breadcrumb> -->
  17. </div>
  18. <div style="margin-top: 30px;width: 100%;height: 260px;margin-left: 20px;">
  19. <div style="float: left;width: 55%;height: 100%;">
  20. <img v-if="committeeActivityInfo.activityLogo" :src="'api/file/pub/' + committeeActivityInfo.activityLogo" alt="" style=" width:100%;height:260px;">
  21. <img v-else src="@/assets/img/nationaIntorduction/lavle.png" alt="" style="width: 100%;height: 260px;">
  22. </div>
  23. <div style="float: left;width: 42%;height: 100%;position: relative;">
  24. <!-- <span style="position: absolute;top: 0;right: 0;font-size: 14px;
  25. color: #0000ff;cursor: pointer;">分享</span> -->
  26. <div style="margin-top: 20px;width: 100%;">
  27. <div style="line-height: 25px;text-align: left;margin-left: 50px;
  28. font-weight: 700;">
  29. {{committeeActivityInfo.activityName}}
  30. </div>
  31. <div style="width: 100%;line-height: 15px;font-size: 14px;">
  32. <p style="margin-left: 50px;margin-right: 15px;">
  33. {{$t('common.Committee')}}:{{$i18n.locale=='zh'?committeeZH:committeeEN}}
  34. </p>
  35. <p style="margin-left: 50px;margin-right: 15px;">
  36. {{$t('common.place')}}:{{committeeActivityInfo.activityPlace}}
  37. </p>
  38. <p style="margin-left: 50px;margin-right: 15px;">
  39. {{$t('common.line')}}:{{committeeActivityInfo.activityTime}}
  40. </p>
  41. <div style="width: 80%;font-size: 14px;
  42. -webkit-box-orient: vertical;
  43. position:relative;
  44. overflow: hidden;
  45. line-height:1.4em;
  46. text-overflow: ellipsis;
  47. -webkit-line-clamp:2;
  48. display:-webkit-box;
  49. color: #666666;margin-left: 50px;line-height: 25px;margin-top: -10px;"
  50. @click="dialogVisibleChange">
  51. {{committeeActivityInfo.activityIntroduction}}
  52. </div>
  53. <div style="font-size: 14px;height: 40px;text-align: center;margin-top: 20px;" v-if="committeeActivityInfo.activityTypeDict =='1' && formatUrl">
  54. <el-button type="primary"
  55. v-if="signUpFlag"
  56. @click=signUp(committeeActivityInfo.registrationUrl)
  57. round
  58. style="width: 140px;height: 24px;line-height: 4px">
  59. {{$t('common.signUp')}}
  60. </el-button>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div style="padding: 20px 20px 20px 30px;min-height: 400px;" v-if="committeeActivityInfo.activityReviewUe">
  67. <div v-html="committeeActivityInfo.activityReviewUe" class="coo_box"></div>
  68. </div>
  69. <div style="padding: 20px 20px 20px 30px;min-height: 400px;" v-else>
  70. <div v-html="committeeActivityInfo.activityPreviewUe" class="coo_box"></div>
  71. </div>
  72. <!-- 精彩回顾 -->
  73. <div id="wrap" >
  74. <ul id="film" ref="wrapScrool">
  75. <li v-for="(item,index) in photos" :key="index + 2" style="margin-left: 20px;">
  76. <div>
  77. <img :src="item" alt style="width: 100%;height: 150px;" v-if="item"/>
  78. <img :src="'api/file/pub/def/projectdefault.png'" alt
  79. style="width: 100%;height: 150px;" v-else/>
  80. </div>
  81. </li>
  82. </ul>
  83. </div>
  84. <!-- 附件 -->
  85. <span style="margin:0 20px; " v-if="countryList && countryList.length>0 && committeeActivityInfo.activityTypeDict != 1">
  86. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt="" style="height: 20px;vertical-align: middle;">
  87. {{$t('common.Enclosure')}}
  88. </span>
  89. <hr style="margin:10px 20px;" v-if="countryList && countryList.length>0 && committeeActivityInfo.activityTypeDict != 1">
  90. <div class="result" v-for="(item,index) in countryList" v-if="committeeActivityInfo.activityTypeDict =='2'">
  91. <div >
  92. <!-- <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt="" style="height: 100%;vertical-align: middle;"> -->
  93. <!-- <span style="margin-left: 10px;font-weight: 700;color: #000;font-size: 18px;"></span> -->
  94. </div>
  95. <div class="content">
  96. <i></i>
  97. <div>
  98. <img v-if="state==1" :src="'./api/file/pub/'+ item.attachmentSavePath" alt="" style="width: 10%;height: 10%;" />
  99. <img v-if="state==2" src="@/assets/img/cooperationExchange/txt.png" alt="" class="Messicon" />
  100. <img v-if="state==3" src="@/assets/img/cooperationExchange/excel.png" alt="" class="Messicon" />
  101. <img v-if="state==6" src="@/assets/img/cooperationExchange/powerpoint.png" alt="" class="Messicon"/>
  102. <img v-if="state==5" src="@/assets/img/cooperationExchange/pdf.png" alt="" class="Messicon"/>
  103. <img v-if="state==4" src="@/assets/img/cooperationExchange/word.png" alt="" class="Messicon"/>
  104. <p style="display: inline-block;margin-right:150px;vertical-align:top">{{item.attachmentName}}</p>
  105. <div style="height: 50px;background-color: #fff;width: 100%;">
  106. <a class="func example" @click="downloads(item.attachmentSavePath,item.attachmentName)">{{$t('common.download')}}</a>
  107. <a class="func" @click="download(item.attachmentSavePath)">{{$t('common.preview')}}</a>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <!-- <div style="margin: 10px 20px;">
  113. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt=""
  114. style="height: 20px;vertical-align: middle;">
  115. 活动概述
  116. </div>
  117. <div style="margin: 10px 20px;">
  118. asdsad
  119. </div>
  120. <div style="margin: 10px 20px;">
  121. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt=""
  122. style="height: 20px;vertical-align: middle;">
  123. 活动专家介绍
  124. </div>
  125. <div style="margin: 10px 20px;">
  126. asdsad
  127. </div>
  128. <div style="margin: 10px 20px;">
  129. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt=""
  130. style="height: 20px;vertical-align: middle;">
  131. 活动亮点
  132. </div>
  133. <div style="margin: 10px 20px;">
  134. asdsad
  135. </div>
  136. <div style="margin: 10px 20px;">
  137. <img src="@/assets/img/cooperationExchange/20200608_03.gif" alt=""
  138. style="height: 20px;vertical-align: middle;">
  139. 活动议程
  140. </div>
  141. <div style="margin: 10px 20px;">
  142. asdsad
  143. </div> -->
  144. <el-dialog
  145. :title="$t('common.InformationDetails')"
  146. :visible.sync="dialogVisible"
  147. width="35%">
  148. <span style="line-height: 29px;font-size: 18px;word-break:normal;" v-html="committeeActivityInfo.activityIntroduction"></span>
  149. </el-dialog>
  150. </div>
  151. </div>
  152. </template>
  153. <script>
  154. import {countryZh, countryEn,getList} from '@/api/country'
  155. import {activityInfos, countryNationalSpace} from '@/api/cooperation/baseCooperationUnit'
  156. import GlobalRoaming from "@/components/GlobalRoaming";
  157. import {sysAttachmentInfos} from '@/api/cooperation/baseCooperationUnit';
  158. import {getToken, resetToken} from "@/utils/auth";
  159. import {saveFollowModel} from "@/api/operation/basePortalModelFollowInfo";
  160. import {getCommitteeActivityInfo} from '@/api/committee/committeeActivityInfo'
  161. import Base from "@/views/base/Base";
  162. export default {
  163. name: 'NationalregionalCommissionsDetailds',
  164. extends: Base,
  165. data() {
  166. return {
  167. index: 1,
  168. projectList:[],
  169. i: '0',
  170. id: this.$route.query.key,
  171. language:'',
  172. Screens:"common.Committeeactivities",
  173. committeeActivityInfo: {},
  174. photos:[],
  175. photosNum:0,
  176. countryList:[],
  177. basisInfo:[],
  178. committeeEN:'',
  179. committeeZH:'',
  180. realTimeInfoScreens:[{
  181. lable:"common.BriefintroductiontotheCommittee",
  182. value:'introduc'
  183. },{
  184. lable:"common.Committeelayout",
  185. value:'layout'
  186. },{
  187. lable:"common.Committeeactivities",
  188. value:'activities'
  189. }],
  190. now:null,// 存储系统当前时间
  191. signUpFlag:false,
  192. dialogVisible:false,
  193. }
  194. },
  195. watch: {
  196. "$i18n.locale"() {
  197. this.getInitData();
  198. },
  199. "toViewLogin"(){
  200. if(this.toViewLogin==true){
  201. this.loginTipsChange()
  202. }
  203. },
  204. },
  205. computed:{
  206. formatUrl(){
  207. let url = this.committeeActivityInfo?.registrationUrl.replace(/\s+/g, "")
  208. return !!url?true:false
  209. }
  210. },
  211. mounted() {
  212. this.getInitData();
  213. },
  214. methods: {
  215. dialogVisibleChange(){
  216. this.dialogVisible=true;
  217. },
  218. signUp(url){
  219. if(url.indexOf('http') == -1){
  220. url = 'http://' + url
  221. }
  222. window.open(url,'_blank')
  223. },
  224. selectBlur(e) {
  225. },
  226. realTimeInfoScreen(i,value){
  227. this.toView('nationalregionalCommittees',i.value)
  228. },
  229. follow() {
  230. if (this.ifcommon) {
  231. this.followActivitie("unfollow");
  232. } else {
  233. this.followActivitie("follow");
  234. }
  235. },
  236. followActivitie(followType){
  237. let user = window.localStorage.getItem("user");
  238. if (!this.$Cookies.get('token')) {
  239. // this.$message.warning("请先登录");
  240. // this.$confirm('检测到您未登录,是否登录')
  241. // .then(_ => {
  242. // this.toView('login');
  243. // })
  244. // .catch(_ => {});
  245. this.toViewLogin = true;
  246. } else {
  247. var users = JSON.parse(user);
  248. var token = "" + getToken();
  249. var projectId = this.countryList.baseActivityEntityId;
  250. var userId = users.userId;
  251. // 接口逻辑
  252. this.submitHandler((token) => {
  253. saveFollowModel(projectId, "activity", userId, followType, token)
  254. .then((result) => {
  255. this.$message({
  256. message: result.data,
  257. type: "success",
  258. });
  259. this.ifcommon = !this.ifcommon;
  260. this.resetToken();
  261. })
  262. .catch((error) => {
  263. // 此处你的业务代码
  264. });
  265. });
  266. }
  267. },
  268. // 未登录跳转
  269. loginTipsChange(){
  270. const that=this;
  271. this.num =5;
  272. // clearInterval(timer_interval);
  273. this.timer = setInterval(function() {
  274. if (that.num > 0) {
  275. that.num--;
  276. } else {
  277. if(that.toViewLogin==true){
  278. clearInterval(that.timer);
  279. that.toView('login');
  280. }else {
  281. clearInterval(that.timer);
  282. }
  283. }
  284. }, 1000)
  285. },
  286. // 判断未登录跳转是否关闭
  287. toViewLoginChange(done){
  288. this.toViewLogin=false;
  289. this.num=5;
  290. clearInterval(this.timer);
  291. },
  292. getPassAreaCode(code){
  293. this.select = code;
  294. this.formLabelAlign.selectCode = code;
  295. },
  296. getInitData() {
  297. var nowDate = Math.round(new Date().getTime());
  298. this.now = nowDate;
  299. let list={
  300. entityId: this.id,
  301. language:this.$i18n.locale.toUpperCase()
  302. }
  303. getCommitteeActivityInfo(list).then(res => {
  304. var data = res.data;
  305. this.committeeZH='';
  306. this.committeeEN='';
  307. if(data){
  308. this.committeeActivityInfo = res.data.committeeActivityInfo || {};
  309. this.basisInfo = res.data.basisInfo || [];
  310. this.basisInfo.forEach((i)=>{
  311. if (i.language=="ZH"){
  312. this.committeeZH =this.committeeZH+' '+i.name
  313. }else if(i.language=="EN") (
  314. this.committeeEN =this.committeeEN+' '+i.name
  315. )
  316. })
  317. var photoUrl = res.data.committeeActivityInfo.pictures;
  318. if('' != photoUrl){
  319. this.photos = photoUrl.split(',');
  320. this.photos.forEach((item,index) =>{
  321. if(''!=item){
  322. this.photos[index] = "./api/file/pub/"+item;
  323. }
  324. });
  325. this.photosNum = this.photos.length
  326. this.$nextTick(() => {
  327. let linode = [this.$refs.wrapScrool][0].children;
  328. if (linode.length > 5) {
  329. var film = {
  330. imageNumWidth: 240,
  331. time: 3000,
  332. numindex: 0,
  333. ulbox: document.getElementById("film"),
  334. linodes: document.getElementById("film").getElementsByTagName("li"),
  335. li_count: document.getElementById("film").getElementsByTagName("li").length,
  336. animate: null,
  337. autoplay: null,
  338. //初始化
  339. init: function () {
  340. film.ulbox.innerHTML = film.ulbox.innerHTML + film.ulbox.innerHTML;
  341. film.ulbox.style.left = "0px";
  342. film.autoplay = setInterval(function () { film.play(film.numindex + 1) }, film.time);
  343. },
  344. //添加动画
  345. play: function (ele) {
  346. const that = this;
  347. var ulbox_left = parseInt(film.ulbox.style.left);
  348. if (ele > film.li_count) {
  349. ele -= film.li_count;
  350. film.numindex -= film.li_count;
  351. film.ulbox.style.left = "0px";
  352. ulbox_left = parseInt(film.ulbox.style.left);
  353. }
  354. //添加animate,等同于css中animate
  355. if (ele > film.numindex) {
  356. film.animate = setInterval(function () {
  357. if (parseInt(film.ulbox.style.left) > (ulbox_left - film.imageNumWidth * (ele - film.numindex) + film.imageNumWidth * (ele - film.numindex) / 10)) {
  358. film.ulbox.style.left = parseInt(film.ulbox.style.left) - film.imageNumWidth * (ele - film.numindex) / 10 + "px";
  359. } else {
  360. film.ulbox.style.left = ulbox_left - film.imageNumWidth * (ele - film.numindex) + "px";
  361. clearInterval(film.animate);
  362. film.numindex = ele;
  363. film.animate = null;
  364. }
  365. }, 30)
  366. }
  367. }
  368. }
  369. film.init()
  370. film.play(0)
  371. }
  372. })
  373. }
  374. if(this.now >= this.committeeActivityInfo.registrationStartTime && this.committeeActivityInfo.registrationEndTime >= this.now){
  375. this.signUpFlag = true;
  376. }
  377. if(this.committeeActivityInfo.id){
  378. let attacList = {
  379. attachmentBusinessId:this.committeeActivityInfo.id,
  380. attachmentBusinessType:'committeeActivityInfo'
  381. };
  382. sysAttachmentInfos(attacList).then(results=>{
  383. if(results){
  384. this.countryList = results.data.attachmentInfos;
  385. console.log('this.countryList')
  386. console.log(this.countryList)
  387. //进行上传文件的判断
  388. let messName = this.countryList[0].attachmentName;
  389. let suffix='';
  390. let result='';
  391. try{
  392. let splitArr = this.countryList[0].attachmentName.split('.');
  393. suffix = splitArr[splitArr.length-1];
  394. }catch(err){
  395. suffix='';
  396. }
  397. const imglist = ['png', 'jpg', 'jpeg', 'bmp', 'gif'];
  398. // 进行图片匹配
  399. result = imglist.find(item => item === suffix);
  400. for(let i=0;i<imglist.length;i++){
  401. if(suffix === imglist[i]){
  402. this.state=1;
  403. }
  404. }
  405. // 匹配txt
  406. const txtlist = ['txt'];
  407. result = txtlist.find(item => item === suffix);
  408. for(let i=0;i<txtlist.length;i++){
  409. if(suffix === txtlist[i]){
  410. this.state=2;
  411. }
  412. }
  413. // 匹配excel
  414. const excelist = ['xls', 'xlsx'];
  415. result = excelist.find(item => item === suffix);
  416. for(let i=0;i<excelist.length;i++){
  417. if(suffix === excelist[i]){
  418. this.state=3;
  419. }
  420. }
  421. // 匹配 word
  422. const wordlist = ['doc', 'docx'];
  423. result = wordlist.find(item => item === suffix);
  424. for(let i=0;i<wordlist.length;i++){
  425. if(suffix === wordlist[i]){
  426. this.state=4;
  427. }
  428. }
  429. // 匹配 pdf
  430. const pdflist = ['pdf'];
  431. result = pdflist.find(item => item === suffix);
  432. for(let i=0;i<pdflist.length;i++){
  433. if(suffix === pdflist[i]){
  434. this.state=5;
  435. }
  436. }
  437. // 匹配 ppt
  438. const pptlist = ['ppt', 'pptx'];
  439. result = pptlist.find(item => item === suffix);
  440. for(let i=0;i<pptlist.length;i++){
  441. if(suffix === pptlist[i]){
  442. this.state=6;
  443. }
  444. }
  445. // let Messname = this.countruList[index].attachmentName;
  446. // this.MessType = Messname
  447. }else{
  448. this.countryList = null;
  449. }
  450. })
  451. }
  452. }else{
  453. this.committeeActivityInfo = {};
  454. if(this.$i18n.locale =='zh'){
  455. this.$message({
  456. message: '无当前版本',
  457. type: 'error'
  458. });
  459. }else{
  460. this.$message({
  461. message: 'No current version',
  462. type: 'error'
  463. });
  464. }
  465. }
  466. })
  467. // this.activityStatusMap.set('活动中', 'Live');
  468. // this.activityStatusMap.set('已结束', 'Closed');
  469. // this.activityStatusMap.set('未开始', 'Upcoming');
  470. // this.activityStatusMap.set('报名中', 'Registration open')
  471. },
  472. getIconUrl(url) {
  473. return require("@/assets/img/cooperationExchange/" + url);
  474. },
  475. toView(router, json) {
  476. this.$router.push({name: router, params: {key: json}})
  477. },
  478. screenBack(data) {
  479. console.log(data, 'screenBackscreenBackscreenBackscreenBack')
  480. },
  481. screens(item, index) {
  482. this.i = i.value;
  483. },
  484. downloads(path,fileName){
  485. const link = document.createElement('a');
  486. link.href = "api/file/pub/" + path;
  487. link.download = fileName; //下载的文件名
  488. link.click();
  489. },
  490. download(url){
  491. let a = document.createElement('a');
  492. a.href ="api/file/pub/" + url;
  493. a.click();
  494. },
  495. }
  496. }
  497. </script>
  498. <style scoped>
  499. .content{
  500. vertical-align: center;
  501. margin-top: 20px;
  502. padding:0 30px;
  503. cursor: pointer;
  504. width: 100%;
  505. }
  506. .func{
  507. color: rgb(10, 15, 255);
  508. margin-right: 20px;
  509. cursor: pointer;
  510. float: right;
  511. margin-right: 100px;
  512. line-height: 50px;
  513. }
  514. .box {
  515. margin-top: 10px;
  516. background: #fff;
  517. padding-top: 20px;
  518. padding-bottom: 10px;
  519. }
  520. body {
  521. margin: 0;
  522. }
  523. .screen1 {
  524. background: linear-gradient(180deg, #3280E2 0%, #144E97 100%);
  525. border-radius: 20px 20px 20px 20px;
  526. padding: 8px 12px;
  527. color: #F0F3F8;
  528. margin-left: 10px;
  529. }
  530. .screen2 {
  531. font-size: 14px;
  532. background: linear-gradient(180deg, #B4D5FF 0%, #4F81BF 100%);
  533. border-radius: 20px;
  534. padding: 8px 12px;
  535. color: #165099;
  536. margin-left: 10px;
  537. }
  538. .Introduction {
  539. margin-top: 20px;
  540. }
  541. .Introduction li {
  542. float: left;
  543. width: 31%;
  544. height: 400px;
  545. margin-right: 22px;
  546. background: skyblue;
  547. }
  548. .el-button.is-round {
  549. padding: 0
  550. }
  551. .el-input{
  552. width: 400px;
  553. /* line-height: 52px; */
  554. }
  555. .el-input>>>.el-input__inner{
  556. height: 50px;
  557. /* width: 200px; */
  558. }
  559. .el-select>>>.el-input__inner{
  560. height: 50px;
  561. }
  562. .el-form-item>>>.el-form-item__label {
  563. padding-top: 5px;
  564. }
  565. .dcp_input /deep/.el-input__inner {
  566. width: 150px;
  567. }
  568. .dcp_input /deep/.el-select {
  569. width: 150px;
  570. }
  571. .el-select-dropdown {
  572. width: 400px!important;
  573. }
  574. .Messicon{
  575. height: 30px;
  576. margin-top: 12px;
  577. float: left;
  578. margin-right: 10px;
  579. }
  580. #wrap{
  581. width:100%;
  582. overflow: hidden;
  583. position:relative;
  584. height:150px;
  585. margin: 16px auto;
  586. }
  587. #film{
  588. position: absolute;
  589. width: 40000px;
  590. }
  591. #film li{
  592. width: 198px;
  593. height: 150px;
  594. margin-right: 20px;
  595. float: left;
  596. }
  597. #film li img{
  598. width: 100%;
  599. }
  600. </style>