detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
  5. <div class="w_1200">
  6. <el-col :span="24" class="one">
  7. <el-col :span="24" class="oneText">
  8. <el-col :span="4" class="left">
  9. <el-image class="image" :src="info.url" fit="fill" />
  10. </el-col>
  11. <el-col :span="20" class="right">
  12. <el-col :span="24" class="right_1">
  13. <el-col :span="4" class="tags">
  14. <el-tooltip effect="dark" :content="info.name" placement="top">
  15. {{ info.name || '暂无名称' }}
  16. </el-tooltip>
  17. </el-col>
  18. <el-col :span="16" class="tags">
  19. <el-tag :type="[info.status == '0' ? 'success' : 'info']">{{
  20. getDict(info.status, 'status')
  21. }}</el-tag>
  22. </el-col>
  23. <el-col :span="4" class="time" style="text-align: right">
  24. {{ info.create_time || '暂无' }}更新
  25. </el-col>
  26. </el-col>
  27. <el-col :span="24" class="right_2">
  28. <el-tag v-for="(val, indexs) in info.tags" :key="indexs" type="primary">{{
  29. val
  30. }}</el-tag>
  31. </el-col>
  32. <el-col :span="24" class="right_3">
  33. <el-col :span="8" class="info">
  34. 统一社会信用代码:{{ info.code || '暂无' }}
  35. </el-col>
  36. <el-col :span="8" class="info">电话:{{ info.phone || '暂无' }}</el-col>
  37. <el-col :span="8" class="info"
  38. >所属行业:{{ getDict(info.field || '暂无技术领域', 'field') }}</el-col
  39. >
  40. </el-col>
  41. <el-col :span="24" class="right_3">
  42. <el-col :span="8" class="info"
  43. >法定代表人:{{ info.representative || '暂无' }}</el-col
  44. >
  45. <el-col :span="8" class="info">邮箱:{{ info.email || '暂无' }}</el-col>
  46. <el-col :span="8" class="info">员工人数:{{ info.number || '暂无' }}</el-col>
  47. </el-col>
  48. <el-col :span="24" class="right_3">
  49. <el-col :span="8" class="info">注册资本:{{ info.register || '暂无' }}</el-col>
  50. <el-col :span="8" class="info">官网:{{ info.email || '暂无' }}</el-col>
  51. <el-col :span="8" class="info">营业收入:{{ info.money || '暂无' }}</el-col>
  52. </el-col>
  53. <el-col :span="24" class="right_3">
  54. <el-col :span="8" class="info">成立日期:{{ info.create_time || '暂无' }}</el-col>
  55. <el-col :span="16" class="info">地址:{{ info.address || '暂无' }}</el-col>
  56. </el-col>
  57. <el-col :span="24" class="right_3">
  58. <el-col :span="24" class="two_3">
  59. <el-col :span="21" class="file" @click="toCollection">
  60. <el-icon><Star /></el-icon>
  61. 收藏
  62. </el-col>
  63. <el-col :span="3" class="file">
  64. <a-button type="primary" @click="toChat"> 在线洽谈 </a-button>
  65. </el-col>
  66. </el-col>
  67. </el-col>
  68. </el-col>
  69. </el-col>
  70. <el-col :span="24" class="twoText">
  71. <el-col :span="24" class="title">公司简介</el-col>
  72. <el-col :span="24" class="brief">{{ info.brief || '暂无相关简介' }}</el-col>
  73. </el-col>
  74. <el-col :span="24" class="twoText">
  75. <el-col :span="24" class="title">相关成果</el-col>
  76. <el-col :span="24" class="content">
  77. <a-list :loading="loading" :grid="{ gutter: 16, column: 4 }" :data-source="list">
  78. <template #renderItem="{ item }">
  79. <el-col :span="24" class="list" @click="toView(item)">
  80. <el-col :span="24" class="name textOver">
  81. <el-tooltip effect="dark" :content="item.name" placement="top">
  82. {{ item.name || '暂无名称' }}
  83. </el-tooltip>
  84. </el-col>
  85. <el-col :span="24" class="two_1">
  86. <span>技术领域:</span>{{ getDict(item.field || '暂无技术领域', 'field') }}
  87. </el-col>
  88. <el-col :span="24" class="two_1">
  89. <span>成果地区:</span>{{ getArea(item.area || '暂无成果地区') }}
  90. </el-col>
  91. <el-col :span="24" class="two_1">
  92. <span>单位:</span>{{ item.user || '暂无单位' }}
  93. </el-col>
  94. <el-col :span="24" class="bottom">
  95. <a-button size="small" type="primary" @click="toView(item)">
  96. 查看详情
  97. </a-button>
  98. </el-col>
  99. </el-col>
  100. </template>
  101. </a-list>
  102. <el-col :span="24" class="page">
  103. <el-pagination
  104. background
  105. layout="total, prev, pager, next"
  106. :page-sizes="[10, 20, 50, 100, 200]"
  107. :total="total"
  108. :page-size="limit"
  109. v-model:current-page="currentPage"
  110. @current-change="changePage"
  111. @size-change="sizeChange"
  112. >
  113. </el-pagination>
  114. </el-col>
  115. </el-col>
  116. </el-col>
  117. </el-col>
  118. </div>
  119. </el-col>
  120. </el-row>
  121. </div>
  122. </template>
  123. <script setup>
  124. // 基础
  125. import { get } from 'lodash-es'
  126. const $checkRes = inject('$checkRes')
  127. // 接口
  128. import { AchievementStore } from '@/store/api/platform/achievement'
  129. import { DictDataStore } from '@/store/api/system/dictData'
  130. const store = AchievementStore()
  131. const dictDataStore = DictDataStore()
  132. import { UserStore } from '@/store/user'
  133. const userStore = UserStore()
  134. const user = computed(() => userStore.user)
  135. // 图片引入
  136. import science from '@/assets/bg.png'
  137. // 路由
  138. const route = useRoute()
  139. // 加载中
  140. const loading = ref(false)
  141. const info = ref({
  142. name: '努比亚技术有限公司 ',
  143. url: science,
  144. tags: ['战略投资', '国家高新技术企业', '创新型中小企业', '国家级专利奖'],
  145. code: ' 914403007320587423',
  146. phone: '075************',
  147. type: '0',
  148. representative: '倪飞',
  149. email: 'xie.giang@nubia.com',
  150. person: '1万人以上',
  151. address: '深圳市南山区桃源街道福光社区留仙大道3370号南山智园崇文园区2号楼1801',
  152. create_time: '2001-09-12',
  153. status: '0'
  154. })
  155. // 字典表
  156. const educationList = ref([])
  157. const fieldList = ref([])
  158. const statusList = ref([])
  159. const titleList = ref([])
  160. // 成果列表
  161. const list = ref([])
  162. let skip = 0
  163. let limit = inject('limit')
  164. const total = ref(0)
  165. // 请求
  166. onMounted(async () => {
  167. loading.value = true
  168. await searchOther()
  169. await search()
  170. await searchAchieve({ skip, limit })
  171. loading.value = false
  172. })
  173. const search = async () => {
  174. let id = route.query.id
  175. if (id) {
  176. let res = await store.fetch(id)
  177. if (res.errcode == '0') info.value = res.data
  178. }
  179. }
  180. const searchAchieve = async (query = { skip: 0, limit }) => {
  181. const info = {
  182. skip: query.skip,
  183. limit: query.limit,
  184. is_use: '0',
  185. status: '1'
  186. }
  187. const res = await store.query(info)
  188. if (res.errcode == '0') {
  189. list.value = res.data
  190. total.value = res.total
  191. }
  192. }
  193. const searchOther = async () => {
  194. let result
  195. // 学历
  196. result = await dictDataStore.query({ code: 'education', is_use: '0' })
  197. if ($checkRes(result)) educationList.value = result.data
  198. // 技术领域
  199. result = await dictDataStore.query({ code: 'field', is_use: '0' })
  200. if ($checkRes(result)) fieldList.value = result.data
  201. // 职称
  202. result = await dictDataStore.query({ code: 'title', is_use: '0' })
  203. if ($checkRes(result)) titleList.value = result.data
  204. // 企业状态
  205. result = await dictDataStore.query({ code: 'companyStatus', is_use: '0' })
  206. if ($checkRes(result)) statusList.value = result.data
  207. }
  208. // 字典数据转换
  209. const getDict = (data, model) => {
  210. let res
  211. if (model == 'education') res = educationList.value.find((f) => f.value == data)
  212. else if (model == 'field') res = fieldList.value.find((f) => f.value == data)
  213. else if (model == 'title') res = titleList.value.find((f) => f.value == data)
  214. else if (model == 'status') res = statusList.value.find((f) => f.value == data)
  215. return get(res, 'label')
  216. }
  217. // 地区
  218. const getArea = (data) => {
  219. if (data) return data.join(',')
  220. }
  221. // 在线洽谈
  222. const toChat = () => {
  223. console.log('在线洽谈')
  224. }
  225. // 收藏
  226. const toCollection = () => {
  227. console.log('收藏')
  228. }
  229. const currentPage = ref(1)
  230. // 分页
  231. const changePage = (page = currentPage.value) => {
  232. searchAchieve({ skip: (page - 1) * limit, limit: limit })
  233. }
  234. const sizeChange = (limits) => {
  235. console.log(limits)
  236. limit = limits
  237. currentPage.value = 1
  238. searchAchieve({ skip: 0, limit: limit })
  239. }
  240. </script>
  241. <style scoped lang="scss">
  242. .main {
  243. background: #f7f7f7;
  244. .one {
  245. margin: 10px 0;
  246. background-color: #fff;
  247. padding: 24px;
  248. border-top: 6px solid #2374ff;
  249. overflow: hidden;
  250. border-radius: 0 0 5px 5px;
  251. .oneText {
  252. display: flex;
  253. padding: 20px;
  254. margin: 10px 0;
  255. border-radius: 10px;
  256. border: 1px solid #edeff2;
  257. .left {
  258. .image {
  259. width: 150px;
  260. height: 150px;
  261. border-radius: 90px;
  262. }
  263. }
  264. .right {
  265. padding: 5px;
  266. .right_1 {
  267. display: flex;
  268. align-items: center;
  269. .name {
  270. word-break: break-all;
  271. font-size: 18px;
  272. font-family:
  273. PingFangSC-Regular,
  274. PingFang SC;
  275. font-weight: 500;
  276. line-height: 24px;
  277. width: 175px;
  278. overflow: hidden;
  279. text-overflow: ellipsis;
  280. display: -webkit-box;
  281. -webkit-line-clamp: 2;
  282. -webkit-box-orient: vertical;
  283. }
  284. .tags {
  285. grid-gap: 0.5rem;
  286. gap: 0.5rem;
  287. display: flex;
  288. margin: 10px 0;
  289. }
  290. .time {
  291. font-size: 14px;
  292. font-family:
  293. PingFangSC-Regular,
  294. PingFang SC;
  295. color: #666;
  296. }
  297. }
  298. .right_2 {
  299. grid-gap: 0.5rem;
  300. gap: 0.5rem;
  301. display: flex;
  302. margin: 10px 0;
  303. }
  304. .right_3 {
  305. display: flex;
  306. margin: 10px 0;
  307. font-size: 14px;
  308. font-family:
  309. PingFangSC-Regular,
  310. PingFang SC;
  311. color: #666;
  312. .info {
  313. span {
  314. color: #2171f6;
  315. }
  316. }
  317. .two_3 {
  318. display: flex;
  319. align-items: center;
  320. .file {
  321. display: flex;
  322. align-items: center;
  323. justify-content: flex-end;
  324. }
  325. }
  326. }
  327. }
  328. }
  329. .twoText {
  330. padding: 20px;
  331. border-radius: 10px;
  332. margin: 10px 0;
  333. border: 1px solid #edeff2;
  334. .title {
  335. font-size: 20px;
  336. color: #383b40;
  337. letter-spacing: 0;
  338. line-height: 20px;
  339. font-weight: 600;
  340. margin-bottom: 30px;
  341. }
  342. .content {
  343. margin-top: 20px;
  344. .list {
  345. border: 1px solid #edeff2;
  346. background: #fff;
  347. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.03);
  348. border-radius: 2px;
  349. width: 270px;
  350. height: 180px;
  351. margin-bottom: 15px;
  352. cursor: pointer;
  353. transition: all 0.3s;
  354. padding: 15px;
  355. .name {
  356. font-size: 16px;
  357. color: #121834;
  358. height: 16px;
  359. line-height: 13px;
  360. font-weight: 500;
  361. margin: 10px 0;
  362. }
  363. .name:hover {
  364. color: #2374ff;
  365. }
  366. .two_1 {
  367. font-size: 12px;
  368. text-align: justify;
  369. line-height: 12px;
  370. font-weight: 400;
  371. letter-spacing: 0;
  372. color: #8f97a3;
  373. margin-top: 15px;
  374. span:last-child {
  375. color: #525a68;
  376. }
  377. }
  378. .bottom {
  379. text-align: right;
  380. }
  381. }
  382. .list:hover {
  383. background: #f0f7ff;
  384. box-shadow: 0 0 16px rgba(205, 205, 205, 0.6);
  385. }
  386. .page {
  387. display: flex;
  388. flex-direction: row-reverse;
  389. padding: 20px;
  390. }
  391. }
  392. }
  393. }
  394. }
  395. </style>