fix : 修复部门分管领导回显,需求上报排版

This commit is contained in:
2024-08-03 00:36:51 +08:00
parent 6e612e1f7a
commit fbfbe5c328
10 changed files with 307 additions and 200 deletions

View File

@@ -5,7 +5,7 @@
placement="bottom-start"
:disabled="isShow"
>
<div :class="lines?'content-lines':'content'" :style="{width: props.width}" @mouseover="isShowTooltip">
<div :class="lines?'content-lines':textAlign=='left'?'left-content':'content'" :style="{width: props.width+'px'}" @mouseover="isShowTooltip">
<span ref="contentRef">
<slot name="content">{{ props.content }}</slot>
</span>
@@ -25,15 +25,26 @@ const props = defineProps({
lines: {
type: Boolean,
default: false
}
},
textAlign: {
type: String,
default: ''
},
})
const contentRef = ref()
const isShow = ref(false)
const isShowTooltip = () => {
isShow.value = props.width > contentRef.value.offsetWidth;
isShow.value = parseInt(props.width) > contentRef.value.offsetWidth;
}
</script>
<style>
<style scoped>
.left-content{
width: 45px;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.content {
width: 45px;
text-align: center;