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
80dd862a
authored
Nov 25, 2021
by
seraphim
Browse files
Options
_('Browse Files')
Download
Plain Diff
u
parents
11ecf879
164a8c45
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
9 deletions
components/css/benefits-plan.less
components/message-input.vue
components/who-read-list.vue
hybrid-input/index.vue
service/upload.ts
components/css/benefits-plan.less
View file @
80dd862a
...
@@ -74,8 +74,5 @@
...
@@ -74,8 +74,5 @@
.item-title {
.item-title {
font-weight: bold;
font-weight: bold;
margin-bottom: 10px;
margin-bottom: 10px;
text-decoration: underline;
cursor: pointer;
text-decoration: underline;
}
}
}
}
\ No newline at end of file
components/message-input.vue
View file @
80dd862a
...
@@ -128,7 +128,13 @@
...
@@ -128,7 +128,13 @@
};
};
img
.
remove
();
img
.
remove
();
}
}
return
uploadFile
(
file
)
return
uploadFile
(
file
,
(
p
:
number
)
=>
type
===
MessageType
.
File
&&
this
.
chatInput
&&
this
.
chatInput
.
updateUploadProgress
(
p
)
)
.
then
((
r
)
=>
{
.
then
((
r
)
=>
{
if
(
r
)
{
if
(
r
)
{
const
msg
=
{
const
msg
=
{
...
@@ -160,6 +166,7 @@
...
@@ -160,6 +166,7 @@
console
.
error
(
e
);
console
.
error
(
e
);
this
.
setMsg2Failed
(
index
);
this
.
setMsg2Failed
(
index
);
this
.
chatInput
&&
this
.
chatInput
.
updateUploadProgress
(
0
);
});
});
}
}
}
}
...
...
components/who-read-list.vue
View file @
80dd862a
...
@@ -136,6 +136,9 @@
...
@@ -136,6 +136,9 @@
};
};
})
})
);
);
if
(
!
this
.
readlist
.
length
)
{
this
.
tab
=
2
;
}
this
.
unreadlist
=
await
Promise
.
all
(
this
.
unreadlist
=
await
Promise
.
all
(
readerlist
readerlist
.
filter
((
k
)
=>
!
k
.
is_read
)
.
filter
((
k
)
=>
!
k
.
is_read
)
...
...
hybrid-input/index.vue
View file @
80dd862a
...
@@ -29,6 +29,13 @@
...
@@ -29,6 +29,13 @@
/>
/>
</label>
</label>
<el-progress
:percentage=
"percentage"
:show-text=
"false"
:format=
"formatPercentage"
v-if=
"percentage"
></el-progress>
<input
<input
@
change=
"onChange"
@
change=
"onChange"
:value=
"file"
:value=
"file"
...
@@ -69,7 +76,6 @@
...
@@ -69,7 +76,6 @@
import
{
Component
,
Ref
,
Vue
,
Watch
}
from
"vue-property-decorator"
;
import
{
Component
,
Ref
,
Vue
,
Watch
}
from
"vue-property-decorator"
;
import
{
namespace
}
from
"vuex-class"
;
import
{
namespace
}
from
"vuex-class"
;
import
{
import
{
ERROR_IMAGE
,
getFileType
,
getFileType
,
getSvg
,
getSvg
,
MAX_FILE_SIZE
,
MAX_FILE_SIZE
,
...
@@ -157,6 +163,7 @@
...
@@ -157,6 +163,7 @@
private
tip4File
=
`发送文件(最大
${
MAX_FILE_SIZE_STRING
}
)`
;
private
tip4File
=
`发送文件(最大
${
MAX_FILE_SIZE_STRING
}
)`
;
private
emoji
:
EmojiItem
[]
=
[];
private
emoji
:
EmojiItem
[]
=
[];
private
percentage
=
0
;
@
Watch
(
"chatId"
)
@
Watch
(
"chatId"
)
private
onChatIdChanged
(
v
:
number
,
old
:
number
)
{
private
onChatIdChanged
(
v
:
number
,
old
:
number
)
{
...
@@ -217,7 +224,8 @@
...
@@ -217,7 +224,8 @@
private
allowLoadFile
()
{
private
allowLoadFile
()
{
this
.
acceptType
=
this
.
acceptType
=
limitedFileExtension
.
map
((
i
)
=>
`.
${
i
}
`
).
join
(
","
)
+
",image/*,video/*"
;
limitedFileExtension
.
map
((
i
)
=>
`.
${
i
}
`
).
join
(
","
)
+
",image/*,video/*"
;
}
}
private
async
handlePasteEvent
(
event
:
ClipboardEvent
)
{
private
async
handlePasteEvent
(
event
:
ClipboardEvent
)
{
...
@@ -566,6 +574,17 @@
...
@@ -566,6 +574,17 @@
});
});
});
});
}
}
private
formatPercentage
(
p
:
number
)
{
return
`文件处理中
${
p
}
%`
;
}
public
updateUploadProgress
(
v
:
number
)
{
this
.
percentage
=
v
;
if
(
v
<=
0
||
v
>=
100
)
{
this
.
percentage
=
0
;
}
}
}
}
</
script
>
</
script
>
...
@@ -662,6 +681,14 @@
...
@@ -662,6 +681,14 @@
.offset
{
.offset
{
margin
:
0
22px
;
margin
:
0
22px
;
}
}
.el-progress
{
display
:
inline-block
;
margin-left
:
20px
;
width
:
150px
;
top
:
-4px
;
position
:
relative
;
}
}
}
.emoji-picker
{
.emoji-picker
{
...
...
service/upload.ts
View file @
80dd862a
import
Chat
from
"@/customer-service/xim"
;
import
Chat
from
"@/customer-service/xim"
;
export
async
function
uploadFile
(
file
:
File
)
{
export
async
function
uploadFile
(
file
:
File
,
uploading
?:
(
p
:
number
)
=>
void
)
{
const
sdk
=
Chat
.
getSdk
();
const
sdk
=
Chat
.
getSdk
();
let
{
url
}
=
await
sdk
.
uploadFileV2
(
file
)
const
{
url
}
=
await
sdk
.
uploadFileV2
(
file
,
{
onUploadProgress
:
(
e
)
=>
uploading
(
e
.
percent
),
});
return
`
${
sdk
.
global
.
baseUrl
}${
url
}
`
;
return
`
${
sdk
.
global
.
baseUrl
}${
url
}
`
;
}
}
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