Authored by bevishuang

新增资源位Tab

... ... @@ -57,8 +57,6 @@ export default {
}
},
data() {
console.log('editor==this.value')
console.log(this.value)
return {
value_: this.handleData(util.clone(this.value))
};
... ... @@ -96,6 +94,7 @@ export default {
this.$emit('input', this.handleSaveData(this.value_));
},
handleData(m) {
let keys = Object.keys(m);
keys.sort((a,b) => {
... ... @@ -133,8 +132,6 @@ export default {
}
}
this.addId(a);
console.log('========')
console.log(a)
if (a.url && a.url.action && a.url.action === 'go.ufo') {
if (util.getUrlQueryString(a.url.url, 'pagename') === 'productDetail') {
... ... @@ -151,21 +148,15 @@ export default {
a.url.action = 'go.list';
}
}
console.log('====a====')
console.log(a)
result.push(a);
}
return result;
},
handleSaveData(m) {
console.log('handleSaveData')
console.log(m)
let temp = util.clone(m);
for (const i of Object.keys(temp)) {
console.log('temp')
console.log(temp)
if (['go.pool', 'go.detail', 'go.list', 'go.calendar', 'go.hotlist', 'go.identifyList'].includes(temp[i].url.action)) {
temp[i].url.action = 'go.ufo';
}
... ... @@ -178,7 +169,6 @@ export default {
temp[i].url.islogin = 'Y'
}
if (temp[i].url.action === 'go.channel') {
console.log('======'+temp[i].url.action)
temp[i].tabName = util.getUrlQueryString(temp[i].url.url, 'tabName')
temp[i].code = util.getUrlQueryString(temp[i].url.url, 'channelCode')
} else {
... ... @@ -186,8 +176,6 @@ export default {
temp[i].alt = util.getUrlQueryString(temp[i].url.url, 'title')
}
}
// console.log('temp')
// console.log(m)
// array to object
const result = {}
... ... @@ -195,21 +183,15 @@ export default {
result[i] = temp[i];
}
console.log('result')
console.log(result)
return result;
},
getValue(){
console.log('getValue=>')
console.log(this.value_)
return this.handleSaveData(this.value_);
},
addId(m) {
m.id = this.$bus.genId();
},
setValue(newVal) {
console.log('setValue=newVal')
console.log(newVal)
this.value_ = this.handleData(util.clone(newVal));
},
reset() {
... ... @@ -219,8 +201,6 @@ console.log('result')
},
watch: {
value(newVal) {
// console.log('watch=newVal')
// console.log(newVal)
this.value_ = this.handleData(util.clone(newVal));
}
},
... ...
... ... @@ -35,8 +35,6 @@
props: ['value','type'],
data() {
console.log('params==this.value')
console.log(this.value)
return {
url_: this.value.url? this.value.url : '',
action_: this.value.action ? this.value.action : 'go.h5',
... ... @@ -46,13 +44,8 @@
};
},
methods: {
// loggerValue(){
// console.log('loggerValue===this.type')
// console.log(this.type)
// },
initAction() {
// console.log('loggerValue===this.value_')
// console.log(this.type)
let action = [];
if(this.type === 'H5'){
action = [
... ... @@ -120,7 +113,6 @@
return action;
},
updateStatus() {
console.log('updateStatus');
const data = {url: this.url_, action: this.action_};
if (this.islogin) {
... ... @@ -136,13 +128,9 @@
},
watch: {
url_(newVal) {
// console.log('url_');
// console.log(newVal);
this.updateStatus();
},
action_(newVal) {
console.log('action_');
console.log(newVal);
if (newVal === 'go.detail') {
this.url_ = 'https://m.yohobuy.com/?pagename=productDetail';
} else if (newVal === 'go.pool') {
... ...
... ... @@ -330,7 +330,6 @@
},
methods: {
getResourceDetailList() {
console.log('this.resId:'+this.resId)
this.resourceService.info(this.resId).then(result => {
this.list = result;
this.manageAllData(result);
... ... @@ -338,8 +337,6 @@
});
},
manageAllData(data) {
console.log('manageAllData')
console.log(data)
this.uploadData.items = [];
for (let i = 0; i < data.length; i++) {
let item = {
... ... @@ -353,21 +350,15 @@
}
},
manageFloorList(data) {
console.log('manageFloorList')
this.floorList = [];
console.log(data);
for (let i = 0; i < data.length; i++) {
let item = JSON.parse(data[i].data);
// console.log(item)
item.resContentId = data[i].resContentId;
item.type = data[i].type;
this.floorList.push(item);
console.log(this.floorList);
}
},
showModal(type, data, index) {
console.log(data, index);
let modalType = 0;
let modalTitle = '';
let hideAddButton = true;
... ... @@ -378,14 +369,9 @@
}
for (let i in forData) {
let itemData = forData[i];
console.log('itemData')
console.log(itemData)
this.modalData.push(itemData);
}
console.log('modalData:', this.modalData);
switch (type) {
case 'singleImage':
modalType = 3;
... ... @@ -433,7 +419,6 @@
this.show = true;
}
// console.log('ModalInfo:', this.modalInfo);
},
showDeleteModal(index) { // 确认删除对话框
this.$Modal.confirm({
... ... @@ -456,7 +441,6 @@
template_name: ''
};
} else {
// console.log(res);
this.$Message.error(res.message || '修改失败!');
}
});
... ... @@ -465,9 +449,9 @@
},
onOk() { // 对话框点击确认时,保存数据
let modalValue = this.$refs.addEditor.getValue();
console.log('modalValue')
console.log(modalValue)
let size = 0;
for(let key in modalValue) { // 提交空数据的判断
size ++ ;
if (modalValue[key].url.url === '') {
this.modalData = [];
this.$Message.error('请填写所有信息后再提交!');
... ... @@ -481,16 +465,18 @@
list: modalValue,
};
}
console.log('dataResult')
console.log(dataResult)
let name = this.modalInfo.template_name;
let intro =this.modalInfo.template_intro;
let data = {
id: this.modalInfo.resContentId,
contentName: '楼层' + (this.floorList.length + 1),
templateKey: '123',
contentData: JSON.stringify({
template_name: this.modalInfo.template_name,
template_intro: this.modalInfo.template_intro,
data: dataResult
template_name: name,
template_intro: intro,
data: dataResult,
size: size,
}),
type: this.modalInfo.modalType
};
... ... @@ -501,9 +487,7 @@
this.uploadData.items[this.modalInfo.floorIndex] = data;
}
console.log('uploadData:', this.uploadData);
this.resourceService.addOrUpdateResourceDetail(this.uploadData).then(res => {
// console.log(res);
if (res && res.code === 200) {
this.$Message.success(res.message || '修改成功!');
this.getResourceDetailList();
... ... @@ -518,7 +502,6 @@
};
this.show = false;
} else {
// console.log(res);
this.$Message.error(res.message || '修改失败!');
}
});
... ...