Commit 37a7df36 by 陈羽

update: update

parent 498b21cc
......@@ -139,7 +139,6 @@ export default {
enterpriseId: this.activeBrand
};
let list = [].concat(this.defaultTabList);
console.log(list);
getRequest('/haoban-app-customer-web/tag/open-tag', para)
.then(res => {
this.loading = true;
......@@ -188,7 +187,6 @@ export default {
* 返回 的 brandId
*/
selectBrandId(id, groupId) {
console.log(id);
let that = this;
that.activeBrand = id;
that.activeGroup = groupId;
......
......@@ -30,7 +30,8 @@
</div>
<div class="bottom">
<ul class="tag-category">
<li v-for="item in tagCategory" :key="item.id" :class="[item.id == tagCategoryId ? 'acitve' : '']" @click="onChangeCate(item.id)">{{ item.name }}</li>
<li :class="[-1 == tagCategoryId ? 'acitve' : '']" @click="onChangeCate(-1)">全部标签分组</li>
<li v-for="item in tagCategory" :key="item.id" :class="['indent-tag', item.id == tagCategoryId ? 'acitve' : '']" @click="onChangeCate(item.id)">{{ item.name }}</li>
</ul>
<div class="tag-content">
<div class="tag-content-top p-20">
......@@ -50,7 +51,7 @@
</div>
<div class="tag-content-bottom">
<el-table v-loading="loading" ref="table" :data="tableData" tooltip-effect="dark" row-key="tagId" style="width: 100%" @selection-change="handleSelectionChange" @row-click="rowCheckChange">
<el-table-column type="selection" width="55" :selectable="checkSelectable"></el-table-column>
<el-table-column type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
<el-table-column label="标签组" prop="tagName" show-overflow-tooltip>
<template slot-scope="{ row }">
<span>{{ row.tagName || '--' }}</span>
......@@ -171,6 +172,7 @@ export default {
isShake: false,
loading: false,
selectIds: {},
cancelIds: [],
canSync: true, // 查询是否有同步中队列 true可同步 flase不可以
totalCount: 4, // 总同步次数
canUseCount: 0, // 剩余同步次数
......@@ -191,7 +193,6 @@ export default {
},
checkSelectable(row) {
return !this.canSync ? false : this.canUseCount === 0 ? false : row.tagItems.length && row.syncFlag === 0 ? true : false;
2;
},
getTagCategoryList() {
tagCategoryList({ enterpriseId: this.brandId }).then(res => {
......@@ -219,6 +220,7 @@ export default {
res.data.result.result.map((el, index) => {
el.expend = false;
el.index = index;
el.check = false;
});
this.tableData = res.data.result.result;
this.loading = false;
......@@ -290,36 +292,46 @@ export default {
},
// 选中的row
handleSelectionChange(rows) {
this.isShake = true;
let list = [];
this.tagIds = [].concat(rows);
let selectIds = Object.assign({}, this.selectIds);
rows.forEach(row => {
if (this.selectIds[row.tagId] === undefined) {
this.selectIds[row.tagId] = row;
list.push(row);
if (selectIds[row.tagId] === undefined) {
selectIds[row.tagId] = row;
}
});
this.tagIds = this.tagIds.concat(list);
this.selectIds = Object.assign({}, selectIds);
this.isShake = true;
setTimeout(() => (this.isShake = false), 300);
},
rowCheckChange(row, column, event) {
if (this.canSync && row.syncFlag === 0) this.$refs.table.toggleRowSelection(row);
if (this.canSync && row.syncFlag === 0) {
this.$refs.table.toggleRowSelection(row);
row.check = !row.check;
}
},
cancelSelect(row) {
this.$refs.table.toggleRowSelection(this.tableData[row.index]);
delete this.selectIds[row.tagId];
if (this.tableData.find(el => el.tagId === row.tagId)) {
this.$nextTick(() => {
this.$refs.table.toggleRowSelection(this.tableData[this.selectIds[row.tagId].index], false);
});
} else {
this.cancelIds.push(row.tagId);
this.tagIds.splice(
this.tagIds.findIndex(item => item.tagId === row.tagId),
this.tagIds.findIndex(el => el.tagId === row.tagId),
1
);
}
},
chengePageToggleSelect() {
Object.keys(this.selectIds).forEach((key, index) => {
if (this.selectIds[key].tagId === this.tableData[this.selectIds[key].index].tagId) {
this.cancelIds.forEach((id, index) => {
const item = this.tableData.find(el => el.tagId === id);
if (item) {
this.$nextTick(() => {
this.$refs.table.toggleRowSelection(this.tableData[this.selectIds[key].index], true);
this.$refs.table.toggleRowSelection(this.tableData[item.index], false);
});
}
});
this.cancelIds = [];
},
checkSync() {
this.$confirm('<div>确认开启同步?</div><div>由于数据量可能过大以及企微限制,系统将于晚上统一执行同步过程,最早可于次日看到同步结果,请耐心等待。</div>', '', {
......@@ -414,6 +426,9 @@ li {
color: #909399;
line-height: 17px;
}
.indent-tag {
text-indent: 1em;
}
.member-tag {
box-sizing: border-box;
.top {
......
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