NEZ-2227 feat:text chart 富文本编辑器支持插入图片
This commit is contained in:
@@ -54,7 +54,6 @@ export default {
|
|||||||
// 覆盖默认上传图片
|
// 覆盖默认上传图片
|
||||||
const toolbar = this.quill.getModule('toolbar')
|
const toolbar = this.quill.getModule('toolbar')
|
||||||
toolbar.addHandler('image', (value) => {
|
toolbar.addHandler('image', (value) => {
|
||||||
this.uploadType = 'image'
|
|
||||||
if (value) {
|
if (value) {
|
||||||
this.$refs.upload.$children[0].$refs.input.click()
|
this.$refs.upload.$children[0].$refs.input.click()
|
||||||
} else {
|
} else {
|
||||||
@@ -106,6 +105,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 上传图片
|
// 上传图片
|
||||||
async uploadChange (file) {
|
async uploadChange (file) {
|
||||||
|
// 图片小于4M
|
||||||
const isLt4M = (file.size / 1024 / 1024) < 4
|
const isLt4M = (file.size / 1024 / 1024) < 4
|
||||||
if (isLt4M) {
|
if (isLt4M) {
|
||||||
console.log(this.$axios.defaults.baseURL + 'file/download/')
|
console.log(this.$axios.defaults.baseURL + 'file/download/')
|
||||||
@@ -142,29 +142,30 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.rich-text-editor .ql-editor{
|
|
||||||
overflow: auto !important;
|
|
||||||
}
|
|
||||||
.text-too-long{
|
|
||||||
color: #F56C6C;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1;
|
|
||||||
padding-top: 4px;
|
|
||||||
position: absolute;
|
|
||||||
top: 100%;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.rich-text-editor-error {
|
|
||||||
border: 1px solid #F56C6C;
|
|
||||||
}
|
|
||||||
.rich-text-editor-error .ql-container.ql-snow {
|
|
||||||
border: unset !important
|
|
||||||
}
|
|
||||||
|
|
||||||
.rich-text-editor-error .ql-toolbar.ql-snow{
|
.rich-text-editor .ql-editor{
|
||||||
border-top: unset !important;
|
overflow: auto !important;
|
||||||
border-left: unset !important;
|
}
|
||||||
border-right: unset !important;
|
.text-too-long{
|
||||||
}
|
color: #F56C6C;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1;
|
||||||
|
padding-top: 4px;
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
.rich-text-editor-error {
|
||||||
|
border: 1px solid #F56C6C;
|
||||||
|
}
|
||||||
|
.rich-text-editor-error .ql-container.ql-snow {
|
||||||
|
border: unset !important
|
||||||
|
}
|
||||||
|
|
||||||
|
.rich-text-editor-error .ql-toolbar.ql-snow{
|
||||||
|
border-top: unset !important;
|
||||||
|
border-left: unset !important;
|
||||||
|
border-right: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
<span>{{$t('overall.save')}}</span>
|
<span>{{$t('overall.save')}}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 预览-->
|
<!-- 预览 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-if="previewShow"
|
v-if="previewShow"
|
||||||
:visible.sync="previewShow"
|
:visible.sync="previewShow"
|
||||||
@@ -501,7 +501,7 @@ export default {
|
|||||||
preview (show) {
|
preview (show) {
|
||||||
if (show) {
|
if (show) {
|
||||||
this.prevChart = ''
|
this.prevChart = ''
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
const start = new Date().setHours(new Date().getHours() - 1)
|
const start = new Date().setHours(new Date().getHours() - 1)
|
||||||
const end = new Date()
|
const end = new Date()
|
||||||
this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)]
|
this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)]
|
||||||
|
|||||||
@@ -416,7 +416,3 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user