zc-lowcode 0.0.1 → 0.0.3
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/README.md +430 -3
- package/designer.d.ts +5 -0
- package/dist/assets/code-editor.css +1 -0
- package/dist/assets/designer.css +1 -0
- package/dist/assets/materials.css +1 -0
- package/dist/assets/runtime-definitions.css +1 -0
- package/dist/assets/runtime.css +1 -0
- package/dist/assets/sortable.css +1 -0
- package/dist/code-editor-DJwwp3uU.js +9 -0
- package/dist/code-editor-DJwwp3uU.js.map +1 -0
- package/dist/code-editor.vue_vue_type_script_setup_true_lang-aA043pnA.js +40176 -0
- package/dist/code-editor.vue_vue_type_script_setup_true_lang-aA043pnA.js.map +1 -0
- package/dist/core/index.d.ts +560 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core.js +881 -0
- package/dist/core.js.map +1 -0
- package/dist/designer/canvas/draggable-list.vue.d.ts +15 -0
- package/dist/designer/canvas/draggable-list.vue.d.ts.map +1 -0
- package/dist/designer/canvas/widget-node.vue.d.ts +11 -0
- package/dist/designer/canvas/widget-node.vue.d.ts.map +1 -0
- package/dist/designer/canvas/workspace.vue.d.ts +3 -0
- package/dist/designer/canvas/workspace.vue.d.ts.map +1 -0
- package/dist/designer/datasource/data-editor.vue.d.ts +13 -0
- package/dist/designer/datasource/data-editor.vue.d.ts.map +1 -0
- package/dist/designer/datasource/datasource-help.d.ts +9 -0
- package/dist/designer/datasource/datasource-help.d.ts.map +1 -0
- package/dist/designer/datasource/panel.vue.d.ts +3 -0
- package/dist/designer/datasource/panel.vue.d.ts.map +1 -0
- package/dist/designer/designer.d.ts +119 -0
- package/dist/designer/designer.d.ts.map +1 -0
- package/dist/designer/designer.vue.d.ts +40 -0
- package/dist/designer/designer.vue.d.ts.map +1 -0
- package/dist/designer/index.d.ts +13 -0
- package/dist/designer/index.d.ts.map +1 -0
- package/dist/designer/material-registry.d.ts +19 -0
- package/dist/designer/material-registry.d.ts.map +1 -0
- package/dist/designer/materials/widget-library.vue.d.ts +3 -0
- package/dist/designer/materials/widget-library.vue.d.ts.map +1 -0
- package/dist/designer/methods/api-method-params-list.vue.d.ts +14 -0
- package/dist/designer/methods/api-method-params-list.vue.d.ts.map +1 -0
- package/dist/designer/methods/api-param-bind-button.vue.d.ts +17 -0
- package/dist/designer/methods/api-param-bind-button.vue.d.ts.map +1 -0
- package/dist/designer/methods/api-param-list.vue.d.ts +19 -0
- package/dist/designer/methods/api-param-list.vue.d.ts.map +1 -0
- package/dist/designer/methods/api-result-rules-list.vue.d.ts +16 -0
- package/dist/designer/methods/api-result-rules-list.vue.d.ts.map +1 -0
- package/dist/designer/methods/method-api-config-form.vue.d.ts +15 -0
- package/dist/designer/methods/method-api-config-form.vue.d.ts.map +1 -0
- package/dist/designer/methods/page-method-api.d.ts +37 -0
- package/dist/designer/methods/page-method-api.d.ts.map +1 -0
- package/dist/designer/methods/page-method-editor-modal.vue.d.ts +30 -0
- package/dist/designer/methods/page-method-editor-modal.vue.d.ts.map +1 -0
- package/dist/designer/methods/page-method-simulate-args-modal.vue.d.ts +18 -0
- package/dist/designer/methods/page-method-simulate-args-modal.vue.d.ts.map +1 -0
- package/dist/designer/methods/page-methods.vue.d.ts +3 -0
- package/dist/designer/methods/page-methods.vue.d.ts.map +1 -0
- package/dist/designer/methods/use-page-methods-editor.d.ts +163 -0
- package/dist/designer/methods/use-page-methods-editor.d.ts.map +1 -0
- package/dist/designer/outline/panel.vue.d.ts +5 -0
- package/dist/designer/outline/panel.vue.d.ts.map +1 -0
- package/dist/designer/properties/panel.vue.d.ts +18 -0
- package/dist/designer/properties/panel.vue.d.ts.map +1 -0
- package/dist/designer/shared/code-editor-page-context-completion.d.ts +39 -0
- package/dist/designer/shared/code-editor-page-context-completion.d.ts.map +1 -0
- package/dist/designer/shared/code-editor.vue.d.ts +93 -0
- package/dist/designer/shared/code-editor.vue.d.ts.map +1 -0
- package/dist/designer/use-designer-shortcuts.d.ts +21 -0
- package/dist/designer/use-designer-shortcuts.d.ts.map +1 -0
- package/dist/designer-style.js +4 -0
- package/dist/designer.js +3215 -0
- package/dist/designer.js.map +1 -0
- package/dist/materials/definitions.d.ts +3 -0
- package/dist/materials/definitions.d.ts.map +1 -0
- package/dist/materials/index.d.ts +11 -0
- package/dist/materials/index.d.ts.map +1 -0
- package/dist/materials/packages/button/index.d.ts +4 -0
- package/dist/materials/packages/button/index.d.ts.map +1 -0
- package/dist/materials/packages/button/options.d.ts +45 -0
- package/dist/materials/packages/button/options.d.ts.map +1 -0
- package/dist/materials/packages/button/setter.vue.d.ts +7 -0
- package/dist/materials/packages/button/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/button/view.vue.d.ts +11 -0
- package/dist/materials/packages/button/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/card/index.d.ts +4 -0
- package/dist/materials/packages/card/index.d.ts.map +1 -0
- package/dist/materials/packages/card/options.d.ts +24 -0
- package/dist/materials/packages/card/options.d.ts.map +1 -0
- package/dist/materials/packages/card/setter.vue.d.ts +7 -0
- package/dist/materials/packages/card/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/card/view.vue.d.ts +28 -0
- package/dist/materials/packages/card/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/carousel/carousel-slide/options.d.ts +12 -0
- package/dist/materials/packages/carousel/carousel-slide/options.d.ts.map +1 -0
- package/dist/materials/packages/carousel/carousel-slide/setter.vue.d.ts +7 -0
- package/dist/materials/packages/carousel/carousel-slide/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/carousel/carousel-slide/view.vue.d.ts +24 -0
- package/dist/materials/packages/carousel/carousel-slide/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/carousel/designer.vue.d.ts +30 -0
- package/dist/materials/packages/carousel/designer.vue.d.ts.map +1 -0
- package/dist/materials/packages/carousel/index.d.ts +5 -0
- package/dist/materials/packages/carousel/index.d.ts.map +1 -0
- package/dist/materials/packages/carousel/options.d.ts +65 -0
- package/dist/materials/packages/carousel/options.d.ts.map +1 -0
- package/dist/materials/packages/carousel/setter.vue.d.ts +7 -0
- package/dist/materials/packages/carousel/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/carousel/view.vue.d.ts +41 -0
- package/dist/materials/packages/carousel/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/divider/index.d.ts +4 -0
- package/dist/materials/packages/divider/index.d.ts.map +1 -0
- package/dist/materials/packages/divider/options.d.ts +39 -0
- package/dist/materials/packages/divider/options.d.ts.map +1 -0
- package/dist/materials/packages/divider/setter.vue.d.ts +7 -0
- package/dist/materials/packages/divider/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/divider/view.vue.d.ts +11 -0
- package/dist/materials/packages/divider/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/grid/designer.vue.d.ts +160 -0
- package/dist/materials/packages/grid/designer.vue.d.ts.map +1 -0
- package/dist/materials/packages/grid/index.d.ts +4 -0
- package/dist/materials/packages/grid/index.d.ts.map +1 -0
- package/dist/materials/packages/grid/options.d.ts +41 -0
- package/dist/materials/packages/grid/options.d.ts.map +1 -0
- package/dist/materials/packages/grid/setter.vue.d.ts +7 -0
- package/dist/materials/packages/grid/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/grid/split.d.ts +18 -0
- package/dist/materials/packages/grid/split.d.ts.map +1 -0
- package/dist/materials/packages/grid/view.vue.d.ts +35 -0
- package/dist/materials/packages/grid/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/image/index.d.ts +4 -0
- package/dist/materials/packages/image/index.d.ts.map +1 -0
- package/dist/materials/packages/image/options.d.ts +31 -0
- package/dist/materials/packages/image/options.d.ts.map +1 -0
- package/dist/materials/packages/image/setter.vue.d.ts +7 -0
- package/dist/materials/packages/image/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/image/view.vue.d.ts +11 -0
- package/dist/materials/packages/image/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/list/designer.vue.d.ts +29 -0
- package/dist/materials/packages/list/designer.vue.d.ts.map +1 -0
- package/dist/materials/packages/list/index.d.ts +4 -0
- package/dist/materials/packages/list/index.d.ts.map +1 -0
- package/dist/materials/packages/list/options.d.ts +60 -0
- package/dist/materials/packages/list/options.d.ts.map +1 -0
- package/dist/materials/packages/list/setter.vue.d.ts +7 -0
- package/dist/materials/packages/list/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/list/view.vue.d.ts +31 -0
- package/dist/materials/packages/list/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/tab/designer.vue.d.ts +30 -0
- package/dist/materials/packages/tab/designer.vue.d.ts.map +1 -0
- package/dist/materials/packages/tab/index.d.ts +5 -0
- package/dist/materials/packages/tab/index.d.ts.map +1 -0
- package/dist/materials/packages/tab/options.d.ts +48 -0
- package/dist/materials/packages/tab/options.d.ts.map +1 -0
- package/dist/materials/packages/tab/setter.vue.d.ts +7 -0
- package/dist/materials/packages/tab/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/tab/tab-pane/options.d.ts +13 -0
- package/dist/materials/packages/tab/tab-pane/options.d.ts.map +1 -0
- package/dist/materials/packages/tab/tab-pane/setter.vue.d.ts +7 -0
- package/dist/materials/packages/tab/tab-pane/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/tab/tab-pane/view.vue.d.ts +24 -0
- package/dist/materials/packages/tab/tab-pane/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/tab/view.vue.d.ts +34 -0
- package/dist/materials/packages/tab/view.vue.d.ts.map +1 -0
- package/dist/materials/packages/text/index.d.ts +4 -0
- package/dist/materials/packages/text/index.d.ts.map +1 -0
- package/dist/materials/packages/text/options.d.ts +29 -0
- package/dist/materials/packages/text/options.d.ts.map +1 -0
- package/dist/materials/packages/text/setter.vue.d.ts +7 -0
- package/dist/materials/packages/text/setter.vue.d.ts.map +1 -0
- package/dist/materials/packages/text/view.vue.d.ts +11 -0
- package/dist/materials/packages/text/view.vue.d.ts.map +1 -0
- package/dist/materials/page/index.d.ts +4 -0
- package/dist/materials/page/index.d.ts.map +1 -0
- package/dist/materials/page/lifecycle-panel.vue.d.ts +13 -0
- package/dist/materials/page/lifecycle-panel.vue.d.ts.map +1 -0
- package/dist/materials/page/setter-slots.d.ts +7 -0
- package/dist/materials/page/setter-slots.d.ts.map +1 -0
- package/dist/materials/page/setter.vue.d.ts +25 -0
- package/dist/materials/page/setter.vue.d.ts.map +1 -0
- package/dist/materials/page/view.vue.d.ts +26 -0
- package/dist/materials/page/view.vue.d.ts.map +1 -0
- package/dist/materials/runtime-definitions.d.ts +10 -0
- package/dist/materials/runtime-definitions.d.ts.map +1 -0
- package/dist/materials/shared/designer/container-children.vue.d.ts +24 -0
- package/dist/materials/shared/designer/container-children.vue.d.ts.map +1 -0
- package/dist/materials/shared/designer/helpers.d.ts +68 -0
- package/dist/materials/shared/designer/helpers.d.ts.map +1 -0
- package/dist/materials/shared/designer/icon.vue.d.ts +8 -0
- package/dist/materials/shared/designer/icon.vue.d.ts.map +1 -0
- package/dist/materials/shared/designer/selection-chrome.vue.d.ts +31 -0
- package/dist/materials/shared/designer/selection-chrome.vue.d.ts.map +1 -0
- package/dist/materials/shared/designer/use-keyed-slot-sync.d.ts +15 -0
- package/dist/materials/shared/designer/use-keyed-slot-sync.d.ts.map +1 -0
- package/dist/materials/shared/designer/use-widget-size-resize.d.ts +16 -0
- package/dist/materials/shared/designer/use-widget-size-resize.d.ts.map +1 -0
- package/dist/materials/shared/envelopes/internal-pane-view.vue.d.ts +29 -0
- package/dist/materials/shared/envelopes/internal-pane-view.vue.d.ts.map +1 -0
- package/dist/materials/shared/envelopes/item-scope-provider.vue.d.ts +22 -0
- package/dist/materials/shared/envelopes/item-scope-provider.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/binding-form-item.vue.d.ts +40 -0
- package/dist/materials/shared/setter/components/binding-form-item.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/binding-picker/binding-scope-tree.d.ts +83 -0
- package/dist/materials/shared/setter/components/binding-picker/binding-scope-tree.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/binding-picker/binding-utils.d.ts +105 -0
- package/dist/materials/shared/setter/components/binding-picker/binding-utils.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/binding-picker/index.vue.d.ts +30 -0
- package/dist/materials/shared/setter/components/binding-picker/index.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/box-model.vue.d.ts +11 -0
- package/dist/materials/shared/setter/components/box-model.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/color-input.vue.d.ts +14 -0
- package/dist/materials/shared/setter/components/color-input.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/image-upload.vue.d.ts +25 -0
- package/dist/materials/shared/setter/components/image-upload.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/keyed-slot-child-list.vue.d.ts +17 -0
- package/dist/materials/shared/setter/components/keyed-slot-child-list.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/offset-box.vue.d.ts +11 -0
- package/dist/materials/shared/setter/components/offset-box.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/percent-input.vue.d.ts +19 -0
- package/dist/materials/shared/setter/components/percent-input.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/components/style-property-input.vue.d.ts +92 -0
- package/dist/materials/shared/setter/components/style-property-input.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/composables/use-page-data-field-options.d.ts +15 -0
- package/dist/materials/shared/setter/composables/use-page-data-field-options.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/animation-panel.vue.d.ts +7 -0
- package/dist/materials/shared/setter/panels/animation-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/background-panel.vue.d.ts +11 -0
- package/dist/materials/shared/setter/panels/background-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/border-panel.vue.d.ts +11 -0
- package/dist/materials/shared/setter/panels/border-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/event-panel.vue.d.ts +14 -0
- package/dist/materials/shared/setter/panels/event-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/layout-panel.vue.d.ts +25 -0
- package/dist/materials/shared/setter/panels/layout-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/position-panel.vue.d.ts +16 -0
- package/dist/materials/shared/setter/panels/position-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/typography-panel.vue.d.ts +11 -0
- package/dist/materials/shared/setter/panels/typography-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/panels/widget-style-panel.vue.d.ts +30 -0
- package/dist/materials/shared/setter/panels/widget-style-panel.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/shell.vue.d.ts +21 -0
- package/dist/materials/shared/setter/shell.vue.d.ts.map +1 -0
- package/dist/materials/shared/setter/use-widget-setter.d.ts +35 -0
- package/dist/materials/shared/setter/use-widget-setter.d.ts.map +1 -0
- package/dist/materials-style.js +3 -0
- package/dist/materials.js +14703 -0
- package/dist/materials.js.map +1 -0
- package/dist/runtime/index.d.ts +6 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/page-renderer.vue.d.ts +4 -0
- package/dist/runtime/page-renderer.vue.d.ts.map +1 -0
- package/dist/runtime/runtime.d.ts +585 -0
- package/dist/runtime/runtime.d.ts.map +1 -0
- package/dist/runtime/scoped-style-block.vue.d.ts +7 -0
- package/dist/runtime/scoped-style-block.vue.d.ts.map +1 -0
- package/dist/runtime/widget-node.vue.d.ts +9 -0
- package/dist/runtime/widget-node.vue.d.ts.map +1 -0
- package/dist/runtime-definitions-BGShdDBK.js +1984 -0
- package/dist/runtime-definitions-BGShdDBK.js.map +1 -0
- package/dist/runtime-style.js +3 -0
- package/dist/runtime.js +262 -0
- package/dist/runtime.js.map +1 -0
- package/dist/sortable.esm-DbutZcEr.js +18104 -0
- package/dist/sortable.esm-DbutZcEr.js.map +1 -0
- package/dist/style.js +3 -0
- package/package.json +73 -41
- package/runtime.d.ts +5 -0
- package/dist/lowcode-editor.es.js +0 -79541
- package/dist/lowcode-editor.umd.js +0 -79542
- package/dist/style.css +0 -154
- package/dist/type.d.ts +0 -28
package/dist/designer.js
ADDED
|
@@ -0,0 +1,3215 @@
|
|
|
1
|
+
import "./assets/designer.css";
|
|
2
|
+
import "./assets/sortable.css";
|
|
3
|
+
import { defineComponent as te, computed as T, ref as N, watch as xe, createVNode as o, Fragment as K, openBlock as p, createElementBlock as S, createElementVNode as s, withCtx as d, unref as v, toDisplayString as H, withModifiers as ue, normalizeStyle as Ht, createBlock as I, createCommentVNode as W, normalizeClass as ce, renderList as ne, Transition as la, resolveDynamicComponent as Ut, createSlots as ra, renderSlot as Bt, normalizeProps as Ft, guardReactiveProps as Wt, onBeforeUnmount as oa, nextTick as Gt, inject as qt, toRaw as vt, createTextVNode as z, createStaticVNode as ia, useModel as ke, mergeModels as ge, isRef as gt, getCurrentInstance as sa, provide as be, reactive as ua, watchEffect as ca } from "vue";
|
|
4
|
+
import { u as da, a as pa, c as fa, _ as Ee, f as ma, b as xt, d as va, P as ht, t as yt, C as qe, I as de, e as fe, g as he, B as me, h as ga, i as xa, j as ha, k as Ze, l as Xe, R as Qt, S as ya, U as _a, L as ba, D as we, m as ka, n as et, o as wa, p as _t, q as bt, r as Ne, s as Pa, v as Yt, w as Oa, x as Sa, y as Ca, z as kt, A as $a, M as Da, E as Ta, F as Ea, G as Ia, H as He, J as Ue, K as Qe, N as Aa, O as Ce, Q as Ie, T as wt, V as Be, W as La, X as Ma, Y as za, Z as ja, $ as Ra, a0 as Va, a1 as Na, a2 as Ha, a3 as Ua, a4 as Ba, a5 as Fa, a6 as Wa, a7 as Ga, a8 as qa, a9 as Qa, aa as Ya, ab as Ja, ac as Ka, ad as Za } from "./sortable.esm-DbutZcEr.js";
|
|
5
|
+
import { ae as fo, af as mo, ag as vo, ah as go } from "./sortable.esm-DbutZcEr.js";
|
|
6
|
+
import { serializePageSnapshot as Xa, canMutateWidgetContent as Ye, widgetCanAcceptDropTarget as en, isWidgetSelfLocked as Pt, resolveWidgetEditorTitle as Fe, canMutateWidgetStructure as Ae, canToggleWidgetLock as tn, isWidgetEffectivelyLocked as an, clonePageSnapshot as nn, isSamePageSnapshot as ln, createDefaultPage as rn } from "./core.js";
|
|
7
|
+
import { createDefaultPageScript as ho, getDesignerComponentName as yo, getSetterComponentName as _o, resolvePageTitle as bo } from "./core.js";
|
|
8
|
+
import { u as on, _ as sn, a as un, M as cn, b as ze, C as tt, A as Jt, I as ve, S as dn, c as Kt, d as Zt, e as pn, D as Xt, T as fn, f as mn, E as ea, F as je, g as ye, h as ta, i as vn, j as gn, k as oe, l as at, P as nt, m as xn, n as hn, o as Me, p as yn, q as _n, s as bn, r as kn, t as wn, v as lt, w as Pn, x as On, y as Sn, z as Cn, B as $n, G as Dn, H as Je, J as Ot, K as Tn, L as En } from "./code-editor.vue_vue_type_script_setup_true_lang-aA043pnA.js";
|
|
9
|
+
const In = {
|
|
10
|
+
small: 8,
|
|
11
|
+
middle: 16,
|
|
12
|
+
large: 24
|
|
13
|
+
}, An = () => ({
|
|
14
|
+
prefixCls: String,
|
|
15
|
+
size: {
|
|
16
|
+
type: [String, Number, Array]
|
|
17
|
+
},
|
|
18
|
+
direction: ht.oneOf(yt("horizontal", "vertical")).def("horizontal"),
|
|
19
|
+
align: ht.oneOf(yt("start", "end", "center", "baseline")),
|
|
20
|
+
wrap: va()
|
|
21
|
+
});
|
|
22
|
+
function Ln(t) {
|
|
23
|
+
return typeof t == "string" ? In[t] : t || 0;
|
|
24
|
+
}
|
|
25
|
+
const De = te({
|
|
26
|
+
compatConfig: {
|
|
27
|
+
MODE: 3
|
|
28
|
+
},
|
|
29
|
+
name: "ASpace",
|
|
30
|
+
inheritAttrs: !1,
|
|
31
|
+
props: An(),
|
|
32
|
+
slots: Object,
|
|
33
|
+
setup(t, e) {
|
|
34
|
+
let {
|
|
35
|
+
slots: a,
|
|
36
|
+
attrs: i
|
|
37
|
+
} = e;
|
|
38
|
+
const {
|
|
39
|
+
prefixCls: r,
|
|
40
|
+
space: c,
|
|
41
|
+
direction: x
|
|
42
|
+
} = da("space", t), [f, D] = pa(r), $ = on(), h = T(() => {
|
|
43
|
+
var b, w, j;
|
|
44
|
+
return (j = (b = t.size) !== null && b !== void 0 ? b : (w = c == null ? void 0 : c.value) === null || w === void 0 ? void 0 : w.size) !== null && j !== void 0 ? j : "small";
|
|
45
|
+
}), m = N(), O = N();
|
|
46
|
+
xe(h, () => {
|
|
47
|
+
[m.value, O.value] = (Array.isArray(h.value) ? h.value : [h.value, h.value]).map((b) => Ln(b));
|
|
48
|
+
}, {
|
|
49
|
+
immediate: !0
|
|
50
|
+
});
|
|
51
|
+
const L = T(() => t.align === void 0 && t.direction === "horizontal" ? "center" : t.align), y = T(() => fa(r.value, D.value, `${r.value}-${t.direction}`, {
|
|
52
|
+
[`${r.value}-rtl`]: x.value === "rtl",
|
|
53
|
+
[`${r.value}-align-${L.value}`]: L.value
|
|
54
|
+
})), _ = T(() => x.value === "rtl" ? "marginLeft" : "marginRight"), C = T(() => {
|
|
55
|
+
const b = {};
|
|
56
|
+
return $.value && (b.columnGap = `${m.value}px`, b.rowGap = `${O.value}px`), Ee(Ee({}, b), t.wrap && {
|
|
57
|
+
flexWrap: "wrap",
|
|
58
|
+
marginBottom: `${-O.value}px`
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return () => {
|
|
62
|
+
var b, w;
|
|
63
|
+
const {
|
|
64
|
+
wrap: j,
|
|
65
|
+
direction: A = "horizontal"
|
|
66
|
+
} = t, R = (b = a.default) === null || b === void 0 ? void 0 : b.call(a), V = ma(R), U = V.length;
|
|
67
|
+
if (U === 0)
|
|
68
|
+
return null;
|
|
69
|
+
const G = (w = a.split) === null || w === void 0 ? void 0 : w.call(a), Y = `${r.value}-item`, le = m.value, ae = U - 1;
|
|
70
|
+
return o("div", xt(xt({}, i), {}, {
|
|
71
|
+
class: [y.value, i.class],
|
|
72
|
+
style: [C.value, i.style]
|
|
73
|
+
}), [V.map((q, ee) => {
|
|
74
|
+
let Z = R.indexOf(q);
|
|
75
|
+
Z === -1 && (Z = `$$space-${ee}`);
|
|
76
|
+
let ie = {};
|
|
77
|
+
return $.value || (A === "vertical" ? ee < ae && (ie = {
|
|
78
|
+
marginBottom: `${le / (G ? 2 : 1)}px`
|
|
79
|
+
}) : ie = Ee(Ee({}, ee < ae && {
|
|
80
|
+
[_.value]: `${le / (G ? 2 : 1)}px`
|
|
81
|
+
}), j && {
|
|
82
|
+
paddingBottom: `${O.value}px`
|
|
83
|
+
})), f(o(K, {
|
|
84
|
+
key: Z
|
|
85
|
+
}, [o("div", {
|
|
86
|
+
class: Y,
|
|
87
|
+
style: ie
|
|
88
|
+
}, [q]), ee < ae && G && o("span", {
|
|
89
|
+
class: `${Y}-split`,
|
|
90
|
+
style: ie
|
|
91
|
+
}, [G])]));
|
|
92
|
+
})]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
De.Compact = qe;
|
|
97
|
+
De.install = function(t) {
|
|
98
|
+
return t.component(De.name, De), t.component(qe.name, qe), t;
|
|
99
|
+
};
|
|
100
|
+
var Mn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "defs", attrs: {}, children: [{ tag: "style", attrs: {} }] }, { tag: "path", attrs: { d: "M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z" } }] }, name: "clear", theme: "outlined" };
|
|
101
|
+
function St(t) {
|
|
102
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
103
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
104
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
105
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
106
|
+
}))), i.forEach(function(r) {
|
|
107
|
+
zn(t, r, a[r]);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return t;
|
|
111
|
+
}
|
|
112
|
+
function zn(t, e, a) {
|
|
113
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
114
|
+
}
|
|
115
|
+
var rt = function(e, a) {
|
|
116
|
+
var i = St({}, e, a.attrs);
|
|
117
|
+
return o(de, St({}, i, {
|
|
118
|
+
icon: Mn
|
|
119
|
+
}), null);
|
|
120
|
+
};
|
|
121
|
+
rt.displayName = "ClearOutlined";
|
|
122
|
+
rt.inheritAttrs = !1;
|
|
123
|
+
var jn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, name: "code", theme: "outlined" };
|
|
124
|
+
function Ct(t) {
|
|
125
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
126
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
127
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
128
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
129
|
+
}))), i.forEach(function(r) {
|
|
130
|
+
Rn(t, r, a[r]);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return t;
|
|
134
|
+
}
|
|
135
|
+
function Rn(t, e, a) {
|
|
136
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
137
|
+
}
|
|
138
|
+
var Re = function(e, a) {
|
|
139
|
+
var i = Ct({}, e, a.attrs);
|
|
140
|
+
return o(de, Ct({}, i, {
|
|
141
|
+
icon: jn
|
|
142
|
+
}), null);
|
|
143
|
+
};
|
|
144
|
+
Re.displayName = "CodeOutlined";
|
|
145
|
+
Re.inheritAttrs = !1;
|
|
146
|
+
var Vn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM340 683v77c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-77c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198V264c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v221c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8s0 .1.1.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8 0 0 0 .1-.1.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7zM620 539v221c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V539c-10.1 3.3-20.8 5-32 5s-21.9-1.8-32-5zm64-198v-77c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v77c10.1-3.3 20.8-5 32-5s21.9 1.8 32 5zm-64 198c10.1 3.3 20.8 5 32 5s21.9-1.8 32-5c41.8-13.5 72-52.7 72-99s-30.2-85.5-72-99c-10.1-3.3-20.8-5-32-5s-21.9 1.8-32 5c-41.8 13.5-72 52.7-72 99s30.2 85.5 72 99zm.1-115.7c.3-.6.7-1.2 1-1.8v-.1l1.2-1.8c.1-.2.2-.3.3-.5.3-.5.7-.9 1-1.4.1-.1.2-.3.3-.4.5-.6.9-1.1 1.4-1.6l.3-.3 1.2-1.2.4-.4c.5-.5 1-.9 1.6-1.4.6-.5 1.1-.9 1.7-1.3.2-.1.3-.2.5-.3.5-.3.9-.7 1.4-1 .1-.1.3-.2.4-.3.6-.4 1.2-.7 1.9-1.1.1-.1.3-.1.4-.2.5-.3 1-.5 1.6-.8l.6-.3c.7-.3 1.3-.6 2-.8.7-.3 1.4-.5 2.1-.7.2-.1.4-.1.6-.2.6-.2 1.1-.3 1.7-.4.2 0 .3-.1.5-.1.7-.2 1.5-.3 2.2-.4.2 0 .3 0 .5-.1.6-.1 1.2-.1 1.8-.2h.6c.8 0 1.5-.1 2.3-.1s1.5 0 2.3.1h.6c.6 0 1.2.1 1.8.2.2 0 .3 0 .5.1.7.1 1.5.2 2.2.4.2 0 .3.1.5.1.6.1 1.2.3 1.7.4.2.1.4.1.6.2.7.2 1.4.4 2.1.7.7.2 1.3.5 2 .8l.6.3c.5.2 1.1.5 1.6.8.1.1.3.1.4.2.6.3 1.3.7 1.9 1.1.1.1.3.2.4.3.5.3 1 .6 1.4 1 .2.1.3.2.5.3.6.4 1.2.9 1.7 1.3s1.1.9 1.6 1.4l.4.4 1.2 1.2.3.3c.5.5 1 1.1 1.4 1.6.1.1.2.3.3.4.4.4.7.9 1 1.4.1.2.2.3.3.5l1.2 1.8v.1a36.18 36.18 0 015.1 18.5c0 6-1.5 11.7-4.1 16.7-.3.6-.7 1.2-1 1.8v.1l-1.2 1.8c-.1.2-.2.3-.3.5-.3.5-.7.9-1 1.4-.1.1-.2.3-.3.4-.5.6-.9 1.1-1.4 1.6l-.3.3-1.2 1.2-.4.4c-.5.5-1 .9-1.6 1.4-.6.5-1.1.9-1.7 1.3-.2.1-.3.2-.5.3-.5.3-.9.7-1.4 1-.1.1-.3.2-.4.3-.6.4-1.2.7-1.9 1.1-.1.1-.3.1-.4.2-.5.3-1 .5-1.6.8l-.6.3c-.7.3-1.3.6-2 .8-.7.3-1.4.5-2.1.7-.2.1-.4.1-.6.2-.6.2-1.1.3-1.7.4-.2 0-.3.1-.5.1-.7.2-1.5.3-2.2.4-.2 0-.3 0-.5.1-.6.1-1.2.1-1.8.2h-.6c-.8 0-1.5.1-2.3.1s-1.5 0-2.3-.1h-.6c-.6 0-1.2-.1-1.8-.2-.2 0-.3 0-.5-.1-.7-.1-1.5-.2-2.2-.4-.2 0-.3-.1-.5-.1-.6-.1-1.2-.3-1.7-.4-.2-.1-.4-.1-.6-.2-.7-.2-1.4-.4-2.1-.7-.7-.2-1.3-.5-2-.8l-.6-.3c-.5-.2-1.1-.5-1.6-.8-.1-.1-.3-.1-.4-.2-.6-.3-1.3-.7-1.9-1.1-.1-.1-.3-.2-.4-.3-.5-.3-1-.6-1.4-1-.2-.1-.3-.2-.5-.3-.6-.4-1.2-.9-1.7-1.3s-1.1-.9-1.6-1.4l-.4-.4-1.2-1.2-.3-.3c-.5-.5-1-1.1-1.4-1.6-.1-.1-.2-.3-.3-.4-.4-.4-.7-.9-1-1.4-.1-.2-.2-.3-.3-.5l-1.2-1.8v-.1c-.4-.6-.7-1.2-1-1.8-2.6-5-4.1-10.7-4.1-16.7s1.5-11.7 4.1-16.7z" } }] }, name: "control", theme: "outlined" };
|
|
147
|
+
function $t(t) {
|
|
148
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
149
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
150
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
151
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
152
|
+
}))), i.forEach(function(r) {
|
|
153
|
+
Nn(t, r, a[r]);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return t;
|
|
157
|
+
}
|
|
158
|
+
function Nn(t, e, a) {
|
|
159
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
160
|
+
}
|
|
161
|
+
var ot = function(e, a) {
|
|
162
|
+
var i = $t({}, e, a.attrs);
|
|
163
|
+
return o(de, $t({}, i, {
|
|
164
|
+
icon: Vn
|
|
165
|
+
}), null);
|
|
166
|
+
};
|
|
167
|
+
ot.displayName = "ControlOutlined";
|
|
168
|
+
ot.inheritAttrs = !1;
|
|
169
|
+
var Hn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z" } }] }, name: "desktop", theme: "outlined" };
|
|
170
|
+
function Dt(t) {
|
|
171
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
172
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
173
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
174
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
175
|
+
}))), i.forEach(function(r) {
|
|
176
|
+
Un(t, r, a[r]);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return t;
|
|
180
|
+
}
|
|
181
|
+
function Un(t, e, a) {
|
|
182
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
183
|
+
}
|
|
184
|
+
var it = function(e, a) {
|
|
185
|
+
var i = Dt({}, e, a.attrs);
|
|
186
|
+
return o(de, Dt({}, i, {
|
|
187
|
+
icon: Hn
|
|
188
|
+
}), null);
|
|
189
|
+
};
|
|
190
|
+
it.displayName = "DesktopOutlined";
|
|
191
|
+
it.inheritAttrs = !1;
|
|
192
|
+
var Bn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "defs", attrs: {}, children: [{ tag: "style", attrs: {} }] }, { tag: "path", attrs: { d: "M841 370c3-3.3 2.7-8.3-.6-11.3a8.24 8.24 0 00-5.3-2.1h-72.6c-2.4 0-4.6 1-6.1 2.8L633.5 504.6a7.96 7.96 0 01-13.4-1.9l-63.5-141.3a7.9 7.9 0 00-7.3-4.7H380.7l.9-4.7 8-42.3c10.5-55.4 38-81.4 85.8-81.4 18.6 0 35.5 1.7 48.8 4.7l14.1-66.8c-22.6-4.7-35.2-6.1-54.9-6.1-103.3 0-156.4 44.3-175.9 147.3l-9.4 49.4h-97.6c-3.8 0-7.1 2.7-7.8 6.4L181.9 415a8.07 8.07 0 007.8 9.7H284l-89 429.9a8.07 8.07 0 007.8 9.7H269c3.8 0 7.1-2.7 7.8-6.4l89.7-433.1h135.8l68.2 139.1c1.4 2.9 1 6.4-1.2 8.8l-180.6 203c-2.9 3.3-2.6 8.4.7 11.3 1.5 1.3 3.4 2 5.3 2h72.7c2.4 0 4.6-1 6.1-2.8l123.7-146.7c2.8-3.4 7.9-3.8 11.3-1 .9.8 1.6 1.7 2.1 2.8L676.4 784c1.3 2.8 4.1 4.7 7.3 4.7h64.6a8.02 8.02 0 007.2-11.5l-95.2-198.9c-1.4-2.9-.9-6.4 1.3-8.8L841 370z" } }] }, name: "function", theme: "outlined" };
|
|
193
|
+
function Tt(t) {
|
|
194
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
195
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
196
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
197
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
198
|
+
}))), i.forEach(function(r) {
|
|
199
|
+
Fn(t, r, a[r]);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
return t;
|
|
203
|
+
}
|
|
204
|
+
function Fn(t, e, a) {
|
|
205
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
206
|
+
}
|
|
207
|
+
var Te = function(e, a) {
|
|
208
|
+
var i = Tt({}, e, a.attrs);
|
|
209
|
+
return o(de, Tt({}, i, {
|
|
210
|
+
icon: Bn
|
|
211
|
+
}), null);
|
|
212
|
+
};
|
|
213
|
+
Te.displayName = "FunctionOutlined";
|
|
214
|
+
Te.inheritAttrs = !1;
|
|
215
|
+
var Wn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "defs", attrs: {}, children: [{ tag: "style", attrs: {} }] }, { tag: "path", attrs: { d: "M640.6 429.8h257.1c7.9 0 14.3-6.4 14.3-14.3V158.3c0-7.9-6.4-14.3-14.3-14.3H640.6c-7.9 0-14.3 6.4-14.3 14.3v92.9H490.6c-3.9 0-7.1 3.2-7.1 7.1v221.5h-85.7v-96.5c0-7.9-6.4-14.3-14.3-14.3H126.3c-7.9 0-14.3 6.4-14.3 14.3v257.2c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3V544h85.7v221.5c0 3.9 3.2 7.1 7.1 7.1h135.7v92.9c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3v-257c0-7.9-6.4-14.3-14.3-14.3h-257c-7.9 0-14.3 6.4-14.3 14.3v100h-78.6v-393h78.6v100c0 7.9 6.4 14.3 14.3 14.3zm53.5-217.9h150V362h-150V211.9zM329.9 587h-150V437h150v150zm364.2 75.1h150v150.1h-150V662.1z" } }] }, name: "partition", theme: "outlined" };
|
|
216
|
+
function Et(t) {
|
|
217
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
218
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
219
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
220
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
221
|
+
}))), i.forEach(function(r) {
|
|
222
|
+
Gn(t, r, a[r]);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return t;
|
|
226
|
+
}
|
|
227
|
+
function Gn(t, e, a) {
|
|
228
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
229
|
+
}
|
|
230
|
+
var st = function(e, a) {
|
|
231
|
+
var i = Et({}, e, a.attrs);
|
|
232
|
+
return o(de, Et({}, i, {
|
|
233
|
+
icon: Wn
|
|
234
|
+
}), null);
|
|
235
|
+
};
|
|
236
|
+
st.displayName = "PartitionOutlined";
|
|
237
|
+
st.inheritAttrs = !1;
|
|
238
|
+
var qn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z" } }] }, name: "pushpin", theme: "filled" };
|
|
239
|
+
function It(t) {
|
|
240
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
241
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
242
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
243
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
244
|
+
}))), i.forEach(function(r) {
|
|
245
|
+
Qn(t, r, a[r]);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return t;
|
|
249
|
+
}
|
|
250
|
+
function Qn(t, e, a) {
|
|
251
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
252
|
+
}
|
|
253
|
+
var ut = function(e, a) {
|
|
254
|
+
var i = It({}, e, a.attrs);
|
|
255
|
+
return o(de, It({}, i, {
|
|
256
|
+
icon: qn
|
|
257
|
+
}), null);
|
|
258
|
+
};
|
|
259
|
+
ut.displayName = "PushpinFilled";
|
|
260
|
+
ut.inheritAttrs = !1;
|
|
261
|
+
var Yn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z" } }] }, name: "pushpin", theme: "outlined" };
|
|
262
|
+
function At(t) {
|
|
263
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
264
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
265
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
266
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
267
|
+
}))), i.forEach(function(r) {
|
|
268
|
+
Jn(t, r, a[r]);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
return t;
|
|
272
|
+
}
|
|
273
|
+
function Jn(t, e, a) {
|
|
274
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
275
|
+
}
|
|
276
|
+
var ct = function(e, a) {
|
|
277
|
+
var i = At({}, e, a.attrs);
|
|
278
|
+
return o(de, At({}, i, {
|
|
279
|
+
icon: Yn
|
|
280
|
+
}), null);
|
|
281
|
+
};
|
|
282
|
+
ct.displayName = "PushpinOutlined";
|
|
283
|
+
ct.inheritAttrs = !1;
|
|
284
|
+
var Kn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z" } }] }, name: "redo", theme: "outlined" };
|
|
285
|
+
function Lt(t) {
|
|
286
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
287
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
288
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
289
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
290
|
+
}))), i.forEach(function(r) {
|
|
291
|
+
Zn(t, r, a[r]);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return t;
|
|
295
|
+
}
|
|
296
|
+
function Zn(t, e, a) {
|
|
297
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
298
|
+
}
|
|
299
|
+
var dt = function(e, a) {
|
|
300
|
+
var i = Lt({}, e, a.attrs);
|
|
301
|
+
return o(de, Lt({}, i, {
|
|
302
|
+
icon: Kn
|
|
303
|
+
}), null);
|
|
304
|
+
};
|
|
305
|
+
dt.displayName = "RedoOutlined";
|
|
306
|
+
dt.inheritAttrs = !1;
|
|
307
|
+
var Xn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M800 64H224c-35.3 0-64 28.7-64 64v768c0 35.3 28.7 64 64 64h576c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64zm-8 824H232V136h560v752zM472 784a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "tablet", theme: "outlined" };
|
|
308
|
+
function Mt(t) {
|
|
309
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
310
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
311
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
312
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
313
|
+
}))), i.forEach(function(r) {
|
|
314
|
+
el(t, r, a[r]);
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
return t;
|
|
318
|
+
}
|
|
319
|
+
function el(t, e, a) {
|
|
320
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
321
|
+
}
|
|
322
|
+
var pt = function(e, a) {
|
|
323
|
+
var i = Mt({}, e, a.attrs);
|
|
324
|
+
return o(de, Mt({}, i, {
|
|
325
|
+
icon: Xn
|
|
326
|
+
}), null);
|
|
327
|
+
};
|
|
328
|
+
pt.displayName = "TabletOutlined";
|
|
329
|
+
pt.inheritAttrs = !1;
|
|
330
|
+
var tl = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z" } }] }, name: "undo", theme: "outlined" };
|
|
331
|
+
function zt(t) {
|
|
332
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
333
|
+
var a = arguments[e] != null ? Object(arguments[e]) : {}, i = Object.keys(a);
|
|
334
|
+
typeof Object.getOwnPropertySymbols == "function" && (i = i.concat(Object.getOwnPropertySymbols(a).filter(function(r) {
|
|
335
|
+
return Object.getOwnPropertyDescriptor(a, r).enumerable;
|
|
336
|
+
}))), i.forEach(function(r) {
|
|
337
|
+
al(t, r, a[r]);
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
return t;
|
|
341
|
+
}
|
|
342
|
+
function al(t, e, a) {
|
|
343
|
+
return e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
344
|
+
}
|
|
345
|
+
var ft = function(e, a) {
|
|
346
|
+
var i = zt({}, e, a.attrs);
|
|
347
|
+
return o(de, zt({}, i, {
|
|
348
|
+
icon: tl
|
|
349
|
+
}), null);
|
|
350
|
+
};
|
|
351
|
+
ft.displayName = "UndoOutlined";
|
|
352
|
+
ft.inheritAttrs = !1;
|
|
353
|
+
const nl = { class: "relative h-full min-h-0 overflow-hidden" }, ll = { class: "absolute top-1 left-1/2 z-100 inline-flex w-max max-w-[calc(100%-2rem)] shrink-0 flex-nowrap items-center whitespace-nowrap overflow-x-auto rounded-xl border border-[var(--colorBorderSecondary)] bg-[color-mix(in_srgb,var(--colorBgElevated)_98%,transparent)] px-4 py-2 shadow-sm -translate-x-1/2" }, rl = { class: "text-xs text-[var(--colorTextSecondary)] select-none" }, ol = /* @__PURE__ */ te({
|
|
354
|
+
name: "LowcodeDesignerPageWorkspace",
|
|
355
|
+
__name: "workspace",
|
|
356
|
+
setup(t) {
|
|
357
|
+
const e = fe(), a = ha(), i = T(() => (e == null || e.historyRevision, (e == null ? void 0 : e.undoEnabled()) ?? !1)), r = T(() => (e == null || e.historyRevision, (e == null ? void 0 : e.redoEnabled()) ?? !1)), c = N("Pc"), x = {
|
|
358
|
+
Pc: { maxWidth: "100%", label: "桌面" },
|
|
359
|
+
Pad: { maxWidth: "768px", label: "平板 768px" },
|
|
360
|
+
H5: { maxWidth: "375px", label: "手机 375px" }
|
|
361
|
+
}, f = T(() => x[c.value].label), D = T(() => ({
|
|
362
|
+
maxWidth: x[c.value].maxWidth
|
|
363
|
+
}));
|
|
364
|
+
function $() {
|
|
365
|
+
e != null && e.page && e.setSelected(e.page);
|
|
366
|
+
}
|
|
367
|
+
function h(y) {
|
|
368
|
+
y.target === y.currentTarget && $();
|
|
369
|
+
}
|
|
370
|
+
const m = N(!1), O = N(""), L = () => {
|
|
371
|
+
e != null && e.page && (O.value = Xa(e.page, " "), m.value = !0);
|
|
372
|
+
};
|
|
373
|
+
return (y, _) => {
|
|
374
|
+
var U;
|
|
375
|
+
const C = me, b = he, w = ga, j = un, A = sn, R = De, V = ze;
|
|
376
|
+
return p(), S(K, null, [
|
|
377
|
+
s("div", nl, [
|
|
378
|
+
s("header", ll, [
|
|
379
|
+
o(R, {
|
|
380
|
+
size: 8,
|
|
381
|
+
wrap: !1
|
|
382
|
+
}, {
|
|
383
|
+
default: d(() => [
|
|
384
|
+
o(b, {
|
|
385
|
+
title: `撤销 (${v(a)}+Z)`
|
|
386
|
+
}, {
|
|
387
|
+
default: d(() => [
|
|
388
|
+
o(C, {
|
|
389
|
+
size: "small",
|
|
390
|
+
disabled: !i.value,
|
|
391
|
+
onClick: _[0] || (_[0] = (G) => {
|
|
392
|
+
var Y;
|
|
393
|
+
return (Y = v(e)) == null ? void 0 : Y.undo();
|
|
394
|
+
})
|
|
395
|
+
}, {
|
|
396
|
+
default: d(() => [
|
|
397
|
+
o(v(ft))
|
|
398
|
+
]),
|
|
399
|
+
_: 1
|
|
400
|
+
}, 8, ["disabled"])
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
}, 8, ["title"]),
|
|
404
|
+
o(b, {
|
|
405
|
+
title: `重做 (${v(a)}+Shift+Z)`
|
|
406
|
+
}, {
|
|
407
|
+
default: d(() => [
|
|
408
|
+
o(C, {
|
|
409
|
+
size: "small",
|
|
410
|
+
disabled: !r.value,
|
|
411
|
+
onClick: _[1] || (_[1] = (G) => {
|
|
412
|
+
var Y;
|
|
413
|
+
return (Y = v(e)) == null ? void 0 : Y.redo();
|
|
414
|
+
})
|
|
415
|
+
}, {
|
|
416
|
+
default: d(() => [
|
|
417
|
+
o(v(dt))
|
|
418
|
+
]),
|
|
419
|
+
_: 1
|
|
420
|
+
}, 8, ["disabled"])
|
|
421
|
+
]),
|
|
422
|
+
_: 1
|
|
423
|
+
}, 8, ["title"]),
|
|
424
|
+
o(w, {
|
|
425
|
+
type: "vertical",
|
|
426
|
+
class: "!h-5 !my-0"
|
|
427
|
+
}),
|
|
428
|
+
o(A, {
|
|
429
|
+
value: c.value,
|
|
430
|
+
"onUpdate:value": _[2] || (_[2] = (G) => c.value = G),
|
|
431
|
+
size: "small"
|
|
432
|
+
}, {
|
|
433
|
+
default: d(() => [
|
|
434
|
+
o(j, { value: "Pc" }, {
|
|
435
|
+
default: d(() => [
|
|
436
|
+
o(v(it))
|
|
437
|
+
]),
|
|
438
|
+
_: 1
|
|
439
|
+
}),
|
|
440
|
+
o(j, { value: "Pad" }, {
|
|
441
|
+
default: d(() => [
|
|
442
|
+
o(v(pt), { rotate: 90 })
|
|
443
|
+
]),
|
|
444
|
+
_: 1
|
|
445
|
+
}),
|
|
446
|
+
o(j, { value: "H5" }, {
|
|
447
|
+
default: d(() => [
|
|
448
|
+
o(v(cn))
|
|
449
|
+
]),
|
|
450
|
+
_: 1
|
|
451
|
+
})
|
|
452
|
+
]),
|
|
453
|
+
_: 1
|
|
454
|
+
}, 8, ["value"]),
|
|
455
|
+
s("span", rl, H(f.value), 1),
|
|
456
|
+
o(w, {
|
|
457
|
+
type: "vertical",
|
|
458
|
+
class: "!h-5 !my-0"
|
|
459
|
+
}),
|
|
460
|
+
o(b, { title: "源码" }, {
|
|
461
|
+
default: d(() => [
|
|
462
|
+
o(C, {
|
|
463
|
+
size: "small",
|
|
464
|
+
onClick: _[3] || (_[3] = (G) => L())
|
|
465
|
+
}, {
|
|
466
|
+
default: d(() => [
|
|
467
|
+
o(v(Re))
|
|
468
|
+
]),
|
|
469
|
+
_: 1
|
|
470
|
+
})
|
|
471
|
+
]),
|
|
472
|
+
_: 1
|
|
473
|
+
}),
|
|
474
|
+
o(b, { title: "清空画布" }, {
|
|
475
|
+
default: d(() => [
|
|
476
|
+
o(C, {
|
|
477
|
+
size: "small",
|
|
478
|
+
onClick: _[4] || (_[4] = (G) => {
|
|
479
|
+
var Y;
|
|
480
|
+
return (Y = v(e)) == null ? void 0 : Y.clearWidgetList();
|
|
481
|
+
})
|
|
482
|
+
}, {
|
|
483
|
+
default: d(() => [
|
|
484
|
+
o(v(rt))
|
|
485
|
+
]),
|
|
486
|
+
_: 1
|
|
487
|
+
})
|
|
488
|
+
]),
|
|
489
|
+
_: 1
|
|
490
|
+
})
|
|
491
|
+
]),
|
|
492
|
+
_: 1
|
|
493
|
+
})
|
|
494
|
+
]),
|
|
495
|
+
s("div", {
|
|
496
|
+
class: "lowcode-canvas-scroll relative h-full min-h-0 overflow-auto scrollbar bg-transparent p-6 pt-18",
|
|
497
|
+
onClick: h
|
|
498
|
+
}, [
|
|
499
|
+
_[8] || (_[8] = s("div", {
|
|
500
|
+
class: "lowcode-canvas-chrome-layer pointer-events-none absolute inset-0 z-500 overflow-visible",
|
|
501
|
+
"aria-hidden": "true"
|
|
502
|
+
}, null, -1)),
|
|
503
|
+
s("div", {
|
|
504
|
+
class: "relative mx-auto h-full shadow-[0_1px_4px_color-mix(in_srgb,var(--colorText)_6%,transparent)] transition-all duration-250",
|
|
505
|
+
style: Ht(D.value),
|
|
506
|
+
onClick: _[5] || (_[5] = ue(() => {
|
|
507
|
+
}, ["stop"]))
|
|
508
|
+
}, [
|
|
509
|
+
(U = v(e)) != null && U.page ? (p(), I(xa, {
|
|
510
|
+
key: 0,
|
|
511
|
+
designer: v(e),
|
|
512
|
+
widget: v(e).page
|
|
513
|
+
}, null, 8, ["designer", "widget"])) : W("", !0)
|
|
514
|
+
], 4)
|
|
515
|
+
])
|
|
516
|
+
]),
|
|
517
|
+
o(V, {
|
|
518
|
+
open: m.value,
|
|
519
|
+
"onUpdate:open": _[7] || (_[7] = (G) => m.value = G),
|
|
520
|
+
title: "页面源码",
|
|
521
|
+
footer: null,
|
|
522
|
+
width: "80vw",
|
|
523
|
+
centered: "",
|
|
524
|
+
"destroy-on-close": ""
|
|
525
|
+
}, {
|
|
526
|
+
default: d(() => [
|
|
527
|
+
o(v(tt), {
|
|
528
|
+
modelValue: O.value,
|
|
529
|
+
"onUpdate:modelValue": _[6] || (_[6] = (G) => O.value = G),
|
|
530
|
+
language: "json",
|
|
531
|
+
"read-only": "",
|
|
532
|
+
height: 480
|
|
533
|
+
}, null, 8, ["modelValue"])
|
|
534
|
+
]),
|
|
535
|
+
_: 1
|
|
536
|
+
}, 8, ["open"])
|
|
537
|
+
], 64);
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
}), il = { class: "flex h-full min-h-0 flex-col bg-[var(--colorBgContainer)]" }, sl = { class: "shrink-0 border-b border-[var(--colorSplit)] bg-[linear-gradient(180deg,var(--colorBgContainer)_0%,color-mix(in_srgb,var(--colorBgContainer)_94%,var(--colorPrimary)_6%)_100%)] px-4 py-3" }, ul = { class: "flex items-start gap-3" }, cl = { class: "min-w-0 flex-1" }, dl = { class: "truncate text-sm font-medium text-[var(--colorText)]" }, pl = {
|
|
541
|
+
key: 0,
|
|
542
|
+
class: "mt-1.5 flex flex-wrap items-center gap-1"
|
|
543
|
+
}, fl = ["onClick"], ml = {
|
|
544
|
+
key: 1,
|
|
545
|
+
class: "max-w-[120px] truncate text-[11px] leading-[1.4] font-medium text-[var(--colorPrimary)]"
|
|
546
|
+
}, vl = { class: "relative min-h-0 flex-1 overflow-y-auto overflow-x-hidden scrollbar" }, gl = {
|
|
547
|
+
key: 0,
|
|
548
|
+
class: "pointer-events-none absolute inset-0 z-10 flex items-start justify-center bg-[color-mix(in_srgb,var(--colorBgContainer)_72%,transparent)] pt-16"
|
|
549
|
+
}, xl = {
|
|
550
|
+
key: "empty",
|
|
551
|
+
class: "flex-center min-h-[220px] px-6 py-16 text-[var(--colorTextSecondary)]"
|
|
552
|
+
}, We = "size-8 shrink-0 flex-center rounded-lg text-[15px]", jt = "transition-[opacity,transform] duration-[160ms] ease-in-out", Rt = "opacity-0 translate-y-1.5", hl = /* @__PURE__ */ te({
|
|
553
|
+
name: "LowcodeDesignerWidgetSetterPanel",
|
|
554
|
+
__name: "panel",
|
|
555
|
+
setup(t) {
|
|
556
|
+
const e = fe(), a = Ze();
|
|
557
|
+
function i(y, _, C) {
|
|
558
|
+
if (!y) return [];
|
|
559
|
+
for (const b of y) {
|
|
560
|
+
if (C.push(b), _(b)) return C;
|
|
561
|
+
if (b.children) {
|
|
562
|
+
const w = i(b.children, _, C);
|
|
563
|
+
if (w.length) return w;
|
|
564
|
+
}
|
|
565
|
+
C.pop();
|
|
566
|
+
}
|
|
567
|
+
return [];
|
|
568
|
+
}
|
|
569
|
+
const r = T(() => (e == null ? void 0 : e.selectedWidget) ?? null), c = T(() => !(e != null && e.page) || !r.value ? [] : i([e.page], (y) => {
|
|
570
|
+
var _;
|
|
571
|
+
return y.id === ((_ = r.value) == null ? void 0 : _.id);
|
|
572
|
+
}, [])), x = T(() => {
|
|
573
|
+
var y;
|
|
574
|
+
return ((y = r.value) == null ? void 0 : y.type) === "page";
|
|
575
|
+
}), f = T(() => {
|
|
576
|
+
if (!r.value) return "未选择组件";
|
|
577
|
+
const { type: y } = r.value;
|
|
578
|
+
return a.getWidgetTypeLabel(y) ?? y ?? "未知组件";
|
|
579
|
+
}), D = T(() => {
|
|
580
|
+
if (r.value)
|
|
581
|
+
return a.getWidgetTypeIcon(r.value.type);
|
|
582
|
+
}), $ = T(() => !(e != null && e.page) || !r.value || r.value.type === "page" ? !1 : !Ye(e.page, r.value)), h = `${We} bg-[color-mix(in_srgb,var(--colorPrimary)_10%,var(--colorBgContainer))] text-[var(--colorPrimary)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--colorPrimary)_16%,transparent)]`, m = `${We} bg-[color-mix(in_srgb,var(--colorText)_6%,var(--colorBgContainer))] text-[var(--colorTextSecondary)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--colorText)_8%,transparent)]`, O = `${We} bg-[color-mix(in_srgb,var(--colorPrimary)_10%,var(--colorBgContainer))] text-[var(--colorPrimary)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--colorPrimary)_18%,transparent)]`;
|
|
583
|
+
function L(y) {
|
|
584
|
+
e == null || e.setSelected(y);
|
|
585
|
+
}
|
|
586
|
+
return (y, _) => (p(), S("div", il, [
|
|
587
|
+
s("header", sl, [
|
|
588
|
+
s("div", ul, [
|
|
589
|
+
r.value ? (p(), S("span", {
|
|
590
|
+
key: 0,
|
|
591
|
+
class: ce(x.value ? h : m)
|
|
592
|
+
}, [
|
|
593
|
+
D.value ? (p(), I(Xe, {
|
|
594
|
+
key: 0,
|
|
595
|
+
icon: D.value,
|
|
596
|
+
class: "text-[15px]"
|
|
597
|
+
}, null, 8, ["icon"])) : (p(), I(v(Jt), {
|
|
598
|
+
key: 1,
|
|
599
|
+
class: "text-[15px]"
|
|
600
|
+
}))
|
|
601
|
+
], 2)) : (p(), S("span", {
|
|
602
|
+
key: 1,
|
|
603
|
+
class: ce(O)
|
|
604
|
+
}, [
|
|
605
|
+
o(v(ot))
|
|
606
|
+
])),
|
|
607
|
+
s("div", cl, [
|
|
608
|
+
s("div", dl, H(f.value), 1),
|
|
609
|
+
c.value.length > 1 ? (p(), S("div", pl, [
|
|
610
|
+
(p(!0), S(K, null, ne(c.value, (C, b) => (p(), S(K, {
|
|
611
|
+
key: C.id
|
|
612
|
+
}, [
|
|
613
|
+
b < c.value.length - 1 ? (p(), S("button", {
|
|
614
|
+
key: 0,
|
|
615
|
+
type: "button",
|
|
616
|
+
class: "max-w-[88px] cursor-pointer truncate border-none bg-transparent p-0 text-[11px] leading-[1.4] text-[var(--colorTextSecondary)] transition-colors duration-[180ms] ease-in-out hover:text-[var(--colorPrimary)]",
|
|
617
|
+
onClick: (w) => L(C)
|
|
618
|
+
}, H(C.name), 9, fl)) : (p(), S("span", ml, H(C.name), 1)),
|
|
619
|
+
b < c.value.length - 1 ? (p(), I(v(Qt), {
|
|
620
|
+
key: 2,
|
|
621
|
+
class: "text-[9px] text-[var(--colorTextQuaternary)]"
|
|
622
|
+
})) : W("", !0)
|
|
623
|
+
], 64))), 128))
|
|
624
|
+
])) : W("", !0)
|
|
625
|
+
])
|
|
626
|
+
])
|
|
627
|
+
]),
|
|
628
|
+
s("div", vl, [
|
|
629
|
+
o(la, {
|
|
630
|
+
mode: "out-in",
|
|
631
|
+
"enter-active-class": jt,
|
|
632
|
+
"leave-active-class": jt,
|
|
633
|
+
"enter-from-class": Rt,
|
|
634
|
+
"leave-to-class": Rt
|
|
635
|
+
}, {
|
|
636
|
+
default: d(() => [
|
|
637
|
+
r.value ? (p(), S("div", {
|
|
638
|
+
key: r.value.id,
|
|
639
|
+
class: "relative pt-1 pb-3"
|
|
640
|
+
}, [
|
|
641
|
+
(p(), I(Ut("widget-" + r.value.type + "-setter"), { widget: r.value }, ra({ _: 2 }, [
|
|
642
|
+
x.value && y.$slots["page-setter-options"] ? {
|
|
643
|
+
name: "options",
|
|
644
|
+
fn: d((C) => [
|
|
645
|
+
Bt(y.$slots, "page-setter-options", Ft(Wt(C)))
|
|
646
|
+
]),
|
|
647
|
+
key: "0"
|
|
648
|
+
} : void 0
|
|
649
|
+
]), 1032, ["widget"])),
|
|
650
|
+
$.value ? (p(), S("div", gl, [..._[0] || (_[0] = [
|
|
651
|
+
s("span", { class: "rounded-md bg-[var(--colorFillSecondary)] px-3 py-1.5 text-xs text-[var(--colorTextSecondary)] shadow-sm" }, "组件已锁定,不可编辑属性", -1)
|
|
652
|
+
])])) : W("", !0)
|
|
653
|
+
])) : (p(), S("div", xl, [..._[1] || (_[1] = [
|
|
654
|
+
s("span", { class: "text-sm" }, "请在页面工作区选中组件", -1)
|
|
655
|
+
])]))
|
|
656
|
+
]),
|
|
657
|
+
_: 3
|
|
658
|
+
})
|
|
659
|
+
])
|
|
660
|
+
]));
|
|
661
|
+
}
|
|
662
|
+
}), yl = { class: "flex h-full min-h-0 flex-col select-none" }, _l = { class: "shrink-0 select-text border-b border-[var(--colorSplit)] bg-[var(--colorBgContainer)] px-3 py-2.5" }, bl = { class: "min-h-0 flex-1 overflow-y-auto scrollbar" }, kl = { class: "flex min-w-0 flex-1 items-center justify-between gap-2 pr-1" }, wl = { class: "truncate text-sm font-medium text-[var(--colorText)]" }, Pl = { class: "shrink-0 rounded-full bg-[var(--colorFillSecondary)] px-2 py-0.5 text-[10px] text-[var(--colorTextSecondary)]" }, Ol = ["data-widget-type", "title", "onDblclick"], Sl = { class: "flex-center size-8 rounded-lg bg-[color-mix(in_srgb,var(--colorPrimary)_8%,var(--colorBgContainer))] text-base text-[var(--colorPrimary)]" }, Cl = { class: "w-full truncate px-0.5 text-center text-[11px] leading-tight text-[var(--colorTextSecondary)]" }, Vt = "lowcode-sortable-ghost", $e = "lowcode-palette-sortable-noop", $l = /* @__PURE__ */ te({
|
|
663
|
+
name: "LowcodeDesignerWidgetLibrary",
|
|
664
|
+
__name: "widget-library",
|
|
665
|
+
setup(t) {
|
|
666
|
+
const e = Ze(), a = N(""), i = T(() => {
|
|
667
|
+
const y = a.value.trim().toLowerCase();
|
|
668
|
+
return e.packages.map((_) => ({
|
|
669
|
+
name: _.name,
|
|
670
|
+
children: _.children.filter((C) => y ? C.name.toLowerCase().includes(y) || C.type.toLowerCase().includes(y) : !0)
|
|
671
|
+
})).filter((_) => _.children.length > 0);
|
|
672
|
+
}), r = T(() => i.value.map((y) => y.name)), c = fe(), x = /* @__PURE__ */ new Map();
|
|
673
|
+
function f(y) {
|
|
674
|
+
for (const _ of e.packages) {
|
|
675
|
+
const C = _.children.find((b) => b.type === y);
|
|
676
|
+
if (C) return C;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
function D(y) {
|
|
680
|
+
var _;
|
|
681
|
+
(_ = x.get(y)) == null || _.destroy(), x.delete(y);
|
|
682
|
+
}
|
|
683
|
+
function $(y) {
|
|
684
|
+
y && (y.querySelectorAll(".lowcode-draggable-item").forEach((_) => _.remove()), y.querySelectorAll(".palette-item").forEach((_) => {
|
|
685
|
+
_.classList.remove(
|
|
686
|
+
"sortable-chosen",
|
|
687
|
+
"sortable-ghost",
|
|
688
|
+
"sortable-drag",
|
|
689
|
+
Vt,
|
|
690
|
+
$e
|
|
691
|
+
), _.style.removeProperty("display");
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
694
|
+
function h(y, _) {
|
|
695
|
+
D(y), _ && x.set(
|
|
696
|
+
y,
|
|
697
|
+
ya.create(_, {
|
|
698
|
+
group: { name: "dragGroup", pull: "clone", put: !1 },
|
|
699
|
+
sort: !1,
|
|
700
|
+
draggable: ".palette-item",
|
|
701
|
+
animation: 150,
|
|
702
|
+
ghostClass: $e,
|
|
703
|
+
chosenClass: $e,
|
|
704
|
+
dragClass: $e,
|
|
705
|
+
removeCloneOnHide: !0,
|
|
706
|
+
forceFallback: !0,
|
|
707
|
+
fallbackOnBody: !0,
|
|
708
|
+
fallbackTolerance: 8,
|
|
709
|
+
onStart(C) {
|
|
710
|
+
const b = C.item;
|
|
711
|
+
b.classList.remove(Vt, $e);
|
|
712
|
+
const w = b.dataset.widgetType;
|
|
713
|
+
if (!w) return;
|
|
714
|
+
const j = f(w);
|
|
715
|
+
if (j && c) {
|
|
716
|
+
const A = c.copyNewWidget(j);
|
|
717
|
+
c.setPendingPaletteWidget(A), b._underlying_vm_ = A;
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
onClone(C) {
|
|
721
|
+
const b = C.item, w = C.clone;
|
|
722
|
+
w._underlying_vm_ = b._underlying_vm_;
|
|
723
|
+
},
|
|
724
|
+
onEnd(C) {
|
|
725
|
+
c == null || c.setPendingPaletteWidget(null), c == null || c.setDropHoverEmptyZoneId(null), $(C.from);
|
|
726
|
+
}
|
|
727
|
+
})
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
function m(y, _) {
|
|
731
|
+
if (!_) {
|
|
732
|
+
D(y);
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
h(y, _);
|
|
736
|
+
}
|
|
737
|
+
oa(() => {
|
|
738
|
+
for (const y of [...x.keys()])
|
|
739
|
+
D(y);
|
|
740
|
+
});
|
|
741
|
+
function O() {
|
|
742
|
+
const y = c == null ? void 0 : c.page, _ = c == null ? void 0 : c.selectedWidget;
|
|
743
|
+
if (!(!y || !_ || _.id === y.id) && en(y, _, {
|
|
744
|
+
isContainerType: e.isContainerType,
|
|
745
|
+
getKeyedSlotConfig: e.getKeyedSlotConfig
|
|
746
|
+
}))
|
|
747
|
+
return _;
|
|
748
|
+
}
|
|
749
|
+
function L(y) {
|
|
750
|
+
c == null || c.addWidget(y, O());
|
|
751
|
+
}
|
|
752
|
+
return (y, _) => {
|
|
753
|
+
const C = ve;
|
|
754
|
+
return p(), S("div", yl, [
|
|
755
|
+
s("header", _l, [
|
|
756
|
+
o(C, {
|
|
757
|
+
value: a.value,
|
|
758
|
+
"onUpdate:value": _[0] || (_[0] = (b) => a.value = b),
|
|
759
|
+
"allow-clear": "",
|
|
760
|
+
placeholder: "搜索组件",
|
|
761
|
+
size: "small"
|
|
762
|
+
}, {
|
|
763
|
+
prefix: d(() => [
|
|
764
|
+
o(v(dn), { class: "text-[var(--colorTextSecondary)]" })
|
|
765
|
+
]),
|
|
766
|
+
_: 1
|
|
767
|
+
}, 8, ["value"])
|
|
768
|
+
]),
|
|
769
|
+
s("div", bl, [
|
|
770
|
+
(p(), I(v(Kt), {
|
|
771
|
+
key: a.value,
|
|
772
|
+
ghost: "",
|
|
773
|
+
"expand-icon-position": "end",
|
|
774
|
+
"default-active-key": r.value
|
|
775
|
+
}, {
|
|
776
|
+
default: d(() => [
|
|
777
|
+
(p(!0), S(K, null, ne(i.value, (b) => (p(), I(v(Zt), {
|
|
778
|
+
key: b.name,
|
|
779
|
+
"panel-key": b.name
|
|
780
|
+
}, {
|
|
781
|
+
header: d(() => [
|
|
782
|
+
s("div", kl, [
|
|
783
|
+
s("span", wl, H(b.name), 1),
|
|
784
|
+
s("span", Pl, H(b.children.length), 1)
|
|
785
|
+
])
|
|
786
|
+
]),
|
|
787
|
+
default: d(() => [
|
|
788
|
+
s("div", {
|
|
789
|
+
ref_for: !0,
|
|
790
|
+
ref: (w) => m(b.name, w),
|
|
791
|
+
class: "flex flex-wrap gap-2 px-1 pb-2 pt-0.5"
|
|
792
|
+
}, [
|
|
793
|
+
(p(!0), S(K, null, ne(b.children, (w) => (p(), S("div", {
|
|
794
|
+
key: w.type,
|
|
795
|
+
class: "palette-item flex w-[calc((100%-16px)/3)] min-h-[72px] cursor-grab flex-col items-center justify-center gap-1.5 rounded-[10px] border border-transparent bg-[var(--colorBgElevated)] px-1 py-2 hover:bg-[color-mix(in_srgb,var(--colorPrimary)_8%,var(--colorBgContainer))] active:cursor-grabbing",
|
|
796
|
+
"data-widget-type": w.type,
|
|
797
|
+
title: `${w.name} · 双击快速添加`,
|
|
798
|
+
onDblclick: (j) => L(w)
|
|
799
|
+
}, [
|
|
800
|
+
s("div", Sl, [
|
|
801
|
+
o(Xe, {
|
|
802
|
+
icon: w.icon
|
|
803
|
+
}, null, 8, ["icon"])
|
|
804
|
+
]),
|
|
805
|
+
s("div", Cl, H(w.name), 1)
|
|
806
|
+
], 40, Ol))), 128))
|
|
807
|
+
], 512)
|
|
808
|
+
]),
|
|
809
|
+
_: 2
|
|
810
|
+
}, 1032, ["panel-key"]))), 128))
|
|
811
|
+
]),
|
|
812
|
+
_: 1
|
|
813
|
+
}, 8, ["default-active-key"]))
|
|
814
|
+
])
|
|
815
|
+
]);
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
}), Dl = { class: "outline-panel min-h-0 flex-1 overflow-y-auto scrollbar px-2 py-2" }, Tl = ["onDblclick"], El = {
|
|
819
|
+
key: 0,
|
|
820
|
+
class: "outline-tree-node-icon"
|
|
821
|
+
}, Il = {
|
|
822
|
+
key: 2,
|
|
823
|
+
class: "outline-tree-node-label"
|
|
824
|
+
}, Al = ["title", "disabled", "onClick"], Ll = ["disabled", "onClick"], Ml = /* @__PURE__ */ te({
|
|
825
|
+
name: "LowcodeDesignerPageOutline",
|
|
826
|
+
__name: "panel",
|
|
827
|
+
setup(t) {
|
|
828
|
+
const e = fe(), a = Ze();
|
|
829
|
+
function i(n) {
|
|
830
|
+
var l;
|
|
831
|
+
return {
|
|
832
|
+
key: n.id,
|
|
833
|
+
title: Fe(n),
|
|
834
|
+
widgetRef: n,
|
|
835
|
+
children: (l = n.children) == null ? void 0 : l.map(i)
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
const r = N(0), c = T(() => (e == null || e.pageTreeRevision, r.value, e != null && e.page ? [i(e.page)] : [])), x = T(() => {
|
|
839
|
+
var l;
|
|
840
|
+
const n = (l = e == null ? void 0 : e.selectedWidget) == null ? void 0 : l.id;
|
|
841
|
+
return n != null ? [n] : [];
|
|
842
|
+
});
|
|
843
|
+
function f(n) {
|
|
844
|
+
if (!n) return;
|
|
845
|
+
if (n.widgetRef) return n.widgetRef;
|
|
846
|
+
const l = [n.data, n.dataRef].find(
|
|
847
|
+
(E) => !!E && typeof E == "object" && "widgetRef" in E && !!E.widgetRef
|
|
848
|
+
);
|
|
849
|
+
if (l != null && l.widgetRef) return l.widgetRef;
|
|
850
|
+
const g = n.dataRef && typeof n.dataRef == "object" && "data" in n.dataRef ? n.dataRef.data : void 0;
|
|
851
|
+
if (g != null && g.widgetRef) return g.widgetRef;
|
|
852
|
+
const P = typeof n.key == "number" ? n.key : typeof n.eventKey == "number" ? n.eventKey : Number(n.eventKey ?? n.key);
|
|
853
|
+
if (Number.isFinite(P) && e)
|
|
854
|
+
return e.findWidgetById(P) ?? void 0;
|
|
855
|
+
}
|
|
856
|
+
function D(n, l) {
|
|
857
|
+
const g = n.children ?? [], P = g.findIndex((J) => J.id === l);
|
|
858
|
+
if (P >= 0)
|
|
859
|
+
return { parent: n, list: g, index: P };
|
|
860
|
+
function E(J) {
|
|
861
|
+
const F = J.children;
|
|
862
|
+
if (!(F != null && F.length)) return null;
|
|
863
|
+
for (let u = 0; u < F.length; u++) {
|
|
864
|
+
const k = F[u];
|
|
865
|
+
if (k.id === l)
|
|
866
|
+
return { parent: J, list: F, index: u };
|
|
867
|
+
const M = E(k);
|
|
868
|
+
if (M) return M;
|
|
869
|
+
}
|
|
870
|
+
return null;
|
|
871
|
+
}
|
|
872
|
+
for (const J of g) {
|
|
873
|
+
const F = E(J);
|
|
874
|
+
if (F) return F;
|
|
875
|
+
}
|
|
876
|
+
return null;
|
|
877
|
+
}
|
|
878
|
+
function $(n, l) {
|
|
879
|
+
return n.id === l.id ? !0 : a.widgetCanBeParent(n);
|
|
880
|
+
}
|
|
881
|
+
function h(n) {
|
|
882
|
+
return n.children || (n.children = []), n.children;
|
|
883
|
+
}
|
|
884
|
+
function m(n) {
|
|
885
|
+
const l = String(n.node.pos ?? "").split("-");
|
|
886
|
+
return n.dropPosition - Number(l[l.length - 1] ?? 0);
|
|
887
|
+
}
|
|
888
|
+
function O(n, l, g, P, E) {
|
|
889
|
+
var k;
|
|
890
|
+
if (!g)
|
|
891
|
+
return $(l, n) ? { list: h(l), index: 0 } : null;
|
|
892
|
+
if ((((k = l.children) == null ? void 0 : k.length) ?? 0) > 0 && E && P === 1)
|
|
893
|
+
return $(l, n) ? { list: h(l), index: 0 } : null;
|
|
894
|
+
const F = D(n, l.id);
|
|
895
|
+
if (!F) return null;
|
|
896
|
+
const u = P <= 0 ? F.index : F.index + 1;
|
|
897
|
+
return { list: F.list, index: u };
|
|
898
|
+
}
|
|
899
|
+
function L(n) {
|
|
900
|
+
if (!(e != null && e.page)) return !1;
|
|
901
|
+
const l = f(n);
|
|
902
|
+
return !l || l.id === e.page.id ? !1 : Ae(e.page, l);
|
|
903
|
+
}
|
|
904
|
+
function y(n, l) {
|
|
905
|
+
const g = n.page, P = f(l.dragNode), E = f(l.dropNode);
|
|
906
|
+
return !P || !E || P.id === g.id || !Ae(g, P) || n.widgetTreeContains(P, E.id) ? !1 : l.dropPosition === 0 ? $(E, g) ? Ae(g, E) : !1 : !0;
|
|
907
|
+
}
|
|
908
|
+
function _(n, l) {
|
|
909
|
+
const g = n.page, P = f(l.dragNode), E = f(l.node);
|
|
910
|
+
if (!P || !E || P.id === g.id || n.widgetTreeContains(P, E.id)) return;
|
|
911
|
+
const J = m(l), F = l.dropToGap ?? J !== 0, u = O(g, E, F, J, !!l.node.expanded);
|
|
912
|
+
u && (n.beginPageHistoryWatchSuspend(), n.moveWidgetToList(P, u.list, u.index), n.endPageHistoryWatchSuspend(), n.recordHistoryNow(), n.setSelected(P));
|
|
913
|
+
}
|
|
914
|
+
function C(n, l) {
|
|
915
|
+
if (!l.selected) return;
|
|
916
|
+
const g = f(l.node);
|
|
917
|
+
g && (e == null || e.setSelected(g));
|
|
918
|
+
}
|
|
919
|
+
function b(n) {
|
|
920
|
+
return e ? y(e, n) : !1;
|
|
921
|
+
}
|
|
922
|
+
function w(n) {
|
|
923
|
+
e && _(e, n);
|
|
924
|
+
}
|
|
925
|
+
function j(n) {
|
|
926
|
+
const l = f(n);
|
|
927
|
+
if (l)
|
|
928
|
+
return a.getWidgetTypeIcon(l.type);
|
|
929
|
+
}
|
|
930
|
+
function A(n) {
|
|
931
|
+
if (typeof n.title == "string" && n.title) return n.title;
|
|
932
|
+
const l = f(n);
|
|
933
|
+
return l ? Fe(l) : "";
|
|
934
|
+
}
|
|
935
|
+
function R(n) {
|
|
936
|
+
if (!(e != null && e.page) || n.id === e.page.id) return;
|
|
937
|
+
const l = D(e.page, n.id);
|
|
938
|
+
if (!l) return;
|
|
939
|
+
const { parent: g } = l, P = a.getKeyedSlotConfig(g.type);
|
|
940
|
+
if (P != null && P.isContainer(g) && P.isChild(n)) {
|
|
941
|
+
e.removeKeyedSlotChild(g, n, P), r.value++;
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
e.removeWidget(n, g);
|
|
945
|
+
}
|
|
946
|
+
function V(n, l) {
|
|
947
|
+
if (q(n)) return;
|
|
948
|
+
const g = f(n);
|
|
949
|
+
!g || !(e != null && e.page) || !Ye(e.page, g) || (l.preventDefault(), l.stopPropagation(), ee(g));
|
|
950
|
+
}
|
|
951
|
+
function U(n, l) {
|
|
952
|
+
l.preventDefault(), l.stopPropagation();
|
|
953
|
+
const g = f(n);
|
|
954
|
+
!g || !G(g) || (Y.value === g.id && Z(), R(g));
|
|
955
|
+
}
|
|
956
|
+
function G(n) {
|
|
957
|
+
if (!n || !(e != null && e.page) || n.id === e.page.id || !Ae(e.page, n)) return !1;
|
|
958
|
+
const l = D(e.page, n.id);
|
|
959
|
+
if (!l) return !1;
|
|
960
|
+
const g = a.getKeyedSlotConfig(l.parent.type);
|
|
961
|
+
return g != null && g.isContainer(l.parent) && g.isChild(n) ? g.getChildren(l.parent).length > 1 : !0;
|
|
962
|
+
}
|
|
963
|
+
const Y = N(null), le = N(""), ae = N(null);
|
|
964
|
+
function q(n) {
|
|
965
|
+
const l = f(n);
|
|
966
|
+
return l != null && l.id === Y.value;
|
|
967
|
+
}
|
|
968
|
+
function ee(n) {
|
|
969
|
+
e == null || e.setSelected(n), Y.value = n.id, le.value = Fe(n), Gt(() => {
|
|
970
|
+
var l, g, P;
|
|
971
|
+
(l = ae.value) == null || l.focus(), (P = (g = ae.value) == null ? void 0 : g.select) == null || P.call(g);
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
function Z() {
|
|
975
|
+
Y.value = null, le.value = "";
|
|
976
|
+
}
|
|
977
|
+
function ie(n) {
|
|
978
|
+
if (n.key === "Enter") {
|
|
979
|
+
n.preventDefault(), B();
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
n.key === "Escape" && (n.preventDefault(), Z());
|
|
983
|
+
}
|
|
984
|
+
function B() {
|
|
985
|
+
const n = Y.value;
|
|
986
|
+
if (n == null || !e) {
|
|
987
|
+
Z();
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
const l = e.findWidgetById(n);
|
|
991
|
+
if (!l) {
|
|
992
|
+
Z();
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
if (!Ye(e.page, l)) {
|
|
996
|
+
Z();
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
const g = le.value.trim(), P = typeof l.title == "string" ? l.title.trim() : "";
|
|
1000
|
+
g !== P && (l.title = g, r.value++, e.recordHistoryNow()), Z();
|
|
1001
|
+
}
|
|
1002
|
+
function pe(n) {
|
|
1003
|
+
return !n || !(e != null && e.page) ? !1 : tn(e.page, n);
|
|
1004
|
+
}
|
|
1005
|
+
function Pe(n, l) {
|
|
1006
|
+
l.preventDefault(), l.stopPropagation();
|
|
1007
|
+
const g = f(n);
|
|
1008
|
+
!g || !pe(g) || (e == null || e.toggleWidgetLock(g), r.value++);
|
|
1009
|
+
}
|
|
1010
|
+
function Oe(n) {
|
|
1011
|
+
const l = f(n);
|
|
1012
|
+
return !l || !(e != null && e.page) ? !1 : an(e.page, l);
|
|
1013
|
+
}
|
|
1014
|
+
function _e(n) {
|
|
1015
|
+
var g;
|
|
1016
|
+
const l = f(n);
|
|
1017
|
+
return l != null && l.id === ((g = e == null ? void 0 : e.selectedWidget) == null ? void 0 : g.id);
|
|
1018
|
+
}
|
|
1019
|
+
const Se = { showLeafIcon: !1 };
|
|
1020
|
+
return (n, l) => {
|
|
1021
|
+
const g = ve, P = pn;
|
|
1022
|
+
return p(), S("div", Dl, [
|
|
1023
|
+
o(P, {
|
|
1024
|
+
class: "outline-tree",
|
|
1025
|
+
"tree-data": c.value,
|
|
1026
|
+
"selected-keys": x.value,
|
|
1027
|
+
"show-line": Se,
|
|
1028
|
+
"default-expand-all": "",
|
|
1029
|
+
"block-node": "",
|
|
1030
|
+
draggable: L,
|
|
1031
|
+
"field-names": { children: "children", title: "title", key: "key" },
|
|
1032
|
+
"allow-drop": b,
|
|
1033
|
+
onSelect: C,
|
|
1034
|
+
onDrop: w
|
|
1035
|
+
}, {
|
|
1036
|
+
switcherIcon: d(({ expanded: E, isLeaf: J }) => [
|
|
1037
|
+
J ? W("", !0) : (p(), I(v(Qt), {
|
|
1038
|
+
key: 0,
|
|
1039
|
+
class: ce(["outline-tree-switcher", { "outline-tree-switcher--expanded": E }])
|
|
1040
|
+
}, null, 8, ["class"]))
|
|
1041
|
+
]),
|
|
1042
|
+
title: d((E) => {
|
|
1043
|
+
var J;
|
|
1044
|
+
return [
|
|
1045
|
+
s("span", {
|
|
1046
|
+
class: ce(["outline-tree-node group flex min-w-0 flex-1 items-center gap-1.5", { "outline-tree-node--selected": _e(E) }]),
|
|
1047
|
+
onDblclick: (F) => V(E, F)
|
|
1048
|
+
}, [
|
|
1049
|
+
j(E) ? (p(), S("span", El, [
|
|
1050
|
+
o(Xe, {
|
|
1051
|
+
icon: j(E),
|
|
1052
|
+
class: "text-[var(--colorTextSecondary)]"
|
|
1053
|
+
}, null, 8, ["icon"])
|
|
1054
|
+
])) : W("", !0),
|
|
1055
|
+
q(E) ? (p(), I(g, {
|
|
1056
|
+
key: 1,
|
|
1057
|
+
ref_key: "renameInputRef",
|
|
1058
|
+
ref: ae,
|
|
1059
|
+
value: le.value,
|
|
1060
|
+
"onUpdate:value": l[0] || (l[0] = (F) => le.value = F),
|
|
1061
|
+
size: "small",
|
|
1062
|
+
class: "outline-rename-input min-w-0 flex-1",
|
|
1063
|
+
placeholder: "组件名称",
|
|
1064
|
+
onClick: l[1] || (l[1] = ue(() => {
|
|
1065
|
+
}, ["stop"])),
|
|
1066
|
+
onMousedown: l[2] || (l[2] = ue(() => {
|
|
1067
|
+
}, ["stop"])),
|
|
1068
|
+
onKeydown: ie,
|
|
1069
|
+
onBlur: B
|
|
1070
|
+
}, null, 8, ["value"])) : (p(), S("span", Il, H(A(E)), 1)),
|
|
1071
|
+
q(E) ? W("", !0) : (p(), S("span", {
|
|
1072
|
+
key: 3,
|
|
1073
|
+
class: ce(["outline-tree-node-actions ml-auto flex shrink-0 items-center gap-0.5", _e(E) ? "opacity-100" : "opacity-0 group-hover:opacity-100"])
|
|
1074
|
+
}, [
|
|
1075
|
+
((J = f(E)) == null ? void 0 : J.type) !== "page" ? (p(), S("button", {
|
|
1076
|
+
key: 0,
|
|
1077
|
+
type: "button",
|
|
1078
|
+
class: ce(["outline-tree-action-btn", Oe(E) && "outline-tree-action-btn--active"]),
|
|
1079
|
+
title: v(Pt)(f(E)) ? "解锁" : "锁定",
|
|
1080
|
+
disabled: !pe(f(E)),
|
|
1081
|
+
onClick: (F) => Pe(E, F),
|
|
1082
|
+
onMousedown: l[3] || (l[3] = ue(() => {
|
|
1083
|
+
}, ["stop"]))
|
|
1084
|
+
}, [
|
|
1085
|
+
v(Pt)(f(E)) ? (p(), I(v(_a), { key: 0 })) : (p(), I(v(ba), { key: 1 }))
|
|
1086
|
+
], 42, Al)) : W("", !0),
|
|
1087
|
+
s("button", {
|
|
1088
|
+
type: "button",
|
|
1089
|
+
class: "outline-tree-action-btn outline-tree-action-btn--danger",
|
|
1090
|
+
title: "删除",
|
|
1091
|
+
disabled: !G(f(E)),
|
|
1092
|
+
onClick: (F) => U(E, F),
|
|
1093
|
+
onMousedown: l[4] || (l[4] = ue(() => {
|
|
1094
|
+
}, ["stop"]))
|
|
1095
|
+
}, [
|
|
1096
|
+
o(v(we))
|
|
1097
|
+
], 40, Ll)
|
|
1098
|
+
], 2))
|
|
1099
|
+
], 42, Tl)
|
|
1100
|
+
];
|
|
1101
|
+
}),
|
|
1102
|
+
_: 1
|
|
1103
|
+
}, 8, ["tree-data", "selected-keys"])
|
|
1104
|
+
]);
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
}), zl = /* @__PURE__ */ ka(Ml, [["__scopeId", "data-v-04629d9d"]]), jl = { class: "flex flex-col gap-2 p-3" }, Rl = { class: "min-w-0 flex-1" }, Vl = { class: "flex flex-wrap items-center gap-1.5 text-sm leading-tight" }, Nl = { class: "truncate font-mono" }, Hl = { class: "truncate font-mono text-[11px] text-[var(--colorTextQuaternary)]" }, Ul = { class: "flex shrink-0 items-center" }, Bl = { class: "flex items-center justify-between gap-3" }, Fl = { class: "min-w-0 truncate font-mono" }, Wl = { class: "m-0 max-h-60 max-w-80 overflow-auto whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed" }, Gl = /* @__PURE__ */ te({
|
|
1108
|
+
name: "PageDataEditor",
|
|
1109
|
+
__name: "data-editor",
|
|
1110
|
+
props: {
|
|
1111
|
+
modelValue: { default: () => [] }
|
|
1112
|
+
},
|
|
1113
|
+
emits: ["update:modelValue"],
|
|
1114
|
+
setup(t, { emit: e }) {
|
|
1115
|
+
function a(n) {
|
|
1116
|
+
const l = Ne(n.value);
|
|
1117
|
+
return {
|
|
1118
|
+
name: n.name,
|
|
1119
|
+
type: l,
|
|
1120
|
+
valueDraft: Sa(l, n.value)
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
function i(n, l) {
|
|
1124
|
+
const g = kt(l.type, l.valueDraft);
|
|
1125
|
+
return g.ok ? {
|
|
1126
|
+
key: n,
|
|
1127
|
+
name: l.name.trim(),
|
|
1128
|
+
value: g.value
|
|
1129
|
+
} : null;
|
|
1130
|
+
}
|
|
1131
|
+
const r = t, c = e, x = qt(et, null), f = T({
|
|
1132
|
+
get: () => Array.isArray(r.modelValue) ? r.modelValue : [],
|
|
1133
|
+
set: (n) => c("update:modelValue", wa(n))
|
|
1134
|
+
}), D = N(!1), $ = N(null), h = N(!1), m = N(null), O = T(() => {
|
|
1135
|
+
if (h.value) return "添加数据字段";
|
|
1136
|
+
const n = m.value;
|
|
1137
|
+
return n != null && n.name.trim() ? `编辑字段:${n.name.trim()}` : "编辑数据字段";
|
|
1138
|
+
});
|
|
1139
|
+
function L(n) {
|
|
1140
|
+
f.value = f.value.filter((l) => l.key !== n);
|
|
1141
|
+
}
|
|
1142
|
+
function y() {
|
|
1143
|
+
h.value = !0, $.value = null, m.value = {
|
|
1144
|
+
name: "",
|
|
1145
|
+
type: "string",
|
|
1146
|
+
valueDraft: ""
|
|
1147
|
+
}, D.value = !0;
|
|
1148
|
+
}
|
|
1149
|
+
function _(n) {
|
|
1150
|
+
const l = f.value.find((g) => g.key === n.key);
|
|
1151
|
+
l && (h.value = !1, $.value = l.key, m.value = a(l), D.value = !0);
|
|
1152
|
+
}
|
|
1153
|
+
function C(n, l) {
|
|
1154
|
+
const g = n.name.trim();
|
|
1155
|
+
if (!g)
|
|
1156
|
+
return "请填写字段名";
|
|
1157
|
+
if (!_t(g))
|
|
1158
|
+
return "字段名格式无效";
|
|
1159
|
+
if (Ca(f.value, g, l ?? void 0))
|
|
1160
|
+
return "字段名已被使用";
|
|
1161
|
+
const P = kt(n.type, n.valueDraft);
|
|
1162
|
+
return P.ok ? null : P.error;
|
|
1163
|
+
}
|
|
1164
|
+
function b() {
|
|
1165
|
+
if (!m.value || C(m.value, $.value)) return null;
|
|
1166
|
+
if (h.value) {
|
|
1167
|
+
const P = i(0, m.value);
|
|
1168
|
+
return P ? (f.value = [...f.value, P], w(), P) : null;
|
|
1169
|
+
}
|
|
1170
|
+
const l = $.value;
|
|
1171
|
+
if (l === null) return null;
|
|
1172
|
+
const g = i(l, m.value);
|
|
1173
|
+
return g ? (f.value = f.value.map((P) => P.key === l ? g : P), w(), g) : null;
|
|
1174
|
+
}
|
|
1175
|
+
function w() {
|
|
1176
|
+
D.value = !1, $.value = null, h.value = !1, m.value = null;
|
|
1177
|
+
}
|
|
1178
|
+
function j(n) {
|
|
1179
|
+
return n.name.trim() || "未命名字段";
|
|
1180
|
+
}
|
|
1181
|
+
function A(n) {
|
|
1182
|
+
if (m.value) {
|
|
1183
|
+
if (m.value.type = n, n === "null") {
|
|
1184
|
+
m.value.valueDraft = "null";
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
if (n === "boolean") {
|
|
1188
|
+
m.value.valueDraft = "false";
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
if (n === "number") {
|
|
1192
|
+
m.value.valueDraft = "0";
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
if (n === "array") {
|
|
1196
|
+
m.value.valueDraft = "[]";
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
if (n === "object") {
|
|
1200
|
+
m.value.valueDraft = "{}";
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
m.value.valueDraft = "";
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
function R(n) {
|
|
1207
|
+
try {
|
|
1208
|
+
return JSON.stringify(n, null, 2);
|
|
1209
|
+
} catch {
|
|
1210
|
+
return String(n);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
function V(n) {
|
|
1214
|
+
const l = n.trim();
|
|
1215
|
+
if (!l) return;
|
|
1216
|
+
G.value[l], U.value;
|
|
1217
|
+
const g = x == null ? void 0 : x.pageData;
|
|
1218
|
+
if (g)
|
|
1219
|
+
try {
|
|
1220
|
+
const P = vt(g);
|
|
1221
|
+
return Object.prototype.hasOwnProperty.call(P, l) ? P[l] : void 0;
|
|
1222
|
+
} catch {
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
const U = N(0), G = N({}), Y = T(() => {
|
|
1227
|
+
var l;
|
|
1228
|
+
const n = (l = m.value) == null ? void 0 : l.name.trim();
|
|
1229
|
+
return n ? !_t(n) : !1;
|
|
1230
|
+
}), le = T(() => {
|
|
1231
|
+
var l;
|
|
1232
|
+
const n = (l = m.value) == null ? void 0 : l.type;
|
|
1233
|
+
return n === "string" || n === "number";
|
|
1234
|
+
}), ae = T(() => {
|
|
1235
|
+
var n;
|
|
1236
|
+
return ((n = m.value) == null ? void 0 : n.type) === "boolean";
|
|
1237
|
+
}), q = T(() => {
|
|
1238
|
+
U.value;
|
|
1239
|
+
const n = x == null ? void 0 : x.pageData;
|
|
1240
|
+
if (!n) return {};
|
|
1241
|
+
try {
|
|
1242
|
+
return { ...vt(n) };
|
|
1243
|
+
} catch {
|
|
1244
|
+
return {};
|
|
1245
|
+
}
|
|
1246
|
+
}), ee = T(() => {
|
|
1247
|
+
const n = [], l = /* @__PURE__ */ new Set();
|
|
1248
|
+
for (const g of f.value) {
|
|
1249
|
+
const P = g.name.trim();
|
|
1250
|
+
P && l.add(P);
|
|
1251
|
+
const E = P ? V(P) : void 0, J = E !== void 0 ? E : g.value;
|
|
1252
|
+
n.push({
|
|
1253
|
+
id: `field-${g.key}`,
|
|
1254
|
+
kind: "field",
|
|
1255
|
+
name: j(g),
|
|
1256
|
+
typeLabel: Ne(J),
|
|
1257
|
+
summary: bt(J),
|
|
1258
|
+
jsonText: R(J),
|
|
1259
|
+
item: g
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
for (const [g, P] of Object.entries(q.value))
|
|
1263
|
+
l.has(g) || n.push({
|
|
1264
|
+
id: `runtime-${g}`,
|
|
1265
|
+
kind: "runtime",
|
|
1266
|
+
name: g,
|
|
1267
|
+
typeLabel: Ne(P),
|
|
1268
|
+
summary: bt(P),
|
|
1269
|
+
jsonText: R(P)
|
|
1270
|
+
});
|
|
1271
|
+
return n;
|
|
1272
|
+
});
|
|
1273
|
+
function Z(n) {
|
|
1274
|
+
const l = n.trim();
|
|
1275
|
+
l && (G.value = {
|
|
1276
|
+
...G.value,
|
|
1277
|
+
[l]: (G.value[l] ?? 0) + 1
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
function ie(n, l) {
|
|
1281
|
+
l && Z(n);
|
|
1282
|
+
}
|
|
1283
|
+
function B(n) {
|
|
1284
|
+
return (l) => ie(n, l);
|
|
1285
|
+
}
|
|
1286
|
+
async function pe(n) {
|
|
1287
|
+
if (n)
|
|
1288
|
+
try {
|
|
1289
|
+
await navigator.clipboard.writeText(n), oe.success("已复制");
|
|
1290
|
+
} catch {
|
|
1291
|
+
oe.error("复制失败");
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
xe(
|
|
1295
|
+
() => x == null ? void 0 : x.pageData,
|
|
1296
|
+
() => {
|
|
1297
|
+
U.value++;
|
|
1298
|
+
},
|
|
1299
|
+
{ deep: !0 }
|
|
1300
|
+
);
|
|
1301
|
+
function Pe() {
|
|
1302
|
+
if (!m.value) return Promise.reject();
|
|
1303
|
+
const n = C(m.value, $.value);
|
|
1304
|
+
if (n)
|
|
1305
|
+
return oe.warning(n), Promise.reject();
|
|
1306
|
+
if (!b())
|
|
1307
|
+
return oe.warning("保存失败,请重试"), Promise.reject();
|
|
1308
|
+
}
|
|
1309
|
+
function Oe(n) {
|
|
1310
|
+
m.value && (m.value.valueDraft = String(n ?? 0));
|
|
1311
|
+
}
|
|
1312
|
+
function _e(n) {
|
|
1313
|
+
m.value && (m.value.valueDraft = n === !0 || n === "true" ? "true" : "false");
|
|
1314
|
+
}
|
|
1315
|
+
function Se() {
|
|
1316
|
+
w();
|
|
1317
|
+
}
|
|
1318
|
+
return (n, l) => {
|
|
1319
|
+
const g = fn, P = me, E = he, J = mn, F = Yt, u = ve, k = ye, M = ta, X = vn, se = gn, re = je, na = ze;
|
|
1320
|
+
return p(), S(K, null, [
|
|
1321
|
+
s("div", jl, [
|
|
1322
|
+
(p(!0), S(K, null, ne(ee.value, (Q) => (p(), S("div", {
|
|
1323
|
+
key: Q.id,
|
|
1324
|
+
class: ce(["flex items-center", { "opacity-70": Q.kind === "runtime" }])
|
|
1325
|
+
}, [
|
|
1326
|
+
s("div", Rl, [
|
|
1327
|
+
s("div", Vl, [
|
|
1328
|
+
s("span", {
|
|
1329
|
+
class: ce(["inline-flex shrink-0 items-center justify-center rounded-sm p-0.5 text-[10px] leading-none", Q.kind === "field" ? "text-[var(--colorPrimary)] bg-[color-mix(in_srgb,var(--colorPrimary)_12%,transparent)]" : "text-[var(--colorTextTertiary)] bg-[color-mix(in_srgb,var(--colorText)_8%,transparent)]"])
|
|
1330
|
+
}, [
|
|
1331
|
+
o(v(Xt))
|
|
1332
|
+
], 2),
|
|
1333
|
+
s("span", Nl, H(Q.name), 1),
|
|
1334
|
+
o(g, {
|
|
1335
|
+
bordered: !1,
|
|
1336
|
+
class: "mr-0 px-1 py-0 text-[10px] leading-4"
|
|
1337
|
+
}, {
|
|
1338
|
+
default: d(() => [
|
|
1339
|
+
z(H(Q.typeLabel), 1)
|
|
1340
|
+
]),
|
|
1341
|
+
_: 2
|
|
1342
|
+
}, 1024)
|
|
1343
|
+
]),
|
|
1344
|
+
s("div", Hl, H(Q.summary), 1)
|
|
1345
|
+
]),
|
|
1346
|
+
s("div", Ul, [
|
|
1347
|
+
Q.jsonText ? (p(), I(J, {
|
|
1348
|
+
key: 0,
|
|
1349
|
+
trigger: "click",
|
|
1350
|
+
onOpenChange: (Ve) => B(Q.name)
|
|
1351
|
+
}, {
|
|
1352
|
+
title: d(() => [
|
|
1353
|
+
s("div", Bl, [
|
|
1354
|
+
s("span", Fl, H(Q.name), 1),
|
|
1355
|
+
o(P, {
|
|
1356
|
+
type: "link",
|
|
1357
|
+
size: "small",
|
|
1358
|
+
class: "h-auto shrink-0 px-0 text-xs",
|
|
1359
|
+
onClick: ue((Ve) => pe(Q.jsonText), ["stop"])
|
|
1360
|
+
}, {
|
|
1361
|
+
default: d(() => [
|
|
1362
|
+
o(v(Pa)),
|
|
1363
|
+
l[5] || (l[5] = z(" 复制 ", -1))
|
|
1364
|
+
]),
|
|
1365
|
+
_: 1
|
|
1366
|
+
}, 8, ["onClick"])
|
|
1367
|
+
])
|
|
1368
|
+
]),
|
|
1369
|
+
content: d(() => [
|
|
1370
|
+
s("pre", Wl, H(Q.jsonText), 1)
|
|
1371
|
+
]),
|
|
1372
|
+
default: d(() => [
|
|
1373
|
+
o(E, { title: "快照" }, {
|
|
1374
|
+
default: d(() => [
|
|
1375
|
+
o(P, {
|
|
1376
|
+
type: "text",
|
|
1377
|
+
size: "small",
|
|
1378
|
+
class: "shrink-0 px-1"
|
|
1379
|
+
}, {
|
|
1380
|
+
default: d(() => [
|
|
1381
|
+
o(v(Re))
|
|
1382
|
+
]),
|
|
1383
|
+
_: 1
|
|
1384
|
+
})
|
|
1385
|
+
]),
|
|
1386
|
+
_: 1
|
|
1387
|
+
})
|
|
1388
|
+
]),
|
|
1389
|
+
_: 2
|
|
1390
|
+
}, 1032, ["onOpenChange"])) : W("", !0),
|
|
1391
|
+
Q.kind === "field" && Q.item ? (p(), S(K, { key: 1 }, [
|
|
1392
|
+
o(E, { title: "编辑" }, {
|
|
1393
|
+
default: d(() => [
|
|
1394
|
+
o(P, {
|
|
1395
|
+
type: "text",
|
|
1396
|
+
size: "small",
|
|
1397
|
+
onClick: ue((Ve) => _(Q.item), ["stop"])
|
|
1398
|
+
}, {
|
|
1399
|
+
default: d(() => [
|
|
1400
|
+
o(v(ea))
|
|
1401
|
+
]),
|
|
1402
|
+
_: 1
|
|
1403
|
+
}, 8, ["onClick"])
|
|
1404
|
+
]),
|
|
1405
|
+
_: 2
|
|
1406
|
+
}, 1024),
|
|
1407
|
+
o(E, { title: "删除" }, {
|
|
1408
|
+
default: d(() => [
|
|
1409
|
+
o(P, {
|
|
1410
|
+
type: "text",
|
|
1411
|
+
size: "small",
|
|
1412
|
+
danger: "",
|
|
1413
|
+
onClick: ue((Ve) => L(Q.item.key), ["stop"])
|
|
1414
|
+
}, {
|
|
1415
|
+
default: d(() => [
|
|
1416
|
+
o(v(we))
|
|
1417
|
+
]),
|
|
1418
|
+
_: 1
|
|
1419
|
+
}, 8, ["onClick"])
|
|
1420
|
+
]),
|
|
1421
|
+
_: 2
|
|
1422
|
+
}, 1024)
|
|
1423
|
+
], 64)) : W("", !0)
|
|
1424
|
+
])
|
|
1425
|
+
], 2))), 128)),
|
|
1426
|
+
ee.value.length === 0 ? (p(), I(F, {
|
|
1427
|
+
key: 0,
|
|
1428
|
+
description: "暂无数据字段"
|
|
1429
|
+
})) : W("", !0),
|
|
1430
|
+
o(P, {
|
|
1431
|
+
type: "dashed",
|
|
1432
|
+
size: "small",
|
|
1433
|
+
block: "",
|
|
1434
|
+
onClick: y
|
|
1435
|
+
}, {
|
|
1436
|
+
default: d(() => [...l[6] || (l[6] = [
|
|
1437
|
+
z("添加字段", -1)
|
|
1438
|
+
])]),
|
|
1439
|
+
_: 1
|
|
1440
|
+
})
|
|
1441
|
+
]),
|
|
1442
|
+
o(na, {
|
|
1443
|
+
open: D.value,
|
|
1444
|
+
"onUpdate:open": l[4] || (l[4] = (Q) => D.value = Q),
|
|
1445
|
+
title: O.value,
|
|
1446
|
+
"ok-text": "确定",
|
|
1447
|
+
"cancel-text": "取消",
|
|
1448
|
+
width: "520px",
|
|
1449
|
+
"destroy-on-close": "",
|
|
1450
|
+
onOk: Pe,
|
|
1451
|
+
onCancel: Se
|
|
1452
|
+
}, {
|
|
1453
|
+
default: d(() => [
|
|
1454
|
+
m.value ? (p(), I(re, {
|
|
1455
|
+
key: 0,
|
|
1456
|
+
layout: "vertical"
|
|
1457
|
+
}, {
|
|
1458
|
+
default: d(() => [
|
|
1459
|
+
o(k, {
|
|
1460
|
+
label: "字段名",
|
|
1461
|
+
"validate-status": Y.value ? "error" : void 0
|
|
1462
|
+
}, {
|
|
1463
|
+
default: d(() => [
|
|
1464
|
+
o(u, {
|
|
1465
|
+
value: m.value.name,
|
|
1466
|
+
"onUpdate:value": l[0] || (l[0] = (Q) => m.value.name = Q),
|
|
1467
|
+
placeholder: "如:count"
|
|
1468
|
+
}, null, 8, ["value"])
|
|
1469
|
+
]),
|
|
1470
|
+
_: 1
|
|
1471
|
+
}, 8, ["validate-status"]),
|
|
1472
|
+
o(k, { label: "类型" }, {
|
|
1473
|
+
default: d(() => [
|
|
1474
|
+
o(M, {
|
|
1475
|
+
value: m.value.type,
|
|
1476
|
+
"onUpdate:value": [
|
|
1477
|
+
l[1] || (l[1] = (Q) => m.value.type = Q),
|
|
1478
|
+
A
|
|
1479
|
+
],
|
|
1480
|
+
options: v(Oa)
|
|
1481
|
+
}, null, 8, ["value", "options"])
|
|
1482
|
+
]),
|
|
1483
|
+
_: 1
|
|
1484
|
+
}),
|
|
1485
|
+
m.value.type === "null" ? (p(), I(k, {
|
|
1486
|
+
key: 0,
|
|
1487
|
+
label: "值"
|
|
1488
|
+
}, {
|
|
1489
|
+
default: d(() => [
|
|
1490
|
+
o(u, {
|
|
1491
|
+
value: "null",
|
|
1492
|
+
disabled: ""
|
|
1493
|
+
})
|
|
1494
|
+
]),
|
|
1495
|
+
_: 1
|
|
1496
|
+
})) : le.value ? (p(), I(k, {
|
|
1497
|
+
key: 1,
|
|
1498
|
+
label: "值"
|
|
1499
|
+
}, {
|
|
1500
|
+
default: d(() => [
|
|
1501
|
+
m.value.type === "number" ? (p(), I(X, {
|
|
1502
|
+
key: 0,
|
|
1503
|
+
value: Number(m.value.valueDraft),
|
|
1504
|
+
"onUpdate:value": Oe
|
|
1505
|
+
}, null, 8, ["value"])) : (p(), I(u, {
|
|
1506
|
+
key: 1,
|
|
1507
|
+
value: m.value.valueDraft,
|
|
1508
|
+
"onUpdate:value": l[2] || (l[2] = (Q) => m.value.valueDraft = Q),
|
|
1509
|
+
placeholder: "字符串值"
|
|
1510
|
+
}, null, 8, ["value"]))
|
|
1511
|
+
]),
|
|
1512
|
+
_: 1
|
|
1513
|
+
})) : ae.value ? (p(), I(k, {
|
|
1514
|
+
key: 2,
|
|
1515
|
+
label: "值"
|
|
1516
|
+
}, {
|
|
1517
|
+
default: d(() => [
|
|
1518
|
+
o(se, {
|
|
1519
|
+
checked: m.value.valueDraft === "true",
|
|
1520
|
+
"checked-children": "true",
|
|
1521
|
+
"un-checked-children": "false",
|
|
1522
|
+
onChange: _e
|
|
1523
|
+
}, null, 8, ["checked"])
|
|
1524
|
+
]),
|
|
1525
|
+
_: 1
|
|
1526
|
+
})) : (p(), I(k, {
|
|
1527
|
+
key: 3,
|
|
1528
|
+
label: "值(JSON)"
|
|
1529
|
+
}, {
|
|
1530
|
+
default: d(() => [
|
|
1531
|
+
o(v(tt), {
|
|
1532
|
+
modelValue: m.value.valueDraft,
|
|
1533
|
+
"onUpdate:modelValue": l[3] || (l[3] = (Q) => m.value.valueDraft = Q),
|
|
1534
|
+
language: "json",
|
|
1535
|
+
placeholder: m.value.type === "array" ? "[]" : "{}",
|
|
1536
|
+
height: 180
|
|
1537
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
1538
|
+
]),
|
|
1539
|
+
_: 1
|
|
1540
|
+
}))
|
|
1541
|
+
]),
|
|
1542
|
+
_: 1
|
|
1543
|
+
})) : W("", !0)
|
|
1544
|
+
]),
|
|
1545
|
+
_: 1
|
|
1546
|
+
}, 8, ["open", "title"])
|
|
1547
|
+
], 64);
|
|
1548
|
+
};
|
|
1549
|
+
}
|
|
1550
|
+
}), ql = [
|
|
1551
|
+
{
|
|
1552
|
+
key: "pageData",
|
|
1553
|
+
label: "页面数据字段",
|
|
1554
|
+
hint: "在「数据」区定义静态字段,运行时合并为 context.data;字段名须为合法标识符(如 count、pageIndex)",
|
|
1555
|
+
example: `// 定义字段:count = 0,pageIndex = 1
|
|
1556
|
+
// 在函数 / 生命周期中读写(须为 () => { ... } 写法):
|
|
1557
|
+
() => {
|
|
1558
|
+
context.data.count = (context.data.count ?? 0) + 1
|
|
1559
|
+
context.data.pageIndex = 2
|
|
1560
|
+
}`,
|
|
1561
|
+
paramHint: "列表中的「快照」展示当前运行时值;函数写入后也会出现在此处"
|
|
1562
|
+
},
|
|
1563
|
+
{
|
|
1564
|
+
key: "widgetBinding",
|
|
1565
|
+
label: "组件属性绑定",
|
|
1566
|
+
hint: "在右侧属性面板中,可将组件选项绑定到页面数据字段,或调用页面自定义方法",
|
|
1567
|
+
example: `// 文本内容绑定 count
|
|
1568
|
+
{{ count }}
|
|
1569
|
+
|
|
1570
|
+
// 嵌套字段
|
|
1571
|
+
{{ productList.title }}
|
|
1572
|
+
|
|
1573
|
+
// 调用页面方法(参数可为 data / item 字段或字面量)
|
|
1574
|
+
{{ fmDate(time) }}
|
|
1575
|
+
{{ formatPrice(item.price) }}`,
|
|
1576
|
+
paramHint: "语法:{{ 字段名 }} 或 {{ 方法名(参数) }};列表项内可用 item.xxx、index;方法须同步返回值"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
key: "fetchMethod",
|
|
1580
|
+
label: "在函数中请求接口",
|
|
1581
|
+
hint: "HTTP 请求在「函数」面板以 async 方法实现,结果写入 context.data",
|
|
1582
|
+
example: `// loadProductList(pageIndex?, keyword?)
|
|
1583
|
+
async (pageIndex, keyword) => {
|
|
1584
|
+
context.data.loading = true
|
|
1585
|
+
try {
|
|
1586
|
+
const qs = new URLSearchParams({
|
|
1587
|
+
pageIndex: String(pageIndex ?? context.data.pageIndex ?? 1),
|
|
1588
|
+
keyword: keyword ?? context.data.keyword ?? ''
|
|
1589
|
+
})
|
|
1590
|
+
const res = await fetch('/api/products?' + qs)
|
|
1591
|
+
const result = await res.json()
|
|
1592
|
+
context.data.productList = result.data?.items ?? []
|
|
1593
|
+
} finally {
|
|
1594
|
+
context.data.loading = false
|
|
1595
|
+
}
|
|
1596
|
+
}`,
|
|
1597
|
+
paramHint: "在生命周期 mounted 或事件中:await context.methods.loadProductList()"
|
|
1598
|
+
}
|
|
1599
|
+
], Ql = { class: "min-h-0 flex-1 overflow-y-auto scrollbar" }, Yl = { class: "mt-3 p-3 border-t border-[color-mix(in_srgb,var(--colorText)_8%,transparent)] pt-3" }, Jl = { class: "mb-2.5 flex items-center gap-1.5" }, Kl = { class: "flex flex-col gap-2.5" }, Zl = { class: "text-xs font-medium leading-tight" }, Xl = { class: "mt-0.5 text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, er = { class: "mt-1.5 overflow-x-auto rounded-sm bg-[color-mix(in_srgb,var(--colorText)_4%,var(--colorBgContainer))] px-2 py-1.5 font-mono text-[10px] leading-[1.45] text-[var(--colorTextSecondary)] scrollbar" }, tr = {
|
|
1600
|
+
key: 0,
|
|
1601
|
+
class: "mt-1 text-[10px] leading-snug text-[var(--colorTextQuaternary)]"
|
|
1602
|
+
}, ar = /* @__PURE__ */ te({
|
|
1603
|
+
name: "LowcodeDesignerDataSourcePanel",
|
|
1604
|
+
__name: "panel",
|
|
1605
|
+
setup(t) {
|
|
1606
|
+
const e = fe(), a = T(() => e == null ? void 0 : e.page), i = T({
|
|
1607
|
+
get: () => {
|
|
1608
|
+
var r;
|
|
1609
|
+
return ((r = a.value) == null ? void 0 : r.data) ?? [];
|
|
1610
|
+
},
|
|
1611
|
+
set: (r) => {
|
|
1612
|
+
a.value && (a.value.data = r);
|
|
1613
|
+
}
|
|
1614
|
+
});
|
|
1615
|
+
return (r, c) => (p(), S("div", Ql, [
|
|
1616
|
+
o(Gl, {
|
|
1617
|
+
modelValue: i.value,
|
|
1618
|
+
"onUpdate:modelValue": c[0] || (c[0] = (x) => i.value = x)
|
|
1619
|
+
}, null, 8, ["modelValue"]),
|
|
1620
|
+
s("section", Yl, [
|
|
1621
|
+
s("div", Jl, [
|
|
1622
|
+
o(v(at), { class: "text-xs text-[var(--colorTextQuaternary)]" }),
|
|
1623
|
+
c[1] || (c[1] = s("span", { class: "text-xs font-medium text-[var(--colorTextSecondary)]" }, "帮助", -1))
|
|
1624
|
+
]),
|
|
1625
|
+
s("div", Kl, [
|
|
1626
|
+
(p(!0), S(K, null, ne(v(ql), (x) => (p(), S("div", {
|
|
1627
|
+
key: x.key,
|
|
1628
|
+
class: "rounded-sm border border-[color-mix(in_srgb,var(--colorText)_8%,transparent)] p-1"
|
|
1629
|
+
}, [
|
|
1630
|
+
s("div", Zl, H(x.label), 1),
|
|
1631
|
+
s("div", Xl, H(x.hint), 1),
|
|
1632
|
+
s("pre", er, H(x.example), 1),
|
|
1633
|
+
x.paramHint ? (p(), S("div", tr, H(x.paramHint), 1)) : W("", !0)
|
|
1634
|
+
]))), 128)),
|
|
1635
|
+
c[2] || (c[2] = ia('<div class="text-[11px] leading-snug text-[var(--colorTextQuaternary)]"> 页面数据统一挂载在 <span class="font-mono">context.data</span>;HTTP 请求请在「函数」面板编写 async 方法,通过 <span class="font-mono">context.methods.xxx(...)</span> 或生命周期调用;组件属性支持 <span class="font-mono">{{ 字段名 }}</span> 或 <span class="font-mono">{{ 方法名(参数) }}</span> 绑定。 </div>', 1))
|
|
1636
|
+
])
|
|
1637
|
+
])
|
|
1638
|
+
]));
|
|
1639
|
+
}
|
|
1640
|
+
}), nr = { class: "flex flex-col gap-1.5" }, lr = {
|
|
1641
|
+
key: 0,
|
|
1642
|
+
class: "text-[11px] text-[var(--colorTextQuaternary)]"
|
|
1643
|
+
}, rr = /* @__PURE__ */ te({
|
|
1644
|
+
name: "ApiMethodParamsList",
|
|
1645
|
+
__name: "api-method-params-list",
|
|
1646
|
+
props: /* @__PURE__ */ ge({
|
|
1647
|
+
invalid: { type: Boolean }
|
|
1648
|
+
}, {
|
|
1649
|
+
entries: { required: !0, default: () => [] },
|
|
1650
|
+
entriesModifiers: {}
|
|
1651
|
+
}),
|
|
1652
|
+
emits: ["update:entries"],
|
|
1653
|
+
setup(t) {
|
|
1654
|
+
const e = ke(t, "entries");
|
|
1655
|
+
function a() {
|
|
1656
|
+
e.value = [...e.value ?? [], xn()];
|
|
1657
|
+
}
|
|
1658
|
+
function i(r) {
|
|
1659
|
+
e.value = (e.value ?? []).filter((c) => c.id !== r);
|
|
1660
|
+
}
|
|
1661
|
+
return (r, c) => {
|
|
1662
|
+
const x = ve, f = me, D = he, $ = ye;
|
|
1663
|
+
return p(), I($, {
|
|
1664
|
+
class: "mb-2",
|
|
1665
|
+
"validate-status": t.invalid ? "error" : void 0
|
|
1666
|
+
}, {
|
|
1667
|
+
label: d(() => [...c[0] || (c[0] = [
|
|
1668
|
+
s("span", null, "函数参数", -1)
|
|
1669
|
+
])]),
|
|
1670
|
+
default: d(() => {
|
|
1671
|
+
var h;
|
|
1672
|
+
return [
|
|
1673
|
+
s("div", nr, [
|
|
1674
|
+
(h = e.value) != null && h.length ? W("", !0) : (p(), S("div", lr, "暂无参数,调用时可不传参")),
|
|
1675
|
+
(p(!0), S(K, null, ne(e.value ?? [], (m) => (p(), S("div", {
|
|
1676
|
+
key: m.id,
|
|
1677
|
+
class: "flex items-center gap-1.5"
|
|
1678
|
+
}, [
|
|
1679
|
+
o(x, {
|
|
1680
|
+
value: m.name,
|
|
1681
|
+
"onUpdate:value": (O) => m.name = O,
|
|
1682
|
+
class: "min-w-0 flex-1",
|
|
1683
|
+
placeholder: "参数名,如 pageIndex",
|
|
1684
|
+
"allow-clear": ""
|
|
1685
|
+
}, null, 8, ["value", "onUpdate:value"]),
|
|
1686
|
+
o(D, { title: "删除" }, {
|
|
1687
|
+
default: d(() => [
|
|
1688
|
+
o(f, {
|
|
1689
|
+
type: "text",
|
|
1690
|
+
size: "small",
|
|
1691
|
+
danger: "",
|
|
1692
|
+
class: "shrink-0 px-1",
|
|
1693
|
+
onClick: (O) => i(m.id)
|
|
1694
|
+
}, {
|
|
1695
|
+
default: d(() => [
|
|
1696
|
+
o(v(we))
|
|
1697
|
+
]),
|
|
1698
|
+
_: 1
|
|
1699
|
+
}, 8, ["onClick"])
|
|
1700
|
+
]),
|
|
1701
|
+
_: 2
|
|
1702
|
+
}, 1024)
|
|
1703
|
+
]))), 128)),
|
|
1704
|
+
o(f, {
|
|
1705
|
+
type: "dashed",
|
|
1706
|
+
size: "small",
|
|
1707
|
+
block: "",
|
|
1708
|
+
onClick: a
|
|
1709
|
+
}, {
|
|
1710
|
+
icon: d(() => [
|
|
1711
|
+
o(v(nt))
|
|
1712
|
+
]),
|
|
1713
|
+
default: d(() => [
|
|
1714
|
+
c[1] || (c[1] = z(" 添加参数 ", -1))
|
|
1715
|
+
]),
|
|
1716
|
+
_: 1
|
|
1717
|
+
}),
|
|
1718
|
+
c[2] || (c[2] = s("div", { class: "text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, [
|
|
1719
|
+
z(" 对应调用时的形参,如 "),
|
|
1720
|
+
s("span", { class: "font-mono" }, "context.methods.loadList(pageIndex, keyword)"),
|
|
1721
|
+
z("。 ")
|
|
1722
|
+
], -1))
|
|
1723
|
+
])
|
|
1724
|
+
];
|
|
1725
|
+
}),
|
|
1726
|
+
_: 1
|
|
1727
|
+
}, 8, ["validate-status"]);
|
|
1728
|
+
};
|
|
1729
|
+
}
|
|
1730
|
+
}), or = { class: "font-mono text-xs" }, ir = { class: "font-mono text-xs" }, Ke = /* @__PURE__ */ te({
|
|
1731
|
+
__name: "api-param-bind-button",
|
|
1732
|
+
props: {
|
|
1733
|
+
dataFields: { default: () => [] },
|
|
1734
|
+
methodParams: { default: () => [] },
|
|
1735
|
+
bindAsExpression: { type: Boolean, default: !1 }
|
|
1736
|
+
},
|
|
1737
|
+
emits: ["select"],
|
|
1738
|
+
setup(t, { emit: e }) {
|
|
1739
|
+
const a = t, i = e, r = T(() => a.methodParams.length > 0 || a.dataFields.length > 0);
|
|
1740
|
+
function c(x) {
|
|
1741
|
+
i("select", a.bindAsExpression ? `{{${x}}}` : x);
|
|
1742
|
+
}
|
|
1743
|
+
return (x, f) => {
|
|
1744
|
+
const D = me, $ = he, h = Ea, m = Ta, O = Da, L = $a;
|
|
1745
|
+
return r.value ? (p(), I(L, {
|
|
1746
|
+
key: 0,
|
|
1747
|
+
trigger: ["click"]
|
|
1748
|
+
}, {
|
|
1749
|
+
overlay: d(() => [
|
|
1750
|
+
o(O, { class: "max-h-60 overflow-y-auto" }, {
|
|
1751
|
+
default: d(() => [
|
|
1752
|
+
t.methodParams.length ? (p(), I(m, {
|
|
1753
|
+
key: 0,
|
|
1754
|
+
title: "函数入参"
|
|
1755
|
+
}, {
|
|
1756
|
+
default: d(() => [
|
|
1757
|
+
(p(!0), S(K, null, ne(t.methodParams, (y) => (p(), I(h, {
|
|
1758
|
+
key: `param-${y}`,
|
|
1759
|
+
onClick: (_) => c(y)
|
|
1760
|
+
}, {
|
|
1761
|
+
default: d(() => [
|
|
1762
|
+
s("span", or, H(y), 1)
|
|
1763
|
+
]),
|
|
1764
|
+
_: 2
|
|
1765
|
+
}, 1032, ["onClick"]))), 128))
|
|
1766
|
+
]),
|
|
1767
|
+
_: 1
|
|
1768
|
+
})) : W("", !0),
|
|
1769
|
+
t.dataFields.length ? (p(), I(m, {
|
|
1770
|
+
key: 1,
|
|
1771
|
+
title: "页面数据"
|
|
1772
|
+
}, {
|
|
1773
|
+
default: d(() => [
|
|
1774
|
+
(p(!0), S(K, null, ne(t.dataFields, (y) => (p(), I(h, {
|
|
1775
|
+
key: `field-${y}`,
|
|
1776
|
+
onClick: (_) => c(y)
|
|
1777
|
+
}, {
|
|
1778
|
+
default: d(() => [
|
|
1779
|
+
s("span", ir, H(y), 1)
|
|
1780
|
+
]),
|
|
1781
|
+
_: 2
|
|
1782
|
+
}, 1032, ["onClick"]))), 128))
|
|
1783
|
+
]),
|
|
1784
|
+
_: 1
|
|
1785
|
+
})) : W("", !0)
|
|
1786
|
+
]),
|
|
1787
|
+
_: 1
|
|
1788
|
+
})
|
|
1789
|
+
]),
|
|
1790
|
+
default: d(() => [
|
|
1791
|
+
o($, { title: "绑定入参或页面数据" }, {
|
|
1792
|
+
default: d(() => [
|
|
1793
|
+
o(D, {
|
|
1794
|
+
type: "text",
|
|
1795
|
+
size: "small",
|
|
1796
|
+
class: "shrink-0 px-1"
|
|
1797
|
+
}, {
|
|
1798
|
+
default: d(() => [...f[0] || (f[0] = [
|
|
1799
|
+
s("span", { class: "inline-flex items-center justify-center rounded-sm px-0.5 text-[9px] font-serif italic leading-none text-[var(--colorPrimary)] bg-[color-mix(in_srgb,var(--colorPrimary)_12%,transparent)]" }, "fx", -1)
|
|
1800
|
+
])]),
|
|
1801
|
+
_: 1
|
|
1802
|
+
})
|
|
1803
|
+
]),
|
|
1804
|
+
_: 1
|
|
1805
|
+
})
|
|
1806
|
+
]),
|
|
1807
|
+
_: 1
|
|
1808
|
+
})) : W("", !0);
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
}), sr = { class: "flex flex-col gap-1.5" }, ur = {
|
|
1812
|
+
key: 0,
|
|
1813
|
+
class: "text-[11px] text-[var(--colorTextQuaternary)]"
|
|
1814
|
+
}, Ge = /* @__PURE__ */ te({
|
|
1815
|
+
name: "ApiParamListEditor",
|
|
1816
|
+
__name: "api-param-list",
|
|
1817
|
+
props: /* @__PURE__ */ ge({
|
|
1818
|
+
label: {},
|
|
1819
|
+
dataFields: { default: () => [] },
|
|
1820
|
+
methodParams: { default: () => [] }
|
|
1821
|
+
}, {
|
|
1822
|
+
entries: { required: !0, default: () => [] },
|
|
1823
|
+
entriesModifiers: {}
|
|
1824
|
+
}),
|
|
1825
|
+
emits: ["update:entries"],
|
|
1826
|
+
setup(t) {
|
|
1827
|
+
const e = ke(t, "entries");
|
|
1828
|
+
function a() {
|
|
1829
|
+
e.value = [...e.value ?? [], Ia()];
|
|
1830
|
+
}
|
|
1831
|
+
function i(r) {
|
|
1832
|
+
e.value = e.value.filter((c) => c.id !== r);
|
|
1833
|
+
}
|
|
1834
|
+
return (r, c) => {
|
|
1835
|
+
const x = ve, f = me, D = he, $ = ye;
|
|
1836
|
+
return p(), I($, { class: "mb-2" }, {
|
|
1837
|
+
label: d(() => [
|
|
1838
|
+
s("span", null, H(t.label), 1)
|
|
1839
|
+
]),
|
|
1840
|
+
default: d(() => {
|
|
1841
|
+
var h;
|
|
1842
|
+
return [
|
|
1843
|
+
s("div", sr, [
|
|
1844
|
+
(h = e.value) != null && h.length ? W("", !0) : (p(), S("div", ur, "暂无参数")),
|
|
1845
|
+
(p(!0), S(K, null, ne(e.value ?? [], (m) => (p(), S("div", {
|
|
1846
|
+
key: m.id,
|
|
1847
|
+
class: "flex items-center gap-1.5"
|
|
1848
|
+
}, [
|
|
1849
|
+
o(x, {
|
|
1850
|
+
value: m.key,
|
|
1851
|
+
"onUpdate:value": (O) => m.key = O,
|
|
1852
|
+
class: "min-w-0 flex-[2]",
|
|
1853
|
+
placeholder: "Key",
|
|
1854
|
+
"allow-clear": ""
|
|
1855
|
+
}, null, 8, ["value", "onUpdate:value"]),
|
|
1856
|
+
o(x, {
|
|
1857
|
+
value: m.value,
|
|
1858
|
+
"onUpdate:value": (O) => m.value = O,
|
|
1859
|
+
class: "min-w-0 flex-[3]",
|
|
1860
|
+
placeholder: "值或 {{入参/字段}}",
|
|
1861
|
+
"allow-clear": ""
|
|
1862
|
+
}, null, 8, ["value", "onUpdate:value"]),
|
|
1863
|
+
o(Ke, {
|
|
1864
|
+
"data-fields": t.dataFields,
|
|
1865
|
+
"method-params": t.methodParams,
|
|
1866
|
+
"bind-as-expression": "",
|
|
1867
|
+
onSelect: (O) => m.value = O
|
|
1868
|
+
}, null, 8, ["data-fields", "method-params", "onSelect"]),
|
|
1869
|
+
o(D, { title: "删除" }, {
|
|
1870
|
+
default: d(() => [
|
|
1871
|
+
o(f, {
|
|
1872
|
+
type: "text",
|
|
1873
|
+
size: "small",
|
|
1874
|
+
danger: "",
|
|
1875
|
+
class: "shrink-0 px-1",
|
|
1876
|
+
onClick: (O) => i(m.id)
|
|
1877
|
+
}, {
|
|
1878
|
+
default: d(() => [
|
|
1879
|
+
o(v(we))
|
|
1880
|
+
]),
|
|
1881
|
+
_: 1
|
|
1882
|
+
}, 8, ["onClick"])
|
|
1883
|
+
]),
|
|
1884
|
+
_: 2
|
|
1885
|
+
}, 1024)
|
|
1886
|
+
]))), 128)),
|
|
1887
|
+
o(f, {
|
|
1888
|
+
type: "dashed",
|
|
1889
|
+
size: "small",
|
|
1890
|
+
block: "",
|
|
1891
|
+
onClick: a
|
|
1892
|
+
}, {
|
|
1893
|
+
icon: d(() => [
|
|
1894
|
+
o(v(nt))
|
|
1895
|
+
]),
|
|
1896
|
+
default: d(() => [
|
|
1897
|
+
c[0] || (c[0] = z(" 添加参数 ", -1))
|
|
1898
|
+
]),
|
|
1899
|
+
_: 1
|
|
1900
|
+
}),
|
|
1901
|
+
c[1] || (c[1] = s("div", { class: "text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, [
|
|
1902
|
+
z(" 值支持固定输入,或通过 "),
|
|
1903
|
+
s("span", { class: "font-mono" }, "fx"),
|
|
1904
|
+
z(" 绑定函数入参 / 页面数据。 ")
|
|
1905
|
+
], -1))
|
|
1906
|
+
])
|
|
1907
|
+
];
|
|
1908
|
+
}),
|
|
1909
|
+
_: 1
|
|
1910
|
+
});
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
}), cr = { class: "flex flex-col gap-2" }, dr = {
|
|
1914
|
+
key: 0,
|
|
1915
|
+
class: "text-[11px] text-[var(--colorTextQuaternary)]"
|
|
1916
|
+
}, pr = { class: "mb-1.5 flex items-center justify-between gap-2" }, fr = { class: "text-[11px] font-medium text-[var(--colorTextSecondary)]" }, mr = { class: "grid grid-cols-1 gap-1.5" }, vr = { class: "flex items-center gap-1.5" }, gr = { class: "flex items-center gap-1.5" }, xr = /* @__PURE__ */ te({
|
|
1917
|
+
name: "ApiResultRulesList",
|
|
1918
|
+
__name: "api-result-rules-list",
|
|
1919
|
+
props: /* @__PURE__ */ ge({
|
|
1920
|
+
dataFields: {},
|
|
1921
|
+
methodParams: {},
|
|
1922
|
+
targetInvalid: { type: Boolean }
|
|
1923
|
+
}, {
|
|
1924
|
+
rules: { required: !0, default: () => [] },
|
|
1925
|
+
rulesModifiers: {}
|
|
1926
|
+
}),
|
|
1927
|
+
emits: ["update:rules"],
|
|
1928
|
+
setup(t) {
|
|
1929
|
+
const e = ke(t, "rules");
|
|
1930
|
+
function a() {
|
|
1931
|
+
e.value = [...e.value ?? [], hn()];
|
|
1932
|
+
}
|
|
1933
|
+
function i(r) {
|
|
1934
|
+
e.value = (e.value ?? []).filter((c, x) => x !== r);
|
|
1935
|
+
}
|
|
1936
|
+
return (r, c) => {
|
|
1937
|
+
const x = me, f = he, D = ve, $ = ye;
|
|
1938
|
+
return p(), I($, {
|
|
1939
|
+
class: "mb-2",
|
|
1940
|
+
"validate-status": t.targetInvalid ? "error" : void 0
|
|
1941
|
+
}, {
|
|
1942
|
+
label: d(() => [...c[0] || (c[0] = [
|
|
1943
|
+
s("span", null, "结果处理(可选)", -1)
|
|
1944
|
+
])]),
|
|
1945
|
+
default: d(() => {
|
|
1946
|
+
var h;
|
|
1947
|
+
return [
|
|
1948
|
+
s("div", cr, [
|
|
1949
|
+
(h = e.value) != null && h.length ? W("", !0) : (p(), S("div", dr, "未配置:请求成功但不写入页面数据")),
|
|
1950
|
+
(p(!0), S(K, null, ne(e.value ?? [], (m, O) => (p(), S("div", {
|
|
1951
|
+
key: O,
|
|
1952
|
+
class: "rounded-sm border border-[color-mix(in_srgb,var(--colorText)_10%,transparent)] p-2"
|
|
1953
|
+
}, [
|
|
1954
|
+
s("div", pr, [
|
|
1955
|
+
s("span", fr, "映射 " + H(O + 1), 1),
|
|
1956
|
+
o(f, { title: "删除" }, {
|
|
1957
|
+
default: d(() => [
|
|
1958
|
+
o(x, {
|
|
1959
|
+
type: "text",
|
|
1960
|
+
size: "small",
|
|
1961
|
+
danger: "",
|
|
1962
|
+
class: "px-1",
|
|
1963
|
+
onClick: (L) => i(O)
|
|
1964
|
+
}, {
|
|
1965
|
+
default: d(() => [
|
|
1966
|
+
o(v(we))
|
|
1967
|
+
]),
|
|
1968
|
+
_: 1
|
|
1969
|
+
}, 8, ["onClick"])
|
|
1970
|
+
]),
|
|
1971
|
+
_: 2
|
|
1972
|
+
}, 1024)
|
|
1973
|
+
]),
|
|
1974
|
+
s("div", mr, [
|
|
1975
|
+
s("div", vr, [
|
|
1976
|
+
o(D, {
|
|
1977
|
+
value: m.target,
|
|
1978
|
+
"onUpdate:value": (L) => m.target = L,
|
|
1979
|
+
class: "min-w-0 flex-1",
|
|
1980
|
+
placeholder: "目标字段,如 productList",
|
|
1981
|
+
"allow-clear": ""
|
|
1982
|
+
}, null, 8, ["value", "onUpdate:value"]),
|
|
1983
|
+
o(Ke, {
|
|
1984
|
+
"data-fields": t.dataFields,
|
|
1985
|
+
"method-params": t.methodParams,
|
|
1986
|
+
onSelect: (L) => m.target = L
|
|
1987
|
+
}, null, 8, ["data-fields", "method-params", "onSelect"])
|
|
1988
|
+
]),
|
|
1989
|
+
o(D, {
|
|
1990
|
+
value: m.sourcePath,
|
|
1991
|
+
"onUpdate:value": (L) => m.sourcePath = L,
|
|
1992
|
+
placeholder: "来源路径,如 data.items(留空=整段响应)",
|
|
1993
|
+
"allow-clear": ""
|
|
1994
|
+
}, null, 8, ["value", "onUpdate:value"]),
|
|
1995
|
+
s("div", gr, [
|
|
1996
|
+
o(D, {
|
|
1997
|
+
value: m.fallback,
|
|
1998
|
+
"onUpdate:value": (L) => m.fallback = L,
|
|
1999
|
+
class: "min-w-0 flex-1",
|
|
2000
|
+
placeholder: "默认值,可选 {{字段}}",
|
|
2001
|
+
"allow-clear": ""
|
|
2002
|
+
}, null, 8, ["value", "onUpdate:value"]),
|
|
2003
|
+
o(Ke, {
|
|
2004
|
+
"data-fields": t.dataFields,
|
|
2005
|
+
"method-params": t.methodParams,
|
|
2006
|
+
"bind-as-expression": "",
|
|
2007
|
+
onSelect: (L) => m.fallback = L
|
|
2008
|
+
}, null, 8, ["data-fields", "method-params", "onSelect"])
|
|
2009
|
+
])
|
|
2010
|
+
])
|
|
2011
|
+
]))), 128)),
|
|
2012
|
+
o(x, {
|
|
2013
|
+
type: "dashed",
|
|
2014
|
+
size: "small",
|
|
2015
|
+
block: "",
|
|
2016
|
+
onClick: a
|
|
2017
|
+
}, {
|
|
2018
|
+
icon: d(() => [
|
|
2019
|
+
o(v(nt))
|
|
2020
|
+
]),
|
|
2021
|
+
default: d(() => [
|
|
2022
|
+
c[1] || (c[1] = z(" 添加映射 ", -1))
|
|
2023
|
+
]),
|
|
2024
|
+
_: 1
|
|
2025
|
+
}),
|
|
2026
|
+
c[2] || (c[2] = s("div", { class: "text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, [
|
|
2027
|
+
z(" 将响应写入 "),
|
|
2028
|
+
s("span", { class: "font-mono" }, "context.data"),
|
|
2029
|
+
z(";来源路径相对响应根对象;默认值支持 "),
|
|
2030
|
+
s("code", null, "{{ 入参/字段 }}"),
|
|
2031
|
+
z("。 ")
|
|
2032
|
+
], -1))
|
|
2033
|
+
])
|
|
2034
|
+
];
|
|
2035
|
+
}),
|
|
2036
|
+
_: 1
|
|
2037
|
+
}, 8, ["validate-status"]);
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
}), hr = { class: "grid grid-cols-[88px_1fr] gap-x-3" }, yr = /* @__PURE__ */ te({
|
|
2041
|
+
name: "MethodApiConfigForm",
|
|
2042
|
+
__name: "method-api-config-form",
|
|
2043
|
+
props: {
|
|
2044
|
+
modelValue: {},
|
|
2045
|
+
pageData: {},
|
|
2046
|
+
urlInvalid: { type: Boolean },
|
|
2047
|
+
resultInvalid: { type: Boolean },
|
|
2048
|
+
paramsInvalid: { type: Boolean }
|
|
2049
|
+
},
|
|
2050
|
+
emits: ["update:modelValue"],
|
|
2051
|
+
setup(t, { emit: e }) {
|
|
2052
|
+
const a = t, i = e, r = N(Me(a.modelValue)), c = T({
|
|
2053
|
+
get() {
|
|
2054
|
+
return r.value.result || (r.value.result = []), r.value.result;
|
|
2055
|
+
},
|
|
2056
|
+
set(C) {
|
|
2057
|
+
r.value.result = C;
|
|
2058
|
+
}
|
|
2059
|
+
}), x = N(He(a.modelValue.request.query)), f = N(He(a.modelValue.request.headers)), D = N(He(a.modelValue.request.body)), $ = N(yn(a.modelValue.params));
|
|
2060
|
+
function h() {
|
|
2061
|
+
r.value.params = bn($.value);
|
|
2062
|
+
}
|
|
2063
|
+
function m() {
|
|
2064
|
+
i("update:modelValue", Me(r.value));
|
|
2065
|
+
}
|
|
2066
|
+
function O() {
|
|
2067
|
+
r.value.request.query = Ue(x.value), r.value.request.headers = Ue(f.value), r.value.request.body = Ue(D.value);
|
|
2068
|
+
}
|
|
2069
|
+
xe([x, f, D], () => {
|
|
2070
|
+
O();
|
|
2071
|
+
}, { deep: !0 }), xe($, () => {
|
|
2072
|
+
h();
|
|
2073
|
+
}, { deep: !0 }), xe(
|
|
2074
|
+
r,
|
|
2075
|
+
() => {
|
|
2076
|
+
m();
|
|
2077
|
+
},
|
|
2078
|
+
{ deep: !0 }
|
|
2079
|
+
);
|
|
2080
|
+
const L = [
|
|
2081
|
+
{ value: "GET", label: "GET" },
|
|
2082
|
+
{ value: "POST", label: "POST" },
|
|
2083
|
+
{ value: "PUT", label: "PUT" },
|
|
2084
|
+
{ value: "DELETE", label: "DELETE" }
|
|
2085
|
+
], y = T(() => _n(r.value.params)), _ = T(() => {
|
|
2086
|
+
var j;
|
|
2087
|
+
const C = new Set(y.value), b = /* @__PURE__ */ new Set();
|
|
2088
|
+
for (const A of a.pageData ?? []) {
|
|
2089
|
+
const R = A.name.trim();
|
|
2090
|
+
R && !C.has(R) && b.add(R);
|
|
2091
|
+
}
|
|
2092
|
+
const w = (j = r.value.loadingField) == null ? void 0 : j.trim();
|
|
2093
|
+
w && !C.has(w) && b.add(w);
|
|
2094
|
+
for (const A of r.value.result ?? []) {
|
|
2095
|
+
const R = A.target.trim();
|
|
2096
|
+
R && !C.has(R) && b.add(R);
|
|
2097
|
+
}
|
|
2098
|
+
return [...b].sort();
|
|
2099
|
+
});
|
|
2100
|
+
return (C, b) => {
|
|
2101
|
+
const w = ve, j = ye, A = ta, R = je;
|
|
2102
|
+
return p(), I(R, {
|
|
2103
|
+
layout: "vertical",
|
|
2104
|
+
class: "mb-1"
|
|
2105
|
+
}, {
|
|
2106
|
+
default: d(() => [
|
|
2107
|
+
o(rr, {
|
|
2108
|
+
entries: $.value,
|
|
2109
|
+
"onUpdate:entries": b[0] || (b[0] = (V) => $.value = V),
|
|
2110
|
+
invalid: t.paramsInvalid
|
|
2111
|
+
}, null, 8, ["entries", "invalid"]),
|
|
2112
|
+
o(j, {
|
|
2113
|
+
label: "Loading 字段(可选)",
|
|
2114
|
+
class: "mb-2"
|
|
2115
|
+
}, {
|
|
2116
|
+
default: d(() => [
|
|
2117
|
+
o(w, {
|
|
2118
|
+
value: r.value.loadingField,
|
|
2119
|
+
"onUpdate:value": b[1] || (b[1] = (V) => r.value.loadingField = V),
|
|
2120
|
+
placeholder: "如:loading",
|
|
2121
|
+
"allow-clear": ""
|
|
2122
|
+
}, null, 8, ["value"])
|
|
2123
|
+
]),
|
|
2124
|
+
_: 1
|
|
2125
|
+
}),
|
|
2126
|
+
s("div", hr, [
|
|
2127
|
+
o(j, {
|
|
2128
|
+
label: "Method",
|
|
2129
|
+
class: "mb-2"
|
|
2130
|
+
}, {
|
|
2131
|
+
default: d(() => [
|
|
2132
|
+
o(A, {
|
|
2133
|
+
value: r.value.request.method,
|
|
2134
|
+
"onUpdate:value": b[2] || (b[2] = (V) => r.value.request.method = V),
|
|
2135
|
+
options: L
|
|
2136
|
+
}, null, 8, ["value"])
|
|
2137
|
+
]),
|
|
2138
|
+
_: 1
|
|
2139
|
+
}),
|
|
2140
|
+
o(j, {
|
|
2141
|
+
label: "URL",
|
|
2142
|
+
class: "mb-2",
|
|
2143
|
+
"validate-status": t.urlInvalid ? "error" : void 0
|
|
2144
|
+
}, {
|
|
2145
|
+
default: d(() => [
|
|
2146
|
+
o(w, {
|
|
2147
|
+
value: r.value.request.url,
|
|
2148
|
+
"onUpdate:value": b[3] || (b[3] = (V) => r.value.request.url = V),
|
|
2149
|
+
placeholder: "如:https://example.com/api/products/list"
|
|
2150
|
+
}, null, 8, ["value"])
|
|
2151
|
+
]),
|
|
2152
|
+
_: 1
|
|
2153
|
+
}, 8, ["validate-status"])
|
|
2154
|
+
]),
|
|
2155
|
+
o(Ge, {
|
|
2156
|
+
entries: x.value,
|
|
2157
|
+
"onUpdate:entries": b[4] || (b[4] = (V) => x.value = V),
|
|
2158
|
+
label: "Query",
|
|
2159
|
+
"data-fields": _.value,
|
|
2160
|
+
"method-params": y.value
|
|
2161
|
+
}, null, 8, ["entries", "data-fields", "method-params"]),
|
|
2162
|
+
o(Ge, {
|
|
2163
|
+
entries: f.value,
|
|
2164
|
+
"onUpdate:entries": b[5] || (b[5] = (V) => f.value = V),
|
|
2165
|
+
label: "Headers",
|
|
2166
|
+
"data-fields": _.value,
|
|
2167
|
+
"method-params": y.value
|
|
2168
|
+
}, null, 8, ["entries", "data-fields", "method-params"]),
|
|
2169
|
+
(r.value.request.method ?? "GET") !== "GET" ? (p(), I(Ge, {
|
|
2170
|
+
key: 0,
|
|
2171
|
+
entries: D.value,
|
|
2172
|
+
"onUpdate:entries": b[6] || (b[6] = (V) => D.value = V),
|
|
2173
|
+
label: "Body",
|
|
2174
|
+
"data-fields": _.value,
|
|
2175
|
+
"method-params": y.value
|
|
2176
|
+
}, null, 8, ["entries", "data-fields", "method-params"])) : W("", !0),
|
|
2177
|
+
o(xr, {
|
|
2178
|
+
rules: c.value,
|
|
2179
|
+
"onUpdate:rules": b[7] || (b[7] = (V) => c.value = V),
|
|
2180
|
+
"data-fields": _.value,
|
|
2181
|
+
"method-params": y.value,
|
|
2182
|
+
"target-invalid": t.resultInvalid
|
|
2183
|
+
}, null, 8, ["rules", "data-fields", "method-params", "target-invalid"])
|
|
2184
|
+
]),
|
|
2185
|
+
_: 1
|
|
2186
|
+
});
|
|
2187
|
+
};
|
|
2188
|
+
}
|
|
2189
|
+
}), mt = [
|
|
2190
|
+
{
|
|
2191
|
+
key: "updateData",
|
|
2192
|
+
label: "读写页面数据",
|
|
2193
|
+
hint: "context.data 与「页面数据」面板字段同一引用,修改后绑定该数据的组件会自动更新",
|
|
2194
|
+
example: `() => {
|
|
2195
|
+
context.data.count = (context.data.count ?? 0) + 1
|
|
2196
|
+
}`,
|
|
2197
|
+
placeholder: `() => {
|
|
2198
|
+
context.data.count = (context.data.count ?? 0) + 1
|
|
2199
|
+
}`,
|
|
2200
|
+
paramHint: "无参时可写 () => { ... };页面环境通过闭包 context 访问"
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
key: "fetchData",
|
|
2204
|
+
label: "请求接口(async 函数)",
|
|
2205
|
+
hint: "HTTP 请求在 async 函数中通过 fetch 实现,结果写入 context.data",
|
|
2206
|
+
example: `async (pageIndex, keyword) => {
|
|
2207
|
+
context.data.loading = true
|
|
2208
|
+
try {
|
|
2209
|
+
const qs = new URLSearchParams({
|
|
2210
|
+
pageIndex: String(pageIndex ?? context.data.pageIndex ?? 1),
|
|
2211
|
+
keyword: keyword ?? context.data.keyword ?? ''
|
|
2212
|
+
})
|
|
2213
|
+
const res = await fetch('/api/products?' + qs)
|
|
2214
|
+
const result = await res.json()
|
|
2215
|
+
context.data.productList = result.data?.items ?? []
|
|
2216
|
+
} finally {
|
|
2217
|
+
context.data.loading = false
|
|
2218
|
+
}
|
|
2219
|
+
}`,
|
|
2220
|
+
placeholder: `async () => {
|
|
2221
|
+
const res = await fetch('/api/products')
|
|
2222
|
+
context.data.productList = (await res.json()).data?.items ?? []
|
|
2223
|
+
}`,
|
|
2224
|
+
paramHint: "在生命周期或事件中:await context.methods.loadProductList(...)"
|
|
2225
|
+
},
|
|
2226
|
+
{
|
|
2227
|
+
key: "widgetBinding",
|
|
2228
|
+
label: "在组件属性中调用",
|
|
2229
|
+
hint: "组件属性 / 接口参数绑定中可写 {{ 函数名(参数) }};参数支持 data / item 字段、字面量或嵌套函数调用",
|
|
2230
|
+
example: `// 组件文本属性示例
|
|
2231
|
+
{{ fmDate(time) }}
|
|
2232
|
+
{{ formatPrice(item.price) }}
|
|
2233
|
+
|
|
2234
|
+
// 函数体示例(须同步 return 结果;可选参数与形参一一对应)
|
|
2235
|
+
(url, w, h) => {
|
|
2236
|
+
if (!url) return ''
|
|
2237
|
+
const width = w ?? context.data.defaultImgW ?? 200
|
|
2238
|
+
const height = h ?? context.data.defaultImgH ?? width
|
|
2239
|
+
return String(url)
|
|
2240
|
+
}`,
|
|
2241
|
+
paramHint: "绑定表达式中不支持 async 返回值;形参仅对应 {{ }} 传入的参数,context 由运行时注入;列表项内可用 item.xxx、index"
|
|
2242
|
+
},
|
|
2243
|
+
{
|
|
2244
|
+
key: "callMethod",
|
|
2245
|
+
label: "调用其他函数",
|
|
2246
|
+
hint: "在函数内组合调用同页其它自定义函数,便于拆分复用逻辑",
|
|
2247
|
+
example: `async () => {
|
|
2248
|
+
context.methods.resetFilters()
|
|
2249
|
+
await context.methods.loadProductList()
|
|
2250
|
+
}`,
|
|
2251
|
+
paramHint: "可用:context.methods.methodName(...args)"
|
|
2252
|
+
},
|
|
2253
|
+
{
|
|
2254
|
+
key: "widgetEvent",
|
|
2255
|
+
label: "响应组件事件",
|
|
2256
|
+
hint: "在组件「事件」面板编写 handler,点击等交互会触发",
|
|
2257
|
+
example: `(event, widgetCtx) => {
|
|
2258
|
+
context.data.lastClickedId = widgetCtx.widget.id
|
|
2259
|
+
}`,
|
|
2260
|
+
paramHint: "形参 event、widgetCtx 由事件传入;context 由闭包注入"
|
|
2261
|
+
},
|
|
2262
|
+
{
|
|
2263
|
+
key: "async",
|
|
2264
|
+
label: "异步 / await",
|
|
2265
|
+
hint: "需要等待接口返回时使用 async 写法;函数体以 async 开头同样支持",
|
|
2266
|
+
example: `async () => {
|
|
2267
|
+
context.data.submitting = true
|
|
2268
|
+
try {
|
|
2269
|
+
await context.methods.submitOrder()
|
|
2270
|
+
context.methods.showSuccessToast()
|
|
2271
|
+
} finally {
|
|
2272
|
+
context.data.submitting = false
|
|
2273
|
+
}
|
|
2274
|
+
}`,
|
|
2275
|
+
paramHint: "须写 async () => { ... } 或 (args) => { await ... } 形式"
|
|
2276
|
+
}
|
|
2277
|
+
];
|
|
2278
|
+
var Nt;
|
|
2279
|
+
const _r = ((Nt = mt[0]) == null ? void 0 : Nt.placeholder) ?? `() => {
|
|
2280
|
+
context.data.count += 1
|
|
2281
|
+
}`;
|
|
2282
|
+
function br(t) {
|
|
2283
|
+
var a;
|
|
2284
|
+
const e = lt(t) ? "api" : "function";
|
|
2285
|
+
return {
|
|
2286
|
+
name: t.name,
|
|
2287
|
+
handler: t.handler,
|
|
2288
|
+
kind: e,
|
|
2289
|
+
api: Me((a = t.meta) == null ? void 0 : a.api)
|
|
2290
|
+
};
|
|
2291
|
+
}
|
|
2292
|
+
function kr(t) {
|
|
2293
|
+
return {
|
|
2294
|
+
name: "",
|
|
2295
|
+
handler: "",
|
|
2296
|
+
kind: t,
|
|
2297
|
+
api: $n()
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
function aa(t) {
|
|
2301
|
+
return Sn(t);
|
|
2302
|
+
}
|
|
2303
|
+
function Le(t, e) {
|
|
2304
|
+
return e.kind === "api" ? {
|
|
2305
|
+
key: t,
|
|
2306
|
+
name: e.name,
|
|
2307
|
+
handler: aa(e.api),
|
|
2308
|
+
meta: {
|
|
2309
|
+
template: "api",
|
|
2310
|
+
api: Me(e.api)
|
|
2311
|
+
}
|
|
2312
|
+
} : {
|
|
2313
|
+
key: t,
|
|
2314
|
+
name: e.name,
|
|
2315
|
+
handler: e.handler
|
|
2316
|
+
};
|
|
2317
|
+
}
|
|
2318
|
+
function wr(t, e) {
|
|
2319
|
+
const a = fe(), i = qt(et, null), r = N(!1), c = N(null), x = N(!1), f = N(null), D = N(!1), $ = N(null), h = T(() => {
|
|
2320
|
+
const u = f.value, k = u == null ? void 0 : u.name.trim();
|
|
2321
|
+
return x.value ? (u == null ? void 0 : u.kind) === "api" ? "添加接口" : "添加函数" : (u == null ? void 0 : u.kind) === "api" ? k ? `编辑接口:${k}()` : "编辑接口" : k ? `编辑函数:${k}()` : "编辑函数";
|
|
2322
|
+
});
|
|
2323
|
+
function m(u) {
|
|
2324
|
+
return typeof u == "string" && u.trim().length > 0;
|
|
2325
|
+
}
|
|
2326
|
+
function O(u) {
|
|
2327
|
+
const k = t.value.find((M) => M.key === u);
|
|
2328
|
+
return t.value = t.value.filter((M) => M.key !== u), k ?? null;
|
|
2329
|
+
}
|
|
2330
|
+
function L(u) {
|
|
2331
|
+
x.value = !0, c.value = null, f.value = kr(u), r.value = !0;
|
|
2332
|
+
}
|
|
2333
|
+
function y() {
|
|
2334
|
+
L("function");
|
|
2335
|
+
}
|
|
2336
|
+
function _() {
|
|
2337
|
+
L("api");
|
|
2338
|
+
}
|
|
2339
|
+
function C(u) {
|
|
2340
|
+
const k = t.value.find((M) => M.key === u.key);
|
|
2341
|
+
k && (x.value = !1, c.value = k.key, f.value = br(k), r.value = !0);
|
|
2342
|
+
}
|
|
2343
|
+
function b(u) {
|
|
2344
|
+
return u.kind === "api" ? aa(u.api) : u.handler;
|
|
2345
|
+
}
|
|
2346
|
+
function w(u, k) {
|
|
2347
|
+
const M = u.name.trim();
|
|
2348
|
+
if (!M) return u.kind === "api" ? "请填写接口名" : "请填写函数名";
|
|
2349
|
+
if (!Ce(M))
|
|
2350
|
+
return u.kind === "api" ? "接口名格式无效" : "函数名格式无效";
|
|
2351
|
+
if (Ma(t.value, M, k ?? void 0))
|
|
2352
|
+
return u.kind === "api" ? "接口名已被使用" : "函数名已被使用";
|
|
2353
|
+
if (u.kind === "api")
|
|
2354
|
+
return On(u.api, wt, Be);
|
|
2355
|
+
const X = u.handler.trim();
|
|
2356
|
+
return X ? Ie(X) ? null : "函数须为带 {} 的完整函数写法,如 () => { ... } 或 (url, w) => { return ... }" : "请编写函数体";
|
|
2357
|
+
}
|
|
2358
|
+
function j(u) {
|
|
2359
|
+
const k = a == null ? void 0 : a.page;
|
|
2360
|
+
if (!k) return [];
|
|
2361
|
+
const M = k.data ?? [], { pageData: X, added: se } = Cn(M, u, Be);
|
|
2362
|
+
return se.length ? (k.data = za(X), se) : [];
|
|
2363
|
+
}
|
|
2364
|
+
function A() {
|
|
2365
|
+
if (!f.value || w(f.value, c.value)) return null;
|
|
2366
|
+
const k = f.value.kind === "api" ? j(f.value.api) : [];
|
|
2367
|
+
if (x.value) {
|
|
2368
|
+
const re = Le(0, f.value);
|
|
2369
|
+
return t.value = Qe([...t.value, re]), R(), { item: re, addedPageDataFields: k };
|
|
2370
|
+
}
|
|
2371
|
+
const M = c.value;
|
|
2372
|
+
if (M === null) return null;
|
|
2373
|
+
const X = Le(M, f.value);
|
|
2374
|
+
return t.value.some((re) => re.key === M) ? (t.value = Qe(t.value.map((re) => re.key === M ? X : re)), R(), { item: X, addedPageDataFields: k }) : null;
|
|
2375
|
+
}
|
|
2376
|
+
function R() {
|
|
2377
|
+
r.value = !1, c.value = null, x.value = !1, f.value = null;
|
|
2378
|
+
}
|
|
2379
|
+
function V(u) {
|
|
2380
|
+
const k = u.name.trim();
|
|
2381
|
+
return k ? La(k, u.handler) : lt(u) ? "未命名接口" : "未命名函数";
|
|
2382
|
+
}
|
|
2383
|
+
function U(u) {
|
|
2384
|
+
const k = u.name.trim();
|
|
2385
|
+
return !!(k && Ce(k));
|
|
2386
|
+
}
|
|
2387
|
+
function G() {
|
|
2388
|
+
return f.value ? x.value ? Le(0, f.value) : c.value === null ? null : Le(c.value, f.value) : null;
|
|
2389
|
+
}
|
|
2390
|
+
const Y = T(() => []), le = T(() => {
|
|
2391
|
+
var k;
|
|
2392
|
+
const u = (k = f.value) == null ? void 0 : k.name.trim();
|
|
2393
|
+
return u ? !Ce(u) : !1;
|
|
2394
|
+
}), ae = T(() => {
|
|
2395
|
+
var k, M;
|
|
2396
|
+
if (((k = f.value) == null ? void 0 : k.kind) === "api") return !1;
|
|
2397
|
+
const u = (M = f.value) == null ? void 0 : M.handler.trim();
|
|
2398
|
+
return u ? !Ie(u) : !1;
|
|
2399
|
+
}), q = T(() => {
|
|
2400
|
+
var k;
|
|
2401
|
+
if (((k = f.value) == null ? void 0 : k.kind) !== "api") return !1;
|
|
2402
|
+
const u = f.value.api.request.url.trim();
|
|
2403
|
+
return u ? !wt(u) : !1;
|
|
2404
|
+
}), ee = T(() => {
|
|
2405
|
+
var u;
|
|
2406
|
+
if (((u = f.value) == null ? void 0 : u.kind) !== "api") return !1;
|
|
2407
|
+
for (const k of f.value.api.result ?? []) {
|
|
2408
|
+
const M = k.target.trim();
|
|
2409
|
+
if (M && !Be(M))
|
|
2410
|
+
return !0;
|
|
2411
|
+
}
|
|
2412
|
+
return !1;
|
|
2413
|
+
}), Z = T(() => {
|
|
2414
|
+
var u;
|
|
2415
|
+
return ((u = f.value) == null ? void 0 : u.kind) !== "api" ? !1 : !kn(f.value.api.params);
|
|
2416
|
+
});
|
|
2417
|
+
function ie(u) {
|
|
2418
|
+
O(u);
|
|
2419
|
+
}
|
|
2420
|
+
function B(u) {
|
|
2421
|
+
}
|
|
2422
|
+
function pe() {
|
|
2423
|
+
var se;
|
|
2424
|
+
if (!f.value) return Promise.reject();
|
|
2425
|
+
c.value !== null && ((se = t.value.find((re) => re.key === c.value)) == null || se.name);
|
|
2426
|
+
const u = w(f.value, c.value);
|
|
2427
|
+
if (u)
|
|
2428
|
+
return oe.warning(u), Promise.reject();
|
|
2429
|
+
const k = A();
|
|
2430
|
+
if (!k)
|
|
2431
|
+
return oe.warning("保存失败,请重试"), Promise.reject();
|
|
2432
|
+
const { item: M, addedPageDataFields: X } = k;
|
|
2433
|
+
X.length && oe.info(`已自动添加页面数据字段:${X.join("、")}`), M.name.trim() && Ce(M.name) && (e != null && e.selectedMethod);
|
|
2434
|
+
}
|
|
2435
|
+
function Pe() {
|
|
2436
|
+
R();
|
|
2437
|
+
}
|
|
2438
|
+
function Oe(u) {
|
|
2439
|
+
const k = u.handler.trim();
|
|
2440
|
+
return U(u) && m(k) && Ie(k);
|
|
2441
|
+
}
|
|
2442
|
+
function _e() {
|
|
2443
|
+
return f.value ? w(f.value, c.value) === null : !1;
|
|
2444
|
+
}
|
|
2445
|
+
function Se(u) {
|
|
2446
|
+
if (u.reason === "empty") return "请先编写函数函数";
|
|
2447
|
+
if (u.reason === "invalid_name") return "请先填写有效函数名";
|
|
2448
|
+
if (u.reason === "invalid_handler") return "函数须为带 {} 的完整函数写法";
|
|
2449
|
+
if (u.reason === "compile_failed") return "函数解析失败,请检查语法";
|
|
2450
|
+
const k = u.error;
|
|
2451
|
+
return k instanceof Error && k.message ? `执行失败:${k.message}` : "执行失败,请查看控制台";
|
|
2452
|
+
}
|
|
2453
|
+
function n(u, k, M) {
|
|
2454
|
+
if (!i) {
|
|
2455
|
+
oe.warning("页面脚本运行时未就绪");
|
|
2456
|
+
return;
|
|
2457
|
+
}
|
|
2458
|
+
const X = u.name.trim();
|
|
2459
|
+
if (!X || !Ce(X)) {
|
|
2460
|
+
oe.warning("请先填写有效函数名");
|
|
2461
|
+
return;
|
|
2462
|
+
}
|
|
2463
|
+
const se = (k ?? u.handler).trim();
|
|
2464
|
+
if (!se) {
|
|
2465
|
+
oe.warning("请先编写函数函数");
|
|
2466
|
+
return;
|
|
2467
|
+
}
|
|
2468
|
+
if (!Ie(se)) {
|
|
2469
|
+
oe.warning("函数须为带 {} 的完整函数写法");
|
|
2470
|
+
return;
|
|
2471
|
+
}
|
|
2472
|
+
const re = i.simulateMethod(X, {
|
|
2473
|
+
handlerSource: k !== void 0 ? k : void 0,
|
|
2474
|
+
methodKey: x.value ? void 0 : c.value ?? void 0,
|
|
2475
|
+
args: M
|
|
2476
|
+
});
|
|
2477
|
+
if (re.ok) {
|
|
2478
|
+
oe.success(`已模拟执行 ${V(u)}`);
|
|
2479
|
+
return;
|
|
2480
|
+
}
|
|
2481
|
+
oe.warning(Se(re));
|
|
2482
|
+
}
|
|
2483
|
+
function l(u, k) {
|
|
2484
|
+
const M = Pn(u, k);
|
|
2485
|
+
if (!M.length) {
|
|
2486
|
+
n(u, k);
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
$.value = {
|
|
2490
|
+
item: u,
|
|
2491
|
+
handlerSource: k,
|
|
2492
|
+
methodName: u.name.trim(),
|
|
2493
|
+
paramNames: M,
|
|
2494
|
+
values: Object.fromEntries(M.map((X) => [X, ""]))
|
|
2495
|
+
}, D.value = !0;
|
|
2496
|
+
}
|
|
2497
|
+
function g() {
|
|
2498
|
+
const u = $.value;
|
|
2499
|
+
if (!u) return Promise.reject();
|
|
2500
|
+
const k = u.paramNames.map((M) => wn(u.values[M] ?? ""));
|
|
2501
|
+
D.value = !1, $.value = null, n(u.item, u.handlerSource, k);
|
|
2502
|
+
}
|
|
2503
|
+
function P() {
|
|
2504
|
+
D.value = !1, $.value = null;
|
|
2505
|
+
}
|
|
2506
|
+
function E(u) {
|
|
2507
|
+
l(u);
|
|
2508
|
+
}
|
|
2509
|
+
function J() {
|
|
2510
|
+
if (!_e()) {
|
|
2511
|
+
oe.warning("请先完善配置");
|
|
2512
|
+
return;
|
|
2513
|
+
}
|
|
2514
|
+
const u = G();
|
|
2515
|
+
!u || !f.value || l(u, b(f.value));
|
|
2516
|
+
}
|
|
2517
|
+
function F(u) {
|
|
2518
|
+
!f.value || f.value.kind !== "function" || (f.value.handler = u);
|
|
2519
|
+
}
|
|
2520
|
+
return {
|
|
2521
|
+
editorVisible: r,
|
|
2522
|
+
editingDraft: f,
|
|
2523
|
+
editorTitle: h,
|
|
2524
|
+
editingNameInvalid: le,
|
|
2525
|
+
editingHandlerInvalid: ae,
|
|
2526
|
+
editingApiUrlInvalid: q,
|
|
2527
|
+
editingApiResultInvalid: ee,
|
|
2528
|
+
editingApiParamsInvalid: Z,
|
|
2529
|
+
selectedMethodKeys: Y,
|
|
2530
|
+
getDisplayName: V,
|
|
2531
|
+
isSelectable: U,
|
|
2532
|
+
canSimulateMethod: Oe,
|
|
2533
|
+
addFunction: y,
|
|
2534
|
+
addApi: _,
|
|
2535
|
+
editItem: C,
|
|
2536
|
+
handleRemove: ie,
|
|
2537
|
+
selectMethod: B,
|
|
2538
|
+
handleSaveEditor: pe,
|
|
2539
|
+
handleCancelEditor: Pe,
|
|
2540
|
+
simulateArgsVisible: D,
|
|
2541
|
+
simulateArgsDraft: $,
|
|
2542
|
+
confirmSimulateArgs: g,
|
|
2543
|
+
cancelSimulateArgs: P,
|
|
2544
|
+
simulateMethodFromList: E,
|
|
2545
|
+
simulateMethodFromEditor: J,
|
|
2546
|
+
insertUsageExample: F
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2549
|
+
function Pr() {
|
|
2550
|
+
const t = fe(), e = T(() => t == null ? void 0 : t.page);
|
|
2551
|
+
return T({
|
|
2552
|
+
get: () => {
|
|
2553
|
+
var a;
|
|
2554
|
+
return e.value && Aa(e.value), ((a = e.value) == null ? void 0 : a.methods) ?? [];
|
|
2555
|
+
},
|
|
2556
|
+
set: (a) => {
|
|
2557
|
+
e.value && (e.value.methods = Qe(a));
|
|
2558
|
+
}
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
const Or = { class: "mt-1 text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, Sr = {
|
|
2562
|
+
key: 0,
|
|
2563
|
+
class: "relative min-h-[280px]"
|
|
2564
|
+
}, Cr = { class: "mt-3 flex items-center justify-between gap-2" }, $r = {
|
|
2565
|
+
key: 1,
|
|
2566
|
+
class: "relative min-h-[280px]"
|
|
2567
|
+
}, Dr = {
|
|
2568
|
+
key: 0,
|
|
2569
|
+
class: "mt-1 text-[11px] leading-snug text-[var(--colorError)]"
|
|
2570
|
+
}, Tr = { class: "mb-2 flex items-center justify-between gap-2" }, Er = { class: "flex min-w-0 flex-1 items-center gap-1 text-[11px] text-[var(--colorTextQuaternary)]" }, Ir = { class: "overflow-x-auto rounded-sm bg-[color-mix(in_srgb,var(--colorText)_4%,var(--colorBgContainer))] px-2 py-1.5 font-mono text-[10px] leading-[1.45] text-[var(--colorTextSecondary)]" }, Ar = {
|
|
2571
|
+
key: 0,
|
|
2572
|
+
class: "mt-2 text-[11px] leading-[1.4] text-[var(--colorTextQuaternary)]"
|
|
2573
|
+
}, Lr = { class: "mt-2 flex items-center justify-between gap-2" }, Mr = /* @__PURE__ */ te({
|
|
2574
|
+
name: "PageMethodEditorModal",
|
|
2575
|
+
__name: "page-method-editor-modal",
|
|
2576
|
+
props: /* @__PURE__ */ ge({
|
|
2577
|
+
editingDraft: {},
|
|
2578
|
+
title: {},
|
|
2579
|
+
pageData: {},
|
|
2580
|
+
nameInvalid: { type: Boolean },
|
|
2581
|
+
handlerInvalid: { type: Boolean },
|
|
2582
|
+
apiUrlInvalid: { type: Boolean },
|
|
2583
|
+
apiResultInvalid: { type: Boolean },
|
|
2584
|
+
apiParamsInvalid: { type: Boolean }
|
|
2585
|
+
}, {
|
|
2586
|
+
open: { type: Boolean, default: !1 },
|
|
2587
|
+
openModifiers: {}
|
|
2588
|
+
}),
|
|
2589
|
+
emits: /* @__PURE__ */ ge(["save", "cancel", "simulate", "insertExample"], ["update:open"]),
|
|
2590
|
+
setup(t, { emit: e }) {
|
|
2591
|
+
const a = ke(t, "open"), i = t, r = e, c = T(() => {
|
|
2592
|
+
var $;
|
|
2593
|
+
return (($ = i.editingDraft) == null ? void 0 : $.kind) === "api";
|
|
2594
|
+
}), x = fe(), f = T(() => {
|
|
2595
|
+
var $;
|
|
2596
|
+
if (!(c.value || !i.editingDraft))
|
|
2597
|
+
return Dn({
|
|
2598
|
+
pageData: i.pageData,
|
|
2599
|
+
methods: ($ = x == null ? void 0 : x.page) == null ? void 0 : $.methods,
|
|
2600
|
+
handler: i.editingDraft.handler,
|
|
2601
|
+
excludeMethodName: i.editingDraft.name
|
|
2602
|
+
});
|
|
2603
|
+
}), D = T(() => c.value ? "保存时根据接口配置自动生成 async 函数,可通过 context.methods.函数名(...) 调用" : "须为合法标识符;在组件属性 {{ fn() }} 或事件中通过 context.methods 调用");
|
|
2604
|
+
return ($, h) => {
|
|
2605
|
+
const m = ve, O = ye, L = je, y = me, _ = Zt, C = Kt, b = ze;
|
|
2606
|
+
return p(), I(b, {
|
|
2607
|
+
open: a.value,
|
|
2608
|
+
"onUpdate:open": h[5] || (h[5] = (w) => a.value = w),
|
|
2609
|
+
title: t.title,
|
|
2610
|
+
"ok-text": "确定",
|
|
2611
|
+
"cancel-text": "取消",
|
|
2612
|
+
width: "640px",
|
|
2613
|
+
"destroy-on-close": "",
|
|
2614
|
+
onOk: h[6] || (h[6] = (w) => r("save")),
|
|
2615
|
+
onCancel: h[7] || (h[7] = (w) => r("cancel"))
|
|
2616
|
+
}, {
|
|
2617
|
+
default: d(() => [
|
|
2618
|
+
t.editingDraft ? (p(), S(K, { key: 0 }, [
|
|
2619
|
+
o(L, {
|
|
2620
|
+
layout: "vertical",
|
|
2621
|
+
class: "mb-1"
|
|
2622
|
+
}, {
|
|
2623
|
+
default: d(() => [
|
|
2624
|
+
o(O, {
|
|
2625
|
+
label: c.value ? "接口名" : "函数名",
|
|
2626
|
+
class: "mb-2",
|
|
2627
|
+
"validate-status": t.nameInvalid ? "error" : void 0
|
|
2628
|
+
}, {
|
|
2629
|
+
default: d(() => [
|
|
2630
|
+
o(m, {
|
|
2631
|
+
value: t.editingDraft.name,
|
|
2632
|
+
"onUpdate:value": h[0] || (h[0] = (w) => t.editingDraft.name = w),
|
|
2633
|
+
placeholder: c.value ? "如:loadProductList、fetchUserInfo" : "如:formatPrice、onBannerClick"
|
|
2634
|
+
}, null, 8, ["value", "placeholder"]),
|
|
2635
|
+
s("div", Or, H(D.value), 1)
|
|
2636
|
+
]),
|
|
2637
|
+
_: 1
|
|
2638
|
+
}, 8, ["label", "validate-status"])
|
|
2639
|
+
]),
|
|
2640
|
+
_: 1
|
|
2641
|
+
}),
|
|
2642
|
+
c.value ? (p(), S("div", Sr, [
|
|
2643
|
+
o(yr, {
|
|
2644
|
+
modelValue: t.editingDraft.api,
|
|
2645
|
+
"onUpdate:modelValue": h[1] || (h[1] = (w) => t.editingDraft.api = w),
|
|
2646
|
+
"page-data": t.pageData,
|
|
2647
|
+
"url-invalid": t.apiUrlInvalid,
|
|
2648
|
+
"result-invalid": t.apiResultInvalid,
|
|
2649
|
+
"params-invalid": t.apiParamsInvalid
|
|
2650
|
+
}, null, 8, ["modelValue", "page-data", "url-invalid", "result-invalid", "params-invalid"]),
|
|
2651
|
+
s("div", Cr, [
|
|
2652
|
+
h[9] || (h[9] = s("div", { class: "min-w-0 text-[11px] leading-[1.4] text-[var(--colorTextQuaternary)]" }, [
|
|
2653
|
+
z("保存时将根据上方配置自动生成 async 函数;可在生命周期或事件中 "),
|
|
2654
|
+
s("span", { class: "font-mono" }, "await context.methods.函数名(...)"),
|
|
2655
|
+
z(" 调用")
|
|
2656
|
+
], -1)),
|
|
2657
|
+
o(y, {
|
|
2658
|
+
type: "link",
|
|
2659
|
+
size: "small",
|
|
2660
|
+
class: "shrink-0 px-0",
|
|
2661
|
+
disabled: !t.editingDraft.name.trim() || t.nameInvalid || t.apiUrlInvalid || t.apiResultInvalid || t.apiParamsInvalid,
|
|
2662
|
+
onClick: h[2] || (h[2] = (w) => r("simulate"))
|
|
2663
|
+
}, {
|
|
2664
|
+
icon: d(() => [
|
|
2665
|
+
o(v(Je))
|
|
2666
|
+
]),
|
|
2667
|
+
default: d(() => [
|
|
2668
|
+
h[8] || (h[8] = z(" 模拟执行 ", -1))
|
|
2669
|
+
]),
|
|
2670
|
+
_: 1
|
|
2671
|
+
}, 8, ["disabled"])
|
|
2672
|
+
])
|
|
2673
|
+
])) : (p(), S("div", $r, [
|
|
2674
|
+
o(L, {
|
|
2675
|
+
layout: "vertical",
|
|
2676
|
+
class: "mb-1"
|
|
2677
|
+
}, {
|
|
2678
|
+
default: d(() => [
|
|
2679
|
+
o(O, {
|
|
2680
|
+
label: "函数体",
|
|
2681
|
+
class: "mb-0",
|
|
2682
|
+
"validate-status": t.handlerInvalid ? "error" : void 0
|
|
2683
|
+
}, {
|
|
2684
|
+
default: d(() => [
|
|
2685
|
+
o(v(tt), {
|
|
2686
|
+
modelValue: t.editingDraft.handler,
|
|
2687
|
+
"onUpdate:modelValue": h[3] || (h[3] = (w) => t.editingDraft.handler = w),
|
|
2688
|
+
language: "javascript",
|
|
2689
|
+
placeholder: v(_r),
|
|
2690
|
+
height: 240,
|
|
2691
|
+
"page-context-completion": f.value
|
|
2692
|
+
}, null, 8, ["modelValue", "placeholder", "page-context-completion"]),
|
|
2693
|
+
t.handlerInvalid ? (p(), S("div", Dr, [...h[10] || (h[10] = [
|
|
2694
|
+
z("须为带 ", -1),
|
|
2695
|
+
s("span", { class: "font-mono" }, "{}", -1),
|
|
2696
|
+
z(" 的完整函数,如 ", -1),
|
|
2697
|
+
s("span", { class: "font-mono" }, "() => { ... }", -1),
|
|
2698
|
+
z(" 或 ", -1),
|
|
2699
|
+
s("span", { class: "font-mono" }, "(url, w) => { return ... }", -1)
|
|
2700
|
+
])])) : W("", !0)
|
|
2701
|
+
]),
|
|
2702
|
+
_: 1
|
|
2703
|
+
}, 8, ["validate-status"])
|
|
2704
|
+
]),
|
|
2705
|
+
_: 1
|
|
2706
|
+
}),
|
|
2707
|
+
o(C, {
|
|
2708
|
+
bordered: !1,
|
|
2709
|
+
"expand-icon-position": "end",
|
|
2710
|
+
"default-active-key": [],
|
|
2711
|
+
class: "mt-2"
|
|
2712
|
+
}, {
|
|
2713
|
+
default: d(() => [
|
|
2714
|
+
(p(!0), S(K, null, ne(v(mt), (w) => (p(), I(_, {
|
|
2715
|
+
key: w.key,
|
|
2716
|
+
header: w.label
|
|
2717
|
+
}, {
|
|
2718
|
+
default: d(() => [
|
|
2719
|
+
s("div", Tr, [
|
|
2720
|
+
s("div", Er, [
|
|
2721
|
+
o(v(at), { class: "shrink-0 text-[10px] opacity-80" }),
|
|
2722
|
+
s("span", null, H(w.hint), 1)
|
|
2723
|
+
]),
|
|
2724
|
+
o(y, {
|
|
2725
|
+
type: "link",
|
|
2726
|
+
size: "small",
|
|
2727
|
+
class: "shrink-0 px-0",
|
|
2728
|
+
onClick: (j) => r("insertExample", w.example)
|
|
2729
|
+
}, {
|
|
2730
|
+
default: d(() => [...h[11] || (h[11] = [
|
|
2731
|
+
z("插入示例", -1)
|
|
2732
|
+
])]),
|
|
2733
|
+
_: 1
|
|
2734
|
+
}, 8, ["onClick"])
|
|
2735
|
+
]),
|
|
2736
|
+
s("pre", Ir, H(w.example), 1),
|
|
2737
|
+
w.paramHint ? (p(), S("div", Ar, H(w.paramHint), 1)) : W("", !0)
|
|
2738
|
+
]),
|
|
2739
|
+
_: 2
|
|
2740
|
+
}, 1032, ["header"]))), 128))
|
|
2741
|
+
]),
|
|
2742
|
+
_: 1
|
|
2743
|
+
}),
|
|
2744
|
+
s("div", Lr, [
|
|
2745
|
+
h[13] || (h[13] = s("div", { class: "min-w-0 text-[11px] leading-[1.4] text-[var(--colorTextQuaternary)]" }, [
|
|
2746
|
+
z("须写完整函数(带 "),
|
|
2747
|
+
s("span", { class: "font-mono" }, "{}"),
|
|
2748
|
+
z(" 函数体);运行时注入 "),
|
|
2749
|
+
s("span", { class: "font-mono" }, "context"),
|
|
2750
|
+
z("(含 data / methods),调用方参数通过形参传入")
|
|
2751
|
+
], -1)),
|
|
2752
|
+
o(y, {
|
|
2753
|
+
type: "link",
|
|
2754
|
+
size: "small",
|
|
2755
|
+
class: "shrink-0 px-0",
|
|
2756
|
+
disabled: !t.editingDraft.handler.trim() || !t.editingDraft.name.trim() || t.nameInvalid || t.handlerInvalid,
|
|
2757
|
+
onClick: h[4] || (h[4] = (w) => r("simulate"))
|
|
2758
|
+
}, {
|
|
2759
|
+
icon: d(() => [
|
|
2760
|
+
o(v(Je))
|
|
2761
|
+
]),
|
|
2762
|
+
default: d(() => [
|
|
2763
|
+
h[12] || (h[12] = z(" 模拟执行 ", -1))
|
|
2764
|
+
]),
|
|
2765
|
+
_: 1
|
|
2766
|
+
}, 8, ["disabled"])
|
|
2767
|
+
])
|
|
2768
|
+
]))
|
|
2769
|
+
], 64)) : W("", !0)
|
|
2770
|
+
]),
|
|
2771
|
+
_: 1
|
|
2772
|
+
}, 8, ["open", "title"]);
|
|
2773
|
+
};
|
|
2774
|
+
}
|
|
2775
|
+
}), zr = /* @__PURE__ */ te({
|
|
2776
|
+
name: "PageMethodSimulateArgsModal",
|
|
2777
|
+
__name: "page-method-simulate-args-modal",
|
|
2778
|
+
props: /* @__PURE__ */ ge({
|
|
2779
|
+
draft: {}
|
|
2780
|
+
}, {
|
|
2781
|
+
open: { type: Boolean, default: !1 },
|
|
2782
|
+
openModifiers: {}
|
|
2783
|
+
}),
|
|
2784
|
+
emits: /* @__PURE__ */ ge(["confirm", "cancel"], ["update:open"]),
|
|
2785
|
+
setup(t, { emit: e }) {
|
|
2786
|
+
const a = ke(t, "open"), i = e;
|
|
2787
|
+
return (r, c) => {
|
|
2788
|
+
const x = ve, f = ye, D = je, $ = ze;
|
|
2789
|
+
return p(), I($, {
|
|
2790
|
+
open: a.value,
|
|
2791
|
+
"onUpdate:open": c[0] || (c[0] = (h) => a.value = h),
|
|
2792
|
+
title: t.draft ? `模拟执行:${t.draft.methodName}()` : "模拟执行",
|
|
2793
|
+
"ok-text": "执行",
|
|
2794
|
+
"cancel-text": "取消",
|
|
2795
|
+
width: "480px",
|
|
2796
|
+
"destroy-on-close": "",
|
|
2797
|
+
onOk: c[1] || (c[1] = (h) => i("confirm")),
|
|
2798
|
+
onCancel: c[2] || (c[2] = (h) => i("cancel"))
|
|
2799
|
+
}, {
|
|
2800
|
+
default: d(() => [
|
|
2801
|
+
t.draft ? (p(), S(K, { key: 0 }, [
|
|
2802
|
+
c[3] || (c[3] = s("div", { class: "mb-3 text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, [
|
|
2803
|
+
z("为形参填写测试值;支持 JSON 字面量(如 "),
|
|
2804
|
+
s("span", { class: "font-mono" }, "1"),
|
|
2805
|
+
z("、"),
|
|
2806
|
+
s("span", { class: "font-mono" }, '"text"'),
|
|
2807
|
+
z("、"),
|
|
2808
|
+
s("span", { class: "font-mono" }, "true"),
|
|
2809
|
+
z("),留空为 "),
|
|
2810
|
+
s("span", { class: "font-mono" }, "undefined"),
|
|
2811
|
+
z("。")
|
|
2812
|
+
], -1)),
|
|
2813
|
+
o(D, {
|
|
2814
|
+
layout: "vertical",
|
|
2815
|
+
class: "mb-0"
|
|
2816
|
+
}, {
|
|
2817
|
+
default: d(() => [
|
|
2818
|
+
(p(!0), S(K, null, ne(t.draft.paramNames, (h) => (p(), I(f, {
|
|
2819
|
+
key: h,
|
|
2820
|
+
label: h,
|
|
2821
|
+
class: "mb-2"
|
|
2822
|
+
}, {
|
|
2823
|
+
default: d(() => [
|
|
2824
|
+
o(x, {
|
|
2825
|
+
value: t.draft.values[h],
|
|
2826
|
+
"onUpdate:value": (m) => t.draft.values[h] = m,
|
|
2827
|
+
placeholder: `参数 ${h}`,
|
|
2828
|
+
"allow-clear": ""
|
|
2829
|
+
}, null, 8, ["value", "onUpdate:value", "placeholder"])
|
|
2830
|
+
]),
|
|
2831
|
+
_: 2
|
|
2832
|
+
}, 1032, ["label"]))), 128))
|
|
2833
|
+
]),
|
|
2834
|
+
_: 1
|
|
2835
|
+
})
|
|
2836
|
+
], 64)) : W("", !0)
|
|
2837
|
+
]),
|
|
2838
|
+
_: 1
|
|
2839
|
+
}, 8, ["open", "title"]);
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2842
|
+
}), jr = { class: "min-h-0 flex-1 overflow-y-auto scrollbar p-3" }, Rr = { class: "min-w-0 flex-1" }, Vr = { class: "flex min-w-0 flex-1 items-center gap-1.5 text-sm leading-tight" }, Nr = { class: "inline-flex shrink-0 items-center justify-center rounded-sm p-0.5 text-[10px] leading-none text-[var(--colorPrimary)] bg-[color-mix(in_srgb,var(--colorPrimary)_12%,transparent)]" }, Hr = ["title"], Ur = { class: "mt-2 grid grid-cols-2 gap-2" }, Br = { class: "mt-3 border-t border-[color-mix(in_srgb,var(--colorText)_8%,transparent)] pt-3" }, Fr = { class: "mb-2.5 flex items-center gap-1.5" }, Wr = { class: "flex flex-col gap-2.5" }, Gr = { class: "text-xs font-medium leading-tight" }, qr = { class: "mt-0.5 text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, Qr = { class: "mt-1.5 overflow-x-auto rounded-sm bg-[color-mix(in_srgb,var(--colorText)_4%,var(--colorBgContainer))] px-2 py-1.5 font-mono text-[10px] leading-[1.45] text-[var(--colorTextSecondary)] scrollbar" }, Yr = {
|
|
2843
|
+
key: 0,
|
|
2844
|
+
class: "mt-1 text-[10px] leading-snug text-[var(--colorTextQuaternary)]"
|
|
2845
|
+
}, Jr = /* @__PURE__ */ te({
|
|
2846
|
+
name: "PageMethods",
|
|
2847
|
+
__name: "page-methods",
|
|
2848
|
+
setup(t) {
|
|
2849
|
+
const e = Pr(), a = fe(), i = T(() => {
|
|
2850
|
+
var ae;
|
|
2851
|
+
return ((ae = a == null ? void 0 : a.page) == null ? void 0 : ae.data) ?? [];
|
|
2852
|
+
}), { editorVisible: r, editingDraft: c, editorTitle: x, editingNameInvalid: f, editingHandlerInvalid: D, editingApiUrlInvalid: $, editingApiResultInvalid: h, editingApiParamsInvalid: m, getDisplayName: O, canSimulateMethod: L, addFunction: y, addApi: _, editItem: C, handleRemove: b, handleSaveEditor: w, handleCancelEditor: j, simulateArgsVisible: A, simulateArgsDraft: R, confirmSimulateArgs: V, cancelSimulateArgs: U, simulateMethodFromList: G, simulateMethodFromEditor: Y, insertUsageExample: le } = wr(e);
|
|
2853
|
+
return (ae, q) => {
|
|
2854
|
+
const ee = me, Z = he, ie = Yt;
|
|
2855
|
+
return p(), S(K, null, [
|
|
2856
|
+
s("div", jr, [
|
|
2857
|
+
(p(!0), S(K, null, ne(v(e), (B) => (p(), S("div", {
|
|
2858
|
+
key: B.key,
|
|
2859
|
+
class: "flex items-center"
|
|
2860
|
+
}, [
|
|
2861
|
+
s("div", Rr, [
|
|
2862
|
+
s("div", Vr, [
|
|
2863
|
+
s("span", Nr, [
|
|
2864
|
+
v(lt)(B) ? (p(), I(v(Ot), { key: 0 })) : (p(), I(v(Te), { key: 1 }))
|
|
2865
|
+
]),
|
|
2866
|
+
s("span", {
|
|
2867
|
+
class: "truncate font-mono text-xs",
|
|
2868
|
+
title: v(O)(B)
|
|
2869
|
+
}, H(v(O)(B)), 9, Hr)
|
|
2870
|
+
])
|
|
2871
|
+
]),
|
|
2872
|
+
o(Z, { title: "执行" }, {
|
|
2873
|
+
default: d(() => [
|
|
2874
|
+
o(ee, {
|
|
2875
|
+
type: "text",
|
|
2876
|
+
size: "small",
|
|
2877
|
+
disabled: !v(L)(B),
|
|
2878
|
+
onClick: ue((pe) => v(G)(B), ["stop"])
|
|
2879
|
+
}, {
|
|
2880
|
+
default: d(() => [
|
|
2881
|
+
o(v(Je))
|
|
2882
|
+
]),
|
|
2883
|
+
_: 1
|
|
2884
|
+
}, 8, ["disabled", "onClick"])
|
|
2885
|
+
]),
|
|
2886
|
+
_: 2
|
|
2887
|
+
}, 1024),
|
|
2888
|
+
o(Z, { title: "编辑" }, {
|
|
2889
|
+
default: d(() => [
|
|
2890
|
+
o(ee, {
|
|
2891
|
+
type: "text",
|
|
2892
|
+
size: "small",
|
|
2893
|
+
onClick: ue((pe) => v(C)(B), ["stop"])
|
|
2894
|
+
}, {
|
|
2895
|
+
default: d(() => [
|
|
2896
|
+
o(v(ea))
|
|
2897
|
+
]),
|
|
2898
|
+
_: 1
|
|
2899
|
+
}, 8, ["onClick"])
|
|
2900
|
+
]),
|
|
2901
|
+
_: 2
|
|
2902
|
+
}, 1024),
|
|
2903
|
+
o(Z, { title: "删除" }, {
|
|
2904
|
+
default: d(() => [
|
|
2905
|
+
o(ee, {
|
|
2906
|
+
type: "text",
|
|
2907
|
+
size: "small",
|
|
2908
|
+
danger: "",
|
|
2909
|
+
onClick: ue((pe) => v(b)(B.key), ["stop"])
|
|
2910
|
+
}, {
|
|
2911
|
+
default: d(() => [
|
|
2912
|
+
o(v(we))
|
|
2913
|
+
]),
|
|
2914
|
+
_: 1
|
|
2915
|
+
}, 8, ["onClick"])
|
|
2916
|
+
]),
|
|
2917
|
+
_: 2
|
|
2918
|
+
}, 1024)
|
|
2919
|
+
]))), 128)),
|
|
2920
|
+
v(e).length === 0 ? (p(), I(ie, {
|
|
2921
|
+
key: 0,
|
|
2922
|
+
description: "暂无函数"
|
|
2923
|
+
})) : W("", !0),
|
|
2924
|
+
s("div", Ur, [
|
|
2925
|
+
o(ee, {
|
|
2926
|
+
type: "dashed",
|
|
2927
|
+
size: "small",
|
|
2928
|
+
block: "",
|
|
2929
|
+
onClick: q[0] || (q[0] = (B) => v(y)())
|
|
2930
|
+
}, {
|
|
2931
|
+
icon: d(() => [
|
|
2932
|
+
o(v(Te))
|
|
2933
|
+
]),
|
|
2934
|
+
default: d(() => [
|
|
2935
|
+
q[4] || (q[4] = z(" 添加函数", -1))
|
|
2936
|
+
]),
|
|
2937
|
+
_: 1
|
|
2938
|
+
}),
|
|
2939
|
+
o(ee, {
|
|
2940
|
+
type: "dashed",
|
|
2941
|
+
size: "small",
|
|
2942
|
+
block: "",
|
|
2943
|
+
onClick: q[1] || (q[1] = (B) => v(_)())
|
|
2944
|
+
}, {
|
|
2945
|
+
icon: d(() => [
|
|
2946
|
+
o(v(Ot))
|
|
2947
|
+
]),
|
|
2948
|
+
default: d(() => [
|
|
2949
|
+
q[5] || (q[5] = z(" 添加接口 ", -1))
|
|
2950
|
+
]),
|
|
2951
|
+
_: 1
|
|
2952
|
+
})
|
|
2953
|
+
]),
|
|
2954
|
+
s("section", Br, [
|
|
2955
|
+
s("div", Fr, [
|
|
2956
|
+
o(v(at), { class: "text-xs text-[var(--colorTextQuaternary)]" }),
|
|
2957
|
+
q[6] || (q[6] = s("span", { class: "text-xs font-medium text-[var(--colorTextSecondary)]" }, "帮助", -1))
|
|
2958
|
+
]),
|
|
2959
|
+
s("div", Wr, [
|
|
2960
|
+
(p(!0), S(K, null, ne(v(mt), (B) => (p(), S("div", {
|
|
2961
|
+
key: B.key,
|
|
2962
|
+
class: "rounded-sm border border-[color-mix(in_srgb,var(--colorText)_8%,transparent)] p-1"
|
|
2963
|
+
}, [
|
|
2964
|
+
s("div", Gr, H(B.label), 1),
|
|
2965
|
+
s("div", qr, H(B.hint), 1),
|
|
2966
|
+
s("pre", Qr, H(B.example), 1),
|
|
2967
|
+
B.paramHint ? (p(), S("div", Yr, H(B.paramHint), 1)) : W("", !0)
|
|
2968
|
+
]))), 128)),
|
|
2969
|
+
q[7] || (q[7] = s("div", { class: "text-[11px] leading-snug text-[var(--colorTextQuaternary)]" }, [
|
|
2970
|
+
z("自定义函数须为带 "),
|
|
2971
|
+
s("span", { class: "font-mono" }, "{}"),
|
|
2972
|
+
z(" 的完整写法;接口函数通过表单配置后自动生成 async 函数。均可通过 "),
|
|
2973
|
+
s("span", { class: "font-mono" }, "context.methods.xxx(...)"),
|
|
2974
|
+
z(" 调用。")
|
|
2975
|
+
], -1))
|
|
2976
|
+
])
|
|
2977
|
+
])
|
|
2978
|
+
]),
|
|
2979
|
+
o(Mr, {
|
|
2980
|
+
open: v(r),
|
|
2981
|
+
"onUpdate:open": q[2] || (q[2] = (B) => gt(r) ? r.value = B : null),
|
|
2982
|
+
"editing-draft": v(c),
|
|
2983
|
+
title: v(x),
|
|
2984
|
+
"page-data": i.value,
|
|
2985
|
+
"name-invalid": v(f),
|
|
2986
|
+
"handler-invalid": v(D),
|
|
2987
|
+
"api-url-invalid": v($),
|
|
2988
|
+
"api-result-invalid": v(h),
|
|
2989
|
+
"api-params-invalid": v(m),
|
|
2990
|
+
onSave: v(w),
|
|
2991
|
+
onCancel: v(j),
|
|
2992
|
+
onSimulate: v(Y),
|
|
2993
|
+
onInsertExample: v(le)
|
|
2994
|
+
}, null, 8, ["open", "editing-draft", "title", "page-data", "name-invalid", "handler-invalid", "api-url-invalid", "api-result-invalid", "api-params-invalid", "onSave", "onCancel", "onSimulate", "onInsertExample"]),
|
|
2995
|
+
o(zr, {
|
|
2996
|
+
open: v(A),
|
|
2997
|
+
"onUpdate:open": q[3] || (q[3] = (B) => gt(A) ? A.value = B : null),
|
|
2998
|
+
draft: v(R),
|
|
2999
|
+
onConfirm: v(V),
|
|
3000
|
+
onCancel: v(U)
|
|
3001
|
+
}, null, 8, ["open", "draft", "onConfirm", "onCancel"])
|
|
3002
|
+
], 64);
|
|
3003
|
+
};
|
|
3004
|
+
}
|
|
3005
|
+
}), Kr = {
|
|
3006
|
+
class: "flex h-full w-12 min-w-12 shrink-0 flex-col gap-1 border-r border-r-solid border-r-[var(--colorSplit)] bg-[var(--colorBgContainer)] px-1.5 py-3",
|
|
3007
|
+
"aria-label": "编辑器侧栏"
|
|
3008
|
+
}, Zr = ["title", "aria-label", "aria-current", "onClick"], Xr = { class: "shrink-0 border-b border-[var(--colorSplit)] px-3 py-2.5" }, eo = { class: "flex items-center justify-between gap-2" }, to = { class: "text-sm font-medium text-[var(--colorText)]" }, ao = { class: "flex items-center gap-0.5" }, no = { class: "min-h-0 min-w-0 flex-1 overflow-hidden border-r border-[var(--colorSplit)] bg-[var(--colorBgLayout)] [background-image:linear-gradient(90deg,color-mix(in_srgb,var(--colorText)_4%,transparent)_1px,transparent_1px),linear-gradient(color-mix(in_srgb,var(--colorText)_4%,transparent)_1px,transparent_1px)] [background-size:20px_20px]" }, lo = "relative flex-center h-9 w-full cursor-pointer border-none rounded-lg transition-colors duration-200", uo = /* @__PURE__ */ te({
|
|
3009
|
+
name: "LowcodeDesigner",
|
|
3010
|
+
__name: "designer",
|
|
3011
|
+
props: /* @__PURE__ */ ge({
|
|
3012
|
+
definitions: {},
|
|
3013
|
+
theme: {},
|
|
3014
|
+
locale: {},
|
|
3015
|
+
height: { default: Za },
|
|
3016
|
+
width: { default: Ka },
|
|
3017
|
+
uploadHandler: {}
|
|
3018
|
+
}, {
|
|
3019
|
+
page: {
|
|
3020
|
+
default: () => rn()
|
|
3021
|
+
},
|
|
3022
|
+
pageModifiers: {}
|
|
3023
|
+
}),
|
|
3024
|
+
emits: ["update:page"],
|
|
3025
|
+
setup(t) {
|
|
3026
|
+
var j;
|
|
3027
|
+
const e = [
|
|
3028
|
+
{ key: "pageOutline", title: "大纲", icon: st },
|
|
3029
|
+
{ key: "widgetLibrary", title: "组件库", icon: Jt },
|
|
3030
|
+
{ key: "dataSource", title: "数据源", icon: Xt },
|
|
3031
|
+
{ key: "methods", title: "函数", icon: Te }
|
|
3032
|
+
], a = ke(t, "page"), i = t;
|
|
3033
|
+
if (!((j = i.definitions) != null && j.length))
|
|
3034
|
+
throw new Error("[@fp-mall/lowcode/designer] 请通过 :definitions 传入物料定义(如 materialDefinitions)");
|
|
3035
|
+
ja(i.uploadHandler);
|
|
3036
|
+
const r = Ra(i.definitions), c = sa();
|
|
3037
|
+
c && Va(c.appContext.app, r), be(Na, r), be(Ha, !0);
|
|
3038
|
+
const x = ua(
|
|
3039
|
+
Ua({
|
|
3040
|
+
page: a.value,
|
|
3041
|
+
widgetNormalizers: r.widgetNormalizers,
|
|
3042
|
+
copyNormalizeTypes: r.copyNormalizeTypes,
|
|
3043
|
+
widgetAcceptsChild: r.widgetAcceptsChild
|
|
3044
|
+
})
|
|
3045
|
+
);
|
|
3046
|
+
be(Ba, x), be(
|
|
3047
|
+
Fa,
|
|
3048
|
+
T(() => ({
|
|
3049
|
+
widgetId: x.stylePreview.pinned ? x.stylePreview.widgetId : null,
|
|
3050
|
+
state: x.stylePreview.pinned ? x.stylePreview.state : null
|
|
3051
|
+
}))
|
|
3052
|
+
), be(Wa, (A) => x.setSelected(A)), Ga({
|
|
3053
|
+
designer: () => x,
|
|
3054
|
+
getKeyedSlotConfig: (A) => r.getKeyedSlotConfig(A)
|
|
3055
|
+
});
|
|
3056
|
+
const f = qa({
|
|
3057
|
+
page: () => x.page,
|
|
3058
|
+
designMode: () => !0
|
|
3059
|
+
});
|
|
3060
|
+
be(et, f);
|
|
3061
|
+
let D = null;
|
|
3062
|
+
xe(
|
|
3063
|
+
() => x.page,
|
|
3064
|
+
(A) => {
|
|
3065
|
+
D = "designer", a.value = nn(A), x.commitHistoryIfChanged(), Gt(() => {
|
|
3066
|
+
D = null;
|
|
3067
|
+
});
|
|
3068
|
+
},
|
|
3069
|
+
{ deep: !0, flush: "sync" }
|
|
3070
|
+
), xe(
|
|
3071
|
+
a,
|
|
3072
|
+
(A) => {
|
|
3073
|
+
D === "designer" || !A || ln(A, x.page) || x.loadPage(A);
|
|
3074
|
+
},
|
|
3075
|
+
{ deep: !0, flush: "sync" }
|
|
3076
|
+
);
|
|
3077
|
+
const { token: $ } = Qa.useToken(), h = N(null);
|
|
3078
|
+
ca(() => {
|
|
3079
|
+
h.value && Ya($.value, h.value);
|
|
3080
|
+
});
|
|
3081
|
+
function m(A) {
|
|
3082
|
+
return h.value ?? (A == null ? void 0 : A.parentElement) ?? document.body;
|
|
3083
|
+
}
|
|
3084
|
+
const O = N("widgetLibrary"), L = N(!0), y = N(null);
|
|
3085
|
+
Ja(y, () => {
|
|
3086
|
+
L.value || !O.value || (O.value = null);
|
|
3087
|
+
});
|
|
3088
|
+
const _ = T(() => {
|
|
3089
|
+
var A;
|
|
3090
|
+
return ((A = e.find((R) => R.key === O.value)) == null ? void 0 : A.title) ?? "";
|
|
3091
|
+
}), C = T(() => !L.value && !!O.value), b = T(() => ({
|
|
3092
|
+
height: i.height,
|
|
3093
|
+
width: i.width
|
|
3094
|
+
}));
|
|
3095
|
+
function w(A) {
|
|
3096
|
+
O.value = O.value === A ? null : A;
|
|
3097
|
+
}
|
|
3098
|
+
return (A, R) => {
|
|
3099
|
+
const V = me;
|
|
3100
|
+
return p(), I(v(Tn), {
|
|
3101
|
+
theme: i.theme,
|
|
3102
|
+
locale: i.locale,
|
|
3103
|
+
"get-popup-container": m
|
|
3104
|
+
}, {
|
|
3105
|
+
default: d(() => [
|
|
3106
|
+
s("div", {
|
|
3107
|
+
ref_key: "themeScopeRootEl",
|
|
3108
|
+
ref: h,
|
|
3109
|
+
class: "lowcode-theme-scope h-full w-full min-h-0 min-w-0"
|
|
3110
|
+
}, [
|
|
3111
|
+
s("div", {
|
|
3112
|
+
class: "flex h-full w-full flex-row overflow-hidden",
|
|
3113
|
+
style: Ht(b.value)
|
|
3114
|
+
}, [
|
|
3115
|
+
s("div", {
|
|
3116
|
+
ref_key: "sidebarPanelRef",
|
|
3117
|
+
ref: y,
|
|
3118
|
+
class: ce(["flex h-full shrink-0", C.value && "relative z-30"])
|
|
3119
|
+
}, [
|
|
3120
|
+
s("nav", Kr, [
|
|
3121
|
+
(p(), S(K, null, ne(e, (U) => s("button", {
|
|
3122
|
+
key: U.key,
|
|
3123
|
+
type: "button",
|
|
3124
|
+
class: ce([lo, O.value === U.key ? "bg-[var(--colorPrimary)] text-[var(--colorTextLightSolid)] hover:bg-[var(--colorPrimary)] hover:text-[var(--colorTextLightSolid)]" : "bg-transparent text-[var(--colorTextSecondary)] hover:bg-[var(--colorFillSecondary)] hover:text-[var(--colorText)]"]),
|
|
3125
|
+
title: U.title,
|
|
3126
|
+
"aria-label": U.title,
|
|
3127
|
+
"aria-current": O.value === U.key ? "page" : void 0,
|
|
3128
|
+
onClick: (G) => w(U.key)
|
|
3129
|
+
}, [
|
|
3130
|
+
(p(), I(Ut(U.icon), { class: "text-base" }))
|
|
3131
|
+
], 10, Zr)), 64))
|
|
3132
|
+
]),
|
|
3133
|
+
O.value ? (p(), S("aside", {
|
|
3134
|
+
key: 0,
|
|
3135
|
+
class: ce(["flex h-full w-[280px] min-w-[280px] flex-col border-r border-[var(--colorSplit)] bg-[var(--colorBgContainer)]", L.value ? "shrink-0" : "absolute top-0 left-12 z-30 shadow-[0_4px_12px_color-mix(in_srgb,var(--colorText)_8%,transparent)]"])
|
|
3136
|
+
}, [
|
|
3137
|
+
s("header", Xr, [
|
|
3138
|
+
s("div", eo, [
|
|
3139
|
+
s("span", to, H(_.value), 1),
|
|
3140
|
+
s("div", ao, [
|
|
3141
|
+
o(V, {
|
|
3142
|
+
type: "text",
|
|
3143
|
+
size: "small",
|
|
3144
|
+
class: "!h-7 !w-7 !p-0",
|
|
3145
|
+
title: L.value ? "取消固定" : "固定面板",
|
|
3146
|
+
onClick: R[0] || (R[0] = (U) => L.value = !L.value)
|
|
3147
|
+
}, {
|
|
3148
|
+
default: d(() => [
|
|
3149
|
+
L.value ? (p(), I(v(ut), {
|
|
3150
|
+
key: 0,
|
|
3151
|
+
class: "text-xs text-[var(--colorPrimary)]"
|
|
3152
|
+
})) : (p(), I(v(ct), {
|
|
3153
|
+
key: 1,
|
|
3154
|
+
class: "text-xs text-[var(--colorTextSecondary)]"
|
|
3155
|
+
}))
|
|
3156
|
+
]),
|
|
3157
|
+
_: 1
|
|
3158
|
+
}, 8, ["title"]),
|
|
3159
|
+
o(V, {
|
|
3160
|
+
type: "text",
|
|
3161
|
+
size: "small",
|
|
3162
|
+
class: "!h-7 !w-7 !p-0",
|
|
3163
|
+
title: "关闭",
|
|
3164
|
+
"aria-label": "关闭",
|
|
3165
|
+
onClick: R[1] || (R[1] = (U) => O.value = null)
|
|
3166
|
+
}, {
|
|
3167
|
+
default: d(() => [
|
|
3168
|
+
o(v(En), { class: "text-xs text-[var(--colorTextSecondary)]" })
|
|
3169
|
+
]),
|
|
3170
|
+
_: 1
|
|
3171
|
+
})
|
|
3172
|
+
])
|
|
3173
|
+
])
|
|
3174
|
+
]),
|
|
3175
|
+
O.value === "widgetLibrary" ? (p(), I($l, { key: 0 })) : O.value === "pageOutline" ? (p(), I(zl, { key: 1 })) : O.value === "dataSource" ? (p(), I(ar, { key: 2 })) : O.value === "methods" ? (p(), I(Jr, { key: 3 })) : W("", !0)
|
|
3176
|
+
], 2)) : W("", !0)
|
|
3177
|
+
], 2),
|
|
3178
|
+
s("main", no, [
|
|
3179
|
+
o(ol)
|
|
3180
|
+
]),
|
|
3181
|
+
o(hl, { class: "h-full w-[320px] min-w-[320px] shrink-0" }, {
|
|
3182
|
+
"page-setter-options": d((U) => [
|
|
3183
|
+
Bt(A.$slots, "page-setter-options", Ft(Wt(U)))
|
|
3184
|
+
]),
|
|
3185
|
+
_: 3
|
|
3186
|
+
})
|
|
3187
|
+
], 4)
|
|
3188
|
+
], 512)
|
|
3189
|
+
]),
|
|
3190
|
+
_: 3
|
|
3191
|
+
}, 8, ["theme", "locale"]);
|
|
3192
|
+
};
|
|
3193
|
+
}
|
|
3194
|
+
});
|
|
3195
|
+
export {
|
|
3196
|
+
Za as DEFAULT_LOWCODE_DESIGNER_HEIGHT,
|
|
3197
|
+
fo as DEFAULT_LOWCODE_DESIGNER_LOCALE,
|
|
3198
|
+
mo as DEFAULT_LOWCODE_DESIGNER_THEME,
|
|
3199
|
+
Ka as DEFAULT_LOWCODE_DESIGNER_WIDTH,
|
|
3200
|
+
Ba as DESIGNER_KEY,
|
|
3201
|
+
vo as LOWCODE_UPLOAD_KEY,
|
|
3202
|
+
uo as LowcodeDesigner,
|
|
3203
|
+
Ya as applyLowcodeThemeCssVariables,
|
|
3204
|
+
rn as createDefaultPage,
|
|
3205
|
+
ho as createDefaultPageScript,
|
|
3206
|
+
Ua as createDesigner,
|
|
3207
|
+
yo as getDesignerComponentName,
|
|
3208
|
+
_o as getSetterComponentName,
|
|
3209
|
+
ja as provideLowcodeUpload,
|
|
3210
|
+
bo as resolvePageTitle,
|
|
3211
|
+
fe as useInjectDesigner,
|
|
3212
|
+
Ze as useInjectMaterialRegistry,
|
|
3213
|
+
go as useLowcodeToken
|
|
3214
|
+
};
|
|
3215
|
+
//# sourceMappingURL=designer.js.map
|