数字化园区前端项目
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CompanyItem.vue 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!-- 园区企业单个item -->
  2. <template>
  3. <div class="item_box" @click="goDetail(companyInfo.companyId)">
  4. <img class="company_img" :src="formatImg(JSON.parse(companyInfo.logo)[0])" alt="企业图片" />
  5. <div class="info_box pointer">
  6. <div class="title_box">
  7. <span class="company_title" :title="companyInfo.companyName">
  8. {{ companyInfo.companyName }}
  9. </span>
  10. <span
  11. :class="[
  12. 'claim_state',
  13. companyInfo &&
  14. companyInfo.claimState &&
  15. companyInfo.claimState.text === '已认领'
  16. ? 'claimed'
  17. : 'not_claim',
  18. ]"
  19. >
  20. {{ companyInfo.claimState.text }}
  21. </span>
  22. </div>
  23. <div
  24. class="company_info"
  25. :title="
  26. `法人:${companyInfo.legalPerson};状态:${companyInfo.enterpriseState};注册资本:${companyInfo.registeredCapital};信用代码:${companyInfo.creditCode}`
  27. "
  28. >
  29. <span>法人:{{ companyInfo.legalPerson }}</span>
  30. <span>状态:{{ companyInfo.enterpriseState }}</span>
  31. <span>注册资本:{{ companyInfo.registeredCapital }}</span>
  32. <span>信用代码:{{ companyInfo.creditCode }}</span>
  33. </div>
  34. <div
  35. class="company_info"
  36. :title="
  37. `成立日期:${formatDateFun(companyInfo.establishOn, 'YYYY-MM-DD')};行业:${
  38. companyInfo.ownerIndustry
  39. };地址:${companyInfo.businessAddress}`
  40. "
  41. >
  42. <span>成立日期:{{ companyInfo.establishOn | formatDate("YYYY-MM-DD") }}</span>
  43. <span v-if="companyInfo.ownerIndustry">行业:{{ companyInfo.ownerIndustry }}</span>
  44. <span>地址:{{ companyInfo.businessAddress }}</span>
  45. </div>
  46. <div class="advantage_box" v-if="enterpriseLabel.length > 0" :title="enterpriseLabel">
  47. <span v-for="item in enterpriseLabel" :key="item">
  48. {{ item }}
  49. </span>
  50. </div>
  51. <div
  52. :class="[
  53. 'business',
  54. !enterpriseLabel || enterpriseLabel.length === 0 ? 'two_rows' : 'one_rows',
  55. ]"
  56. :title="companyInfo && companyInfo.businessScope ? companyInfo.businessScope : ''"
  57. >
  58. <template v-if="companyInfo.businessScope">
  59. <span>主营业务:</span>
  60. {{ companyInfo.businessScope }}
  61. </template>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  68. //例如:import 《组件名称》 from '《组件路径》';
  69. import { formatImg, formatDateFun } from "@/utils/common.js";
  70. export default {
  71. //import引入的组件需要注入到对象中才能使用
  72. props: {
  73. companyInfo: {
  74. type: Object,
  75. default: () => {},
  76. },
  77. },
  78. components: {},
  79. data() {
  80. //这里存放数据
  81. return {};
  82. },
  83. //监听属性 类似于data概念
  84. computed: {
  85. enterpriseLabel() {
  86. return this.companyInfo?.enterpriseLabel?.text ?? [];
  87. },
  88. },
  89. //监控data中的数据变化
  90. watch: {},
  91. //方法集合
  92. methods: {
  93. formatImg,
  94. formatDateFun,
  95. goDetail(companyId) {
  96. this.$router.push({
  97. path: "/company-detail",
  98. query: {
  99. companyId,
  100. },
  101. });
  102. },
  103. },
  104. //生命周期 - 创建完成(可以访问当前this实例)
  105. created() {},
  106. //生命周期 - 挂载完成(可以访问DOM元素)
  107. mounted() {},
  108. };
  109. </script>
  110. <style lang="scss" scoped>
  111. //@import url(); 引入公共css类
  112. .item_box {
  113. @include size(100%, auto);
  114. border: solid 1px #bcd8e9;
  115. padding: 30px;
  116. @include border-box;
  117. @include flex(row, flex-start, center, null);
  118. margin-bottom: 30px;
  119. .company_img {
  120. @include size(280px, 180px);
  121. }
  122. .info_box {
  123. flex: 1;
  124. height: 180px;
  125. padding-left: 30px;
  126. @include border-box;
  127. @include flex(column, flex-start, flex-start, null);
  128. overflow: hidden;
  129. .title_box {
  130. @include flex(row, flex-start, center, null);
  131. margin-bottom: 15px;
  132. width: 100%;
  133. .company_title {
  134. max-width: calc(100% - 80px);
  135. @include font(18px, #334a5f);
  136. font-weight: 600;
  137. margin-right: 10px;
  138. @include text-ellipsis;
  139. }
  140. .claim_state {
  141. @include size(68px, 22px);
  142. @include flex(row, flex-start, center, null);
  143. @include font(14px, #fff);
  144. padding-left: 6px;
  145. @include border-box;
  146. }
  147. .claimed {
  148. background: url("~@assets/image/company/bg_claimed.png") no-repeat;
  149. }
  150. .not_claim {
  151. background: url("~@assets/image/company/bg_not_claim.png") no-repeat;
  152. }
  153. }
  154. .company_info {
  155. width: 100%;
  156. margin-bottom: 10px;
  157. @include font(16px, #637485);
  158. @include text-ellipsis;
  159. span {
  160. padding-right: 8px;
  161. @include border-box;
  162. }
  163. > span + span {
  164. border-left: solid 1px #637485;
  165. padding-left: 8px;
  166. }
  167. }
  168. .advantage_box {
  169. margin-bottom: 15px;
  170. margin-top: 10px;
  171. span {
  172. @include font(14px, #0086e7);
  173. padding: 2px 8px;
  174. border: solid 1px #0086e7;
  175. @include border-box;
  176. margin-right: 10px;
  177. }
  178. }
  179. .business {
  180. width: 100%;
  181. min-height: 20px;
  182. @include font(16px, #637485);
  183. margin-top: 8px;
  184. span {
  185. @include font(16px, #334a5f);
  186. font-weight: 600;
  187. }
  188. }
  189. .one_rows {
  190. @include text-ellipsis;
  191. }
  192. .two_rows {
  193. @include text-ellipsis-multiple(2);
  194. }
  195. }
  196. }
  197. </style>