Commit fa27a2a0 by chenyu

Merge branch 'feature/9月迭代' of http://git.gicdev.com/memberTag/memberTag-web into feature/9月迭代

parents 91357446 c812ab43
......@@ -29,7 +29,7 @@
<script src="//web-1251519181.file.myqcloud.com/components/area-ab.2.0.00.js"></script>
<!-- <script src="//web-1251519181.file.myqcloud.com/components/card.2.0.18.js"></script> --><!-- 卡券选择器其实并没有用到 -->
<script src="//web-1251519181.file.myqcloud.com/components/selector.1.2.27.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/export-excel.2.0.20.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/export-excel.2.0.21.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js"></script>
</body>
</html>
......@@ -328,3 +328,27 @@ export const isAutomaticSync = (params = {}) =>
...params
}
});
// 手工标签同步标签
export const getSyncTag = (params = {}) =>
request({
url: '/tagLevel/findGroupLevelPage',
method: 'get',
params: {
requestProject: 'gic-member-tag-web',
...params
}
// data: qs.stringify(params)
})
// 手工标签更新同步标签
export const updateSyncTag = (params = {}) =>
request({
url: '/tagLevel/updateSyncWmFlag',
method: 'get',
params: {
requestProject: 'gic-member-tag-web',
...params
}
// data: qs.stringify(params)
})
<template>
<div class="common-wrap syncTag">
<nav-crumb :navpath="navpath"></nav-crumb>
<div class="right-content">
<div class="right-content" v-loading="loading">
<div class="right-box">
<div class="title">
<el-input class="w220" v-model="searchVal" placeholder="请输入标签分类名称" prefix-icon="el-icon-search" />
<el-input class="w220" @change="onSearch" v-model="searchVal" placeholder="请输入标签分类名称" prefix-icon="el-icon-search" />
<el-button type="primary" class="add-btn" @click="dialogData.dialogVisible = true">添加标签分类</el-button>
<span>添加标签分类后,分类下面所有会员标签均会同步至微盟</span>
</div>
<div class="sync-content">
<el-table :data="tableData">
<el-table-column label="标签分类" prop=""></el-table-column>
<el-table-column label="标签分组" prop=""></el-table-column>
<el-table-column label="添加时间" prop=""></el-table-column>
<el-table-column label="标签分类" prop="levelName"></el-table-column>
<el-table-column label="标签分组" prop="">
<template slot-scope="{ row }"> {{ row.parentLevelGroupId ? groupName(row.parentLevelGroupId) : "--" }} </template>
</el-table-column>
<el-table-column label="添加时间" prop="createTime">
<template slot-scope="{ row }">{{ row.createTime ? dateformat(new Date(row.createTime), 'yyyy-MM-dd hh:mm:ss') : '--' }}</template>
</el-table-column>
<el-table-column label="操作">
<template><el-button type="text" @click="cancelSync">取消同步</el-button></template>
<template slot-scope="{ row }"><el-button type="text" @click="cancelSync(row)">取消同步</el-button></template>
</el-table-column>
</el-table>
<el-pagination
style="text-align: right;padding: 28px 0"
background
hide-on-single-page
@size-change="onSizeChange"
@current-change="onCurrentChange"
......@@ -35,14 +40,18 @@
<template slot="title">
<p class="el-dialog__title">添加分类标签<span class="tip">仅查询未同步的标签</span></p>
</template>
<div class="dialog_contetn">
<el-input class="w220 mb20" prefix-icon="el-icon-search" v-model="dialogData.searchTagVal" placeholder="请输入标签分类名称"></el-input>
<div class="dialog_contetn" v-loading="dialogData.loading">
<el-input class="w220 mb20" prefix-icon="el-icon-search" @change="onDialogSearch" v-model="dialogData.searchTagVal" placeholder="请输入标签分类名称" />
<el-table :data="dialogData.tagTableData">
<el-table-column label="序号" prop=""></el-table-column>
<el-table-column label="标签分类" prop=""></el-table-column>
<el-table-column label="标签分组" prop=""></el-table-column>
<el-table-column label="序号" prop="index"></el-table-column>
<el-table-column label="标签分类" prop="levelName"></el-table-column>
<el-table-column label="标签分组" prop="">
<template slot-scope="{ row }"> {{ row.parentLevelGroupId ? groupName(row.parentLevelGroupId) : "--" }} </template>
</el-table-column>
<el-table-column label="操作">
<el-button type="text">添加</el-button>
<template slot-scope="{ row }">
<el-button type="text" @click="addSyncTag(row)">添加</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
......@@ -65,6 +74,7 @@
<script>
import navCrumb from '@/components/nav/nav.vue';
import { dateformat } from '@/utils/formatTime';
import { getSyncTag, updateSyncTag } from '@/request/api';
export default {
name: 'syncTagHistory',
data() {
......@@ -94,6 +104,7 @@ export default {
pageSize: 20,
total: 0,
searchVal: '',
loading: false,
dateformat,
// -----------------dialogData---------------------
dialogData: {
......@@ -101,27 +112,52 @@ export default {
tagTableData: [],
total: 0,
currentPage: 1,
searchTagVal: ''
searchTagVal: '',
loading: false
}
};
},
components: {
navCrumb
},
mounted() {
this.getTableData();
},
methods: {
// ----------------------Page-----------------------
cancelSync() {
cancelSync(row) {
this.$confirm('取消同步后,该分类下的标签将不会再同步至微盟,并且该分类下已同步至微盟侧的会员标签将同步从微盟侧删除,是否继续取消?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(_ => {
this.$message.success('取消成功');
const para = {
tagLevelGroupId: row.tagLevelGroupId,
syncWmFlag: 0
};
updateSyncTag(para).then(res => {
this.$message.success('取消同步成功');
if(this.tableData.length == 1) {
this.currentPage = this.currentPage - 1 || 1;
};
this.getTableData();
})
}).catch(_ => {});
},
getTableData() {
console.log('111');
this.loading = true;
const para = {
search: this.searchVal,
syncWmFlag: 1,
pageNum: this.currentPage,
pageSize: this.pageSize
};
getSyncTag(para).then(res => {
const resData = res.result;
this.tableData = resData.result || [];
this.total = resData.totalCount;
}).finally(() => this.loading = false);
},
onCurrentChange(val) {
this.currentPage = val;
......@@ -132,21 +168,68 @@ export default {
this.currentPage = 1;
this.getTableData();
},
onSearch() {
this.currentPage = 1;
this.getTableData();
},
// ----------------------dialog---------------------
// 获取dialog表格数据
getDiaglogTableData() {
// this.dialogData
this.dialogData.loading = true;
const para = {
search: this.dialogData.searchTagVal,
syncWmFlag: 0,
pageSize: 5,
pageNum: this.dialogData.currentPage
};
getSyncTag(para).then(res => {
const resData = res.result;
const listData = resData.result || [];
this.dialogData.tagTableData = listData.map((el, index) => {
el.index = this.sortIndex(index + 1);
return el;
});
this.dialogData.total = resData.totalCount;
}).finally(() => this.dialogData.loading = false);
},
onDialogPageChange(val) {
this.currentPage = val;
this.dialogData.currentPage = val;
this.getDiaglogTableData();
},
addSyncTag(row) {
const para = {
tagLevelGroupId: row.tagLevelGroupId,
syncWmFlag: 1
};
updateSyncTag(para).then(res => {
this.$message.success('同步成功');
if(this.dialogData.tagTableData.length == 1) {
this.dialogData.currentPage = this.dialogData.currentPage - 1 || 1;
};
this.getDiaglogTableData();
})
},
onDialogSearch() {
this.dialogData.currentPage = 1;
this.getDiaglogTableData();
}
},
computed: {
sortIndex() {
return index => ((this.dialogData.currentPage - 1) * 5 + index);
},
groupName() {
return id => (id == "3d11ac15963b4c0790762e6147ea9312" ? '导购标签' : id == "a3a4ed179ed3435fab33f5952d021b6d" ? "其他" : "--");
}
},
watch: {
'dialogData.dialogVisible' (newVal) {
if(newVal) {
this.dialogData.searchTagVal = '';
this.getDiaglogData();
this.dialogData.currentPage = 1;
this.getDiaglogTableData();
} else {
this.getTableData();
}
}
}
......
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