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
999659ed
authored
Jan 05, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into pre
parents
3d272f5e
b8911ba3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
1 deletions
components/chat-room.vue
database/dev-tools.ts
components/chat-room.vue
View file @
999659ed
<
template
>
<
template
>
<div
class=
"chat-room-con
h-100
pos-rel"
>
<div
class=
"chat-room-con pos-rel"
>
<div
class=
"chat-panel"
>
<div
class=
"chat-panel"
>
<div
class=
"chat-area h-100 d-flex flex-column"
ref=
"chatBox"
>
<div
class=
"chat-area h-100 d-flex flex-column"
ref=
"chatBox"
>
<div
<div
...
...
database/dev-tools.ts
View file @
999659ed
...
@@ -79,6 +79,61 @@ class DevAppTools {
...
@@ -79,6 +79,61 @@ class DevAppTools {
});
});
});
});
}
}
public
getDataByKey
(
key
:
string
)
{
return
new
Promise
<
any
>
((
resolve
)
=>
{
this
.
onReady
().
finally
(()
=>
{
if
(
!
this
.
db
)
{
return
resolve
(
false
);
}
setTimeout
(()
=>
{
const
store
=
this
.
buildStore
(
this
.
table
);
const
r
=
store
.
get
(
key
);
r
.
onsuccess
=
((
o
)
=>
{
const
result
=
(
o
.
target
as
any
).
result
;
if
(
result
)
{
resolve
(
result
.
content
)
}
else
{
resolve
(
result
)
}
});
r
.
onerror
=
()
=>
resolve
(
false
);
},
300
);
});
});
}
public
addData
(
data
:
any
,
key
:
string
)
{
return
new
Promise
<
boolean
>
((
resolve
)
=>
{
this
.
onReady
().
finally
(()
=>
{
if
(
!
this
.
db
)
{
return
resolve
(
false
);
}
setTimeout
(()
=>
{
const
store
=
this
.
buildStore
(
this
.
table
);
const
r
=
store
.
add
({
value
:
key
,
content
:
data
});
r
.
onsuccess
=
()
=>
resolve
(
true
);
r
.
onerror
=
()
=>
resolve
(
false
);
},
300
);
});
});
}
public
deleteData
(
key
:
string
)
{
return
new
Promise
<
boolean
>
((
resolve
)
=>
{
this
.
onReady
().
finally
(()
=>
{
if
(
!
this
.
db
)
{
return
resolve
(
false
);
}
setTimeout
(()
=>
{
const
store
=
this
.
buildStore
(
this
.
table
);
const
r
=
store
.
delete
(
key
);
r
.
onsuccess
=
()
=>
resolve
(
true
);
r
.
onerror
=
()
=>
resolve
(
false
);
},
300
);
});
});
}
}
}
export
const
devAppTools
=
new
DevAppTools
();
export
const
devAppTools
=
new
DevAppTools
();
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