Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄媛媛
ElectricitySheep
Commits
240d2544
Commit
240d2544
authored
Jan 04, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
71db10ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
3 deletions
+126
-3
UE2.vue
src/components/global/UE2.vue
+123
-0
image-text.vue
src/components/sallCenter/plugin/image-text.vue
+3
-3
No files found.
src/components/global/UE2.vue
0 → 100644
View file @
240d2544
<
template
>
<div>
<textarea
type=
"text/plain"
:id=
"id"
></textarea>
<!-- 选择图片 -->
<el-dialog
title=
"选择文件"
:visible
.
sync=
"changeState"
width=
"1240px"
>
<ChooseImg
@
SelectId=
"SelectId"
:IsMultiple=
"IsMultiple"
></ChooseImg>
</el-dialog>
</div>
</
template
>
<
script
>
import
ChooseImg
from
"@/components/global/ChooseImg.vue"
;
export
default
{
components
:
{
ChooseImg
},
name
:
'UE'
,
data
()
{
return
{
id
:
'editor'
+
(
Math
.
floor
((
Math
.
random
()
*
10000
)
+
1
)),
editor
:
null
,
changeState
:
false
,
isInputChange
:
false
,
tempContent
:
this
.
defaultMsg
}
},
props
:
{
defaultMsg
:
{
type
:
String
},
config
:
{
type
:
Object
},
//是否多选
IsMultiple
:
{
type
:
Boolean
}
},
mounted
()
{
this
.
loadUe
();
},
watch
:
{
defaultMsg
(
newVal
,
oldVal
)
{
if
(
!
this
.
isInputChange
&&
newVal
)
{
if
(
this
.
editor
&&
this
.
editor
.
isReady
===
1
)
{
this
.
editor
.
setContent
(
newVal
);
}
else
{
this
.
tempContent
=
newVal
;
}
}
if
(
this
.
isInputChange
)
{
this
.
isInputChange
=
false
;
}
},
},
methods
:
{
InitData
()
{
},
SelectId
(
resultMsg
)
{
if
(
resultMsg
)
{
let
html
=
''
;
this
.
ue
=
UE
.
getEditor
(
this
.
id
);
if
(
this
.
IsMultiple
)
{
if
(
resultMsg
.
length
>
0
)
{
resultMsg
.
forEach
(
item
=>
{
html
+=
'<img src="'
+
this
.
getIconLink
(
item
.
url
)
+
'" style="max-width: 100%;" />'
;
})
}
}
else
{
html
=
'<img src="'
+
this
.
getIconLink
(
resultMsg
.
url
)
+
'" style="max-width: 100%;" />'
;
}
this
.
ue
.
execCommand
(
'inserthtml'
,
html
);
}
this
.
changeState
=
false
;
},
getUEContent
()
{
// 获取内容方法
if
(
this
.
editor
)
{
return
this
.
editor
.
getContent
();
}
return
""
;
},
loadUe
()
{
const
_this
=
this
;
UE
.
registerUI
(
'appinsertimage'
,
(
editor
,
uiName
)
=>
{
return
new
UE
.
ui
.
Button
({
name
:
uiName
,
title
:
'插入图片'
,
//添加额外样式,指定icon图标,这里默认使用一个重复的icon
cssRules
:
'background-position: -381px 0px;'
,
onclick
()
{
self
.
editor
=
editor
;
_this
.
changeState
=
true
;
},
});
});
this
.
editor
=
UE
.
getEditor
(
this
.
id
,
this
.
config
);
// 初始化UE
let
self
=
this
;
this
.
editor
.
addListener
(
"ready"
,
function
()
{
_this
.
editor
.
setContent
(
_this
.
defaultMsg
);
// 确保UE加载完成后,放入内容。
});
this
.
editor
.
addListener
(
'ready'
,
editor
=>
{
if
(
_this
.
tempContent
)
{
_this
.
editor
.
setContent
(
_this
.
tempContent
);
}
});
this
.
editor
.
addListener
(
'keyup'
,
editor
=>
{
this
.
isInputChange
=
true
;
_this
.
$emit
(
'input'
,
_this
.
editor
.
getContent
());
});
this
.
editor
.
addListener
(
'contentChange'
,
editor
=>
{
this
.
isInputChange
=
true
;
_this
.
$emit
(
'input'
,
_this
.
editor
.
getContent
());
});
}
},
destroyed
()
{
this
.
editor
.
destroy
();
},
}
</
script
>
src/components/sallCenter/plugin/image-text.vue
View file @
240d2544
...
@@ -33,17 +33,17 @@
...
@@ -33,17 +33,17 @@
</div>
</div>
</div>
</div>
<div
class=
"diy-component-edit imgVisible"
:class=
"
{'visibleA':imageData.isCked}">
<div
class=
"diy-component-edit imgVisible"
:class=
"
{'visibleA':imageData.isCked}">
<UE
v-model=
"data.content"
:defaultMsg=
"data.content"
:config=
"config"
ref=
"ue"
:IsMultiple=
"true"
></UE
>
<UE
2
v-model=
"data.content"
:defaultMsg=
"data.content"
:config=
"config"
ref=
"ue"
:IsMultiple=
"true"
></UE2
>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
UE
from
'@/components/global/UE
.vue'
import
UE
2
from
'@/components/global/UE2
.vue'
export
default
{
export
default
{
props
:
[
"imageData"
,
"index"
,
"dataLeng"
],
props
:
[
"imageData"
,
"index"
,
"dataLeng"
],
components
:
{
components
:
{
UE
UE
2
},
},
data
()
{
data
()
{
return
{
return
{
...
...
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