|
@@ -8,11 +8,11 @@
|
|
<v-img :src="item?.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" alt="" width="77" height="77" style="border-radius: 4px;"/>
|
|
<v-img :src="item?.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" alt="" width="77" height="77" style="border-radius: 4px;"/>
|
|
</div>
|
|
</div>
|
|
<div class="company-info cursor-pointer">
|
|
<div class="company-info cursor-pointer">
|
|
- <h3 v-ellipse-tooltip.top>{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3>
|
|
|
|
- <!-- <h3 :ref="el => { if(el) companyNameRefs[index] = el }">
|
|
|
|
|
|
+ <!-- <h3 v-ellipse-tooltip.top>{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</h3> -->
|
|
|
|
+ <h3 :ref="el => { if(el) companyNameRefs[index] = el }">
|
|
{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}
|
|
{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}
|
|
<v-tooltip v-if="isTextOverflow[index]" activator="parent" location="top">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</v-tooltip>
|
|
<v-tooltip v-if="isTextOverflow[index]" activator="parent" location="top">{{ formatName(item.enterprise.anotherName || item.enterprise.name) }}</v-tooltip>
|
|
- </h3> -->
|
|
|
|
|
|
+ </h3>
|
|
<p>
|
|
<p>
|
|
{{ item?.enterprise.scaleName }}
|
|
{{ item?.enterprise.scaleName }}
|
|
<span class="septal-line" v-if="item.enterprise.industryName"></span>
|
|
<span class="septal-line" v-if="item.enterprise.industryName"></span>
|
|
@@ -57,7 +57,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="hotPromoted">
|
|
<script setup name="hotPromoted">
|
|
-import { ref, watch } from 'vue'
|
|
|
|
|
|
+import { nextTick, ref, watch } from 'vue'
|
|
import { timesTampChange } from '@/utils/date'
|
|
import { timesTampChange } from '@/utils/date'
|
|
import { formatName } from '@/utils/getText'
|
|
import { formatName } from '@/utils/getText'
|
|
import { jumpToEnterpriseDetail } from '@/utils/position'
|
|
import { jumpToEnterpriseDetail } from '@/utils/position'
|
|
@@ -73,25 +73,25 @@ const props = defineProps({
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
|
|
|
-// const isTextOverflow = ref({})
|
|
|
|
-// const companyNameRefs = ref({})
|
|
|
|
|
|
+const isTextOverflow = ref({})
|
|
|
|
+const companyNameRefs = ref({})
|
|
// 检查文本是否溢出
|
|
// 检查文本是否溢出
|
|
-// const checkTextOverflow = () => {
|
|
|
|
-// Object.entries(companyNameRefs.value).forEach(([index, element]) => {
|
|
|
|
-// if (element) {
|
|
|
|
-// isTextOverflow.value[index] = element.scrollWidth > element.clientWidth
|
|
|
|
-// }
|
|
|
|
-// })
|
|
|
|
-// }
|
|
|
|
|
|
+const checkTextOverflow = () => {
|
|
|
|
+ Object.entries(companyNameRefs.value).forEach(([index, element]) => {
|
|
|
|
+ if (element) {
|
|
|
|
+ isTextOverflow.value[index] = element.scrollWidth > element.clientWidth
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
const list = ref([])
|
|
const list = ref([])
|
|
watch(
|
|
watch(
|
|
() => props.items,
|
|
() => props.items,
|
|
(newVal) => {
|
|
(newVal) => {
|
|
list.value = newVal
|
|
list.value = newVal
|
|
- // nextTick(() => {
|
|
|
|
- // checkTextOverflow()
|
|
|
|
- // })
|
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ checkTextOverflow()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
{ immediate: true },
|
|
{ immediate: true },
|
|
{ deep: true }
|
|
{ deep: true }
|