Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
c75bfa8c
Commit
c75bfa8c
authored
Dec 13, 2018
by
chenfenglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
富文本
parent
0beab470
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
23 deletions
+27
-23
index.vue
src/components/groupSend/index.vue
+8
-2
dialog.vue
src/components/shop/dialog.vue
+11
-13
editorDetail.vue
src/components/shop/editorDetail.vue
+1
-2
editorKnow.vue
src/components/shop/editorKnow.vue
+7
-6
No files found.
src/components/groupSend/index.vue
View file @
c75bfa8c
...
@@ -124,7 +124,7 @@
...
@@ -124,7 +124,7 @@
<el-row
v-if=
"searchFrom.type === 4"
>
<el-row
v-if=
"searchFrom.type === 4"
>
<el-col
:span=
"16"
>
<el-col
:span=
"16"
>
<el-form-item
label=
"用户手机号"
>
<el-form-item
label=
"用户手机号"
>
<el-input
v-model=
"searchFrom.mobiles"
placeholder=
"提示:多个手机号逗号隔开"
></el-input>
<el-input
v-model=
"searchFrom.mobiles"
placeholder=
"提示:多个手机号逗号隔开"
type=
"textarea"
></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -611,7 +611,13 @@ export default {
...
@@ -611,7 +611,13 @@ export default {
if
(
!
this
.
searchFrom
.
mobiles
){
if
(
!
this
.
searchFrom
.
mobiles
){
this
.
searchFrom
.
mobiles
=
""
;
this
.
searchFrom
.
mobiles
=
""
;
}
}
json
.
mobiles
=
this
.
searchFrom
.
mobiles
;
var
str
=
this
.
searchFrom
.
mobiles
//去掉空格
str
=
str
.
replace
(
/
\
+/g
,
""
);
//去掉回车换行
str
=
str
.
replace
(
/
[\r\n]
/g
,
""
);
json
.
mobiles
=
str
;
msgTips
+=
"指定手机号用户("
+
json
.
mobiles
+
"),"
;
msgTips
+=
"指定手机号用户("
+
json
.
mobiles
+
"),"
;
}
}
if
(
this
.
searchFrom
.
user_ids
)
{
if
(
this
.
searchFrom
.
user_ids
)
{
...
...
src/components/shop/dialog.vue
View file @
c75bfa8c
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
<el-dialog
<el-dialog
:title=
"dialogObj.title"
:title=
"dialogObj.title"
center
center
append-to-body
:visible
.
sync=
"dialogObj.show"
:visible
.
sync=
"dialogObj.show"
width=
"
800px
"
>
width=
"
70%
"
>
<div
v-loading=
"loading"
>
<div
v-loading=
"loading"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"100px"
:disabled=
"dialogObj.type === 2"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"100px"
:disabled=
"dialogObj.type === 2"
>
<el-row>
<el-row>
...
@@ -247,7 +246,7 @@
...
@@ -247,7 +246,7 @@
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"商品详情"
>
<el-form-item
label=
"商品详情"
>
<!--
<el-input
type=
"textarea"
:rows=
"25"
v-model=
"form.desc.detail"
></el-input>
-->
<!--
<el-input
type=
"textarea"
:rows=
"25"
v-model=
"form.desc.detail"
></el-input>
-->
<editor
:lookData=
"msg"
/>
<editor
-detail
:lookData=
"form.desc.detail"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -255,7 +254,7 @@
...
@@ -255,7 +254,7 @@
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"购买须知"
>
<el-form-item
label=
"购买须知"
>
<!--
<el-input
type=
"textarea"
:rows=
"25"
v-model=
"form.desc.qa"
></el-input>
-->
<!--
<el-input
type=
"textarea"
:rows=
"25"
v-model=
"form.desc.qa"
></el-input>
-->
<edi
/>
<edi
tor-know
:lookData1=
"form.desc.qa"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -272,16 +271,16 @@
...
@@ -272,16 +271,16 @@
<
script
>
<
script
>
import
{
getLessonApi
,
addGoodsApi
,
editGoodsApi
,
getGoodsDetailApi
,
uploadFileApi
,
getGoodsListApi
}
from
"../../service/api"
;
import
{
getLessonApi
,
addGoodsApi
,
editGoodsApi
,
getGoodsDetailApi
,
uploadFileApi
,
getGoodsListApi
}
from
"../../service/api"
;
import
{
TEACHERTYPE
,
GOODSTYPE
}
from
"../../util/wordbook"
;
import
{
TEACHERTYPE
,
GOODSTYPE
}
from
"../../util/wordbook"
;
import
editor
from
"./editor
"
import
editor
Detail
from
"./editorDetail
"
import
edi
from
"./edi
"
import
edi
torKnow
from
"./editorKnow
"
export
default
{
export
default
{
name
:
"dialogObj"
,
name
:
"dialogObj"
,
props
:[
props
:[
'dialogObj'
,
'dialogObj'
,
],
],
components
:
{
// 引入组件
components
:
{
// 引入组件
editor
,
editor
Detail
,
edi
edi
torKnow
},
},
filters
:
{
filters
:
{
filterGoods
(
val
){
filterGoods
(
val
){
...
@@ -290,9 +289,6 @@
...
@@ -290,9 +289,6 @@
},
},
data
(){
data
(){
return
{
return
{
msg
:{
a
:
""
},
tiny
:{
tiny
:{
height
:
300
height
:
300
},
},
...
@@ -341,10 +337,8 @@
...
@@ -341,10 +337,8 @@
},
},
methods
:{
methods
:{
sub
(){
sub
(){
console
.
log
(
tinymce
.
get
(
'tinymce'
).
getContent
())
this
.
form
.
desc
.
detail
=
tinymce
.
get
(
'tinymce'
).
getContent
()
this
.
form
.
desc
.
detail
=
tinymce
.
get
(
'tinymce'
).
getContent
()
this
.
form
.
desc
.
qa
=
tinymce
.
get
(
'tinymce1'
).
getContent
()
this
.
form
.
desc
.
qa
=
tinymce
.
get
(
'tinymce1'
).
getContent
()
console
.
log
(
tinymce
.
get
(
'tinymce1'
).
getContent
())
let
_json
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
)
+
''
);
let
_json
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
)
+
''
);
if
(
_json
.
goods_type
===
3
||
_json
.
goods_type
===
4
){
if
(
_json
.
goods_type
===
3
||
_json
.
goods_type
===
4
){
_json
.
course_id
=
0
;
_json
.
course_id
=
0
;
...
@@ -389,6 +383,8 @@
...
@@ -389,6 +383,8 @@
// });
// });
break
break
}
}
tinymce
.
get
(
'tinymce'
).
getContent
(
""
)
tinymce
.
get
(
'tinymce1'
).
getContent
(
""
)
},
},
removeFileMain
(
a
){
removeFileMain
(
a
){
let
x
=
this
.
form
.
goods_desc
.
img
.
findIndex
(
i
=>
{
return
i
.
name
===
a
.
name
});
let
x
=
this
.
form
.
goods_desc
.
img
.
findIndex
(
i
=>
{
return
i
.
name
===
a
.
name
});
...
@@ -633,6 +629,8 @@
...
@@ -633,6 +629,8 @@
},
},
deep
:
true
deep
:
true
},
},
"dialogObj.show"
:
function
(
a
){
},
show
(
value
){
show
(
value
){
this
.
$emit
(
"changeShow"
,
value
);
this
.
$emit
(
"changeShow"
,
value
);
}
}
...
...
src/components/shop/editor.vue
→
src/components/shop/editor
Detail
.vue
View file @
c75bfa8c
<
template
>
<
template
>
<div
class=
'tinymce'
>
<div
class=
'tinymce'
>
{{
lookData
.
a
}}
<editor
id=
'tinymce'
v-model=
'lookData'
:init=
'init'
></editor>
<editor
id=
'tinymce'
v-model=
'lookData.a'
:init=
'init'
></editor>
<div>
<div>
<div
class=
"imgInter"
@
click=
"showDialog()"
>
插入图片
</div>
<div
class=
"imgInter"
@
click=
"showDialog()"
>
插入图片
</div>
</div>
</div>
...
...
src/components/shop/edi.vue
→
src/components/shop/edi
torKnow
.vue
View file @
c75bfa8c
<
template
>
<
template
>
<div
class=
'tinymce
1
'
>
<div
class=
'tinymce'
>
<editor
id=
'tinymce1'
v-model=
'lookData1'
:init=
'init'
></editor>
<editor
id=
'tinymce1'
v-model=
'lookData1'
:init=
'init'
></editor>
<div>
<div>
<
!--
<div
class=
"imgInter"
@
click=
"showDialog1()"
>
插入图片
</div>
--
>
<
div
class=
"imgInter"
@
click=
"showDialog1()"
>
插入图片
</div
>
</div>
</div>
<el-dialog
<el-dialog
title=
"插入图片"
title=
"插入图片"
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</el-form>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible1 = false"
>
取 消
</el-button>
<el-button
@
click=
"dialogVisible1 = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"imgInter"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"imgInter
1
"
>
确 定
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
</div>
</div>
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
}
}
return
isJPG
&&
isLt2M
;
return
isJPG
&&
isLt2M
;
},
},
imgInter
(){
imgInter
1
(){
if
(
this
.
form
.
imgList1
.
length
<
1
){
if
(
this
.
form
.
imgList1
.
length
<
1
){
this
.
$message
({
this
.
$message
({
type
:
'error'
,
type
:
'error'
,
...
@@ -164,14 +164,15 @@
...
@@ -164,14 +164,15 @@
sel
=
document
.
selection
;
sel
=
document
.
selection
;
sel
.
createRange
().
pasteHTML
(
content
);
sel
.
createRange
().
pasteHTML
(
content
);
}
else
{
}
else
{
sel
=
document
.
getElementById
(
'tinymce_ifr'
).
contentWindow
.
getSelection
();
sel
=
document
.
getElementById
(
'tinymce1_ifr'
).
contentWindow
.
getSelection
();
// console.log(sel)
if
(
sel
.
rangeCount
>
0
)
{
if
(
sel
.
rangeCount
>
0
)
{
let
range
=
sel
.
getRangeAt
(
0
);
//获取选择范围
let
range
=
sel
.
getRangeAt
(
0
);
//获取选择范围
range
.
deleteContents
();
//删除选中的内容
range
.
deleteContents
();
//删除选中的内容
let
el
=
document
.
createElement
(
"div"
);
//创建一个空的div外壳
let
el
=
document
.
createElement
(
"div"
);
//创建一个空的div外壳
el
.
innerHTML
=
content
;
//设置div内容为我们想要插入的内容。
el
.
innerHTML
=
content
;
//设置div内容为我们想要插入的内容。
let
frag
=
document
.
createDocumentFragment
();
//创建一个空白的文档片段,便于之后插入dom树
let
frag
=
document
.
createDocumentFragment
();
//创建一个空白的文档片段,便于之后插入dom树
let
node
=
el
.
firstChild
;
let
node
=
el
.
firstChild
;
let
lastNode
=
frag
.
appendChild
(
node
);
let
lastNode
=
frag
.
appendChild
(
node
);
range
.
insertNode
(
frag
);
//设置选择范围的内容为插入的内容
range
.
insertNode
(
frag
);
//设置选择范围的内容为插入的内容
...
...
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