Commit b2e77304 by 王志慧

ui修改

1 parent 55fa3af9
......@@ -56,7 +56,7 @@
</p>
<p>
<span>证件号码:</span>
<span class="ellipsis-1">341189199508293021</span>
<span class="ellipsis-1">{{leftPanelInfo.idCard}}</span>
</p>
<p>
<span>性别:</span>
......
......@@ -27,11 +27,11 @@
</div>
</el-form>
<div class="label-wrap">
<div :class="{ 'fixed-box': true, is_fixed: isFixed, is_pb: isDom, is_auto: !isFixed }" id="boxFixed">
<div :class="{ 'fixed-box': true, is_fixed: isFixed, is_pb: isDom }" id="boxFixed">
<template v-if="this.selectedArray.length > 0">
<div class="select-label-wrap font-14 flex-start" id="tagBox">
<div :class="['select-label-wrap', 'font-14', 'flex-start', !isFixed ? 'is_auto' : '']" id="tagBox">
<div class="select-label color-3">已选标签:</div>
<div class="flex">
<div class="flex" id="selectTagBox">
<div class="selects" v-for="(selectTag, index) in selectedArray" :key="index" @click="labelFilter(selectTag)">
<template v-if="selectTag.groupName.length + selectTag.combination.length <= 20">
<div class="label-group-name color-3 hand">
......@@ -91,8 +91,9 @@
</div>
</div>
</div>
<div v-show="isFixed" style="width: 100%" id="placeholder"></div>
<div class="pageContent">
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="crowdManage" :hasNum="false" :tableTotal="tableTotal" :tableData="tableData" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" @refreshTable="refreshTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<GLTable ref="crowdManage" :hasNum="false" :tableTotal="tableTotal" :tableData="tableData" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" @refreshTable="refreshTable" :tableParams="tableParams" :headerStyle="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="labelUnitList" slot-scope="scope">
<div class="allTagsWrap flex">
<template v-for="(item, index) in scope.scope.labelUnitList">
......@@ -174,6 +175,7 @@ export default {
offsetTop: 0,
expande: false,
isClick: false,
addClick:false,
isDom: false,
isShowCloseBtn: true,
tableData: [],
......@@ -243,17 +245,22 @@ export default {
if (this.selectedArray.length > 0) {
this.$nextTick(() => {
//条件重置
document.getElementById('placeholder').style.height = document.getElementById('boxFixed').offsetHeight + 'px'
document.getElementById('tagBox').style.height = 'auto'
if (!this.isFixed) {
let height = document.getElementById('selectTagBox').offsetHeight
console.log(height, '数据监听')
if (!this.isFixed||this.addClick) {
//判断是否可以触发
this.isClick = false
this.expande = false
}
if (!this.isClick || !this.isFixed) {
console.log(this.isClick)
if (!this.isClick ||this.addClick|| !this.isFixed) {
//获取当前元素的高
let height = document.getElementById('tagBox').offsetHeight
if (height > 127) {
document.getElementById('tagBox').style.height = 128 + 'px'
if (height > 96) {
document.getElementById('tagBox').style.height = 96 + 'px'
this.isDom = true
} else {
document.getElementById('tagBox').style.height = 'auto'
......@@ -265,10 +272,6 @@ export default {
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
window.addEventListener('scroll', this.initHeight, true)
this.$nextTick(() => {
this.offsetTop = document.querySelector('#boxFixed').offsetTop
......@@ -413,11 +416,13 @@ export default {
expandeClick() {
this.expande = !this.expande
this.isClick = this.expande
this.addClick = false
if (this.expande) {
document.getElementById('tagBox').style.height = 'auto'
} else {
document.getElementById('tagBox').style.height = 128 + 'px'
document.getElementById('tagBox').style.height = 96 + 'px'
}
document.getElementById('placeholder').style.height = document.getElementById('boxFixed').offsetHeight + 'px'
},
initHeight() {
var timeOut = null
......@@ -427,7 +432,9 @@ export default {
timeOut = setTimeout(() => {
var scrollTop = document.querySelector('#container').scrollTop
this.isFixed = scrollTop > this.offsetTop ? true : false
console.log(this.isFixed)
if (!this.isFixed) {
document.getElementById('placeholder').style.height = document.getElementById('boxFixed').offsetHeight + 'px'
}
}, 200)
},
//获取标签数据
......@@ -482,6 +489,7 @@ export default {
},
// 添加已选标签
selectedLabelFn(groupData, data) {
this.addClick = true
if (this.selectedArray.length > 0) {
for (let i = 0; i < this.selectedArray.length; i++) {
if (this.selectedArray[i].groupId == groupData.groupId) {
......@@ -520,6 +528,7 @@ export default {
let idArray = []
if (this.selectedArray[i].labelUnitList.length == 0) {
this.selectedArray.splice(i--, 1)
return
}
for (let j = 0; j < this.selectedArray[i].labelUnitList.length; j++) {
array.push(this.selectedArray[i].labelUnitList[j].labelName)
......@@ -527,16 +536,14 @@ export default {
}
this.selectedArray[i].labelIdList = idArray
this.selectedArray[i].combination = array.join('、')
console.log(this.checkName(this.selectedArray[i].groupName))
let length = 40 - this.checkName(this.selectedArray[i].groupName)
console.log(length)
this.selectedArray[i].combinationtext = this.cutMaxCharStr(this.selectedArray[i].combination, length)
console.log(this.selectedArray[i].combinationtext)
this.$set(this.selectedArray, i, this.selectedArray[i])
}
},
//删除选中标签
closeTag(data, index) {
this.addClick = true
this.selectedArray.splice(index, 1)
this.tableData.forEach(t => {
if (t.groupId == data.groupId) {
......@@ -546,15 +553,18 @@ export default {
}
})
//条件重置
document.getElementById('tagBox').style.height = 'auto'
let height = document.getElementById('tagBox').offsetHeight
if (height > 127) {
document.getElementById('tagBox').style.height = 128 + 'px'
this.isDom = true
} else {
this.$nextTick(() => {
document.getElementById('tagBox').style.height = 'auto'
this.isDom = false
}
let height = document.getElementById('selectTagBox').offsetHeight
console.log(height, '删除')
if (height > 96) {
document.getElementById('tagBox').style.height = 96 + 'px'
this.isDom = true
} else {
document.getElementById('tagBox').style.height = 'auto'
this.isDom = false
}
})
},
//点击标签组搜索
labelFilter(data) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!