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.
Files changed (220) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/index.css +1 -1
  3. package/dist/index.es.js +491 -253
  4. package/package.json +1 -1
  5. package/.env.development +0 -3
  6. package/.env.production +0 -3
  7. package/.eslintrc-auto-import.json +0 -77
  8. package/.gitignore +0 -27
  9. package/.idea/.gitignore +0 -5
  10. package/.idea/MarsCodeWorkspaceAppSettings.xml +0 -6
  11. package/.idea/inspectionProfiles/Project_Default.xml +0 -7
  12. package/.idea/modules.xml +0 -8
  13. package/.idea/testcode.iml +0 -12
  14. package/.idea/vcs.xml +0 -6
  15. package/.idea/watcherTasks.xml +0 -4
  16. package/.idea/workspace.xml +0 -207
  17. package/.npmignore +0 -21
  18. package/.prettierignore +0 -26
  19. package/auto-imports.d.ts +0 -137
  20. package/components.d.ts +0 -189
  21. package/eslint.config.js +0 -37
  22. package/index.html +0 -14
  23. package/package-lock.json +0 -8276
  24. package/prettier.config.js +0 -20
  25. package/public/logo.svg +0 -660
  26. package/src/App.vue +0 -11
  27. package/src/api/date_utils.ts +0 -219
  28. package/src/api/finger_utils.ts +0 -71
  29. package/src/api/form_utils.ts +0 -281
  30. package/src/api/jquery.min.js +0 -2
  31. package/src/api/pcas-code.json +0 -1
  32. package/src/api/settings.ts +0 -81
  33. package/src/api/star_horse_apis.ts +0 -196
  34. package/src/api/star_horse_utils.ts +0 -797
  35. package/src/api/system.ts +0 -351
  36. package/src/api/user_func.ts +0 -147
  37. package/src/api/valid_utils.ts +0 -165
  38. package/src/assets/css/index.scss +0 -908
  39. package/src/assets/icons.css +0 -574
  40. package/src/assets/star-horse-icons.woff +0 -0
  41. package/src/components/comp/ShDynamicForm.vue +0 -160
  42. package/src/components/comp/ShForm.vue +0 -30
  43. package/src/components/comp/ShTableListColumn.vue +0 -61
  44. package/src/components/comp/StarHorseDataSelector.vue +0 -139
  45. package/src/components/comp/StarHorseDataView.vue +0 -110
  46. package/src/components/comp/StarHorseDataViewItems.vue +0 -61
  47. package/src/components/comp/StarHorseDataViewTable.vue +0 -102
  48. package/src/components/comp/StarHorseDialog.vue +0 -383
  49. package/src/components/comp/StarHorseDraggable.vue +0 -401
  50. package/src/components/comp/StarHorseForm.vue +0 -458
  51. package/src/components/comp/StarHorseFormItem.vue +0 -82
  52. package/src/components/comp/StarHorseFormList.vue +0 -516
  53. package/src/components/comp/StarHorseFormTable.vue +0 -56
  54. package/src/components/comp/StarHorseIcon.vue +0 -76
  55. package/src/components/comp/StarHorseItem.vue +0 -302
  56. package/src/components/comp/StarHorseJsonEditor.vue +0 -115
  57. package/src/components/comp/StarHorsePopover.vue +0 -66
  58. package/src/components/comp/StarHorseSearchComp.vue +0 -253
  59. package/src/components/comp/StarHorseStaticTable.vue +0 -395
  60. package/src/components/comp/StarHorseTableColumn.vue +0 -249
  61. package/src/components/comp/StarHorseTableComp.vue +0 -1193
  62. package/src/components/comp/StarHorseTableViewColumn.vue +0 -61
  63. package/src/components/comp/StarHorseTree.vue +0 -494
  64. package/src/components/comp/index.ts +0 -22
  65. package/src/components/comp/items/UTableColumn.vue +0 -65
  66. package/src/components/comp/items/boxItem.vue +0 -98
  67. package/src/components/comp/items/callitem.ts +0 -9
  68. package/src/components/comp/items/cardItem.vue +0 -152
  69. package/src/components/comp/items/collapseItem.vue +0 -134
  70. package/src/components/comp/items/dytableItem.vue +0 -135
  71. package/src/components/comp/items/otherItem.vue +0 -65
  72. package/src/components/comp/items/tabItem.vue +0 -155
  73. package/src/components/comp/items/tabPanelItem.vue +0 -110
  74. package/src/components/comp/items/tableColumn.vue +0 -129
  75. package/src/components/comp/items/tableItem.vue +0 -97
  76. package/src/components/comp/items/tablebtn.vue +0 -158
  77. package/src/components/comp/items/viewBoxItem.vue +0 -55
  78. package/src/components/comp/items/viewCardItem.vue +0 -47
  79. package/src/components/comp/items/viewCollapseItem.vue +0 -71
  80. package/src/components/comp/items/viewDytableItem.vue +0 -77
  81. package/src/components/comp/items/viewOtherItem.vue +0 -55
  82. package/src/components/comp/items/viewTabItem.vue +0 -77
  83. package/src/components/comp/items/viewTabPanelItem.vue +0 -54
  84. package/src/components/comp/items/viewTableItem.vue +0 -74
  85. package/src/components/comp/selfcomp.ts +0 -9
  86. package/src/components/comp/utils/DataPicker.vue +0 -302
  87. package/src/components/comp/utils/DataTag.vue +0 -51
  88. package/src/components/cron/Crontab-Day.vue +0 -230
  89. package/src/components/cron/Crontab-Hour.vue +0 -165
  90. package/src/components/cron/Crontab-Min.vue +0 -166
  91. package/src/components/cron/Crontab-Month.vue +0 -166
  92. package/src/components/cron/Crontab-Result.vue +0 -615
  93. package/src/components/cron/Crontab-Second.vue +0 -185
  94. package/src/components/cron/Crontab-Week.vue +0 -208
  95. package/src/components/cron/Crontab-Year.vue +0 -183
  96. package/src/components/cron/Crontab.vue +0 -474
  97. package/src/components/enums/ModuleEnums.ts +0 -10
  98. package/src/components/enums/ServiceEnums.ts +0 -18
  99. package/src/components/formcomp/container/box-container.vue +0 -162
  100. package/src/components/formcomp/container/callitem.ts +0 -9
  101. package/src/components/formcomp/container/card-container.vue +0 -170
  102. package/src/components/formcomp/container/collapse-container.vue +0 -133
  103. package/src/components/formcomp/container/dytable-col.vue +0 -448
  104. package/src/components/formcomp/container/dytable-container.vue +0 -57
  105. package/src/components/formcomp/container/dytableUtils.ts +0 -358
  106. package/src/components/formcomp/container/group-box-container.vue +0 -331
  107. package/src/components/formcomp/container/index.ts +0 -6
  108. package/src/components/formcomp/container/tab-container.vue +0 -153
  109. package/src/components/formcomp/container/table-container.vue +0 -249
  110. package/src/components/formcomp/items/allitem.ts +0 -9
  111. package/src/components/formcomp/items/area-item.vue +0 -116
  112. package/src/components/formcomp/items/audio-item.vue +0 -163
  113. package/src/components/formcomp/items/autocomplete-item.vue +0 -118
  114. package/src/components/formcomp/items/barcode-item.vue +0 -87
  115. package/src/components/formcomp/items/base-json-item.vue +0 -207
  116. package/src/components/formcomp/items/button-item.vue +0 -228
  117. package/src/components/formcomp/items/cascade-item.vue +0 -113
  118. package/src/components/formcomp/items/checkbox-item.vue +0 -97
  119. package/src/components/formcomp/items/color-item.vue +0 -70
  120. package/src/components/formcomp/items/cron-item.vue +0 -115
  121. package/src/components/formcomp/items/datetime-item.vue +0 -99
  122. package/src/components/formcomp/items/depart-item.vue +0 -51
  123. package/src/components/formcomp/items/dialog-input-item.vue +0 -207
  124. package/src/components/formcomp/items/divider-item.vue +0 -66
  125. package/src/components/formcomp/items/html-item.vue +0 -65
  126. package/src/components/formcomp/items/htmleditor-item.vue +0 -104
  127. package/src/components/formcomp/items/icon-item.vue +0 -195
  128. package/src/components/formcomp/items/image-item.vue +0 -247
  129. package/src/components/formcomp/items/index.ts +0 -44
  130. package/src/components/formcomp/items/input-item.vue +0 -150
  131. package/src/components/formcomp/items/json-array-item.vue +0 -67
  132. package/src/components/formcomp/items/json-item.vue +0 -66
  133. package/src/components/formcomp/items/markdown-item.vue +0 -77
  134. package/src/components/formcomp/items/number-item.vue +0 -94
  135. package/src/components/formcomp/items/number-range-item.vue +0 -278
  136. package/src/components/formcomp/items/page-select-item.vue +0 -407
  137. package/src/components/formcomp/items/password-item.vue +0 -71
  138. package/src/components/formcomp/items/qrcode-item.vue +0 -84
  139. package/src/components/formcomp/items/radio-item.vue +0 -112
  140. package/src/components/formcomp/items/rate-item.vue +0 -68
  141. package/src/components/formcomp/items/select-item.vue +0 -133
  142. package/src/components/formcomp/items/signature-item.vue +0 -216
  143. package/src/components/formcomp/items/slider-item.vue +0 -68
  144. package/src/components/formcomp/items/starhorse-form-item.vue +0 -334
  145. package/src/components/formcomp/items/switch-item.vue +0 -77
  146. package/src/components/formcomp/items/tag-item.vue +0 -77
  147. package/src/components/formcomp/items/text-item.vue +0 -75
  148. package/src/components/formcomp/items/textarea-item.vue +0 -85
  149. package/src/components/formcomp/items/time-item.vue +0 -77
  150. package/src/components/formcomp/items/time-picker-item.vue +0 -74
  151. package/src/components/formcomp/items/transfer-item.vue +0 -93
  152. package/src/components/formcomp/items/tselect-item.vue +0 -121
  153. package/src/components/formcomp/items/unknown-item.vue +0 -51
  154. package/src/components/formcomp/items/upload-item.vue +0 -189
  155. package/src/components/formcomp/items/user-item.vue +0 -177
  156. package/src/components/formcomp/items/usercomp-item.vue +0 -85
  157. package/src/components/formcomp/items/view-markdown-item.vue +0 -77
  158. package/src/components/formcomp/utils/EditDataDialog.vue +0 -67
  159. package/src/components/formcomp/utils/FieldList.vue +0 -125
  160. package/src/components/formcomp/utils/ItemRelationEventUtils.ts +0 -284
  161. package/src/components/help.vue +0 -31
  162. package/src/components/menu/MenuItem.vue +0 -95
  163. package/src/components/menu/SubMenu.vue +0 -68
  164. package/src/components/menu/SubSystemMenu.vue +0 -142
  165. package/src/components/register.ts +0 -24
  166. package/src/components/system/ContentMenu.vue +0 -260
  167. package/src/components/system/StarHorseButtonList.vue +0 -344
  168. package/src/components/system/StarHorseMenu.vue +0 -97
  169. package/src/components/system/StarHorseSvg.vue +0 -62
  170. package/src/components/system/SystemComp.ts +0 -9
  171. package/src/components/system/index.ts +0 -4
  172. package/src/components/types/ApiUrls.ts +0 -168
  173. package/src/components/types/BtnAction.ts +0 -51
  174. package/src/components/types/BtnAuth.ts +0 -43
  175. package/src/components/types/CompInfo.ts +0 -81
  176. package/src/components/types/DialogProps.ts +0 -55
  177. package/src/components/types/DyCompField.ts +0 -23
  178. package/src/components/types/DynamicNode.ts +0 -42
  179. package/src/components/types/MenusInfo.ts +0 -45
  180. package/src/components/types/PageFieldInfo.ts +0 -530
  181. package/src/components/types/PageProps.ts +0 -25
  182. package/src/components/types/Params.ts +0 -93
  183. package/src/components/types/RuleType.ts +0 -10
  184. package/src/components/types/SearchProps.ts +0 -42
  185. package/src/components/types/ShortKey.ts +0 -30
  186. package/src/components/types/StarHorseType.ts +0 -18
  187. package/src/components/types/index.ts +0 -15
  188. package/src/config/element.ts +0 -15
  189. package/src/config/styles.ts +0 -4
  190. package/src/index.ts +0 -98
  191. package/src/install.ts +0 -33
  192. package/src/lang/en_US.ts +0 -81
  193. package/src/lang/index.ts +0 -35
  194. package/src/lang/zh_CN.ts +0 -84
  195. package/src/main.ts +0 -57
  196. package/src/plugins/AblesPlugin.ts +0 -618
  197. package/src/plugins/registerCompPlugin.ts +0 -15
  198. package/src/sample/test.vue +0 -9
  199. package/src/store/ButtonPermission.ts +0 -101
  200. package/src/store/ConsumerView.ts +0 -52
  201. package/src/store/ContinusConfig.ts +0 -78
  202. package/src/store/CopyerOperation.ts +0 -74
  203. package/src/store/DesignForm.ts +0 -481
  204. package/src/store/DesignPage.ts +0 -59
  205. package/src/store/DynamicForm.ts +0 -241
  206. package/src/store/GlobalConfig.ts +0 -90
  207. package/src/store/SelfOperation.ts +0 -95
  208. package/src/store/UserInfo.ts +0 -88
  209. package/src/store/index.ts +0 -6
  210. package/src/theme/localStorge.ts +0 -16
  211. package/src/theme/theme.ts +0 -27
  212. package/src/utils/FieldOperationUtils.ts +0 -91
  213. package/src/utils/auth.ts +0 -83
  214. package/src/utils/message.ts +0 -69
  215. package/src/utils/preview.ts +0 -125
  216. package/tsconfig.json +0 -39
  217. package/tsconfig.node.json +0 -10
  218. package/vite-env.d.ts +0 -16
  219. package/vite.config.ts +0 -162
  220. package/yarn.lock +0 -4627
@@ -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
- });
@@ -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
- });