This commit is contained in:
qq787203167
2022-03-15 18:18:00 +08:00
4 changed files with 230 additions and 13 deletions
+103
View File
@@ -0,0 +1,103 @@
<!-- UEditor -->
<template>
<div>
<script id="editor" type="text/plain" ></script>
</div>
</template>
<script>
/* eslint-disable */
// import 'ueditor/example/public/ueditor/ueditor.config'
// import 'ueditor/example/public/ueditor/ueditor.all'
// import 'ueditor/example/public/ueditor/lang/zh-cn/zh-cn'
// import '@/../public/ueditor/ueditor.config.js'
// import '@/../public/ueditor/ueditor.all.js'
// import '@/../public/ueditor/lang/zh-cn/zh-cn.js'
export default {
name: 'UEditor',
data () {
return {
editor: null
}
},
methods: {
getUEContent: function () {
// return this.editor.ready(()=>{
// this.editor.getContent()
// })
return this.editor.getContent()
},
getContentTxt: function () {
return this.editor.getContentTxt()
},
setContent (content) {
return this.editor.ready(()=>{
this.editor.setContent(content,true)
})
},
// 清空内容
execCommand (content) {
return this.editor.execCommand('cleardoc')
},
getContentLength () {
return this.editor.getContentLength()
}
},
props: {
id: {
type: String
},
config: {
type: Object
},
fontfamily: {
type: String,
default: ''
},
fontsize: {
type: String,
default: ''
},
bold: {
type: Boolean,
default: false
},
content:{
type: String,
default: ''
}
},
watch: {
},
mounted () {
// 初始化UE
this.editor = UE.delEditor('editor')
this.editor = UE.getEditor('editor', this.config)
let _this = this
UE.getEditor('editor').addListener('blur',function(editor){
_this.$emit('editor-onChange', _this.getUEContent())
});
UE.getEditor('editor').ready(function() {
if (_this.fontfamily !== '') {
UE.getEditor('editor').execCommand( 'fontfamily',_this.fontfamily)
}
if (_this.content !== '') {
UE.getEditor('editor').setContent(_this.content)
}
if (_this.fontsize !== '') {
UE.getEditor('editor').execCommand( 'fontsize', _this.fontsize )
}
if (_this.bold) {
UE.getEditor('editor').execCommand('bold')
}
});
},
destoryed () {
this.editor.destory()
}
}
</script>
@@ -184,8 +184,8 @@
console.log("------------WebSocket连接成功");
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
let userId = store.getters.userInfo.id;
// let url = window._CONFIG['domianWebSocketURL'].replace("https://","wss://").replace("http://","ws://") + '/websocket/socketServer'
let url = 'http://139.9.235.66:8008/jero-boot'.replace("https://","wss://").replace("http://","ws://") + '/websocket/socketServer'
let url = window._CONFIG['domianWebSocketURL'].replace("https://","wss://").replace("http://","ws://") + '/websocket/socketServer'
// let url = 'http://139.9.235.66:8008/jero-boot'.replace("https://","wss://").replace("http://","ws://") + '/websocket/socketServer'
this.websock = new WebSocket(url);
this.websock.onopen = this.websocketOnopen;
this.websock.onerror = this.websocketOnerror;
@@ -201,7 +201,7 @@
this.timer = setInterval(() => {
try {
self.websock.send('test')
console.log('发送消息');
// console.log('发送消息');
}catch(err){
console.log('断开了' + err);
self.connection()
@@ -213,9 +213,9 @@
this.reconnect();
},
websocketOnmessage: function (e) {
console.log("WebSocket连接数据1111",e);
// console.log("WebSocket连接数据1111",e);
if(e.data=='1'){
console.log('data改变')
// console.log('data改变')
eventBUs.$emit('searchReset')
}
},
@@ -117,6 +117,17 @@
</a-modal>
<!-- 上传图片弹框-->
<split-upload v-if="splitVisible" ref="uploadFile2" :disabled="disabled" :accept="accept" :title="titleImg" :listType='listType' :splitVisible="splitVisible" @uploadSuccess="uploadSuccess"></split-upload>
<!-- 表格弹框-->
<a-modal
:title="titleTable"
class="split-title"
:visible="tableVisible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
>
<!-- <u-editor :content="ueContent" :config=config ref="ueditor" @editor-onChange="uEditorChange"></u-editor>-->
</a-modal>
</a-drawer>
</div>
</div>
@@ -125,13 +136,16 @@
<script>
import Vue from 'vue'
import splitUpload from '@/components/splitUpload/index'
// import uEditor from '@/components/ueditor/index'
export default {
name: 'splitAddForm',
components:{
splitUpload
splitUpload,
// uEditor
},
data(){
return{
titleTable:'表格',
title:this.$t('newClause'),
TitlePreImg:'',
contentList:[
@@ -182,8 +196,105 @@
splitVisible:false,
tableVisible:false,
preImgVisible:false, //图片预览
itemSrc:'' //预览图片
itemSrc:'', //预览图片
ueContent: '',
// UE编辑器配置
config: {
// 可以在此处定义工具栏的内容
toolbars: [
[
'undo', // 撤销
'redo', // 重做
'bold', // 加粗
'italic', // 斜体
'underline', // 下划线
'strikethrough', // 删除线
'subscript', // 下标
'superscript', // 上标
'fontborder', // 字符边框
'fontfamily', // 字体
'fontsize', // 字号
'forecolor', // 字体颜色
// 'backcolor', // 背景色
'paragraph', // 段落格式
'customstyle', // 自定义标题
'indent', // 首行缩进
'justifyleft', // 居左对齐
'justifyright', // 居右对齐
'justifycenter', // 居中对齐
'justifyjustify', // 两端对齐
'lineheight', // 行间距,
'rowspacingtop', // 段前距
'rowspacingbottom', // 段后距
'directionalityltr', // 从左向右输入
'directionalityrtl', // 从右向左输入
'fullscreen' // 全屏
],
[
'cleardoc', // 清空文档
'formatmatch', // 格式刷
'removeformat', // 清除格式
'source', // 源代码
'blockquote', // 引用
'pasteplain', // 纯文本粘贴模式
'selectall', // 全选
'horizontal', // 分隔线
'time', // 时间
'date', // 日期
'link', // 超链接
'unlink', // 取消链接
// 'background', // 背景
// 'simpleupload', // 单图上传
'imagenone', // 默认
'imageleft', // 左浮动
'imageright', // 右浮动
'imagecenter', // 居中
'touppercase', // 字母大写
'tolowercase', // 字母小写
'emotion', // 表情
'spechars', // 特殊字符
'searchreplace', // 查询替换
'insertunorderedlist', // 无序列表
'insertorderedlist', // 有序列表
'pagebreak', // 分页
'insertframe', // 插入Iframe
'charts', // 图表
'edittip ', // 编辑提示
'autotypeset', // 自动排版
'drafts' // 从草稿箱加载
],
[
'inserttable', // 插入表格
'deletetable', // 删除表格,
'insertparagraphbeforetable', // ”表格前插入行”
'insertrow', // 前插入行
'insertcol', // 前插入列
'mergeright', // 右合并单元格
'mergedown', // 下合并单元格
'deleterow', // 删除行
'deletecol', // 删除列
'splittorows', // 拆分成行
'splittocols', // 拆分成列
'splittocells', // 完全拆分单元格
'inserttitle', // 插入标题
'deletecaption', // 删除表格标题,
'mergecells', // 合并多个单元格
'edittable', // 表格属性
'edittd' // 单元格属性
]
],
autoHeightEnabled: false,
autoFloatEnabled: false,
initialContent: '', // 初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
autoClearinitialContent: true, // 是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
initialFrameWidth: 650,
elementPathEnabled: false,
initialFrameHeight: 300,
maximumWords: 4000,
BaseUrl: '',
UEDITOR_HOME_URL: 'ueditor/',
editTableIndex: 1
},
}
},
props:{
@@ -294,6 +405,9 @@
handlePreImgCancel(){
this.preImgVisible=false
},
uEditorChange () {
this.itemContent = this.$refs.ueditor.getUEContent()
},
//正则替换小数点
limitNumber(value) {
if (typeof value === 'string') {
@@ -92,31 +92,31 @@
title: this.$t('ChineseName'),
align: "center",
width: 100,
dataIndex: 'dbFieldTxt_dictText',
dataIndex: 'dbFieldTxt',
},
{
title: this.$t('enName'),
align: "center",
width: 100,
dataIndex: 'dbFieldEnName_dictText',
dataIndex: 'dbFieldEnName',
},
{
title: this.$t('AttributeType'),
align: "center",
width: 100,
dataIndex: 'fieldShowType_dictText',
dataIndex: 'fieldShowTypeName',
},
{
title: this.$t('FieldLength'),
align: "center",
width: 80,
dataIndex: 'dbLength_dictText'
dataIndex: 'dbLength'
},
{
title: this.$t('DisplayOrder'),
align: "center",
width: 80,
dataIndex: 'orderNum_dictText'
dataIndex: 'orderNum'
},
{
title: this.$t('DisplayArea'),