Bläddra i källkod

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 3 månader sedan
förälder
incheckning
5b9610e226

+ 0 - 10
src/components/Enterprise/hotPromoted.vue

@@ -20,14 +20,6 @@
             </p>
           </div>
         </div>
-
-        <div v-if="showTextOverflow">
-          <div v-ellipse-tooltip.top class="px-5 py-1 ellipsis-tag">北京金融街资本运营集团北京金融街资本运营集集</div>
-          <div v-ellipse-tooltip.bottom class="px-5 py-1 ellipsis-tag">北京金融街资本运营集团北京金融街资本运营集集</div>
-          <div v-ellipse-tooltip.left class="px-5 py-1 ellipsis-tag">北京金融街资本运营集团北京金融街资本运营集集</div>
-          <div v-ellipse-tooltip.right class="px-5 py-1 ellipsis-tag">北京金融街资本运营集团北京金融街资本运营集集</div>
-        </div>
-
         <div v-ellipse-tooltip.top class="px-5 py-1 ellipsis-tag" :style="{'height': '33px', 'border-bottom': item.enterprise.welfareList && item.enterprise.welfareList.length ? '1px solid #EBEBEB' : 'none'}">
           <span class="welfareTag" v-for="(k, i) in item.enterprise.welfareList" :key="i">{{ spaces(i ? 4 : 0) + k }}</span>
         </div>
@@ -81,8 +73,6 @@ const props = defineProps({
 
 const router = useRouter()
 
-const showTextOverflow = ref(localStorage.getItem('useEllipseTooltip') || false)
-
 const isTextOverflow = ref({})
 const companyNameRefs = ref({})
 // 检查文本是否溢出

+ 1 - 1
src/components/Position/item.vue

@@ -13,7 +13,7 @@
             </div>
           </div>
           <div class="d-flex justify-space-between align-center">
-            <div class="text-truncate" style="color: #808080;" :style="{'width': !item.payFrom && !item.payTo ? '290px' : '190px'}">
+            <div v-ellipse-tooltip.top class="text-truncate" style="color: #808080;" :style="{'width': !item.payFrom && !item.payTo ? '290px' : '190px'}">
               <span v-for="(j, i) in desc" :key="i" class="font-size-13" style="">
                 <span
                   v-if="item[j.value] || j.value === 'areaName'"

+ 15 - 13
src/directives/ellipsisTooltip/index.js

@@ -101,24 +101,26 @@ function dealDomBoundary(el, direction) {
 const allPlacements = ['left', 'bottom', 'right', 'top']
 
 
-function getElStyleAttr(element, attr) {
-    const styles = window.getComputedStyle(element)
-    // @ts-ignore
-    return styles[attr]
-}
+// function getElStyleAttr(element, attr) {
+//     const styles = window.getComputedStyle(element)
+//     return styles[attr]
+// }
 
 const isOverflow = (target) => {
     const scrollWidth = target.scrollWidth
     const offsetWidth = target.offsetWidth
-    const range = document.createRange()
-    range.setStart(target, 0)
-    range.setEnd(target, target.childNodes.length)
-    const rangeWidth = range.getBoundingClientRect().width
-    const padding = (parseInt(getElStyleAttr(target, 'paddingLeft'), 10) || 0) + (parseInt(getElStyleAttr(target, 'paddingRight'), 10) || 0)
-    return (rangeWidth + padding > target.offsetWidth) || scrollWidth > offsetWidth
+    // const range = document.createRange()
+    // range.setStart(target, 0)
+    // range.setEnd(target, target.childNodes.length)
+    // const rangeWidth = range.getBoundingClientRect().width
+    // const padding = (parseInt(getElStyleAttr(target, 'paddingLeft'), 10) || 0) + (parseInt(getElStyleAttr(target, 'paddingRight'), 10) || 0)
+    // return (rangeWidth + padding > target.offsetWidth) || scrollWidth > offsetWidth
+    return  scrollWidth > offsetWidth
 }
 
-export const ellipsisTooltip = localStorage.getItem('useEllipseTooltip') ? {
+const closeTooltip = false
+
+export const ellipsisTooltip = closeTooltip ? {} : {
     mounted(el, binding) {
         //获取指令的参数
         const {
@@ -186,4 +188,4 @@ export const ellipsisTooltip = localStorage.getItem('useEllipseTooltip') ? {
         }
         window.removeEventListener('scroll', el._scrollHandler)
     }
-} : {}
+}

+ 1 - 1
src/views/recruit/personal/recommend/components/positionList.vue

@@ -60,7 +60,7 @@
 defineOptions({ name: 'position-card-item' })
 import { ref, watch } from 'vue'
 import { formatName } from '@/utils/getText'
-import { spaces } from '@/utils/index.js'
+// import { spaces } from '@/utils/index.js'
 
 const emit = defineEmits([''])
 const props = defineProps({