...
|
...
|
@@ -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;
|
...
|
...
|
@@ -377,14 +368,9 @@ |
|
|
forData = data.data;
|
|
|
}
|
|
|
for (let i in forData) {
|
|
|
let itemData = forData[i];
|
|
|
console.log('itemData')
|
|
|
console.log(itemData)
|
|
|
this.modalData.push(itemData);
|
|
|
}
|
|
|
|
|
|
|
|
|
console.log('modalData:', this.modalData);
|
|
|
let itemData = forData[i];
|
|
|
this.modalData.push(itemData);
|
|
|
}
|
|
|
|
|
|
switch (type) {
|
|
|
case 'singleImage':
|
...
|
...
|
@@ -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 || '修改失败!');
|
|
|
}
|
|
|
});
|
...
|
...
|
|