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}`, url: `/manage/labelfieldinfo/labelFieldList?fieldType=${fieldType}`,
method: 'get', method: 'get',
}) })
}
//上传图片
export function richTextPictureUrl(data) {
return request({
url: `/common/richTextPictureUrl`,
method: 'post',
data
})
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <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 : '选择短信模板' :style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName : '选择短信模板'
}}</el-button> }}</el-button>
<el-dialog title="短信库模板选择" :visible.sync="classificationOpen" width="70%" :before-close="classificationOpenfalse"> <el-dialog title="短信库模板选择" :visible.sync="classificationOpen" width="70%" :before-close="classificationOpenfalse">

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <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 : :style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择公众号模板' }}</el-button> '选择公众号模板' }}</el-button>
<el-dialog title="公众号模板选择" :visible.sync="classificationOpen" width="70%" <el-dialog title="公众号模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,7 @@
<template> <template>
<div class="app-container"> <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 : :style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择公众号模板' }}</el-button> '选择公众号模板' }}</el-button>
<el-dialog title="公众号模板选择" :visible.sync="classificationOpen" width="70%" <el-dialog title="公众号模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <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 : :style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择宣教模板' }}</el-button> '选择宣教模板' }}</el-button>
<el-dialog title="宣教库模板选择" :visible.sync="classificationOpen" width="70%" <el-dialog title="宣教库模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <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 : :style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'选择问卷模板' }}</el-button> '选择问卷模板' }}</el-button>
<el-dialog title="问卷库模板选择" :visible.sync="classificationOpen" width="70%" <el-dialog title="问卷库模板选择" :visible.sync="classificationOpen" width="70%"

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <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 : :style="handleselectName ? 'color:black' : 'color:#C0C4CC'">{{ handleselectName ? handleselectName :
'请选择' '请选择'
}}</el-button> }}</el-button>

View File

@ -34,7 +34,8 @@ import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { Boot } from '@wangeditor/editor' import { Boot } from '@wangeditor/editor'
import { h, VNode } from 'snabbdom' import { h, VNode } from 'snabbdom'
import { import {
labelFieldList labelFieldList,
richTextPictureUrl
} from '@/api/system/wangEditor.js' } from '@/api/system/wangEditor.js'
// import menuConf from "./ModalMenu"; // import menuConf from "./ModalMenu";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
@ -63,7 +64,10 @@ export default ({
'codeBlock', 'codeBlock',
'todo', 'todo',
'insertVideo', 'insertVideo',
'insertImage' 'insertImage',
"emotion",
"divider",
"insertTable",
], ],
}, },
editorConfig: { editorConfig: {
@ -81,9 +85,12 @@ export default ({
} }
}, },
}, },
uploadVideo: { //
customUpload: this.handleUpload
},
}, },
}, },
mode: 'simple', // or 'simple' mode: 'default', // or 'simple'
timer: '', timer: '',
html: `<p></p>`, html: `<p></p>`,
addnode: { addnode: {
@ -95,6 +102,22 @@ export default ({
} }
}, },
methods: { 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() { emit() {
this.$emit("on-nodeContent", { nodeContent: this.html }); this.$emit("on-nodeContent", { nodeContent: this.html });
}, },
@ -212,7 +235,6 @@ export default ({
}, },
watch: { watch: {
nodeContent(newValue, oldValue) { nodeContent(newValue, oldValue) {
console.log(newValue, oldValue)
this.html = newValue; this.html = newValue;
} }
}, },