提交
This commit is contained in:
@@ -0,0 +1,481 @@
|
||||
<template>
|
||||
|
||||
|
||||
<div>
|
||||
<el-tabs tab-position="top" v-model="activeName" v-loading="loading">
|
||||
<el-tab-pane label="申请信息" name="1">
|
||||
<table style="width: 100%">
|
||||
|
||||
<tr style="border: 1px solid rgb(220,220,220);">
|
||||
<td class="tpa">姓名</td>
|
||||
<td class="tpb">{{ viewData.username }}</td>
|
||||
<td class="tpa">工号</td>
|
||||
<td class="tpb">{{ viewData.loginname }}</td>
|
||||
</tr>
|
||||
<tr style="border: 1px solid rgb(220,220,220);">
|
||||
<td class="tpa">单位</td>
|
||||
<td class="tpb">{{ viewData.dwname }}</td>
|
||||
<td class="tpa">工会</td>
|
||||
<td class="tpb">{{ viewData.ghname }}</td>
|
||||
</tr>
|
||||
<tr style="border: 1px solid rgb(220,220,220);">
|
||||
<td class="tpa">活动类别</td>
|
||||
<td class="tpb">
|
||||
<span>{{ viewData.hdlbname }}</span>
|
||||
</td>
|
||||
<template v-if="viewData.zplbname">
|
||||
<td class="tpa">类别</td>
|
||||
<td class="tpb">
|
||||
<span>{{ viewData.zplbname }}</span>
|
||||
</td>
|
||||
</template>
|
||||
<template v-else>
|
||||
<td class="tpa">健步走步数</td>
|
||||
<td class="tpb">
|
||||
<span>{{ viewData.step_count }}</span>
|
||||
</td>
|
||||
</template>
|
||||
</tr>
|
||||
<!-- <tr style="border: 1px solid rgb(220,220,220);">
|
||||
<td class="tpa">作品主题</td>
|
||||
<td class="tpb" colspan="3">{{viewData.hdsbzpzt}}</td>
|
||||
</tr>-->
|
||||
<tr style="border: 1px solid rgb(220,220,220);">
|
||||
<td class="tpa">标题</td>
|
||||
<td class="tpb" colspan="3">{{ viewData.zpmc }}</td>
|
||||
</tr>
|
||||
<tr style="border: 1px solid rgb(220,220,220);">
|
||||
<td class="tpa">创作说明</td>
|
||||
<td class="tpb" colspan="3">{{ viewData.hdsbzpms }}</td>
|
||||
</tr>
|
||||
<tr style="border: 1px solid rgb(220,220,220);" v-if="viewData.isUploadPhoto||viewData.isUploadOther">
|
||||
<td class="tpa">作品信息</td>
|
||||
<td class="tpb" colspan="3">
|
||||
<el-row v-if="viewData.isUploadPhoto">
|
||||
<el-divider>照片 <i class="el-icon-picture-outline"></i></el-divider>
|
||||
<file-upload view :files="img2List"></file-upload>
|
||||
</el-row>
|
||||
<!-- <div v-if="viewData.isUploadOther">
|
||||
<el-row>
|
||||
<el-divider>视频 <i class="el-icon-video-camera"></i></el-divider>
|
||||
<div style="text-align: left;" v-if="videoList.length>0">
|
||||
<div v-for="item in videoList">
|
||||
<el-tooltip class="item" effect="dark" placement="right-start">
|
||||
<div slot="content">{{ item.fjname }}</div>
|
||||
<div class="view-myvideo-tab">
|
||||
<div class="video-toggle-i"
|
||||
@click="playVideo1(APP_DOMAIN + '/file_server/fileStreamPreview?id=' + item.id)">
|
||||
<i class="el-icon-video-camera-solid"></i>
|
||||
<i class="el-icon-video-play"></i>
|
||||
</div>
|
||||
|
||||
<span class="file-down-span"
|
||||
style="bottom: 0;height: 20px;display: inline-block;"
|
||||
@click="APP_DOMAIN+'/file_server/download?filepath=' + item.filepath + '&filename=' + item.filename">
|
||||
<i class="el-icon-download"></i>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
|
||||
没有视频。
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-divider>音频 <i class="el-icon-video-camera"></i></el-divider>
|
||||
<div style="text-align: left;" v-if="audioList.length>0">
|
||||
<div v-for="item in audioList">
|
||||
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
|
||||
<!– <source :src="'${AppFileDomain!}'+item.filepath"/>–>
|
||||
<source :src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + item.id"/>
|
||||
</audio>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
|
||||
没有音频。
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-divider>文档 <i class="el-icon-document-copy"></i></el-divider>
|
||||
<div style="text-align: left;" v-if="docList.length>0">
|
||||
<!– <div v-for="item in docList">
|
||||
<el-tooltip class="item" effect="dark" placement="right-start">
|
||||
<div slot="content">{{ item.fjname }}</div>
|
||||
<div class="view-myvideo-tab" style="background-color: #f6f6f6">
|
||||
<div class="video-toggle-i" @click="dd3s.preview(item.filepath,item.id)">
|
||||
<i class="el-icon-document"></i>
|
||||
</div>
|
||||
|
||||
<span class="file-down-span"
|
||||
style="bottom: 0;height: 20px;display: inline-block;"
|
||||
@click="APP_DOMAIN+'/file_server/download?filepath=' + item.filepath + '&filename=' + item.filename">
|
||||
<i class="el-icon-download"></i>
|
||||
</span>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>–>
|
||||
<file-upload v-if="docList&&docList.length"
|
||||
:files="docList"
|
||||
:view="true"></file-upload>
|
||||
<span v-else>暂无</span>
|
||||
</div>
|
||||
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
|
||||
没有文档。
|
||||
</div>
|
||||
</el-row>
|
||||
</div>-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="分工会审核信息" name="2" v-if="viewData.union">
|
||||
<el-form label-width="130px" label-suffix=":" style="padding: 20px 0">
|
||||
<vi-title title="审核信息"></vi-title>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员">
|
||||
{{ viewData.union.username }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.union.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="审核意见">
|
||||
<div class="textarea-div">{{ viewData.union.auditOpinion ? viewData.union.auditOpinion : '暂无' }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="签  字">
|
||||
<el-image v-if="viewData.union.auditSign"
|
||||
style="width: 300px; height: 100px"
|
||||
:src="viewData.union.auditSign"
|
||||
fit="contain"></el-image>
|
||||
<span v-else>暂无</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="校工会审核信息" name="3" v-if="viewData.school">
|
||||
<el-form label-width="130px" label-suffix=":" style="padding: 20px 0">
|
||||
<vi-title title="审核信息"></vi-title>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员">
|
||||
{{ viewData.school.username }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.school.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="审核意见">
|
||||
<div class="textarea-div">{{ viewData.school.auditOpinion ? viewData.school.auditOpinion : '暂无' }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="签  字">
|
||||
<el-image v-if="viewData.school.auditSign"
|
||||
style="width: 300px; height: 100px"
|
||||
:src="viewData.school.auditSign"
|
||||
fit="contain"></el-image>
|
||||
<span v-else>暂无</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane v-if="handle" :label="label" name="999">
|
||||
<slot name="handle"></slot>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
handle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: '审核'
|
||||
},
|
||||
panes: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: "1",
|
||||
viewData: {},
|
||||
loading: true,
|
||||
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
|
||||
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
|
||||
doctype: ['doc', 'docx', 'xlsx', 'xls', 'txt'],
|
||||
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
|
||||
prevImgList: [],
|
||||
img2List: [],
|
||||
videoList: [],
|
||||
docList: [],
|
||||
audioList: [],
|
||||
imgShow: false,
|
||||
fileDialogVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
methods: {
|
||||
hasPane(name) {
|
||||
if (!this.handle) {
|
||||
return true
|
||||
}
|
||||
return this.panes.includes(name)
|
||||
},
|
||||
async getInfo(id) {
|
||||
|
||||
this.img2List = [];
|
||||
this.prevImgList = [];
|
||||
this.videoList = [];
|
||||
this.audioList = [];
|
||||
this.docList = [];
|
||||
$.post(base + '/platform/hd/wmhd/findOneById', {id: id}).then(data => {
|
||||
if (data.code == 0) {
|
||||
data.data.forEach(val => {
|
||||
val.fjname = val.filename
|
||||
val.fjurl = val.filepath
|
||||
val.url = '${AppFileDomain!}' + val.filepath
|
||||
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
|
||||
if (this.videotype.indexOf(filetype) > -1) {
|
||||
this.videoList.push(val);
|
||||
} else if (this.imgtype.indexOf(filetype) > -1) {
|
||||
this.prevImgList.push('${AppFileDomain!}' + val.filepath)
|
||||
this.img2List.push(val);
|
||||
} else if (this.doctype.indexOf(filetype) > -1) {
|
||||
this.docList.push(val);
|
||||
} else if (this.audiotype.indexOf(filetype) > -1) {
|
||||
this.audioList.push(val);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
const {data} = await $.post("/platform/hd/wmhd/findxxById", {id: id})
|
||||
this.viewData = data
|
||||
this.activeName = this.handle ? "999" : "1"
|
||||
this.loading = false
|
||||
},
|
||||
playVideo1(fjurl) {
|
||||
this.$emit("playvideo", fjurl)
|
||||
},
|
||||
filedialogClose() {
|
||||
//关闭的时候需要销毁video 但是随之dom元素也会被删除!!!!
|
||||
this.imgShow = false;
|
||||
this.videoShow = false;
|
||||
videojs('my-video').dispose();
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
.tpa {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
width: 12%;
|
||||
color: #a0a9b4;
|
||||
background-color: rgb(250, 250, 250);
|
||||
border: 1px solid rgb(220, 220, 220);
|
||||
}
|
||||
|
||||
.tpb {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
color: #4f576b;
|
||||
width: 15%;
|
||||
border: 1px solid rgb(220, 220, 220);
|
||||
}
|
||||
|
||||
input[type=file] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.filedialog .el-dialog__header i {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.filedialog .el-dialog__body {
|
||||
padding: 20px 0 0 0;
|
||||
}
|
||||
|
||||
/*video{
|
||||
width: 100%!important;
|
||||
height: 500px!important;
|
||||
outline:none;
|
||||
}*/
|
||||
.video-js {
|
||||
width: 100%;
|
||||
height: 450px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vjs-tech, .video-js button {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#app .el-table th.gutter {
|
||||
display: table-cell !important
|
||||
}
|
||||
|
||||
.filedialog .el-dialog {
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
|
||||
.video-js .vjs-big-play-button { /* 中间大的播放按钮 */
|
||||
font-size: 2.5em;
|
||||
line-height: 2.3em;
|
||||
height: 2.5em;
|
||||
width: 2.5em;
|
||||
-webkit-border-radius: 2.5em;
|
||||
-moz-border-radius: 2.5em;
|
||||
border-radius: 2.5em;
|
||||
background-color: rgba(115, 133, 159, .5);
|
||||
border-width: 0.12em;
|
||||
margin-top: -1.25em;
|
||||
margin-left: -1.75em;
|
||||
}
|
||||
|
||||
.video-js.vjs-paused .vjs-big-play-button { /* 视频暂停时显示播放按钮 */
|
||||
display: block;
|
||||
}
|
||||
|
||||
.video-js.vjs-error .vjs-big-play-button { /* 视频加载出错时隐藏播放按钮 */
|
||||
display: none;
|
||||
}
|
||||
|
||||
.vjs-loading-spinner { /* 加载圆圈 */
|
||||
font-size: 2.5em;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
border-radius: 1em;
|
||||
margin-top: -1em;
|
||||
margin-left: -1.5em;
|
||||
}
|
||||
|
||||
.el-image {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.el-divider__text {
|
||||
color: #abc5df;
|
||||
}
|
||||
|
||||
.el-divider {
|
||||
background-color: #e5edf6;
|
||||
}
|
||||
|
||||
.view-myvideo-tab {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: #C0C4CC;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.video-toggle-i:hover .el-icon-video-camera-solid {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.video-toggle-i:hover .el-icon-video-play {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
.view-myvideo-tab .el-icon-video-camera-solid, .view-myvideo-tab .el-icon-video-play, .view-myvideo-tab .el-icon-document {
|
||||
color: #000000;
|
||||
line-height: 80px;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
|
||||
.view-myvideo-tab .el-icon-download {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.el-icon-video-play {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ckdialogclass .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.el-icon-download {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.file-down-span {
|
||||
background: black;
|
||||
opacity: 0.5;
|
||||
z-index: 1000;
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
/*position: absolute;*/
|
||||
position: relative;
|
||||
bottom: -100px;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.file-down-span:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.ckdialogclass .el-icon-circle-close {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.form-item-container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.form-item-container .el-form-item {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.el-upload--picture-card {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
line-height: 98px;
|
||||
}
|
||||
|
||||
.el-upload-list--picture-card .el-upload-list__item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.el-loading-mask.is-fullscreen .el-loading-spinner {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,229 @@
|
||||
/**
|
||||
*Desc:
|
||||
*Create by: jug
|
||||
*Create time:2024/1/24/16:40
|
||||
*/
|
||||
<template>
|
||||
<div>
|
||||
<div ref="editorDom"></div>
|
||||
<input type="file" style="display: none;">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
|
||||
<script>
|
||||
|
||||
const {$, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip} = wangEditor
|
||||
|
||||
class AlertMenu extends BtnMenu {
|
||||
constructor(editor) {
|
||||
const $elem = wangEditor.$(
|
||||
`<div class="w-e-menu" data-title="上传word">
|
||||
word
|
||||
</div>`
|
||||
)
|
||||
super($elem, editor)
|
||||
}
|
||||
|
||||
clickHandler() {
|
||||
const _this = this
|
||||
const inputFileElement = document.querySelector('#' + this.editor.textElemId).parentElement.parentElement.nextElementSibling
|
||||
inputFileElement.click()
|
||||
inputFileElement.addEventListener('change', function () {
|
||||
const file = this.files[0];
|
||||
const fileName = file.name
|
||||
|
||||
if (!fileName.toLowerCase().endsWith('.doc') && !fileName.toLowerCase().endsWith('.docx')) {
|
||||
alert('请上传doc或者docx的文件')
|
||||
_this.clearInputFile()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append('file', file, file.name)
|
||||
axios.post('/file_server/word2Html', formData, {}).then(response => {
|
||||
console.log(response.data)
|
||||
if (response.data.code === 0) {
|
||||
_this.editor.txt.html(response.data.data)
|
||||
} else {
|
||||
alert(response.data.msg + ',上传word失败,请联系管理员!')
|
||||
_this.clearInputFile()
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
_this.clearInputFile()
|
||||
alert('上传word失败,请联系管理员!')
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
clearInputFile() {
|
||||
const obj = document.getElementById('fileInput');
|
||||
obj.outerHTML = obj.outerHTML
|
||||
}
|
||||
|
||||
tryChangeActive() {
|
||||
this.active()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wangEditor.registerMenu('alertMenuKey', AlertMenu)
|
||||
module.exports = {
|
||||
name: "textEditor",
|
||||
props: {
|
||||
// 定义值属性,用于接收父组件传递的值
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 300
|
||||
},
|
||||
menus: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [
|
||||
'head',//标题
|
||||
'bold',//加粗
|
||||
'fontSize',//字号
|
||||
'fontName',//字体
|
||||
'italic',//斜体
|
||||
'underline',//下划线
|
||||
'strikeThrough',//删除线
|
||||
'indent',//缩进
|
||||
'lineHeight',//行高
|
||||
'foreColor',//文字颜色
|
||||
'backColor',//背景颜色
|
||||
//'link',//链接
|
||||
'list',//序列
|
||||
'todo',//待办
|
||||
'justify',//对齐
|
||||
'quote',//引用
|
||||
// 'emoticon',//表情
|
||||
'image',
|
||||
//'video',
|
||||
'table',
|
||||
//'code',
|
||||
'splitLine',//分割线
|
||||
'undo',
|
||||
'redo',
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editor: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initEditor()
|
||||
},
|
||||
|
||||
watch: {
|
||||
value: {
|
||||
handler: function (newValue) {
|
||||
this.$nextTick(() => {
|
||||
this.editor.txt.html(newValue);
|
||||
// this.editor.config.focus = true
|
||||
})
|
||||
// const _this = this
|
||||
// const waitUntilEditorNotNull = () => {
|
||||
// if (_this.editor != null) {
|
||||
// _this.editor.txt.html(newValue);
|
||||
// } else {
|
||||
// setTimeout(waitUntilEditorNotNull, 100); // 每隔100毫秒检查一次
|
||||
// }
|
||||
// }
|
||||
// waitUntilEditorNotNull();
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
initEditor() {
|
||||
let _this = this
|
||||
this.editor = new wangEditor(this.$refs.editorDom)
|
||||
|
||||
// this.editor.config.focus = false // 取消光标自动定位
|
||||
|
||||
//内容change回调
|
||||
this.editor.config.onchange = function (newHtml) {
|
||||
let content = _this.editor.txt.html()
|
||||
let text = _this.editor.txt.text()
|
||||
// 对于一键格式化后的内容,空内容可能会出现<p></br></p>标签,此处进行判断
|
||||
// if (_this.isEmptyEditor()) {
|
||||
// content = ''
|
||||
// }
|
||||
_this.$emit('input', content)
|
||||
_this.$emit('catchData', content, text)
|
||||
}
|
||||
|
||||
//配置图片上传
|
||||
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
|
||||
// resultFiles 是 input 中选中的文件列表
|
||||
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
|
||||
|
||||
Promise.all(_this.uploadFiles(resultFiles)).then(res => {
|
||||
res.forEach(v => {
|
||||
if (v.code === 0) {
|
||||
insertImgFn(CREATE_PREVIEW_URL(v.data.filepath))
|
||||
} else {
|
||||
ELEMENT.message.warning('图片上传失败')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
//粘贴过滤
|
||||
this.editor.config.pasteFilterStyle = false
|
||||
//高度
|
||||
this.editor.config.height = this.height
|
||||
//菜单
|
||||
this.editor.config.menus = this.menus
|
||||
this.editor.create()
|
||||
},
|
||||
isEmptyEditor() {
|
||||
const children = this.editor.$textElem.children()
|
||||
for (let i = 0; i < children.elems.length; i++) {
|
||||
const node = children.elems[i]
|
||||
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== '') {
|
||||
return false
|
||||
}
|
||||
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'p' && node.innerText.trim() !== '') {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
uploadFiles(resultFiles) {
|
||||
return resultFiles.map(async file => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file, file.name)
|
||||
formData.append("folderPath", "/wangEditorImg/")
|
||||
return jQuery.ajax({
|
||||
url: '/file_server/uploadFile',
|
||||
type: 'post',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user