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
package/src/store/DesignForm.ts
DELETED
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
import { defineStore } from "pinia";
|
|
2
|
-
import { SelectOption } from "@/components/types/SearchProps";
|
|
3
|
-
import { Config } from "@/api/settings";
|
|
4
|
-
import { ref, unref } from "vue";
|
|
5
|
-
|
|
6
|
-
export const useDesignFormStore = defineStore("designForm", () => {
|
|
7
|
-
const containerList = ref<Array<any>>([]);
|
|
8
|
-
const formDataList = ref<Array<any>>([]);
|
|
9
|
-
const selfFormDataList = ref<Array<any>>([]);
|
|
10
|
-
const allFormDataList = ref<Array<any>>([]);
|
|
11
|
-
const formInfo = ref<any>({});
|
|
12
|
-
const compList = ref<Array<any>>([]);
|
|
13
|
-
const compListNoLayer = ref<any>([]);
|
|
14
|
-
const formData = ref<any>({});
|
|
15
|
-
const currentComp = ref<Array<any> | any>();
|
|
16
|
-
const currentItemType = ref<string>("");
|
|
17
|
-
const currentCompCategory = ref<string>("");
|
|
18
|
-
const parentCompType = ref<string>("");
|
|
19
|
-
const currentItemId = ref<string>("");
|
|
20
|
-
const currentSubItemId = ref<string>("");
|
|
21
|
-
const currentSubTabName = ref<string>("");
|
|
22
|
-
const isEdit = ref<boolean>(false);
|
|
23
|
-
const componentVisible = ref<boolean>(false);
|
|
24
|
-
const batchEditFieldVisible = ref<boolean>(false);
|
|
25
|
-
const previewVisible = ref<boolean>(false);
|
|
26
|
-
const refresh = ref<number>(0);
|
|
27
|
-
const currentFormPreps = ref<any>({});
|
|
28
|
-
const draggingItem = ref<any>({});
|
|
29
|
-
const isDragging = ref<boolean>(false);
|
|
30
|
-
const shortKeyDisabled = ref<boolean>(false);
|
|
31
|
-
const historyRecord = ref<any>({
|
|
32
|
-
index: -1,
|
|
33
|
-
maxStep: 20,
|
|
34
|
-
datas: [],
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 添加历史记录
|
|
39
|
-
* @param reOrUnDoFlag 是否点击按钮时触发
|
|
40
|
-
*/
|
|
41
|
-
const addHistoryRecord = (reOrUnDoFlag: boolean) => {
|
|
42
|
-
//不需要添加历史记录
|
|
43
|
-
if (reOrUnDoFlag || compList.value.length == 0) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const record = historyRecord;
|
|
47
|
-
const recordData: any = {
|
|
48
|
-
complist: unref(compList),
|
|
49
|
-
currentCompCategory: unref(currentCompCategory),
|
|
50
|
-
currentItemId: unref(currentItemId),
|
|
51
|
-
parentCompType: unref(parentCompType),
|
|
52
|
-
currentItemType: unref(currentItemType),
|
|
53
|
-
currentFormPreps: unref(currentFormPreps),
|
|
54
|
-
};
|
|
55
|
-
record.value.index = -1;
|
|
56
|
-
record.value.datas.splice(0, 0, JSON.stringify(recordData));
|
|
57
|
-
//数据只存20条,当大于20条时,删除最旧的一条
|
|
58
|
-
if (record.value.datas.length > record.value.maxStep) {
|
|
59
|
-
record.value.datas.splice(record.value.datas.length - 1, 1);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* 下一步
|
|
64
|
-
*/
|
|
65
|
-
const redo = () => {
|
|
66
|
-
//数据本身就是最新的
|
|
67
|
-
if (historyRecord.value.index < 0) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
historyRecord.value.index = historyRecord.value.index - 1;
|
|
71
|
-
reAndUnDo();
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const reAndUnDo = () => {
|
|
75
|
-
const record = unref(historyRecord);
|
|
76
|
-
if (!record.datas[record.index]) {
|
|
77
|
-
currentFormPreps.value = {};
|
|
78
|
-
currentItemType.value = "";
|
|
79
|
-
currentComp.value = {};
|
|
80
|
-
currentItemId.value = "";
|
|
81
|
-
parentCompType.value = "";
|
|
82
|
-
currentCompCategory.value = "";
|
|
83
|
-
compList.value = [];
|
|
84
|
-
} else {
|
|
85
|
-
const data = JSON.parse(record.datas[record.index]);
|
|
86
|
-
setCompList(data.complist);
|
|
87
|
-
currentCompCategory.value = data.currentCompCategory;
|
|
88
|
-
currentItemId.value = data.currentItemId;
|
|
89
|
-
parentCompType.value = data.parentCompType;
|
|
90
|
-
currentItemType.value = data.currentItemType;
|
|
91
|
-
currentFormPreps.value = data.currentFormPreps;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* 上一步
|
|
97
|
-
*/
|
|
98
|
-
const undo = () => {
|
|
99
|
-
const record = unref(historyRecord);
|
|
100
|
-
historyRecord.value.index = record.index < 0 ? 1 : record.index + 1;
|
|
101
|
-
//上一步大于已存在的数据量
|
|
102
|
-
if (historyRecord.value.index > record.datas.length) {
|
|
103
|
-
historyRecord.value.index = record.datas.length - 1;
|
|
104
|
-
}
|
|
105
|
-
//达到最大步骤,取允许的最大数据
|
|
106
|
-
if (historyRecord.value.index > record.maxStep) {
|
|
107
|
-
historyRecord.value.index = record.maxStep;
|
|
108
|
-
}
|
|
109
|
-
reAndUnDo();
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* 激活组件的数下
|
|
113
|
-
* @param data 数据
|
|
114
|
-
* @param itemType 数据类型
|
|
115
|
-
* @param parentType 父组件类型
|
|
116
|
-
*/
|
|
117
|
-
const selectItem = (data: any, itemType: string, parentType: string) => {
|
|
118
|
-
currentCompCategory.value = data.compType;
|
|
119
|
-
currentItemId.value = data?.id;
|
|
120
|
-
parentCompType.value = parentType;
|
|
121
|
-
currentComp.value = data;
|
|
122
|
-
currentItemType.value = itemType || data.itemType;
|
|
123
|
-
currentFormPreps.value = data.preps || data;
|
|
124
|
-
setIsDragging(false);
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* 刷新页面
|
|
128
|
-
*/
|
|
129
|
-
const setRefresh = () => {
|
|
130
|
-
refresh.value++;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* 选中子组件
|
|
134
|
-
* @param subItemId
|
|
135
|
-
*/
|
|
136
|
-
const setSubItemId = (subItemId: string) => {
|
|
137
|
-
currentSubItemId.value = subItemId;
|
|
138
|
-
};
|
|
139
|
-
const setCurrentSubTabName = (tabName: string) => {
|
|
140
|
-
currentSubTabName.value = tabName;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* 设置表单信息
|
|
144
|
-
* @param formData
|
|
145
|
-
*/
|
|
146
|
-
const setFormInfo = (formData: any) => {
|
|
147
|
-
formInfo.value = {
|
|
148
|
-
...unref(formInfo),
|
|
149
|
-
...formData,
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
const setCompList = (comps: Array<any>) => {
|
|
153
|
-
compList.value = comps;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* 通过组件Id查找数据
|
|
157
|
-
* @param itemId 组件Id
|
|
158
|
-
* @returns
|
|
159
|
-
*/
|
|
160
|
-
const selectItemById = (itemId: string) => {
|
|
161
|
-
if (compListNoLayer.value?.length == 0) {
|
|
162
|
-
loadCompNames();
|
|
163
|
-
}
|
|
164
|
-
return compListNoLayer.value?.find((item: any) => item.id == itemId);
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* 获取属性列表,
|
|
168
|
-
* 如果要使用compListNoLayer 必须先调用loadCompNames 方法
|
|
169
|
-
*/
|
|
170
|
-
const loadCompNames = () => {
|
|
171
|
-
const innerFunc = (datas: Array<any>, tabName?: string) => {
|
|
172
|
-
const selectList: Array<any> = [];
|
|
173
|
-
const compList: Array<any> = [];
|
|
174
|
-
for (const index in datas) {
|
|
175
|
-
const temp: any = datas[index];
|
|
176
|
-
if (temp.itemType == "box" || temp.itemType == "dytable") {
|
|
177
|
-
const elements = temp.preps.elements;
|
|
178
|
-
const children: SelectOption[] = [];
|
|
179
|
-
for (const sindex in elements) {
|
|
180
|
-
const columns = elements[sindex].columns;
|
|
181
|
-
for (const ssindex in columns) {
|
|
182
|
-
const column = columns[ssindex];
|
|
183
|
-
if (column.items && column.items.length > 0) {
|
|
184
|
-
children.push(
|
|
185
|
-
...column.items
|
|
186
|
-
?.map((item: any) => ({
|
|
187
|
-
name: item.preps?.label,
|
|
188
|
-
id: item.preps?.id,
|
|
189
|
-
compType: "item",
|
|
190
|
-
tabName,
|
|
191
|
-
type: item.preps?.itemType,
|
|
192
|
-
value: item.preps?.name,
|
|
193
|
-
}))
|
|
194
|
-
.filter((item: SelectOption) => item.name),
|
|
195
|
-
);
|
|
196
|
-
compList.push(...column.items);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
selectList.push({
|
|
201
|
-
name: temp.preps?.label ?? temp.preps?.itemNameLabel,
|
|
202
|
-
value: temp.preps?.name,
|
|
203
|
-
id: temp.preps?.id,
|
|
204
|
-
tabName,
|
|
205
|
-
type: temp.itemType,
|
|
206
|
-
compType: "container",
|
|
207
|
-
children: children,
|
|
208
|
-
});
|
|
209
|
-
} else if (temp.itemType == "table") {
|
|
210
|
-
const elements = temp.preps.elements;
|
|
211
|
-
const children: SelectOption[] = [];
|
|
212
|
-
for (const index in elements) {
|
|
213
|
-
const element = elements[index];
|
|
214
|
-
if (element.items?.length > 0) {
|
|
215
|
-
children.push(
|
|
216
|
-
...element.items
|
|
217
|
-
?.map((item: any) => ({
|
|
218
|
-
name: item.preps?.label,
|
|
219
|
-
id: item.preps?.id,
|
|
220
|
-
compType: "item",
|
|
221
|
-
tabName,
|
|
222
|
-
type: item.itemType ?? item.preps?.itemType,
|
|
223
|
-
value: item.preps?.name,
|
|
224
|
-
}))
|
|
225
|
-
.filter((item: SelectOption) => item.name),
|
|
226
|
-
);
|
|
227
|
-
compList.push(...element.items);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
selectList.push({
|
|
231
|
-
name: temp.preps?.label,
|
|
232
|
-
value: temp.preps?.batchFieldName,
|
|
233
|
-
tabName,
|
|
234
|
-
id: temp.id,
|
|
235
|
-
type: temp.itemType,
|
|
236
|
-
compType: "container",
|
|
237
|
-
children: children,
|
|
238
|
-
});
|
|
239
|
-
} else if (
|
|
240
|
-
temp.itemType == "tab" ||
|
|
241
|
-
temp.itemType == "collapse" ||
|
|
242
|
-
temp.itemType == "card"
|
|
243
|
-
) {
|
|
244
|
-
const elements = temp.preps?.elements;
|
|
245
|
-
for (const index in elements) {
|
|
246
|
-
const element = elements[index];
|
|
247
|
-
const tempTabName = tabName
|
|
248
|
-
? tabName + "__" + element.tabName
|
|
249
|
-
: tabName;
|
|
250
|
-
const subItems = innerFunc(element.items, tempTabName);
|
|
251
|
-
selectList.push({
|
|
252
|
-
name: element.label,
|
|
253
|
-
value: element.objectName,
|
|
254
|
-
tabName: tempTabName,
|
|
255
|
-
id: temp.id,
|
|
256
|
-
type: temp.itemType,
|
|
257
|
-
compType: "container",
|
|
258
|
-
children: subItems.selectList,
|
|
259
|
-
});
|
|
260
|
-
compList.push(...subItems.compList);
|
|
261
|
-
}
|
|
262
|
-
} else {
|
|
263
|
-
selectList.push({
|
|
264
|
-
name: temp.preps?.label,
|
|
265
|
-
value: temp.preps?.name,
|
|
266
|
-
tabName,
|
|
267
|
-
compType: "item",
|
|
268
|
-
id: temp.preps?.id,
|
|
269
|
-
type: temp.itemType ?? temp.preps?.itemType,
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
compList.push(temp);
|
|
273
|
-
}
|
|
274
|
-
return { selectList, compList };
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
const resultDatas = innerFunc(compList.value);
|
|
278
|
-
compListNoLayer.value = resultDatas.compList;
|
|
279
|
-
return resultDatas.selectList;
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* 手动添加组件
|
|
284
|
-
* @param comp
|
|
285
|
-
*/
|
|
286
|
-
const addComp = (comp: any) => {
|
|
287
|
-
//如果已存在,则要过滤掉,不能重复添加
|
|
288
|
-
if (Array.isArray(comp)) {
|
|
289
|
-
compList.value = [...compList.value, ...comp];
|
|
290
|
-
} else {
|
|
291
|
-
compList.value.push(comp);
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
const setFormData = (data: any) => {
|
|
295
|
-
formData.value = data;
|
|
296
|
-
};
|
|
297
|
-
const setIsEdit = (editFlag: boolean) => {
|
|
298
|
-
isEdit.value = editFlag;
|
|
299
|
-
};
|
|
300
|
-
const setCurrentComp = (currComp: object) => {
|
|
301
|
-
currentComp.value = currComp;
|
|
302
|
-
};
|
|
303
|
-
const setCurrentItemType = (currItemType: string) => {
|
|
304
|
-
currentItemType.value = currItemType;
|
|
305
|
-
};
|
|
306
|
-
const setParentCompType = (parentType: string) => {
|
|
307
|
-
parentCompType.value = parentType;
|
|
308
|
-
};
|
|
309
|
-
const setCurrentItemId = (currItemId: string) => {
|
|
310
|
-
currentItemId.value = currItemId;
|
|
311
|
-
};
|
|
312
|
-
const setCurrentFormPreps = (currFormPreps: any) => {
|
|
313
|
-
currentFormPreps.value = currFormPreps["preps"] || currFormPreps;
|
|
314
|
-
};
|
|
315
|
-
const setContainerList = (list: any) => {
|
|
316
|
-
containerList.value = list;
|
|
317
|
-
};
|
|
318
|
-
const setFormDataList = (list: any) => {
|
|
319
|
-
formDataList.value = list;
|
|
320
|
-
};
|
|
321
|
-
const setSelfFormDataList = (list: any) => {
|
|
322
|
-
selfFormDataList.value = list;
|
|
323
|
-
};
|
|
324
|
-
const setAllFormDataList = (list: any) => {
|
|
325
|
-
allFormDataList.value = list;
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* 正在拖动中的组件
|
|
329
|
-
* @param dragItem
|
|
330
|
-
*/
|
|
331
|
-
const setDraggingItem = (dragItem: any) => {
|
|
332
|
-
draggingItem.value = dragItem;
|
|
333
|
-
setIsDragging(true);
|
|
334
|
-
};
|
|
335
|
-
/**
|
|
336
|
-
* 设置是否正在拖动
|
|
337
|
-
*/
|
|
338
|
-
const setIsDragging = (flag: boolean) => {
|
|
339
|
-
isDragging.value = flag;
|
|
340
|
-
};
|
|
341
|
-
/**
|
|
342
|
-
* 删除数据
|
|
343
|
-
*/
|
|
344
|
-
const removePromise = () => {
|
|
345
|
-
const comps = unref(compList);
|
|
346
|
-
for (let i = 0; i < comps.length; i++) {
|
|
347
|
-
const temp = comps[i];
|
|
348
|
-
if (temp instanceof Promise) {
|
|
349
|
-
temp.then((res) => {
|
|
350
|
-
if (Array.isArray(res)) {
|
|
351
|
-
comps.splice(i, 1, ...res);
|
|
352
|
-
} else {
|
|
353
|
-
comps.splice(i, 1, res);
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
// compList = [...JSON.parse(JSON.stringify(comps))];
|
|
359
|
-
};
|
|
360
|
-
/**
|
|
361
|
-
* 清除所有数据
|
|
362
|
-
*/
|
|
363
|
-
const clearAll = (_initComp: boolean = true) => {
|
|
364
|
-
const ms = new Date().getTime();
|
|
365
|
-
isEdit.value = true;
|
|
366
|
-
isDragging.value = false;
|
|
367
|
-
currentFormPreps.value = {};
|
|
368
|
-
currentItemType.value = "";
|
|
369
|
-
currentComp.value = {};
|
|
370
|
-
currentItemId.value = "";
|
|
371
|
-
currentItemType.value = "";
|
|
372
|
-
parentCompType.value = "";
|
|
373
|
-
currentCompCategory.value = "";
|
|
374
|
-
formInfo.value = {
|
|
375
|
-
rules: "",
|
|
376
|
-
inline: "N",
|
|
377
|
-
labelPosition: "left",
|
|
378
|
-
labelWidth: "",
|
|
379
|
-
labelSuffix: "",
|
|
380
|
-
hideRequiredAsterisk: "N",
|
|
381
|
-
requireAsteriskPosition: "left",
|
|
382
|
-
showMessage: "Y",
|
|
383
|
-
inlineMessage: "N",
|
|
384
|
-
statusIcon: "N",
|
|
385
|
-
primaryKeyPolicy: "manual",
|
|
386
|
-
createTable: "Y",
|
|
387
|
-
validateOnRuleChange: "Y",
|
|
388
|
-
size: Config.compSize,
|
|
389
|
-
disabled: "N",
|
|
390
|
-
dataIndex: 1,
|
|
391
|
-
scrollToError: "N",
|
|
392
|
-
formId: "id" + ms,
|
|
393
|
-
tbName: "tb" + ms,
|
|
394
|
-
};
|
|
395
|
-
compList.value = [];
|
|
396
|
-
formData.value = { index: 1 };
|
|
397
|
-
historyRecord.value = {
|
|
398
|
-
index: -1,
|
|
399
|
-
maxStep: 20,
|
|
400
|
-
datas: [],
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
const setComponentVisible = (visible: boolean) => {
|
|
404
|
-
componentVisible.value = visible;
|
|
405
|
-
};
|
|
406
|
-
const setBatchEditFieldVisible = (visible: boolean) => {
|
|
407
|
-
batchEditFieldVisible.value = visible;
|
|
408
|
-
};
|
|
409
|
-
const setPreviewVisible = (visible: boolean) => {
|
|
410
|
-
previewVisible.value = visible;
|
|
411
|
-
};
|
|
412
|
-
const setShortKeyDisabled = (disabled: boolean) => {
|
|
413
|
-
shortKeyDisabled.value = disabled;
|
|
414
|
-
};
|
|
415
|
-
/**
|
|
416
|
-
* 获取字段索引
|
|
417
|
-
*/
|
|
418
|
-
const getFieldDataIndex = () => {
|
|
419
|
-
if (!formInfo.value["dataIndex"]) {
|
|
420
|
-
formInfo.value["dataIndex"] = 1;
|
|
421
|
-
}
|
|
422
|
-
return formInfo.value["dataIndex"]++;
|
|
423
|
-
};
|
|
424
|
-
return {
|
|
425
|
-
formData,
|
|
426
|
-
formInfo,
|
|
427
|
-
compList,
|
|
428
|
-
containerList,
|
|
429
|
-
formDataList,
|
|
430
|
-
selfFormDataList,
|
|
431
|
-
allFormDataList,
|
|
432
|
-
currentCompCategory,
|
|
433
|
-
currentItemId,
|
|
434
|
-
parentCompType,
|
|
435
|
-
currentItemType,
|
|
436
|
-
currentFormPreps,
|
|
437
|
-
currentSubItemId,
|
|
438
|
-
isEdit,
|
|
439
|
-
isDragging,
|
|
440
|
-
currentComp,
|
|
441
|
-
draggingItem,
|
|
442
|
-
refresh,
|
|
443
|
-
historyRecord,
|
|
444
|
-
componentVisible,
|
|
445
|
-
batchEditFieldVisible,
|
|
446
|
-
previewVisible,
|
|
447
|
-
shortKeyDisabled,
|
|
448
|
-
setCurrentSubTabName,
|
|
449
|
-
selectItemById,
|
|
450
|
-
setAllFormDataList,
|
|
451
|
-
setSelfFormDataList,
|
|
452
|
-
setFormDataList,
|
|
453
|
-
setContainerList,
|
|
454
|
-
addHistoryRecord,
|
|
455
|
-
redo,
|
|
456
|
-
undo,
|
|
457
|
-
selectItem,
|
|
458
|
-
setRefresh,
|
|
459
|
-
setSubItemId,
|
|
460
|
-
setFormInfo,
|
|
461
|
-
setCompList,
|
|
462
|
-
loadCompNames,
|
|
463
|
-
addComp,
|
|
464
|
-
setIsDragging,
|
|
465
|
-
setFormData,
|
|
466
|
-
setIsEdit,
|
|
467
|
-
setCurrentComp,
|
|
468
|
-
setCurrentItemType,
|
|
469
|
-
setParentCompType,
|
|
470
|
-
setCurrentItemId,
|
|
471
|
-
setCurrentFormPreps,
|
|
472
|
-
setDraggingItem,
|
|
473
|
-
removePromise,
|
|
474
|
-
clearAll,
|
|
475
|
-
setComponentVisible,
|
|
476
|
-
setBatchEditFieldVisible,
|
|
477
|
-
setPreviewVisible,
|
|
478
|
-
setShortKeyDisabled,
|
|
479
|
-
getFieldDataIndex,
|
|
480
|
-
};
|
|
481
|
-
});
|
package/src/store/DesignPage.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { defineStore } from "pinia";
|
|
2
|
-
import { ref } from "vue";
|
|
3
|
-
import { DynamicNode } from "@/components/types/DynamicNode";
|
|
4
|
-
|
|
5
|
-
export const useDesignPageStore = defineStore("designPage", () => {
|
|
6
|
-
const nodeList = ref<Array<DynamicNode>>([]);
|
|
7
|
-
const currentNode = ref<DynamicNode>(null);
|
|
8
|
-
const isEdit = ref<boolean>(false);
|
|
9
|
-
const defaultZindex = ref<number>(100);
|
|
10
|
-
/**
|
|
11
|
-
* 清除所有数据
|
|
12
|
-
*/
|
|
13
|
-
const clearAll = () => {
|
|
14
|
-
isEdit.value = false;
|
|
15
|
-
nodeList.value = [];
|
|
16
|
-
currentNode.value = null;
|
|
17
|
-
};
|
|
18
|
-
const removeNode = (id: string) => {
|
|
19
|
-
nodeList.value = nodeList.value.filter((node: DynamicNode) => {
|
|
20
|
-
return node.id != id;
|
|
21
|
-
});
|
|
22
|
-
currentNode.value = id == currentNode.value.id ? null : currentNode.value;
|
|
23
|
-
};
|
|
24
|
-
const setNodeList = (list: Array<DynamicNode>) => {
|
|
25
|
-
nodeList.value = list;
|
|
26
|
-
};
|
|
27
|
-
const addNode = (node: DynamicNode) => {
|
|
28
|
-
nodeList.value.push(node);
|
|
29
|
-
};
|
|
30
|
-
const selectNode = (node: DynamicNode) => {
|
|
31
|
-
currentNode.value = node;
|
|
32
|
-
};
|
|
33
|
-
const setIsEdit = (edit: boolean) => {
|
|
34
|
-
isEdit.value = edit;
|
|
35
|
-
};
|
|
36
|
-
const maxZIndex = () => {
|
|
37
|
-
nodeList.value.sort((a: DynamicNode, b: DynamicNode) => {
|
|
38
|
-
return (
|
|
39
|
-
(a.zIndex || defaultZindex.value) - (b.zIndex || defaultZindex.value)
|
|
40
|
-
);
|
|
41
|
-
});
|
|
42
|
-
return nodeList.value[0].zIndex || defaultZindex.value;
|
|
43
|
-
};
|
|
44
|
-
const init = () => {};
|
|
45
|
-
return {
|
|
46
|
-
nodeList,
|
|
47
|
-
currentNode,
|
|
48
|
-
isEdit,
|
|
49
|
-
defaultZindex,
|
|
50
|
-
setNodeList,
|
|
51
|
-
removeNode,
|
|
52
|
-
addNode,
|
|
53
|
-
selectNode,
|
|
54
|
-
clearAll,
|
|
55
|
-
setIsEdit,
|
|
56
|
-
maxZIndex,
|
|
57
|
-
init,
|
|
58
|
-
};
|
|
59
|
-
});
|