project.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div class="project">
  3. <div class="project-pages">
  4. <div class="img-bos">
  5. <el-image class="solve-img" src="https://yunying.yoe365.com:8045/Photos/134108619338390297.jpg" fit="cover" />
  6. </div>
  7. <div class="filter-bos">
  8. <div v-for="(item1, index1) in filterListy" :key="index1" class="filter-list flex-row-start">
  9. <div class="filter-title">{{ item1.title }}</div>
  10. <div
  11. @click="onFilter(item1, item2)"
  12. v-for="(item2, index2) in item1.list"
  13. :key="index2"
  14. class="filter-item"
  15. :class="item1.id == item2.id ? 'hig' : ''"
  16. >
  17. {{ item2.title }}
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <!-- 数据 -->
  23. <div class="project-bos">
  24. <div v-for="(item, index) in dataList" :key="index" class="project-list" @click="onPath('/plan_info/project?id=' + item.id)">
  25. <el-image class="data-img" :src="item.uploadProgram" fit="cover" />
  26. <div class="project-box">
  27. <div class="project1 ellipsis">{{ item.caseTitle || '' }}</div>
  28. <div class="project2">
  29. {{ item.projectBrief || '' }}
  30. </div>
  31. <div class="project-more flex-row-between">
  32. <div></div>
  33. <div class="flex-row-start">
  34. <div style="margin-right: 5px">了解详情</div>
  35. <el-icon :size="14" color="#E7000B"><ArrowRight /></el-icon>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <!-- 游标分页控制 -->
  42. <div class="table-pagination flex-row-between">
  43. <div></div>
  44. <TablePagination v-model:page="httpObj.pageNum" v-model:page-size="httpObj.pageSize" :total="total" @change="getList" />
  45. </div>
  46. </div>
  47. </template>
  48. <script setup lang="ts">
  49. import { onPath } from '@/utils/siteConfig';
  50. import { getProjectCaseAllList, getCustomerIndustry, getProjectTypeList } from '@/api/plan/index';
  51. import Pagination from '@/components/Pagination/index.vue';
  52. const httpObj = ref<any>({
  53. topCategoryId: '',
  54. brandId: '',
  55. priceRange: '',
  56. sortField: '',
  57. sortOrder: '',
  58. isCustomize: '',
  59. pageSize: 10,
  60. pageNum: 1
  61. });
  62. const dataList = ref<any>([]);
  63. const hasMore = ref(true); // 是否还有更多数据
  64. const way = ref<any>(1);
  65. const total = ref(0);
  66. const filterListy = ref<any>([
  67. {
  68. title: '客户行业',
  69. key: 'clientIndustry',
  70. id: '',
  71. list: [
  72. {
  73. id: '',
  74. title: '全部'
  75. }
  76. ]
  77. },
  78. {
  79. title: '项目类型',
  80. key: 'projectType',
  81. id: '',
  82. list: [
  83. {
  84. id: '',
  85. title: '全部'
  86. }
  87. ]
  88. }
  89. ]);
  90. onMounted(() => {
  91. //适配行业
  92. getCustomerIndustry({}).then((res) => {
  93. if (res.code == 200) {
  94. res.data.forEach((item: any) => {
  95. item.title = item.industryCategoryName;
  96. filterListy.value[0].list.push(item);
  97. });
  98. }
  99. });
  100. //项目类型
  101. getProjectTypeList({}).then((res) => {
  102. if (res.code == 200) {
  103. res.data.forEach((item: any) => {
  104. item.title = item.typeName;
  105. filterListy.value[1].list.push(item);
  106. });
  107. }
  108. });
  109. getList();
  110. });
  111. const getList = () => {
  112. getProjectCaseAllList(httpObj.value).then((res) => {
  113. if (res.code == 200) {
  114. dataList.value = res.rows;
  115. total.value = res.total;
  116. }
  117. });
  118. };
  119. const onFilter = (item1: any, item2: any) => {
  120. item1.id = item2.id;
  121. httpObj.value[item1.key] = item2.id;
  122. getList();
  123. };
  124. const handleSizeChange = (val: number) => {
  125. console.log(`${val} items per page`);
  126. };
  127. const handleCurrentChange = (val: number) => {
  128. console.log(`current page: ${val}`);
  129. };
  130. </script>
  131. <style lang="scss" scoped>
  132. .project {
  133. width: 100%;
  134. .project-pages {
  135. width: 100%;
  136. background-color: #ffffff;
  137. .img-bos {
  138. width: 100%;
  139. display: flex;
  140. justify-content: center;
  141. .solve-img {
  142. width: 100%;
  143. max-width: 1500px;
  144. min-width: 1200px;
  145. height: 380px;
  146. border-radius: 5px;
  147. }
  148. }
  149. .filter-bos {
  150. width: 100%;
  151. max-width: 1500px;
  152. min-width: 1200px;
  153. margin: 0 auto;
  154. padding-bottom: 20px;
  155. .filter-list {
  156. margin-top: 20px;
  157. .filter-title {
  158. font-size: 14px;
  159. color: #101828;
  160. margin-right: 40px;
  161. }
  162. .filter-item {
  163. font-size: 14px;
  164. color: #364153;
  165. margin-right: 30px;
  166. cursor: pointer;
  167. &.hig {
  168. color: #e7000b;
  169. }
  170. &:hover {
  171. color: var(--el-color-primary);
  172. }
  173. }
  174. }
  175. }
  176. }
  177. //项目案例
  178. .project-bos {
  179. width: 100%;
  180. max-width: 1500px;
  181. min-width: 1200px;
  182. margin: 0 auto;
  183. display: flex;
  184. margin-top: 25px;
  185. gap: 15px;
  186. flex-wrap: wrap;
  187. .project-list {
  188. flex: 0 0 calc((100% - 45px) / 3);
  189. width: 0;
  190. height: 320px;
  191. cursor: pointer;
  192. border-radius: 10px;
  193. overflow: hidden;
  194. position: relative;
  195. transition:
  196. transform 0.2s ease,
  197. box-shadow 0.2s ease;
  198. &:hover {
  199. transform: translateY(-2px);
  200. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  201. .project1 {
  202. color: #e7000b !important;
  203. }
  204. }
  205. .project-box {
  206. width: 100%;
  207. height: 156px;
  208. background: #ffffff;
  209. border-radius: 10px;
  210. margin-top: -20px;
  211. z-index: 2;
  212. position: absolute;
  213. padding: 20px;
  214. border: 1px solid #e5e7eb;
  215. }
  216. .data-img {
  217. width: 100%;
  218. height: 180px;
  219. }
  220. .project1 {
  221. font-weight: 600;
  222. font-size: 16px;
  223. color: #101828;
  224. margin-bottom: 14px;
  225. }
  226. .project2 {
  227. font-size: 14px;
  228. color: #364153;
  229. display: -webkit-box;
  230. -webkit-line-clamp: 2;
  231. line-clamp: 2; /* 添加标准属性 */
  232. -webkit-box-orient: vertical;
  233. overflow: hidden;
  234. text-overflow: ellipsis;
  235. }
  236. .project-more {
  237. text-align: right;
  238. font-size: 14px;
  239. color: var(--el-color-primary);
  240. margin-top: 18px;
  241. }
  242. }
  243. }
  244. .table-pagination {
  245. width: 100%;
  246. min-width: 1200px;
  247. max-width: 1500px;
  248. margin: 0 auto;
  249. box-sizing: border-box;
  250. padding-bottom: 30px;
  251. }
  252. }
  253. </style>