Commit c75bfa8c authored by chenfenglei's avatar chenfenglei

富文本

parent 0beab470
......@@ -124,7 +124,7 @@
<el-row v-if="searchFrom.type === 4">
<el-col :span="16">
<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-col>
</el-row>
......@@ -611,7 +611,13 @@ export default {
if(!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+"),";
}
if (this.searchFrom.user_ids) {
......
......@@ -2,9 +2,8 @@
<el-dialog
:title="dialogObj.title"
center
append-to-body
:visible.sync="dialogObj.show"
width="800px">
width="70%">
<div v-loading="loading">
<el-form ref="form" :model="form" label-width="100px" :disabled="dialogObj.type === 2">
<el-row>
......@@ -247,7 +246,7 @@
<el-col :span="24">
<el-form-item label="商品详情">
<!-- <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-col>
</el-row>
......@@ -255,7 +254,7 @@
<el-col :span="24">
<el-form-item label="购买须知">
<!-- <el-input type="textarea" :rows="25" v-model="form.desc.qa"></el-input> -->
<edi />
<editor-know :lookData1="form.desc.qa"/>
</el-form-item>
</el-col>
</el-row>
......@@ -272,16 +271,16 @@
<script>
import {getLessonApi,addGoodsApi,editGoodsApi,getGoodsDetailApi,uploadFileApi,getGoodsListApi} from "../../service/api";
import {TEACHERTYPE,GOODSTYPE} from "../../util/wordbook";
import editor from "./editor"
import edi from "./edi"
import editorDetail from "./editorDetail"
import editorKnow from "./editorKnow"
export default {
name: "dialogObj",
props:[
'dialogObj',
],
components: { // 引入组件
editor,
edi
editorDetail,
editorKnow
},
filters: {
filterGoods(val){
......@@ -290,9 +289,6 @@
},
data(){
return{
msg:{
a:""
},
tiny:{
height:300
},
......@@ -341,10 +337,8 @@
},
methods:{
sub(){
console.log(tinymce.get('tinymce').getContent())
this.form.desc.detail=tinymce.get('tinymce').getContent()
this.form.desc.qa=tinymce.get('tinymce1').getContent()
console.log(tinymce.get('tinymce1').getContent())
let _json = JSON.parse(JSON.stringify(this.form)+'');
if(_json.goods_type === 3 || _json.goods_type === 4 ){
_json.course_id=0;
......@@ -389,6 +383,8 @@
// });
break
}
tinymce.get('tinymce').getContent("")
tinymce.get('tinymce1').getContent("")
},
removeFileMain(a){
let x = this.form.goods_desc.img.findIndex(i=>{return i.name === a.name});
......@@ -633,6 +629,8 @@
},
deep: true
},
"dialogObj.show":function(a){
},
show(value){
this.$emit("changeShow",value);
}
......
<template>
<div class='tinymce'>
{{lookData.a}}
<editor id='tinymce' v-model='lookData.a' :init='init'></editor>
<editor id='tinymce' v-model='lookData' :init='init'></editor>
<div>
<div class="imgInter" @click="showDialog()">插入图片</div>
</div>
......
<template>
<div class='tinymce1'>
<div class='tinymce'>
<editor id='tinymce1' v-model='lookData1' :init='init'></editor>
<div>
<!-- <div class="imgInter" @click="showDialog1()">插入图片</div> -->
<div class="imgInter" @click="showDialog1()">插入图片</div>
</div>
<el-dialog
title="插入图片"
......@@ -42,7 +42,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false">取 消</el-button>
<el-button type="primary" @click="imgInter">确 定</el-button>
<el-button type="primary" @click="imgInter1">确 定</el-button>
</span>
</el-dialog>
</div>
......@@ -116,7 +116,7 @@
}
return isJPG && isLt2M;
},
imgInter(){
imgInter1(){
if(this.form.imgList1.length < 1){
this.$message({
type: 'error',
......@@ -164,7 +164,8 @@
sel = document.selection;
sel.createRange().pasteHTML(content);
} else {
sel = document.getElementById('tinymce_ifr').contentWindow.getSelection();
sel = document.getElementById('tinymce1_ifr').contentWindow.getSelection();
// console.log(sel)
if (sel.rangeCount > 0) {
let range = sel.getRangeAt(0); //获取选择范围
range.deleteContents(); //删除选中的内容
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment