Commit ffaeb011 by member

配置项

parent d6c9433e
...@@ -13,14 +13,12 @@ const portfinder = require('portfinder') ...@@ -13,14 +13,12 @@ const portfinder = require('portfinder')
const HOST = process.env.HOST const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT) const PORT = process.env.PORT && Number(process.env.PORT)
console.log(config.dev.devtool);
const devWebpackConfig = merge(baseWebpackConfig, { const devWebpackConfig = merge(baseWebpackConfig, {
module: { module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
}, },
// cheap-module-eval-source-map is faster for development // cheap-module-eval-source-map is faster for development
// devtool: config.dev.devtool, devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js // these devServer options should be customized in /config/index.js
devServer: { devServer: {
...@@ -48,9 +46,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { ...@@ -48,9 +46,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
}, },
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': require('../config/dev.env')
NODE_ENV: '"development"'
}
}), }),
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"element-ui": "^2.3.9", "element-ui": "^2.3.9",
"file-saver": "^1.3.8", "file-saver": "^1.3.8",
"tinymce": "^4.8.3", "tinymce": "^4.8.3",
"vant": "^1.6.13",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-clipboard2": "^0.2.0", "vue-clipboard2": "^0.2.0",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
......
<template>
<div class="birth-select">
<div class="start-date date-block">
<el-select v-model="startVal[0]" style="width: 100px" placeholder="月份" @change="handleStartMonthChange">
<el-option v-for="item in MonthList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
<span class="space"></span>
<el-select v-model="startVal[1]" style="width: 100px" placeholder="日期" @change="handleStartDateChange">
<el-option v-for="item in startDateList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
</div>
<span class="range"></span>
<div class="end-date date-block">
<el-select v-model="endVal[0]" style="width: 100px" placeholder="月份" @change="handleEndMonthChange">
<el-option v-for="item in MonthList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
<span class="space"></span>
<el-select v-model="endVal[1]" style="width: 100px" placeholder="日期" @change="handleEndDateChange">
<el-option v-for="item in endDateList" :value="item.value" :key="item.key" :label="item.label"> </el-option>
</el-select>
</div>
</div>
</template>
<script>
export default {
name: 'GicSelect',
props: {
dateval: [String, Array]
},
data() {
return {
startVal: ['', ''],
endVal: ['', ''],
// 月份
MonthList: [
{ key: 1, value: '01', label: '1月' },
{ key: 2, value: '02', label: '2月' },
{ key: 3, value: '03', label: '3月' },
{ key: 4, value: '04', label: '4月' },
{ key: 5, value: '05', label: '5月' },
{ key: 6, value: '06', label: '6月' },
{ key: 7, value: '07', label: '7月' },
{ key: 8, value: '08', label: '8月' },
{ key: 9, value: '09', label: '9月' },
{ key: 10, value: '10', label: '10月' },
{ key: 11, value: '11', label: '11月' },
{ key: 12, value: '12', label: '12月' }
],
// 日期
daysList: [['01', '03', '05', '07', '08', '10', '12'], ['02'], ['04', '06', '09', '11']],
startDateList: [
{ key: 1, value: '01', label: '1日' },
{ key: 2, value: '02', label: '2日' },
{ key: 3, value: '03', label: '3日' },
{ key: 4, value: '04', label: '4日' },
{ key: 5, value: '05', label: '5日' },
{ key: 6, value: '06', label: '6日' },
{ key: 7, value: '07', label: '7日' },
{ key: 8, value: '08', label: '8日' },
{ key: 9, value: '09', label: '9日' },
{ key: 10, value: '10', label: '10日' },
{ key: 11, value: '11', label: '11日' },
{ key: 12, value: '12', label: '12日' },
{ key: 13, value: '13', label: '13日' },
{ key: 14, value: '14', label: '14日' },
{ key: 15, value: '15', label: '15日' },
{ key: 16, value: '16', label: '16日' },
{ key: 17, value: '17', label: '17日' },
{ key: 18, value: '18', label: '18日' },
{ key: 19, value: '19', label: '19日' },
{ key: 20, value: '20', label: '20日' },
{ key: 21, value: '21', label: '21日' },
{ key: 22, value: '22', label: '22日' },
{ key: 23, value: '23', label: '23日' },
{ key: 24, value: '24', label: '24日' },
{ key: 25, value: '25', label: '25日' },
{ key: 26, value: '26', label: '26日' },
{ key: 27, value: '27', label: '27日' },
{ key: 28, value: '28', label: '28日' },
{ key: 29, value: '29', label: '29日' },
{ key: 30, value: '30', label: '30日' },
{ key: 31, value: '31', label: '31日' }
],
endDateList: [
{ key: 1, value: '01', label: '1日' },
{ key: 2, value: '02', label: '2日' },
{ key: 3, value: '03', label: '3日' },
{ key: 4, value: '04', label: '4日' },
{ key: 5, value: '05', label: '5日' },
{ key: 6, value: '06', label: '6日' },
{ key: 7, value: '07', label: '7日' },
{ key: 8, value: '08', label: '8日' },
{ key: 9, value: '09', label: '9日' },
{ key: 10, value: '10', label: '10日' },
{ key: 11, value: '11', label: '11日' },
{ key: 12, value: '12', label: '12日' },
{ key: 13, value: '13', label: '13日' },
{ key: 14, value: '14', label: '14日' },
{ key: 15, value: '15', label: '15日' },
{ key: 16, value: '16', label: '16日' },
{ key: 17, value: '17', label: '17日' },
{ key: 18, value: '18', label: '18日' },
{ key: 19, value: '19', label: '19日' },
{ key: 20, value: '20', label: '20日' },
{ key: 21, value: '21', label: '21日' },
{ key: 22, value: '22', label: '22日' },
{ key: 23, value: '23', label: '23日' },
{ key: 24, value: '24', label: '24日' },
{ key: 25, value: '25', label: '25日' },
{ key: 26, value: '26', label: '26日' },
{ key: 27, value: '27', label: '27日' },
{ key: 28, value: '28', label: '28日' },
{ key: 29, value: '29', label: '29日' },
{ key: 30, value: '30', label: '30日' },
{ key: 31, value: '31', label: '31日' }
]
};
},
methods: {
//
handleMonthValue(position, val) {
const WM = this.daysList.findIndex((item, i) => {
return item.includes(val);
});
if (position == 'start') {
this.handleChangeData(this.startDateList, WM);
} else if (position == 'end') {
this.handleChangeData(this.endDateList, WM);
}
},
handleChangeData(data, inx) {
const length = data.length; // 31 29 30
if (inx == 0) {
// 31天
this.handleLength(length, data, 0);
} else if (inx == 2) {
// 如果升级 30天
this.handleLength(length, data, 1);
} else {
// 29天
this.handleLength(length, data, 2);
}
},
handleLength(length, data, days) {
if (length == 31) {
if (days == 0) {
return;
} else if (days == 1) {
data.pop();
} else if (days == 2) {
data.splice(29, 2);
}
} else if (length == 30) {
if (days == 0) {
data.push({ key: 31, value: '31', label: '31日' });
} else if (days == 1) {
return;
} else if (days == 2) {
data.splice(29, 1);
}
} else if (length == 29) {
if (days == 0) {
data.push({ key: 30, value: '30', label: '30日' });
data.push({ key: 31, value: '31', label: '31日' });
} else if (days == 1) {
data.push({ key: 30, value: '30', label: '30日' });
} else if (days == 2) {
return;
}
}
},
// 开始月份
handleStartMonthChange(val) {
this.handleMonthValue('start', val);
this.handleDate();
this.$emit('change');
},
handleStartDateChange(val) {
this.handleDate();
this.$emit('change');
},
handleEndMonthChange(val) {
this.handleMonthValue('end', val);
this.handleDate();
this.$emit('change');
},
handleEndDateChange(val) {
this.handleDate();
this.$emit('change');
},
handleDate() {
if (!this.startVal[0] || !this.startVal[0] || !this.endVal[0] || !this.endVal[1]) {
return;
}
const start = this.startVal.join('');
const end = this.endVal.join('');
if (start - end > 0) {
this.$message.warning('开始生日日期不能大于结束日期');
this.$emit('update:dateval', '');
return;
}
const value = [start, end];
this.$emit('update:dateval', value);
},
// 回显数据
replay(start, end) {
this.startVal[0] = start.slice(0, 2);
this.startVal[1] = start.slice(2, 4);
this.endVal[0] = end.slice(0, 2);
this.endVal[1] = end.slice(2, 4);
}
},
created() {
if (this.dateval[0] && this.dateval[1]) {
this.replay(this.dateval[0], this.dateval[1]);
}
}
};
</script>
<style lang="scss" scoped>
.birth-select {
.date-block {
display: inline-block;
.space {
display: inline-block;
width: 10px;
}
}
.range {
display: inline-block;
vertical-align: middle;
width: 30px;
height: 32px;
line-height: 32px;
font-size: 12px;
text-align: center;
}
}
</style>
...@@ -31,7 +31,8 @@ Vue.use(vueGicAsideMenu); ...@@ -31,7 +31,8 @@ Vue.use(vueGicAsideMenu);
Vue.use(vueGicHeader); */ Vue.use(vueGicHeader); */
// Vue.use(vueGicDatepicker); // Vue.use(vueGicDatepicker);
Vue.config.productionTip = false; Vue.config.devtools = true;
// Vue.config.productionTip = true;
// Vue.use(ElementUI, { size: 'large' }); // Vue.use(ElementUI, { size: 'large' });
Vue.use(VueAxios, axios); Vue.use(VueAxios, axios);
Vue.axios.defaults.withCredentials = true; // 跨域cookie访问 Vue.axios.defaults.withCredentials = true; // 跨域cookie访问
...@@ -88,5 +89,4 @@ new Vue({ ...@@ -88,5 +89,4 @@ new Vue({
template: '<App/>' template: '<App/>'
}); });
console.log(Vue.config);
console.log(typeof Vue); \ No newline at end of file
import request from './index';
// 会员 /memberTag/getTagById
export const getTagType = params =>
request({
url: '/memberTag/getTagById',
method: 'get',
params: params
});
// 获取模板
export const findWidget = params =>
request({
url: '/memberTag/findWidget',
method: 'get',
params: params
});
export const findOndJson = params =>
request({
url: '/member-tag-value/findOne.json',
method: 'get',
params
});
...@@ -120,10 +120,11 @@ export function export_table_to_excel(id) { ...@@ -120,10 +120,11 @@ export function export_table_to_excel(id) {
function formatJson(jsonData) { function formatJson(jsonData) {
console.log(jsonData) console.log(jsonData)
} }
export function export_json_to_excel(th, jsonData, defaultTitle) { export function export_json_to_excel(th, jsonData, defaultTitle) {
/* original data */ /* original data */
console.log(jsonData);
var data = jsonData; var data = jsonData;
data.unshift(th); data.unshift(th);
var ws_name = "SheetJS"; var ws_name = "SheetJS";
......
...@@ -2366,6 +2366,7 @@ export default { ...@@ -2366,6 +2366,7 @@ export default {
// 获取 columnKey // 获取 columnKey
// if (!!resData.result.columnKey) { // if (!!resData.result.columnKey) {
that.currentKey = resData.result.columnKey; that.currentKey = resData.result.columnKey;
console.log(resData.result);
// }else { // }else {
// that.currentKey = resData.result.tagId; // that.currentKey = resData.result.tagId;
// } // }
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
<el-form-item label="标签描述" prop="tagDescribe" class="w-560"> <el-form-item label="标签描述" prop="tagDescribe" class="w-560">
<el-input :disabled="!tagEditFlag" class="w-447" type="textarea" v-model="ruleForm.tagDescribe" style="height: 96px;" @focus="focus('tagDescribe', 200)" @keyup.native="value => toInput(value)"> <el-input :disabled="!tagEditFlag" class="w-447" type="textarea" v-model="ruleForm.tagDescribe" style="height: 96px;" @focus="focus('tagDescribe', 200)" @keyup.native="value => toInput(value)">
</el-input> </el-input>
<template <template>
><label class="input-label textarea-label">{{ inputNumObj.tagDescribe }}/200</label></template <label class="input-label textarea-label">{{ inputNumObj.tagDescribe }}/200</label>
> </template>
</el-form-item> </el-form-item>
<el-form-item label="" class="font-0"> <el-form-item label="" class="font-0">
<el-button type="primary" @click.stop="confirmSave('ruleForm')" v-if="tagEditFlag">保存</el-button> <el-button type="primary" @click.stop="confirmSave('ruleForm')" v-if="tagEditFlag">保存</el-button>
...@@ -88,21 +88,7 @@ ...@@ -88,21 +88,7 @@
> >
删除 删除
</el-button> </el-button>
<!-- <el-popover
v-if="!scope.row.editAble && scope.row.status != 5"
placement="top"
width="160"
v-model="scope.row.popVisible">
<p style="line-height: 1.5; padding: 10px 10px 20px;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="cancelDelTag(scope.$index,scope.row)">取消</el-button>
<el-button type="primary" size="mini" @click="toDelTag(scope.$index,scope.row)">确定</el-button>
</div> -->
<!-- <el-button slot="reference" class="p-l-20" type="text">
删除
</el-button> -->
<!-- <el-button type="text" size="small" class="" @click="confirmDel(scope.$index,scope.row)">删除</el-button> -->
<!-- </el-popover> -->
<el-button v-if="scope.row.status == 5" type="text" size="small" class="">删除中</el-button> <el-button v-if="scope.row.status == 5" type="text" size="small" class="">删除中</el-button>
<el-button v-if="scope.row.editAble" type="text" @click.stop="confirmEdit(scope.$index, scope.row)">确认</el-button> <el-button v-if="scope.row.editAble" type="text" @click.stop="confirmEdit(scope.$index, scope.row)">确认</el-button>
...@@ -124,8 +110,6 @@ ...@@ -124,8 +110,6 @@
@selectIndex="setSelectIndex" @selectIndex="setSelectIndex"
@clearOldData="clearOldData" @clearOldData="clearOldData"
> >
<!-- :failHead="scope.row.header"
:failData="scope.row.data" -->
</upload-excel-component> </upload-excel-component>
</template> </template>
<template v-if="excelExistIndex == scope.$index && !!currentExcelHeader.length"> <template v-if="excelExistIndex == scope.$index && !!currentExcelHeader.length">
...@@ -135,21 +119,6 @@ ...@@ -135,21 +119,6 @@
<div class="flex-1"> <div class="flex-1">
<span class="p-r-8 color-303133">{{ currentExcelName }}</span <span class="p-r-8 color-303133">{{ currentExcelName }}</span
><span class="p-l-8 border-l-dcdfe6 color-1890ff excel-upload__del" @click.stop="clearOldData(scope.$index, scope.row)">删除</span> ><span class="p-l-8 border-l-dcdfe6 color-1890ff excel-upload__del" @click.stop="clearOldData(scope.$index, scope.row)">删除</span>
<!-- <el-popover
v-if="!scope.row.editAble"
placement="top"
width="160"
v-model="scope.row.popVisible">
<p style="line-height: 1.5; padding: 10px 10px 20px;">确认删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="cancelDelTag(scope.$index,scope.row)">取消</el-button>
<el-button type="primary" size="mini" @click="toDelCate(scope.$index,scope.row)">确定</el-button>
</div>
<el-button slot="reference" class="p-l-20" type="text">
删除
</el-button>
<el-button slot="reference" type="text" size="small" :disabled="!scope.row.enterpriseId? true: false" class="">删除</el-button>
</el-popover> -->
</div> </div>
<div class="flex-1 color-909399 font-12 m-t-05">已导入会员 {{ currentExcelData.length }}</div> <div class="flex-1 color-909399 font-12 m-t-05">已导入会员 {{ currentExcelData.length }}</div>
</div> </div>
...@@ -160,11 +129,7 @@ ...@@ -160,11 +129,7 @@
<el-table-column label=" " width="220px" class-name="no-right-border"> <el-table-column label=" " width="220px" class-name="no-right-border">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox v-model="scope.row.optType">清空标签历史标记会员</el-checkbox> <el-checkbox v-model="scope.row.optType">清空标签历史标记会员</el-checkbox>
<!-- <el-tooltip class="item" effect="light" content="" placement="top">
<div slot="content">勾选此选项之后,此前被本标签标记的会员将移除此标签,此标签标记会员以本次导入为准。
</div>
<i class="el-icon-question"></i>
</el-tooltip> -->
<el-popover placement="top-end" width="200" trigger="hover"> <el-popover placement="top-end" width="200" trigger="hover">
<span>勾选后,此前被该标签标记的会员将移除此标签,此标签标记会员以本次导入为准。</span> <span>勾选后,此前被该标签标记的会员将移除此标签,此标签标记会员以本次导入为准。</span>
<i slot="reference" class="iconfont icon-xinxixianshi"></i> <i slot="reference" class="iconfont icon-xinxixianshi"></i>
...@@ -185,23 +150,6 @@ ...@@ -185,23 +150,6 @@
</div> </div>
</div> </div>
<vue-gic-footer></vue-gic-footer> <vue-gic-footer></vue-gic-footer>
<!-- 保存 -->
<!-- <div class="manualTagEdit-wrap__footer">
<el-button @click.stop="cancelSave">取消</el-button>
<el-button type="primary" @click.stop="confirmSave">保存</el-button>
</div> -->
<!-- 上传后弹窗 -->
<!-- <el-dialog
title="提示"
:visible.sync="uploadedVisible"
width="30%"
:before-close="handleClose">
<p></p>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="uploadedVisible = false">确 定</el-button>
</span>
</el-dialog> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -233,16 +181,10 @@ export default { ...@@ -233,16 +181,10 @@ export default {
tagLevelGroupId: [{ required: true, message: '请选择所属分类', trigger: 'blur' }] tagLevelGroupId: [{ required: true, message: '请选择所属分类', trigger: 'blur' }]
}, },
optionsTwo: [ optionsTwo: [
// {
// value: '1',
// label: '二级分类'
// }
], ],
optionsThree: [ optionsThree: [
// {
// value: '1',
// label: '未分类'
// }
], ],
inputNumObj: { inputNumObj: {
tagName: 0, tagName: 0,
...@@ -258,15 +200,7 @@ export default { ...@@ -258,15 +200,7 @@ export default {
currentExcelData: [], // 当前上传 excel 内容的数据 currentExcelData: [], // 当前上传 excel 内容的数据
currentExcelHeader: [], // 当前上传 excel 标题的数据 currentExcelHeader: [], // 当前上传 excel 标题的数据
tagValTableData: [ tagValTableData: [
// {
// tagItemId: 1,
// tagItemName: '标签值1',
// inputValue: '', // 编辑输入框的值
// editAble: false, // 是否在编辑
// optType: true, // 是否选择清空已有标签
// status: 0, // 记录上传的状态
// popVisible: false
// },
], ],
// 上传后 // 上传后
uploadedVisible: false, uploadedVisible: false,
...@@ -751,16 +685,16 @@ export default { ...@@ -751,16 +685,16 @@ export default {
const that = this const that = this
require.ensure([], () => { require.ensure([], () => {
const { export_json_to_excel } = require('@/vendor/Export2Excel') const { export_json_to_excel } = require('@/vendor/Export2Excel')
const tHeader = ['mobile','cardNum']; const tHeader = ['手机号','卡号'];
const filterVal = ['mobile','cardNum']; const filterVal = ['手机号','卡号'];
const list = [ const list = [
{ {
cardNum: "jhdm2018071315", 卡号: "jhdm2018071315",
mobile: "17098078224" 手机号: "17098078224"
}, },
{ {
cardNum: "jhdm20180608000000003", 卡号: "jhdm20180608000000003",
mobile: "13100000055" 手机号: "13100000055"
} }
]; ];
if (!list.length) { if (!list.length) {
......
...@@ -909,6 +909,7 @@ export default { ...@@ -909,6 +909,7 @@ export default {
let newTempVal = newTemp.val[0]; let newTempVal = newTemp.val[0];
let newTime = newTemp.time; let newTime = newTemp.time;
that.currentComputeType = parseInt(newTempVal.compute.computeType); that.currentComputeType = parseInt(newTempVal.compute.computeType);
// 计算控件 // 计算控件
if (parseInt(newTempVal.compute.computeType) === 0 && !!newTempVal.compute.computeWidgetId) { if (parseInt(newTempVal.compute.computeType) === 0 && !!newTempVal.compute.computeWidgetId) {
that.getTemplateCodeById(newTempVal.compute.computeWidgetId); that.getTemplateCodeById(newTempVal.compute.computeWidgetId);
...@@ -956,6 +957,7 @@ export default { ...@@ -956,6 +957,7 @@ export default {
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
// 返回字段否追加对应 模板数据对象上 // 返回字段否追加对应 模板数据对象上
for (let key in resData.result) { for (let key in resData.result) {
console.log(that[resData.result.templateCode][key], resData.result[key]);
that[resData.result.templateCode][key] = resData.result[key]; that[resData.result.templateCode][key] = resData.result[key];
} }
// 如果是城市 // 如果是城市
...@@ -981,6 +983,7 @@ export default { ...@@ -981,6 +983,7 @@ export default {
return false; return false;
} }
that.templateData.push(that[resData.result.templateCode]); that.templateData.push(that[resData.result.templateCode]);
// 获取已存数据 // 获取已存数据
that.getExistData(that.tagData.tagId); that.getExistData(that.tagData.tagId);
if (resData.result.templateCode === 'tag009' || resData.result.templateCode === 'tag010') { if (resData.result.templateCode === 'tag009' || resData.result.templateCode === 'tag010') {
...@@ -1147,6 +1150,7 @@ export default { ...@@ -1147,6 +1150,7 @@ export default {
// 获取 columnKey // 获取 columnKey
that.currentKey = resData.result.columnKey; that.currentKey = resData.result.columnKey;
let templateObj = resData.result.template; let templateObj = resData.result.template;
if (!!templateObj) { if (!!templateObj) {
that.checkTagTemplate(templateObj.templateContent); that.checkTagTemplate(templateObj.templateContent);
} }
......
...@@ -104,6 +104,7 @@ export default { ...@@ -104,6 +104,7 @@ export default {
}, },
async loadMemberTagList(opt) { async loadMemberTagList(opt) {
try {
const params = { const params = {
requestProject: 'gic-member-tag-web', requestProject: 'gic-member-tag-web',
search: opt.searchName || null, // 标签名 search: opt.searchName || null, // 标签名
...@@ -120,6 +121,9 @@ export default { ...@@ -120,6 +121,9 @@ export default {
this.memberTagList = []; this.memberTagList = [];
this.total = 0; this.total = 0;
} }
} catch (e) {
console.log(e);
}
}, },
// 每页条数改变 // 每页条数改变
...@@ -131,8 +135,27 @@ export default { ...@@ -131,8 +135,27 @@ export default {
// 当前页码改变 // 当前页码改变
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNum = val; this.pageNum = val;
this.loadMemberTagList({}); const param = this.JudgeIsHandTag();
console.log(param);
this.loadMemberTagList(param);
},
/**
* 判断是否是手工标签
*/
JudgeIsHandTag() {
let param = null;
let keys = Object.keys(this.middleWareVariable);
// 长度大于0就表示 有手工标签的值
if (keys.length) {
param = {
id: this.middleWareVariable.id,
type: this.middleWareVariable.type == 1 ? 1 : 0
};
}
console.log(param);
return param;
}, },
// 模糊查询会员标签 // 模糊查询会员标签
searchMemberList() { searchMemberList() {
this.loadMemberTagList({ this.loadMemberTagList({
...@@ -141,6 +164,13 @@ export default { ...@@ -141,6 +164,13 @@ export default {
}, },
// 一级标签 // 一级标签
handleFristTag(list) { handleFristTag(list) {
this.middleWareVariable = {
id: list.id,
type: list.handTag,
name: list.name
};
this.pageNum = 1;
this.pageSize = 20;
this.loadMemberTagList({ this.loadMemberTagList({
id: list.id, id: list.id,
type: list.handTag ? 1 : -1 // 手工标签传1 type: list.handTag ? 1 : -1 // 手工标签传1
...@@ -157,6 +187,7 @@ export default { ...@@ -157,6 +187,7 @@ export default {
if (list.handTag == 1) { if (list.handTag == 1) {
const hangObj = { const hangObj = {
name: list.name, name: list.name,
type: 1,
id: list.id id: list.id
}; };
localStorage.setItem('groupId', JSON.stringify(hangObj)); localStorage.setItem('groupId', JSON.stringify(hangObj));
...@@ -168,7 +199,6 @@ export default { ...@@ -168,7 +199,6 @@ export default {
}, },
// 删除手工 // 删除手工
deleteHandTag(id) { deleteHandTag(id) {
console.log(id);
this.loadMemberTagList({ this.loadMemberTagList({
id: id, id: id,
type: 1 // 手工标签传1 type: 1 // 手工标签传1
...@@ -177,11 +207,14 @@ export default { ...@@ -177,11 +207,14 @@ export default {
}, },
beforeMount() { beforeMount() {
// 一二三级都需要一个变量来保存自己的信息 在切换页码和数量的时候也要传参数过去
this.middleWareVariable = {};
this.handTag = null; this.handTag = null;
this.groupId = ''; this.groupId = '';
this.getTagList(); this.getTagList();
if (localStorage.getItem('groupId')) { if (localStorage.getItem('groupId')) {
const hangObj = JSON.parse(localStorage.getItem('groupId')); const hangObj = JSON.parse(localStorage.getItem('groupId'));
this.middleWareVariable = JSON.parse(JSON.stringify(hangObj));
this.loadMemberTagList({ this.loadMemberTagList({
tagType: 1, tagType: 1,
id: hangObj.id id: hangObj.id
...@@ -201,6 +234,13 @@ export default { ...@@ -201,6 +234,13 @@ export default {
// 处理二级标签 // 处理二级标签
this.$on('handle-second-tag', list => { this.$on('handle-second-tag', list => {
this.middleWareVariable = {
id: list.id,
type: list.handTag,
name: list.name
};
this.pageNum = 1;
this.pageSize = 20;
this.loadMemberTagList({ this.loadMemberTagList({
id: list.id, id: list.id,
type: list.handTag ? 1 : -1 // 手工标签传1 type: list.handTag ? 1 : -1 // 手工标签传1
...@@ -212,6 +252,13 @@ export default { ...@@ -212,6 +252,13 @@ export default {
}); });
// 处理三级标签 // 处理三级标签
this.$on('handle-third-tag', list => { this.$on('handle-third-tag', list => {
this.middleWareVariable = {
id: list.id,
type: list.handTag,
name: list.name
};
this.pageNum = 1;
this.pageSize = 20;
this.loadMemberTagList({ this.loadMemberTagList({
id: list.id, id: list.id,
type: list.handTag ? 1 : -1 // 手工标签传1 type: list.handTag ? 1 : -1 // 手工标签传1
......
...@@ -34,7 +34,11 @@ ...@@ -34,7 +34,11 @@
<div class="dialog-box"> <div class="dialog-box">
<p class="tag-name">{{ dialogData.tagName }}</p> <p class="tag-name">{{ dialogData.tagName }}</p>
<p class="tag-desc">根据会员信息扩展字段统计而来</p> <p class="tag-desc">根据会员信息扩展字段统计而来</p>
<div class="tag-value"> <p class="tag-desc">标签值设置</p>
<!-- 所有标签的配置项 -->
<tag-config-options v-if="optionFlag" :tagId="tagId" ref="tagConfig"> </tag-config-options>
<!-- <div class="tag-value">
<p>标签值设置</p> <p>标签值设置</p>
<div class="tag-area"></div> <div class="tag-area"></div>
<p>时间范围</p> <p>时间范围</p>
...@@ -43,7 +47,7 @@ ...@@ -43,7 +47,7 @@
<el-option v-for="item in TimeOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option> <el-option v-for="item in TimeOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div> -->
<div class="tag-mode"> <div class="tag-mode">
<p>营销方式</p> <p>营销方式</p>
...@@ -52,7 +56,7 @@ ...@@ -52,7 +56,7 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> <el-button type="primary" @click="confirmOptions">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -60,13 +64,15 @@ ...@@ -60,13 +64,15 @@
<script> <script>
import TagMode from '@/components/tag/tag-mode'; import TagMode from '@/components/tag/tag-mode';
import TagConfigOptions from '@/components/tag/tag-config-options';
import { delThirdHandTag } from '@/request/api'; import { delThirdHandTag } from '@/request/api';
export default { export default {
name: 'tag-container', name: 'tag-container',
components: { components: {
TagMode TagMode,
TagConfigOptions
}, },
props: { props: {
...@@ -88,15 +94,24 @@ export default { ...@@ -88,15 +94,24 @@ export default {
tableData: [], tableData: [],
dialogVisible: false, dialogVisible: false,
dialogData: {}, dialogData: {},
TimeOptions: [] TimeOptions: [],
optionFlag: false,
tagId: ''
}; };
}, },
methods: { methods: {
handleClose() {
this.optionFlag = false;
},
// 添加标签 弹框里面操作 // 添加标签 弹框里面操作
addTag(list) { addTag(list) {
this.dialogData = list; this.dialogData = list;
if (list.tagId) {
this.optionFlag = true;
this.tagId = list.tagId;
this.dialogVisible = !this.dialogVisible; this.dialogVisible = !this.dialogVisible;
}
}, },
editHandTag(list) { editHandTag(list) {
this.$router.push({ this.$router.push({
...@@ -133,6 +148,13 @@ export default { ...@@ -133,6 +148,13 @@ export default {
.catch(err => { .catch(err => {
console.log(err); console.log(err);
}); });
},
/**
*
*/
confirmOptions() {
console.log(this.$refs.tagConfig.getTemplateData());
} }
}, },
......
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