Commit 2187b4d6 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/madara

parents 238e0efa 6c17cb87
...@@ -656,6 +656,9 @@ ipc.on('getNetworkImage', function(event, url) { ...@@ -656,6 +656,9 @@ ipc.on('getNetworkImage', function(event, url) {
}); });
}); });
}) })
ipc.on('getNetworkImageBASE64', function (event, img) {
clipboard.writeImage(img)
})
ipc.on('screens-session', function(event) { ipc.on('screens-session', function(event) {
screenEvent = event screenEvent = event
}) })
......
...@@ -321,6 +321,25 @@ export default { ...@@ -321,6 +321,25 @@ export default {
dom.style.paddingRight = "12px"; dom.style.paddingRight = "12px";
} }
}, },
getBase64Image(img) {
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, img.width, img.height);
var dataURL = canvas.toDataURL("image/png");
alert(dataURL)
this.$electron.ipcRenderer.send("getNetworkImageBASE64", dataURL);
return
},
getBase64(src) {
var img = document.createElement('img');
img.src = src; //此处自己替换本地图片的地址
let _this = this;
img.onload =function() {
// console.log(_this.getBase64Image(img))
}
},
setClipboard() { setClipboard() {
if (this.msg.type == "text") { if (this.msg.type == "text") {
var text = document var text = document
...@@ -328,6 +347,8 @@ export default { ...@@ -328,6 +347,8 @@ export default {
.querySelector(".msg-text").innerText; .querySelector(".msg-text").innerText;
this.$electron.ipcRenderer.send("setClipboard", text, 1); this.$electron.ipcRenderer.send("setClipboard", text, 1);
} else if (this.msg.type == "image") { } else if (this.msg.type == "image") {
this.getBase64(this.msg.file.url)
return
let url = this.msg.file.url; let url = this.msg.file.url;
if (url.indexOf('nim.nosdn.127.net') !== -1) { if (url.indexOf('nim.nosdn.127.net') !== -1) {
url = url.replace('nim.nosdn.127.net', 'nim-nosdn.netease.im') url = url.replace('nim.nosdn.127.net', 'nim-nosdn.netease.im')
......
...@@ -269,8 +269,8 @@ export default { ...@@ -269,8 +269,8 @@ export default {
.forward-msg .content .panle .search__user_box .seach_ctr .seach__item__input { .forward-msg .content .panle .search__user_box .seach_ctr .seach__item__input {
width: 100%; width: 100%;
text-indent: 23px; text-indent: 23px;
height: 23px; height: 23px !important;
line-height: 23px; line-height: 23px !important;
border: none; border: none;
border: 1px solid rgb(225, 225, 225); border: 1px solid rgb(225, 225, 225);
outline: none; outline: none;
...@@ -280,6 +280,8 @@ export default { ...@@ -280,6 +280,8 @@ export default {
box-sizing: border-box; box-sizing: border-box;
background: rgb(225, 225, 225); background: rgb(225, 225, 225);
border-radius: 2px; border-radius: 2px;
position: relative;
z-index: 3;
} }
.forward-msg .forward-msg
.content .content
...@@ -296,7 +298,7 @@ export default { ...@@ -296,7 +298,7 @@ export default {
top: 2px; top: 2px;
left: 0; left: 0;
padding-left: 7px; padding-left: 7px;
max-width: 24px !important; width: 24px !important;
} }
.forward-msg .content .panle .search__user_box .seach_ctr .seach__item__icon i { .forward-msg .content .panle .search__user_box .seach_ctr .seach__item__icon i {
font-size: 12px; font-size: 12px;
......
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