starfish-form-custom 1.0.0
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 +2 -0
- package/auto-imports.d.ts +9 -0
- package/components.d.ts +68 -0
- package/dist/formAction-28d86b6a.mjs +446 -0
- package/dist/index-04830c0b.mjs +126 -0
- package/dist/index-eab8ef70.mjs +519 -0
- package/dist/index-f7ea052c.mjs +241 -0
- package/dist/main-96327b2e.mjs +5051 -0
- package/dist/starfish-form-a18a5409.mjs +328 -0
- package/dist/starfish-form.mjs +36 -0
- package/dist/style.css +377 -0
- package/dist/types/form/src/common/Loading.vue.d.ts +3 -0
- package/dist/types/form/src/env.d.ts +15 -0
- package/dist/types/form/src/main.d.ts +43 -0
- package/dist/types/form/src/starfish-form.vue.d.ts +40 -0
- package/dist/types/form/src/utils/customHooks.d.ts +2 -0
- package/dist/types/form/src/utils/fieldConfig.d.ts +78 -0
- package/dist/types/form/src/utils/fieldProps.d.ts +43 -0
- package/dist/types/starfish-form.d.ts +3 -0
- package/package.json +42 -0
- package/src/common/KeyValueConfig.vue +145 -0
- package/src/common/KeyValueConfigMult.vue +139 -0
- package/src/common/Loading.vue +14 -0
- package/src/common/action.vue +76 -0
- package/src/common/formAction.vue +298 -0
- package/src/common/listConfig.vue +45 -0
- package/src/common/panel.vue +61 -0
- package/src/common/radiogroup.vue +31 -0
- package/src/components/CheckBox/index.vue +42 -0
- package/src/components/ColorSelect/index.vue +49 -0
- package/src/components/Date/index.vue +39 -0
- package/src/components/DateTime/index.vue +39 -0
- package/src/components/InputNumber/index.vue +48 -0
- package/src/components/JsonEditor/index.vue +167 -0
- package/src/components/Radio/index.vue +42 -0
- package/src/components/RichText/index.vue +60 -0
- package/src/components/Rule/index.vue +365 -0
- package/src/components/Rule/ruleform.json +315 -0
- package/src/components/Rule/rules.js +91 -0
- package/src/components/Selected/index.vue +50 -0
- package/src/components/Selecteds/index.vue +50 -0
- package/src/components/ShowRule/index.vue +50 -0
- package/src/components/Slider/index.vue +38 -0
- package/src/components/Switch/index.vue +61 -0
- package/src/components/Text/index.vue +48 -0
- package/src/components/TextArea/index.vue +49 -0
- package/src/components/Time/index.vue +36 -0
- package/src/env.d.ts +15 -0
- package/src/layout/Divider.vue +30 -0
- package/src/layout/Info.vue +69 -0
- package/src/layout/Tabs.vue +75 -0
- package/src/layout/collapse.vue +78 -0
- package/src/layout/grid.vue +88 -0
- package/src/layout/table.vue +80 -0
- package/src/main.ts +62 -0
- package/src/starfish-form.vue +265 -0
- package/src/styles/action.scss +25 -0
- package/src/styles/collapse.scss +15 -0
- package/src/styles/custom-cpm.scss +5 -0
- package/src/styles/divider.scss +16 -0
- package/src/styles/form-action.scss +92 -0
- package/src/styles/formedit.scss +69 -0
- package/src/styles/grid.scss +12 -0
- package/src/styles/index.scss +12 -0
- package/src/styles/keyvalueConfig.scss +56 -0
- package/src/styles/rule.scss +17 -0
- package/src/styles/showrule.scss +5 -0
- package/src/styles/table.scss +19 -0
- package/src/styles/tabs.scss +5 -0
- package/src/utils/customHooks.ts +22 -0
- package/src/utils/fieldConfig.ts +961 -0
- package/src/utils/fieldProps.ts +50 -0
- package/stats.html +4949 -0
package/README.md
ADDED
package/components.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// Generated by unplugin-vue-components
|
|
5
|
+
// Read more: https://github.com/vuejs/core/pull/3399
|
|
6
|
+
export {}
|
|
7
|
+
|
|
8
|
+
declare module 'vue' {
|
|
9
|
+
export interface GlobalComponents {
|
|
10
|
+
CheckBox: typeof import('./src/components/CheckBox/index.vue')['default']
|
|
11
|
+
ColorSelect: typeof import('./src/components/ColorSelect/index.vue')['default']
|
|
12
|
+
Date: typeof import('./src/components/Date/index.vue')['default']
|
|
13
|
+
DateTime: typeof import('./src/components/DateTime/index.vue')['default']
|
|
14
|
+
ElAlert: typeof import('element-plus/es')['ElAlert']
|
|
15
|
+
ElAside: typeof import('element-plus/es')['ElAside']
|
|
16
|
+
ElButton: typeof import('element-plus/es')['ElButton']
|
|
17
|
+
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
|
18
|
+
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
|
19
|
+
ElCol: typeof import('element-plus/es')['ElCol']
|
|
20
|
+
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
|
21
|
+
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
|
22
|
+
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
|
|
23
|
+
ElContainer: typeof import('element-plus/es')['ElContainer']
|
|
24
|
+
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
|
25
|
+
ElDivider: typeof import('element-plus/es')['ElDivider']
|
|
26
|
+
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
|
27
|
+
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
|
28
|
+
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
|
29
|
+
ElFooter: typeof import('element-plus/es')['ElFooter']
|
|
30
|
+
ElForm: typeof import('element-plus/es')['ElForm']
|
|
31
|
+
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
|
32
|
+
ElIcon: typeof import('element-plus/es')['ElIcon']
|
|
33
|
+
ElInput: typeof import('element-plus/es')['ElInput']
|
|
34
|
+
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
|
|
35
|
+
ElMain: typeof import('element-plus/es')['ElMain']
|
|
36
|
+
ElOption: typeof import('element-plus/es')['ElOption']
|
|
37
|
+
ElRadio: typeof import('element-plus/es')['ElRadio']
|
|
38
|
+
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
|
39
|
+
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
|
40
|
+
ElRow: typeof import('element-plus/es')['ElRow']
|
|
41
|
+
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
|
42
|
+
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
43
|
+
ElSlider: typeof import('element-plus/es')['ElSlider']
|
|
44
|
+
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
|
45
|
+
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
|
46
|
+
ElTabs: typeof import('element-plus/es')['ElTabs']
|
|
47
|
+
ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect']
|
|
48
|
+
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
|
49
|
+
InputNumber: typeof import('./src/components/InputNumber/index.vue')['default']
|
|
50
|
+
JsonEditor: typeof import('./src/components/JsonEditor/index.vue')['default']
|
|
51
|
+
Radio: typeof import('./src/components/Radio/index.vue')['default']
|
|
52
|
+
RichText: typeof import('./src/components/RichText/index.vue')['default']
|
|
53
|
+
RouterLink: typeof import('vue-router')['RouterLink']
|
|
54
|
+
RouterView: typeof import('vue-router')['RouterView']
|
|
55
|
+
Rule: typeof import('./src/components/Rule/index.vue')['default']
|
|
56
|
+
Selected: typeof import('./src/components/Selected/index.vue')['default']
|
|
57
|
+
Selecteds: typeof import('./src/components/Selecteds/index.vue')['default']
|
|
58
|
+
ShowRule: typeof import('./src/components/ShowRule/index.vue')['default']
|
|
59
|
+
Slider: typeof import('./src/components/Slider/index.vue')['default']
|
|
60
|
+
Switch: typeof import('./src/components/Switch/index.vue')['default']
|
|
61
|
+
Text: typeof import('./src/components/Text/index.vue')['default']
|
|
62
|
+
TextArea: typeof import('./src/components/TextArea/index.vue')['default']
|
|
63
|
+
Time: typeof import('./src/components/Time/index.vue')['default']
|
|
64
|
+
}
|
|
65
|
+
export interface ComponentCustomProperties {
|
|
66
|
+
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { ElTooltip, ElButton, ElScrollbar, ElMain, ElContainer, ElAside, ElInput, ElFormItem, ElForm } from 'element-plus/es';
|
|
2
|
+
import 'element-plus/es/components/base/style/css';
|
|
3
|
+
import 'element-plus/es/components/form/style/css';
|
|
4
|
+
import 'element-plus/es/components/form-item/style/css';
|
|
5
|
+
import 'element-plus/es/components/input/style/css';
|
|
6
|
+
import 'element-plus/es/components/aside/style/css';
|
|
7
|
+
import 'element-plus/es/components/container/style/css';
|
|
8
|
+
import 'element-plus/es/components/main/style/css';
|
|
9
|
+
import 'element-plus/es/components/scrollbar/style/css';
|
|
10
|
+
import 'element-plus/es/components/button/style/css';
|
|
11
|
+
import 'element-plus/es/components/tooltip/style/css';
|
|
12
|
+
import { defineComponent, inject, ref, getCurrentInstance, reactive, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, createBlock, withCtx, createTextVNode, createVNode, Fragment, renderList, withModifiers } from 'vue';
|
|
13
|
+
import { Codemirror } from 'vue-codemirror';
|
|
14
|
+
import { _ as _export_sfc } from './main-96327b2e.mjs';
|
|
15
|
+
import 'element-plus/es/components/checkbox/style/css';
|
|
16
|
+
import 'element-plus/es/components/loading/style/css';
|
|
17
|
+
import 'element-plus/es/components/dropdown/style/css';
|
|
18
|
+
import 'element-plus/es/components/dropdown-menu/style/css';
|
|
19
|
+
import 'element-plus/es/components/dropdown-item/style/css';
|
|
20
|
+
import 'element-plus/es/components/collapse/style/css';
|
|
21
|
+
import 'element-plus/es/components/collapse-item/style/css';
|
|
22
|
+
import 'element-plus/es/components/row/style/css';
|
|
23
|
+
import 'element-plus/es/components/icon/style/css';
|
|
24
|
+
import 'element-plus/es/components/col/style/css';
|
|
25
|
+
import 'element-plus/es/components/select/style/css';
|
|
26
|
+
import 'element-plus/es/components/option/style/css';
|
|
27
|
+
import '@element-plus/icons-vue';
|
|
28
|
+
import 'element-plus/es/components/input-number/style/css';
|
|
29
|
+
import 'element-plus/es/components/radio-group/style/css';
|
|
30
|
+
import 'element-plus/es/components/radio-button/style/css';
|
|
31
|
+
import 'element-plus/es/components/checkbox-group/style/css';
|
|
32
|
+
import 'element-plus/es/components/color-picker/style/css';
|
|
33
|
+
import 'element-plus/es/components/date-picker/style/css';
|
|
34
|
+
import 'element-plus/es/components/radio/style/css';
|
|
35
|
+
import 'element-plus/es/components/slider/style/css';
|
|
36
|
+
import 'element-plus/es/components/switch/style/css';
|
|
37
|
+
import 'element-plus/es/components/time-select/style/css';
|
|
38
|
+
import 'element-plus/es/components/divider/style/css';
|
|
39
|
+
import 'element-plus/es/components/alert/style/css';
|
|
40
|
+
import 'element-plus/es/components/tabs/style/css';
|
|
41
|
+
import 'element-plus/es/components/tab-pane/style/css';
|
|
42
|
+
import 'element-plus';
|
|
43
|
+
|
|
44
|
+
const _sfc_main = defineComponent({
|
|
45
|
+
ControlType: "FormAction",
|
|
46
|
+
isHide: true,
|
|
47
|
+
components: {
|
|
48
|
+
Codemirror
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
item: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => ({})
|
|
54
|
+
},
|
|
55
|
+
data: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => ({})
|
|
58
|
+
},
|
|
59
|
+
drag: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
labelalign: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "top"
|
|
66
|
+
},
|
|
67
|
+
labelWidth: {
|
|
68
|
+
type: Number
|
|
69
|
+
},
|
|
70
|
+
size: {
|
|
71
|
+
type: String
|
|
72
|
+
},
|
|
73
|
+
isForm: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
setup(props) {
|
|
79
|
+
const { actionContrl: actionStore } = inject("control") || {};
|
|
80
|
+
const actionRef = ref();
|
|
81
|
+
const { proxy } = getCurrentInstance();
|
|
82
|
+
const action = ref(window.VApp.$Flex.deepClone(actionStore?.get("action")));
|
|
83
|
+
const currentAction = ref(
|
|
84
|
+
window.VApp.$Flex.deepClone(actionStore?.get("currentAction"))
|
|
85
|
+
);
|
|
86
|
+
let actionType = "";
|
|
87
|
+
const rules = reactive({
|
|
88
|
+
funcName: [
|
|
89
|
+
{
|
|
90
|
+
required: true,
|
|
91
|
+
message: "\u51FD\u6570\u540D\u79F0\u5FC5\u586B",
|
|
92
|
+
trigger: "change"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
});
|
|
96
|
+
console.log(props);
|
|
97
|
+
onMounted(() => {
|
|
98
|
+
});
|
|
99
|
+
return {
|
|
100
|
+
rules,
|
|
101
|
+
actionRef,
|
|
102
|
+
action,
|
|
103
|
+
currentAction,
|
|
104
|
+
getField(methods) {
|
|
105
|
+
return window.VApp.$Flex.getField(methods);
|
|
106
|
+
},
|
|
107
|
+
// extensions,
|
|
108
|
+
onAction(type) {
|
|
109
|
+
action.value = window.VApp.$Flex.deepClone(actionStore?.get("action"));
|
|
110
|
+
actionRef.value.init("\u52A8\u4F5C\u8BBE\u7F6E", "icon-icon-bianji");
|
|
111
|
+
actionRef.value.show();
|
|
112
|
+
if (type) {
|
|
113
|
+
actionType = type;
|
|
114
|
+
const item = action.value.find((item2) => {
|
|
115
|
+
if (item2.type == type) {
|
|
116
|
+
return item2;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
if (item) {
|
|
120
|
+
currentAction.value = item;
|
|
121
|
+
} else {
|
|
122
|
+
proxy.addAction(type);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
onEditAction(key, type) {
|
|
127
|
+
actionType = key;
|
|
128
|
+
action.value = window.VApp.$Flex.deepClone(actionStore?.get("action"));
|
|
129
|
+
actionRef.value.init("\u52A8\u4F5C\u8BBE\u7F6E", "icon-icon-bianji");
|
|
130
|
+
actionRef.value.show();
|
|
131
|
+
const item = action.value.find((item2) => {
|
|
132
|
+
if (item2.type == type) {
|
|
133
|
+
return item2;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
if (item) {
|
|
137
|
+
currentAction.value = item;
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
handleAction(item) {
|
|
141
|
+
currentAction.value = item;
|
|
142
|
+
},
|
|
143
|
+
onSave() {
|
|
144
|
+
actionStore?.set("action", action.value);
|
|
145
|
+
actionRef.value.close();
|
|
146
|
+
},
|
|
147
|
+
onCancel() {
|
|
148
|
+
actionRef.value.close();
|
|
149
|
+
},
|
|
150
|
+
copyAction(item) {
|
|
151
|
+
const newAction = window.VApp.$Flex.deepClone(item);
|
|
152
|
+
newAction.funcName = newAction.funcName + "_copy";
|
|
153
|
+
newAction.type = window.VApp.$Flex.generateMixed(5);
|
|
154
|
+
action.value.push(newAction);
|
|
155
|
+
currentAction.value = newAction;
|
|
156
|
+
},
|
|
157
|
+
deleteAction(item) {
|
|
158
|
+
action.value = action.value.filter((actionItem) => {
|
|
159
|
+
if (actionItem.type !== item.type) {
|
|
160
|
+
return actionItem;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
if (currentAction.value && item.type == currentAction.value.type) {
|
|
164
|
+
currentAction.value = null;
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
addAction(type) {
|
|
168
|
+
const addAction = {
|
|
169
|
+
funcName: (type || "func") + "_" + window.VApp.$Flex.generateMixed(5),
|
|
170
|
+
type: window.VApp.$Flex.generateMixed(5),
|
|
171
|
+
funcStr: "",
|
|
172
|
+
methods: type
|
|
173
|
+
};
|
|
174
|
+
action.value.push(addAction);
|
|
175
|
+
if (type) {
|
|
176
|
+
currentAction.value = addAction;
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
onConfirm() {
|
|
180
|
+
if (!props.data[props.item.data.fieldName]) {
|
|
181
|
+
props.data[props.item.data.fieldName] = {};
|
|
182
|
+
}
|
|
183
|
+
props.data[props.item.data.fieldName][actionType] = JSON.stringify(
|
|
184
|
+
currentAction.value
|
|
185
|
+
);
|
|
186
|
+
proxy.onSave();
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
const _hoisted_1 = {
|
|
192
|
+
key: 0,
|
|
193
|
+
class: "item_require"
|
|
194
|
+
};
|
|
195
|
+
const _hoisted_2 = { class: "common-layout" };
|
|
196
|
+
const _hoisted_3 = { class: "action-header" };
|
|
197
|
+
const _hoisted_4 = { class: "action-list" };
|
|
198
|
+
const _hoisted_5 = ["onClick"];
|
|
199
|
+
const _hoisted_6 = { class: "event-script-menu-label" };
|
|
200
|
+
const _hoisted_7 = {
|
|
201
|
+
key: 0,
|
|
202
|
+
class: "event-script-menu-action"
|
|
203
|
+
};
|
|
204
|
+
const _hoisted_8 = ["onClick"];
|
|
205
|
+
const _hoisted_9 = ["onClick"];
|
|
206
|
+
const _hoisted_10 = { class: "action-header event-script-main-header" };
|
|
207
|
+
const _hoisted_11 = { class: "coding" };
|
|
208
|
+
const _hoisted_12 = { class: "header" };
|
|
209
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
210
|
+
const _component_el_tooltip = ElTooltip;
|
|
211
|
+
const _component_el_button = ElButton;
|
|
212
|
+
const _component_el_scrollbar = ElScrollbar;
|
|
213
|
+
const _component_el_main = ElMain;
|
|
214
|
+
const _component_el_container = ElContainer;
|
|
215
|
+
const _component_el_aside = ElAside;
|
|
216
|
+
const _component_el_input = ElInput;
|
|
217
|
+
const _component_el_form_item = ElFormItem;
|
|
218
|
+
const _component_codemirror = resolveComponent("codemirror");
|
|
219
|
+
const _component_el_form = ElForm;
|
|
220
|
+
const _component_CustomDialog = resolveComponent("CustomDialog");
|
|
221
|
+
return openBlock(), createElementBlock("div", {
|
|
222
|
+
class: normalizeClass(["starfish-formitem", {
|
|
223
|
+
formCover: _ctx.drag,
|
|
224
|
+
"starfish-vertical": _ctx.labelalign != "top",
|
|
225
|
+
[_ctx.item.data.csslist?.join(" ")]: !!_ctx.item.data.csslist
|
|
226
|
+
}])
|
|
227
|
+
}, [
|
|
228
|
+
!_ctx.isForm ? (openBlock(), createElementBlock("div", {
|
|
229
|
+
key: 0,
|
|
230
|
+
class: normalizeClass(["label", "label_" + _ctx.labelalign]),
|
|
231
|
+
style: normalizeStyle({ width: _ctx.labelWidth + "px" })
|
|
232
|
+
}, [
|
|
233
|
+
createElementVNode("label", null, toDisplayString(_ctx.item.data.label), 1),
|
|
234
|
+
_ctx.item.data.required ? (openBlock(), createElementBlock("span", _hoisted_1, "*")) : createCommentVNode("", true),
|
|
235
|
+
_ctx.item.data.tip ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
236
|
+
key: 1,
|
|
237
|
+
class: "item",
|
|
238
|
+
effect: "dark",
|
|
239
|
+
content: _ctx.item.data.tip,
|
|
240
|
+
placement: "top"
|
|
241
|
+
}, {
|
|
242
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
243
|
+
createElementVNode("span", { class: "tip iconfontui icon-tishi" }, null, -1)
|
|
244
|
+
])),
|
|
245
|
+
_: 1,
|
|
246
|
+
__: [2]
|
|
247
|
+
}, 8, ["content"])) : createCommentVNode("", true)
|
|
248
|
+
], 6)) : createCommentVNode("", true),
|
|
249
|
+
createElementVNode("div", {
|
|
250
|
+
class: "control",
|
|
251
|
+
style: normalizeStyle({ marginLeft: _ctx.labelalign != "top" ? _ctx.labelWidth + "px" : "" })
|
|
252
|
+
}, [
|
|
253
|
+
!_ctx.isForm ? (openBlock(), createBlock(_component_el_button, {
|
|
254
|
+
key: 0,
|
|
255
|
+
style: { "width": "100%" },
|
|
256
|
+
onClick: _ctx.onAction
|
|
257
|
+
}, {
|
|
258
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
259
|
+
createTextVNode(" \u8BBE\u7F6E ", -1)
|
|
260
|
+
])),
|
|
261
|
+
_: 1,
|
|
262
|
+
__: [3]
|
|
263
|
+
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
264
|
+
createVNode(_component_CustomDialog, { ref: "actionRef" }, {
|
|
265
|
+
default: withCtx(() => [
|
|
266
|
+
createElementVNode("div", _hoisted_2, [
|
|
267
|
+
createVNode(_component_el_container, { style: { "height": "100%", "border": "1px solid rgb(238, 238, 238)" } }, {
|
|
268
|
+
default: withCtx(() => [
|
|
269
|
+
createVNode(_component_el_container, null, {
|
|
270
|
+
default: withCtx(() => [
|
|
271
|
+
createVNode(_component_el_aside, {
|
|
272
|
+
width: "300px",
|
|
273
|
+
class: "event-script-aside"
|
|
274
|
+
}, {
|
|
275
|
+
default: withCtx(() => [
|
|
276
|
+
createVNode(_component_el_container, { class: "is-vertical" }, {
|
|
277
|
+
default: withCtx(() => [
|
|
278
|
+
createElementVNode("header", _hoisted_3, [
|
|
279
|
+
createVNode(_component_el_button, {
|
|
280
|
+
type: "text",
|
|
281
|
+
size: _ctx.size,
|
|
282
|
+
onClick: _ctx.addAction
|
|
283
|
+
}, {
|
|
284
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
|
285
|
+
createTextVNode(" +\u6DFB\u52A0\u52A8\u4F5C", -1)
|
|
286
|
+
])),
|
|
287
|
+
_: 1,
|
|
288
|
+
__: [4]
|
|
289
|
+
}, 8, ["size", "onClick"])
|
|
290
|
+
]),
|
|
291
|
+
createVNode(_component_el_main, null, {
|
|
292
|
+
default: withCtx(() => [
|
|
293
|
+
createVNode(_component_el_scrollbar, null, {
|
|
294
|
+
default: withCtx(() => [
|
|
295
|
+
createElementVNode("div", _hoisted_4, [
|
|
296
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.action, (item, index) => {
|
|
297
|
+
return openBlock(), createElementBlock("div", {
|
|
298
|
+
class: normalizeClass([
|
|
299
|
+
"action",
|
|
300
|
+
_ctx.currentAction && item.type == _ctx.currentAction.type ? "selectAction" : ""
|
|
301
|
+
]),
|
|
302
|
+
key: index,
|
|
303
|
+
onClick: ($event) => _ctx.handleAction(item)
|
|
304
|
+
}, [
|
|
305
|
+
_cache[5] || (_cache[5] = createElementVNode("span", { class: "event-script-menu-i" }, "Function", -1)),
|
|
306
|
+
createElementVNode("div", _hoisted_6, toDisplayString(item.funcName), 1),
|
|
307
|
+
!item.disabled ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
308
|
+
createElementVNode("i", {
|
|
309
|
+
title: "\u590D\u5236",
|
|
310
|
+
class: "iconfontui icon-fuzhi",
|
|
311
|
+
onClick: withModifiers(($event) => _ctx.copyAction(item), ["stop"])
|
|
312
|
+
}, null, 8, _hoisted_8),
|
|
313
|
+
createElementVNode("i", {
|
|
314
|
+
title: "\u5220\u9664",
|
|
315
|
+
class: "iconfontui icon-shanchu1",
|
|
316
|
+
onClick: withModifiers(($event) => _ctx.deleteAction(item), ["stop"])
|
|
317
|
+
}, null, 8, _hoisted_9)
|
|
318
|
+
])) : createCommentVNode("", true)
|
|
319
|
+
], 10, _hoisted_5);
|
|
320
|
+
}), 128))
|
|
321
|
+
])
|
|
322
|
+
]),
|
|
323
|
+
_: 1
|
|
324
|
+
})
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
})
|
|
328
|
+
]),
|
|
329
|
+
_: 1
|
|
330
|
+
})
|
|
331
|
+
]),
|
|
332
|
+
_: 1
|
|
333
|
+
}),
|
|
334
|
+
createVNode(_component_el_main, { class: "event-script-main" }, {
|
|
335
|
+
default: withCtx(() => [
|
|
336
|
+
createVNode(_component_el_container, { class: "is-vertical" }, {
|
|
337
|
+
default: withCtx(() => [
|
|
338
|
+
createElementVNode("header", _hoisted_10, [
|
|
339
|
+
createVNode(_component_el_button, {
|
|
340
|
+
type: "primary",
|
|
341
|
+
onClick: _ctx.onConfirm,
|
|
342
|
+
size: "small"
|
|
343
|
+
}, {
|
|
344
|
+
default: withCtx(() => _cache[6] || (_cache[6] = [
|
|
345
|
+
createTextVNode("\u786E\u5B9A", -1)
|
|
346
|
+
])),
|
|
347
|
+
_: 1,
|
|
348
|
+
__: [6]
|
|
349
|
+
}, 8, ["onClick"]),
|
|
350
|
+
createVNode(_component_el_button, {
|
|
351
|
+
type: "primary",
|
|
352
|
+
onClick: _ctx.onSave,
|
|
353
|
+
size: "small"
|
|
354
|
+
}, {
|
|
355
|
+
default: withCtx(() => _cache[7] || (_cache[7] = [
|
|
356
|
+
createTextVNode("\u4FDD\u5B58", -1)
|
|
357
|
+
])),
|
|
358
|
+
_: 1,
|
|
359
|
+
__: [7]
|
|
360
|
+
}, 8, ["onClick"]),
|
|
361
|
+
createVNode(_component_el_button, {
|
|
362
|
+
onClick: _ctx.onCancel,
|
|
363
|
+
size: "small"
|
|
364
|
+
}, {
|
|
365
|
+
default: withCtx(() => _cache[8] || (_cache[8] = [
|
|
366
|
+
createTextVNode("\u53D6\u6D88", -1)
|
|
367
|
+
])),
|
|
368
|
+
_: 1,
|
|
369
|
+
__: [8]
|
|
370
|
+
}, 8, ["onClick"])
|
|
371
|
+
]),
|
|
372
|
+
_ctx.currentAction ? (openBlock(), createBlock(_component_el_main, {
|
|
373
|
+
key: 0,
|
|
374
|
+
class: "func_main"
|
|
375
|
+
}, {
|
|
376
|
+
default: withCtx(() => [
|
|
377
|
+
createVNode(_component_el_scrollbar, null, {
|
|
378
|
+
default: withCtx(() => [
|
|
379
|
+
createVNode(_component_el_form, {
|
|
380
|
+
model: _ctx.currentAction,
|
|
381
|
+
rules: _ctx.rules
|
|
382
|
+
}, {
|
|
383
|
+
default: withCtx(() => [
|
|
384
|
+
createVNode(_component_el_form_item, {
|
|
385
|
+
label: "Function Name",
|
|
386
|
+
prop: "funcName"
|
|
387
|
+
}, {
|
|
388
|
+
default: withCtx(() => [
|
|
389
|
+
createVNode(_component_el_input, {
|
|
390
|
+
modelValue: _ctx.currentAction.funcName,
|
|
391
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.currentAction.funcName = $event),
|
|
392
|
+
disabled: _ctx.currentAction.disabled
|
|
393
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
394
|
+
]),
|
|
395
|
+
_: 1
|
|
396
|
+
}),
|
|
397
|
+
createVNode(_component_el_form_item, { prop: "funcStr" }, {
|
|
398
|
+
default: withCtx(() => [
|
|
399
|
+
createElementVNode("div", _hoisted_11, [
|
|
400
|
+
createElementVNode("div", _hoisted_12, " function " + toDisplayString(_ctx.currentAction.funcName) + "(" + toDisplayString(_ctx.getField(_ctx.currentAction.methods)) + "){ ", 1),
|
|
401
|
+
createVNode(_component_codemirror, {
|
|
402
|
+
modelValue: _ctx.currentAction.funcStr,
|
|
403
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.currentAction.funcStr = $event),
|
|
404
|
+
placeholder: "",
|
|
405
|
+
style: { height: "400px" },
|
|
406
|
+
mode: "text/javascript",
|
|
407
|
+
autofocus: true,
|
|
408
|
+
"indent-with-tab": true,
|
|
409
|
+
"tab-size": 2
|
|
410
|
+
}, null, 8, ["modelValue"]),
|
|
411
|
+
_cache[9] || (_cache[9] = createElementVNode("div", { class: "footer" }, "}", -1))
|
|
412
|
+
])
|
|
413
|
+
]),
|
|
414
|
+
_: 1
|
|
415
|
+
})
|
|
416
|
+
]),
|
|
417
|
+
_: 1
|
|
418
|
+
}, 8, ["model", "rules"])
|
|
419
|
+
]),
|
|
420
|
+
_: 1
|
|
421
|
+
})
|
|
422
|
+
]),
|
|
423
|
+
_: 1
|
|
424
|
+
})) : createCommentVNode("", true)
|
|
425
|
+
]),
|
|
426
|
+
_: 1
|
|
427
|
+
})
|
|
428
|
+
]),
|
|
429
|
+
_: 1
|
|
430
|
+
})
|
|
431
|
+
]),
|
|
432
|
+
_: 1
|
|
433
|
+
})
|
|
434
|
+
]),
|
|
435
|
+
_: 1
|
|
436
|
+
})
|
|
437
|
+
])
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
}, 512)
|
|
441
|
+
], 4)
|
|
442
|
+
], 2);
|
|
443
|
+
}
|
|
444
|
+
const formAction = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
445
|
+
|
|
446
|
+
export { formAction as default };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ElTooltip } from 'element-plus/es';
|
|
2
|
+
import 'element-plus/es/components/base/style/css';
|
|
3
|
+
import 'element-plus/es/components/tooltip/style/css';
|
|
4
|
+
import { defineComponent, ref, onMounted, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode, createBlock, withCtx } from 'vue';
|
|
5
|
+
import E from 'wangeditor';
|
|
6
|
+
import { _ as _export_sfc, g as getFormConfig, f as fieldProps, u as useWatch } from './main-96327b2e.mjs';
|
|
7
|
+
import 'element-plus/es/components/input/style/css';
|
|
8
|
+
import 'element-plus/es/components/checkbox/style/css';
|
|
9
|
+
import 'element-plus/es/components/loading/style/css';
|
|
10
|
+
import 'element-plus/es/components/dropdown/style/css';
|
|
11
|
+
import 'element-plus/es/components/dropdown-menu/style/css';
|
|
12
|
+
import 'element-plus/es/components/dropdown-item/style/css';
|
|
13
|
+
import 'element-plus/es/components/collapse/style/css';
|
|
14
|
+
import 'element-plus/es/components/collapse-item/style/css';
|
|
15
|
+
import 'element-plus/es/components/row/style/css';
|
|
16
|
+
import 'element-plus/es/components/button/style/css';
|
|
17
|
+
import 'element-plus/es/components/icon/style/css';
|
|
18
|
+
import 'element-plus/es/components/col/style/css';
|
|
19
|
+
import 'element-plus/es/components/select/style/css';
|
|
20
|
+
import 'element-plus/es/components/option/style/css';
|
|
21
|
+
import '@element-plus/icons-vue';
|
|
22
|
+
import 'element-plus/es/components/input-number/style/css';
|
|
23
|
+
import 'element-plus/es/components/radio-group/style/css';
|
|
24
|
+
import 'element-plus/es/components/radio-button/style/css';
|
|
25
|
+
import 'element-plus/es/components/checkbox-group/style/css';
|
|
26
|
+
import 'element-plus/es/components/color-picker/style/css';
|
|
27
|
+
import 'element-plus/es/components/date-picker/style/css';
|
|
28
|
+
import 'element-plus/es/components/radio/style/css';
|
|
29
|
+
import 'element-plus/es/components/slider/style/css';
|
|
30
|
+
import 'element-plus/es/components/switch/style/css';
|
|
31
|
+
import 'element-plus/es/components/time-select/style/css';
|
|
32
|
+
import 'element-plus/es/components/divider/style/css';
|
|
33
|
+
import 'element-plus/es/components/alert/style/css';
|
|
34
|
+
import 'element-plus/es/components/tabs/style/css';
|
|
35
|
+
import 'element-plus/es/components/tab-pane/style/css';
|
|
36
|
+
import 'element-plus/es/components/form-item/style/css';
|
|
37
|
+
import 'element-plus';
|
|
38
|
+
|
|
39
|
+
const _sfc_main = defineComponent({
|
|
40
|
+
ControlType: "RichText",
|
|
41
|
+
// 必须与文件名匹配
|
|
42
|
+
nameCn: "\u5BCC\u6587\u672C",
|
|
43
|
+
icon: "icon-textEdit",
|
|
44
|
+
formConfig: getFormConfig("RichText", [{ fieldName: "state", component: "Radio" }]),
|
|
45
|
+
props: {
|
|
46
|
+
...fieldProps
|
|
47
|
+
},
|
|
48
|
+
setup(props) {
|
|
49
|
+
const richText = ref();
|
|
50
|
+
let editor = null;
|
|
51
|
+
useWatch(props);
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
if (props.drag) {
|
|
54
|
+
editor = new E(richText.value);
|
|
55
|
+
editor.config.focus = false;
|
|
56
|
+
editor.create();
|
|
57
|
+
} else {
|
|
58
|
+
editor = new E(richText.value);
|
|
59
|
+
editor.config.focus = false;
|
|
60
|
+
editor.create();
|
|
61
|
+
const data = props.data;
|
|
62
|
+
const item = props.item;
|
|
63
|
+
editor.config.onchange = function(newHtml) {
|
|
64
|
+
console.log("onblur", newHtml);
|
|
65
|
+
data[item.data.fieldName] = newHtml;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
onUnmounted(() => {
|
|
70
|
+
editor.destroy();
|
|
71
|
+
editor = null;
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
richText
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
const _hoisted_1 = {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: "item_require"
|
|
81
|
+
};
|
|
82
|
+
const _hoisted_2 = {
|
|
83
|
+
key: 0,
|
|
84
|
+
ref: "richText"
|
|
85
|
+
};
|
|
86
|
+
const _hoisted_3 = {
|
|
87
|
+
key: 1,
|
|
88
|
+
ref: "richText"
|
|
89
|
+
};
|
|
90
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
91
|
+
const _component_el_tooltip = ElTooltip;
|
|
92
|
+
return openBlock(), createElementBlock("div", {
|
|
93
|
+
class: normalizeClass(["starfish-formitem", { formCover: _ctx.drag, "starfish-vertical": _ctx.labelalign != "top", [_ctx.item.data.csslist?.join(" ")]: !!_ctx.item.data.csslist }])
|
|
94
|
+
}, [
|
|
95
|
+
createElementVNode("div", {
|
|
96
|
+
class: normalizeClass(["label", "label_" + _ctx.labelalign]),
|
|
97
|
+
style: normalizeStyle({ width: _ctx.labelWidth + "px" })
|
|
98
|
+
}, [
|
|
99
|
+
createElementVNode("label", null, toDisplayString(_ctx.item.data.label) + toDisplayString(_ctx.suffix), 1),
|
|
100
|
+
_ctx.item.data.required ? (openBlock(), createElementBlock("span", _hoisted_1, "*")) : createCommentVNode("", true),
|
|
101
|
+
_ctx.item.data.tip ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
102
|
+
key: 1,
|
|
103
|
+
class: "item",
|
|
104
|
+
effect: "dark",
|
|
105
|
+
content: _ctx.item.data.tip,
|
|
106
|
+
placement: "top"
|
|
107
|
+
}, {
|
|
108
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
109
|
+
createElementVNode("span", { class: "tip iconfontui icon-tishi" }, null, -1)
|
|
110
|
+
])),
|
|
111
|
+
_: 1,
|
|
112
|
+
__: [0]
|
|
113
|
+
}, 8, ["content"])) : createCommentVNode("", true)
|
|
114
|
+
], 6),
|
|
115
|
+
createElementVNode("div", {
|
|
116
|
+
class: "control",
|
|
117
|
+
style: normalizeStyle({ marginLeft: _ctx.labelalign != "top" ? _ctx.labelWidth + "px" : "" })
|
|
118
|
+
}, [
|
|
119
|
+
_ctx.drag ? (openBlock(), createElementBlock("div", _hoisted_2, null, 512)) : createCommentVNode("", true),
|
|
120
|
+
!_ctx.drag ? (openBlock(), createElementBlock("div", _hoisted_3, null, 512)) : createCommentVNode("", true)
|
|
121
|
+
], 4)
|
|
122
|
+
], 2);
|
|
123
|
+
}
|
|
124
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
125
|
+
|
|
126
|
+
export { index as default };
|