expert.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <custom-layout class="main">
  3. <el-col :span="24" class="one">
  4. <el-image class="image" :src="lists" fit="fill" />
  5. </el-col>
  6. <div class="w_1300">
  7. <div class="two">
  8. <div class="twoSeacher">
  9. <div class="twoLeft">
  10. <span>行业</span>
  11. </div>
  12. <div v-if="!oneShow" class="twoRight">
  13. <div class="label" v-for="(item, index) in plateList.slice(0, 6)" :key="index">
  14. {{ item.label }}
  15. </div>
  16. </div>
  17. <div v-else class="twoRight">
  18. <div class="label" v-for="(item, index) in plateList" :key="index">
  19. {{ item.label }}
  20. </div>
  21. </div>
  22. <div class="button">
  23. <span v-if="!oneShow" @click="oneShow = true">
  24. <el-icon><ArrowDown /></el-icon>
  25. </span>
  26. <span v-else @click="oneShow = false">
  27. <el-icon><ArrowUp /></el-icon>
  28. </span>
  29. </div>
  30. </div>
  31. <div class="twoSeacher">
  32. <div class="twoLeft">
  33. <span>技术领域</span>
  34. </div>
  35. <div class="twoRight">
  36. <div class="label" v-for="(item, index) in typeList" :key="index">
  37. {{ item.label }}
  38. </div>
  39. </div>
  40. </div>
  41. <div class="twoSeacher">
  42. <div class="twoLeft">
  43. <span>所在地</span>
  44. </div>
  45. <div v-if="!twoShow" class="twoRight">
  46. <div class="label" v-for="(item, index) in cityList.slice(0, 15)" :key="index">
  47. {{ item.label }}
  48. </div>
  49. </div>
  50. <div v-else class="twoRight">
  51. <div class="label" v-for="(item, index) in cityList" :key="index">
  52. {{ item.label }}
  53. </div>
  54. </div>
  55. <div class="button">
  56. <span v-if="!twoShow" @click="twoShow = true">
  57. <el-icon><ArrowDown /></el-icon>
  58. </span>
  59. <span v-else @click="twoShow = false">
  60. <el-icon><ArrowUp /></el-icon>
  61. </span>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="twoTwo">
  66. <div class="twoTable">
  67. <div class="label" v-for="(item, index) in column" :key="index" :style="item.style">
  68. {{ item.name }}
  69. </div>
  70. </div>
  71. <div class="twoValue">
  72. <div class="value" v-for="(item, index) in list" :key="index">
  73. <div class="table-colunm table-colunm1">{{ index + 1 }}</div>
  74. <div class="table-colunm textOne">{{ item.name || '暂无' }}</div>
  75. <div class="table-colunm textOne table-colunm2">{{ item.work || '暂无' }}</div>
  76. <div class="table-colunm textOne">{{ item.title || '暂无' }}</div>
  77. <div class="table-colunm textOne">{{ item.industry || '暂无' }}</div>
  78. <div class="table-colunm button" @click="toView(item)">查看详情</div>
  79. </div>
  80. </div>
  81. <div class="twoTotal">
  82. <el-pagination background layout="prev, pager, next" :total="total" :page-size="limit" v-model:current-page="currentPage" @current-change="changePage" @size-change="sizeChange" />
  83. </div>
  84. </div>
  85. </div>
  86. </custom-layout>
  87. </template>
  88. <script setup>
  89. // 图片引入
  90. import lists from '/images/expert.png'
  91. import { getCity } from '@/utils/city'
  92. import { UserStore } from '@/store/user'
  93. const userStore = UserStore()
  94. const user = computed(() => userStore.user)
  95. // 接口
  96. import { DictDataStore } from '@/store/api/system/dictData'
  97. import { ExpertStore } from '@/store/api/user/expert'
  98. const store = ExpertStore()
  99. const dictDataStore = DictDataStore()
  100. // 加载中
  101. const loading = ref(false)
  102. // 路由
  103. const router = useRouter()
  104. // 是否展开
  105. const oneShow = ref(false)
  106. const twoShow = ref(false)
  107. const cityList = ref([])
  108. const typeList = ref([
  109. { label: '不限', value: '-1' },
  110. { label: '教育休闲', value: '0' },
  111. { label: '包装印刷', value: '1' },
  112. { label: '电气自动化', value: '2' },
  113. { label: '采矿冶金', value: '3' },
  114. { label: '航空航天', value: '4' },
  115. { label: '海洋开发', value: '5' },
  116. { label: '衣林牧业', value: '6' },
  117. { label: '医药与医疗', value: '7' },
  118. { label: '电子信息', value: '8' }
  119. ])
  120. const plateList = ref([
  121. { label: '汽车电子及新型汽车零部件', value: '0' },
  122. { label: '精细化工及天然气化工', value: '1' },
  123. { label: '农产品加工及绿色食品', value: '2' },
  124. { label: '光电子及智能传感器', value: '3' },
  125. { label: '车规级芯片及功率半导体器件', value: '4' },
  126. { label: '新能源及动力电池', value: '5' },
  127. { label: '生物基新材料', value: '6' },
  128. { label: '人工智能及智能机器人', value: '7' },
  129. { label: '碳纤维及复合材料', value: '8' },
  130. { label: '遥感卫星及航天航空技术', value: '9' },
  131. { label: '精密仪器及先进装备', value: '10' },
  132. { label: '生物医药及先进医疗器械', value: '11' },
  133. { label: '生物制造', value: '12' }
  134. ])
  135. const column = ref([
  136. { name: '序号', style: { width: '116px' }, key: 'key' },
  137. { name: '名称', style: { width: '216px' }, key: 'name' },
  138. { name: '工作单位', style: { width: '316px' }, key: 'area' },
  139. { name: '学历/职称', style: { width: '216px' }, key: 'education' },
  140. { name: '所属产业', style: { width: '216px' }, key: 'industry' },
  141. { name: '操作', style: { width: '216px' }, key: 'operation' }
  142. ])
  143. // 列表
  144. const list = ref([])
  145. let skip = 0
  146. let limit = 15
  147. const total = ref(0)
  148. // 请求
  149. onMounted(async () => {
  150. loading.value = true
  151. // 城市
  152. getCity().then((response) => (cityList.value = [{ label: '不限', value: '-1' }, ...response.address]))
  153. await searchOther()
  154. await search({ skip, limit })
  155. loading.value = false
  156. })
  157. const searchOther = async () => {}
  158. const search = async (query = { skip, limit }) => {
  159. skip = query.skip
  160. limit = query.limit
  161. const info = {
  162. skip: query.skip,
  163. limit: query.limit
  164. }
  165. const res = await store.query(info)
  166. if (res.errcode == '0') {
  167. list.value = res.data
  168. total.value = res.total
  169. }
  170. }
  171. // 查看
  172. const toView = (item) => {
  173. router.push({ path: `/expert/detail`, query: { id: item.id || item._id } })
  174. }
  175. const currentPage = ref(1)
  176. // 分页
  177. const changePage = (page = currentPage.value) => {
  178. search({ skip: (page - 1) * limit, limit: limit })
  179. }
  180. const sizeChange = (limits) => {
  181. limit = limits
  182. currentPage.value = 1
  183. search({ skip: 0, limit: limit })
  184. }
  185. </script>
  186. <style scoped lang="scss">
  187. .main {
  188. background: url(/images/information.jpg) no-repeat top center;
  189. background-size: 100% 100%;
  190. .one {
  191. .image {
  192. width: 100%;
  193. height: 350px;
  194. }
  195. }
  196. .two {
  197. margin: 10px 0;
  198. background-color: $global-color-fff;
  199. .twoSeacher {
  200. display: flex;
  201. justify-content: center;
  202. align-items: stretch;
  203. position: relative;
  204. border: solid 1px #e5e5e5;
  205. border-bottom: 0;
  206. font-size: $global-font-size-18;
  207. color: #666;
  208. min-height: 60px;
  209. overflow: hidden;
  210. .twoLeft {
  211. display: flex;
  212. justify-content: center;
  213. align-items: center;
  214. flex-shrink: 0;
  215. width: 110px;
  216. text-align: center;
  217. color: #000;
  218. font-weight: bold;
  219. background-color: #fafafa;
  220. }
  221. .twoRight {
  222. display: flex;
  223. flex-wrap: wrap;
  224. align-items: center;
  225. padding: 12px;
  226. flex: 1;
  227. border-left: solid 1px #e5e5e5;
  228. background-color: #fff;
  229. .label {
  230. color: #313131;
  231. margin-bottom: 10px;
  232. padding: 8px 10px;
  233. border-radius: 3px;
  234. background-color: #fff;
  235. border: solid 1px transparent;
  236. cursor: pointer;
  237. }
  238. .label:first-child {
  239. color: #0a58c2;
  240. border: solid 1px #006dd2;
  241. }
  242. .label:hover {
  243. color: $global-color-107;
  244. }
  245. }
  246. .button {
  247. display: flex;
  248. align-items: center;
  249. margin: 0 5px 0 0;
  250. }
  251. }
  252. }
  253. .twoTwo {
  254. margin: 10px 0;
  255. .twoTable {
  256. display: flex;
  257. justify-content: space-between;
  258. color: $global-color-fff;
  259. font-size: $global-font-size-20;
  260. background-color: rgba(255, 255, 255, 0.1);
  261. padding: 12px 0;
  262. .label {
  263. text-align: center;
  264. }
  265. }
  266. .twoValue {
  267. color: $global-color-fff;
  268. font-size: $global-font-size-20;
  269. .value {
  270. display: flex;
  271. justify-content: space-between;
  272. padding: 12px 0;
  273. .table-colunm {
  274. width: 216px;
  275. text-align: center;
  276. }
  277. .table-colunm1 {
  278. width: 116px !important;
  279. }
  280. .table-colunm2 {
  281. width: 316px !important;
  282. }
  283. .button {
  284. cursor: pointer; /* 改变鼠标样式为手形 */
  285. }
  286. .button:hover {
  287. color: $global-color-107;
  288. }
  289. }
  290. .value:nth-child(2n) {
  291. background-color: rgba(255, 255, 255, 0.1);
  292. }
  293. }
  294. .twoTotal {
  295. display: flex;
  296. justify-content: center;
  297. margin: 20px 0;
  298. }
  299. }
  300. }
  301. </style>