ts-glitter 13.6.6 → 13.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/glitterBundle/Glitter.js +7 -1
- package/lowcode/glitterBundle/Glitter.ts +7 -1
- package/lowcode/jspage/editor.js +24 -5
- package/lowcode/jspage/editor.ts +23 -4
- package/lowcode/jspage/function-page/main_editor.js +49 -4
- package/lowcode/jspage/function-page/main_editor.ts +63 -15
- package/lowcode/jspage/function-page/tool-setting.js +62 -56
- package/lowcode/jspage/function-page/tool-setting.ts +63 -57
- package/lowcode/official_event/e-commerce/get-count.js +25 -20
- package/lowcode/official_event/e-commerce/get-count.ts +30 -24
- package/lowcode/official_view_component/official/component.js +4 -0
- package/lowcode/official_view_component/official/component.ts +2 -0
- package/lowcode/public-components/headers/sy-02.js +326 -0
- package/lowcode/public-components/headers/sy-02.ts +324 -0
- package/lowcode/public-components/headers/sy-04.js +320 -0
- package/lowcode/public-components/headers/sy-04.ts +318 -0
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -59,7 +59,7 @@ export class Entry {
|
|
|
59
59
|
}
|
|
60
60
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
61
61
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
62
|
-
glitter.share.editerVersion = "V_13.6.
|
|
62
|
+
glitter.share.editerVersion = "V_13.6.9";
|
|
63
63
|
glitter.share.start = (new Date());
|
|
64
64
|
const vm = {
|
|
65
65
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -60,7 +60,7 @@ export class Entry {
|
|
|
60
60
|
}
|
|
61
61
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
62
62
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
63
|
-
glitter.share.editerVersion = "V_13.6.
|
|
63
|
+
glitter.share.editerVersion = "V_13.6.9";
|
|
64
64
|
glitter.share.start = (new Date());
|
|
65
65
|
const vm: {
|
|
66
66
|
appConfig: any;
|
|
@@ -756,16 +756,22 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
|
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
;
|
|
759
|
-
openDrawer() {
|
|
759
|
+
openDrawer(width) {
|
|
760
760
|
if (window.drawer !== undefined) {
|
|
761
761
|
$("#Navigation").show();
|
|
762
762
|
window.drawer.open();
|
|
763
|
+
if (width) {
|
|
764
|
+
document.querySelector('.hy-drawer-content').style.width = width + 'px';
|
|
765
|
+
}
|
|
763
766
|
}
|
|
764
767
|
else {
|
|
765
768
|
var timer = setInterval(function () {
|
|
766
769
|
if (window.drawer !== undefined) {
|
|
767
770
|
$("#Navigation").show();
|
|
768
771
|
window.drawer.open();
|
|
772
|
+
if (width) {
|
|
773
|
+
document.querySelector('.hy-drawer-content').style.width = width + 'px';
|
|
774
|
+
}
|
|
769
775
|
clearInterval(timer);
|
|
770
776
|
}
|
|
771
777
|
}, 100);
|
|
@@ -320,15 +320,21 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
|
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
322
|
|
|
323
|
-
public openDrawer() {
|
|
323
|
+
public openDrawer(width?:number) {
|
|
324
324
|
if ((window as any).drawer !== undefined) {
|
|
325
325
|
$("#Navigation").show();
|
|
326
326
|
(window as any).drawer.open();
|
|
327
|
+
if(width){
|
|
328
|
+
(document.querySelector('.hy-drawer-content') as any).style.width=width+'px'
|
|
329
|
+
}
|
|
327
330
|
} else {
|
|
328
331
|
var timer = setInterval(function () {
|
|
329
332
|
if ((window as any).drawer !== undefined) {
|
|
330
333
|
$("#Navigation").show();
|
|
331
334
|
(window as any).drawer.open();
|
|
335
|
+
if(width){
|
|
336
|
+
(document.querySelector('.hy-drawer-content') as any).style.width=width+'px'
|
|
337
|
+
}
|
|
332
338
|
clearInterval(timer);
|
|
333
339
|
}
|
|
334
340
|
}, 100);
|
package/lowcode/jspage/editor.js
CHANGED
|
@@ -1053,14 +1053,33 @@ color:white;
|
|
|
1053
1053
|
});
|
|
1054
1054
|
},
|
|
1055
1055
|
divCreate: () => {
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1056
|
+
if (gvc.glitter.getUrlParameter('function') !== 'page-editor') {
|
|
1057
|
+
return {
|
|
1058
|
+
elem: 'main',
|
|
1059
|
+
class: `docs-container`,
|
|
1060
|
+
style: `padding-top: ${EditorConfig.getPaddingTop(gvc) + 56}px;
|
|
1060
1061
|
padding-left:${size < 800 ? `0px;` : Storage.select_function === 'user-editor' ? `365px;` : `284px;`}
|
|
1061
1062
|
padding-right:0px;
|
|
1062
1063
|
${Storage.select_function === 'page-editor' ? `overflow:hidden;` : ``}`
|
|
1063
|
-
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
return {
|
|
1068
|
+
elem: 'main',
|
|
1069
|
+
class: `docs-container`,
|
|
1070
|
+
style: `padding-top: ${EditorConfig.getPaddingTop(gvc) + 56}px;
|
|
1071
|
+
padding-right:${(Storage.view_type === ViewType.col3 || Storage.view_type === ViewType.mobile) &&
|
|
1072
|
+
Storage.select_function !== 'backend-manger' &&
|
|
1073
|
+
Storage.select_function !== 'server-manager'
|
|
1074
|
+
? `290`
|
|
1075
|
+
: `0`}px;${Storage.view_type === ViewType.fullScreen
|
|
1076
|
+
? `padding-left:0px;`
|
|
1077
|
+
: `
|
|
1078
|
+
padding-left:${size < 800 ? `0px;` : Storage.select_function === 'user-editor' ? `365px;` : `284px;`}
|
|
1079
|
+
${Storage.select_function === 'page-editor' ? `overflow:hidden;` : ``}
|
|
1080
|
+
`}`
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1064
1083
|
},
|
|
1065
1084
|
};
|
|
1066
1085
|
})}
|
package/lowcode/jspage/editor.ts
CHANGED
|
@@ -1084,14 +1084,33 @@ color:white;
|
|
|
1084
1084
|
})
|
|
1085
1085
|
},
|
|
1086
1086
|
divCreate: () => {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1087
|
+
if(gvc.glitter.getUrlParameter('function')!=='page-editor'){
|
|
1088
|
+
return {
|
|
1089
|
+
elem: 'main',
|
|
1090
|
+
class: `docs-container`,
|
|
1091
|
+
style: `padding-top: ${EditorConfig.getPaddingTop(gvc) + 56}px;
|
|
1091
1092
|
padding-left:${size < 800 ? `0px;` : Storage.select_function === 'user-editor' ? `365px;` : `284px;`}
|
|
1092
1093
|
padding-right:0px;
|
|
1093
1094
|
${Storage.select_function === 'page-editor' ? `overflow:hidden;` : ``}`
|
|
1095
|
+
}
|
|
1096
|
+
}else{
|
|
1097
|
+
return {
|
|
1098
|
+
elem: 'main',
|
|
1099
|
+
class: `docs-container`,
|
|
1100
|
+
style: `padding-top: ${EditorConfig.getPaddingTop(gvc) + 56}px;
|
|
1101
|
+
padding-right:${(Storage.view_type === ViewType.col3 || Storage.view_type === ViewType.mobile) &&
|
|
1102
|
+
Storage.select_function !== 'backend-manger' &&
|
|
1103
|
+
Storage.select_function !== 'server-manager'
|
|
1104
|
+
? `290`
|
|
1105
|
+
: `0`}px;${Storage.view_type === ViewType.fullScreen
|
|
1106
|
+
? `padding-left:0px;`
|
|
1107
|
+
: `
|
|
1108
|
+
padding-left:${size < 800 ? `0px;` : Storage.select_function === 'user-editor' ? `365px;` : `284px;`}
|
|
1109
|
+
${Storage.select_function === 'page-editor' ? `overflow:hidden;` : ``}
|
|
1110
|
+
`}`
|
|
1111
|
+
}
|
|
1094
1112
|
}
|
|
1113
|
+
|
|
1095
1114
|
},
|
|
1096
1115
|
}
|
|
1097
1116
|
})}
|
|
@@ -1014,6 +1014,14 @@ export class Main_editor {
|
|
|
1014
1014
|
].join('');
|
|
1015
1015
|
}
|
|
1016
1016
|
static center(gvc) {
|
|
1017
|
+
if (gvc.glitter.getUrlParameter('function') === 'page-editor') {
|
|
1018
|
+
return Main_editor.developerEditor(gvc);
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
return Main_editor.userEditor(gvc);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
static userEditor(gvc) {
|
|
1017
1025
|
gvc.glitter.share.resetCenterFrame = () => {
|
|
1018
1026
|
const container_width = (() => {
|
|
1019
1027
|
if (Storage.view_type === ViewType.mobile) {
|
|
@@ -1176,14 +1184,15 @@ export class Main_editor {
|
|
|
1176
1184
|
style="height:40px;gap:7px;background: linear-gradient(143deg, #FFB400 -22.7%, #FF6C02 114.57%);color:white;">
|
|
1177
1185
|
<div class="fw-500 fs-6"
|
|
1178
1186
|
style="text-overflow: ellipsis;overflow: hidden !important;">
|
|
1179
|
-
|
|
1187
|
+
${gvc.glitter.share.editorViewModel.selectItem.label}
|
|
1180
1188
|
</div>
|
|
1181
1189
|
<div class="flex-fill"></div>
|
|
1182
1190
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1183
1191
|
style="font-size: 14px;color:black;"
|
|
1184
1192
|
onclick="${gvc.event(() => {
|
|
1185
1193
|
gvc.glitter.openDrawer();
|
|
1186
|
-
})}"
|
|
1194
|
+
})}">編輯
|
|
1195
|
+
</div>
|
|
1187
1196
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1188
1197
|
style="font-size: 14px;color:black;"
|
|
1189
1198
|
onclick="${gvc.event(() => {
|
|
@@ -1195,7 +1204,8 @@ export class Main_editor {
|
|
|
1195
1204
|
<div class="btn-group dropdown">
|
|
1196
1205
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1197
1206
|
style="font-size: 14px;color:black;"
|
|
1198
|
-
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1207
|
+
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1208
|
+
aria-expanded="false">貼上
|
|
1199
1209
|
</div>
|
|
1200
1210
|
<div class="dropdown-menu my-1">
|
|
1201
1211
|
<a class="dropdown-item" onclick="${gvc.event(() => {
|
|
@@ -1211,7 +1221,8 @@ export class Main_editor {
|
|
|
1211
1221
|
<div class="btn-group dropdown">
|
|
1212
1222
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1213
1223
|
style="font-size: 14px;color:black;"
|
|
1214
|
-
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1224
|
+
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1225
|
+
aria-expanded="false">新增
|
|
1215
1226
|
</div>
|
|
1216
1227
|
<div class="dropdown-menu my-1">
|
|
1217
1228
|
<a class="dropdown-item" onclick="${gvc.event(() => {
|
|
@@ -1257,6 +1268,40 @@ export class Main_editor {
|
|
|
1257
1268
|
};
|
|
1258
1269
|
});
|
|
1259
1270
|
}
|
|
1271
|
+
static developerEditor(gvc) {
|
|
1272
|
+
return gvc.bindView(() => {
|
|
1273
|
+
return {
|
|
1274
|
+
bind: 'iframe_center',
|
|
1275
|
+
view: () => {
|
|
1276
|
+
if (EditorConfig.backend_page() === 'backend-manger') {
|
|
1277
|
+
return html `
|
|
1278
|
+
<div class="position-relative"
|
|
1279
|
+
style="width:100%;height: 100%;padding-top:${parseInt(gvc.glitter.share.top_inset, 10)}px;"
|
|
1280
|
+
id="editerCenter">
|
|
1281
|
+
</div>`;
|
|
1282
|
+
}
|
|
1283
|
+
else {
|
|
1284
|
+
return html `
|
|
1285
|
+
<div class="position-relative"
|
|
1286
|
+
style="width:100%;height: calc(100%);${(parseInt(gvc.glitter.share.top_inset, 10)) ? `padding-top:${parseInt(gvc.glitter.share.top_inset, 10)}px;` : ``}"
|
|
1287
|
+
id="editerCenter">
|
|
1288
|
+
<iframe class="w-100 h-100 bg-white iframe_view"
|
|
1289
|
+
sandbox="allow-same-origin allow-scripts"
|
|
1290
|
+
src="${gvc.glitter.root_path}${gvc.glitter.getUrlParameter('page')}?type=htmlEditor&appName=${gvc.glitter.getUrlParameter('appName')}&device=${gvc.glitter.getUrlParameter('device')}"></iframe>
|
|
1291
|
+
</div>`;
|
|
1292
|
+
}
|
|
1293
|
+
},
|
|
1294
|
+
divCreate: () => {
|
|
1295
|
+
return {
|
|
1296
|
+
class: Storage.view_type === ViewType.mobile && (Storage.select_function === 'page-editor' || Storage.select_function === 'user-editor')
|
|
1297
|
+
? `d-flex align-items-center justify-content-center flex-column mx-auto` : `d-flex align-items-center justify-content-center flex-column`,
|
|
1298
|
+
style: Storage.view_type === ViewType.mobile && (Storage.select_function === 'page-editor' || Storage.select_function === 'user-editor')
|
|
1299
|
+
? `width: calc(${(document.body.clientWidth < 800) ? `${document.body.clientWidth}px` : `414px`});height: ${window.innerHeight - EditorConfig.getPaddingTop(gvc) - 56}px;` : `width: calc(${(document.body.clientWidth < 800) ? `${document.body.clientWidth}px` : `100%`});height: ${window.innerHeight - EditorConfig.getPaddingTop(gvc) - 56}px;overflow:hidden;`
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1260
1305
|
static pageAndComponent(option) {
|
|
1261
1306
|
const data = option.data;
|
|
1262
1307
|
const gvc = option.gvc;
|
|
@@ -1094,6 +1094,15 @@ export class Main_editor {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
1096
|
public static center(gvc: GVC) {
|
|
1097
|
+
if(gvc.glitter.getUrlParameter('function')==='page-editor'){
|
|
1098
|
+
return Main_editor.developerEditor(gvc)
|
|
1099
|
+
}else{
|
|
1100
|
+
return Main_editor.userEditor(gvc)
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
//用戶版本編輯器
|
|
1105
|
+
public static userEditor(gvc: GVC) {
|
|
1097
1106
|
gvc.glitter.share.resetCenterFrame = () => {
|
|
1098
1107
|
const container_width = (() => {
|
|
1099
1108
|
if (Storage.view_type === ViewType.mobile) {
|
|
@@ -1135,7 +1144,7 @@ export class Main_editor {
|
|
|
1135
1144
|
frame.style.left = `0`;
|
|
1136
1145
|
}
|
|
1137
1146
|
if (gvc.glitter.share.top_inset) {
|
|
1138
|
-
frame.style.top = `${parseInt(gvc.glitter.share.top_inset, 10)
|
|
1147
|
+
frame.style.top = `${parseInt(gvc.glitter.share.top_inset, 10) + tool_box + 10}px`;
|
|
1139
1148
|
} else {
|
|
1140
1149
|
frame.style.top = `${tool_box}px`;
|
|
1141
1150
|
}
|
|
@@ -1165,14 +1174,14 @@ export class Main_editor {
|
|
|
1165
1174
|
view: () => {
|
|
1166
1175
|
if (gvc.glitter.share.editorViewModel.selectItem) {
|
|
1167
1176
|
function addWidgetEvent(direction: number, component?: any) {
|
|
1168
|
-
const cf=gvc.glitter.share.editorViewModel.selectItem
|
|
1177
|
+
const cf = gvc.glitter.share.editorViewModel.selectItem
|
|
1169
1178
|
let glitter = (window as any).glitter;
|
|
1170
1179
|
while (!glitter.share.editorViewModel) {
|
|
1171
1180
|
glitter = (window.parent as any).glitter;
|
|
1172
1181
|
}
|
|
1173
1182
|
if (component) {
|
|
1174
|
-
component=JSON.parse(JSON.stringify(component))
|
|
1175
|
-
component.id=gvc.glitter.getUUID()
|
|
1183
|
+
component = JSON.parse(JSON.stringify(component))
|
|
1184
|
+
component.id = gvc.glitter.getUUID()
|
|
1176
1185
|
glitter.share.addWithIndex({
|
|
1177
1186
|
data: component,
|
|
1178
1187
|
index: cf.id,
|
|
@@ -1229,8 +1238,9 @@ export class Main_editor {
|
|
|
1229
1238
|
}
|
|
1230
1239
|
|
|
1231
1240
|
}
|
|
1232
|
-
|
|
1233
|
-
|
|
1241
|
+
|
|
1242
|
+
async function readAndPasteClipboardContent(index: number) {
|
|
1243
|
+
const dialog = new ShareDialog(gvc.glitter)
|
|
1234
1244
|
try {
|
|
1235
1245
|
// 使用 navigator.clipboard.readText() 方法取得剪貼簿的文字內容
|
|
1236
1246
|
const json: any = JSON.parse(await navigator.clipboard.readText());
|
|
@@ -1243,22 +1253,24 @@ export class Main_editor {
|
|
|
1243
1253
|
dialog.errorMessage({text: '請選擇要複製的元件,並按下複製元件。'})
|
|
1244
1254
|
}
|
|
1245
1255
|
}
|
|
1256
|
+
|
|
1246
1257
|
return html`
|
|
1247
1258
|
<div class="border-bottom d-flex align-items-center px-2 shadow"
|
|
1248
1259
|
style="height:40px;gap:7px;background: linear-gradient(143deg, #FFB400 -22.7%, #FF6C02 114.57%);color:white;">
|
|
1249
1260
|
<div class="fw-500 fs-6"
|
|
1250
1261
|
style="text-overflow: ellipsis;overflow: hidden !important;">
|
|
1251
|
-
|
|
1262
|
+
${gvc.glitter.share.editorViewModel.selectItem.label}
|
|
1252
1263
|
</div>
|
|
1253
1264
|
<div class="flex-fill"></div>
|
|
1254
1265
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1255
1266
|
style="font-size: 14px;color:black;"
|
|
1256
1267
|
onclick="${gvc.event(() => {
|
|
1257
1268
|
gvc.glitter.openDrawer();
|
|
1258
|
-
})}"
|
|
1269
|
+
})}">編輯
|
|
1270
|
+
</div>
|
|
1259
1271
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1260
1272
|
style="font-size: 14px;color:black;"
|
|
1261
|
-
onclick="${gvc.event(()=>{
|
|
1273
|
+
onclick="${gvc.event(() => {
|
|
1262
1274
|
const dialog = new ShareDialog(gvc.glitter)
|
|
1263
1275
|
navigator.clipboard.writeText(JSON.stringify(gvc.glitter.share.editorViewModel.selectItem));
|
|
1264
1276
|
dialog.successMessage({text: '複製成功,滑動至要插入的區塊,並點擊貼上。'})
|
|
@@ -1267,14 +1279,15 @@ export class Main_editor {
|
|
|
1267
1279
|
<div class="btn-group dropdown">
|
|
1268
1280
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1269
1281
|
style="font-size: 14px;color:black;"
|
|
1270
|
-
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1282
|
+
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1283
|
+
aria-expanded="false">貼上
|
|
1271
1284
|
</div>
|
|
1272
1285
|
<div class="dropdown-menu my-1">
|
|
1273
|
-
<a class="dropdown-item" onclick="${gvc.event(()=>{
|
|
1286
|
+
<a class="dropdown-item" onclick="${gvc.event(() => {
|
|
1274
1287
|
gvc.glitter.htmlGenerate.block_timer = new Date().getTime();
|
|
1275
1288
|
readAndPasteClipboardContent(-1)
|
|
1276
1289
|
})}">向上貼上元件</a>
|
|
1277
|
-
<a class="dropdown-item" onclick="${gvc.event(()=>{
|
|
1290
|
+
<a class="dropdown-item" onclick="${gvc.event(() => {
|
|
1278
1291
|
gvc.glitter.htmlGenerate.block_timer = new Date().getTime();
|
|
1279
1292
|
readAndPasteClipboardContent(1)
|
|
1280
1293
|
})}">向下貼上元件</a>
|
|
@@ -1283,13 +1296,14 @@ export class Main_editor {
|
|
|
1283
1296
|
<div class="btn-group dropdown">
|
|
1284
1297
|
<div class="rounded-1 border bg-white p-1 px-2 fw-500"
|
|
1285
1298
|
style="font-size: 14px;color:black;"
|
|
1286
|
-
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1299
|
+
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
1300
|
+
aria-expanded="false">新增
|
|
1287
1301
|
</div>
|
|
1288
1302
|
<div class="dropdown-menu my-1">
|
|
1289
|
-
<a class="dropdown-item" onclick="${gvc.event(()=>{
|
|
1303
|
+
<a class="dropdown-item" onclick="${gvc.event(() => {
|
|
1290
1304
|
addWidgetEvent(-1)
|
|
1291
1305
|
})}">向上添加元件</a>
|
|
1292
|
-
<a class="dropdown-item" onclick="${gvc.event(()=>{
|
|
1306
|
+
<a class="dropdown-item" onclick="${gvc.event(() => {
|
|
1293
1307
|
addWidgetEvent(1)
|
|
1294
1308
|
})}">向下添加元件</a>
|
|
1295
1309
|
</div>
|
|
@@ -1327,7 +1341,41 @@ export class Main_editor {
|
|
|
1327
1341
|
}
|
|
1328
1342
|
}
|
|
1329
1343
|
})
|
|
1344
|
+
}
|
|
1330
1345
|
|
|
1346
|
+
//開發人員版本編輯器
|
|
1347
|
+
public static developerEditor(gvc: GVC) {
|
|
1348
|
+
return gvc.bindView(() => {
|
|
1349
|
+
return {
|
|
1350
|
+
bind: 'iframe_center',
|
|
1351
|
+
view: () => {
|
|
1352
|
+
if (EditorConfig.backend_page() === 'backend-manger') {
|
|
1353
|
+
return html`
|
|
1354
|
+
<div class="position-relative"
|
|
1355
|
+
style="width:100%;height: 100%;padding-top:${parseInt(gvc.glitter.share.top_inset, 10)}px;"
|
|
1356
|
+
id="editerCenter">
|
|
1357
|
+
</div>`
|
|
1358
|
+
} else {
|
|
1359
|
+
return html`
|
|
1360
|
+
<div class="position-relative"
|
|
1361
|
+
style="width:100%;height: calc(100%);${(parseInt(gvc.glitter.share.top_inset, 10)) ? `padding-top:${parseInt(gvc.glitter.share.top_inset, 10)}px;` : ``}"
|
|
1362
|
+
id="editerCenter">
|
|
1363
|
+
<iframe class="w-100 h-100 bg-white iframe_view"
|
|
1364
|
+
sandbox="allow-same-origin allow-scripts"
|
|
1365
|
+
src="${gvc.glitter.root_path}${gvc.glitter.getUrlParameter('page')}?type=htmlEditor&appName=${gvc.glitter.getUrlParameter('appName')}&device=${gvc.glitter.getUrlParameter('device')}"></iframe>
|
|
1366
|
+
</div>`
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
divCreate: () => {
|
|
1370
|
+
return {
|
|
1371
|
+
class: Storage.view_type === ViewType.mobile && (Storage.select_function === 'page-editor' || Storage.select_function === 'user-editor')
|
|
1372
|
+
? `d-flex align-items-center justify-content-center flex-column mx-auto` : `d-flex align-items-center justify-content-center flex-column`,
|
|
1373
|
+
style: Storage.view_type === ViewType.mobile && (Storage.select_function === 'page-editor' || Storage.select_function === 'user-editor')
|
|
1374
|
+
? `width: calc(${(document.body.clientWidth<800) ? `${document.body.clientWidth}px`:`414px`});height: ${window.innerHeight - EditorConfig.getPaddingTop(gvc) - 56}px;` : `width: calc(${(document.body.clientWidth<800) ? `${document.body.clientWidth}px`:`100%`});height: ${window.innerHeight - EditorConfig.getPaddingTop(gvc) - 56}px;overflow:hidden;`
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
})
|
|
1331
1379
|
}
|
|
1332
1380
|
|
|
1333
1381
|
public static pageAndComponent(option: { gvc: GVC; data: any; divCreate?: any }) {
|
|
@@ -43,12 +43,12 @@ export class ToolSetting {
|
|
|
43
43
|
view: () => {
|
|
44
44
|
if (vm.function === 'edit') {
|
|
45
45
|
return html `
|
|
46
|
-
<div class="px-2 pt-
|
|
46
|
+
<div class="px-2 pt-2">${vm.edit_view}</div>`;
|
|
47
47
|
}
|
|
48
48
|
return html `
|
|
49
49
|
${(() => {
|
|
50
50
|
if (document.body.clientWidth < 800) {
|
|
51
|
-
return `<div class="w-100 d-flex align-items-center p-3 border-bottom
|
|
51
|
+
return `<div class="w-100 d-flex align-items-center p-3 border-bottom">
|
|
52
52
|
<h5 class="offcanvas-title " style="max-width: calc(100% - 50px);overflow: hidden;text-overflow: ellipsis;">統一元件設定</h5>
|
|
53
53
|
<div class="flex-fill"></div>
|
|
54
54
|
<div
|
|
@@ -274,59 +274,65 @@ export class ToolSetting {
|
|
|
274
274
|
callback: (response) => {
|
|
275
275
|
if (response) {
|
|
276
276
|
dialog.dataLoading({ visible: true });
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
277
|
+
(window.glitterInitialHelper).getPageData({
|
|
278
|
+
tag: dd.tag,
|
|
279
|
+
appName: dd.appName
|
|
280
|
+
}, (d3) => {
|
|
281
|
+
widget.config[0] = {
|
|
282
|
+
id: gvc.glitter.getUUID(),
|
|
283
|
+
js: './official_view_component/official.js',
|
|
284
|
+
css: {
|
|
285
|
+
class: {},
|
|
286
|
+
style: {},
|
|
287
|
+
},
|
|
288
|
+
data: {
|
|
289
|
+
refer_app: dd.appName,
|
|
290
|
+
refer_form_data: d3.response.result[0].page_config.formData,
|
|
291
|
+
tag: dd.tag,
|
|
292
|
+
list: [],
|
|
293
|
+
carryData: {},
|
|
294
|
+
},
|
|
295
|
+
type: 'component',
|
|
296
|
+
class: 'w-100',
|
|
297
|
+
index: 0,
|
|
298
|
+
label: dd.name,
|
|
299
|
+
style: '',
|
|
300
|
+
bundle: {},
|
|
301
|
+
global: [],
|
|
302
|
+
toggle: false,
|
|
303
|
+
stylist: [],
|
|
304
|
+
dataType: 'static',
|
|
305
|
+
style_from: 'code',
|
|
306
|
+
classDataType: 'static',
|
|
307
|
+
preloadEvenet: {},
|
|
308
|
+
share: {},
|
|
309
|
+
"arrayData": {
|
|
310
|
+
"clickEvent": [{
|
|
311
|
+
"clickEvent": {
|
|
312
|
+
"src": "./official_event/event.js",
|
|
313
|
+
"route": "code"
|
|
314
|
+
},
|
|
315
|
+
"codeVersion": "v2",
|
|
316
|
+
"code": " //判斷不是APP在顯示\n if ((gvc.glitter.deviceType === glitter.deviceTypeEnum.Web) && (glitter.getUrlParameter('device') !== 'mobile')) {\n return [subData]\n } else {\n return []\n }"
|
|
317
|
+
}]
|
|
318
|
+
},
|
|
319
|
+
"gCount": "multiple"
|
|
320
|
+
};
|
|
321
|
+
ApiPageConfig.setPage({
|
|
322
|
+
id: widget.id,
|
|
323
|
+
appName: widget.appName,
|
|
324
|
+
tag: widget.tag,
|
|
325
|
+
name: widget.name,
|
|
326
|
+
config: widget.config,
|
|
327
|
+
group: widget.group,
|
|
328
|
+
page_config: widget.page_config,
|
|
329
|
+
page_type: widget.page_type,
|
|
330
|
+
preview_image: widget.preview_image,
|
|
331
|
+
favorite: widget.favorite,
|
|
332
|
+
}).then((api) => {
|
|
333
|
+
dialog.dataLoading({ visible: false });
|
|
334
|
+
location.reload();
|
|
335
|
+
});
|
|
330
336
|
});
|
|
331
337
|
}
|
|
332
338
|
},
|
|
@@ -392,7 +398,7 @@ export class ToolSetting {
|
|
|
392
398
|
`;
|
|
393
399
|
},
|
|
394
400
|
divCreate: {
|
|
395
|
-
class: `p-2 mx-n2`,
|
|
401
|
+
class: `p-2 mx-n2 mt-n2`,
|
|
396
402
|
},
|
|
397
403
|
};
|
|
398
404
|
})].join('');
|