career_story1.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div class="university_details_video">
  3. <head-component :headinfo=headinfo></head-component>
  4. <div class="page-content">
  5. <div class="page-img-box">
  6. <!-- 生涯故事1-->
  7. <div>
  8. <div class="item-box" v-for="(item,index) in list" @click="toDetail(item)">
  9. <div class="top">
  10. <p class="title" v-html="item.title"></p>
  11. <p class="details">详情 ></p>
  12. </div>
  13. <div class="content" >{{ safeTruncate(item.content, 50) }}...</div>
  14. </div>
  15. </div>
  16. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  17. v-model:limit="queryParams.pageSize" @pagination="query"/>
  18. </div>
  19. <drag_component></drag_component>
  20. </div>
  21. </div>
  22. </template>
  23. <script setup>
  24. import headComponent from '@/views/xjc-integratedmachine/components/head_component.vue'
  25. import Drag_component from "@/views/xjc-integratedmachine/components/drag_component.vue";
  26. import {
  27. universityDetail,
  28. getPlanYearList,
  29. getScoreList,
  30. getPlanList,
  31. getCollection
  32. } from '@/api/xjc-integratedmachine/environment/university.js'
  33. import videojs from 'video.js';
  34. import 'video.js/dist/video-js.css';
  35. import collectionComponent from '@/views/xjc-integratedmachine/components/collection_component.vue'
  36. import {ref} from "vue";
  37. import {getConfigKey} from "@/api/system/config.js";
  38. import {careerinformation} from '@/api/xjc-integratedmachine/environment/tscareer.js'
  39. const router = useRouter()
  40. const route = useRoute()
  41. const list = ref([])
  42. const total = ref(0)
  43. const showAreaChoose = ref(false)
  44. const showCategoryChoose = ref(false)
  45. const showGradeChoose = ref(false)
  46. const param = route.query
  47. const showIndex = ref(1)
  48. const baseUrl = ref()
  49. const grade = ref([])
  50. const {proxy} = getCurrentInstance()
  51. const {
  52. gk_province,
  53. category,
  54. educationlevel,
  55. property,
  56. school_category
  57. } = proxy.useDict('gk_province', 'category', 'educationlevel', 'property', 'school_category')
  58. const form = ref({
  59. area: null,
  60. areaname: null,
  61. university: param.name,
  62. })
  63. const entity = ref({})
  64. const collectionList = ref([])
  65. const headinfo = ref({})
  66. const onePage = ref(true)
  67. const twoPage = ref(false)
  68. const threePage = ref(false)
  69. const fourPage = ref(false)
  70. const fivePage = ref(false)
  71. const fivePageDialog = ref(false)
  72. const sixPageDialog = ref(false)
  73. const eightPageDialog = ref(false)
  74. const sixPage = ref(false)
  75. const senvenPage = ref(false)
  76. const eightPage = ref(false)
  77. function setHeadinfo(){
  78. headinfo.value = {
  79. title: '学职资讯',
  80. user: {
  81. avatar: '头像路径',
  82. nickName: '张三'
  83. },
  84. backUrl : '/xjc-integratedmachine/environment/query_universitydb_conditions',
  85. homeUrl:'/xjc-integratedmachine/environment/index',
  86. }
  87. }
  88. function safeTruncate(text, length) {
  89. // 使用 substring 方法截取字符串
  90. // 这里可以添加额外的消毒步骤来确保文本安全
  91. // 例如:使用正则表达式移除所有脚本标签等
  92. // let reg = /[\u4e00-\u9fa5]|[\(\)\《\》\——\;\,\。\“\”\<\>\!]/g;
  93. // const sanitizedText = text.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
  94. const sanitizedText = text.replace(/[^\u4e00-\u9fa5;,。“”《》?!]+/g, '');
  95. // const truncatedText = sanitizedText.substring(0, length);
  96. const truncatedText = sanitizedText.substring(0, length);
  97. console.log("truncatedText",truncatedText)
  98. // 但为了简化示例,这里仅返回截取的文本
  99. return truncatedText;
  100. }
  101. onMounted(() => {
  102. setHeadinfo()
  103. })
  104. const queryParams = ref({
  105. pageNum: 1,
  106. pageSize: 10,
  107. type: '5'
  108. })
  109. function query() {
  110. careerinformation(queryParams.value).then(resp => {
  111. console.log(resp.data_list.rows)
  112. list.value = resp.data_list.rows
  113. total.value = resp.data_list.total
  114. })
  115. }
  116. function toDetail(item) {
  117. router.push({
  118. path : '/xjc-integratedmachine/environment/career_story2',
  119. query :{
  120. id : item.id
  121. }
  122. })
  123. }
  124. query()
  125. </script>
  126. <style scoped lang="scss">
  127. p, div {
  128. margin: 0;
  129. padding: 0;
  130. }
  131. .university_details_video {
  132. background: url('@/assets/images/environment/university-detail.png') no-repeat;
  133. background-size: 1920px 1080px;
  134. z-index: 10;
  135. width: 100%;
  136. height: 1080px;
  137. .page-content {
  138. width: 100%;
  139. position: absolute;
  140. top: 100px;
  141. bottom: 0;
  142. display: flex;
  143. justify-content: center;
  144. }
  145. .page-img-box {
  146. width: 1832px;
  147. height: 922px;
  148. margin-top: 13px;
  149. background: rgba(255, 255, 255, 0.4);
  150. border-radius: 35px 35px 35px 35px;
  151. display: flex;
  152. flex-direction: column;
  153. overflow: auto;
  154. .item-box{
  155. width: 1750px;
  156. height: 204px;
  157. border-left: 10px solid #1EC590;
  158. background: #FFFFFF;
  159. box-shadow: 0px 2px 4px 2px rgba(0,0,0,0.09);
  160. border-radius: 5px 5px 5px 5px;
  161. margin-left: 40px;
  162. margin-top: 46px;
  163. padding-left: 40px;
  164. padding-right: 40px;
  165. .top{
  166. display: flex;
  167. justify-content: space-between;
  168. padding-top: 40px;
  169. .title{
  170. font-weight: bold;
  171. font-size: 32px;
  172. color: #000000;
  173. line-height: 52px;
  174. //margin-left: 25px;
  175. }
  176. .details{
  177. font-weight: 400;
  178. font-size: 20px;
  179. color: #515F6A;
  180. //margin-right: 40px;
  181. //margin-top: 40px;
  182. }
  183. }
  184. .content{
  185. border-top: #E6E6E6 1px solid;
  186. height: 100px;
  187. overflow: auto;
  188. padding-top: 30px;
  189. font-weight: 400;
  190. font-size: 30px;
  191. color: #333333;
  192. }
  193. }
  194. }
  195. }
  196. </style>