This commit is contained in:
2024-06-03 15:22:11 +08:00
parent 19df1462c1
commit 0b94a32337
8 changed files with 42 additions and 10 deletions

View File

@ -6,4 +6,13 @@ export function labelFieldList(fieldType) {
url: `/manage/labelfieldinfo/labelFieldList?fieldType=${fieldType}`,
method: 'get',
})
}
//上传图片
export function richTextPictureUrl(data) {
return request({
url: `/common/richTextPictureUrl`,
method: 'post',
data
})
}

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left"
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
:style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName : '选择短信模板'
}}</el-button>
<el-dialog title="短信库模板选择" :visible.sync="classificationOpen" width="70%" :before-close="classificationOpenfalse">

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left"
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
:style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择公众号模板' }}</el-button>
<el-dialog title="公众号模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,7 @@
<template>
<div class="app-container">
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left"
<el-button size="small" @click="classificationOpen = true"
style="width: 200px;font-size:14px;text-align:left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
:style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择公众号模板' }}</el-button>
<el-dialog title="公众号模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left"
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
:style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择宣教模板' }}</el-button>
<el-dialog title="宣教库模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left"
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
:style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择问卷模板' }}</el-button>
<el-dialog title="问卷库模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left"
<el-button size="small" @click="classificationOpen = true" style="width: 200px;font-size:14px;text-align:left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"
:style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'请选择'
}}</el-button>

View File

@ -34,7 +34,8 @@ import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { Boot } from '@wangeditor/editor'
import { h, VNode } from 'snabbdom'
import {
labelFieldList
labelFieldList,
richTextPictureUrl
} from '@/api/system/wangEditor.js'
// import menuConf from "./ModalMenu";
import { getToken } from "@/utils/auth";
@ -63,7 +64,10 @@ export default ({
'codeBlock',
'todo',
'insertVideo',
'insertImage'
'insertImage',
"emotion",
"divider",
"insertTable",
],
},
editorConfig: {
@ -81,9 +85,12 @@ export default ({
}
},
},
uploadVideo: { //
customUpload: this.handleUpload
},
},
},
mode: 'simple', // or 'simple'
mode: 'default', // or 'simple'
timer: '',
html: `<p></p>`,
addnode: {
@ -95,6 +102,22 @@ export default ({
}
},
methods: {
async handleUpload(file, insertFn) {
let form = new FormData();
form.append('file', file);
let res = await this.uploadFile(form); //id
console.log(res)
const videoUrl = URL.createObjectURL(file);
// this.content += '<video poster=\"\" controls=\"true\" width=\"auto\" height=\"auto\"><source src=\"'+ res +'\" type=\"video/mp4\"/></video>'
// resurl
this.html += '<video poster=\"\" controls=\"true\" width=\"auto\" height=\"auto\"><source src=\"' + process.env.VUE_APP_BASE_API + res.fileName + '\" type=\"video/mp4\"/></video>'
// 使
},
async uploadFile(form) {
let res = await richTextPictureUrl(form); //
console.log(res)
return res
},
emit() {
this.$emit("on-nodeContent", { nodeContent: this.html });
},
@ -212,7 +235,6 @@ export default ({
},
watch: {
nodeContent(newValue, oldValue) {
console.log(newValue, oldValue)
this.html = newValue;
}
},