Commit 6e4dd2a6 by 王志慧

commit

1 parent fbdd0044
......@@ -73,10 +73,6 @@ background: transparent !important;
align-items: center;
justify-content: space-between;
}
.flex-satrt{
display: flex;
align-items: flex-start;
}
.font-20{
font-size: 20px;
}
......
......@@ -4,7 +4,7 @@
<div>
<div class="title">创建人群</div>
<div class="info-box">
<el-form :model="groupForm" :rules="groupRules" ref="groupForm" label-width="118px">
<el-form class="create-form" :model="groupForm" :rules="groupRules" ref="groupForm" label-width="118px">
<div class="el-form-line">
<el-form-item label="人群名称:" prop="groupName">
<el-input v-model.trim="groupForm.groupName" size="small" placeholder="请输入人群名称" maxlength="30"></el-input>
......@@ -20,16 +20,16 @@
<div class="el-form-line">
<el-form-item label="标签筛选:" prop="groupNameRule" class="label-word">
<div class="flex">
<div class="font-14 color-58 mr2 hand">人群规则说明</div>
<div class="font-14 color-58 hand">人群规则逻辑</div>
<div class="font-14 color-58 mr2 hand" @click="open('dialogRuleVisible')">人群规则说明</div>
<div class="font-14 color-58 hand" @click="open('dialogLogicVisible')">人群规则逻辑</div>
</div>
</el-form-item>
</div>
</el-form>
<div class="label-wrap">
<div :class="{ 'fixed-box': true, is_fixed: isFixed, is_pb: isDom }" id="boxFixed">
<div :class="{ 'fixed-box': true, is_fixed: isFixed, is_pb: isDom, is_auto: !isFixed }" id="boxFixed">
<template v-if="this.selectedArray.length > 0">
<div class="select-label-wrap font-14 flex-satrt" id="tagBox">
<div class="select-label-wrap font-14 flex-start" id="tagBox">
<div class="select-label color-3">已选标签:</div>
<div class="flex">
<div class="selects" v-for="(selectTag, index) in selectedArray" :key="index">
......@@ -55,12 +55,22 @@
</div>
</div>
</template>
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="tagsPartFormList" @setTableHeightEvent="setTableHeightEvent" labelWidth="54px">
<span class="inline-b" slot="form-slot">
<el-form :model="searchForm" size="small" :inline="true" @submit.native.prevent label-position="right" label-width="auto">
<el-form-item label="标签组名称">
<el-select v-model="searchForm.labelTypesStr" filterable placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标签名称">
<el-select v-model="searchForm.labelGroupName" filterable placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="resetTable" plain>重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
</el-form-item>
</el-form>
<div class="expande-button-wrap" v-if="isFixed">
<div class="expande-button" @click="expandeClick" v-if="!expande && isDom">
<i class="el-icon-arrow-down"></i>
......@@ -73,6 +83,7 @@
</div>
</div>
<div class="pageContent">
<div class="color-3 font-14 forecast">查看预估人数<span class="color-58">刷新</span></div>
<GLTable @setTableFinishFun="setTableFinishFun" v-if="isReload" ref="tagsManage" :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="labelGroup" slot-scope="scope">
<span>{{ scope.scope.labelGroup.name }}</span>
......@@ -105,6 +116,51 @@
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button @click="handleCancel">取消</el-button>
</div>
<el-dialog title="人群规则说明" class="crowd-dialog" width="720px" :before-close="handleClose" :visible.sync="dialogRuleVisible" :show-close="isShowCloseBtn">
<div class="crowd-dialog-wrap color-3">
<div class="condition font-14">
<b>说明:</b>
<br />
<span>
标签组内已选标签取
<b>并集(或)</b>
,即满足一个条件即可、标签组之间取
<b>交集(且)</b>
,即同时满足标签组条件。
</span>
</div>
<div class="flex-between">
<div class="static-image">
<img src="@/assets/crowdManage/sum.png" alt="" />
</div>
<div class="static-image">
<img src="@/assets/crowdManage/intersection.png" alt="" />
</div>
</div>
</div>
</el-dialog>
<el-dialog title="人群规则逻辑" class="crowd-logic-dialog" width="720px" :before-close="handleClose" :visible.sync="dialogLogicVisible" :show-close="isShowCloseBtn">
<div class="crowd-logic-dialog-wrap">
<div :class="{ 'crowd-flex': true }" v-if="this.selectedArray.length > 1">
<div class="crowd-line" id="lineHeight"></div>
<div class="moreover">且</div>
<div class="crowd-line" id="lineHeight2"></div>
</div>
<div class="crowd-logic-wrap" id="crowd-logic-wrap" :style="{ 'margin-left': this.selectedArray.length > 1 ? '20px' : '55px' }">
<div class="crowd-logic-labels" v-for="(logicTag, index) in this.selectedArray" :key="index">
<div class="crowd-logic-label-group-name font-14 color-3">{{ logicTag.labelGroupName.name }}:</div>
<div class="flex">
<template v-for="(tag, id) in logicTag.children">
<div class="crowd-logic-tag color-6 font-14" :key="id">{{ tag.name }}</div>
<template v-if="id < logicTag.children.length - 1">
<div class="color-3 perhaps" :key="id">或</div>
</template>
</template>
</div>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
......@@ -114,12 +170,16 @@ export default {
name: 'crowdAdd',
data() {
return {
isFixed: true,
isFixed: false,
offsetTop: 0,
expande: false,
isClick: false,
isDom: false,
isShowCloseBtn: true,
tableData: [],
isReload: true,
dialogRuleVisible: false,
dialogLogicVisible: false,
groupForm: {
groupName: ''
},
......@@ -201,11 +261,15 @@ export default {
},
watch: {
selectedArray: function () {
this.$nextTick(function () {
this.$nextTick(() => {
//条件重置
document.getElementById('tagBox').style.height = 'auto'
if (!this.expande || !this.isFixed) {
if (!this.isFixed) {
//判断是否可以触发
this.isClick = false
this.expande = false
}
if (!this.isClick || !this.isFixed) {
//获取当前元素的高
let height = document.getElementById('tagBox').offsetHeight
if (height > 127) {
......@@ -225,20 +289,49 @@ export default {
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
})
},
methods: {
delayScrollFunc(fn, delay) {
const now = new Date().getTime()
if (now - this.lastScrollCall < delay) return
this.lastScrollCall = now
setTimeout(() => {
fn()
}, 60) // 在实际项目中,我发现这里再延迟一点时间执行效果更好(针对监听scroll)
},
open(value) {
this[value] = true
if (this.dialogLogicVisible == true && this.selectedArray.length > 1) {
this.$nextTick(() => {
let height = document.getElementById('crowd-logic-wrap').offsetHeight
if (height >= 650) {
document.getElementById('lineHeight').style.height = 308 + 'px'
document.getElementById('lineHeight2').style.height = 308 + 'px'
this.logicFix = true
} else {
let lineHeight = (height - 35) / 2
document.getElementById('lineHeight').style.height = lineHeight + 'px'
document.getElementById('lineHeight2').style.height = lineHeight + 'px'
}
})
}
},
handleClose() {
this.dialogRuleVisible = false
this.dialogLogicVisible = false
},
refreshTable(page) {
console.log(page)
this.page = page
this.getLabelData()
},
expandeClick() {
this.expande = !this.expande
this.isClick = this.expande
if (this.expande) {
document.getElementById('tagBox').style.height = 'auto'
} else {
......@@ -248,18 +341,6 @@ export default {
initHeight() {
var scrollTop = document.querySelector('#container').scrollTop
this.isFixed = scrollTop > this.offsetTop ? true : false
document.getElementById('tagBox').style.height = 'auto'
let height = document.getElementById('tagBox').offsetHeight
if (!this.isFixed) {
//条件重置
if (height > 127) {
this.expande = true
this.isDom = true
} else {
this.expande = false
this.isDom = false
}
}
},
//获取标签数据
getLabelData() {
......@@ -350,11 +431,9 @@ export default {
}
this.selectedArray[i].combination = array.join('、')
let length = 20 - this.selectedArray[i].labelGroupName.name.length
console.log(this.selectedArray[i].combination)
this.selectedArray[i].combinationtext = this.selectedArray[i].combination.substring(0, length)
this.$set(this.selectedArray, i, this.selectedArray[i])
}
console.log(this.selectedArray)
},
//删除选中标签
closeTag(data, index) {
......@@ -407,6 +486,7 @@ export default {
height: calc(100vh - 150px);
overflow-y: auto;
// padding: 20px;
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
......@@ -421,7 +501,7 @@ export default {
width: 100%;
padding: 30px 0;
box-sizing: border-box;
.el-form {
.create-form {
width: 100%;
height: 246px;
box-sizing: border-box;
......@@ -473,7 +553,6 @@ export default {
width: 100%;
.fixed-box {
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 0 30px;
}
......@@ -483,10 +562,14 @@ export default {
top: 60px;
z-index: 999;
padding: 20px 30px 20px 30px;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
}
.is_pb {
padding: 20px 30px 52px 30px !important;
}
.is_auto {
height: auto !important;
}
.select-label-wrap {
margin-bottom: 20px;
overflow: hidden;
......@@ -546,8 +629,19 @@ export default {
padding: 0 0 2px 0;
}
.pageContent {
position:relative;
padding: 0 30px;
}
.forecast{
position: absolute;
right:40px;
top:-56px;
line-height: 36px;
span{
margin-left:4px;
cursor: pointer;
}
}
.expande-button-wrap {
position: absolute;
bottom: 16px;
......@@ -630,4 +724,99 @@ export default {
.tooltip-text {
line-height: 18px;
}
.crowd-dialog {
/deep/.el-dialog__header {
padding: 15px 20px;
}
/deep/.el-dialog__body {
padding: 20px;
}
}
.crowd-logic-dialog {
/deep/.el-dialog__header {
padding: 15px 20px;
}
/deep/.el-dialog__body {
padding: 20px;
min-height: 260px;
max-height: 690px;
overflow: auto;
}
}
.crowd-dialog-wrap {
.condition {
margin-bottom: 16px;
line-height: 21px;
b {
color: #666666;
}
}
.static-image {
width: 335px;
height: 325px;
img {
width: 100%;
}
}
}
.crowd-logic-dialog-wrap {
display: flex;
.crowd-flex {
display: flex;
flex-direction: column;
align-items: center;
}
.crowd-line {
width: 1px;
background: #5850ff;
}
.moreover {
text-align: center;
font-size: 16px;
font-weight: 500;
color: #5850ff;
line-height: 35px;
width: 35px;
height: 35px;
background: #efeeff;
border-radius: 4px;
border: 1px solid #5850ff;
}
.crowd-logic-wrap {
width: 100%;
height: auto;
.crowd-logic-labels {
width: 625px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
padding: 10px;
box-sizing: border-box;
margin-top: 10px;
.crowd-logic-label-group-name {
line-height: 21px;
}
.crowd-logic-tag {
padding: 1px 8px;
line-height: 24px;
height: 26px;
background: #f4f6fc;
border-radius: 4px;
border: 1px solid #e8e8ea;
margin-top: 8px;
margin-right: 8px;
}
.perhaps {
margin-top: 8px;
margin-right: 8px;
font-weight: 400;
}
}
}
.crowd-logic-wrap :nth-child(1) {
margin-top: 0;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!