RealTimeInfoItemInfo.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div>
  3. <div class="autoBox box RealTimeInfo" style="padding-top: 0;">
  4. <!-- 主体部分 -->
  5. <div>
  6. <div style="height: 45px;line-height: 45px;" class="realTimeInfo_scree">
  7. <span class="cursor" v-for="(i,index) in realTimeInfo_scree" @click="realTimeInfoScreensChange(i,index)"
  8. :class="index==realTimeInfoScreenItem?'span1':'span2'">{{i.label=='common.LatestNews'?$t('common.LatestNews'):i.label}}</span>
  9. </div>
  10. <div style="height: 120px;position: relative;">
  11. <div style="margin-top: 15px;position: absolute;
  12. left: 18%;top: 20%;transform: translate(-50%,-50%);color: #5083ba;font-weight: 700;" >
  13. {{ $t('common.Informationsearch')}}
  14. </div>
  15. <div style="margin-top: 15px;width: 50%;position: absolute;
  16. left: 50%;top: 20%;transform: translate(-50%,-50%);">
  17. <el-input :placeholder="$t('common.EnterContent')" v-model="page.title" class="input-with-select">
  18. <el-button slot="append" icon="el-icon-search" @click="getData"></el-button>
  19. </el-input>
  20. </div>
  21. <div style="margin-top: 15px;position: absolute;
  22. right: 15%;top: 20%;transform: translate(-50%,-50%);color: #5083ba;font-weight: 700;" :style="$i18n.locale=='en'?'right:7%':''">
  23. {{ $t('common.AdvancedSearch')}}
  24. </div>
  25. <div style="width: 100%;position: absolute;left: 0px;top: 65%;">
  26. <div class="Information">
  27. <span class="dcp_infor"> {{ $t('common.LatestNews')}}</span>
  28. <span style="color: #bebebe;" class="dcp_infor2 cursor">{{ $t('common.publish')}}<span class="el-icon-edit-outline"></span></span>
  29. <span style="color: #bebebe;" class="cursor" @click="toView('RealTimeInfoMoreInfo','')">{{ $t('common.More')}} <span class="el-icon-arrow-right"></span></span>
  30. </div>
  31. </div>
  32. </div>
  33. <div style="height: 350px;position: relative;">
  34. <div style="width: 65%;height: 350px;position: absolute;">
  35. <div style="width: 33%;height: 100%;float: left;">
  36. <ul>
  37. <li>
  38. <img :src="'/api/file/pub/' + i.pictureUrl" style="width: 100%;height: 160px;margin-top: 8px;" alt="" v-for="(i,index) in img">
  39. </li>
  40. </ul>
  41. </div>
  42. <div style="width: 67%;height: 100%;float: right;">
  43. <ul class="lableStyle">
  44. <li v-for="(item,index) in info" :class="item.icon?'lableStyle1':'lableStyle2'"
  45. class="cursor"
  46. @click="toView('realTimeInfoItemdetails',item.baseEntityId)">
  47. <span class="spot"></span>
  48. <span>{{item.title}}</span>
  49. </li>
  50. </ul>
  51. </div>
  52. </div>
  53. <div style="width: 34%;height: 350px;position: absolute;top: 0;right: 0;">
  54. <img src="@/assets/img\home/u5114.png" alt="">
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import Base from "@/views/base/Base";
  63. import {cmsInformationViews} from "@/api/baseUnitView";
  64. import {getDicts} from '@/api/dict';
  65. export default {
  66. name: 'realTimeInfoItemInfo',
  67. extends: Base,
  68. data () {
  69. return {
  70. realTimeInfo_scree:[],
  71. realTimeInfoScreenItem:0,
  72. page:{
  73. pageSize:12,
  74. pageNo:1,
  75. businessType:"information",
  76. typeDict:null,
  77. title:''
  78. },
  79. img:[],
  80. info:[]
  81. }
  82. },
  83. watch:{
  84. '$i18n.locale'(){
  85. this.toInitData();
  86. this.getData();
  87. }
  88. },
  89. mounted() {
  90. this.toInitData();
  91. this.getData();
  92. },
  93. methods:{
  94. toInitData: function () {
  95. getDicts(this.$i18n.locale=='en'?"CMS_INFORMATION_TYPE_DICT_EN":"CMS_INFORMATION_TYPE_DICT").then((result) => {
  96. if(result.data){
  97. this.realTimeInfo_scree = result.data[0] ||[];
  98. let both={
  99. label:'common.LatestNews',
  100. value:null
  101. };
  102. this.realTimeInfo_scree.unshift(both);
  103. }
  104. });
  105. },
  106. getData(){
  107. this.page.language=this.$i18n.locale.toUpperCase();
  108. cmsInformationViews(this.page).then(res=>{
  109. var data = res.data;
  110. if(data){
  111. this.img = [];
  112. this.info = data.allDataList||[];
  113. var count = 0;
  114. this.info.forEach(element=>{
  115. if(element.pictureUrl && this.img.length <2){
  116. this.img.push(element);
  117. }
  118. })
  119. }
  120. });
  121. },
  122. getIconUrl(url){
  123. return require("@/assets/img/realTimeInfo/"+url);
  124. },
  125. toView(router,json){
  126. this.$store.commit('modify', router);
  127. this.$router.push({name:router,params:{key:json}});
  128. },
  129. screenBack(data){
  130. console.log(data,'screenBackscreenBackscreenBackscreenBack');
  131. },
  132. realTimeInfoScreensChange(i,index){
  133. this.realTimeInfoScreenItem=index;
  134. this.page.typeDict=i.value;
  135. this.page.title='';
  136. this.getData();
  137. console.log(i)
  138. }
  139. }
  140. }
  141. </script>
  142. <style scoped>
  143. ul{
  144. margin: 0;
  145. padding: 0;
  146. }
  147. .box,.boxs {
  148. margin-top: 10px;
  149. background: #fff;
  150. padding-bottom: 10px;
  151. }
  152. .boxs {
  153. padding-bottom:30px;
  154. }
  155. body {
  156. margin: 0;
  157. }
  158. .screen1 {
  159. color:#2c5589;
  160. }
  161. .screen2 {
  162. font-size: 14px;
  163. color:#bebebe;
  164. }
  165. li {
  166. display: inline-block;
  167. margin-left: 6px;
  168. padding: 0 2px;
  169. color: #1251A7;
  170. }
  171. .realTimeInfo_scree .span1,
  172. .realTimeInfo_scree .span2{
  173. color: #fff;
  174. padding: 0 10px;
  175. font-size: 13px;
  176. display: inline-block;
  177. height: 100%;
  178. background: #2c5589;
  179. /* margin-right: 30px; */
  180. width: 90px;
  181. text-align: center;
  182. }
  183. .realTimeInfo_scree .span2 {
  184. background: #fff;
  185. color: #1251A7;
  186. }
  187. .RealTimeInfo >>>.el-input__inner {
  188. height: 50px !important;
  189. }
  190. .RealTimeInfo >>>.el-input-group__prepend {
  191. background-color: #fff;
  192. color: #000;
  193. }
  194. .Information {
  195. border-bottom: 1px solid #bebebe;
  196. }
  197. .Information span {
  198. font-size: 14px;
  199. display: inline-block;
  200. padding: 6px 0;
  201. }
  202. .Information .dcp_infor {
  203. margin-right: 500px;
  204. color: #2c5589;
  205. font-weight: 700;
  206. font-size: 15px;
  207. padding-left: 20px;
  208. }
  209. .Information .dcp_infor2 {
  210. margin-right: 30px;
  211. }
  212. .lableStyle li {
  213. display: block;
  214. }
  215. .lableStyle1,
  216. .lableStyle2 {
  217. color: #666;
  218. font-size: 14px;
  219. line-height: 29px;
  220. padding-left: 10px;
  221. }
  222. .lableStyle1 {
  223. font-size: 16px;
  224. font-weight: 600;
  225. }
  226. .spot {
  227. display: inline-block;
  228. width: 6px;
  229. height: 6px;
  230. background-color: #999;
  231. margin-right: 5px;
  232. margin-bottom:2px;
  233. }
  234. .cursor:hover {
  235. color: #ff0000;
  236. }
  237. </style>