sun-form-v3 1.0.70 → 1.0.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/abap-DfvySaIJ.js +1404 -0
- package/dist/apex-B__0irD3.js +332 -0
- package/dist/assets/css.worker-OK053IOu.js +84 -0
- package/dist/assets/editor.worker-D9iUZyMP.js +11 -0
- package/dist/assets/html.worker-CL40hqKM.js +458 -0
- package/dist/assets/json.worker-6f9bhSHY.js +42 -0
- package/dist/assets/ts.worker-B6g3wjaE.js +37021 -0
- package/dist/azcli-CDMGhRmx.js +74 -0
- package/dist/bat-0Mk8aqzx.js +106 -0
- package/dist/bicep-BBi_I06Z.js +108 -0
- package/dist/cameligo-D0G_Zm6X.js +180 -0
- package/dist/clojure-o2ZKLeMp.js +767 -0
- package/dist/coffee-DOQff5VC.js +238 -0
- package/dist/cpp-CQGJnWhD.js +395 -0
- package/dist/csharp-C1jLsHl8.js +332 -0
- package/dist/csp-C_ttMQaW.js +59 -0
- package/dist/css-BC202kVV.js +193 -0
- package/dist/cssMode-D3INtz5D.js +1541 -0
- package/dist/cypher-DwtEH7Fi.js +269 -0
- package/dist/dart-D9XknsP2.js +287 -0
- package/dist/dockerfile-DgsNjqqa.js +136 -0
- package/dist/ecl-BAMCHBl6.js +462 -0
- package/dist/elixir-CegIttP8.js +575 -0
- package/dist/favicon.ico +0 -0
- package/dist/flow9-9608t7UV.js +148 -0
- package/dist/freemarker2-hasIzj0A.js +995 -0
- package/dist/fsharp-CCtt9-1_.js +223 -0
- package/dist/go-CGUIPbct.js +224 -0
- package/dist/graphql-BNRIFFIn.js +157 -0
- package/dist/handlebars-Cqza9dif.js +425 -0
- package/dist/hcl-C__KLIXe.js +189 -0
- package/dist/html-QpDlLWtS.js +314 -0
- package/dist/htmlMode-3p93KT8l.js +1551 -0
- package/dist/index2-jkDcibEo.js +120443 -0
- package/dist/ini-CeKYn_zA.js +77 -0
- package/dist/java-Dm24deQl.js +238 -0
- package/dist/javascript-CSPB5Brm.js +76 -0
- package/dist/jsonMode-qA6pURD0.js +1957 -0
- package/dist/julia-BImNW7VE.js +517 -0
- package/dist/kotlin-BfE79GEb.js +259 -0
- package/dist/less-DglNOcaC.js +168 -0
- package/dist/lexon-BA0dRz9Q.js +163 -0
- package/dist/liquid-BWuASSim.js +246 -0
- package/dist/lua-DMkWzJcm.js +168 -0
- package/dist/m3-sA-5shO8.js +216 -0
- package/dist/markdown-OYRB1igA.js +235 -0
- package/dist/mdx-CnHJXO9F.js +171 -0
- package/dist/mips-rRzkJ_7G.js +204 -0
- package/dist/msdax-DoVJdUhd.js +381 -0
- package/dist/mysql-Ty44IHXo.js +884 -0
- package/dist/objective-c-VUfyhYrA.js +189 -0
- package/dist/pascal-DkASiYyw.js +257 -0
- package/dist/pascaligo-p-ELPlVO.js +170 -0
- package/dist/perl-Cjl1FxLZ.js +632 -0
- package/dist/pgsql-DjVenF7s.js +857 -0
- package/dist/php-CwvGzZOO.js +506 -0
- package/dist/pla-Br1iaBIV.js +143 -0
- package/dist/postiats-BaeP8zZY.js +913 -0
- package/dist/powerquery-CLCshuo8.js +896 -0
- package/dist/powershell-CZV50w5N.js +245 -0
- package/dist/protobuf-MV3XTewJ.js +426 -0
- package/dist/pug-DkDg4c4l.js +408 -0
- package/dist/python-CRYsEVap.js +282 -0
- package/dist/qsharp-BAtiKA97.js +291 -0
- package/dist/r-8ocrd-h-.js +249 -0
- package/dist/razor-DyEtGntt.js +556 -0
- package/dist/redis-9sZiddxc.js +308 -0
- package/dist/redshift-DQfTOGC0.js +815 -0
- package/dist/restructuredtext-DXU-vkgr.js +180 -0
- package/dist/ruby-DotfqwMf.js +517 -0
- package/dist/rust-BIauJ5KN.js +349 -0
- package/dist/sb-CmWMvDEV.js +121 -0
- package/dist/scala-C81brEbk.js +376 -0
- package/dist/scheme-D0pcFz2x.js +114 -0
- package/dist/scss-BOdN2fGG.js +268 -0
- package/dist/shell-6E09eAkU.js +227 -0
- package/dist/solidity-CWStzA1K.js +1373 -0
- package/dist/sophia-76Sb6CWe.js +205 -0
- package/dist/sparql-BmZTkOWT.js +207 -0
- package/dist/sql-Cs9TBAW5.js +859 -0
- package/dist/st-B-rqE1Bu.js +422 -0
- package/dist/style.css +1 -0
- package/dist/sun-form-v3.es.js +4 -0
- package/dist/sun-form-v3.umd.js +1902 -0
- package/dist/swift-Btsj6YxQ.js +318 -0
- package/dist/systemverilog-B3RHBRa2.js +582 -0
- package/dist/tcl-Dpj776pn.js +238 -0
- package/dist/tsMode-BrlIPEQw.js +885 -0
- package/dist/twig-Bb9JmBsE.js +398 -0
- package/dist/typescript-CYTudnTM.js +349 -0
- package/dist/typespec-CDWeg3SU.js +123 -0
- package/dist/vb-DEXnYwEI.js +378 -0
- package/dist/wgsl-D602c1lx.js +445 -0
- package/dist/xml-B-x5164u.js +101 -0
- package/dist/yaml-Buq2hM65.js +212 -0
- package/package.json +5 -8
- package/src/App.vue +0 -9
- package/src/assets/font/YouSheBiaoTiHei-2.ttf +0 -0
- package/src/assets/font/demo.css +0 -539
- package/src/assets/font/demo_index.html +0 -1200
- package/src/assets/font/iconfont.css +0 -191
- package/src/assets/font/iconfont.js +0 -1
- package/src/assets/font/iconfont.json +0 -317
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/font/iconfont.woff2 +0 -0
- package/src/assets/img/bg_footer.png +0 -0
- package/src/assets/img/bg_title.png +0 -0
- package/src/assets/img/file.png +0 -0
- package/src/assets/img/logo.png +0 -0
- package/src/assets/img/logo2.png +0 -0
- package/src/assets/img/logo22.png +0 -0
- package/src/assets/img/logo23.png +0 -0
- package/src/assets/img/logo3.png +0 -0
- package/src/assets/img//347/237/251/345/275/242@2x.png +0 -0
- package/src/assets/logo.svg +0 -1
- package/src/assets/styles/element/index.scss +0 -15
- package/src/assets/styles/index.css +0 -3
- package/src/components/a.js +0 -14
- package/src/components/aDesigner/config.vue +0 -127
- package/src/components/aDesigner/design.vue +0 -20
- package/src/components/aDesigner/designer.js +0 -342
- package/src/components/aDesigner/http.js +0 -292
- package/src/components/aDesigner/index.vue +0 -144
- package/src/components/aDesigner/panel.vue +0 -144
- package/src/components/aDesigner/show.vue +0 -24
- package/src/components/widgetCommonComps/commonApiConfig/index.vue +0 -194
- package/src/components/widgetCommonComps/commonCard/index.vue +0 -36
- package/src/components/widgetCommonComps/commonCodeEditor/editor.vue +0 -219
- package/src/components/widgetCommonComps/commonCodeEditor/modalEditor.vue +0 -68
- package/src/components/widgetCommonComps/commonCollapseCard/index.vue +0 -10
- package/src/components/widgetCommonComps/commonContainer/index.vue +0 -95
- package/src/components/widgetCommonComps/commonJsonInput/index.vue +0 -59
- package/src/components/widgetCommonComps/commonLabelContainer/index.vue +0 -39
- package/src/components/widgetCommonComps/commonSidetree/index.vue +0 -61
- package/src/components/widgetCommonComps/commonTypeInput/index.vue +0 -75
- package/src/components/widgetCommonComps/commonWidgetLabelContainer/index.vue +0 -55
- package/src/components/widgetCommonComps/index copy.js +0 -17
- package/src/components/widgetCommonComps/index.js +0 -17
- package/src/components/widgetConfigComps/config-input/index.vue +0 -60
- package/src/components/widgetConfigComps/index copy.js +0 -13
- package/src/components/widgetConfigComps/index.js +0 -17
- package/src/components/widgetShowComps/index.js +0 -29
- package/src/components/widgetShowComps/widget-form/index.vue +0 -43
- package/src/components/widgetShowComps/widget-homepage/index.vue +0 -41
- package/src/components/widgetShowComps/widget-input/index.vue +0 -85
- package/src/components/widgetShowComps/widget-select/index.vue +0 -31
- package/src/designer.js +0 -342
- package/src/http.js +0 -293
- package/src/index.js +0 -24
- package/src/index2.js +0 -23
- package/src/main.js +0 -19
- package/src/remark.js +0 -708
- package/src/testBtn.vue +0 -11
- package/src/testInput.vue +0 -12
- package/src/util/jsformat.js +0 -568
- package/src/widgetConfig.js +0 -1112
@@ -1,292 +0,0 @@
|
|
1
|
-
import axios from 'axios'
|
2
|
-
import qs from 'qs'
|
3
|
-
import {
|
4
|
-
ElNotification
|
5
|
-
} from 'element-plus'
|
6
|
-
/**
|
7
|
-
* Http类用于封装HTTP请求
|
8
|
-
* 提供了多种请求方法,如GET、POST、PUT、DELETE等
|
9
|
-
* 支持设置基础URL、请求头、超时时间等选项
|
10
|
-
* 可以自定义请求成功和失败的处理函数
|
11
|
-
*/
|
12
|
-
class Http {
|
13
|
-
/**
|
14
|
-
* 构造函数初始化Http对象
|
15
|
-
* @param {Object} options 配置选项,包括baseUrl、headers、timeout、httpSuccessHandle、httpErrorHandle、httpBeforeSendHandle
|
16
|
-
*/
|
17
|
-
constructor({
|
18
|
-
baseUrl = "",
|
19
|
-
headers = {},
|
20
|
-
timeout = 1000000,
|
21
|
-
httpSuccessHandle = null,
|
22
|
-
httpErrorHandle = null,
|
23
|
-
httpBeforeSendHandle = null
|
24
|
-
}) {
|
25
|
-
this.options = {
|
26
|
-
baseUrl,
|
27
|
-
headers,
|
28
|
-
timeout,
|
29
|
-
httpSuccessHandle,
|
30
|
-
httpErrorHandle,
|
31
|
-
httpBeforeSendHandle
|
32
|
-
}
|
33
|
-
// 定义不同Content-Type的headers
|
34
|
-
this.formDataHeader = {
|
35
|
-
'Content-Type': 'application/x-www-form-urlencoded'
|
36
|
-
}
|
37
|
-
this.formFileHeader = {
|
38
|
-
'Content-Type': 'multipart/form-data'
|
39
|
-
}
|
40
|
-
this.jsonHeader = {
|
41
|
-
'Content-Type': 'application/json'
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
/**
|
46
|
-
* 处理请求参数
|
47
|
-
* @param {any} data 请求参数
|
48
|
-
* @returns 处理后的请求参数
|
49
|
-
*/
|
50
|
-
paramHandle(data) {
|
51
|
-
// 如果data是数组,直接返回
|
52
|
-
if (data instanceof Array) {
|
53
|
-
return data;
|
54
|
-
}
|
55
|
-
// 如果data不是对象,直接返回
|
56
|
-
if (typeof data !== 'object') {
|
57
|
-
return data
|
58
|
-
}
|
59
|
-
// 如果data存在,返回合并后的对象
|
60
|
-
if (data) {
|
61
|
-
return Object.assign({}, this.httpBeforeSendHandle ? this.httpBeforeSendHandle() || {} : {}, data)
|
62
|
-
} else {
|
63
|
-
// 如果data不存在,仅返回httpBeforeSendHandle处理的结果
|
64
|
-
return this.httpBeforeSendHandle()
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
/**
|
69
|
-
* 发送请求
|
70
|
-
* @param {Object} config 请求配置,包括url、method、params、data、headers等
|
71
|
-
* @returns 返回axios发送请求的Promise
|
72
|
-
*/
|
73
|
-
send(config) {
|
74
|
-
// 创建axios实例
|
75
|
-
const api = axios.create({
|
76
|
-
baseURL: this.options.baseUrl,
|
77
|
-
timeout: this.options.timeout,
|
78
|
-
responseType: 'json'
|
79
|
-
})
|
80
|
-
// 请求拦截器,设置请求头
|
81
|
-
api.interceptors.request.use(
|
82
|
-
request => {
|
83
|
-
if (this.options.headers) {
|
84
|
-
for (var key in this.options.headers) {
|
85
|
-
request.headers[key] = headers[key]
|
86
|
-
}
|
87
|
-
}
|
88
|
-
return request
|
89
|
-
}
|
90
|
-
)
|
91
|
-
// 响应拦截器,处理请求成功和失败的情况
|
92
|
-
api.interceptors.response.use(
|
93
|
-
response => {
|
94
|
-
if (this.options.httpSuccessHandle) {
|
95
|
-
this.options.httpSuccessHandle(response.data)
|
96
|
-
}
|
97
|
-
return Promise.resolve(response.data)
|
98
|
-
},
|
99
|
-
error => {
|
100
|
-
if (this.options.httpErrorHandle) {
|
101
|
-
this.options.httpErrorHandle(error)
|
102
|
-
}
|
103
|
-
ElNotification({
|
104
|
-
title: '消息',
|
105
|
-
message: '数据请求失败',
|
106
|
-
type: 'error'
|
107
|
-
})
|
108
|
-
return Promise.reject(error)
|
109
|
-
}
|
110
|
-
)
|
111
|
-
// 发送请求
|
112
|
-
return api(config)
|
113
|
-
}
|
114
|
-
|
115
|
-
/**
|
116
|
-
* 发送GET请求
|
117
|
-
* @param {string} url 请求URL
|
118
|
-
* @param {any} data 请求参数
|
119
|
-
* @param {Object} headers 请求头
|
120
|
-
* @returns 返回发送GET请求的Promise
|
121
|
-
*/
|
122
|
-
get(url, data, headers) { //get请求
|
123
|
-
return this.send({
|
124
|
-
url: url,
|
125
|
-
method: 'get',
|
126
|
-
params: this.paramHandle(data),
|
127
|
-
headers: headers
|
128
|
-
})
|
129
|
-
}
|
130
|
-
|
131
|
-
/**
|
132
|
-
* 发送GET请求,返回Blob类型数据
|
133
|
-
* @param {string} url 请求URL
|
134
|
-
* @param {any} data 请求参数
|
135
|
-
* @param {Object} headers 请求头
|
136
|
-
* @returns 返回发送GET请求的Promise
|
137
|
-
*/
|
138
|
-
getBlob(url, data, headers) { //get请求
|
139
|
-
return this.send({
|
140
|
-
url: url,
|
141
|
-
method: 'get',
|
142
|
-
responseType: 'blob',
|
143
|
-
params: this.paramHandle(data),
|
144
|
-
headers: headers
|
145
|
-
})
|
146
|
-
}
|
147
|
-
|
148
|
-
/**
|
149
|
-
* 发送POST请求
|
150
|
-
* @param {string} url 请求URL
|
151
|
-
* @param {any} data 请求参数
|
152
|
-
* @param {Object} headers 请求头
|
153
|
-
* @returns 返回发送POST请求的Promise
|
154
|
-
*/
|
155
|
-
post(url, data, headers = {}) { //post请求
|
156
|
-
return this.send({
|
157
|
-
url: url,
|
158
|
-
method: 'post',
|
159
|
-
data: this.paramHandle(data),
|
160
|
-
headers: {
|
161
|
-
...headers,
|
162
|
-
...this.jsonHeader
|
163
|
-
}
|
164
|
-
})
|
165
|
-
}
|
166
|
-
|
167
|
-
/**
|
168
|
-
* 发送PUT请求
|
169
|
-
* @param {string} url 请求URL
|
170
|
-
* @param {any} data 请求参数
|
171
|
-
* @param {Object} headers 请求头
|
172
|
-
* @returns 返回发送PUT请求的Promise
|
173
|
-
*/
|
174
|
-
put(url, data, headers) { //put请求
|
175
|
-
return this.send({
|
176
|
-
url: url,
|
177
|
-
method: 'put',
|
178
|
-
data: this.paramHandle(data),
|
179
|
-
headers: headers
|
180
|
-
})
|
181
|
-
}
|
182
|
-
|
183
|
-
/**
|
184
|
-
* 发送PATCH请求
|
185
|
-
* @param {string} url 请求URL
|
186
|
-
* @param {any} data 请求参数
|
187
|
-
* @param {Object} headers 请求头
|
188
|
-
* @returns 返回发送PATCH请求的Promise
|
189
|
-
*/
|
190
|
-
patch(url, data, headers) { //patch请求
|
191
|
-
return this.send({
|
192
|
-
url: url,
|
193
|
-
method: 'patch',
|
194
|
-
data: this.paramHandle(data),
|
195
|
-
headers: headers
|
196
|
-
})
|
197
|
-
}
|
198
|
-
|
199
|
-
/**
|
200
|
-
* 发送DELETE请求
|
201
|
-
* @param {string} url 请求URL
|
202
|
-
* @param {any} data 请求参数
|
203
|
-
* @param {Object} headers 请求头
|
204
|
-
* @returns 返回发送DELETE请求的Promise
|
205
|
-
*/
|
206
|
-
delete(url, data, headers) { //delete请求
|
207
|
-
return this.send({
|
208
|
-
url: url,
|
209
|
-
method: 'delete',
|
210
|
-
params: this.paramHandle(data),
|
211
|
-
headers: headers
|
212
|
-
})
|
213
|
-
}
|
214
|
-
|
215
|
-
/**
|
216
|
-
* 发送使用FormData的POST请求
|
217
|
-
* @param {string} url 请求URL
|
218
|
-
* @param {any} data 请求参数
|
219
|
-
* @param {Object} headers 请求头
|
220
|
-
* @returns 返回发送POST请求的Promise
|
221
|
-
*/
|
222
|
-
postFormData(url, data, headers) { //formdata的post请求
|
223
|
-
return this.send({
|
224
|
-
url: url,
|
225
|
-
method: 'post',
|
226
|
-
data: qs.stringify(this.paramHandle(data)),
|
227
|
-
headers: {
|
228
|
-
...this.formDataHeader,
|
229
|
-
...headers
|
230
|
-
}
|
231
|
-
})
|
232
|
-
}
|
233
|
-
|
234
|
-
/**
|
235
|
-
* 发送上传文件的POST请求
|
236
|
-
* @param {string} url 请求URL
|
237
|
-
* @param {any} data 请求参数
|
238
|
-
* @param {Object} headers 请求头
|
239
|
-
* @returns 返回发送POST请求的Promise
|
240
|
-
*/
|
241
|
-
postFile(url, data, headers) { //formdata的post请求
|
242
|
-
return this.send({
|
243
|
-
url: url,
|
244
|
-
method: 'post',
|
245
|
-
data: data,
|
246
|
-
headers: {
|
247
|
-
...this.formDataHeader,
|
248
|
-
...headers
|
249
|
-
}
|
250
|
-
})
|
251
|
-
}
|
252
|
-
|
253
|
-
/**
|
254
|
-
* 发送使用FormData的PUT请求
|
255
|
-
* @param {string} url 请求URL
|
256
|
-
* @param {any} data 请求参数
|
257
|
-
* @param {Object} headers 请求头
|
258
|
-
* @returns 返回发送PUT请求的Promise
|
259
|
-
*/
|
260
|
-
putFormData(url, data, headers) { //formdata的put请求
|
261
|
-
return this.send({
|
262
|
-
url: url,
|
263
|
-
method: 'put',
|
264
|
-
data: qs.stringify(this.paramHandle(data)),
|
265
|
-
headers: {
|
266
|
-
...this.formDataHeader,
|
267
|
-
...headers
|
268
|
-
}
|
269
|
-
})
|
270
|
-
}
|
271
|
-
|
272
|
-
/**
|
273
|
-
* 发送使用FormData的PATCH请求
|
274
|
-
* @param {string} url 请求URL
|
275
|
-
* @param {any} data 请求参数
|
276
|
-
* @param {Object} headers 请求头
|
277
|
-
* @returns 返回发送PATCH请求的Promise
|
278
|
-
*/
|
279
|
-
patchFormData(url, data, headers) { //formdata的patch请求
|
280
|
-
return this.send({
|
281
|
-
url: url,
|
282
|
-
method: 'patch',
|
283
|
-
data: qs.stringify(this.paramHandle(data)),
|
284
|
-
headers: {
|
285
|
-
...this.formDataHeader,
|
286
|
-
...headers
|
287
|
-
}
|
288
|
-
})
|
289
|
-
}
|
290
|
-
|
291
|
-
}
|
292
|
-
export default Http
|
@@ -1,144 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="h-[100vh] bg-gray-100 flex flex-col ">
|
3
|
-
<div class="head px-4 py-2 bg-gray-50 flex justify-between items-center">
|
4
|
-
<div class="logo">
|
5
|
-
<img class="h-[32px]" src="../../assets/img/logo.png" alt="">
|
6
|
-
</div>
|
7
|
-
<div class="menu">
|
8
|
-
<el-popover placement="bottom" :width="360" trigger="click">
|
9
|
-
<template #reference>
|
10
|
-
<el-button class="mr-3">历史记录</el-button>
|
11
|
-
</template>
|
12
|
-
<el-table :row-style="rowStyleHandle" :data="designer.historyList" @row-click="clickRowHandle"
|
13
|
-
max-height="300">
|
14
|
-
<el-table-column property="id" label="变更组件">
|
15
|
-
<template #default="scope">
|
16
|
-
<div>{{ scope.row.widgetConfig.chosenId }}</div>
|
17
|
-
</template>
|
18
|
-
</el-table-column>
|
19
|
-
<el-table-column width="100" property="time" label="操作时间" />
|
20
|
-
</el-table>
|
21
|
-
</el-popover>
|
22
|
-
<el-button-group class="mr-3">
|
23
|
-
<el-button @click="goBack" :disabled="designer.historyIndex === 0">
|
24
|
-
<i :class="`iconfont icon-xianghou`"></i>
|
25
|
-
</el-button>
|
26
|
-
<el-button @click="goForward" :disabled="designer.historyIndex === designer.historyList.length - 1">
|
27
|
-
<i :class="`iconfont icon-xiangqian`"></i>
|
28
|
-
</el-button>
|
29
|
-
</el-button-group>
|
30
|
-
<el-button @click="clearWidgetConfig">重置</el-button>
|
31
|
-
<el-button type="primary" @click="preview">预览</el-button>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
<div class="content flex-1 flex border-t border-gray-200 overflow-hidden">
|
35
|
-
<!-- 左侧菜单栏 -->
|
36
|
-
<div class="left flex bg-gray-50 border-r border-gray-200">
|
37
|
-
<div class="w-12 border-r border-gray-200 pt-5">
|
38
|
-
<div class="btn_item" :class="{ active: data.activeSidebar === 0 }" @click="data.activeSidebar = 0">
|
39
|
-
<i :class="`iconfont icon-zujian`"></i>
|
40
|
-
</div>
|
41
|
-
<div class="btn_item" :class="{ active: data.activeSidebar === 1 }" @click="data.activeSidebar = 1">
|
42
|
-
<i :class="`iconfont icon-dagang`"></i>
|
43
|
-
</div>
|
44
|
-
<div class="btn_item" :class="{ active: data.activeSidebar === 2 }" @click="data.activeSidebar = 2">
|
45
|
-
<i :class="`iconfont icon-yuanma`"></i>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
<div class="w-80">
|
49
|
-
<panel :designer="designer" :activeSidebar="data.activeSidebar"></panel>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
<!-- 中间操作栏 -->
|
53
|
-
<div class="mid flex-1 py-2 px-2 box-border w-full h-full overflow-auto">
|
54
|
-
<div class="inner w-full h-full bg-gray-50 ">
|
55
|
-
<design :designer="designer"></design>
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
<!-- 右侧配置栏 -->
|
59
|
-
<div class="right bg-gray-50 w-80 border-l border-gray-200 overflow-y-auto overflow-x-hidden">
|
60
|
-
<config v-if="designer.chosenWidget" :designer="designer"></config>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
</div>
|
64
|
-
<vxe-modal transfer v-model="showModal" width="99%" height="99%" show-footer>
|
65
|
-
<template #title>
|
66
|
-
<span>预览表单</span>
|
67
|
-
</template>
|
68
|
-
<template #default>
|
69
|
-
<show v-if="showModal" :widgetConfig="compWidgetConfig"></show>
|
70
|
-
</template>
|
71
|
-
<template #footer>
|
72
|
-
<el-button icon="Close" size="small" @click="showModal=false">关闭</el-button>
|
73
|
-
</template>
|
74
|
-
</vxe-modal>
|
75
|
-
</template>
|
76
|
-
|
77
|
-
<script setup>
|
78
|
-
import { ref, reactive, watch } from 'vue';
|
79
|
-
import panel from './panel.vue'
|
80
|
-
import design from './design.vue'
|
81
|
-
import config from './config.vue'
|
82
|
-
import show from './show.vue'
|
83
|
-
|
84
|
-
import Designer from '../../designer'
|
85
|
-
|
86
|
-
import widgetConfigPanelData from '../../widgetConfig'
|
87
|
-
let initWidgetConfig = widgetConfigPanelData.homepage
|
88
|
-
let originInitData = JSON.parse(JSON.stringify(initWidgetConfig))
|
89
|
-
let showModal = ref(false)
|
90
|
-
let compWidgetConfig = null
|
91
|
-
let designer = reactive(new Designer({
|
92
|
-
widgetConfig: initWidgetConfig
|
93
|
-
}))
|
94
|
-
let data = reactive({
|
95
|
-
activeSidebar: 0,
|
96
|
-
})
|
97
|
-
const preview = ()=>{
|
98
|
-
compWidgetConfig=designer.$utils.clone(designer.widgetConfig, true)
|
99
|
-
showModal.value=true;
|
100
|
-
}
|
101
|
-
const clearWidgetConfig = () => {
|
102
|
-
designer.updateWidget("homepage", designer.$utils.clone(originInitData, true), true)
|
103
|
-
}
|
104
|
-
const clickRowHandle = (row) => {
|
105
|
-
designer.historyIndex = row.index
|
106
|
-
designer.updateByHistory(row.widgetConfig)
|
107
|
-
|
108
|
-
}
|
109
|
-
const rowStyleHandle = ({ row, rowIndex }) => {
|
110
|
-
if (designer.historyIndex === rowIndex) {
|
111
|
-
return {
|
112
|
-
color: 'rgb(85, 132, 255)',
|
113
|
-
fontWeight: "bold"
|
114
|
-
// background: "rgb(85, 132, 255)"
|
115
|
-
}
|
116
|
-
}
|
117
|
-
}
|
118
|
-
const goBack = () => {
|
119
|
-
if (designer.historyIndex > 0) {
|
120
|
-
designer.historyIndex--
|
121
|
-
designer.updateByHistory(designer.historyList[designer.historyIndex].widgetConfig)
|
122
|
-
}
|
123
|
-
}
|
124
|
-
const goForward = () => {
|
125
|
-
if (designer.historyIndex < designer.historyList.length - 1) {
|
126
|
-
designer.historyIndex++
|
127
|
-
designer.updateByHistory(designer.historyList[designer.historyIndex].widgetConfig)
|
128
|
-
}
|
129
|
-
}
|
130
|
-
defineOptions({ name: "designer" })
|
131
|
-
</script>
|
132
|
-
|
133
|
-
<style scoped lang="scss">
|
134
|
-
@import url("../../assets/font/iconfont.css");
|
135
|
-
|
136
|
-
.btn_item {
|
137
|
-
transition: all .3s;
|
138
|
-
@apply w-full flex items-center box-border border-l-4 border-transparent justify-center h-12 mb-3 cursor-pointer hover:bg-blue-50 hover:text-blue-700;
|
139
|
-
}
|
140
|
-
|
141
|
-
.active {
|
142
|
-
@apply border-blue-700 text-blue-700 bg-blue-50;
|
143
|
-
}
|
144
|
-
</style>
|
@@ -1,144 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="flex flex-col h-full" v-if="props.activeSidebar === 0">
|
3
|
-
<!-- 工具栏 -->
|
4
|
-
<div class="px-4 py-2 text-lg text-gray-900 border-b border-gray-200">组件库</div>
|
5
|
-
<!-- 组件内容 -->
|
6
|
-
<div class="flex-1 overflow-auto select-none">
|
7
|
-
<commonCard :title="'容器组件'" class="mb-1">
|
8
|
-
<draggable ghostClass="ghost" class="content_wrap flex flex-wrap flex-shrink-0 justify-between "
|
9
|
-
:list="panelListContainer" :group="{ name: 'dragGroup', pull: 'clone', put: false }" item-key="id"
|
10
|
-
:clone="handleWidgetClone" :sort="false">
|
11
|
-
<template #item="{ element }">
|
12
|
-
<div @click="handleWidgetClick(element)"
|
13
|
-
class="group items w-[47%] flex-shrink-0 px-2 py-2 border border-gray-200 my-2 rounded cursor-pointer hover:shadow-md">
|
14
|
-
<i :class="`iconfont icon-${element.type} text-blue-700 group-hover:text-blue-500`"></i>
|
15
|
-
<span class="text-sm ml-1 group-hover:text-blue-500"> {{ element.displayName }} </span>
|
16
|
-
</div>
|
17
|
-
</template>
|
18
|
-
</draggable>
|
19
|
-
</commonCard>
|
20
|
-
<commonCard :title="'表单组件'" class="mb-1">
|
21
|
-
<draggable ghostClass="ghost" class="content_wrap flex flex-wrap flex-shrink-0 justify-between "
|
22
|
-
:list="panelListForm" :group="{ name: 'dragGroup', pull: 'clone', put: false }" item-key="id"
|
23
|
-
:clone="handleWidgetClone" :sort="false">
|
24
|
-
<template #item="{ element }">
|
25
|
-
<div @click="handleWidgetClick(element)"
|
26
|
-
class="group items w-[47%] flex-shrink-0 px-2 py-2 border border-gray-200 my-2 rounded cursor-pointer hover:shadow-md">
|
27
|
-
<i :class="`iconfont icon-${element.type} text-blue-700 group-hover:text-blue-500`"></i>
|
28
|
-
<span class="text-sm ml-1 group-hover:text-blue-500"> {{ element.displayName }} </span>
|
29
|
-
</div>
|
30
|
-
</template>
|
31
|
-
</draggable>
|
32
|
-
</commonCard>
|
33
|
-
<commonCard :title="'其他组件'">
|
34
|
-
<draggable ghostClass="ghost" class="content_wrap flex flex-wrap flex-shrink-0 justify-between "
|
35
|
-
:list="panelListOrther" :group="{ name: 'dragGroup', pull: 'clone', put: false }" item-key="id"
|
36
|
-
:clone="handleWidgetClone" :sort="false">
|
37
|
-
<template #item="{ element }">
|
38
|
-
<div @click="handleWidgetClick(element)"
|
39
|
-
class="group items w-[47%] flex-shrink-0 px-2 py-2 border border-gray-200 my-2 rounded cursor-pointer hover:shadow-md">
|
40
|
-
<i :class="`iconfont icon-${element.type} text-blue-700 group-hover:text-blue-500`"></i>
|
41
|
-
<span class="text-sm ml-1 group-hover:text-blue-500"> {{ element.displayName }} </span>
|
42
|
-
</div>
|
43
|
-
</template>
|
44
|
-
</draggable>
|
45
|
-
</commonCard>
|
46
|
-
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
<!-- 大纲 -->
|
50
|
-
<div class="flex flex-col h-full" v-if="props.activeSidebar === 1">
|
51
|
-
<common-sidetree :designer="designer"></common-sidetree>
|
52
|
-
</div>
|
53
|
-
<!-- 源码 -->
|
54
|
-
<div class="flex flex-col h-full box-border p-2" v-if="props.activeSidebar === 2">
|
55
|
-
<common-code-editor class="flex-1" theme="vs-dark" ref="editor" :tabSize="2" :pure="true" :minimap="false"
|
56
|
-
language="json" v-model="codeString"></common-code-editor>
|
57
|
-
<el-button @click="updateWidget">立即应用配置</el-button>
|
58
|
-
</div>
|
59
|
-
</template>
|
60
|
-
|
61
|
-
|
62
|
-
<script setup>
|
63
|
-
import draggable from "vuedraggable/src/vuedraggable";
|
64
|
-
import commonCodeEditor from '../widgetCommonComps/commonCodeEditor/editor.vue'
|
65
|
-
import { ref, reactive, watch, toRaw } from 'vue';
|
66
|
-
import widgetConfig from '../../widgetConfig';
|
67
|
-
import { js_beautify } from "../../util/jsformat";
|
68
|
-
//获取参数props传参
|
69
|
-
let props = defineProps({
|
70
|
-
designer: {
|
71
|
-
type: Object,
|
72
|
-
default: {}
|
73
|
-
},
|
74
|
-
activeSidebar: {
|
75
|
-
type: Number,
|
76
|
-
default: 0
|
77
|
-
}
|
78
|
-
})
|
79
|
-
let designer = props.designer
|
80
|
-
let panelList = reactive(widgetConfig);
|
81
|
-
let panelListContainer = reactive([]);
|
82
|
-
let panelListForm = reactive([]);
|
83
|
-
let panelListOrther = reactive([]);
|
84
|
-
let codeString = ref("")
|
85
|
-
let editor = ref()
|
86
|
-
let handleWidgetClone = (e) => {
|
87
|
-
return designer.getChosenInitData(e)
|
88
|
-
}
|
89
|
-
let handleWidgetClick = (e) => {
|
90
|
-
let chosenWidget = designer.chosenWidget;
|
91
|
-
let obj = designer.getChosenInitData(e)
|
92
|
-
if (!chosenWidget) {//没有选中时候默认添加到homeWidgetList
|
93
|
-
let homeWidgetList = designer.widgetConfig.widgetList;
|
94
|
-
homeWidgetList.push(obj)
|
95
|
-
} else {//选中时候
|
96
|
-
if (chosenWidget.isContainer) {//如果选中组件是容器就添加到容器中
|
97
|
-
chosenWidget.widgetList.push(obj)
|
98
|
-
} else {//如果选中组件不是容器就添加到选中组件后面
|
99
|
-
let { widgetList, index } = designer.getParentWidgetById(chosenWidget.id);
|
100
|
-
widgetList.splice(index + 1, 0, obj)
|
101
|
-
}
|
102
|
-
}
|
103
|
-
}
|
104
|
-
for (let i in panelList) {
|
105
|
-
let item = panelList[i];
|
106
|
-
if (item.addToPanel !== false && i != 'homepage') {
|
107
|
-
item.type = i;
|
108
|
-
if (item.isContainer) {
|
109
|
-
panelListContainer.push(item);
|
110
|
-
} else if (item.isForm) {
|
111
|
-
panelListForm.push(item);
|
112
|
-
} else {
|
113
|
-
panelListOrther.push(item);
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}
|
117
|
-
const updateWidget = () => {
|
118
|
-
let chosenWidget = designer.chosenWidget;
|
119
|
-
designer.updateWidget(chosenWidget.id, JSON.parse(codeString.value))
|
120
|
-
|
121
|
-
}
|
122
|
-
watch(() => designer.widgetConfig, (val) => {
|
123
|
-
if (designer.chosenWidget) {
|
124
|
-
let str = js_beautify(JSON.stringify(designer.chosenWidget))
|
125
|
-
codeString.value = str
|
126
|
-
if (props.activeSidebar == 2) {
|
127
|
-
editor.value.setValue(str)
|
128
|
-
}
|
129
|
-
}
|
130
|
-
}, {
|
131
|
-
deep: true,
|
132
|
-
immediate: true
|
133
|
-
})
|
134
|
-
defineOptions({ name: "panel" })
|
135
|
-
|
136
|
-
</script>
|
137
|
-
|
138
|
-
<style scoped lang="scss">
|
139
|
-
@import url("../../assets/font/iconfont.css");
|
140
|
-
|
141
|
-
.ghost {
|
142
|
-
@apply max-h-0 overflow-hidden border border-blue-700 p-0 w-full;
|
143
|
-
}
|
144
|
-
</style>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<commonContainer class="h-full w-full" :widget="designer.widgetConfig" :designer="designer">
|
3
|
-
<widget-homepage :widget="designer.widgetConfig" :designer="designer"></widget-homepage>
|
4
|
-
</commonContainer>
|
5
|
-
</template>
|
6
|
-
|
7
|
-
<script setup>
|
8
|
-
import { ref, reactive } from 'vue';
|
9
|
-
import Designer from '../../designer'
|
10
|
-
let props = defineProps({
|
11
|
-
widgetConfig: {
|
12
|
-
type: Object,
|
13
|
-
default: {}
|
14
|
-
},
|
15
|
-
})
|
16
|
-
let designer = reactive(new Designer({
|
17
|
-
widgetConfig: props.widgetConfig,
|
18
|
-
showMode: true
|
19
|
-
}))
|
20
|
-
defineOptions({ name: "sunForm" })
|
21
|
-
|
22
|
-
</script>
|
23
|
-
|
24
|
-
<style scoped lang="scss"></style>
|