Commit 589e1baf by member

Merge branch 'dev-dingdang' into dev

parents 6f2a4083 fa82e7bb
......@@ -14,6 +14,7 @@ import '../theme/index.css';
import '../static/css/index.less';
import '../static/font/iconfont.css';
import vueGicDatepicker from '@gic-test/vue-gic-datepicker';
// test submit
/* import vueGicHeader from '@gic-test/vue-gic-header';
import vueGicAsideMenu from '@gic-test/vue-gic-aside-menu';
......@@ -89,4 +90,4 @@ new Vue({
template: '<App/>'
});
console.log(Vue.config);
\ No newline at end of file
console.log(Vue.config);
......@@ -8,6 +8,7 @@
:tagsGroupIndex="index"
:tagsRelation="tagsGroupRelation[index]"
:showAddMenu="showAddMenu"
:show-del-menu="selectedTagsData.length > 1"
:active="activeTagsGroupIndex === index"
@addTags="addTags"
@delTags="delTags"
......@@ -17,7 +18,7 @@
@checkTagsGroup="checkTagsGroup"
@dragTag="dragTag"
/>
<el-button class="m-t-10 w-384 el-icon-plus color-blue add-group-btn" v-show="selectedTagsData.length < 3" @click="addTagsGroup">
<el-button class="m-t-10 w-427 el-icon-plus color-blue add-group-btn" v-show="selectedTagsData.length < 3" @click="addTagsGroup">
&nbsp;&nbsp;添加
</el-button>
</div>
......
<template>
<div class="w-384 border-box">
<div class="w-427 border-box">
<div :class="['tags-group', { 'tags-group--active': active }]" @click="checkTagsGroup">
<!--右上角的下拉菜单-->
<el-dropdown class="tags-group__dropdown" placement="bottom-end">
<el-dropdown class="tags-group__dropdown" placement="bottom-end" v-if="showAddMenu || showDelMenu">
<el-popover width="200" placement="top" v-model="showDelPop" trigger="manual">
<p class="m-b-20">确认删除输入框及内部所有标签?</p>
<div class="text-right">
......@@ -13,7 +13,7 @@
</el-popover>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="showAddMenu" @click.native="addTags">添加标签</el-dropdown-item>
<el-dropdown-item @click.native="showDelPop = true">删除</el-dropdown-item>
<el-dropdown-item v-if="showDelMenu" @click.native="showDelPop = true">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!--展示选中的标签-->
......@@ -75,6 +75,8 @@ export default {
tagsGroupIndex: Number,
// 下拉菜单是否显示"添加标签"菜单项
showAddMenu: Boolean,
// 下拉菜单是否显示"删除"菜单项
showDelMenu: Boolean,
// 标签组是否选中
active: Boolean
},
......@@ -175,11 +177,13 @@ export default {
}
.tags-group__tag {
position: relative;
display: inline-block;
vertical-align: top;
padding: 6px 10px;
padding: 6px 40px 6px 10px;
margin-right: 8px;
margin-bottom: 8px;
max-width: 100%;
background: #f3f6f9;
border-radius: 2px;
font-size: 14px;
......@@ -209,13 +213,23 @@ export default {
}
i {
position: absolute;
top: 0;
z-index: 1;
display: flex;
align-items: center;
padding: 0 2px;
height: 100%;
color: #999;
cursor: pointer;
padding-left: 10px;
}
i.edit {
right: 18px;
color: #c0c4cc;
}
i.el-icon-error {
right: 0;
}
.tags-group__tag-name {
max-width: 180px;
......
......@@ -80,16 +80,21 @@
/>
<div class="form-item" :class="{ 'margin-60': marginSixty }">
<label for="">分组名称</label>
<el-input v-model="tagConfig.groupName" :maxlength="10" style="width: 200px;" placeholder="请输入内容"></el-input>
<el-input v-model="tagConfig.groupName" :maxlength="10" class="w-220" placeholder="请输入内容"></el-input>
<span class="groupName-txt">{{ tagConfig.groupName.length }}/10</span>
</div>
<div class="form-item" :class="{ 'margin-60': marginSixty }">
<label for="">分组有效期</label>
<el-date-picker v-model="tagConfig.date" :picker-options="pickerOptions" type="date" placeholder="选择日期"> </el-date-picker>
<label for="">
分组有效期
<el-tooltip content="分组有效期需早于所用标签的最早有效期,且最长不超过365天">
<i class="form-tip-icon">i</i>
</el-tooltip>
</label>
<el-date-picker class="w-220" v-model="tagConfig.date" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss" type="date" placeholder="选择日期"> </el-date-picker>
</div>
<div class="form-item" :class="{ 'margin-60': marginSixty }">
<label for="">分组描述</label>
<el-input type="textarea" v-model="tagConfig.textarea" :maxlength="200" style="width: 300px;" placeholder="请输入内容"></el-input>
<el-input type="textarea" v-model="tagConfig.textarea" :maxlength="200" class="w-427" placeholder="请输入内容"></el-input>
<span class="textarea-txt">{{ tagConfig.textarea.length }}/200</span>
</div>
<div class="form-item" v-show="tagConfig.isRealTime == 0" :class="{ 'margin-60': marginSixty }">
......@@ -158,7 +163,10 @@ export default {
tagsGroupRelation: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
let curDate = new Date().getTime();
let oneYear = 365 * 24 * 3600 * 1000;
let y = curDate + oneYear;
return time.getTime() < Date.now() - 8.64e7 || time.getTime() > y;
}
},
// 面包屑参数
......@@ -254,6 +262,14 @@ export default {
},
methods: {
// 设置默认的分组有效期
defaultDate() {
let date = new Date(new Date().getTime() + 365 * 24 * 3600 * 1000);
let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
this.tagConfig.date = Y + M + D + '23:59:59';
},
// 收起右边的
collapseRightList(eve) {
console.log(eve.target.className);
......@@ -297,7 +313,7 @@ export default {
effectiveStatus: 1,
requestProject: 'gic-member-tag-web',
json: JSON.stringify(this.selectedTags),
effectiveDateTmp: this.tagConfig.date
effectiveDateTmp: `${this.tagConfig.date.split(' ')[0]} 23:59:59`
};
// 必填项目
if (param.groupName == '') {
......@@ -586,6 +602,7 @@ export default {
this.handTag = list.handTag;
this.changeTagTitle(list.name);
});
this.defaultDate();
}
};
</script>
......@@ -714,10 +731,24 @@ export default {
margin-bottom: 20px;
color: #606266;
label {
display: block;
display: flex;
margin-bottom: 10px;
align-items: center;
font-size: 14px;
}
.form-tip-icon {
margin-left: 5px;
display: flex;
justify-content: center;
align-items: center;
width: 14px;
height: 14px;
font-size: 12px;
color: #909399;
border: 1px solid #909399;
border-radius: 14px;
cursor: pointer;
}
}
.refresh-txt {
color: #606266;
......
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