Commit 56318800 by 前端

Merge branch 'v2.4.0' into 'v2.5.0'

V2.4.0 to v2.5.0

See merge request !195
2 parents ff49f661 9162b094
......@@ -528,7 +528,7 @@ export default {
// 删除人群
removeCrowd(item, index) {
this.basicForm.crowdList.splice(index, 1)
this.$refs.selectCrowd.remove(item)
// this.$refs.selectCrowd.remove(item)
this.getCrowdData(this.basicForm.crowdList)
if (!this.basicForm.crowdList.length) {
this.basicForm.userList = []
......@@ -687,6 +687,14 @@ export default {
this.isUpdate = true
this.editStatus = true
})
} else {
this.basicForm.userList = []
this.basicForm.crowdList = []
this.selectData = []
this.isSelectCrowd = false
this.isUpdate = true
this.editStatus = true
this.key = new Date()
}
}
}
......
......@@ -59,7 +59,7 @@ export default {
previewList(val) {
if (val.length && val[0].attType == 1) {
const attContent = val[0].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
......@@ -128,14 +128,17 @@ export default {
word-break: break-all;
display: flex;
img {
width: 20px;
height: 20px;
width: 16px;
height: 16px;
vertical-align: middle;
}
}
.text {
display: inline-block;
font-size: 16px;
font-size: 12px;
padding: 8px 11px;
line-height: 16px;
white-space: pre-wrap;
}
.preview-link {
display: inline-flex;
......
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2022-05-24 18:18:53
* @LastEditors: huyue
* @LastEditTime: 2022-06-13 16:51:03
* @LastEditTime: 2022-06-15 17:25:53
-->
<template>
<div>
<el-dialog :title="'人群筛选'" :width="'1080px'" :visible.sync="crowdVisible">
<el-dialog :title="'人群筛选'" :width="'1080px'" :visible.sync="crowdVisible" v-if="crowdVisible">
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
......@@ -23,7 +23,7 @@
</el-form-item>
</el-form>
<div class="table-content">
<GLTable v-loading="loading" ref="crowdTable" :tableData="tableData" @refreshTable="search" :tableTotal="tableTotal" :layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick"></GLTable>
<GLTable v-loading="loading" ref="crowdTable" :tableData="tableData" @refreshTable="getCrowdList" :tableTotal="tableTotal" :layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf" :noDataImg="url" @selectionTable="handleSelectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
......@@ -32,7 +32,7 @@
<div class="member-name">人群({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag, idx)">
{{ tag.crowdName }}
</el-tag>
</div>
......@@ -97,7 +97,7 @@ export default {
},
methods: {
init(val) {
console.log(val)
// console.log(val)
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
......@@ -108,61 +108,118 @@ export default {
this.getCrowdList()
})
},
getCrowdList() {
getCrowdList(page = { pageNum: 1, pageSize: 10 }) {
this.$refs.crowdTable.page = page
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: this.$refs.crowdTable.page.pageSize,
pageNum: this.$refs.crowdTable.page.pageNum
pageSize: page.pageSize,
pageNum: page.pageNum
}
}
this.$apis.customerTransform.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
console.log(this.inner)
console.log(this.tableData)
this.tableData.forEach(item => {
this.inner.forEach((itm, index) => {
if (itm.crowdId == item.crowdId) {
this.rowClick(item)
}
})
})
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected()
})
},
beforeSearchFn() {
return new Promise(resolve => {
Object.assign(this.searchForm.req, {})
resolve()
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.innerTags))
this.innerTags = []
val.forEach(item => {
if (this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.crowdId == item.crowdId) == '-1' && this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
},
selectionTable(val) {
this.innerTags = []
for (let i = 0; i < val.length; i++) {
console.log(i)
const tagArr = this.innerTags.map(item => item.crowdId)
if (!tagArr.includes(val[i].crowdId)) {
this.innerTags.push(val[i])
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) {
list.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.crowdId == item.crowdId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(item)
var idx = this.innerTags.findIndex(k => k.crowdId == item.crowdId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.crowdId).includes(item.crowdId)) {
var i = this.tableData.findIndex(k => k.crowdId == item.crowdId)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[i])
}
},
rowClick(row) {
console.log(this.$refs.crowdTable)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.getCrowdList()
this.getCrowdList({ pageNum: 1, pageSize: 10 })
},
handleConfirm() {
// console.log(this.innerTags)
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm = { req: {} }
this.searchForm = { keyword: {} }
}
}
}
......@@ -197,7 +254,7 @@ export default {
/deep/ {
.el-table {
height: 40vh;
// height: 40vh;
overflow-y: auto;
}
}
......@@ -207,7 +264,7 @@ export default {
}
.table-content {
max-height: 456px;
max-height: 500px;
overflow: auto;
border-top: 1px solid #eee;
}
......@@ -297,6 +354,7 @@ export default {
.el-dialog__close {
width: 24px;
height: 24px;
font-size: 24px;
}
}
.el-pagination {
......
......@@ -335,11 +335,12 @@ export default {
-webkit-user-modify: read-only !important;
}
img {
width: 24px;
height: 24px;
width: 18px;
height: 18px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
vertical-align: middle;
}
.active {
background: #dcdfe6;
......
......@@ -60,7 +60,7 @@
</div>
<div class="tips-text">
<img src="@/assets/guestCustom/tips.png" class="tips-icon" alt />
<div class="tips-icon"><img src="@/assets/guestCustom/tips.png" alt /></div>
<span v-if="form == 'customer'">每位客户每天可接收1条群发消息,超过接收上限的客户将无法再收到群发消息。</span>
<span v-if="form == 'customerGroup'">每个客户群每天可接收1条群发消息,超过接收上限的客户群将无法再收到群发消息。</span>
</div>
......@@ -323,7 +323,7 @@ export default {
}
}
},
changeInput: utils.debounce(function () {
changeInput: utils.debounce(function() {
var allNodes = document.getElementById('editor').childNodes
var str = ''
allNodes.forEach(item => {
......@@ -341,7 +341,7 @@ export default {
this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
......@@ -520,19 +520,25 @@ export default {
}
.tips-text {
display: flex;
align-items: center;
// align-items: center;
justify-self: center;
color: #000;
font-size: 14px;
padding: 0 16px;
padding: 10px 16px;
margin-top: 10px;
background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px;
line-height: 20px;
.tips-icon {
width: 14px;
height: 14px;
margin-right: 8px;
display: flex;
align-items: center;
height: 20px;
img {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
}
// 编辑器
......
......@@ -149,7 +149,8 @@ export default {
createDate: [],
orderSource: '',
deliveryType: '',
vin: ''
vin: '',
shareStaffName: ''
},
tableSearchForm: {},
statisticsInfo: {
......@@ -284,6 +285,13 @@ export default {
labelWidth: 56,
type: 'input',
maxlength: 50
},
{
label: '推荐人',
name: 'shareStaffName',
labelWidth: 56,
type: 'input',
maxlength: 100
}
],
// 快递信息
......@@ -775,7 +783,8 @@ export default {
createDate: [],
orderSource: '',
deliveryType: '',
vin: ''
vin: '',
shareStaffName: ''
}
this.handleSearch()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!