集成Ueditor
# 说明
使用Ueditor富文本编辑器
# 配置项相关
# 前端(下面的步骤,在框架的更新包里面已经包含了)
# 1,安装:
npm install vue-ueditor-wrap
1
# 2,拷贝框架文件:
public/tianggongPublic/UEditor文件夹到业务系统public/tianggongPublic/UEditor
# 3,在main.js中进行引入
import VueUeditorWrap from 'vue-ueditor-wrap';
const mountApp = async () => {
const app = createApp(App);
app.use(VueUeditorWrap)
}
1
2
3
4
5
2
3
4
5
# 4,测试示例
<vue-ueditor-wrap class="tg-ueditor" v-model="content"
:config="editorConfig"></vue-ueditor-wrap>
<script>
import {reactive, ref} from "vue";
let content=ref()
let editorConfig = reactive({
// 编辑器不自动被内容撑高
autoHeightEnabled: false,
// 初始容器高度
initialFrameHeight: 400,
//设置zindex的值
zIndex:3000,
// 初始容器宽度
initialFrameWidth: "100%",
UEDITOR_HOME_URL: "/tiangongPublic/UEditor/",
// UEDITOR_HOME_URL: `/${website.deployPrefix}/tiangongPublic/UEditor/`,//需要添加路由前缀的
})
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 后端
# 1,修改配置文件
默认是api的发布地址,如果是nginx的话,需要添加路由
project:
ueditor:
# server-url: http://192.168.106.189:80/tq 这个是添加nginx路由的地址
server-url: http://127.0.0.1:9528
1
2
3
4
5
2
3
4
5
# 2,升级pom版本号
<dependencies>
<!-- 天宫框架核心 -->
<dependency>
<groupId>com.eci</groupId>
<artifactId>tiangong-core</artifactId>
<version>2.2.1_release</version>
</dependency>
<!-- 天宫框架权限平台支持组件 -->
<dependency>
<groupId>com.eci</groupId>
<artifactId>tiangong-sso</artifactId>
<version>2.2.1_release</version>
</dependency>
<!-- 天宫框架系统组件 -->
<dependency>
<groupId>com.eci</groupId>
<artifactId>tiangong-system</artifactId>
<version>2.2.1_release</version>
</dependency>
<!-- 天宫框架三方库引用 -->
<dependency>
<groupId>com.eci</groupId>
<artifactId>tiangong-third</artifactId>
<version>2.2.1_release</version>
</dependency>
<!-- 后端通用组件-->
<dependency>
<groupId>com.eci</groupId>
<artifactId>tiangong-component</artifactId>
<version>2.2.1_release</version>
</dependency>
<!-- excel导入组件, (选用) -->
<dependency>
<groupId>com.eci</groupId>
<artifactId>tiangong-excel</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 3,拷贝配置文件
拷贝这个config.json的配置文件,resources/config/config.json config.json
{
"imageActionName":"uploadimage",
"imageFieldName":"upfile",
"imageMaxSize":2048000,
"imageAllowFiles":[
".png",
".jpg",
".jpeg",
".gif",
".bmp"
],
"imageCompressEnable":true,
"imageCompressBorder":1600,
"imageInsertAlign":"none",
"imageUrlPrefix":"",
"imagePathFormat":"/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"scrawlActionName":"uploadscrawl",
"scrawlFieldName":"upfile",
"scrawlPathFormat":"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"scrawlMaxSize":2048000,
"scrawlUrlPrefix":"",
"scrawlInsertAlign":"none",
"snapscreenActionName":"uploadimage",
"snapscreenPathFormat":"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"snapscreenUrlPrefix":"",
"snapscreenInsertAlign":"none",
"catcherLocalDomain":[
"127.0.0.1",
"localhost",
"img.baidu.com"
],
"catcherActionName":"catchimage",
"catcherFieldName":"source",
"catcherPathFormat":"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"catcherUrlPrefix":"",
"catcherMaxSize":2048000,
"catcherAllowFiles":[
".png",
".jpg",
".jpeg",
".gif",
".bmp"
],
"videoActionName":"uploadvideo",
"videoFieldName":"upfile",
"videoPathFormat":"/ueditor/jsp/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}",
"videoUrlPrefix":"",
"videoMaxSize":102400000,
"videoAllowFiles":[
".flv",
".swf",
".mkv",
".avi",
".rm",
".rmvb",
".mpeg",
".mpg",
".ogg",
".ogv",
".mov",
".wmv",
".mp4",
".webm",
".mp3",
".wav",
".mid"
],
"fileActionName":"uploadfile",
"fileFieldName":"upfile",
"filePathFormat":"/ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}",
"fileUrlPrefix":"",
"fileMaxSize":51200000,
"fileAllowFiles":[
".png",
".jpg",
".jpeg",
".gif",
".bmp",
".flv",
".swf",
".mkv",
".avi",
".rm",
".rmvb",
".mpeg",
".mpg",
".ogg",
".ogv",
".mov",
".wmv",
".mp4",
".webm",
".mp3",
".wav",
".mid",
".rar",
".zip",
".tar",
".gz",
".7z",
".bz2",
".cab",
".iso",
".doc",
".docx",
".xls",
".xlsx",
".ppt",
".pptx",
".pdf",
".txt",
".md",
".xml"
],
"imageManagerActionName":"listimage",
"imageManagerListPath":"/ueditor/jsp/upload/image/",
"imageManagerListSize":20,
"imageManagerUrlPrefix":"",
"imageManagerInsertAlign":"none",
"imageManagerAllowFiles":[
".png",
".jpg",
".jpeg",
".gif",
".bmp"
],
"fileManagerActionName":"listfile",
"fileManagerListPath":"/ueditor/jsp/upload/file/",
"fileManagerUrlPrefix":"",
"fileManagerListSize":20,
"fileManagerAllowFiles":[
".png",
".jpg",
".jpeg",
".gif",
".bmp",
".flv",
".swf",
".mkv",
".avi",
".rm",
".rmvb",
".mpeg",
".mpg",
".ogg",
".ogv",
".mov",
".wmv",
".mp4",
".webm",
".mp3",
".wav",
".mid",
".rar",
".zip",
".tar",
".gz",
".7z",
".bz2",
".cab",
".iso",
".doc",
".docx",
".xls",
".xlsx",
".ppt",
".pptx",
".pdf",
".txt",
".md",
".xml"
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
上次更新: 2024/7/18 10:32:53