Commit 65f76a12 by caoyanzhi

Merge branch 'feature/7月迭代-会员'

parents 451cfaea 49e8f3ed
......@@ -21,7 +21,7 @@
(function() {
var src = '/component/static/import-component.js?timestrap='+ new Date().getTime();
var host = window.location.host;
host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'gicdev.demogic.com' : host;
host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'www.gicdev.com' : host;
document.write('<script src="//'+ host + src +'"><\/script>')
})()
</script>
......
......@@ -58,6 +58,8 @@ export default {
// 两次的uId不等 表示账号有冲突
if (this.uniqueId !== uId) {
this.$store.commit('changeUniqueId', uId);
// 切换账号后,不缓存权限数据、菜单数据、面包屑数据
window.notCache = true;
this.$confirm('当前登录账号已经发生变化,如果您在其他页面已经登录另一个账号,请重新登录!', '登录账号变更提示', {
confirmButtonText: '重新登录',
cancelButtonText: '刷新页面',
......
......@@ -69,6 +69,18 @@ export const getRequest = (url, params) => {
});
};
export const getRequestBlob = (url, params) => {
params.requestProject = 'member-tag';
return Vue.axios({
method: 'get',
url: `${local}/gic-member-tag-web${url}`,
data: {},
params: params,
responseType: 'blob',
headers: { 'content-type': 'application/x-www-form-urlencoded' } // "token": token
});
};
/*
*
* 统一 post 请求方法
......
......@@ -141,7 +141,7 @@ export default {
if (res.errorCode == 0) {
console.log(res.result)
const { result} = res.result;
this.groupList = result.filter(el => el.classifyName != '未分类').map(item => ({
this.groupList = result.filter(el => el.classifyName != '未分类' && el.classifyName != null).map(item => ({
...item,
edit: false
}));
......
......@@ -531,7 +531,7 @@ export default {
}
/* 固定/相对 年月日+最近+之后 年月日+最近 年月日时分秒-年月日时分秒 */
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData[0].radio == 1) {
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015' || code == 'tag050') && that.templateData[0].radio == 1) {
if (!that.templateData[0].dateRangeValue || !that.templateData[0].dateRangeValue.length) {
that.$message.error({ message: '请选择值' });
return false;
......@@ -542,7 +542,7 @@ export default {
}
}
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015')) {
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015' || code== 'tag050')) {
for (let k of this.templateData) {
if (!k.timeChecked && !k.timeAfterChecked && k.radio == 2) {
let tips = k.timeRadio == 1 ? '天' : k.timeRadio == 2 ? '月' : '年';
......@@ -564,7 +564,128 @@ export default {
}
}
}
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length === 1 && that.templateData[0].radio == 1) {
if (code == 'tag050' && that.templateData.length > 0) {
switch(Number(that.templateData[0].radio)) {
case 0:
tagValue.time[0].compute = 'all';
tagValue.time[0].value = '';
that.postTemplateData.selectedVal.push('所有时间');
break;
case 1:
tagValue.time[0].compute = 'between';
tagValue.time[0].value = that.templateData[0].dateRangeValue.join(',')
that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]);
break;
case 2:
// tagValue.time[0].compute = 'lastday';
// tagValue.time[0].value = that.templateData[0].dateRangeValue
// 天
// timeAfterChecked 最近/之后
// timeChecked 当天/年/月
if (that.templateData[0].timeRadio == 1) {
/** 同时选择
* lastdayHasToday 最近几天包含今天
* afterdayHasToday 之后几天包含今天
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastdayHasToday';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput}天包含当天`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//天 当天
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'today'
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当天');
that.templateData[0].timeInput = '';
}
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastday';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 天`);
}
}
}
// 月
if (that.templateData[0].timeRadio == 2) {
/**
* lastmonthHasCurrentMonth 最近几月包含当月
* aftermonthHasCurrentMonth 之后几月包含当月
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastmonthHasCurrentMonth';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 月包含当月`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//月 当月
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'currentMonth';
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当月');
that.templateData[0].timeInput = '';
}
// 最近/之后
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastmonth';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 月`);
}
}
}
// 年
if (that.templateData[0].timeRadio == 3) {
/**
* lastyearHasCurrentYear 最近几年包含当年
* afteryearHasCurrentYear 之后几年包含当年
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastyearHasCurrentYear';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 年包含当年`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//年 当年
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'currentYear';
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当年');
that.templateData[0].timeInput = '';
}
// 最近/之后
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastyear';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 年`);
}
}
}
break;
}
}
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length > 0 && that.templateData[0].radio == 1) {
if (that.currentComputeType == 2) {
tagValue.val[0].data.compute = 'between';
} else {
......@@ -590,7 +711,7 @@ export default {
that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]);
}
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length === 1 && that.templateData[0].radio == 2) {
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length > 0 && that.templateData[0].radio == 2) {
// 天
// timeAfterChecked 最近/之后
// timeChecked 当天/年/月
......@@ -1039,6 +1160,10 @@ export default {
that.postTemplateData.selectedVal.push(`时间范围为之后 ${ele.afterday} 天`);
}
}
if (ele.templateCode == 'tag040') {
tagValue.val[0].data.value = ele.radioType;
that.postTemplateData.selectedVal.push(ele.options.find(item => item.key == ele.radioType).value);
}
}
}
......@@ -1417,10 +1542,10 @@ export default {
newNum = 1;
}
// 天
if (code != 'tag020' && newNum > 365 && radio == 1) {
if (code != 'tag020' && code != 'tag050' && newNum > 365 && radio == 1) {
newNum = 365;
}
if (code == 'tag020' && newNum > 730 && radio == 1) {
if ((code == 'tag020' || code == 'tag050') && newNum > 730 && radio == 1) {
newNum = 730;
}
// 月
......
......@@ -598,6 +598,14 @@
</div>
</div>
</template>
<!-- 单选属性 关联渠道-->
<template v-if="parent.templateCode == 'tag040'">
</template>
<!-- 最近关联时间 -->
<template v-if="parent.templateCode == 'tag020'">
</template>
</div>
</div>
</div>
......
......@@ -205,11 +205,11 @@ const router = new Router({
})
router.beforeEach((to, from, next) => {
const { keepAlive, componentName, fromPath } = to.meta || {};
if (keepAlive && fromPath.every(el => el != '/')) {
if (keepAlive && Array.isArray(fromPath) && fromPath.every(el => el != '/')) {
fromPath.push('/');
}
// 当前路径的keepAlive为true而且from.path不在fromPath中时,将清除to.path的缓存
if (keepAlive && fromPath.every(el => el != from.path)) {
if (keepAlive && Array.isArray(fromPath) && fromPath.every(el => el != from.path)) {
delCache(router.apps, componentName);
}
next();
......
......@@ -12,6 +12,10 @@
<i class="iconfont icon-shangc" />
导入多标签值会员
</el-button>
<el-button type="primary" class="ghost-btn" @click="importTagValue" :limit-code="$buttonCode.importTagValueBtnCode" v-if="$getButtonLimit($buttonCode.importTagValueBtnCode)" >
<i class="iconfont icon-xiazai"/>
导出标签值
</el-button>
<el-button type="primary" class="ghost-btn" @click="exportMember">
<i class="iconfont icon-xiazai" />
导出人群
......@@ -90,7 +94,7 @@ import Trash from '@/components/Trash.vue';
import importDialog from './import-member-dialog.vue';
import DeleteTagDialog from './delete-tag-dialog.vue';
/* eslint-disable */
import { getRequest, postForm } from '@/api/api';
import { getRequest, postForm, getRequestBlob } from '@/api/api';
import Sortable from 'sortablejs';
/**
* 通过excel导入会员的业务逻辑 2019-5-27
......@@ -191,6 +195,31 @@ export default {
}
},
methods: {
// 导出标签值
importTagValue() {
// window.open(`http://www.gicdev.com/gic-member-tag-web/memberTag/exportMemberTag?requestProject=member-tag&tagId=${this.$route.query.tagId}&tagName=${this.$route.query.tagName}`);
// return
const paras = {
tagId: this.$route.query.tagId,
tagName: this.$route.query.tagName
}
getRequestBlob('/memberTag/exportMemberTag', paras).then(res=>{
if(res.status == '200') {
let blob = new Blob([res.data], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
});
// 3.创建一个临时的url指向blob对象
let objectUrl = window.URL.createObjectURL(blob);
// 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
let a = document.createElement("a");
a.setAttribute("href", objectUrl);
a.setAttribute("download", `${this.$route.query.tagName}-${new Date().toLocaleDateString()}`);
a.click();
// 5.释放这个临时的对象url
window.URL.revokeObjectURL(objectUrl);
}
})
},
// 添加和编辑标签值
addTagItem(tagItemId, tagItemName) {
......
<template>
<div class="group-list">
<div class="group-list" v-loading="memberGroupLoading">
<div class="search-box">
<el-input v-model="listsParams.classifyName" clearable prefix-icon="el-icon-search" placeholder="请输入分类名称" @change="onSearch"></el-input>
</div>
......@@ -15,17 +15,15 @@
<i slot="reference" class="iconfont icon-gengduo icon"></i>
</el-popover>
</li>
<li >
<!-- <li >
<div class="el-loading-spinner" style="width: 86%;" v-if="memberGroupLoading">
<!-- <svg viewBox="25 25 50 50" class="circular">
<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
</svg> -->
<i class="el-icon-loading"></i>
</div>
</li>
</li> -->
</ul>
<p v-if="searchTip" class="searchTip">没有找到和“{{ listsParams.classifyName }}”相关的内容</p>
<div v-if="$getButtonLimit($buttonCode.memberTagAddCateGory) && activeType == 1" class="add-category">
<el-button @click="editDialog.visible = true" :limit-code="$buttonCode.memberTagAddCateGory" type="primary" class="ghost-btn add-group">新增分类</el-button>
<el-button @click="editDialog.visible = true" :limit-code="$buttonCode.memberTagAddCateGory" type="primary" class="ghost-btn add-group" v-if="addType && lists.length">新增分类</el-button>
</div>
<!--编辑分类-->
<el-dialog :title="editDialog.list.memberTagGroupClassifyId ? '编辑分类' : '新增分类'" :visible.sync="editDialog.visible" width="600px" top="30vh" :close-on-click-modal="false" @close="closeEditGroup">
......@@ -51,6 +49,7 @@ export default {
},
data() {
return {
searchTip: false,
addGroupDialog: false,
listsParams: {
// type: '', // 类型 0:客户分组,1:固化分组
......@@ -67,8 +66,8 @@ export default {
classifyName: '',
list: {}
},
memberGroupLoading: false
memberGroupLoading: false,
addType: true
};
},
......@@ -214,6 +213,17 @@ export default {
this.memberGroupLoading = false;
if (res.errorCode == 0) {
const { result, totalPage } = res.result || {};
if (this.listsParams.classifyName == '') {
this.searchTip = false;
this.addType = true;
} else if (this.listsParams.classifyName != '') {
this.addType = false;
if (result.length <= 0) {
this.searchTip = true;
}else {
this.searchTip = false;
}
}
if (pageNum == 1) {
this.lists = [];
}
......@@ -245,7 +255,7 @@ export default {
} else if (newVal == 3) {
this.$emit('second-list', 'allLevel');
}
}
},
}
};
</script>
......@@ -271,10 +281,19 @@ export default {
justify-content: space-between;
align-items: center;
.icon {
display: inline-block;
width: 16px;
height: 16px;
padding: 1px;
border-radius: 2px;
margin: 0 4px;
}
&:hover {
color: #2F54EB;
background: #F2F3F5;
.icon:hover {
background: RGBA(229, 230, 235, 1);
}
}
.name-txt {
display: inline-block;
......@@ -290,23 +309,22 @@ export default {
overflow-y: auto;
.active-li {
color: #2F54EB;
background-color: #EBEFFE;
.icon {
color: #2f54eb;
background-color: #ebeffe;
.wrap span{
padding-left: 6px;
color: #2f54eb;
}
.icon:hover {
background: #d8defc;
}
}
.wrap span{
padding-left: 6px;
color: #303133;
}
li:hover {
background-color: #EBEFFE;
.icon {
color: #2f54eb;
}
}
}
.more {
line-height: 26px;
text-align: center;
......@@ -315,4 +333,11 @@ export default {
color: #2f54eb;
}
}
.searchTip {
width: 100%;
text-align: center;
margin-top: 80%;
color: #909399;
font-size: 14px;
}
</style>
......@@ -660,6 +660,7 @@ export default {
// 获取一个标签分类下面的标签数据
getTagsGroupList() {
const tagType = this.activeTag == 'system' ? 0 : this.activeTag == 'manual' ? 1 : 2;
console.log(this.searchData, 'this.searchData');
const params = {
requestProject: 'gic-member-tag-web',
search: this.searchData || null, // 模糊查询的标签名
......
......@@ -1072,6 +1072,7 @@ export default {
return false;
} else {
this.operateNumber = val;
console.log(val, 'val');
this.batchVisiable = true;
}
},
......
......@@ -43,7 +43,7 @@
style="width: 260px;float: left;margin-left: 0"
v-model="memberTag"
@keyup.native.enter="searchMemberList"
@blur="searchMemberList"
@change="searchMemberList"
@clear="allTagList"
clearable
></el-input>
......@@ -609,7 +609,7 @@ export default {
try {
const params = {
requestProject: 'gic-member-tag-web',
search: opt.searchName || null, // 标签名
search: opt.searchName || null || this.memberTag, // 标签名
tagLevelGroupId: opt.id || '', // 标签层级
tagType, // 标签类型
showMemberCount: 1, // 覆盖人数
......@@ -667,8 +667,8 @@ export default {
},
// 模糊查询会员标签
searchMemberList() {
console.log(this.activeTag);
searchMemberList(e) {
// console.log(this.activeTag);
if (this.memberTag) {
this.tagName = this.memberTag;
} else {
......@@ -677,7 +677,8 @@ export default {
// this.handTag = null;
this.loadMemberTagList({
searchName: this.memberTag,
showSearchResult: true
showSearchResult: true,
id: this.groupId
});
this.pageNum = 1;
// this.handTag = null;
......
......@@ -131,7 +131,7 @@ export default {
localStorage.setItem('jumpThirdTag', '');
this.$router.push({
path: '/manualTagValueEdit',
query: { tagId: list.tagId, type: 'manual' }
query: { tagId: list.tagId,tagName: list.tagName, type: 'manual' }
});
},
deleteHandTag(list, index, e) {
......
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