Commit 059b53ce by 无尘

fix: 修改各个排序

parent 11c8935a
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-09-01 11:09:16
* @LastEditors: 无尘
* @LastEditTime: 2020-09-08 12:19:47
* @LastEditTime: 2020-09-11 11:40:58
-->
<!--
<tag-classify-list :tag-list="tagList" :current-classify-id="currentClassifyId" :brand-id="brandId" @refreshClassify="refreshClassify" @resetCurrentId="resetCurrentId" @changeClass="changeClass"></tag-classify-list>
......@@ -15,7 +15,7 @@
<ul class="tag-classify-body">
<li :class="['tag-classify-item', { active: currentClassifyId == item.categoryId }]" v-for="(item, index) in tagList" :key="item.categoryId+index" @click="changeClassify(index, item)">
<span class="tag-classify-name">{{ item.categoryName || '--' }}</span>
<el-dropdown v-if="item.categoryId != ''" class="tag-classify-drop" placement="bottom-start">
<el-dropdown v-if="item.categoryId != '' || item.state != 0" class="tag-classify-drop" placement="bottom-start">
<i class="iconfont icongengduo edit-icon"></i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item styel="padding: 0 30px;" @click.native="toEditClassify(index, item)">编辑</el-dropdown-item>
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-28 16:51:22
* @LastEditors: 无尘
* @LastEditTime: 2020-09-11 09:22:14
* @LastEditTime: 2020-09-11 11:38:49
-->
<template>
......@@ -39,7 +39,7 @@
v-loading="loading"
ref="tagsData"
style="width: 100%">
<el-table-column v-if="currentClassify == ''" prop="" label="" width="56" class-name="move-row-cell">
<el-table-column v-if="currentClassify === '' && searchVal === ''" prop="" label="" width="56" class-name="move-row-cell">
<template>
<span class="font-22 iconfont icontuozhuaiopen color-c0c4cc" style="cursor: move;"></span>
</template>
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘
* @LastEditTime: 2020-09-11 09:21:21
* @LastEditTime: 2020-09-11 11:35:49
-->
<template>
......@@ -29,7 +29,7 @@
ref="memberCrowdData"
row-key="sceneCrowdId"
style="width: 100%">
<el-table-column prop="" label="" width="56" class-name="move-row-cell">
<el-table-column v-if="searchVal === '' && classifyId === ''" prop="" label="" width="56" class-name="move-row-cell">
<template>
<span class="font-22 iconfont icontuozhuaiopen color-c0c4cc" style="cursor: move;"></span>
</template>
......@@ -100,6 +100,7 @@ export default {
classifyId: '', // 选择分类
classifyList: [], // 分类列表
memberCrowdData: [], // 场景人群列表
memberCrowdDataCopy: [], // 场景人群列表 copy 本地搜索
totalNum: 0, // 获取的列表总数
loading: false, // 列表加载
showSync: false, // 同步弹窗显示
......@@ -181,6 +182,7 @@ export default {
},
/**
* @description: 同步
* @author: 无尘
*/
toSync() {
const that = this;
......@@ -191,6 +193,7 @@ export default {
* @description: 编辑可见范围
* @param {Number} index
* @param {Object} row
* @author: 无尘
*/
toEdit(index, row) {
const that = this;
......@@ -217,24 +220,65 @@ export default {
},
/**
* @description: 搜索输入
* @returns {Boolean}
* @author: 无尘
*/
toInput: _debounce(function() {
const that = this;
that.getGroupList();
if (that.searchVal === '' && that.classifyId === '') {
that.getGroupList();
return false;
}
that.memberCrowdData = that.memberCrowdDataCopy.filter(ele => {
if (that.classifyId === '') {
return ele.sceneCrowdName.indexOf(that.searchVal) != -1;
}
return ele.sceneCrowdName.indexOf(that.searchVal) != -1 && ele.sceneCrowdCategoryId == that.classifyId;
});
}, 500),
/**
* @description: 搜索清除
* @returns {Boolean}
* @author: 无尘
*/
clearInput() {
const that = this;
that.getGroupList();
if (that.searchVal === '' && that.classifyId === '') {
that.getGroupList();
return false;
}
if (that.classifyId != '') {
that.memberCrowdData = that.memberCrowdDataCopy.filter(ele => {
return ele.sceneCrowdCategoryId == that.classifyId;
});
};
},
/**
* @description: 条件
* @returns {Boolean}
* @author: 无尘
*/
changeCondition() {
const that = this;
that.getGroupList();
if (that.searchVal === '' && that.classifyId === '') {
that.getGroupList();
return false;
}
if (that.searchVal != '' && that.classifyId != '') {
that.memberCrowdData = that.memberCrowdDataCopy.filter(ele => {
return ele.sceneCrowdName.indexOf(that.searchVal) != -1 && ele.sceneCrowdCategoryId == that.classifyId;
});
}
if (that.searchVal != '' && that.classifyId === '') {
that.memberCrowdData = that.memberCrowdDataCopy.filter(ele => {
return ele.sceneCrowdName.indexOf(that.searchVal) != -1;
});
}
if (that.searchVal === '' && that.classifyId != '') {
that.memberCrowdData = that.memberCrowdDataCopy.filter(ele => {
return ele.sceneCrowdCategoryId == that.classifyId;
});
}
},
/**
* @description: 拖拽排序
......@@ -279,6 +323,7 @@ export default {
},
/**
* @description: 获取分类
* @author: 无尘
*/
getGroupClassify() {
const that = this;
......@@ -302,6 +347,7 @@ export default {
const that = this;
that.loading = true;
that.memberCrowdData = [];
that.memberCrowdDataCopy = [];
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
......@@ -313,8 +359,10 @@ export default {
that.loading = false;
if (!!res.result && !!res.result.length) {
that.memberCrowdData = that.sortTable(res.result);
that.memberCrowdDataCopy = JSON.parse(JSON.stringify(that.memberCrowdData));
}else {
that.memberCrowdData = [];
that.memberCrowdDataCopy = [];
that.totalNum = 0;
}
if (!that.searchVal && !that.classifyId && !!res.result && !!res.result.length) {
......
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