Commit 577f7049 by crushh

update: 删除原来组件

parent ec080448
......@@ -284,7 +284,6 @@ import birthSense from '@/views/ai/task/components/birthActiveTime.vue';
import holidaySense from '@/views/ai/task/components/holidayActiveTime.vue';
import LibMessage from '@/views/ecm/marketing-event/components/lib-message.vue';
import activeTime from '@/views/ai/task/components/activeTime.vue';
import tagPop from '@/views/ai/task/tagPop.vue';
import { formatDateTimeByType, _debounce } from '@/utils/index';
import ruleFilter from '@/components/dm-new-rule/ruleFilter.vue';
......@@ -488,8 +487,7 @@ export default {
holidaySense,
activeTime,
LibMessage,
ruleFilter,
tagPop
ruleFilter
},
methods: {
async getActivityDetail(activityId) {
......
<template>
<div class="flex">
<el-input v-model="item.tagItemName" placeholder="请输入标签值" class="w-380" maxlength="15" show-word-limit @change="onChange" />
<template>
<i v-if="currentLength < 50" class="iconfont plus icon margin icon-PlusOutlined" @click="add" />
<i v-else class="icon margin" />
</template>
<i v-if="currentLength > 1" class="iconfont delete icon icon-Delete" @click="del" />
</div>
</template>
<script>
export default {
name: 'TagValueItem',
props: {
item: Object,
currentLength: Number
},
data() {
return {
tagValue: ''
};
},
methods: {
add() {
this.$emit('add', this.item.id);
},
del() {
this.$emit('del', this.item.id);
}
}
};
</script>
<style scoped lang="scss">
@mixin flex($justify, $alignItems) {
display: flex;
justify-content: $justify;
align-items: $alignItems;
}
.flex {
@include flex(initial, center);
&:not(:last-of-type) {
margin-bottom: 20px;
}
}
.w-380 {
width: 380px;
}
.icon {
display: inline-block;
width: 24px;
height: 24px;
border-radius: 2px;
text-align: center;
line-height: 24px;
cursor: pointer;
}
.margin {
margin: 0 7px 0 16px;
}
.plus {
color: #2f54eb;
&:hover {
background: rgba(47, 84, 235, 0.1);
}
}
.delete {
color: #f5222d;
&:hover {
background: rgba(245, 34, 45, 0.1);
}
}
</style>
<template>
<div class="flex">
<el-input v-model="item.tagItemName" placeholder="请输入标签值" class="w-380" maxlength="15" show-word-limit @change="onChange" @paste.native="onPaste" />
<i class="iconfont plus icon margin icon-PlusOutlined" @click="add" />
<i v-if="currentLength > 1 && !item.tagItemId" class="iconfont delete icon icon-Delete" @click="del" />
</div>
</template>
<script>
export default {
name: 'TagValueItem',
props: {
item: Object,
currentLength: Number
},
data() {
return {
tagValue: ''
};
},
methods: {
onPaste(e) {
if (this.currentLength >= 100) {
return this.$message.warning('标签值最多支持设置100个');
}
this.$emit('paste', e);
setTimeout(() => {
this.item.tagItemName = '';
}, 10);
},
add() {
if (this.currentLength >= 100) {
return this.$message.warning('标签值最多支持设置100个');
}
this.$emit('add', this.item.id);
},
del() {
this.$emit('del', this.item.id);
}
}
};
</script>
<style scoped lang="scss">
@mixin flex($justify, $alignItems) {
display: flex;
justify-content: $justify;
align-items: $alignItems;
}
.flex {
@include flex(initial, center);
&:not(:last-of-type) {
margin-bottom: 20px;
}
}
.w-380 {
width: 380px;
}
.icon {
display: inline-block;
width: 24px;
height: 24px;
border-radius: 2px;
text-align: center;
line-height: 24px;
cursor: pointer;
}
.margin {
margin: 0 7px 0 16px;
}
.plus {
color: #2f54eb;
&:hover {
background: rgba(47, 84, 235, 0.1);
}
}
.delete {
color: #f5222d;
&:hover {
background: rgba(245, 34, 45, 0.1);
}
}
</style>
<template>
<div>
<el-dialog title="选择标签" :visible.sync="visiable" width="900px" :before-close="close">
<div class="container">
<el-tabs tab-position="left" @tab-click="onTabsClick" v-model="activeName">
<el-tab-pane :label="item.levelName" v-for="item in tabList" :key="item.id" :name="item.id" v-loading="tabPaneLoading">
<div class="rightContent">
<div class="searchWrap">
<div><el-input prefix-icon="el-icon-search" v-model="search" placeholder="请输入标签名称" @keyup.enter.native="getList" clearable @clear="getList"></el-input></div>
<div class="btn"><el-button size="small" type="primary" @click="showPopVisible = true">新增标签</el-button></div>
</div>
<div class="radioContainer" v-if="valueList.length">
<div v-for="item in valueList" :key="item.tagId" class="radioLine">
<div class="lineTitle">{{ item.tagName }}</div>
<el-radio v-for="value in item.itemList" :key="value.tagItemId" :label="value" v-model="selectVal" @change="val => handleChange(item.tagName, val)">{{ value.tagItemName }}</el-radio>
</div>
</div>
<div class="nonData" v-else>
暂无数据
</div>
<dm-pagination class="fr" layout="prev, pager, next" v-if="totalCount" :total="totalCount" :page-size="pageSize" :current-page.sync="currentPage" @current-change="getPageMemberTagDetail"> </dm-pagination>
</div>
</el-tab-pane>
</el-tabs>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="confirm">确定</el-button>
</div>
</el-dialog>
<manual-tag-edit :options="manualTagPop" :showPop.sync="showPopVisible" @save="addNewTag"></manual-tag-edit>
</div>
</template>
<script>
import ManualTagEdit from './manualTagEdit2';
export default {
data() {
return {
activeName: '',
search: '',
tabList: [],
valueList: [],
tabPaneLoading: false,
totalCount: 0,
currentPage: 1,
pageSize: 20,
showPopVisible: false,
manualTagPop: {
show: false,
popTitle: '',
tagId: '',
tagLevelGroupId: '',
tagTwoLevelGroupId: '',
isSync: false
},
selectVal: '',
selectedTag: ''
};
},
props: {
visiable: {
type: Boolean,
default: false
},
projectName: {
type: String,
default: 'marketing'
}
},
mounted() {
this.getPlatformHomePageV2();
},
components: {
ManualTagEdit
},
methods: {
handleChange(val, label) {
this.selectedTag = JSON.parse(JSON.stringify(label));
this.selectedTag.tagItemName = val + '-' + this.selectedTag.tagItemName;
},
confirm() {
if (!this.selectedTag) {
this.$message.waring('请选择标签');
return;
}
this.$emit('save', this.selectedTag);
this.close();
},
addNewTag() {
this.activeName = this.tabList[0].id;
this.currentPage = 1;
this.getPageMemberTagDetail();
},
getList() {
this.currentPage = 1;
this.getPageMemberTagDetail();
},
onTabsClick(val) {
const { name } = val;
console.log(name);
this.currentPage = 1;
this.getPageMemberTagDetail();
},
close() {
this.selectedTag = '';
this.$emit('update:visiable', false);
},
async getPageMemberTagDetail() {
const param = {
search: this.search,
tagLevelGroupId: this.activeName,
pageNum: this.currentPage,
pageSize: this.pageSize
};
this.axios.get(`/gic-member-tag-web/memberTag/pageMemberTagDetail?requestProject=${this.projectName}`, { params: param }).then(res => {
console.log(res);
const { result } = res.data;
if (result) {
this.totalCount = result.totalCount;
this.valueList = result.result;
console.log(this.valueList);
}
});
},
async getPlatformHomePageV2() {
this.axios.get(`/gic-member-tag-web/memberTag/platformHomePageByAI?requestProject=${this.projectName}&tagLevelType=2`).then(res => {
console.log(res);
const { result } = res.data;
if (result) {
this.tabList = [{ levelName: '所有活动标签', id: result[0].tagLevelGroupId }, ...result[0].children[0].children];
}
if (this.tabList.length) {
this.activeName = this.tabList[0].id;
this.getPageMemberTagDetail();
}
});
}
}
};
</script>
<style lang="scss" scoped>
.rightContent {
padding: 4px 0 0 16px;
box-sizing: border-box;
}
.searchWrap {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}
.container {
height: 521px;
border-radius: 4px;
border: 1px solid #dcdfe6;
padding: 11px 17px 0 0;
}
.radioContainer {
height: 430px;
overflow-y: auto;
.el-radio + .el-radio {
margin-left: 0;
}
}
.nonData {
height: 430px;
display: flex;
justify-content: center;
align-items: center;
}
.radioLine {
.lineTitle {
font-weight: bolder;
margin-bottom: 16px;
width: 100%;
color: #303030;
}
display: flex;
flex-wrap: wrap;
margin-bottom: 24px;
}
.fr {
float: right;
margin: 0;
}
</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