Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-task
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 931751ba
authored
Oct 25, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修复
1 parent
4065af51
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
src/components/GLEditor/index.vue
src/components/GLEditor/index.vue
View file @
931751b
...
@@ -389,12 +389,12 @@ export default {
...
@@ -389,12 +389,12 @@ export default {
// })
// })
console
.
log
(
this
.
previewList
)
console
.
log
(
this
.
previewList
)
if
(
this
.
previewList
.
length
)
{
if
(
this
.
previewList
.
length
)
{
this
.
updateList
(
this
.
previewList
,
1
)
//
this.updateList(this.previewList, 1)
//
this.previewList.map((item) => {
this
.
previewList
.
map
((
item
)
=>
{
//
if (item.materialType == ATT_TYPE.TEXT) {
if
(
item
.
materialType
==
ATT_TYPE
.
TEXT
)
{
// // this.textValue = item.materialContent
this
.
textValue
=
this
.
changeText
(
item
.
materialContent
)
//
}
}
//
})
})
}
}
},
},
computed
:
{
computed
:
{
...
@@ -485,6 +485,24 @@ export default {
...
@@ -485,6 +485,24 @@ export default {
)
)
})
})
},
},
// 表情转换
changeText
(
val
)
{
let
htm
=
val
.
replace
(
/
\[([\u
4E00-
\u
9FA56
]{1,4}
|OK|NO|666
)
]/gi
,
function
(
res
)
{
let
word
=
res
.
replace
(
/
\[
|
\]
/gi
,
''
)
const
list
=
emoji
.
flat
(
Infinity
)
let
index
=
parseInt
(
list
.
indexOf
(
word
))
+
1
if
(
index
<
10
)
{
index
=
'00'
+
index
}
else
if
(
index
>=
10
&&
index
<
100
)
{
index
=
'0'
+
index
}
return
`<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/
${
index
}
.png">`
}
)
return
htm
},
// 上传图片
// 上传图片
handleImgChange
(
e
)
{
handleImgChange
(
e
)
{
let
imgFlag
=
false
let
imgFlag
=
false
...
@@ -870,6 +888,7 @@ export default {
...
@@ -870,6 +888,7 @@ export default {
this
.
previewList
=
utils
.
deepClone
(
val
)
this
.
previewList
=
utils
.
deepClone
(
val
)
const
obj
=
val
.
find
((
item
)
=>
item
.
materialType
==
this
.
ATT_TYPE
.
TEXT
)
const
obj
=
val
.
find
((
item
)
=>
item
.
materialType
==
this
.
ATT_TYPE
.
TEXT
)
if
(
obj
)
{
if
(
obj
)
{
console
.
log
(
obj
,
'obj'
)
let
materialContent
let
materialContent
if
(
status
)
{
if
(
status
)
{
materialContent
=
obj
.
materialContent
.
replace
(
materialContent
=
obj
.
materialContent
.
replace
(
...
@@ -910,6 +929,7 @@ export default {
...
@@ -910,6 +929,7 @@ export default {
document
.
querySelector
(
'.w-textarea_input'
).
innerHTML
=
htm
document
.
querySelector
(
'.w-textarea_input'
).
innerHTML
=
htm
},
100
)
},
100
)
}
else
{
}
else
{
console
.
log
(
343434343333
)
this
.
textValue
=
''
this
.
textValue
=
''
}
}
},
},
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment