Commit 7542caa0 by member

添加标签

parent e1d8abd8
......@@ -548,6 +548,7 @@
<script>
import qs from 'qs';
import tagDetails from '@/components/tagDetail/mixin/index';
import GicSelect from './birth-select';
import { getTagType, findWidget, findOndJson } from '@/request/tagConfig';
......@@ -566,6 +567,8 @@ export default {
tagId: String
},
mixins: [tagDetails],
data() {
return {
templateData: [],
......
......@@ -629,6 +629,7 @@ export default {
that.closeTagShortDialog();
// 如果来源是 会员标签编辑的时候
// if (that.fromFlag == 'memberGroup') {
console.log(this.tagData);
let sendObj = {
tagId: that.tagShortId || this.tagId,
tagValue: JSON.stringify(tagValue),
......
......@@ -37,9 +37,9 @@
</div>
<!-- 我的标签 -->
<div class="my-pop-tagbox" v-if="selectedTags.length > 0" @click="expendsGroupList">
<div class="my-pop-tagbox" v-if="groupListNumber > 0" @click="expendsGroupList">
<p class="txt">已选标签</p>
<p class="number-txt">{{ selectedTags.length }}</p>
<p class="number-txt">{{ groupListNumber }}</p>
</div>
</div>
</div>
......@@ -50,9 +50,9 @@
<vue-gic-footer></vue-gic-footer>
</div>
<div class="grouo-right-list" v-show="groupShow && selectedTags.length">
<div class="grouo-right-list" v-show="groupShow && groupListNumber">
<el-collapseTransition>
<tags-group-list :selectedTagsData="selectedTags" :tagsGroupRelation="tagsGroupRelation" @addTags="addTags" @editTags="editTags" />
<tags-group-list :selectedTagsData="selectedTags" :tagsGroupRelation="tagsGroupRelation" @addTags="addTags" @editTags="editTags" :activeTagsGroupIndex.sync="activeTagsGroupIndex" />
</el-collapseTransition>
</div>
</div>
......@@ -83,9 +83,10 @@ export default {
data() {
return {
activeTagsGroupIndex: 0,
groupShow: false,
selectedTags: [],
tagsGroupRelation: [[]],
selectedTags: [[]],
tagsGroupRelation: [],
// 面包屑参数
navpath: [
{
......@@ -114,18 +115,33 @@ export default {
};
},
computed: {
groupListNumber() {
return this.selectedTags.reduce((curr, el) => {
return curr + el.length;
}, 0);
}
},
methods: {
expendsGroupList() {
if (this.selectedTags && this.selectedTags.length) {
this.groupShow = true;
}
// if (this.selectedTags && this.selectedTags.length) {
this.groupShow = true;
// }
},
returnTagData(list) {
console.log(this.selectedTags);
// 如果存在id
let index = this.selectedTags.findIndex(el => el.tagId === list.tagId);
// 把添加的标签数据加到显示组件中 activeTagsGroupIndex
// 判断是否已经存在于当前二维数组里面
let middleList = this.selectedTags.reduce((curr, el) => {
return curr.concat(el);
}, []);
let index = middleList.findIndex(el => el.tagId === list.tagId);
// 不存在这个元素
if (index < 0) {
this.selectedTags.push(list);
this.selectedTags[this.activeTagsGroupIndex].push(list);
} else {
// 否则就是修改
}
},
editTags() {
......
......@@ -985,10 +985,9 @@ export default {
* 确定添加
*/
addTemporary: _debounce(function() {
const that = this;
that.addTemporaryPost();
}, 500),
addTemporary() {
this.addTemporaryPost();
},
/* eslint-disable */
async addTemporaryPost() {
......
......@@ -32,7 +32,7 @@
<el-dialog title="添加标签" :visible.sync="dialogVisible" width="540" :before-close="handleClose">
<div class="dialog-box">
<p class="tag-name">{{ dialogData.tagName }}</p>
<p class="tag-name">{{ tagData.tagName }}</p>
<p class="tag-desc">根据会员信息扩展字段统计而来</p>
<p class="tag-desc">标签值设置</p>
<!-- 所有标签的配置项 -->
......@@ -125,6 +125,7 @@ export default {
// 添加标签 弹框里面操作
addTag(list) {
this.dialogData = list;
this.tagData = list;
this.middleList = list;
if (list.tagId) {
this.optionFlag = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment