提交 a95d2d3c authored 作者: 王鹏飞's avatar 王鹏飞

升级ckeditor和aliplayer

上级 049bf68c
...@@ -1169,6 +1169,16 @@ ...@@ -1169,6 +1169,16 @@
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
}, },
"@ckeditor/ckeditor5-build-classic": {
"version": "23.1.0",
"resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-build-classic/-/ckeditor5-build-classic-23.1.0.tgz",
"integrity": "sha512-wqJZ6yuqm48NoiciRcfs+t73YOfIKovJIiLSHf0yB2I3Mc+bL6iNhwwyJ3b6D/22IgYEXTpc6PiwsYFbGFnq2Q=="
},
"@ckeditor/ckeditor5-vue2": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@ckeditor/ckeditor5-vue2/-/ckeditor5-vue2-1.0.5.tgz",
"integrity": "sha512-snsNB/2oWfKw0drGJAmMGpTatmt//L1rQsOwkBw+1uKUuOJPKN3xwyUZVWT906VguIMXm4E9OHzquZ3bdkijiA=="
},
"@types/anymatch": { "@types/anymatch": {
"version": "1.3.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz",
...@@ -1922,11 +1932,18 @@ ...@@ -1922,11 +1932,18 @@
"dev": true "dev": true
}, },
"axios": { "axios": {
"version": "0.19.2", "version": "0.21.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz",
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==",
"requires": { "requires": {
"follow-redirects": "1.5.10" "follow-redirects": "^1.10.0"
},
"dependencies": {
"follow-redirects": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz",
"integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA=="
}
} }
}, },
"babel-eslint": { "babel-eslint": {
...@@ -1999,9 +2016,9 @@ ...@@ -1999,9 +2016,9 @@
}, },
"dependencies": { "dependencies": {
"core-js": { "core-js": {
"version": "2.6.11", "version": "2.6.12",
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.11.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha1-OIMUafmSK97Y7iHJ3EaYXgOZMIw=" "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
} }
} }
}, },
...@@ -3077,9 +3094,9 @@ ...@@ -3077,9 +3094,9 @@
} }
}, },
"core-js": { "core-js": {
"version": "3.6.5", "version": "3.8.0",
"resolved": "https://registry.npm.taobao.org/core-js/download/core-js-3.6.5.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.0.tgz",
"integrity": "sha1-c5XcJzrzf7LlDpvT2f6EEoUjHRo=" "integrity": "sha512-W2VYNB0nwQQE7tKS7HzXd7r2y/y2SVJl4ga6oH/dnaLFzM0o2lB2P3zCkWj5Wc/zyMYjtgd5Hmhk0ObkQFZOIA=="
}, },
"core-js-compat": { "core-js-compat": {
"version": "3.6.5", "version": "3.6.5",
...@@ -3197,9 +3214,9 @@ ...@@ -3197,9 +3214,9 @@
} }
}, },
"cross-env": { "cross-env": {
"version": "7.0.2", "version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
"integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
"requires": { "requires": {
"cross-spawn": "^7.0.1" "cross-spawn": "^7.0.1"
} }
...@@ -3393,6 +3410,7 @@ ...@@ -3393,6 +3410,7 @@
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": { "requires": {
"ms": "2.0.0" "ms": "2.0.0"
} }
...@@ -3791,9 +3809,9 @@ ...@@ -3791,9 +3809,9 @@
"dev": true "dev": true
}, },
"element-ui": { "element-ui": {
"version": "2.13.2", "version": "2.14.1",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.13.2.tgz", "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.14.1.tgz",
"integrity": "sha512-r761DRPssMPKDiJZWFlG+4e4vr0cRG/atKr3Eqr8Xi0tQMNbtmYU1QXvFnKiFPFFGkgJ6zS6ASkG+sellcoHlQ==", "integrity": "sha512-Uje0J12dBaXdyvt/EtuDA8diFbYTdO7uI4QCfl7zmEJmE1WxgCSVKhlRRoL8MDonO8pyNVhB4n0AFAR14g56nw==",
"requires": { "requires": {
"async-validator": "~1.8.1", "async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0", "babel-helper-vue-jsx-merge-props": "^2.0.0",
...@@ -5038,6 +5056,7 @@ ...@@ -5038,6 +5056,7 @@
"version": "1.5.10", "version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"dev": true,
"requires": { "requires": {
"debug": "=3.1.0" "debug": "=3.1.0"
} }
...@@ -7002,7 +7021,8 @@ ...@@ -7002,7 +7021,8 @@
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
}, },
"multicast-dns": { "multicast-dns": {
"version": "6.2.3", "version": "6.2.3",
...@@ -10596,14 +10616,14 @@ ...@@ -10596,14 +10616,14 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==" "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog=="
}, },
"vue-i18n": { "vue-i18n": {
"version": "8.22.0", "version": "8.22.2",
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.22.0.tgz", "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.22.2.tgz",
"integrity": "sha512-2tYS0bYDPJHKAWPy01aDe5h3wcXDGjhJmboHKOfi2OEYR+6gyXaIzdua1smZCQwOeWdlGsLntwdIgkXWrnLjxg==" "integrity": "sha512-rb569fVJInPUgS/bbCxEQ9DrAoFTntuJvYoK4Fpk2VfNbA09WzdTKk57ppjz3S+ps9hW+p9H+2ASgMvojedkow=="
}, },
"vue-loader": { "vue-loader": {
"version": "15.9.3", "version": "15.9.5",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.3.tgz", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.5.tgz",
"integrity": "sha512-Y67VnGGgVLH5Voostx8JBZgPQTlDQeOVBLOEsjc2cXbCYBKexSKEpOA56x0YZofoDOTszrLnIShyOX1p9uCEHA==", "integrity": "sha512-oeMOs2b5o5gRqkxfds10bCx6JeXYTwivRgbb8hzOrcThD2z1+GqEKE3EX9A2SGbsYDf4rXwRg6D5n1w0jO5SwA==",
"requires": { "requires": {
"@vue/component-compiler-utils": "^3.1.0", "@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2", "hash-sum": "^1.0.2",
...@@ -10633,9 +10653,9 @@ ...@@ -10633,9 +10653,9 @@
} }
}, },
"vue-router": { "vue-router": {
"version": "3.4.6", "version": "3.4.9",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.6.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz",
"integrity": "sha512-kaXnB3pfFxhAJl/Mp+XG1HJMyFqrL/xPqV7oXlpXn4AwMmm6VNgf0nllW8ksflmZANfI4kdo0bVn/FYSsAolPQ==" "integrity": "sha512-CGAKWN44RqXW06oC+u4mPgHLQQi2t6vLD/JbGRDAXm0YpMv0bgpKuU5bBd7AvMgfTz9kXVRIWKHqRwGEb8xFkA=="
}, },
"vue-style-loader": { "vue-style-loader": {
"version": "4.1.2", "version": "4.1.2",
...@@ -10661,9 +10681,9 @@ ...@@ -10661,9 +10681,9 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==" "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw=="
}, },
"vuex": { "vuex": {
"version": "3.5.1", "version": "3.6.0",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.5.1.tgz", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.0.tgz",
"integrity": "sha512-w7oJzmHQs0FM9LXodfskhw9wgKBiaB+totOdb8sNzbTB2KDCEEwEs29NzBZFh/lmEK1t5tDmM1vtsO7ubG1DFw==" "integrity": "sha512-W74OO2vCJPs9/YjNjW8lLbj+jzT24waTo2KShI8jLvJW8OaIkgb3wuAMA7D+ZiUxDOx3ubwSZTaJBip9G8a3aQ=="
}, },
"watchpack": { "watchpack": {
"version": "1.7.4", "version": "1.7.4",
......
...@@ -72,19 +72,21 @@ ...@@ -72,19 +72,21 @@
"@babel/runtime-corejs3": "^7.11.2" "@babel/runtime-corejs3": "^7.11.2"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.2", "@ckeditor/ckeditor5-build-classic": "^23.1.0",
"cross-env": "^7.0.2", "@ckeditor/ckeditor5-vue2": "^1.0.5",
"element-ui": "^2.13.0", "axios": "^0.21.0",
"core-js": "^3.8.0",
"cross-env": "^7.0.3",
"element-ui": "^2.14.1",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"lodash": "^4.17.15", "lodash": "^4.17.20",
"qs": "^6.9.4", "qs": "^6.9.4",
"vue": "^2.6.11", "vue": "^2.6.12",
"vue-i18n": "^8.16.0", "vue-i18n": "^8.22.2",
"vue-loader": "^15.9.1", "vue-loader": "^15.9.5",
"vue-meta-info": "^0.1.7", "vue-meta-info": "^0.1.7",
"vue-router": "^3.1.6", "vue-router": "^3.4.9",
"vue-template-compiler": "^2.6.11", "vue-template-compiler": "^2.6.12",
"vuex": "^3.1.3", "vuex": "^3.6.0"
"core-js": "^3.6.5"
} }
} }
import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
/**
* 上传文件
*/
export function uploadFile(data) {
return httpRequest.post('/api/lms/util/upload-file', data, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
import { uploadFile } from '@/api/common'
export default class MyUploadAdapter {
constructor(loader) {
// The file loader instance to use during the upload.
this.loader = loader
}
// Starts the upload process.
upload() {
return this.loader.file.then(
file =>
new Promise((resolve, reject) => {
this._sendRequest(resolve, reject, file)
})
)
}
_sendRequest(resolve, reject, file) {
uploadFile({ file })
.then(response => {
if (response.success) {
resolve({ default: response.url })
} else {
return reject(response.message)
}
})
.catch(response => {
return reject(response.message)
})
}
}
<template>
<div class="ckeditor">
<ckeditor
:editor="editor"
:value="value"
:disabled="disabled"
:config="editorConfig"
@ready="onEditorReady"
@input="onEditorInput"
></ckeditor>
</div>
</template>
<script>
import CKEditor from '@ckeditor/ckeditor5-vue2'
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'
import '@ckeditor/ckeditor5-build-classic/build/translations/zh-cn'
import MyUploadAdapter from './MyUploadAdapter'
export default {
components: {
ckeditor: CKEditor.component
},
props: {
value: { type: String },
disabled: { type: Boolean, default: false }
},
data() {
return {
editor: ClassicEditor,
editorConfig: {
language: this.$i18n.locale.toLocaleLowerCase()
}
}
},
methods: {
onEditorReady(editor) {
const FileRepository = editor.plugins.get('FileRepository')
// 自定义上传图片插件
FileRepository.createUploadAdapter = loader => {
return new MyUploadAdapter(loader)
}
},
onEditorInput(value) {
this.$emit('input', value)
}
}
}
</script>
<style>
.ck-content {
min-height: 300px;
max-height: 500px;
word-break: break-word;
}
.ck-sticky-panel__content {
position: unset !important;
}
</style>
<template>
<div class="editor">
<textarea name="editor" :id="textareaElementId" :disabled="disabled"></textarea>
</div>
</template>
<script>
import { uniqueId } from 'lodash'
export default {
name: 'VEditor',
props: {
value: { type: String },
disabled: { type: Boolean, default: false }
},
data() {
return {
textareaElementId: uniqueId('editor_'),
ckEditor: null
}
},
watch: {
value(val) {
if (this.ckEditor && this.ckEditor.getData() !== val) {
this.ckEditor.setData(val)
}
},
disabled(val) {
if (this.ckEditor && this.ckEditor.instanceReady) {
this.ckEditor.setReadOnly(val)
}
}
},
methods: {
createEditor() {
const config = {
language: this.$i18n.locale.toLocaleLowerCase(),
height: 400,
uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] },
// { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
{ name: 'editing', items: ['Find', 'Replace'] },
// { name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
'/',
{
name: 'basicstyles',
items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']
},
{
name: 'paragraph',
items: [
'NumberedList',
'BulletedList',
'-',
'Outdent',
'Indent',
'-',
'Blockquote',
'CreateDiv',
'-',
'JustifyLeft',
'JustifyCenter',
'JustifyRight',
'JustifyBlock',
'-',
'BidiLtr',
'BidiRtl'
]
},
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule'] }
]
}
// if (this.disabled !== null) {
// console.log(this.disabled)
// config.readOnly = this.disabled
// }
const editor = (this.ckEditor = CKEDITOR.replace(this.textareaElementId, config))
editor.on('instanceReady', () => {
const data = this.value
editor.fire('lockSnapshot')
editor.setData(data, {
callback: () => {
this.bindEvent()
const newData = editor.getData()
// Locking the snapshot prevents the 'change' event.
// Trigger it manually to update the bound data.
if (data !== newData) {
this.$once('input', () => {
this.$emit('ready', editor)
})
this.$emit('input', newData)
} else {
this.$emit('ready', editor)
}
editor.fire('unlockSnapshot')
}
})
editor.setReadOnly(this.disabled)
})
},
bindEvent() {
const editor = this.ckEditor
editor.on('change', evt => {
const data = editor.getData()
if (this.value !== data) {
this.$emit('input', data, evt, editor)
}
})
editor.on('focus', evt => {
this.$emit('focus', evt, editor)
})
editor.on('blur', evt => {
this.$emit('blur', evt, editor)
})
}
},
mounted() {
this.createEditor()
},
beforeDestroy() {
this.ckEditor && this.ckEditor.destroy()
this.ckEditor = null
}
}
</script>
<style lang="scss" scoped>
* {
margin: 0;
padding: 0;
}
</style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<title>紫荆教育MBA学习系统</title> <title>紫荆教育MBA学习系统</title>
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no"> <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
<!-- 直接引入aliyun播放插件 CSS --> <!-- 直接引入aliyun播放插件 CSS -->
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.8/skins/default/aliplayer-min.css" /> <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.1/skins/default/aliplayer-min.css" />
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
...@@ -15,16 +15,17 @@ ...@@ -15,16 +15,17 @@
<!-- <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/compatible/es5-shim.min.js"></script> <!-- <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/compatible/es5-shim.min.js"></script>
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/compatible/es5-sham.min.js"></script> --> <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/compatible/es5-sham.min.js"></script> -->
<!-- 三方插件引入 --> <!-- 三方插件引入 -->
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/ckeditor/ckeditor.js"></script> <!-- <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/videoJs/videoJs.js"></script> <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/videoJs/videoJs.js"></script> -->
<!-- common --> <!-- common -->
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/base64.js"></script> <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/base64.js"></script>
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/md5.js"></script> <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/md5.js"></script>
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/jQuery-2.1.4.min.js"></script> <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/jQuery-2.1.4.min.js"></script>
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/runtime.js"></script> <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/runtime.js"></script>
<!-- 直接引入aliyun播放插件 JS --> <!-- 直接引入aliyun播放插件 JS -->
<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.8.8/aliplayer-min.js"></script> <script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.9.1/aliplayer-min.js"></script>
<script type="text/javascript" charset="utf-8" src="https://player.alicdn.com/aliplayer/presentation/js/aliplayercomponents.min.js"></script> <!-- 解决iframe嵌套,CC视频在safri中打开免登陆兼容问题 --> <script type="text/javascript" charset="utf-8" src="https://player.alicdn.com/aliplayer/presentation/js/aliplayercomponents.min.js"></script>
<!-- 解决iframe嵌套,CC视频在safri中打开免登陆兼容问题 -->
<script src="//view.csslcloud.net/js/_fix_.js"></script> <script src="//view.csslcloud.net/js/_fix_.js"></script>
<script src="//view.csslcloud.net/js/jquery-1.9.0.min.js" type="text/javascript"></script> <script src="//view.csslcloud.net/js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="//view.csslcloud.net/js/sdk/3.1.0/liveSDK.js" type="text/javascript"></script> <script src="//view.csslcloud.net/js/sdk/3.1.0/liveSDK.js" type="text/javascript"></script>
......
<template>
<div class="editor">
<textarea name="editor" :id="textareaElementId" :disabled="disabled"></textarea>
</div>
</template>
<script>
import { uniqueId } from 'lodash'
export default {
name: 'VEditor',
props: {
value: { type: String },
disabled: { type: Boolean, default: false }
},
data() {
return {
textareaElementId: uniqueId('editor_'),
ckEditor: null
}
},
watch: {
value(val) {
if (this.ckEditor && this.ckEditor.getData() !== val) {
this.ckEditor.setData(val)
}
},
disabled(val) {
if (this.ckEditor && this.ckEditor.instanceReady) {
this.ckEditor.setReadOnly(val)
}
}
},
methods: {
createEditor() {
const config = {
language: this.$i18n.locale.toLocaleLowerCase(),
height: 400,
uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] },
// { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
{ name: 'editing', items: ['Find', 'Replace'] },
// { name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
'/',
{
name: 'basicstyles',
items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']
},
{
name: 'paragraph',
items: [
'NumberedList',
'BulletedList',
'-',
'Outdent',
'Indent',
'-',
'Blockquote',
'CreateDiv',
'-',
'JustifyLeft',
'JustifyCenter',
'JustifyRight',
'JustifyBlock',
'-',
'BidiLtr',
'BidiRtl'
]
},
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule'] }
]
}
// if (this.disabled !== null) {
// console.log(this.disabled)
// config.readOnly = this.disabled
// }
const editor = (this.ckEditor = CKEDITOR.replace(this.textareaElementId, config))
editor.on('instanceReady', () => {
const data = this.value
editor.fire('lockSnapshot')
editor.setData(data, {
callback: () => {
this.bindEvent()
const newData = editor.getData()
// Locking the snapshot prevents the 'change' event.
// Trigger it manually to update the bound data.
if (data !== newData) {
this.$once('input', () => {
this.$emit('ready', editor)
})
this.$emit('input', newData)
} else {
this.$emit('ready', editor)
}
editor.fire('unlockSnapshot')
}
})
editor.setReadOnly(this.disabled)
})
},
bindEvent() {
const editor = this.ckEditor
editor.on('change', evt => {
const data = editor.getData()
if (this.value !== data) {
this.$emit('input', data, evt, editor)
}
})
editor.on('focus', evt => {
this.$emit('focus', evt, editor)
})
editor.on('blur', evt => {
this.$emit('blur', evt, editor)
})
}
},
mounted() {
this.createEditor()
},
beforeDestroy() {
this.ckEditor && this.ckEditor.destroy()
this.ckEditor = null
}
}
</script>
<style lang="scss" scoped>
* {
margin: 0;
padding: 0;
}
</style>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<script> <script>
// componets // componets
import Container from '../common/container.vue' import Container from '../common/container.vue'
import VEditor from '../common/editor.vue' import VEditor from '@/components/ckeditor'
import VUpload from '../common/upload.vue' import VUpload from '../common/upload.vue'
// api // api
import * as api from '../../api' import * as api from '../../api'
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<script> <script>
// components // components
import VEditor from '../common/editor.vue' import VEditor from '@/components/ckeditor'
import VUpload from '../common/upload.vue' import VUpload from '../common/upload.vue'
export default { export default {
......
...@@ -4,14 +4,13 @@ ...@@ -4,14 +4,13 @@
<div class="con-box"> <div class="con-box">
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<el-form ref="setApplyForm" :model="setApply" :rules="applyRules"> <el-form ref="form" :model="ruleForm" :rules="rules" label-position="top">
<el-form-item :label="$t('feedbackCreate.probDesc')" prop="name"> <el-form-item :label="$t('feedbackCreate.probDesc')" prop="title">
<el-input v-model="setApply.name" :placeholder="$t('feedbackCreate.enterDesc')" type="text" /> <el-input v-model="ruleForm.title" :placeholder="$t('feedbackCreate.enterDesc')" type="text" />
</el-form-item>
<el-form-item :label="$t('feedbackCreate.problemDetails')" prop="contents">
<v-editor v-model="ruleForm.contents"></v-editor>
</el-form-item> </el-form-item>
<div style="width: 100%; height: 10px;"></div>
<div class="label" style="font-size: 14px; line-height: 2;">{{ $t('feedbackCreate.problemDetails') }}</div>
<textarea id="editor"></textarea>
<div style="width: 100%; height: 10px;"></div>
<el-form-item :label="$t('feedbackCreate.uploadAtta')" prop="file"> <el-form-item :label="$t('feedbackCreate.uploadAtta')" prop="file">
<el-upload <el-upload
ref="upFile" ref="upFile"
...@@ -22,11 +21,12 @@ ...@@ -22,11 +21,12 @@
:show-file-list="false" :show-file-list="false"
:on-change="handleChange" :on-change="handleChange"
:http-request="uploadFile" :http-request="uploadFile"
:file-list="filesArr"> :file-list="filesArr"
>
<el-button size="small" type="primary">{{ $t('feedbackCreate.btnUpload') }}</el-button> <el-button size="small" type="primary">{{ $t('feedbackCreate.btnUpload') }}</el-button>
<div slot="tip" class="el-upload__tip">{{ $t('feedbackCreate.limit') }}</div> <div slot="tip" class="el-upload__tip">{{ $t('feedbackCreate.limit') }}</div>
<template v-if="successFileUrl"> <template v-if="successFileUrl">
{{successFileUrl.replace(/.*\/([^\/]*\.[^.]+)$/gi, '$1')}} {{ successFileUrl.replace(/.*\/([^\/]*\.[^.]+)$/gi, '$1') }}
</template> </template>
</el-upload> </el-upload>
<template v-if="successFileUrl"> <template v-if="successFileUrl">
...@@ -34,17 +34,13 @@ ...@@ -34,17 +34,13 @@
</template> </template>
</el-form-item> </el-form-item>
<el-form-item :label="$t('feedbackCreate.submitTo')" prop="type_id"> <el-form-item :label="$t('feedbackCreate.submitTo')" prop="type_id">
<el-select v-model="value"> <el-select v-model="ruleForm.type_id">
<el-option <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onApplyFrom">{{$t('feedbackCreate.subBtn')}}</el-button> <el-button type="primary" @click="onApplyFrom">{{ $t('feedbackCreate.subBtn') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
...@@ -56,21 +52,20 @@ ...@@ -56,21 +52,20 @@
<script> <script>
import cAction from '@action' import cAction from '@action'
import CKEDITOR from 'CKEDITOR' import VEditor from '@/components/ckeditor'
export default { export default {
components: {}, components: { VEditor },
data () { data() {
return { return {
ckeditor: null, ruleForm: {
setApply: { title: '',
name: '', contents: '',
content: '' type_id: '2'
}, },
applyRules: { rules: {
name: [ title: [{ required: true, message: '问题描述不能为空', trigger: 'blur' }],
{ required: true, message: '问题描述不能为空', trigger: 'blur' } contents: [{ required: true, message: '问题详情不能为空', trigger: 'blur' }]
]
}, },
successFileUrl: '', successFileUrl: '',
filesArr: [], filesArr: [],
...@@ -86,94 +81,62 @@ export default { ...@@ -86,94 +81,62 @@ export default {
{ value: '0', label: this.$t('feedbackCreate.all') }, { value: '0', label: this.$t('feedbackCreate.all') },
{ value: '1', label: this.$t('feedbackCreate.administration') }, { value: '1', label: this.$t('feedbackCreate.administration') },
{ value: '2', label: this.$t('feedbackCreate.technology') } { value: '2', label: this.$t('feedbackCreate.technology') }
], ]
value: '2'
} }
}, },
mounted () {
this.initckeditor()
},
destroyed () {
/* 清空 ckeditor 需要调用方法删除 并 在DOM结构中也移除 */
this.ckeditor && this.ckeditor.destroy(true)
this.ckeditor = null
},
methods: { methods: {
handleChange (file, filelist) { handleChange(file, filelist) {
this.file.name = file.raw.name this.file.name = file.raw.name
this.file.type = file.raw.type this.file.type = file.raw.type
this.file.lastModifiedDate = file.raw.lastModifiedDate this.file.lastModifiedDate = file.raw.lastModifiedDate
this.file.size = file.raw.size this.file.size = file.raw.size
this.file.file = file.raw this.file.file = file.raw
}, },
uploadFile () { uploadFile() {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' }) const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Other.uploadFile(this.file).then(data => { cAction.Other.uploadFile(this.file)
this.successFileUrl = data.url .then(data => {
this.filesArr.pop() this.successFileUrl = data.url
}).catch(e => { this.filesArr.pop(); this.$message.error(e.message) }).finally(() => { loading.close() }) this.filesArr.pop()
})
.catch(e => {
this.filesArr.pop()
this.$message.error(e.message)
})
.finally(() => {
loading.close()
})
}, },
onApplyFrom () { onApplyFrom() {
this.$refs.setApplyForm.validate((valid) => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' }) const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Feedback.feedbackCommit({ cAction.Feedback.feedbackCommit({
title: this.setApply.name, title: this.ruleForm.title,
contents: this.ckeditor.getData(), contents: this.ruleForm.contents,
type_id: this.value, type_id: this.ruleForm.type_id,
attachments: JSON.stringify([{ attachments: JSON.stringify([{ name: this.file.name, url: this.successFileUrl }])
name: this.file.name, })
url: this.successFileUrl .then(data => {
}]) if (data.success) {
}).then(data => { this.$message({ type: 'success', message: '提交成功,等待反馈' })
if (data.success) { this.$refs.form.resetFields()
this.$message({ type: 'success', message: '提交成功,等待反馈' }) this.$router.push({ path: '/app/feedback/feedback-list' })
this.ckeditor.setData('') }
this.$refs.setApplyForm.resetFields() })
this.$router.push({ path: '/app/feedback/feedback-list' }) .catch(e => {
} this.filesArr.pop()
}).catch(e => { this.filesArr.pop(); this.$message.error(e.message) }).finally(() => { loading.close() }) this.$message.error(e.message)
})
.finally(() => {
loading.close()
})
} else { } else {
this.$message.error('请检查输入项,确认无误后,重新提交') this.$message.error('请检查输入项,确认无误后,重新提交')
return false return false
} }
}) })
},
/* 初始化 ckeditor */
initckeditor () {
!this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor', {
language: this.$i18n.locale.toLocaleLowerCase(),
height: 300,
uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] },
// { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
{ name: 'editing', items: ['Find', 'Replace'] },
// { name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
'/',
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'] },
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule'] }
]
}))
} }
} }
} }
</script> </script>
<style lang="scss" scoped>
/* 申请 */
.el-date-editor.el-input {
width: 100%;
}
.el-upload__tip {
line-height: 1.5;
}
</style>
...@@ -104,8 +104,8 @@ export default { ...@@ -104,8 +104,8 @@ export default {
pageSize: 10 pageSize: 10
}, },
pagination: { pagination: {
totalCount: 5, totalCount: 0,
pageSize: 1, pageSize: 10,
currentPage: 1 currentPage: 1
}, },
activeNames: ['1'], activeNames: ['1'],
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
$t('pages.learn.courseDetail.Returntoquestionlist') $t('pages.learn.courseDetail.Returntoquestionlist')
}}</el-button> }}</el-button>
</div> </div>
<el-form ref="setPublishform" :model="publish" :rules="publishRules"> <el-form ref="setPublishform" :model="publish" :rules="publishRules" label-position="top">
<el-form-item :label="$t('pages.learn.courseDetail.title1')" prop="title"> <el-form-item :label="$t('pages.learn.courseDetail.title1')" prop="title">
<el-input <el-input
v-model="publish.title" v-model="publish.title"
...@@ -152,11 +152,9 @@ ...@@ -152,11 +152,9 @@
:placeholder="$t('pages.learn.courseDetail.inputtitle1')" :placeholder="$t('pages.learn.courseDetail.inputtitle1')"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<div style="line-height: 1.5; font-size: 0.16rem; margin-bottom: 0.2rem"> <el-form-item :label="$t('pages.learn.courseDetail.Textcontent')" prop="contents">
{{ $t('pages.learn.courseDetail.Textcontent') }} <v-editor v-model="publish.contents"></v-editor>
</div> </el-form-item>
<textarea id="editor"></textarea>
<div style="height: 0.2rem"></div>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmitPublish">{{ <el-button type="primary" @click="onSubmitPublish">{{
$t('pages.learn.courseDetail.Releaseissues') $t('pages.learn.courseDetail.Releaseissues')
...@@ -268,11 +266,15 @@ ...@@ -268,11 +266,15 @@
</template> </template>
</div> </div>
<div class="table-title">{{ $t('pages.learn.courseDetail.Bighomework') }}</div> <div class="table-title">{{ $t('pages.learn.courseDetail.Bighomework') }}</div>
<div class="status-text">{{ $t('pages.learn.courseDetail.Status') }}{{ tabs[3].assess.essay.status }}</div> <div class="status-text">
{{ $t('pages.learn.courseDetail.Status') }}{{ tabs[3].assess.essay.status }}
</div>
<div class="status-text" v-if="tabs[3].assess.essay.created_time"> <div class="status-text" v-if="tabs[3].assess.essay.created_time">
{{ $t('pages.learn.courseDetail.Submissiontime') }}{{ tabs[3].assess.essay.created_time }} {{ $t('pages.learn.courseDetail.Submissiontime') }}{{ tabs[3].assess.essay.created_time }}
</div> </div>
<div class="status-text">{{ $t('pages.learn.courseDetail.score2') }}{{ tabs[3].assess.essay.score }}</div> <div class="status-text">
{{ $t('pages.learn.courseDetail.score2') }}{{ tabs[3].assess.essay.score }}
</div>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -309,10 +311,10 @@ ...@@ -309,10 +311,10 @@
import cAction from '@action' import cAction from '@action'
import cTool from '@tool' import cTool from '@tool'
import CKEDITOR from 'CKEDITOR' import VEditor from '@/components/ckeditor'
export default { export default {
components: {}, components: { VEditor },
props: { props: {
sid: { sid: {
type: String, type: String,
...@@ -333,7 +335,6 @@ export default { ...@@ -333,7 +335,6 @@ export default {
offset: 0 offset: 0
} }
}, },
ckeditor: null,
activeName: '1', activeName: '1',
activeName1: '1', activeName1: '1',
passCount: 0, // 隐藏功能, 退课专用 passCount: 0, // 隐藏功能, 退课专用
...@@ -434,13 +435,8 @@ export default { ...@@ -434,13 +435,8 @@ export default {
}, },
isPublicShow: false, // 是否显示发布问题 isPublicShow: false, // 是否显示发布问题
publishRules: { publishRules: {
title: [ title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
{ contents: [{ required: true, message: '请输入正文内容', trigger: 'blur' }]
required: true,
message: '请输入标题',
trigger: 'blur'
}
]
}, },
isOpenNewTabFlag: false, isOpenNewTabFlag: false,
arrFn: [], arrFn: [],
...@@ -537,9 +533,6 @@ export default { ...@@ -537,9 +533,6 @@ export default {
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.resizeRoot.bind(this), false) window.removeEventListener('resize', this.resizeRoot.bind(this), false)
/* 清空 ckeditor 需要调用方法删除 并 在DOM结构中也移除 */
this.ckeditor && this.ckeditor.destroy(true)
this.ckeditor = null
if (this.timeHeart) { if (this.timeHeart) {
clearInterval(this.timeHeart) clearInterval(this.timeHeart)
this.timeHeart = null this.timeHeart = null
...@@ -550,90 +543,11 @@ export default { ...@@ -550,90 +543,11 @@ export default {
}, },
updated() { updated() {
this.resizeRoot() this.resizeRoot()
if (this.isPublicShow) {
this.initckeditor()
}
},
beforeUpdate() {
if (!this.isPublicShow) {
/* 清空 ckeditor 需要调用方法删除 并 在DOM结构中也移除 */
this.ckeditor && this.ckeditor.destroy(true)
this.ckeditor = null
}
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
/* console.log(tab, event) */ /* console.log(tab, event) */
}, },
/* 初始化 ckeditor */
initckeditor() {
!this.ckeditor &&
(this.ckeditor = CKEDITOR.replace('editor', {
language: this.$i18n.locale.toLocaleLowerCase(),
height: 300,
uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: {
tenant: 'sofia'
},
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
{
name: 'styles',
items: ['Styles', 'Format', 'Font', 'FontSize']
},
{
name: 'colors',
items: ['TextColor', 'BGColor']
},
{
name: 'tools',
items: ['Maximize', 'ShowBlocks']
},
// { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
{
name: 'editing',
items: ['Find', 'Replace']
},
// { name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
'/',
{
name: 'basicstyles',
items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']
},
{
name: 'paragraph',
items: [
'NumberedList',
'BulletedList',
'-',
'Outdent',
'Indent',
'-',
'Blockquote',
'CreateDiv',
'-',
'JustifyLeft',
'JustifyCenter',
'JustifyRight',
'JustifyBlock',
'-',
'BidiLtr',
'BidiRtl'
]
},
{
name: 'links',
items: ['Link', 'Unlink', 'Anchor']
},
{
name: 'insert',
items: ['Image', 'Table', 'HorizontalRule']
}
]
}))
},
updatePages() { updatePages() {
cAction.Course.getCourseDetail(this.cid, this.sid).then(json => { cAction.Course.getCourseDetail(this.cid, this.sid).then(json => {
/* 更新直播状态 */ /* 更新直播状态 */
...@@ -962,45 +876,32 @@ export default { ...@@ -962,45 +876,32 @@ export default {
onSubmitPublish() { onSubmitPublish() {
this.$refs.setPublishform.validate(valid => { this.$refs.setPublishform.validate(valid => {
if (valid) { if (valid) {
if (!this.ckeditor.getData()) { const loading = this.$loading({
this.$message.error('请输入正文内容') lock: true,
} else { text: '',
this.publish.contents = this.ckeditor.getData() spinner: '',
const loading = this.$loading({ background: 'rgba(255, 255, 255, 0.9)'
lock: true, })
text: '', cAction.Discuss.publishQues(this.publish)
spinner: '', .then(json => {
background: 'rgba(255, 255, 255, 0.9)' this.$message({ type: 'success', message: '问题发布成功' })
this.isPublicShow = false
this.params = {
path: `/${this.sid}/${this.cid}`,
request: 'getCourseDiscussList',
page: { limit: 10, offset: 0 }
}
this.$refs.setPublishform.resetFields()
// cAction.Discuss.getCourseDiscussList(this.cid, this.sid, this.param).then(json2 => {
// this.discussList = json2
// }).catch(e => { this.$message.error(e.message) }).finally(() => { })
})
.catch(e => {
this.$message.error(e.message)
})
.finally(() => {
loading.close()
}) })
cAction.Discuss.publishQues(this.publish)
.then(json => {
this.$message({
type: 'success',
message: '问题发布成功'
})
this.isPublicShow = false
this.params = {
path: `/${this.sid}/${this.cid}`,
request: 'getCourseDiscussList',
page: {
limit: 10,
offset: 0
}
}
// cAction.Discuss.getCourseDiscussList(this.cid, this.sid, this.param).then(json2 => {
// this.discussList = json2
// }).catch(e => { this.$message.error(e.message) }).finally(() => { })
})
.catch(e => {
this.$message.error(e.message)
})
.finally(() => {
loading.close()
})
}
} else {
this.$message.error('请输入标题')
return false
} }
}) })
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论