This commit is contained in:
clay
2022-12-08 15:40:33 +08:00
parent 0a2a804ca8
commit 2cfbfef8bd
5 changed files with 348 additions and 243 deletions

View File

@@ -2,11 +2,11 @@
ENV = 'development' ENV = 'development'
# EBTS/开发环境 # EBTS/开发环境
#VUE_APP_BASE_API = '/dev-api' VUE_APP_BASE_API = '/dev-api'
#VUE_APP_BASE_API = 'http://192.168.190.67/dev-api' #VUE_APP_BASE_API = 'http://192.168.190.67/dev-api'
#VUE_APP_BASE_API = 'http://127.0.0.1:8085/dev-api' #VUE_APP_BASE_API = 'http://127.0.0.1:8085/dev-api'
#VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api' #VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api'
VUE_APP_BASE_API = 'http://sist.swjtu.edu.cn/dev-api' #VUE_APP_BASE_API = 'http://sist.swjtu.edu.cn/dev-api'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@@ -133,10 +133,10 @@ export default {
}, },
mounted() { mounted() {
this.initInform() this.initInform()
let notice_text = document.getElementById('notice_text') // let notice_text = document.getElementById('notice_text')
notice_text.addEventListener('webkitAnimationEnd', function() { // notice_text.addEventListener('webkitAnimationEnd', function() {
this.style.marginLeft = 0 // this.style.marginLeft = 0
}, false) // }, false)
// this.initFiche() // this.initFiche()
}, },
methods: { methods: {

View File

@@ -16,7 +16,8 @@
type="textarea" type="textarea"
:rows="4" :rows="4"
placeholder="请输入内容" placeholder="请输入内容"
clearable :style="{width: '100%'}"> clearable :style="{width: '100%'}"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -26,7 +27,8 @@
<el-form-item label="是否新闻" prop="isTop"> <el-form-item label="是否新闻" prop="isTop">
<el-radio-group v-model="formData.isTop"> <el-radio-group v-model="formData.isTop">
<el-radio-button v-for="(item, index) in isTopOptions" :key="index" <el-radio-button v-for="(item, index) in isTopOptions" :key="index"
:label="item.dictValue">{{ item.dictLabel }} :label="item.dictValue"
>{{ item.dictLabel }}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@@ -44,7 +46,8 @@
<el-form-item label="是否英语" prop="isEnglish"> <el-form-item label="是否英语" prop="isEnglish">
<el-radio-group v-model="formData.isEnglish"> <el-radio-group v-model="formData.isEnglish">
<el-radio-button v-for="(item, index) in isEnglishOptions" :key="index" <el-radio-button v-for="(item, index) in isEnglishOptions" :key="index"
:label="item.dictValue">{{ item.dictLabel }} :label="item.dictValue"
>{{ item.dictLabel }}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@@ -56,7 +59,8 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="信息网站"> <el-form-item label="信息网站">
<el-select v-model="params.sistArticleType" @change="getSistApprove(params.sistArticleType)" <el-select v-model="params.sistArticleType" @change="getSistApprove(params.sistArticleType)"
placeholder="请选择文章类型" clearable :style="{width: '100%'}"> placeholder="请选择文章类型" clearable :style="{width: '100%'}"
>
<el-option <el-option
v-for="dict in sistArticleTypeOption" v-for="dict in sistArticleTypeOption"
:key="dict.id" :key="dict.id"
@@ -83,7 +87,8 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="实验室网站"> <el-form-item label="实验室网站">
<el-select v-model="params.labArticleType" placeholder="请选择文章类型" <el-select v-model="params.labArticleType" placeholder="请选择文章类型"
@change="getLabApprove(params.labArticleType)" clearable :style="{width: '100%'}"> @change="getLabApprove(params.labArticleType)" clearable :style="{width: '100%'}"
>
<el-option <el-option
v-for="dict in labArticleTypeOption" v-for="dict in labArticleTypeOption"
:key="dict.id" :key="dict.id"
@@ -146,7 +151,8 @@
<el-col :span="24" class="submitForm"> <el-col :span="24" class="submitForm">
<el-form-item size="large"> <el-form-item size="large">
<el-button type="success" @click="saveDrafts">保存草稿</el-button> <el-button type="success" @click="saveDrafts">保存草稿</el-button>
<el-button type="primary" @click="submitForm">{{(isAuditShow.sist || isAuditShow.lab) ? "提交审核":"发布"}}</el-button> <el-button type="primary" @click="submitForm">{{ (isAuditShow.sist || isAuditShow.lab) ? '提交审核' : '发布' }}
</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -155,18 +161,17 @@
</template> </template>
<script> <script>
import TinymceEditor from '@/views/utils/tinymce/Tinymce' import TinymceEditor from '@/views/utils/tinymce/Tinymce'
import {updateArticle, getArticle, drafts, getArticleType, getArticleApprove} from "@/api/sist/article"; import { updateArticle, getArticle, drafts, getArticleApprove } from '@/api/sist/article'
import {Message} from "element-ui"; import { Message } from 'element-ui'
import UploadFile from '@/views/utils/uploadFile.vue'; import UploadFile from '@/views/utils/uploadFile.vue'
import { getArticleNav } from '../../../../api/sist/article' import { getArticleNav } from '../../../../api/sist/article'
import { getToken } from '../../../../utils/auth' import { getToken } from '../../../../utils/auth'
import { addFile, delFile } from '../../../../api/sist/file' import { addFile, delFile } from '../../../../api/sist/file'
export default { export default {
components: { components: {
TinymceEditor, TinymceEditor,
UploadFile, UploadFile
// ArticleFile // ArticleFile
}, },
props: [], props: [],
@@ -186,12 +191,12 @@ export default {
title: null, title: null,
isTop: '2', isTop: '2',
isEnglish: '0', isEnglish: '0',
content: "", content: '',
imgurl:null, imgurl: null
}, },
approveShow: { approveShow: {
sist: true, sist: true,
lab: true, lab: true
}, },
isAuditShow: { isAuditShow: {
sist: false, sist: false,
@@ -201,7 +206,7 @@ export default {
sistArticleType: null, sistArticleType: null,
sistApprove: null, sistApprove: null,
labArticleType: null, labArticleType: null,
labApprove: null, labApprove: null
}, },
sistArticleTypeOption: [], sistArticleTypeOption: [],
labArticleTypeOption: [], labArticleTypeOption: [],
@@ -247,8 +252,8 @@ export default {
required: true, required: true,
message: '请选择发布日期', message: '请选择发布日期',
trigger: 'change' trigger: 'change'
}], }]
}, }
} }
}, },
computed: {}, computed: {},
@@ -258,9 +263,9 @@ export default {
sist: true, sist: true,
lab: true lab: true
} }
this.formData.id = this.$route.params && this.$route.params.articleId; this.formData.id = this.$route.params && this.$route.params.articleId
if (this.formData.id === undefined) { if (this.formData.id === undefined) {
this.formData.id = null; this.formData.id = null
} else { } else {
getArticle(this.formData.id).then(response => { getArticle(this.formData.id).then(response => {
this.formData = response.data this.formData = response.data
@@ -279,21 +284,21 @@ export default {
} }
}) })
} }
this.getDicts("article_site_type").then(response => { this.getDicts('article_site_type').then(response => {
this.sitetypeOptions = response.data; this.sitetypeOptions = response.data
}); })
this.getDicts("is_top").then(response => { this.getDicts('is_top').then(response => {
this.isTopOptions = response.data; this.isTopOptions = response.data
}); })
this.getDicts("is_view").then(response => { this.getDicts('is_view').then(response => {
this.isViewOptions = response.data; this.isViewOptions = response.data
}); })
this.getDicts("is_english").then(response => { this.getDicts('is_english').then(response => {
this.isEnglishOptions = response.data; this.isEnglishOptions = response.data
}); })
this.getDicts("article_status").then(response => { this.getDicts('article_status').then(response => {
this.statusOptions = response.data; this.statusOptions = response.data
}); })
getArticleNav().then(res => { getArticleNav().then(res => {
let data = res.data let data = res.data
this.articleTypeOptions = data this.articleTypeOptions = data
@@ -343,10 +348,10 @@ export default {
id: dataFile.fileId, id: dataFile.fileId,
uid: file.uid, uid: file.uid,
url: dataFile.url, url: dataFile.url,
fileName:data.fileName, fileName: data.fileName
} }
let url = dataFile.uri let url = dataFile.uri
url = url.replace("/pubfiles","/attached") url = url.replace('/pubfiles', '/attached')
let fileStr = '<p><a target="_blank" href="' + url + '">' + mapperItem.fileName + '</a><br/></p>' let fileStr = '<p><a target="_blank" href="' + url + '">' + mapperItem.fileName + '</a><br/></p>'
this.formData.content = this.formData.content + fileStr this.formData.content = this.formData.content + fileStr
this.fileMapper.push(mapperItem) this.fileMapper.push(mapperItem)
@@ -403,22 +408,22 @@ export default {
let that_ = this let that_ = this
this.$refs['elForm'].validate(valid => { this.$refs['elForm'].validate(valid => {
if (valid) { if (valid) {
if ((that_.params.sistArticleType === null || that_.params.sistArticleType === "") && (that_.params.labArticleType === null || that_.params.labArticleType === "")) { if ((that_.params.sistArticleType === null || that_.params.sistArticleType === '') && (that_.params.labArticleType === null || that_.params.labArticleType === '')) {
Message({ Message({
message: "请至少选择一个网站发布文章", message: '请至少选择一个网站发布文章',
type: "error", type: 'error'
}) })
return return
} else if ((that_.params.sistArticleType === null || that_.params.sistArticleType === "") && (that_.params.labArticleType !== null || that_.params.labArticleType !== "") && (that_.formData.sistApprove === null || that_.params.sistApprove === "")) { } else if ((that_.params.sistArticleType === null || that_.params.sistArticleType === '') && (that_.params.labArticleType !== null || that_.params.labArticleType !== '') && (that_.formData.sistApprove === null || that_.params.sistApprove === '')) {
Message({ Message({
message: "请选择信息网站的审批人", message: '请选择信息网站的审批人',
type: "error", type: 'error'
}) })
return return
} else if ((that_.params.sistArticleType === null || that_.params.sistArticleType === "") && (that_.params.labArticleType != null || that_.params.labArticleType !== "") && (that_.params.labApprove === null || that_.params.labApprove === "")) { } else if ((that_.params.sistArticleType === null || that_.params.sistArticleType === '') && (that_.params.labArticleType != null || that_.params.labArticleType !== '') && (that_.params.labApprove === null || that_.params.labApprove === '')) {
Message({ Message({
message: "请选择实验室网站的审批人", message: '请选择实验室网站的审批人',
type: "error", type: 'error'
}) })
return return
} }
@@ -426,49 +431,49 @@ export default {
that_.formData.params = that_.params that_.formData.params = that_.params
if (that_.submit == 0) { if (that_.submit == 0) {
Message({ Message({
message: "您操作过快", message: '您操作过快',
type: "error", type: 'error'
}) })
} else { } else {
that_.submit = 0 that_.submit = 0
that_.loading = true; that_.loading = true
// this.formData.imgurl = this.form.imgurl.url // this.formData.imgurl = this.form.imgurl.url
updateArticle(that_.formData).then(response => { updateArticle(that_.formData).then(response => {
that_.loading = false; that_.loading = false
if (response.code == 200) { if (response.code == 200) {
that_.msgSuccess("提交审批成功"); that_.msgSuccess('提交审批成功')
that_.submit = 1 that_.submit = 1
that_.close(); that_.close()
} }
}).catch(e => { }).catch(e => {
that_.submit = 1 that_.submit = 1
}); })
} }
// TODO 提交表单 // TODO 提交表单
}) })
}, },
close() { close() {
this.$store.dispatch("tagsView/delView", this.$route); this.$store.dispatch('tagsView/delView', this.$route)
this.$router.push({path: "/SIST/article/", query: {t: Date.now()}}) this.$router.push({ path: '/SIST/article/', query: { t: Date.now() } })
}, },
saveDrafts() { saveDrafts() {
let that = this let that = this
this.$refs['elForm'].validate(valid => { this.$refs['elForm'].validate(valid => {
drafts(that.formData).then(res => { drafts(that.formData).then(res => {
if (that.formData.id == null || this.formData.id == "") { if (that.formData.id == null || this.formData.id == '') {
that.formData.id = res.data that.formData.id = res.data
} }
if (res.code == 200) { if (res.code == 200) {
that.msgSuccess('保存成功'); that.msgSuccess('保存成功')
} else { } else {
that.Message({ that.Message({
message: res.code, message: res.code,
type: "error" type: 'error'
}) })
} }
}) })
}) })
}, }
} }
} }

View File

@@ -44,7 +44,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:notice:add']" v-hasPermi="['system:notice:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@@ -55,7 +56,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:notice:edit']" v-hasPermi="['system:notice:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@@ -66,7 +68,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:notice:remove']" v-hasPermi="['system:notice:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@@ -108,14 +111,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']" v-hasPermi="['system:notice:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']" v-hasPermi="['system:notice:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -161,11 +166,36 @@
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="内容"> <el-form-item label="公告标题" prop="noticeContent">
<el-row>
<el-col :offset="1" :span="22">
<el-upload
class="upload-demo"
ref="upload"
:action="uploadFileUrl"
:headers="headers"
:on-remove="handleRemove"
:on-success="handleUploadSuccess"
:file-list="fileList"
:auto-upload="true"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>-->
</el-upload>
</el-col>
</el-row>
<el-row>
<el-col :offset="1" :span="22">
<!-- <TinymceEditor ref="tinymce" v-model="form.noticeContent"></TinymceEditor>-->
<editor v-model="form.noticeContent" :min-height="192"/> <editor v-model="form.noticeContent" :min-height="192"/>
</el-col>
</el-row>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <TinymceEditor v-model="form.noticeContent"></TinymceEditor>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@@ -176,16 +206,24 @@
</template> </template>
<script> <script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice"; import { listNotice, getNotice, delNotice, addNotice, updateNotice } from '@/api/system/notice'
import Editor from '@/components/Editor'; import Editor from '@/components/Editor'
import { addFile, delFile } from '../../../api/sist/file'
import { getToken } from '../../../utils/auth'
export default { export default {
name: "Notice", name: 'Notice',
components: { components: {
Editor Editor
}, },
data() { data() {
return { return {
uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传的图片服务器地址
headers: {
Authorization: 'Bearer ' + getToken()
},
fileList: [],
fileMapper: [],
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
@@ -201,7 +239,7 @@ export default {
// 公告表格数据 // 公告表格数据
noticeList: [], noticeList: [],
// 弹出层标题 // 弹出层标题
title: "", title: '',
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 类型数据字典 // 类型数据字典
@@ -217,70 +255,121 @@ export default {
status: undefined status: undefined
}, },
// 表单参数 // 表单参数
form: {}, form: {
noticeId: undefined,
noticeTitle: undefined,
noticeType: '2',
noticeContent: undefined,
status: '0'
},
// 表单校验 // 表单校验
rules: { rules: {
noticeTitle: [ noticeTitle: [
{ required: true, message: "公告标题不能为空", trigger: "blur" } { required: true, message: '公告标题不能为空', trigger: 'blur' }
], ],
noticeType: [ noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "blur" } { required: true, message: '公告类型不能为空', trigger: 'blur' }
] ]
} }
}; }
}, },
created() { created() {
this.getList(); this.getList()
this.getDicts("sys_notice_status").then(response => { this.getDicts('sys_notice_status').then(response => {
this.statusOptions = response.data; this.statusOptions = response.data
}); })
this.getDicts("sys_notice_type").then(response => { this.getDicts('sys_notice_type').then(response => {
this.typeOptions = response.data; this.typeOptions = response.data
}); })
}, },
methods: { methods: {
handleRemove(file, fileList) {
let fileId = null
let index = 0
for (let item of this.fileMapper) {
console.log(file.uid, item)
if (file.uid == item.uid) {
fileId = item.id
break
}
index++
}
console.log(index)
let that = this
delFile(fileId).then(res => {
that.fileMapper.splice(index, 1)
console.log(that.fileMapper)
that.$message.success('提交成功!')
})
},
// 上传成功回调
handleUploadSuccess(res, file) {
let data = {
isPublic: '1',
fileType: '',
fileName: res.fileName,
fileAddr: res.fileAddr
}
addFile(data).then(res => {
console.log(res)
let dataFile = res.data
let mapperItem = {
id: dataFile.fileId,
uid: file.uid,
url: dataFile.url,
fileName: data.fileName
}
let url = dataFile.uri
url = url.replace('/pubfiles', '/attached')
let fileStr = '<p><a style="color: blue;text-decoration: underline;" target="_blank" href="' + url + '">' + mapperItem.fileName + '</a><br/></p>'
this.form.noticeContent = this.form.noticeContent + fileStr
this.fileMapper.push(mapperItem)
})
this.$message.success('提交成功!')
},
/** 查询公告列表 */ /** 查询公告列表 */
getList() { getList() {
this.loading = true; this.loading = true
listNotice(this.queryParams).then(response => { listNotice(this.queryParams).then(response => {
this.noticeList = response.rows; this.noticeList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
}, },
// 公告状态字典翻译 // 公告状态字典翻译
statusFormat(row, column) { statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status); return this.selectDictLabel(this.statusOptions, row.status)
}, },
// 公告状态字典翻译 // 公告状态字典翻译
typeFormat(row, column) { typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.noticeType); return this.selectDictLabel(this.typeOptions, row.noticeType)
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
noticeId: undefined, noticeId: undefined,
noticeTitle: undefined, noticeTitle: undefined,
noticeType: "2", noticeType: '2',
noticeContent: undefined, noticeContent: undefined,
status: "0", status: '0'
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
@@ -290,58 +379,58 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset()
this.open = true; this.open = true
this.title = "添加公告"; this.title = '添加公告'
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset()
const noticeId = row.noticeId || this.ids const noticeId = row.noticeId || this.ids
getNotice(noticeId).then(response => { getNotice(noticeId).then(response => {
this.form = response.data; this.form = response.data
this.open = true; this.open = true
this.title = "修改公告"; this.title = '修改公告'
}); })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
this.form.noticeType = "1" this.form.noticeType = '1'
this.form.status = "0" this.form.status = '0'
if (valid) { if (valid) {
if (this.form.noticeId != undefined) { if (this.form.noticeId != undefined) {
updateNotice(this.form).then(response => { updateNotice(this.form).then(response => {
this.msgSuccess("修改成功"); this.msgSuccess('修改成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} else { } else {
addNotice(this.form).then(response => { addNotice(this.form).then(response => {
this.msgSuccess("新增成功"); this.msgSuccess('新增成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} }
} }
}); })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const noticeIds = row.noticeId || this.ids const noticeIds = row.noticeId || this.ids
this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", { this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', '警告', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning'
}).then(function() { }).then(function() {
return delNotice(noticeIds); return delNotice(noticeIds)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.msgSuccess("删除成功"); this.msgSuccess('删除成功')
}) })
} }
} }
}; }
</script> </script>
<style scoped> <style scoped>
/deep/ .w-e-text { /deep/ .w-e-text {

View File

@@ -174,19 +174,29 @@ export default {
} }
}, },
mounted() { mounted() {
this.initTinymce()
// tinymce.init({
// images_upload_handler: (blobInfo, success, failure) => {
// this.upload_handler(blobInfo, success, failure)
// }
// })
},
// created() {
// this.initTinymce()
// tinymce.init({
// images_upload_handler: (blobInfo, success, failure) => {
// this.upload_handler(blobInfo, success, failure)
// }
// })
// },
methods: {
initTinymce(){
tinymce.init({ tinymce.init({
images_upload_handler: (blobInfo, success, failure) => { images_upload_handler: (blobInfo, success, failure) => {
this.upload_handler(blobInfo, success, failure) this.upload_handler(blobInfo, success, failure)
} }
}) })
}, },
// created() {
// tinymce.init({})
// },
methods: {
upload_handler(blobInfo, success, failure) { upload_handler(blobInfo, success, failure) {
console.log('我被触发了') console.log('我被触发了')
console.log(blobInfo, 'blobInfo') console.log(blobInfo, 'blobInfo')
@@ -216,6 +226,7 @@ export default {
}, },
watch: { watch: {
value(newValue) { value(newValue) {
// this.initTinymce()
this.myValue = newValue this.myValue = newValue
}, },
myValue(newValue) { myValue(newValue) {