|
@@ -0,0 +1,181 @@
|
|
|
+<template>
|
|
|
+ <section
|
|
|
+ class="buyer-cell cell-clickable"
|
|
|
+ :class="{
|
|
|
+ visited: visited
|
|
|
+ }"
|
|
|
+ v-on="$listeners"
|
|
|
+ >
|
|
|
+ <div class="buyer-cell-hd">
|
|
|
+ <div class="buyer-cell-title-container">
|
|
|
+ <span class="iconfont icon-mine_company"></span>
|
|
|
+ <span class="buyer-cell-title visited-hd" v-html="getTitle"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="buyer-cell-bd">
|
|
|
+ <div class="cor-item-info cor-item-info-line-1 visited-ft">
|
|
|
+ <div class="cor-info-item cor-info-item-project">项目数量:{{ projectCount || '-' }}</div>
|
|
|
+ <div class="cor-info-item cor-info-item-amount">项目总金额:{{ budget || '-' }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="cor-item-info cor-item-info-line-2 visited-ft">
|
|
|
+ <div class="cor-info-item cor-info-item-location">
|
|
|
+ <span>所在地:</span>
|
|
|
+ <span class="highlight-text">{{ location || '-' }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="cor-info-item cor-info-item-time">更新时间:{{ updateTime || '-' }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="buyer-cell-ft">
|
|
|
+ <div class="cor-item-right">
|
|
|
+ <slot name="ft-actions">
|
|
|
+ <span class="more-action">
|
|
|
+ <span>监控</span>
|
|
|
+ </span>
|
|
|
+ </slot>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { replaceKeyword } from '../../utils/index'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'BuyerCell',
|
|
|
+ props: {
|
|
|
+ title: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ visited: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ keys: {
|
|
|
+ type: Array,
|
|
|
+ default() {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ projectCount: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ budget: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ location: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ updateTime: {
|
|
|
+ type: [Number, String],
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {}
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ tagList() {
|
|
|
+ return this.tags.map((tag) => {
|
|
|
+ if (!tag || typeof tag === 'string') {
|
|
|
+ return {
|
|
|
+ name: tag,
|
|
|
+ className: 'grey'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return tag
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTitle() {
|
|
|
+ return replaceKeyword(this.title, this.keys)
|
|
|
+ },
|
|
|
+ getTime() {
|
|
|
+ if (this.timeFmt) {
|
|
|
+ return dateFormatter(this.time, this.timeFmt)
|
|
|
+ } else {
|
|
|
+ return dateFromNow(this.time)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setKeyLength() {
|
|
|
+ const key = this.keys[0]
|
|
|
+ if (key) {
|
|
|
+ if (key.length > 3) {
|
|
|
+ return key.substring(0, 3) + '...'
|
|
|
+ } else {
|
|
|
+ return key
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {}
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.buyer-cell {
|
|
|
+ position: relative;
|
|
|
+ padding: 12px 16px;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #171826;
|
|
|
+ background-color: $white;
|
|
|
+ .buyer-cell-title-container {
|
|
|
+ display: flex;
|
|
|
+ .buyer-cell-title {
|
|
|
+ margin-left: 4px;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .buyer-cell-bd {
|
|
|
+ margin-top: 4px;
|
|
|
+ padding-left: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .icon-mine_company {
|
|
|
+ color: $main;
|
|
|
+ font-size: 26px;
|
|
|
+ }
|
|
|
+ .buyer-cell-ft {
|
|
|
+ margin-top: 14px;
|
|
|
+ }
|
|
|
+ .cor-item-info {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ .cor-info-item {
|
|
|
+ margin: 0 8px;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ .cor-item-right {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .cor-item-info-line-1 {
|
|
|
+ color: #5f5e64;
|
|
|
+ }
|
|
|
+ .cor-item-info-line-2 {
|
|
|
+ color: #9B9CA3;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.visited {
|
|
|
+ .visited-hd {
|
|
|
+ color: #C0C4CC!important;
|
|
|
+ }
|
|
|
+ .visited-ft {
|
|
|
+ color: #9B9CA3!important;
|
|
|
+ }
|
|
|
+ .visited-ft.visited-tag {
|
|
|
+ background-color: #F7F9F9;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|