Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d1683770
authored
Jan 06, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'pre' into release
parents
f0747279
7615652f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
components/chat-room.vue
components/chat-room.vue
View file @
d1683770
...
...
@@ -43,12 +43,15 @@
import
Chat
from
"@/customer-service/xim"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
const
chatResizeKey1
=
"chat-resize-1"
;
const
chatResizeKey2
=
"chat-resize-2"
;
@
Component
({
components
:
{
MessageInput
,
messages
}
})
export
default
class
ChatRoom
extends
Vue
{
@
Ref
(
"chatBox"
)
private
readonly
chatBox
!
:
Element
;
@
Ref
(
"top"
)
private
readonly
refTop
!
:
Element
;
@
Ref
(
"bottom"
)
private
readonly
refBottom
!
:
Element
;
@
Ref
(
"resize"
)
private
readonly
refResize
!
:
Element
;
@
Ref
(
"chatBox"
)
private
readonly
chatBox
!
:
HTML
Element
;
@
Ref
(
"top"
)
private
readonly
refTop
!
:
HTML
Element
;
@
Ref
(
"bottom"
)
private
readonly
refBottom
!
:
HTML
Element
;
@
Ref
(
"resize"
)
private
readonly
refResize
!
:
HTML
Element
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
...
...
@@ -97,9 +100,9 @@
private
dragControllerDiv
(
e
:
MouseEvent
)
{
const
resize
=
this
.
refResize
as
any
;
const
top
=
this
.
refTop
as
HTMLElement
;
const
bottom
=
this
.
refBottom
as
HTMLElement
;
const
box
=
this
.
chatBox
as
HTMLElement
;
const
top
=
this
.
refTop
;
const
bottom
=
this
.
refBottom
;
const
box
=
this
.
chatBox
;
const
startY
=
e
.
clientY
;
const
originTop
=
resize
.
offsetTop
;
...
...
@@ -115,6 +118,9 @@
resize
.
style
.
top
=
moveLen
+
"px"
;
// 设置左侧区域的宽度
top
.
style
.
height
=
moveLen
+
"px"
;
bottom
.
style
.
height
=
bottomHeight
+
"px"
;
localStorage
.
setItem
(
chatResizeKey1
,
moveLen
);
localStorage
.
setItem
(
chatResizeKey2
,
bottomHeight
+
""
);
};
document
.
onmouseup
=
function
()
{
document
.
onmousemove
=
null
;
...
...
@@ -126,9 +132,22 @@
}
mounted
()
{
this
.
refBottom
&&
((
this
.
refBottom
as
HTMLElement
).
style
.
height
=
this
.
chatBox
.
clientHeight
-
this
.
refTop
.
clientHeight
+
"px"
);
if
(
localStorage
.
getItem
(
chatResizeKey1
)
&&
localStorage
.
getItem
(
chatResizeKey2
)
)
{
const
s1
=
localStorage
.
getItem
(
chatResizeKey1
)
+
"px"
;
const
s2
=
localStorage
.
getItem
(
chatResizeKey2
)
+
"px"
;
this
.
refResize
&&
(
this
.
refResize
.
style
.
top
=
s1
);
this
.
refTop
&&
(
this
.
refTop
.
style
.
height
=
s1
);
this
.
refBottom
&&
(
this
.
refBottom
.
style
.
height
=
s2
);
}
else
{
this
.
refBottom
&&
((
this
.
refBottom
as
HTMLElement
).
style
.
height
=
this
.
chatBox
.
clientHeight
-
this
.
refTop
.
clientHeight
+
"px"
);
}
}
private
openMessage
(
o
:
any
)
{
...
...
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