Commit 2bdec947 by caoyanzhi

删除不用的代码

parent 9a175938
......@@ -37,8 +37,9 @@
<el-select v-model="ruleForm.updateType" placeholder="请选择" class="w-200" @change="changeRate(ruleForm.updateType)">
<el-option label="每日一次" value="1"></el-option>
<el-option label="每周一次" value="2"></el-option>
<el-option label="每月一次" value="3"></el-option> </el-select
><el-select v-model="ruleForm.updateDay" v-if="ruleForm.updateType != 1" placeholder="请选择" class="w-200 p-l-8">
<el-option label="每月一次" value="3"></el-option>
</el-select>
<el-select v-model="ruleForm.updateDay" v-if="ruleForm.updateType != 1" placeholder="请选择" class="w-200 p-l-8">
<el-option v-for="item in rateOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
<div class="form-tip-text"><label>*更新时间预计选择日期的凌晨0点至6点</label></div>
......@@ -52,33 +53,6 @@
</div>
</div>
<vue-gic-footer></vue-gic-footer>
<!-- 标签详情缩写版 -->
<tagShortDetail
:fromFlag="fromFlag"
:showTagDetail="showTagDetail"
:tagShortId.sync="tagShortDetailId"
:tabActive="tabActiveName"
:rowItemData.sync="rowItemData"
@hideTag="handleHideTag"
@returnTagData="returnTagData"
>
</tagShortDetail>
<!-- 会员分组-我的标签列表和暂存架 -->
<add-tag-view
ref="addTagViewComponent"
:delTagId="delTagId"
:addTagShow.sync="showTagFlag"
:selTagData="selectedTagData"
:returnEditObj="returnEditObj"
@showTabActive="showTabActive"
@showShortDetail="showShortDetail"
@returnTempData="returnTempData"
@returnTempTableData="returnTempTableData"
@returnTempTagId="returnTempTagId"
@returnTempRowData="returnTempRowData"
>
</add-tag-view>
</div>
</template>
......@@ -87,12 +61,9 @@
* #/member-tag
* */
import navCrumb from '@/components/nav/nav.vue';
import addTagView from '@/components/addTagView.vue';
import tagShortDetail from '@/components/tagShortDetail.vue';
import tagsGroupList from './tags-group-list.vue';
import strLength from '@/common/js/strlen';
import showMsg from '@/common/js/showmsg';
// import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
......@@ -164,8 +135,6 @@ export default {
// },
],
showTagFlag: false, //是否显示需要添加的标签层
// 已选标签数据
selectedTagData: [
[
......@@ -178,16 +147,7 @@ export default {
// isActive: 0
// }
]
],
rowItemData: {}, //选择的标签的数据
showTagDetail: false, // 标签详情缩小版显示/隐藏
tagShortDetailId: '', // 标签详情缩写版 id
fromFlag: 'memberGroup', // 参数--来源标志
delTagId: '', // 删掉 id
returnEditObj: {}, // 标签详情缩小版返回的对象
tabActiveName: 'first' // 我的标签列表/暂存架
]
};
},
computed: {
......@@ -385,197 +345,6 @@ export default {
},
/**
* 子组件 我的标签库/暂存架 -点击名字显示标签详情缩略版
*/
showShortDetail(id) {
const that = this;
that.showTagDetail = true;
that.tagShortDetailId = id;
},
/**
* 子组件触发---隐藏标签详情缩小版
*/
handleHideTag(val) {
const that = this;
that.showTagDetail = false;
},
/**
* 判断添加重复字段
*/
isRepeat(arr) {
let hash = {};
for (let i in arr) {
if (hash[arr[i]]) {
return true;
}
hash[arr[i]] = true;
}
return false;
},
/**
* 子组件触发---标签详情缩略版编辑值后返回参数
*/
returnTagData(obj) {
const that = this;
console.log('返回obj:', obj);
that.returnEditObj = obj; // 标签详情编辑后返回的标签数据
if (that.tabActiveName == 'second') {
// 如果是在暂存架修改标签值
return false;
}
let allIds = !!that.selectedTagData.length ? that.selectedTagData.map(item => item.tagId) : [];
if (allIds.indexOf(obj.tagId) != -1) {
// 存在覆盖
let newList = JSON.parse(JSON.stringify(that.selectedTagData));
newList.forEach(function(ele, index) {
if (ele.tagId == obj.tagId) {
ele.tagValue = obj.tagValue;
ele.tagParams = obj.tagParams;
}
});
that.selectedTagData = newList;
} else {
console.log(allIds.indexOf(obj.tagId));
// 不存在直接追加
that.selectedTagData.unshift(JSON.parse(JSON.stringify(obj)));
console.log('处理obj:', that.selectedTagData);
}
that.handleReturnData(that.selectedTagData);
},
/**
* 子组件触发-- 全选---暂存架全选后返回参数
*/
returnTempData(arr) {
const that = this;
console.log('暂存架全选数据:', arr);
if (!!arr.length) {
let tagAllIds = arr.map(item => item.tagId);
console.log(tagAllIds);
// 存在先删除,后追加新数据
let midData = JSON.parse(JSON.stringify(that.selectedTagData));
let newMidData = [];
midData.forEach(function(ele, index) {
// 全选中如果有标签不在 已选数据中,就要单独挑出来
if (!tagAllIds.includes(ele.tagId)) {
newMidData.push(ele);
}
});
// midData = midData.filter(item=>(tagIds.indexOf(item.tagId) == -1))
// console.log("处理已选的时候:",newMidData)
arr.forEach(function(ele, index) {
newMidData.unshift(ele);
});
that.selectedTagData = newMidData;
// console.log("全选的时候:",newMidData)
that.handleReturnData(that.selectedTagData);
}
},
/**
* 子组件触发--全不选---返回暂存架所有标签数据
*/
returnTempTableData(arrData) {
const that = this;
console.log('返回暂存架所有标签数据:', arrData);
let tagIds = arrData.map(item => item.tagId);
// 存在先删除,后追加新数据
let midData = JSON.parse(JSON.stringify(that.selectedTagData));
let newMidData = [];
midData.forEach(function(ele, index) {
if (!tagIds.includes(ele.tagId)) {
newMidData.push(ele);
}
});
console.log('全不选:', midData);
that.selectedTagData = newMidData;
that.handleReturnData(that.selectedTagData);
},
/**
* 子组件触发--返回暂存架标签 id
*/
returnTempTagId(id) {
const that = this;
console.log('返回暂存架标签 id:', id);
let delData = JSON.parse(JSON.stringify(that.selectedTagData));
delData.forEach(function(ele, index) {
if (ele.tagId == id) {
that.selectedTagData.splice(index, 1);
}
});
console.log('返回暂存架标签 id 后:', that.selectedTagData);
// 更新 form 数据
that.ruleForm.selectedTag = that.selectedTagData;
// 判断实时非实时
that.checkRealTime();
},
/**
* 子组件触发--返回暂存架当前标签数据
*/
returnTempRowData(row) {
const that = this;
// 判断当前标签是否在已选数据中
let delData = JSON.parse(JSON.stringify(that.selectedTagData));
delData.forEach(function(ele, index) {
if (ele.tagId == row.tagId) {
ele.tagParams = row.tagParams;
ele.tagValue = row.tagValue;
ele.newTagVal = row.newTagVal;
}
});
let ids = delData.map(item => item.tagId);
// 暂存架选择的标签不在已选数据中
if (ids.indexOf(row.tagId) == -1) {
delData.unshift(row);
}
that.selectedTagData = delData;
that.ruleForm.selectedTag = that.selectedTagData;
// 判断实时非实时
that.checkRealTime();
},
/**
* 子组件触发--返回参数处理
*/
handleReturnData(selectedTagData) {
const that = this;
// 提取选择值
selectedTagData.forEach(function(ele, index) {
let newTagVal = JSON.parse(ele.tagParams);
if (newTagVal.selectedVal != '') {
ele.newTagVal = JSON.stringify(newTagVal.selectedVal).replace(/"/g, '');
} else {
ele.newTagVal = '';
}
});
that.ruleForm.selectedTag = selectedTagData;
// 判断实时非实时
that.checkRealTime();
// 刷新暂存架
// console.log(that.$refs.addTagViewComponent)
// that.$refs.addTagViewComponent.refreshTemp();
},
/**
* 子组件触发--返回当前 tab
*/
showTabActive(name) {
const that = this;
that.tabActiveName = name;
},
/**
* 编辑时候---获取分组数据
*/
getGroupData() {
......@@ -656,8 +425,6 @@ export default {
},
components: {
navCrumb,
addTagView,
tagShortDetail,
tagsGroupList
}
};
......
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