star-horse-lowcode 2.7.65 → 2.7.66
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 +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/index.es.js +491 -253
- package/package.json +1 -1
- package/.env.development +0 -3
- package/.env.production +0 -3
- package/.eslintrc-auto-import.json +0 -77
- package/.gitignore +0 -27
- package/.idea/.gitignore +0 -5
- package/.idea/MarsCodeWorkspaceAppSettings.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/testcode.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.idea/watcherTasks.xml +0 -4
- package/.idea/workspace.xml +0 -207
- package/.npmignore +0 -21
- package/.prettierignore +0 -26
- package/auto-imports.d.ts +0 -137
- package/components.d.ts +0 -189
- package/eslint.config.js +0 -37
- package/index.html +0 -14
- package/package-lock.json +0 -8276
- package/prettier.config.js +0 -20
- package/public/logo.svg +0 -660
- package/src/App.vue +0 -11
- package/src/api/date_utils.ts +0 -219
- package/src/api/finger_utils.ts +0 -71
- package/src/api/form_utils.ts +0 -281
- package/src/api/jquery.min.js +0 -2
- package/src/api/pcas-code.json +0 -1
- package/src/api/settings.ts +0 -81
- package/src/api/star_horse_apis.ts +0 -196
- package/src/api/star_horse_utils.ts +0 -797
- package/src/api/system.ts +0 -351
- package/src/api/user_func.ts +0 -147
- package/src/api/valid_utils.ts +0 -165
- package/src/assets/css/index.scss +0 -908
- package/src/assets/icons.css +0 -574
- package/src/assets/star-horse-icons.woff +0 -0
- package/src/components/comp/ShDynamicForm.vue +0 -160
- package/src/components/comp/ShForm.vue +0 -30
- package/src/components/comp/ShTableListColumn.vue +0 -61
- package/src/components/comp/StarHorseDataSelector.vue +0 -139
- package/src/components/comp/StarHorseDataView.vue +0 -110
- package/src/components/comp/StarHorseDataViewItems.vue +0 -61
- package/src/components/comp/StarHorseDataViewTable.vue +0 -102
- package/src/components/comp/StarHorseDialog.vue +0 -383
- package/src/components/comp/StarHorseDraggable.vue +0 -401
- package/src/components/comp/StarHorseForm.vue +0 -458
- package/src/components/comp/StarHorseFormItem.vue +0 -82
- package/src/components/comp/StarHorseFormList.vue +0 -516
- package/src/components/comp/StarHorseFormTable.vue +0 -56
- package/src/components/comp/StarHorseIcon.vue +0 -76
- package/src/components/comp/StarHorseItem.vue +0 -302
- package/src/components/comp/StarHorseJsonEditor.vue +0 -115
- package/src/components/comp/StarHorsePopover.vue +0 -66
- package/src/components/comp/StarHorseSearchComp.vue +0 -253
- package/src/components/comp/StarHorseStaticTable.vue +0 -395
- package/src/components/comp/StarHorseTableColumn.vue +0 -249
- package/src/components/comp/StarHorseTableComp.vue +0 -1193
- package/src/components/comp/StarHorseTableViewColumn.vue +0 -61
- package/src/components/comp/StarHorseTree.vue +0 -494
- package/src/components/comp/index.ts +0 -22
- package/src/components/comp/items/UTableColumn.vue +0 -65
- package/src/components/comp/items/boxItem.vue +0 -98
- package/src/components/comp/items/callitem.ts +0 -9
- package/src/components/comp/items/cardItem.vue +0 -152
- package/src/components/comp/items/collapseItem.vue +0 -134
- package/src/components/comp/items/dytableItem.vue +0 -135
- package/src/components/comp/items/otherItem.vue +0 -65
- package/src/components/comp/items/tabItem.vue +0 -155
- package/src/components/comp/items/tabPanelItem.vue +0 -110
- package/src/components/comp/items/tableColumn.vue +0 -129
- package/src/components/comp/items/tableItem.vue +0 -97
- package/src/components/comp/items/tablebtn.vue +0 -158
- package/src/components/comp/items/viewBoxItem.vue +0 -55
- package/src/components/comp/items/viewCardItem.vue +0 -47
- package/src/components/comp/items/viewCollapseItem.vue +0 -71
- package/src/components/comp/items/viewDytableItem.vue +0 -77
- package/src/components/comp/items/viewOtherItem.vue +0 -55
- package/src/components/comp/items/viewTabItem.vue +0 -77
- package/src/components/comp/items/viewTabPanelItem.vue +0 -54
- package/src/components/comp/items/viewTableItem.vue +0 -74
- package/src/components/comp/selfcomp.ts +0 -9
- package/src/components/comp/utils/DataPicker.vue +0 -302
- package/src/components/comp/utils/DataTag.vue +0 -51
- package/src/components/cron/Crontab-Day.vue +0 -230
- package/src/components/cron/Crontab-Hour.vue +0 -165
- package/src/components/cron/Crontab-Min.vue +0 -166
- package/src/components/cron/Crontab-Month.vue +0 -166
- package/src/components/cron/Crontab-Result.vue +0 -615
- package/src/components/cron/Crontab-Second.vue +0 -185
- package/src/components/cron/Crontab-Week.vue +0 -208
- package/src/components/cron/Crontab-Year.vue +0 -183
- package/src/components/cron/Crontab.vue +0 -474
- package/src/components/enums/ModuleEnums.ts +0 -10
- package/src/components/enums/ServiceEnums.ts +0 -18
- package/src/components/formcomp/container/box-container.vue +0 -162
- package/src/components/formcomp/container/callitem.ts +0 -9
- package/src/components/formcomp/container/card-container.vue +0 -170
- package/src/components/formcomp/container/collapse-container.vue +0 -133
- package/src/components/formcomp/container/dytable-col.vue +0 -448
- package/src/components/formcomp/container/dytable-container.vue +0 -57
- package/src/components/formcomp/container/dytableUtils.ts +0 -358
- package/src/components/formcomp/container/group-box-container.vue +0 -331
- package/src/components/formcomp/container/index.ts +0 -6
- package/src/components/formcomp/container/tab-container.vue +0 -153
- package/src/components/formcomp/container/table-container.vue +0 -249
- package/src/components/formcomp/items/allitem.ts +0 -9
- package/src/components/formcomp/items/area-item.vue +0 -116
- package/src/components/formcomp/items/audio-item.vue +0 -163
- package/src/components/formcomp/items/autocomplete-item.vue +0 -118
- package/src/components/formcomp/items/barcode-item.vue +0 -87
- package/src/components/formcomp/items/base-json-item.vue +0 -207
- package/src/components/formcomp/items/button-item.vue +0 -228
- package/src/components/formcomp/items/cascade-item.vue +0 -113
- package/src/components/formcomp/items/checkbox-item.vue +0 -97
- package/src/components/formcomp/items/color-item.vue +0 -70
- package/src/components/formcomp/items/cron-item.vue +0 -115
- package/src/components/formcomp/items/datetime-item.vue +0 -99
- package/src/components/formcomp/items/depart-item.vue +0 -51
- package/src/components/formcomp/items/dialog-input-item.vue +0 -207
- package/src/components/formcomp/items/divider-item.vue +0 -66
- package/src/components/formcomp/items/html-item.vue +0 -65
- package/src/components/formcomp/items/htmleditor-item.vue +0 -104
- package/src/components/formcomp/items/icon-item.vue +0 -195
- package/src/components/formcomp/items/image-item.vue +0 -247
- package/src/components/formcomp/items/index.ts +0 -44
- package/src/components/formcomp/items/input-item.vue +0 -150
- package/src/components/formcomp/items/json-array-item.vue +0 -67
- package/src/components/formcomp/items/json-item.vue +0 -66
- package/src/components/formcomp/items/markdown-item.vue +0 -77
- package/src/components/formcomp/items/number-item.vue +0 -94
- package/src/components/formcomp/items/number-range-item.vue +0 -278
- package/src/components/formcomp/items/page-select-item.vue +0 -407
- package/src/components/formcomp/items/password-item.vue +0 -71
- package/src/components/formcomp/items/qrcode-item.vue +0 -84
- package/src/components/formcomp/items/radio-item.vue +0 -112
- package/src/components/formcomp/items/rate-item.vue +0 -68
- package/src/components/formcomp/items/select-item.vue +0 -133
- package/src/components/formcomp/items/signature-item.vue +0 -216
- package/src/components/formcomp/items/slider-item.vue +0 -68
- package/src/components/formcomp/items/starhorse-form-item.vue +0 -334
- package/src/components/formcomp/items/switch-item.vue +0 -77
- package/src/components/formcomp/items/tag-item.vue +0 -77
- package/src/components/formcomp/items/text-item.vue +0 -75
- package/src/components/formcomp/items/textarea-item.vue +0 -85
- package/src/components/formcomp/items/time-item.vue +0 -77
- package/src/components/formcomp/items/time-picker-item.vue +0 -74
- package/src/components/formcomp/items/transfer-item.vue +0 -93
- package/src/components/formcomp/items/tselect-item.vue +0 -121
- package/src/components/formcomp/items/unknown-item.vue +0 -51
- package/src/components/formcomp/items/upload-item.vue +0 -189
- package/src/components/formcomp/items/user-item.vue +0 -177
- package/src/components/formcomp/items/usercomp-item.vue +0 -85
- package/src/components/formcomp/items/view-markdown-item.vue +0 -77
- package/src/components/formcomp/utils/EditDataDialog.vue +0 -67
- package/src/components/formcomp/utils/FieldList.vue +0 -125
- package/src/components/formcomp/utils/ItemRelationEventUtils.ts +0 -284
- package/src/components/help.vue +0 -31
- package/src/components/menu/MenuItem.vue +0 -95
- package/src/components/menu/SubMenu.vue +0 -68
- package/src/components/menu/SubSystemMenu.vue +0 -142
- package/src/components/register.ts +0 -24
- package/src/components/system/ContentMenu.vue +0 -260
- package/src/components/system/StarHorseButtonList.vue +0 -344
- package/src/components/system/StarHorseMenu.vue +0 -97
- package/src/components/system/StarHorseSvg.vue +0 -62
- package/src/components/system/SystemComp.ts +0 -9
- package/src/components/system/index.ts +0 -4
- package/src/components/types/ApiUrls.ts +0 -168
- package/src/components/types/BtnAction.ts +0 -51
- package/src/components/types/BtnAuth.ts +0 -43
- package/src/components/types/CompInfo.ts +0 -81
- package/src/components/types/DialogProps.ts +0 -55
- package/src/components/types/DyCompField.ts +0 -23
- package/src/components/types/DynamicNode.ts +0 -42
- package/src/components/types/MenusInfo.ts +0 -45
- package/src/components/types/PageFieldInfo.ts +0 -530
- package/src/components/types/PageProps.ts +0 -25
- package/src/components/types/Params.ts +0 -93
- package/src/components/types/RuleType.ts +0 -10
- package/src/components/types/SearchProps.ts +0 -42
- package/src/components/types/ShortKey.ts +0 -30
- package/src/components/types/StarHorseType.ts +0 -18
- package/src/components/types/index.ts +0 -15
- package/src/config/element.ts +0 -15
- package/src/config/styles.ts +0 -4
- package/src/index.ts +0 -98
- package/src/install.ts +0 -33
- package/src/lang/en_US.ts +0 -81
- package/src/lang/index.ts +0 -35
- package/src/lang/zh_CN.ts +0 -84
- package/src/main.ts +0 -57
- package/src/plugins/AblesPlugin.ts +0 -618
- package/src/plugins/registerCompPlugin.ts +0 -15
- package/src/sample/test.vue +0 -9
- package/src/store/ButtonPermission.ts +0 -101
- package/src/store/ConsumerView.ts +0 -52
- package/src/store/ContinusConfig.ts +0 -78
- package/src/store/CopyerOperation.ts +0 -74
- package/src/store/DesignForm.ts +0 -481
- package/src/store/DesignPage.ts +0 -59
- package/src/store/DynamicForm.ts +0 -241
- package/src/store/GlobalConfig.ts +0 -90
- package/src/store/SelfOperation.ts +0 -95
- package/src/store/UserInfo.ts +0 -88
- package/src/store/index.ts +0 -6
- package/src/theme/localStorge.ts +0 -16
- package/src/theme/theme.ts +0 -27
- package/src/utils/FieldOperationUtils.ts +0 -91
- package/src/utils/auth.ts +0 -83
- package/src/utils/message.ts +0 -69
- package/src/utils/preview.ts +0 -125
- package/tsconfig.json +0 -39
- package/tsconfig.node.json +0 -10
- package/vite-env.d.ts +0 -16
- package/vite.config.ts +0 -162
- package/yarn.lock +0 -4627
|
@@ -1,618 +0,0 @@
|
|
|
1
|
-
import { useCopyerOperationStore } from "@/store/CopyerOperation";
|
|
2
|
-
import piniaInstance from "@/store";
|
|
3
|
-
import { computed, reactive, ref } from "vue";
|
|
4
|
-
import { useDesignFormStore } from "@/store/DesignForm";
|
|
5
|
-
import { uuid } from "@/api/system";
|
|
6
|
-
import { DynamicNode } from "@/components/types/DynamicNode";
|
|
7
|
-
import { useDesignPageStore } from "@/store/DesignPage";
|
|
8
|
-
|
|
9
|
-
const copyerAction = useCopyerOperationStore(piniaInstance);
|
|
10
|
-
const designForm = useDesignFormStore(piniaInstance);
|
|
11
|
-
const designPage = useDesignPageStore(piniaInstance);
|
|
12
|
-
const compList = computed(() => designForm.compList);
|
|
13
|
-
const currentItemId = computed(() => designForm.currentItemId);
|
|
14
|
-
const pasteDisplay = computed(() => {
|
|
15
|
-
const action = copyerAction.action;
|
|
16
|
-
return !!action;
|
|
17
|
-
});
|
|
18
|
-
export function getParentComp(parentField: any) {
|
|
19
|
-
return parentField &&
|
|
20
|
-
(parentField.itemType == "box" ||
|
|
21
|
-
parentField.itemType == "tab" ||
|
|
22
|
-
parentField.itemType == "dytable" ||
|
|
23
|
-
parentField.itemType == "table")
|
|
24
|
-
? "container"
|
|
25
|
-
: "item";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 选中组件
|
|
30
|
-
* @param index
|
|
31
|
-
* @param currentItems
|
|
32
|
-
* @param elements
|
|
33
|
-
* @param parentType
|
|
34
|
-
*/
|
|
35
|
-
const selectItem = (
|
|
36
|
-
index: number,
|
|
37
|
-
currentItems: Array<any>,
|
|
38
|
-
elements: Array<any>,
|
|
39
|
-
parentType: string,
|
|
40
|
-
) => {
|
|
41
|
-
let item: any = {};
|
|
42
|
-
if (currentItems.length > 0) {
|
|
43
|
-
item = currentItems[currentItems.length - 1];
|
|
44
|
-
} else {
|
|
45
|
-
const element = elements[index - 1] || elements[0];
|
|
46
|
-
item = element?.items[element.items?.length - 1];
|
|
47
|
-
}
|
|
48
|
-
if (item && Object.keys(item).length > 0) {
|
|
49
|
-
designForm.selectItem(item, item.itemType, parentType);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* 从舞台删除组件
|
|
55
|
-
* @param isEdit
|
|
56
|
-
* @param formItem
|
|
57
|
-
* @param parentField
|
|
58
|
-
*/
|
|
59
|
-
export function removeItem(isEdit: boolean, formItem: any, parentField: any) {
|
|
60
|
-
if (!isEdit) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const parentItemType = parentField?.itemType;
|
|
64
|
-
const dataList = compList.value;
|
|
65
|
-
if (
|
|
66
|
-
parentItemType == "tab" ||
|
|
67
|
-
parentItemType == "table" ||
|
|
68
|
-
parentItemType == "card" ||
|
|
69
|
-
parentItemType == "collapse"
|
|
70
|
-
) {
|
|
71
|
-
const elements = parentField!.preps.elements;
|
|
72
|
-
for (let i = 0; i < elements.length; i++) {
|
|
73
|
-
const items = elements[i].items;
|
|
74
|
-
for (let j = 0; j < items.length; j++) {
|
|
75
|
-
if (formItem.id === items[j]?.id) {
|
|
76
|
-
items.splice(j, 1);
|
|
77
|
-
selectItem(i, items, elements, parentItemType);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
} else if (parentItemType == "box" || parentItemType == "dytable") {
|
|
83
|
-
const elements = parentField!.preps.elements;
|
|
84
|
-
for (const index in elements) {
|
|
85
|
-
const sdataTemp = elements[index];
|
|
86
|
-
if (sdataTemp.columns.length > 0) {
|
|
87
|
-
for (let i = 0; i < sdataTemp.columns.length; i++) {
|
|
88
|
-
const items = sdataTemp.columns[i].items;
|
|
89
|
-
for (let j = 0; j < items.length; j++) {
|
|
90
|
-
if (formItem.id === items[j].id) {
|
|
91
|
-
items.splice(j, 1);
|
|
92
|
-
selectItem(i, items, sdataTemp.columns, parentItemType);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
} else {
|
|
100
|
-
for (let i = 0; i < dataList.length; i++) {
|
|
101
|
-
if (formItem.id === dataList[i].id) {
|
|
102
|
-
const item = dataList[i - 1] || dataList[0];
|
|
103
|
-
dataList.splice(i, 1);
|
|
104
|
-
if (item && Object.keys(item).length > 0) {
|
|
105
|
-
designForm.selectItem(item, item.itemType, parentItemType);
|
|
106
|
-
}
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 上移组件
|
|
115
|
-
* @param formItem
|
|
116
|
-
* @param parentField
|
|
117
|
-
*/
|
|
118
|
-
export function moveUpItem(isEdit: boolean, formItem: any, parentField: any) {
|
|
119
|
-
if (!isEdit) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
//这个数据解析好麻烦
|
|
123
|
-
const dataList = compList.value;
|
|
124
|
-
if (parentField?.itemType == "tab") {
|
|
125
|
-
const elements = parentField!.preps.elements;
|
|
126
|
-
for (let i = 0; i < elements.length; i++) {
|
|
127
|
-
const items = elements[i].items;
|
|
128
|
-
for (let j = 0; j < items.length; j++) {
|
|
129
|
-
if (formItem.id === items[j]?.id && j > 0) {
|
|
130
|
-
const temp = items[j];
|
|
131
|
-
items[j] = items[j - 1];
|
|
132
|
-
items[j - 1] = temp;
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
} else if (parentField?.itemType == "box") {
|
|
138
|
-
}
|
|
139
|
-
const compType = getParentComp(parentField);
|
|
140
|
-
if (compType === "item") {
|
|
141
|
-
for (let i = 0; i < dataList.length; i++) {
|
|
142
|
-
if (formItem.id === dataList[i].id && i > 0) {
|
|
143
|
-
const temp = dataList[i];
|
|
144
|
-
dataList[i] = dataList[i - 1];
|
|
145
|
-
dataList[i - 1] = temp;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
} else {
|
|
150
|
-
for (let i = 0; i < dataList.length; i++) {
|
|
151
|
-
const dataTemp = dataList[i];
|
|
152
|
-
if (dataTemp.compType !== "container") {
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
const elements = dataTemp.preps.elements;
|
|
156
|
-
for (const index in elements) {
|
|
157
|
-
const sdataTemp = elements[index];
|
|
158
|
-
if (sdataTemp.columns.length > 0) {
|
|
159
|
-
for (let i = 0; i < sdataTemp.columns.length; i++) {
|
|
160
|
-
const items = sdataTemp.columns[i].items;
|
|
161
|
-
for (let j = 0; j < items.length; j++) {
|
|
162
|
-
if (formItem.id === items[j].id && j > 0) {
|
|
163
|
-
const temp = items[j];
|
|
164
|
-
items[j] = items[j - 1];
|
|
165
|
-
items[j - 1] = temp;
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export function moveDownItem(isEdit: boolean, formItem: any, parentField: any) {
|
|
177
|
-
if (!isEdit) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const dataList = compList.value;
|
|
181
|
-
if (parentField?.itemType == "tab") {
|
|
182
|
-
const elements = parentField!.preps.elements;
|
|
183
|
-
for (let i = 0; i < elements.length; i++) {
|
|
184
|
-
const items = elements[i].items;
|
|
185
|
-
for (let j = 0; j < items.length; j++) {
|
|
186
|
-
if (formItem.id === items[j]?.id && j < items.length - 1) {
|
|
187
|
-
const temp = items[j];
|
|
188
|
-
items[j] = items[j + 1];
|
|
189
|
-
items[j + 1] = temp;
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
} else if (parentField?.itemType == "box") {
|
|
195
|
-
}
|
|
196
|
-
const compType = getParentComp(parentField);
|
|
197
|
-
if (compType === "item") {
|
|
198
|
-
for (let i = 0; i < dataList.length; i++) {
|
|
199
|
-
if (formItem.id === dataList[i].id && i < dataList.length - 1) {
|
|
200
|
-
const temp = dataList[i];
|
|
201
|
-
dataList[i] = dataList[i + 1];
|
|
202
|
-
dataList[i + 1] = temp;
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
} else {
|
|
207
|
-
for (let i = 0; i < dataList.length; i++) {
|
|
208
|
-
const dataTemp = dataList[i];
|
|
209
|
-
if (dataTemp.compType !== "container") {
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
const elements = dataTemp.preps.elements;
|
|
213
|
-
for (const index in elements) {
|
|
214
|
-
const sdataTemp = elements[index];
|
|
215
|
-
if (sdataTemp.columns.length > 0) {
|
|
216
|
-
for (let i = 0; i < sdataTemp.columns.length; i++) {
|
|
217
|
-
const items = sdataTemp.columns[i].items;
|
|
218
|
-
for (let j = 0; j < items.length; j++) {
|
|
219
|
-
if (formItem.id === items[j].id && j < items.length - 1) {
|
|
220
|
-
const temp = items[j];
|
|
221
|
-
items[j] = items[j + 1];
|
|
222
|
-
items[j + 1] = temp;
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
const fieldIndex = ref<number>(200);
|
|
234
|
-
const complexFields = (items: Array<any>, isCut: boolean = false) => {
|
|
235
|
-
for (const index in items) {
|
|
236
|
-
const item = items[index];
|
|
237
|
-
if (item.compType == "container") {
|
|
238
|
-
const sitems = item.preps.elements;
|
|
239
|
-
for (const sindex in sitems) {
|
|
240
|
-
complexFields(sitems[sindex].items);
|
|
241
|
-
}
|
|
242
|
-
} else {
|
|
243
|
-
item.id = uuid();
|
|
244
|
-
item["preps"]["id"] = item.id;
|
|
245
|
-
if (!isCut) {
|
|
246
|
-
fieldIndex.value++;
|
|
247
|
-
item.preps.name = item.preps.name + fieldIndex.value;
|
|
248
|
-
item.preps.label = item.preps.label + "(复制)";
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
/**
|
|
254
|
-
* 拷贝容器
|
|
255
|
-
* @param parentComp
|
|
256
|
-
* @param currentContainer
|
|
257
|
-
* @param isCut
|
|
258
|
-
*/
|
|
259
|
-
export const copyContainer = (
|
|
260
|
-
parentComp: Array<any>,
|
|
261
|
-
currentContainer: any,
|
|
262
|
-
isCut: boolean = false,
|
|
263
|
-
) => {
|
|
264
|
-
if (!currentContainer) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
const containerType = currentContainer.itemType;
|
|
268
|
-
const container = JSON.parse(JSON.stringify(currentContainer));
|
|
269
|
-
container.id = uuid();
|
|
270
|
-
//box和dytable 有列属性
|
|
271
|
-
if (containerType == "box" || containerType == "dytable") {
|
|
272
|
-
const rows = container.preps.elements;
|
|
273
|
-
for (const index in rows) {
|
|
274
|
-
const row = rows[index];
|
|
275
|
-
for (const cIndex in row.columns) {
|
|
276
|
-
const col = row.columns[cIndex];
|
|
277
|
-
col._uuid = uuid();
|
|
278
|
-
col.id = col._uuid;
|
|
279
|
-
complexFields(col.items, isCut);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
} else {
|
|
283
|
-
const rows = container.preps.elements;
|
|
284
|
-
for (const index in rows) {
|
|
285
|
-
complexFields(rows[index].items, isCut);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
parentComp.push(container);
|
|
289
|
-
designForm.selectItem(container, containerType, "");
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* 操作接口
|
|
294
|
-
* @param act
|
|
295
|
-
* @param item
|
|
296
|
-
* @param parentItem
|
|
297
|
-
*/
|
|
298
|
-
export function contextOperation(act: string, item: any, parentItem: any) {
|
|
299
|
-
console.log(act, item, parentItem);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export function cut(item: any, parentItem: any) {
|
|
303
|
-
copyerAction.operation("cut", parentItem, item);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export function copy(item: any, parentItem: any) {
|
|
307
|
-
copyerAction.operation("copy", parentItem, item);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export function paste(parentItem: any) {
|
|
311
|
-
let copyerData = copyerAction.copyerData;
|
|
312
|
-
if (!copyerData || Object.keys(copyerData).length == 0) {
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
if (parentItem && Object.keys(parentItem).length > 0) {
|
|
316
|
-
// let action = copyerAction.action;
|
|
317
|
-
copyContainer(parentItem!.preps?.elements, copyerData);
|
|
318
|
-
} else {
|
|
319
|
-
//拷贝容器
|
|
320
|
-
if (getParentComp(copyerData) == "container") {
|
|
321
|
-
const parentContainer = copyerAction.parentContainer;
|
|
322
|
-
copyContainer(
|
|
323
|
-
parentContainer ? parentContainer!.preps?.elements : compList.value,
|
|
324
|
-
copyerData,
|
|
325
|
-
);
|
|
326
|
-
} else {
|
|
327
|
-
copyerData = JSON.parse(JSON.stringify(copyerData));
|
|
328
|
-
copyerData.id = uuid();
|
|
329
|
-
copyerData.preps.id = copyerData.id;
|
|
330
|
-
compList.value.push(copyerData);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
*
|
|
337
|
-
* @param item
|
|
338
|
-
* @param parentItem
|
|
339
|
-
* @param flag scene 场景 container 容器 item 组件
|
|
340
|
-
* @param recall
|
|
341
|
-
*/
|
|
342
|
-
export function dynamicFormContextMenuData(
|
|
343
|
-
item: any,
|
|
344
|
-
parentItem: any,
|
|
345
|
-
flag: string = "scene",
|
|
346
|
-
recall?: Function,
|
|
347
|
-
) {
|
|
348
|
-
const menus = reactive<Array<any>>([]);
|
|
349
|
-
if (flag == "scene") {
|
|
350
|
-
menus.push({
|
|
351
|
-
type: "button",
|
|
352
|
-
text: "新建",
|
|
353
|
-
icon: "new",
|
|
354
|
-
display: true,
|
|
355
|
-
handler: () => {
|
|
356
|
-
if (recall) {
|
|
357
|
-
recall("new");
|
|
358
|
-
} else {
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
menus.push(
|
|
364
|
-
{
|
|
365
|
-
type: "button",
|
|
366
|
-
text: "剪切",
|
|
367
|
-
icon: "cut",
|
|
368
|
-
display: true,
|
|
369
|
-
handler: () => {
|
|
370
|
-
if (recall) {
|
|
371
|
-
recall("cut");
|
|
372
|
-
} else {
|
|
373
|
-
cut(item, parentItem);
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
type: "button",
|
|
379
|
-
text: "复制",
|
|
380
|
-
icon: "copy",
|
|
381
|
-
display: true,
|
|
382
|
-
handler: () => {
|
|
383
|
-
if (recall) {
|
|
384
|
-
recall("copy");
|
|
385
|
-
} else {
|
|
386
|
-
copy(item, parentItem);
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
type: "button",
|
|
392
|
-
text: "粘贴",
|
|
393
|
-
icon: "paste",
|
|
394
|
-
display: pasteDisplay,
|
|
395
|
-
handler: () => {
|
|
396
|
-
if (recall) {
|
|
397
|
-
recall("paste");
|
|
398
|
-
} else {
|
|
399
|
-
paste(parentItem);
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
type: "divider",
|
|
405
|
-
direction: "horizontal",
|
|
406
|
-
display: () => true,
|
|
407
|
-
},
|
|
408
|
-
);
|
|
409
|
-
if (flag == "scene") {
|
|
410
|
-
menus.push(
|
|
411
|
-
{
|
|
412
|
-
type: "button",
|
|
413
|
-
text: "全选",
|
|
414
|
-
icon: "select-all",
|
|
415
|
-
display: true,
|
|
416
|
-
handler: () => {
|
|
417
|
-
if (recall) {
|
|
418
|
-
recall("select-all");
|
|
419
|
-
} else {
|
|
420
|
-
}
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
type: "button",
|
|
425
|
-
text: "清空",
|
|
426
|
-
icon: "dustbin",
|
|
427
|
-
display: true,
|
|
428
|
-
handler: () => {
|
|
429
|
-
if (recall) {
|
|
430
|
-
recall("dustbin");
|
|
431
|
-
} else {
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
type: "divider",
|
|
437
|
-
direction: "horizontal",
|
|
438
|
-
display: true,
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
type: "button",
|
|
442
|
-
text: "预览",
|
|
443
|
-
icon: "preview",
|
|
444
|
-
display: true,
|
|
445
|
-
handler: () => {
|
|
446
|
-
if (recall) {
|
|
447
|
-
recall("preview");
|
|
448
|
-
} else {
|
|
449
|
-
}
|
|
450
|
-
},
|
|
451
|
-
},
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
if (flag == "container") {
|
|
455
|
-
menus.push({
|
|
456
|
-
type: "button",
|
|
457
|
-
text: "添加组件",
|
|
458
|
-
icon: "new",
|
|
459
|
-
display: true,
|
|
460
|
-
handler: () => {
|
|
461
|
-
designForm.setComponentVisible(true);
|
|
462
|
-
},
|
|
463
|
-
});
|
|
464
|
-
menus.push({
|
|
465
|
-
type: "button",
|
|
466
|
-
text: "选中容器",
|
|
467
|
-
icon: "select-parent",
|
|
468
|
-
display: currentItemId.value != item.id,
|
|
469
|
-
handler: () => {
|
|
470
|
-
designForm.selectItem(item, item?.itemType, "");
|
|
471
|
-
},
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
menus.push(
|
|
475
|
-
{
|
|
476
|
-
type: "button",
|
|
477
|
-
text: "撤销",
|
|
478
|
-
icon: "undo",
|
|
479
|
-
display: true,
|
|
480
|
-
handler: () => {
|
|
481
|
-
if (recall) {
|
|
482
|
-
recall("undo");
|
|
483
|
-
} else {
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
type: "divider",
|
|
489
|
-
direction: "horizontal",
|
|
490
|
-
display: true,
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
type: "button",
|
|
494
|
-
text: "删除",
|
|
495
|
-
icon: "delete",
|
|
496
|
-
display: () => true,
|
|
497
|
-
handler: () => {
|
|
498
|
-
if (recall) {
|
|
499
|
-
recall("delete");
|
|
500
|
-
} else {
|
|
501
|
-
}
|
|
502
|
-
},
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
type: "divider",
|
|
506
|
-
direction: "horizontal",
|
|
507
|
-
display: true,
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
type: "button",
|
|
511
|
-
text: "属性",
|
|
512
|
-
icon: "prep",
|
|
513
|
-
display: true,
|
|
514
|
-
handler: () => {
|
|
515
|
-
if (recall) {
|
|
516
|
-
recall("prep");
|
|
517
|
-
} else {
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
|
-
},
|
|
521
|
-
);
|
|
522
|
-
|
|
523
|
-
return menus;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
export function dynamicPageContextMenuData(node: DynamicNode) {
|
|
527
|
-
let contentMenuData: Array<any> = [];
|
|
528
|
-
contentMenuData = [
|
|
529
|
-
{
|
|
530
|
-
type: "button",
|
|
531
|
-
text: "水平居中",
|
|
532
|
-
icon: "center",
|
|
533
|
-
display: true,
|
|
534
|
-
handler: () => {},
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
type: "button",
|
|
538
|
-
text: "复制",
|
|
539
|
-
icon: "copy",
|
|
540
|
-
display: true,
|
|
541
|
-
handler: () => {
|
|
542
|
-
const temp = JSON.parse(JSON.stringify(node));
|
|
543
|
-
temp.id = uuid();
|
|
544
|
-
temp.name = temp.name + "复制";
|
|
545
|
-
designPage.addNode(temp);
|
|
546
|
-
},
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
type: "divider",
|
|
550
|
-
direction: "horizontal",
|
|
551
|
-
display: true,
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
type: "button",
|
|
555
|
-
text: "上移一层",
|
|
556
|
-
icon: "up-layer",
|
|
557
|
-
display: true,
|
|
558
|
-
handler: () => {
|
|
559
|
-
node.zIndex = (node.zIndex || 100) + 1;
|
|
560
|
-
},
|
|
561
|
-
},
|
|
562
|
-
{
|
|
563
|
-
type: "button",
|
|
564
|
-
text: "下移一层",
|
|
565
|
-
icon: "down-layer",
|
|
566
|
-
display: node.zIndex && node.zIndex > 100,
|
|
567
|
-
handler: () => {
|
|
568
|
-
node.zIndex = node.zIndex && node.zIndex > 100 ? node.zIndex - 1 : 100;
|
|
569
|
-
},
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
type: "button",
|
|
573
|
-
text: "置顶",
|
|
574
|
-
icon: "to-top",
|
|
575
|
-
display: true,
|
|
576
|
-
handler: () => {
|
|
577
|
-
node.zIndex = designPage.maxZIndex() + 1;
|
|
578
|
-
},
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
type: "button",
|
|
582
|
-
text: "置底",
|
|
583
|
-
icon: "to-bottom",
|
|
584
|
-
display: node.zIndex && node.zIndex > 100,
|
|
585
|
-
handler: () => {
|
|
586
|
-
node.zIndex = 100;
|
|
587
|
-
},
|
|
588
|
-
},
|
|
589
|
-
|
|
590
|
-
{
|
|
591
|
-
type: "divider",
|
|
592
|
-
direction: "horizontal",
|
|
593
|
-
display: true,
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
type: "button",
|
|
597
|
-
text: "删除",
|
|
598
|
-
icon: "delete",
|
|
599
|
-
display: true,
|
|
600
|
-
handler: () => {
|
|
601
|
-
designPage.removeNode(node.id);
|
|
602
|
-
},
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
type: "divider",
|
|
606
|
-
direction: "horizontal",
|
|
607
|
-
display: true,
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
type: "button",
|
|
611
|
-
icon: "empty_setting",
|
|
612
|
-
text: "清空参考线",
|
|
613
|
-
display: true,
|
|
614
|
-
handler: () => {},
|
|
615
|
-
},
|
|
616
|
-
];
|
|
617
|
-
return contentMenuData;
|
|
618
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineAsyncComponent } from "vue";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 注册组件
|
|
5
|
-
* @param app app
|
|
6
|
-
* @param moduleName 模块名称
|
|
7
|
-
*/
|
|
8
|
-
const register = ({ app, moduleName }) => {
|
|
9
|
-
const items = import.meta.glob(`${moduleName}/*.vue`);
|
|
10
|
-
for (const [key, value] of Object.entries(items)) {
|
|
11
|
-
const name = key.slice(key.lastIndexOf("/") + 1, key.lastIndexOf("."));
|
|
12
|
-
app.component(name, defineAsyncComponent(value as any));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export { register };
|