Commit cc2e0335 by liuchuanming

海报保存信息

1 parent 2b89321c
...@@ -19,8 +19,7 @@ var locale_ru_RU = { ...@@ -19,8 +19,7 @@ var locale_ru_RU = {
"DeleteAll": "全部清空", "DeleteAll": "全部清空",
"Delete": "删除元素", "Delete": "删除元素",
"Undo": "后退", "Undo": "后退",
"Redo": "前进", "Redo": "前进"
"Reset": "重置"
}; };
export default { export default {
...@@ -30,7 +29,7 @@ export default { ...@@ -30,7 +29,7 @@ export default {
"tui-image-editor": PosterPage "tui-image-editor": PosterPage
}, },
data () { data () {
const bgPath = "'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg1.gtimg.com%2Fsports%2Fpics%2Fhv1%2F171%2F106%2F1472%2F95744001.jpg&refer=http%3A%2F%2Fimg1.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1612444990&t=6589254fe9669cc6a45fd3688f269612'" const bgPath = ""
return { return {
dialog: { dialog: {
...@@ -72,7 +71,7 @@ export default { ...@@ -72,7 +71,7 @@ export default {
srcList: [], srcList: [],
ids: [], // 选中数组 ids: [], // 选中数组
previewImg: '', // 预览图片地址 previewImg: '', // 预览图片地址
useDefaultUI: false, useDefaultUI: true,
options: { options: {
includeUI: { includeUI: {
// initMenu: "text", // initMenu: "text",
...@@ -83,7 +82,7 @@ export default { ...@@ -83,7 +82,7 @@ export default {
// }, // },
usageStatistics: false, usageStatistics: false,
menuBarPosition: "right", menuBarPosition: "right",
menu: [], // FIXME 因为借用了CANVAS的UI 所以需要使用TEXT,需要额外注释,后面创建自己的UI在去掉 menu: ['text'], // FIXME 因为借用了CANVAS的UI 所以需要使用TEXT,需要额外注释,后面创建自己的UI在去掉
theme: { theme: {
"common.bi.image": "", "common.bi.image": "",
"common.bisize.width": "251px", "common.bisize.width": "251px",
...@@ -93,14 +92,53 @@ export default { ...@@ -93,14 +92,53 @@ export default {
"common.border": "1px solid #c1c1c1", "common.border": "1px solid #c1c1c1",
// header // header
"header.backgroundImage": "none", 'header.backgroundImage': 'none',
"header.backgroundColor": "transparent", 'header.backgroundColor': 'transparent',
"header.border": "0px", 'header.border': '0px',
// load button
'loadButton.backgroundColor': '#fff',
'loadButton.border': '1px solid #ddd',
'loadButton.color': '#222',
'loadButton.fontFamily': "'Noto Sans', sans-serif",
'loadButton.fontSize': '12px',
// download button
'downloadButton.backgroundColor': '#fdba3b',
'downloadButton.border': '1px solid #fdba3b',
'downloadButton.color': '#fff',
'downloadButton.fontFamily': "'Noto Sans', sans-serif",
'downloadButton.fontSize': '12px',
// main icons // main icons
"menu.iconSize.width": "34px", 'menu.normalIcon.color': '#8a8a8a',
"menu.iconSize.height": "34px", 'menu.activeIcon.color': '#555555',
'menu.disabledIcon.color': '#434343',
'menu.hoverIcon.color': '#e9e9e9',
'menu.iconSize.width': '24px',
'menu.iconSize.height': '24px',
// colorpicker style
'colorpicker.button.border': '1px solid #1e1e1e',
'colorpicker.title.color': '#fff',
} }
// {
// "common.bi.image": "",
// "common.bisize.width": "251px",
// "common.bisize.height": "21px",
// "common.backgroundImage": bgpng,
// "common.backgroundColor": "#fff",
// "common.border": "1px solid #c1c1c1",
// // header
// "header.backgroundImage": "none",
// "header.backgroundColor": "transparent",
// "header.border": "0px",
// // main icons
// "menu.iconSize.width": "34px",
// "menu.iconSize.height": "34px",
// }
} }
} }
} }
...@@ -207,61 +245,48 @@ export default { ...@@ -207,61 +245,48 @@ export default {
// //
async save() { async save() {
try { try {
const posterForm = this.posterForm // const posterForm = this.posterForm
console.log('save', posterForm.id) // console.log('save', posterForm.id)
let res = {} // let res = {}
if (posterForm.id) { // if (posterForm.id) {
// 编辑海报 // // 编辑海报
res = await updatePoster(Object.assign({}, { // res = await updatePoster(Object.assign({}, {
backgroundImgPath: 'http://106.13.236.58:8080/profile/2020/12/31/5ca3fa0b-55d7-433c-ba02-61d4502e45e1.jpg', // backgroundImgPath: 'http://106.13.236.58:8080/profile/2020/12/31/5ca3fa0b-55d7-433c-ba02-61d4502e45e1.jpg',
posterSubassemblyList: [] // posterSubassemblyList: []
}, this.posterForm)) // }, this.posterForm))
} else { // } else {
// 新建海报 // // 新建海报
res = await addPoster(Object.assign({}, { // res = await addPoster(Object.assign({}, {
backgroundImgPath: 'http://106.13.236.58:8080/profile/2020/12/31/5ca3fa0b-55d7-433c-ba02-61d4502e45e1.jpg', // backgroundImgPath: 'http://106.13.236.58:8080/profile/2020/12/31/5ca3fa0b-55d7-433c-ba02-61d4502e45e1.jpg',
posterSubassemblyList: [] // posterSubassemblyList: []
}, this.posterForm)) // }, this.posterForm))
} // }
if (res.code === 200) { // if (res.code === 200) {
this.msgSuccess(res.msg) // this.msgSuccess(res.msg)
this.$refs.page.getList(1) // this.$refs.page.getList(1)
this.beforeCloseDialog() // this.beforeCloseDialog()
} // }
// let res = {};
// var list =[]; let imageEditor = this.$refs.tuiImageEditor;
// this.$refs.tuiImageEditor.editorInstance._invoker._undoStack.forEach(element => { let res = {};
// this.records.forEach(item => { let list =[];
// if(element.name =='addIcon' && element.undoData.object.__fe_id && item.id == element.undoData.object.__fe_id){ let deleteId = [];
// item.type = element.args[1] imageEditor.editorInstance._invoker._undoStack.forEach(element => {
// } if(element.name == "removeObject"){
// }); deleteId.push(element.args[1])
// }); }
// var deleteId = []; })
// this.$refs.tuiImageEditor.editorInstance._invoker._undoStack.forEach(element => { Object.values(imageEditor.records).forEach(item => {
// if(element.name == "removeObject"){ if(deleteId.indexOf((item.id).toString())>=0){
// deleteId.push(element.args[1]) console.log(" ")
// } }else{
// }) list.push(item)
// this.records.forEach(item => { }
// if(deleteId.indexOf((item.id).toString())>=0){ });
// console.log(" ")
// }else{
// list.push(item)
// }
// });
// //全清除
// this.$refs.tuiImageEditor.editorInstance._invoker._undoStack.forEach(element => {
// if(element.name == "loadImage" || element.name == "clearObjects"){
// list = []
// }
// })
// const image = this.$refs.tuiImageEditor.editorInstance.toDataURL(); // const image = this.$refs.tuiImageEditor.editorInstance.toDataURL();
// res.url = image; // res.url = image;
// res.records = list; res.records = list;
// console.log("最后结果:")
// console.log(res)
// window.localStorage.setItem('record',JSON.stringify(list))
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} }
...@@ -423,7 +448,7 @@ export default { ...@@ -423,7 +448,7 @@ export default {
<li class="menu-item" id="btn-text">添加自定义文本</li> <li class="menu-item" id="btn-text">添加自定义文本</li>
<li class="menu-item" id="btn-image">添加图片</li> <li class="menu-item" id="btn-image">添加图片</li>
<li class="menu-item" id="btn-qrCode">添加二维码</li> <li class="menu-item" id="btn-qrCode">添加二维码</li>
<li class="menu-item" id="btn-nickName">添加客户昵称</li> <!-- <li class="menu-item" id="btn-nickName">添加客户昵称</li> -->
</ul> </ul>
<div class="sub-menu-container" id="text-sub-menu"> <div class="sub-menu-container" id="text-sub-menu">
<ul class="menu"> <ul class="menu">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!