six.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
  5. <el-col :span="24" class="one">
  6. <el-image class="image" :src="news" fit="fill" />
  7. </el-col>
  8. <el-col :span="24" class="two">
  9. <div class="w_1200">
  10. <el-col :span="24" class="two_1">
  11. <el-row class="two_1_1">
  12. <el-col :span="3" class="left">按地区:</el-col>
  13. <el-col :span="20" class="right" v-if="oneShow">
  14. <a-button
  15. class="title"
  16. v-for="(item, index) in cityList"
  17. :key="index"
  18. type="link"
  19. size="samll"
  20. @click="toSelect(item, 'one')"
  21. :class="[item.is_active ? 'show' : '']"
  22. >
  23. {{ item.label }}
  24. </a-button>
  25. </el-col>
  26. <el-col :span="20" class="right" v-else>
  27. <a-button
  28. class="title"
  29. v-for="(item, index) in cityList.slice(0, 10)"
  30. :key="index"
  31. type="link"
  32. size="samll"
  33. @click="toSelect(item, 'one')"
  34. :class="[item.is_active ? 'show' : '']"
  35. >
  36. {{ item.label }}
  37. </a-button>
  38. </el-col>
  39. <el-col :span="1" class="button">
  40. <span v-if="!oneShow" @click="oneShow = true">
  41. 更多
  42. <el-icon><ArrowDown /></el-icon>
  43. </span>
  44. <span v-else @click="oneShow = false">
  45. 收起
  46. <el-icon><ArrowUp /></el-icon>
  47. </span>
  48. </el-col>
  49. </el-row>
  50. <div class="two_1_2">
  51. <a-input class="input" v-model:value="value" placeholder="中试平台/实验室名称" />
  52. <a-input class="input" v-model:value="value" placeholder="建设主体" />
  53. <a-input class="input" v-model:value="value" placeholder="运营主体" />
  54. <a-input class="input" v-model:value="value" placeholder="服务产业领域" />
  55. <a-button class="button" type="primary">检索</a-button>
  56. </div>
  57. </el-col>
  58. <el-col :span="24" class="two_2">
  59. <el-row :gutter="16">
  60. <el-col :span="6" v-for="(item, index) in list" :key="index" @click="toView(item)">
  61. <div class="list">
  62. <el-col :span="24" class="name textOne">
  63. <el-tooltip effect="dark" :content="item.name" placement="top">
  64. {{ item.name || '暂无名称' }}
  65. </el-tooltip>
  66. </el-col>
  67. <el-col :span="24" class="other_1">
  68. <span>建设主体:</span>
  69. {{ item.build || '暂无建设主体' }}
  70. </el-col>
  71. <el-col :span="24" class="other_1">
  72. <span>运营主体:</span>
  73. {{ item.operate || '暂无运营主体' }}
  74. </el-col>
  75. <el-col :span="24" class="other_1">
  76. <span>服务产业领域:</span>
  77. {{ item.field || '暂无服务产业领域' }}
  78. </el-col>
  79. <el-col :span="24" class="other_1">
  80. <span>地址:</span>
  81. {{ item.address || '暂无地址' }}
  82. </el-col>
  83. <el-col :span="24" class="other_1">
  84. <span>联系人:</span>
  85. {{ item.contacts || '暂无联系人' }}
  86. </el-col>
  87. <el-col :span="24" class="other_1">
  88. <span>联系电话:</span>
  89. {{ item.phone || '暂无联系电话' }}
  90. </el-col>
  91. </div>
  92. </el-col>
  93. </el-row>
  94. </el-col>
  95. <el-col :span="24" class="two_3">
  96. <el-pagination
  97. background
  98. layout="total, prev, pager, next"
  99. :page-sizes="[10, 20, 50, 100, 200]"
  100. :total="total"
  101. :page-size="limit"
  102. v-model:current-page="currentPage"
  103. @current-change="changePage"
  104. @size-change="sizeChange"
  105. >
  106. </el-pagination>
  107. </el-col>
  108. </div>
  109. </el-col>
  110. </el-col>
  111. </el-row>
  112. </div>
  113. </template>
  114. <script setup>
  115. // 图片引入
  116. import news from '/images/news.png'
  117. // 加载中
  118. const loading = ref(false)
  119. // 是否展开
  120. const oneShow = ref(false)
  121. // 路由
  122. const router = useRouter()
  123. const cityList = ref([
  124. { label: '全部', value: '0' },
  125. { label: '南关区', value: '1' },
  126. { label: '朝阳区', value: '2' },
  127. { label: '高新区', value: '3' },
  128. { label: '宽城区', value: '4' },
  129. { label: '二道区', value: '5' },
  130. { label: '净月区', value: '6' },
  131. { label: '绿园区', value: '7' },
  132. { label: '九台区', value: '8' },
  133. { label: '双阳区', value: '9' },
  134. { label: '中韩示范区', value: '10' }
  135. ])
  136. // 列表
  137. const list = ref([
  138. {
  139. name: '粉末冶金新材料中试基地',
  140. build: 'xxxx有限公司',
  141. operate: 'xxxx有限公司',
  142. field: '新材料',
  143. address: '长春市蔚山路333号',
  144. contacts: '张先生',
  145. phone: '13334566543'
  146. },
  147. {
  148. name: '药物开发中试平台',
  149. build: 'xxxx有限公司',
  150. operate: 'xxxx有限公司',
  151. field: '新材料',
  152. address: '长春市蔚山路333号',
  153. contacts: '张先生',
  154. phone: '13334566543'
  155. },
  156. {
  157. name: '高端化学制剂实验室',
  158. build: 'xxxx有限公司',
  159. operate: 'xxxx有限公司',
  160. field: '新材料',
  161. address: '长春市蔚山路333号',
  162. contacts: '张先生',
  163. phone: '13334566543'
  164. },
  165. {
  166. name: '粉末冶金新材料中试基地',
  167. build: 'xxxx有限公司',
  168. operate: 'xxxx有限公司',
  169. field: '新材料',
  170. address: '长春市蔚山路333号',
  171. contacts: '张先生',
  172. phone: '13334566543'
  173. },
  174. {
  175. name: '粉末冶金新材料中试基地',
  176. build: 'xxxx有限公司',
  177. operate: 'xxxx有限公司',
  178. field: '新材料',
  179. address: '长春市蔚山路333号',
  180. contacts: '张先生',
  181. phone: '13334566543'
  182. },
  183. {
  184. name: '粉末冶金新材料中试基地',
  185. build: 'xxxx有限公司',
  186. operate: 'xxxx有限公司',
  187. field: '新材料',
  188. address: '长春市蔚山路333号',
  189. contacts: '张先生',
  190. phone: '13334566543'
  191. },
  192. {
  193. name: '粉末冶金新材料中试基地',
  194. build: 'xxxx有限公司',
  195. operate: 'xxxx有限公司',
  196. field: '新材料',
  197. address: '长春市蔚山路333号',
  198. contacts: '张先生',
  199. phone: '13334566543'
  200. },
  201. {
  202. name: '粉末冶金新材料中试基地',
  203. build: 'xxxx有限公司',
  204. operate: 'xxxx有限公司',
  205. field: '新材料',
  206. address: '长春市蔚山路333号',
  207. contacts: '张先生',
  208. phone: '13334566543'
  209. }
  210. ])
  211. let skip = 0
  212. let limit = inject('limit')
  213. const total = ref(0)
  214. // 请求
  215. onMounted(async () => {
  216. loading.value = true
  217. await search()
  218. loading.value = false
  219. })
  220. const search = async () => {}
  221. // 查看
  222. const toView = (item) => {
  223. router.push({ path: '/platform/detail', query: { id: item.id || item._id } })
  224. }
  225. const currentPage = ref(1)
  226. // 分页
  227. const changePage = (page = currentPage.value) => {
  228. search({ skip: (page - 1) * limit, limit: limit })
  229. }
  230. const sizeChange = (limits) => {
  231. limit = limits
  232. currentPage.value = 1
  233. search({ skip: 0, limit: limit })
  234. }
  235. </script>
  236. <style scoped lang="scss">
  237. .main {
  238. .one {
  239. .image {
  240. width: 100%;
  241. height: 200px;
  242. }
  243. }
  244. .two {
  245. .two_1 {
  246. background: #ffffff;
  247. border-radius: 10px;
  248. padding: 15px;
  249. margin: 10px 0 0 0;
  250. .two_1_1 {
  251. display: flex;
  252. align-items: center;
  253. padding: 10px 0;
  254. border-bottom: #9d9898 1px dashed;
  255. .left {
  256. background: #2280ff;
  257. border-radius: 15px;
  258. line-height: 26px;
  259. color: #fff;
  260. text-align: center;
  261. overflow: hidden;
  262. white-space: nowrap;
  263. text-overflow: ellipsis;
  264. font-family: PingFangSC-Medium;
  265. }
  266. .right {
  267. .show {
  268. color: #2374ff !important;
  269. }
  270. .title {
  271. color: #666;
  272. font-size: $global-font-size-16;
  273. line-height: 15px;
  274. margin: 0 10px;
  275. display: inline-block;
  276. overflow: hidden;
  277. text-decoration: none;
  278. }
  279. .title:hover {
  280. color: #2374ff;
  281. }
  282. }
  283. .button {
  284. color: #2374ff;
  285. font-size: $global-font-size-14;
  286. cursor: pointer;
  287. }
  288. }
  289. .two_1_2 {
  290. display: flex;
  291. align-items: center;
  292. justify-content: space-between;
  293. margin: 10px 0 0 0;
  294. .input {
  295. margin: 0 5px 0 0;
  296. }
  297. .button {
  298. margin: 0 0 0 5px;
  299. }
  300. }
  301. }
  302. .two_2 {
  303. .list {
  304. padding: 15px;
  305. border: 1px solid #f2f4f6;
  306. border-radius: 8px;
  307. margin: 0 0 15px 0;
  308. .name {
  309. color: #337ab7;
  310. font-size: $global-font-size-20;
  311. font-weight: bold;
  312. display: inline-block;
  313. margin: 0 0 8px 0;
  314. }
  315. .name:hover {
  316. color: #2374ff;
  317. cursor: pointer;
  318. }
  319. .other_1 {
  320. font-family: 'PingFangSC-Light', 'Microsoft YaHei', 'WenQuanYi Micro Hei', arial,
  321. sans-serif;
  322. font-size: $global-font-size-16;
  323. font-weight: normal;
  324. color: #666;
  325. }
  326. .other_1:hover {
  327. color: #2374ff;
  328. cursor: pointer;
  329. }
  330. }
  331. }
  332. .two_3 {
  333. display: flex;
  334. flex-direction: row-reverse;
  335. padding: 20px;
  336. }
  337. }
  338. }
  339. </style>