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
7615652f
authored
Jan 06, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into pre
parents
d4ea4c8a
52f485d6
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 @
7615652f
...
@@ -43,12 +43,15 @@
...
@@ -43,12 +43,15 @@
import
Chat
from
"@/customer-service/xim"
;
import
Chat
from
"@/customer-service/xim"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
import
{
CustomerServiceEvent
}
from
"../event"
;
const
chatResizeKey1
=
"chat-resize-1"
;
const
chatResizeKey2
=
"chat-resize-2"
;
@
Component
({
components
:
{
MessageInput
,
messages
}
})
@
Component
({
components
:
{
MessageInput
,
messages
}
})
export
default
class
ChatRoom
extends
Vue
{
export
default
class
ChatRoom
extends
Vue
{
@
Ref
(
"chatBox"
)
private
readonly
chatBox
!
:
Element
;
@
Ref
(
"chatBox"
)
private
readonly
chatBox
!
:
HTML
Element
;
@
Ref
(
"top"
)
private
readonly
refTop
!
:
Element
;
@
Ref
(
"top"
)
private
readonly
refTop
!
:
HTML
Element
;
@
Ref
(
"bottom"
)
private
readonly
refBottom
!
:
Element
;
@
Ref
(
"bottom"
)
private
readonly
refBottom
!
:
HTML
Element
;
@
Ref
(
"resize"
)
private
readonly
refResize
!
:
Element
;
@
Ref
(
"resize"
)
private
readonly
refResize
!
:
HTML
Element
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
...
@@ -97,9 +100,9 @@
...
@@ -97,9 +100,9 @@
private
dragControllerDiv
(
e
:
MouseEvent
)
{
private
dragControllerDiv
(
e
:
MouseEvent
)
{
const
resize
=
this
.
refResize
as
any
;
const
resize
=
this
.
refResize
as
any
;
const
top
=
this
.
refTop
as
HTMLElement
;
const
top
=
this
.
refTop
;
const
bottom
=
this
.
refBottom
as
HTMLElement
;
const
bottom
=
this
.
refBottom
;
const
box
=
this
.
chatBox
as
HTMLElement
;
const
box
=
this
.
chatBox
;
const
startY
=
e
.
clientY
;
const
startY
=
e
.
clientY
;
const
originTop
=
resize
.
offsetTop
;
const
originTop
=
resize
.
offsetTop
;
...
@@ -115,6 +118,9 @@
...
@@ -115,6 +118,9 @@
resize
.
style
.
top
=
moveLen
+
"px"
;
// 设置左侧区域的宽度
resize
.
style
.
top
=
moveLen
+
"px"
;
// 设置左侧区域的宽度
top
.
style
.
height
=
moveLen
+
"px"
;
top
.
style
.
height
=
moveLen
+
"px"
;
bottom
.
style
.
height
=
bottomHeight
+
"px"
;
bottom
.
style
.
height
=
bottomHeight
+
"px"
;
localStorage
.
setItem
(
chatResizeKey1
,
moveLen
);
localStorage
.
setItem
(
chatResizeKey2
,
bottomHeight
+
""
);
};
};
document
.
onmouseup
=
function
()
{
document
.
onmouseup
=
function
()
{
document
.
onmousemove
=
null
;
document
.
onmousemove
=
null
;
...
@@ -126,9 +132,22 @@
...
@@ -126,9 +132,22 @@
}
}
mounted
()
{
mounted
()
{
this
.
refBottom
&&
if
(
((
this
.
refBottom
as
HTMLElement
).
style
.
height
=
localStorage
.
getItem
(
chatResizeKey1
)
&&
this
.
chatBox
.
clientHeight
-
this
.
refTop
.
clientHeight
+
"px"
);
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
)
{
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