洋浦学校八大中心 2022-08-11

init
gongdi 3 years ago
parent d27c16e171
commit 652c169d2f

@ -0,0 +1,121 @@
<template>
<div class="quill-editor-content">
<quillEditor
:options="editorOption"
ref="myQuillEditor"
v-model="contentHtml"
style="height: 200px"
></quillEditor>
<a-upload
name="file"
:beforeUpload="beforeUpload"
:customRequest="customRequest"
:showUploadList="false">
<span class="quill-upload"></span>
</a-upload>
</div>
</template>
<script>
import {quillEditor} from 'vue-quill-editor';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import {Upload} from 'ant-design-vue';
import GUID_UUID from '../../../global-llibs/guid-uuid'
import StaticParams from '../../../global-llibs/staticParams'
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // toggled buttons
['blockquote', 'code-block'],
[{header: 1}, {header: 2}], // custom button values
[{list: 'ordered'}, {list: 'bullet'}],
[{script: 'sub'}, {script: 'super'}], // superscript/subscript
[{indent: '-1'}, {indent: '+1'}], // outdent/indent
[{direction: 'rtl'}], // text direction
// [{size: ['small', false, 'large', 'huge']}], // custom dropdown
[{header: [1, 2, 3, 4, 5, 6, false]}],
[{color: []}, {background: []}], // dropdown with defaults from theme
// [{font: []}],
[{align: []}],
// ['link', 'image', 'video'],
['image'],
['clean'] // remove formatting button
]
export default{
props:{
content:{
default:""
},
},
components: {
quillEditor,
AUpload: Upload
},
watch:{
content:{
immediate:true, //handler
//handlercontentnewValue
handler(newValue,oldValue){
this.contentHtml = newValue;
}
}
},
data(){
return {
contentHtml:this.$props.content,
editorOption: {
modules: {
toolbar: {
container: toolbarOptions,
handlers: {
//
'image': function (value) {
document.querySelector('.quill-upload').click()
}
}
}
}
},
}
},
methods: {
beforeUpload: function (file) {
const fileName = file.name
const extension = fileName.substr(file.name.lastIndexOf('.') + 1)
const guid = GUID_UUID.guid().toUpperCase()
const key = "down/Material/" + guid.substring(0, 2) + "/" + guid + "." + extension
file.extension = extension
file.key = key
file.url = key
file.uid = guid
return true
},
//
customRequest: function (info) {
const {file, onSuccess, onProgress, onError} = info
StaticParams.uploadFile(file, (res) => {
if (res.success) {
let url = window.location.protocol + "//" + window.location.host + "/dsideal_yy/html/" + res.data.url;
const quill = this.$refs.myQuillEditor.quill
//
const pos = quill.getSelection().index
//
quill.insertEmbed(pos, 'image', url)
} else {
console.log("图片插入失败")
}
}
)
},
getContent:function () {
return this.contentHtml;
}
}
}
</script>
<style lang="scss" scoped>
</style>

@ -4,7 +4,7 @@
<script>
import Editor from 'wangeditor';
import Common from '../../../utils/common'
import Common from '../../../utils/common';
export default {
name: "RichEditor",
props:{

@ -118,6 +118,10 @@
type: Boolean,
default: true
},
canViewDownload:{
type: Boolean,
default: true
},
emptyImgShow: {
type: Boolean,
default: false
@ -330,7 +334,11 @@
}
let url = "";
if (this.BaseConfig.isSZUpload) {
url = "intellioa/java/sys/cloudPlatform/insert_resource_base_info";
if(this.BaseConfig.isCloud){
url = "res/insert_resource_base_info";
}else {
url = "intellioa/java/sys/cloudPlatform/insert_resource_base_info";
}
} else {
url = "res/insert_resource_base_info";
}

@ -5,7 +5,9 @@ import PublicFn from './public';
import interfaceConfig from './axios-config';
import Base64 from './base64'
const isSZUpload = true;//是否使用苏州版本上传附件地址
const isCloud = true;//是否云环境 插入图片资源接口路径切换
PublicFn.isSZUpload = isSZUpload;
PublicFn.isCloud = isCloud;
/**
* 配置信息 - 公共方法
* @type {{}}
@ -508,4 +510,5 @@ BaseConfig.projectUrl = {
// 添加方法库
BaseConfig.ConfigFn = ConfigFn;
BaseConfig.isSZUpload = isSZUpload;//是否苏州版本上传附件方式
BaseConfig.isCloud = isCloud;//是否云环境
export default BaseConfig;

@ -766,7 +766,11 @@ StaticParams.insertResource = (result, file, guid, name, extend, callback) => {
}
let url = "";
if(BaseConfig.isSZUpload){
url = "intellioa/java/sys/cloudPlatform/insert_resource_base_info";
if(BaseConfig.isCloud){
url = "res/insert_resource_base_info";
}else {
url = "intellioa/java/sys/cloudPlatform/insert_resource_base_info";
}
}else {
url = "res/insert_resource_base_info";
}

@ -13,6 +13,7 @@
<Upload :type="2" :multiple="true" title="点击上传" :option="{}" :canDownload="false"
:fileData="coverJson"
ref="fileUpload"
:canViewDownload="false"
@uploadComplete="uploadComplete"
/>
</div>
@ -20,7 +21,9 @@
<div class="add-record-row-style">
<div class="li-box li-left"><span class="must-option-style">*</span>正文</div>
<div class="li-box li-right">
<rich-editor editorId="defaultValueEditor" ref="editor" :content="infoContent"/>
<!--<rich-editor editorId="defaultValueEditor" ref="editor" :content="infoContent"/>-->
<!--<wang-editor></wang-editor>-->
<my-editor ref="myEditor" :content="infoContent"></my-editor>
</div>
</div>
<div class="add-record-row-style button-row-style">
@ -35,8 +38,12 @@
<script>
import {Input, Button, Modal, Spin} from 'ant-design-vue';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
import RichEditor from '../../../../../../components/common/richEditor/RichEditor.vue';
// import RichEditor from '../../../../../../components/common/richEditor/RichEditor.vue';
// import WangEditor from '../../../../../../components/common/wangEditor/wangEditor.vue';
import MyEditor from '../../../../../../components/common/myEditor/myEditor.vue';
import InterConfig from '../interConfig';
import Base64 from '../../../../../../global-llibs/base64';
export default{
props: ["id", "name", "infoId"],
data(){
@ -70,7 +77,7 @@
},
//
submit: function () {
this.infoContent = this.$refs.editor.getHtml();
this.infoContent = this.$refs.myEditor.getContent();
if (this.infoTitle === "") {
Modal.warning({
title: "请填写标题",
@ -98,7 +105,7 @@
infoId: this.$props.infoId,
infoTitle: this.infoTitle,
coverJson: this.coverJson,
infoContent: this.infoContent
infoContent: "ab"+Base64.encode(this.infoContent)
}
this.$emit("submit", param)
},
@ -132,7 +139,9 @@
AInput: Input,
ASpin: Spin,
Upload,
RichEditor,
// RichEditor,
// WangEditor,
MyEditor,
AButton: Button,
AModal: Modal
}

@ -9,6 +9,7 @@
<a-date-picker :locale="locale"
v-model="courseDate"
:format="dateFormat"
:getCalendarContainer="getCalendarContainer()"
@change="onChange"/>
<span style="margin:0 0.5rem">课程地点</span>
<a-input v-model="coursePlace"/>
@ -211,7 +212,10 @@
handleCancel: function () {
this.courseId = "";
this.visible = false;
}
},
getCalendarContainer: function () {
return triggerNode => triggerNode.parentNode;
},
},
components: {
ATable: Table,

@ -53,8 +53,8 @@
</script>
<style scoped lang="scss">
.course-schedule-query-box-style {
width: 400px;
height: 380px;
width: 400px !important;
height: 380px !important;
display: flex;
.timetable {

@ -452,8 +452,8 @@
</script>
<style scoped lang="scss" type="text/scss">
.parenting-classes-box-style {
width: 800px;
height: 450px;
width: 800px !important;
height: 450px !important;
display: flex;
/deep/ .ant-spin-nested-loading {

@ -68,8 +68,8 @@
</script>
<style scoped lang="scss">
.platform-through-train-box-style {
width: 400px;
height: 200px;
width: 400px !important;
height: 200px !important;
display: flex;
.platform-through-train {

@ -320,8 +320,8 @@
}
.poverty-alleviation-box-style {
width: 600px;
height: 450px;
width: 600px !important;
height: 450px !important;
display: flex;
.timeline-style {

@ -105,8 +105,8 @@
</script>
<style scoped lang="scss" type="text/scss">
.principal-mailbox-box-style {
width: 400px;
height: 200px;
width: 400px !important;
height: 200px !important;
display: flex;
/deep/ .ant-spin-nested-loading {

@ -194,8 +194,8 @@
}
.recipes-box-style {
width: 800px;
height: 380px;
width: 800px !important;
height: 380px !important;
display: flex;
.brandCreat {

@ -151,8 +151,8 @@
</script>
<style scoped lang="scss" type="text/scss">
.student-activities-box-style {
width: 600px;
height: 380px;
width: 600px !important;
height: 380px !important;
display: flex;
.brandCreat {

Loading…
Cancel
Save