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
146f6c8e
authored
Jan 04, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
fab51b8b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
utils/chat-info.ts
utils/chat-info.ts
View file @
146f6c8e
import
Chat
from
"../xim"
;
import
Chat
from
"../xim"
;
import
{
orderService
}
from
'../service/order'
;
import
{
orderService
}
from
"../service/order"
;
export
type
ChatInfo
=
{
export
type
ChatInfo
=
{
[
eid
:
string
]:
any
;
[
eid
:
string
]:
any
;
...
@@ -10,7 +10,8 @@ const chatInfo: ChatInfo = {};
...
@@ -10,7 +10,8 @@ const chatInfo: ChatInfo = {};
export
const
getChatModel
=
()
=>
chatInfo
;
export
const
getChatModel
=
()
=>
chatInfo
;
const
loadingKeys
=
new
Set
<
string
>
();
const
loadingKeys
=
new
Set
<
string
>
();
let
waitingAction
:
{
key
:
string
;
resolve
:
(
d
:
ChatModelInfoData
)
=>
void
}[]
=
[];
let
waitingAction
:
{
key
:
string
;
resolve
:
(
d
:
ChatModelInfoData
)
=>
void
}[]
=
[];
export
interface
ChatModelInfoData
{
export
interface
ChatModelInfoData
{
uniplatId
:
string
|
number
;
uniplatId
:
string
|
number
;
...
@@ -25,7 +26,10 @@ function buildCache() {
...
@@ -25,7 +26,10 @@ function buildCache() {
if
(
!
model2DetailNameMapping
.
size
)
{
if
(
!
model2DetailNameMapping
.
size
)
{
// 用户端默认不使用chat内置的detailName(这个专属于服务端),所以这里加一层内置转换
// 用户端默认不使用chat内置的detailName(这个专属于服务端),所以这里加一层内置转换
if
(
!
Chat
.
isBackend
())
{
if
(
!
Chat
.
isBackend
())
{
model2DetailNameMapping
.
set
(
orderService
.
generalOrder
,
orderService
.
generalOrderDefaultDetailName
);
model2DetailNameMapping
.
set
(
orderService
.
generalOrder
,
orderService
.
generalOrderDefaultDetailName
);
}
}
}
}
}
}
...
@@ -57,12 +61,6 @@ export async function getChatModelInfo(
...
@@ -57,12 +61,6 @@ export async function getChatModelInfo(
data
:
d
,
data
:
d
,
}
as
ChatModelInfoData
);
}
as
ChatModelInfoData
);
}
}
return
Promise
.
resolve
({
uniplatId
:
0
,
chat_id
:
0
,
uniplat_version
:
0
,
data
:
d
,
});
}
}
loadingKeys
.
add
(
key
);
loadingKeys
.
add
(
key
);
...
@@ -71,7 +69,7 @@ export async function getChatModelInfo(
...
@@ -71,7 +69,7 @@ export async function getChatModelInfo(
.
detail
(
id
+
""
,
detail
)
.
detail
(
id
+
""
,
detail
)
.
query
();
.
query
();
const
data
=
info
;
const
data
=
info
;
chatInfo
[
key
]
=
data
;
info
&&
info
.
row
.
UniplatChatId
&&
(
chatInfo
[
key
]
=
data
)
;
loadingKeys
.
delete
(
key
);
loadingKeys
.
delete
(
key
);
const
o
=
(
const
o
=
(
...
...
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