3.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <template>
  2. <div class="listNewsBox">
  3. <div class="listNewsTitle">
  4. <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
  5. <div>{{ titleLink.alias }}</div>
  6. </NuxtLink>
  7. </div>
  8. <!--样式1-->
  9. <div class="listNewsContent" v-if="componentStyle == 1">
  10. <div class="textLeft">
  11. <div class="textLeft_1">
  12. <div class="textLeft_1_top" v-for="item in component_style1_News1Array_img_1">
  13. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  14. :target="item.islink == 1 ? '_blank' : '_self'">
  15. <img :src="item.imgurl" alt="">
  16. <span>{{ item.title }}</span>
  17. </NuxtLink>
  18. </div>
  19. <div class="textLeft_1_bottom">
  20. <div v-for="item in component_style1_News1Array_img_2">
  21. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  22. :target="item.islink == 1 ? '_blank' : '_self'">
  23. <img :src="item.imgurl" alt="">
  24. <span>{{ item.title }}</span>
  25. </NuxtLink>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="textLeft_2">
  30. <div class="textleftContent">
  31. <div v-for="item in component_style1_News2Array_text_1">
  32. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  33. :target="item.islink == 1 ? '_blank' : '_self'">
  34. {{ item.title }}
  35. </NuxtLink>
  36. </div>
  37. </div>
  38. <div class="textleftContent">
  39. <div v-for="item in component_style1_News2Array_text_2">
  40. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  41. :target="item.islink == 1 ? '_blank' : '_self'">
  42. {{ item.title }}
  43. </NuxtLink>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="textRight">
  49. <div class="textRightContent">
  50. <div class="textRightContent_title">专题报道</div>
  51. <div class="textRightContent_content">
  52. <div v-for="item in component_style1_News1Array_img_3">
  53. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  54. :target="item.islink == 1 ? '_blank' : '_self'">
  55. <img :src="item.imgurl" alt="">
  56. <span>{{ item.title }}</span>
  57. </NuxtLink>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="textleftContent">
  62. <div v-for="item in component_style1_News2Array_text_3">
  63. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  64. :target="item.islink == 1 ? '_blank' : '_self'">
  65. {{ item.title }}
  66. </NuxtLink>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <!--样式2-->
  72. <div class="listNewsContent style2" v-if="componentStyle == 2">
  73. <div class="textLeft">
  74. <div class="textLeft_1">
  75. <div class="textLeft_1_top" v-for="item in component_style1_News1Array_img_1">
  76. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  77. :target="item.islink == 1 ? '_blank' : '_self'">
  78. <img :src="item.imgurl" alt="">
  79. <span>{{ item.title }}</span>
  80. </NuxtLink>
  81. </div>
  82. <div class="textLeft_1_bottom">
  83. <div v-for="item in component_style1_News1Array_img_2">
  84. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  85. :target="item.islink == 1 ? '_blank' : '_self'">
  86. <img :src="item.imgurl" alt="">
  87. <span>{{ item.title }}</span>
  88. </NuxtLink>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="textLeft_2">
  93. <div class="textleftContent">
  94. <div v-for="item in component_style1_News2Array_text_1">
  95. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  96. :target="item.islink == 1 ? '_blank' : '_self'">
  97. {{ item.title }}
  98. </NuxtLink>
  99. </div>
  100. </div>
  101. <div class="textleftContent">
  102. <div v-for="item in component_style1_News2Array_text_2">
  103. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  104. :target="item.islink == 1 ? '_blank' : '_self'">
  105. {{ item.title }}
  106. </NuxtLink>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="textRight">
  112. <div class="textRightContent">
  113. <div class="textRightContent_title">专题报道</div>
  114. <div class="textRightContent_content">
  115. <div v-for="item in component_style1_News1Array_img_3">
  116. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  117. :target="item.islink == 1 ? '_blank' : '_self'">
  118. <img :src="item.imgurl" alt="">
  119. <span>{{ item.title }}</span>
  120. </NuxtLink>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="textleftContent">
  125. <div v-for="item in component_style1_News2Array_text_3">
  126. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  127. :target="item.islink == 1 ? '_blank' : '_self'">
  128. {{ item.title }}
  129. </NuxtLink>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <!--样式3-->
  135. <div class="listNewsContent style3" v-if="componentStyle == 3">
  136. <div class="textLeft">
  137. <div class="textLeft_2">
  138. <div class="textleftContent">
  139. <div v-for="item in component_style1_News2Array_text_1">
  140. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  141. :target="item.islink == 1 ? '_blank' : '_self'">
  142. {{ item.title }}
  143. </NuxtLink>
  144. </div>
  145. </div>
  146. <div class="textleftContent">
  147. <div v-for="item in component_style1_News2Array_text_2">
  148. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  149. :target="item.islink == 1 ? '_blank' : '_self'">
  150. {{ item.title }}
  151. </NuxtLink>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="textLeft_1">
  156. <div class="textLeft_1_top" v-for="item in component_style1_News1Array_img_1">
  157. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  158. :target="item.islink == 1 ? '_blank' : '_self'">
  159. <img :src="item.imgurl" alt="">
  160. <span>{{ item.title }}</span>
  161. </NuxtLink>
  162. </div>
  163. <div class="textLeft_1_bottom">
  164. <div v-for="item in component_style1_News1Array_img_2">
  165. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  166. :target="item.islink == 1 ? '_blank' : '_self'">
  167. <img :src="item.imgurl" alt="">
  168. <span>{{ item.title }}</span>
  169. </NuxtLink>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <div class="textRight">
  175. <div class="textRightContent">
  176. <div class="textRightContent_title">专题报道</div>
  177. <div class="textRightContent_content">
  178. <div v-for="item in component_style1_News1Array_img_3">
  179. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  180. :target="item.islink == 1 ? '_blank' : '_self'">
  181. <img :src="item.imgurl" alt="">
  182. <span>{{ item.title }}</span>
  183. </NuxtLink>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="textleftContent">
  188. <div v-for="item in component_style1_News2Array_text_3">
  189. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  190. :target="item.islink == 1 ? '_blank' : '_self'">
  191. {{ item.title }}
  192. </NuxtLink>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. <!--样式4-->
  198. <div class="listNewsContent style4" v-if="componentStyle == 4">
  199. <div class="textLeft">
  200. <div class="textLeft_2">
  201. <div class="textleftContent">
  202. <div v-for="item in component_style1_News2Array_text_1">
  203. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  204. :target="item.islink == 1 ? '_blank' : '_self'">
  205. {{ item.title }}
  206. </NuxtLink>
  207. </div>
  208. </div>
  209. <div class="textleftContent">
  210. <div v-for="item in component_style1_News2Array_text_2">
  211. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  212. :target="item.islink == 1 ? '_blank' : '_self'">
  213. {{ item.title }}
  214. </NuxtLink>
  215. </div>
  216. </div>
  217. </div>
  218. <div class="textLeft_1">
  219. <div class="textLeft_1_top" v-for="item in component_style1_News1Array_img_1">
  220. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  221. :target="item.islink == 1 ? '_blank' : '_self'">
  222. <img :src="item.imgurl" alt="">
  223. <span>{{ item.title }}</span>
  224. </NuxtLink>
  225. </div>
  226. <div class="textLeft_1_bottom">
  227. <div v-for="item in component_style1_News1Array_img_2">
  228. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  229. :target="item.islink == 1 ? '_blank' : '_self'">
  230. <img :src="item.imgurl" alt="">
  231. <span>{{ item.title }}</span>
  232. </NuxtLink>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. <div class="textRight">
  238. <div class="textRightContent">
  239. <div class="textRightContent_title">专题报道</div>
  240. <div class="textRightContent_content">
  241. <div v-for="item in component_style1_News1Array_img_3">
  242. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  243. :target="item.islink == 1 ? '_blank' : '_self'">
  244. <img :src="item.imgurl" alt="">
  245. <span>{{ item.title }}</span>
  246. </NuxtLink>
  247. </div>
  248. </div>
  249. </div>
  250. <div class="textleftContent">
  251. <div v-for="item in component_style1_News2Array_text_3">
  252. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  253. :target="item.islink == 1 ? '_blank' : '_self'">
  254. {{ item.title }}
  255. </NuxtLink>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </template>
  262. <script setup>
  263. //引入vue
  264. import { ref } from 'vue';
  265. //获得新闻数据
  266. const props = defineProps({
  267. titleLink: Object,//板块名称
  268. templateData: Array,//新闻数据
  269. componentStyle: Number,//样式编号
  270. });
  271. // 新闻数据
  272. const component_style1_News1Array_img_1 = ref([]);
  273. const component_style1_News1Array_img_2 = ref([]);
  274. const component_style1_News1Array_img_3 = ref([]);
  275. const component_style1_News2Array_text_1 = ref([]);
  276. const component_style1_News2Array_text_2 = ref([]);
  277. const component_style1_News2Array_text_3 = ref([]);
  278. component_style1_News1Array_img_1.value = props.templateData.imgnum.slice(0, 1);
  279. component_style1_News1Array_img_2.value = props.templateData.imgnum.slice(1, 3);
  280. component_style1_News1Array_img_3.value = props.templateData.imgnum.slice(3, 5);
  281. component_style1_News2Array_text_1.value = props.templateData.textnum.slice(0, 4);
  282. component_style1_News2Array_text_2.value = props.templateData.textnum.slice(4, 8);
  283. component_style1_News2Array_text_3.value = props.templateData.textnum.slice(8, 12);
  284. </script>
  285. <style lang="less" scoped>
  286. //基本样式 start ---------------------------------------->
  287. .listNewsBox {
  288. position: relative;
  289. .listNewsTitle {
  290. display: flex;
  291. align-items: flex-start;
  292. justify-content: flex-start;
  293. // border-bottom: 1px solid #999999;
  294. height: 40px;
  295. div {
  296. height: 35px;
  297. width: 138px;
  298. line-height: 32px;
  299. font-size: 22px;
  300. font-weight: bold;
  301. cursor: pointer;
  302. overflow: hidden;
  303. text-overflow: ellipsis;
  304. white-space: nowrap;
  305. color: #154079;
  306. padding-bottom: 5px;
  307. background: url("http://192.168.1.234:19000/pre/image/png/20251218/1766042138413493.png") bottom left no-repeat;
  308. }
  309. }
  310. .dashed {
  311. border-bottom: 1px dashed #999999;
  312. }
  313. .listNewsContent {
  314. margin-top: 20px;
  315. display: flex;
  316. align-items: flex-start;
  317. justify-content: flex-start;
  318. margin-bottom: 20px;
  319. // .box1 {
  320. .textLeft {
  321. width: 788px;
  322. height: 416px;
  323. margin-right: 32px;
  324. display: flex;
  325. align-items: flex-start;
  326. justify-content: flex-start;
  327. .textLeft_1 {
  328. width: 380px;
  329. height: 416px;
  330. margin-right: 20px;
  331. .textLeft_1_top {
  332. position: relative;
  333. width: 380px;
  334. height: 268px;
  335. margin-bottom: 18px;
  336. img {
  337. width: 380px;
  338. height: 268px;
  339. }
  340. span {
  341. display: inline-block;
  342. position: absolute;
  343. bottom: 0;
  344. left: 0;
  345. width: 100%;
  346. height: 40px;
  347. line-height: 40px;
  348. font-size: 16px;
  349. font-weight: bold;
  350. color: #fff;
  351. padding-left: 10px;
  352. background-color: #ccc;
  353. box-sizing: border-box;
  354. }
  355. }
  356. .textLeft_1_bottom {
  357. width: 380px;
  358. height: 130px;
  359. display: flex;
  360. align-items: flex-start;
  361. justify-content: flex-start;
  362. div {
  363. position: relative;
  364. width: 185px;
  365. height: 130px;
  366. &:first-child {
  367. margin-right: 10px;
  368. }
  369. a {
  370. img {
  371. width: 185px;
  372. height: 130px;
  373. }
  374. span {
  375. display: inline-block;
  376. position: absolute;
  377. bottom: 0px;
  378. left: 0;
  379. width: 185px;
  380. height: 30px;
  381. line-height: 30px;
  382. font-size: 14px;
  383. font-weight: bold;
  384. color: #fff;
  385. text-align: center;
  386. background-color: #ccc;
  387. white-space: nowrap;
  388. overflow: hidden;
  389. text-overflow: ellipsis;
  390. padding: 0 5px;
  391. box-sizing: border-box;
  392. }
  393. }
  394. }
  395. }
  396. }
  397. .textLeft_2 {
  398. width: 378px;
  399. height: 416px;
  400. .textleftContent {
  401. width: 378px;
  402. height: 210px;
  403. &:first-child {
  404. border-bottom: 1px dashed #ccc;
  405. margin-bottom: 30px;
  406. }
  407. div {
  408. font-size: 18px;
  409. color: #666666;
  410. margin-bottom: 17px;
  411. padding-left: 8px;
  412. background: url("http://192.168.1.234:19000/pre/image/png/20251218/1766042944885873.png") no-repeat left center;
  413. &:first-child {
  414. height: 48px;
  415. line-height: 24px;
  416. font-weight: bold;
  417. color: #333333;
  418. padding-left: 0;
  419. background: none;
  420. a {
  421. color: #333333;
  422. }
  423. }
  424. &:nth-child(2),
  425. &:nth-child(3),
  426. &:nth-child(4) {
  427. color: #666666;
  428. white-space: nowrap;
  429. overflow: hidden;
  430. text-overflow: ellipsis;
  431. a {
  432. color: #666666;
  433. }
  434. }
  435. &:last-child {
  436. margin-bottom: 0;
  437. }
  438. }
  439. }
  440. }
  441. }
  442. .textRight {
  443. width: 380px;
  444. height: 417px;
  445. .textRightContent {
  446. width: 380px;
  447. height: 210px;
  448. &:first-child {
  449. border-bottom: 1px dashed #ccc;
  450. margin-bottom: 30px;
  451. }
  452. .textRightContent_title {
  453. font-size: 20px;
  454. font-weight: bold;
  455. color: #154079;
  456. margin-bottom: 23px;
  457. }
  458. .textRightContent_content {
  459. width: 380px;
  460. height: 130px;
  461. display: flex;
  462. align-items: flex-start;
  463. justify-content: flex-start;
  464. div {
  465. width: 185px;
  466. height: 130px;
  467. position: relative;
  468. a {
  469. img {
  470. width: 185px;
  471. height: 130px;
  472. }
  473. span {
  474. position: absolute;
  475. bottom: 0;
  476. left: 0;
  477. display: inline-block;
  478. width: 185px;
  479. height: 30px;
  480. line-height: 30px;
  481. font-size: 14px;
  482. font-weight: bold;
  483. color: #fff;
  484. text-align: center;
  485. background-color: #ccc;
  486. white-space: nowrap;
  487. overflow: hidden;
  488. text-overflow: ellipsis;
  489. padding: 0 5px;
  490. box-sizing: border-box;
  491. }
  492. }
  493. &:first-child {
  494. margin-right: 10px;
  495. }
  496. }
  497. }
  498. }
  499. .textleftContent {
  500. width: 378px;
  501. height: 210px;
  502. &:first-child {
  503. border-bottom: 1px dashed #ccc;
  504. margin-bottom: 30px;
  505. }
  506. div {
  507. font-size: 18px;
  508. color: #666666;
  509. margin-bottom: 17px;
  510. padding-left: 8px;
  511. background: url("http://192.168.1.234:19000/pre/image/png/20251218/1766042944885873.png") no-repeat left center;
  512. &:first-child {
  513. height: 48px;
  514. line-height: 24px;
  515. font-weight: bold;
  516. color: #333333;
  517. padding-left: 0;
  518. background: none;
  519. a {
  520. color: #333333;
  521. }
  522. }
  523. &:nth-child(2),
  524. &:nth-child(3),
  525. &:nth-child(4) {
  526. color: #666666;
  527. white-space: nowrap;
  528. overflow: hidden;
  529. text-overflow: ellipsis;
  530. a {
  531. color: #666666;
  532. }
  533. }
  534. &:last-child {
  535. margin-bottom: 0;
  536. }
  537. }
  538. }
  539. }
  540. // }
  541. }
  542. //样式2
  543. .style2 {
  544. .textLeft {
  545. .textLeft_2 {
  546. .textleftContent {
  547. div {
  548. padding-left: 8px;
  549. background: url("http://192.168.1.234:19000/pre/image/png/20251218/176604296168575.png") no-repeat left center;
  550. }
  551. }
  552. }
  553. }
  554. .textRight {
  555. .textleftContent {
  556. div {
  557. padding-left: 8px;
  558. background: url("http://192.168.1.234:19000/pre/image/png/20251218/176604296168575.png") no-repeat left center;
  559. }
  560. }
  561. }
  562. }
  563. // 样式3
  564. .style3 {
  565. .textLeft {
  566. margin-right: 28px;
  567. .textLeft_2 {
  568. margin-right: 30px;
  569. }
  570. .textLeft_1 {
  571. margin-right: 0px;
  572. }
  573. }
  574. }
  575. // 样式4
  576. .style4 {
  577. .textLeft {
  578. margin-right: 28px;
  579. .textLeft_2 {
  580. margin-right: 30px;
  581. .textleftContent {
  582. div {
  583. padding-left: 8px;
  584. background: url("http://192.168.1.234:19000/pre/image/png/20251218/176604296168575.png") no-repeat left center;
  585. }
  586. }
  587. }
  588. .textLeft_1 {
  589. margin-right: 0px;
  590. }
  591. }
  592. .textRight {
  593. .textleftContent {
  594. div {
  595. padding-left: 8px;
  596. background: url("http://192.168.1.234:19000/pre/image/png/20251218/176604296168575.png") no-repeat left center;
  597. }
  598. }
  599. }
  600. }
  601. }
  602. </style>