Commit add172a2 by member

新增会员分组

parent dcfa7ca9
......@@ -55,17 +55,11 @@
<el-collapseTransition>
<div class="wapper">
<div class="inner">
<tags-group-list
class="marginwapper"
:selectedTagsData="selectedTags"
:tagsGroupRelation="tagsGroupRelation"
@addTags="addTags"
@editTags="editTags"
:activeTagsGroupIndex.sync="activeTagsGroupIndex"
/>
<tags-group-list :selectedTagsData="selectedTags" :tagsGroupRelation="tagsGroupRelation" @addTags="addTags" @editTags="editTags" :activeTagsGroupIndex.sync="activeTagsGroupIndex" />
<div class="form-item">
<label for="">分组名称</label>
<el-input v-model="tagConfig.groupName" :maxlength="10"></el-input>
<el-input v-model="tagConfig.groupName" :maxlength="10" style="width: 200px;"></el-input>
<span class="groupName-txt">{{ tagConfig.groupName.length }}/10</span>
</div>
<div class="form-item">
<label for="">分组有效期</label>
......@@ -73,9 +67,19 @@
</div>
<div class="form-item">
<label for="">分组描述</label>
<el-input type="textarea" v-model="tagConfig.textarea" :maxlength="200"></el-input>
<el-input type="textarea" v-model="tagConfig.textarea" :maxlength="200" style="width: 400px;"></el-input>
<span class="textarea-txt">{{ tagConfig.textarea.length }}/200</span>
</div>
<p>更新频率(更新时间预计选择日期的凌晨0点至6点)</p>
<div class="form-item">
<label for="">更新频率</label>
<el-select class="w-200" v-model="tagConfig.updateType" placeholder="请选择">
<el-option v-for="(item, index) in rateData" :key="item.label" :label="item.label" :value="index + 1"></el-option>
</el-select>
<el-select class="w-200 p-l-8" v-model="tagConfig.updateDay" v-show="tagConfig.updateType != 1" placeholder="请选择">
<el-option v-for="(item, index) in rateData[tagConfig.updateType ? tagConfig.updateType - 1 : 0].options" :key="item" :label="item" :value="index + 1"></el-option>
</el-select>
</div>
<p class="refresh-txt">更新频率(更新时间预计选择日期的凌晨0点至6点)</p>
</div>
<div class="fixed-btn">
<el-button type="primary" @click="createNewGroup">创建会员分组</el-button>
......@@ -114,8 +118,12 @@ export default {
return {
tagConfig: {
groupName: '',
textarea: '',
date: ''
textarea: '', // 描述
date: '', // 有效期
updateType: '', // 更新类型频率
updateDay: '', // 更新类型时间
isRealTime: 0, // 实时
effectiveStatus: 1 // 有效状态nage
},
activeTagsGroupIndex: 0,
groupShow: false,
......@@ -145,7 +153,52 @@ export default {
pageSize: 20,
pageNum: 1,
currentPage: 1,
total: 0
total: 0,
// 更新频率
rateData: [
{
label: '每日一次',
options: []
},
{
label: '每周一次',
options: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
{
label: '每月一次',
options: [
'1号',
'2号',
'3号',
'4号',
'5号',
'6号',
'7号',
'8号',
'9号',
'10号',
'11号',
'12号',
'13号',
'14号',
'15号',
'16号',
'17号',
'18号',
'19号',
'20号',
'21号',
'22号',
'23号',
'24号',
'25号',
'26号',
'27号',
'28号'
]
}
]
};
},
......@@ -158,19 +211,29 @@ export default {
},
methods: {
checkRealTime() {
let arr = this.selectedTags.reduce((curr, el) => {
return curr.concat(el);
}, []);
let newActiveArr = arr.map(el => el.isActive);
console.log(newActiveArr);
this.tagConfig.isRealTime = newActiveArr.indexOf(0) > -1 ? 0 : 1;
},
createNewGroup() {
//
this.checkRealTime();
const param = {
groupName: this.tagConfig.groupName,
isRealTime: 0,
isRealTime: this.tagConfig.isRealTime,
describle: this.tagConfig.describle,
updateType: '',
updateDay: '',
effectiveStatus: '',
updateType: this.tagConfig.updateType,
updateDay: this.tagConfig.updateDay,
// effectiveStatus: '',
requestProject: 'gic-member-tag-web',
json: JSON.stringify(this.selectedTags),
effectiveDateTmp: this.tagConfig.date
};
console.log(param);
addNewGroup(param)
.then(res => {
if (res.errorCode == 1) {
......@@ -481,6 +544,7 @@ export default {
box-shadow: 0 0 5px #bbb;
background-color: #fff;
z-index: 10;
transition: all 0.3s ease-in-out;
.form-item {
margin-top: 20px;
margin-bottom: 20px;
......@@ -504,5 +568,16 @@ export default {
text-align: center;
}
}
.groupName-txt {
position: relative;
color: #909399;
top: 2px;
left: -45px;
}
.textarea-txt {
position: relative;
color: #909399;
left: -70px;
}
}
</style>
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