Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Madara
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
Madara
Commits
d8dffcc9
Commit
d8dffcc9
authored
Sep 27, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
340b946e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
index.js
src/main/index.js
+3
-0
chatitem.vue
src/renderer/components/msssage/chatitem.vue
+21
-0
forwardMsg.vue
src/renderer/components/team/forwardMsg.vue
+5
-3
No files found.
src/main/index.js
View file @
d8dffcc9
...
...
@@ -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) {
screenEvent = event
})
...
...
src/renderer/components/msssage/chatitem.vue
View file @
d8dffcc9
...
...
@@ -321,6 +321,25 @@ export default {
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
()
{
if
(
this
.
msg
.
type
==
"text"
)
{
var
text
=
document
...
...
@@ -328,6 +347,8 @@ export default {
.
querySelector
(
".msg-text"
).
innerText
;
this
.
$electron
.
ipcRenderer
.
send
(
"setClipboard"
,
text
,
1
);
}
else
if
(
this
.
msg
.
type
==
"image"
)
{
this
.
getBase64
(
this
.
msg
.
file
.
url
)
return
let
url
=
this
.
msg
.
file
.
url
;
if
(
url
.
indexOf
(
'nim.nosdn.127.net'
)
!==
-
1
)
{
url
=
url
.
replace
(
'nim.nosdn.127.net'
,
'nim-nosdn.netease.im'
)
...
...
src/renderer/components/team/forwardMsg.vue
View file @
d8dffcc9
...
...
@@ -269,8 +269,8 @@ export default {
.forward-msg
.content
.panle
.search__user_box
.seach_ctr
.seach__item__input
{
width
:
100%
;
text-indent
:
23px
;
height
:
23px
;
line-height
:
23px
;
height
:
23px
!important
;
line-height
:
23px
!important
;
border
:
none
;
border
:
1px
solid
rgb
(
225
,
225
,
225
);
outline
:
none
;
...
...
@@ -280,6 +280,8 @@ export default {
box-sizing
:
border-box
;
background
:
rgb
(
225
,
225
,
225
);
border-radius
:
2px
;
position
:
relative
;
z-index
:
3
;
}
.forward-msg
.content
...
...
@@ -296,7 +298,7 @@ export default {
top
:
2px
;
left
:
0
;
padding-left
:
7px
;
max-
width
:
24px
!important
;
width
:
24px
!important
;
}
.forward-msg
.content
.panle
.search__user_box
.seach_ctr
.seach__item__icon
i
{
font-size
:
12px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment