Commit 37a7df36 by 陈羽

update: update

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