star-horse-lowcode 2.7.63 → 2.7.65

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 (221) hide show
  1. package/.env.development +3 -0
  2. package/.env.production +3 -0
  3. package/.eslintrc-auto-import.json +77 -0
  4. package/.gitignore +27 -0
  5. package/.idea/.gitignore +5 -0
  6. package/.idea/MarsCodeWorkspaceAppSettings.xml +6 -0
  7. package/.idea/inspectionProfiles/Project_Default.xml +7 -0
  8. package/.idea/modules.xml +8 -0
  9. package/.idea/testcode.iml +12 -0
  10. package/.idea/vcs.xml +6 -0
  11. package/.idea/watcherTasks.xml +4 -0
  12. package/.idea/workspace.xml +207 -0
  13. package/.npmignore +21 -0
  14. package/.prettierignore +26 -0
  15. package/README.md +1 -0
  16. package/auto-imports.d.ts +137 -0
  17. package/components.d.ts +189 -0
  18. package/dist/assets/index.css +1 -1
  19. package/dist/index.es.js +19 -19
  20. package/dist/types/index.d.ts +7 -7
  21. package/eslint.config.js +37 -0
  22. package/index.html +14 -0
  23. package/package-lock.json +8276 -0
  24. package/package.json +4 -4
  25. package/prettier.config.js +20 -0
  26. package/public/logo.svg +660 -0
  27. package/src/App.vue +11 -0
  28. package/src/api/date_utils.ts +219 -0
  29. package/src/api/finger_utils.ts +71 -0
  30. package/src/api/form_utils.ts +281 -0
  31. package/src/api/jquery.min.js +2 -0
  32. package/src/api/pcas-code.json +1 -0
  33. package/src/api/settings.ts +81 -0
  34. package/src/api/star_horse_apis.ts +196 -0
  35. package/src/api/star_horse_utils.ts +797 -0
  36. package/src/api/system.ts +351 -0
  37. package/src/api/user_func.ts +147 -0
  38. package/src/api/valid_utils.ts +165 -0
  39. package/src/assets/css/index.scss +908 -0
  40. package/src/assets/icons.css +574 -0
  41. package/src/assets/star-horse-icons.woff +0 -0
  42. package/src/components/comp/ShDynamicForm.vue +160 -0
  43. package/src/components/comp/ShForm.vue +30 -0
  44. package/src/components/comp/ShTableListColumn.vue +61 -0
  45. package/src/components/comp/StarHorseDataSelector.vue +139 -0
  46. package/src/components/comp/StarHorseDataView.vue +110 -0
  47. package/src/components/comp/StarHorseDataViewItems.vue +61 -0
  48. package/src/components/comp/StarHorseDataViewTable.vue +102 -0
  49. package/src/components/comp/StarHorseDialog.vue +383 -0
  50. package/src/components/comp/StarHorseDraggable.vue +401 -0
  51. package/src/components/comp/StarHorseForm.vue +458 -0
  52. package/src/components/comp/StarHorseFormItem.vue +82 -0
  53. package/src/components/comp/StarHorseFormList.vue +516 -0
  54. package/src/components/comp/StarHorseFormTable.vue +56 -0
  55. package/src/components/comp/StarHorseIcon.vue +76 -0
  56. package/src/components/comp/StarHorseItem.vue +302 -0
  57. package/src/components/comp/StarHorseJsonEditor.vue +115 -0
  58. package/src/components/comp/StarHorsePopover.vue +66 -0
  59. package/src/components/comp/StarHorseSearchComp.vue +253 -0
  60. package/src/components/comp/StarHorseStaticTable.vue +395 -0
  61. package/src/components/comp/StarHorseTableColumn.vue +249 -0
  62. package/src/components/comp/StarHorseTableComp.vue +1193 -0
  63. package/src/components/comp/StarHorseTableViewColumn.vue +61 -0
  64. package/src/components/comp/StarHorseTree.vue +494 -0
  65. package/src/components/comp/index.ts +22 -0
  66. package/src/components/comp/items/UTableColumn.vue +65 -0
  67. package/src/components/comp/items/boxItem.vue +98 -0
  68. package/src/components/comp/items/callitem.ts +9 -0
  69. package/src/components/comp/items/cardItem.vue +152 -0
  70. package/src/components/comp/items/collapseItem.vue +134 -0
  71. package/src/components/comp/items/dytableItem.vue +135 -0
  72. package/src/components/comp/items/otherItem.vue +65 -0
  73. package/src/components/comp/items/tabItem.vue +155 -0
  74. package/src/components/comp/items/tabPanelItem.vue +110 -0
  75. package/src/components/comp/items/tableColumn.vue +129 -0
  76. package/src/components/comp/items/tableItem.vue +97 -0
  77. package/src/components/comp/items/tablebtn.vue +158 -0
  78. package/src/components/comp/items/viewBoxItem.vue +55 -0
  79. package/src/components/comp/items/viewCardItem.vue +47 -0
  80. package/src/components/comp/items/viewCollapseItem.vue +71 -0
  81. package/src/components/comp/items/viewDytableItem.vue +77 -0
  82. package/src/components/comp/items/viewOtherItem.vue +55 -0
  83. package/src/components/comp/items/viewTabItem.vue +77 -0
  84. package/src/components/comp/items/viewTabPanelItem.vue +54 -0
  85. package/src/components/comp/items/viewTableItem.vue +74 -0
  86. package/src/components/comp/selfcomp.ts +9 -0
  87. package/src/components/comp/utils/DataPicker.vue +302 -0
  88. package/src/components/comp/utils/DataTag.vue +51 -0
  89. package/src/components/cron/Crontab-Day.vue +230 -0
  90. package/src/components/cron/Crontab-Hour.vue +165 -0
  91. package/src/components/cron/Crontab-Min.vue +166 -0
  92. package/src/components/cron/Crontab-Month.vue +166 -0
  93. package/src/components/cron/Crontab-Result.vue +615 -0
  94. package/src/components/cron/Crontab-Second.vue +185 -0
  95. package/src/components/cron/Crontab-Week.vue +208 -0
  96. package/src/components/cron/Crontab-Year.vue +183 -0
  97. package/src/components/cron/Crontab.vue +474 -0
  98. package/src/components/enums/ModuleEnums.ts +10 -0
  99. package/src/components/enums/ServiceEnums.ts +18 -0
  100. package/src/components/formcomp/container/box-container.vue +162 -0
  101. package/src/components/formcomp/container/callitem.ts +9 -0
  102. package/src/components/formcomp/container/card-container.vue +170 -0
  103. package/src/components/formcomp/container/collapse-container.vue +133 -0
  104. package/src/components/formcomp/container/dytable-col.vue +448 -0
  105. package/src/components/formcomp/container/dytable-container.vue +57 -0
  106. package/src/components/formcomp/container/dytableUtils.ts +358 -0
  107. package/src/components/formcomp/container/group-box-container.vue +331 -0
  108. package/src/components/formcomp/container/index.ts +6 -0
  109. package/src/components/formcomp/container/tab-container.vue +153 -0
  110. package/src/components/formcomp/container/table-container.vue +249 -0
  111. package/src/components/formcomp/items/allitem.ts +9 -0
  112. package/src/components/formcomp/items/area-item.vue +116 -0
  113. package/src/components/formcomp/items/audio-item.vue +163 -0
  114. package/src/components/formcomp/items/autocomplete-item.vue +118 -0
  115. package/src/components/formcomp/items/barcode-item.vue +87 -0
  116. package/src/components/formcomp/items/base-json-item.vue +207 -0
  117. package/src/components/formcomp/items/button-item.vue +228 -0
  118. package/src/components/formcomp/items/cascade-item.vue +113 -0
  119. package/src/components/formcomp/items/checkbox-item.vue +97 -0
  120. package/src/components/formcomp/items/color-item.vue +70 -0
  121. package/src/components/formcomp/items/cron-item.vue +115 -0
  122. package/src/components/formcomp/items/datetime-item.vue +99 -0
  123. package/src/components/formcomp/items/depart-item.vue +51 -0
  124. package/src/components/formcomp/items/dialog-input-item.vue +207 -0
  125. package/src/components/formcomp/items/divider-item.vue +66 -0
  126. package/src/components/formcomp/items/html-item.vue +65 -0
  127. package/src/components/formcomp/items/htmleditor-item.vue +104 -0
  128. package/src/components/formcomp/items/icon-item.vue +195 -0
  129. package/src/components/formcomp/items/image-item.vue +247 -0
  130. package/src/components/formcomp/items/index.ts +44 -0
  131. package/src/components/formcomp/items/input-item.vue +150 -0
  132. package/src/components/formcomp/items/json-array-item.vue +67 -0
  133. package/src/components/formcomp/items/json-item.vue +66 -0
  134. package/src/components/formcomp/items/markdown-item.vue +77 -0
  135. package/src/components/formcomp/items/number-item.vue +94 -0
  136. package/src/components/formcomp/items/number-range-item.vue +278 -0
  137. package/src/components/formcomp/items/page-select-item.vue +407 -0
  138. package/src/components/formcomp/items/password-item.vue +71 -0
  139. package/src/components/formcomp/items/qrcode-item.vue +84 -0
  140. package/src/components/formcomp/items/radio-item.vue +112 -0
  141. package/src/components/formcomp/items/rate-item.vue +68 -0
  142. package/src/components/formcomp/items/select-item.vue +133 -0
  143. package/src/components/formcomp/items/signature-item.vue +216 -0
  144. package/src/components/formcomp/items/slider-item.vue +68 -0
  145. package/src/components/formcomp/items/starhorse-form-item.vue +334 -0
  146. package/src/components/formcomp/items/switch-item.vue +77 -0
  147. package/src/components/formcomp/items/tag-item.vue +77 -0
  148. package/src/components/formcomp/items/text-item.vue +75 -0
  149. package/src/components/formcomp/items/textarea-item.vue +85 -0
  150. package/src/components/formcomp/items/time-item.vue +77 -0
  151. package/src/components/formcomp/items/time-picker-item.vue +74 -0
  152. package/src/components/formcomp/items/transfer-item.vue +93 -0
  153. package/src/components/formcomp/items/tselect-item.vue +121 -0
  154. package/src/components/formcomp/items/unknown-item.vue +51 -0
  155. package/src/components/formcomp/items/upload-item.vue +189 -0
  156. package/src/components/formcomp/items/user-item.vue +177 -0
  157. package/src/components/formcomp/items/usercomp-item.vue +85 -0
  158. package/src/components/formcomp/items/view-markdown-item.vue +77 -0
  159. package/src/components/formcomp/utils/EditDataDialog.vue +67 -0
  160. package/src/components/formcomp/utils/FieldList.vue +125 -0
  161. package/src/components/formcomp/utils/ItemRelationEventUtils.ts +284 -0
  162. package/src/components/help.vue +31 -0
  163. package/src/components/menu/MenuItem.vue +95 -0
  164. package/src/components/menu/SubMenu.vue +68 -0
  165. package/src/components/menu/SubSystemMenu.vue +142 -0
  166. package/src/components/register.ts +24 -0
  167. package/src/components/system/ContentMenu.vue +260 -0
  168. package/src/components/system/StarHorseButtonList.vue +344 -0
  169. package/src/components/system/StarHorseMenu.vue +97 -0
  170. package/src/components/system/StarHorseSvg.vue +62 -0
  171. package/src/components/system/SystemComp.ts +9 -0
  172. package/src/components/system/index.ts +4 -0
  173. package/src/components/types/ApiUrls.ts +168 -0
  174. package/src/components/types/BtnAction.ts +51 -0
  175. package/src/components/types/BtnAuth.ts +43 -0
  176. package/src/components/types/CompInfo.ts +81 -0
  177. package/src/components/types/DialogProps.ts +55 -0
  178. package/src/components/types/DyCompField.ts +23 -0
  179. package/src/components/types/DynamicNode.ts +42 -0
  180. package/src/components/types/MenusInfo.ts +45 -0
  181. package/src/components/types/PageFieldInfo.ts +530 -0
  182. package/src/components/types/PageProps.ts +25 -0
  183. package/src/components/types/Params.ts +93 -0
  184. package/src/components/types/RuleType.ts +10 -0
  185. package/src/components/types/SearchProps.ts +42 -0
  186. package/src/components/types/ShortKey.ts +30 -0
  187. package/src/components/types/StarHorseType.ts +18 -0
  188. package/src/components/types/index.ts +15 -0
  189. package/src/config/element.ts +15 -0
  190. package/src/config/styles.ts +4 -0
  191. package/src/index.ts +98 -0
  192. package/src/install.ts +33 -0
  193. package/src/lang/en_US.ts +81 -0
  194. package/src/lang/index.ts +35 -0
  195. package/src/lang/zh_CN.ts +84 -0
  196. package/src/main.ts +57 -0
  197. package/src/plugins/AblesPlugin.ts +618 -0
  198. package/src/plugins/registerCompPlugin.ts +15 -0
  199. package/src/sample/test.vue +9 -0
  200. package/src/store/ButtonPermission.ts +101 -0
  201. package/src/store/ConsumerView.ts +52 -0
  202. package/src/store/ContinusConfig.ts +78 -0
  203. package/src/store/CopyerOperation.ts +74 -0
  204. package/src/store/DesignForm.ts +481 -0
  205. package/src/store/DesignPage.ts +59 -0
  206. package/src/store/DynamicForm.ts +241 -0
  207. package/src/store/GlobalConfig.ts +90 -0
  208. package/src/store/SelfOperation.ts +95 -0
  209. package/src/store/UserInfo.ts +88 -0
  210. package/src/store/index.ts +6 -0
  211. package/src/theme/localStorge.ts +16 -0
  212. package/src/theme/theme.ts +27 -0
  213. package/src/utils/FieldOperationUtils.ts +91 -0
  214. package/src/utils/auth.ts +83 -0
  215. package/src/utils/message.ts +69 -0
  216. package/src/utils/preview.ts +125 -0
  217. package/tsconfig.json +39 -0
  218. package/tsconfig.node.json +10 -0
  219. package/vite-env.d.ts +16 -0
  220. package/vite.config.ts +162 -0
  221. package/yarn.lock +4627 -0
@@ -0,0 +1,474 @@
1
+ <script setup lang="ts">
2
+ import { nextTick, onMounted, ref, watch } from "vue";
3
+ import CrontabSecond from "@/components/cron/Crontab-Second.vue";
4
+ import CrontabMin from "@/components/cron/Crontab-Min.vue";
5
+ import CrontabHour from "@/components/cron/Crontab-Hour.vue";
6
+ import CrontabDay from "@/components/cron/Crontab-Day.vue";
7
+ import Crontabmonth from "@/components/cron/Crontab-Month.vue";
8
+ import CrontabWeek from "@/components/cron/Crontab-Week.vue";
9
+ import CrontabYear from "@/components/cron/Crontab-Year.vue";
10
+ import { useVModel } from "@vueuse/core";
11
+ import { copyText } from "@/api/system";
12
+
13
+ defineOptions({
14
+ name: "Crontab",
15
+ });
16
+
17
+ export interface Crontab {
18
+ expression?: string;
19
+ modelValue: string;
20
+ hideComponent?: any;
21
+ }
22
+
23
+ const props = withDefaults(defineProps<Crontab>(), {});
24
+ const emits = defineEmits(["update:modelValue"]);
25
+ let dataValue = useVModel(props, "modelValue", emits);
26
+ let tabTitles = ref<Array<string>>([
27
+ "秒",
28
+ "分钟",
29
+ "小时",
30
+ "日",
31
+ "月",
32
+ "周",
33
+ "年",
34
+ ]);
35
+ let tabActive = ref<string>("0");
36
+ const cronsecond = ref();
37
+ const cronmin = ref();
38
+ const cronhour = ref();
39
+ const cronday = ref();
40
+ const cronmonth = ref();
41
+ const cronweek = ref();
42
+ const cronyear = ref();
43
+ const prototypeCron = ["0 0 0 0 0 *", "* * * * * ? *", "* * * * * ?"];
44
+ let contabValueObj = ref<any>({
45
+ second: "*",
46
+ min: "*",
47
+ hour: "*",
48
+ day: "*",
49
+ month: "*",
50
+ week: "?",
51
+ year: "",
52
+ });
53
+ let contabValueString = ref<string>("");
54
+ const contabValueStringFun = () => {
55
+ let obj = contabValueObj.value;
56
+ let val =
57
+ obj.second +
58
+ " " +
59
+ obj.min +
60
+ " " +
61
+ obj.hour +
62
+ " " +
63
+ obj.day +
64
+ " " +
65
+ obj.month +
66
+ " " +
67
+ obj.week +
68
+ (obj.year == "" ? "" : " " + obj.year);
69
+ contabValueString.value = val;
70
+ if (!prototypeCron.includes(val)) {
71
+ emits("update:modelValue", val);
72
+ }
73
+ };
74
+ const shouldHide = (key: any) => {
75
+ return !(props.hideComponent && props.hideComponent.includes(key));
76
+ };
77
+ const resolveExp = () => {
78
+ //反解析 表达式
79
+ if (dataValue.value) {
80
+ let arr = dataValue.value.split(" ");
81
+ // debugger;
82
+ if (arr.length >= 6) {
83
+ //6 位以上是合法表达式
84
+ let obj: any = {
85
+ second: arr[0],
86
+ min: arr[1],
87
+ hour: arr[2],
88
+ day: arr[3],
89
+ month: arr[4],
90
+ week: arr[5],
91
+ year: arr[6] ? arr[6] : "",
92
+ };
93
+
94
+ contabValueObj.value = obj;
95
+ for (let i in obj) {
96
+ if (obj[i]) {
97
+ changeRadio(i, obj[i]);
98
+ }
99
+ }
100
+ }
101
+ } else {
102
+ //没有传入的表达式 则还原
103
+ clearCron();
104
+ }
105
+ };
106
+
107
+ // 由子组件触发,更改表达式组成的字段值
108
+ const updateContabValue = (name: string, value: any, from: any) => {
109
+ contabValueObj.value[name] = value;
110
+ if (from && from !== name) {
111
+ changeRadio(name, value);
112
+ }
113
+ };
114
+ const getRefObj = (name: string) => {
115
+ if (name == "cronsecond") {
116
+ return cronsecond;
117
+ } else if (name == "cronmin") {
118
+ return cronmin;
119
+ } else if (name == "cronhour") {
120
+ return cronhour;
121
+ } else if (name == "cronday") {
122
+ return cronday;
123
+ } else if (name == "cronmonth") {
124
+ return cronmonth;
125
+ } else if (name == "cronweek") {
126
+ return cronweek;
127
+ } else {
128
+ return cronyear;
129
+ }
130
+ };
131
+
132
+ const parseCheckList = (refObj: any, value: string) => {
133
+ let numStrs = value?.split(",");
134
+ if (numStrs?.length > 0) {
135
+ let arr = [];
136
+ for (let i = 0; i < numStrs.length; i++) {
137
+ arr.push(parseInt(numStrs[i]));
138
+ }
139
+ refObj.value.checkboxList = arr;
140
+ } else {
141
+ refObj.value.checkboxList = [];
142
+ }
143
+ };
144
+ //赋值到组件
145
+ const changeRadio = async (name: string, value: string) => {
146
+ let arr = ["second", "min", "hour", "month"],
147
+ refName = "cron" + name,
148
+ insValue;
149
+ let refObj = getRefObj(refName);
150
+ await nextTick();
151
+ if (arr.includes(name)) {
152
+ if (value === "*") {
153
+ insValue = 1;
154
+ } else if (value.indexOf("-") > -1) {
155
+ let indexArr: Array<any> = value.split("-");
156
+ isNaN(indexArr[0])
157
+ ? (refObj.value.cycle01 = 0)
158
+ : (refObj.value.cycle01 = indexArr[0]);
159
+ refObj.value.cycle02 = indexArr[1];
160
+ insValue = 2;
161
+ } else if (value.indexOf("/") > -1) {
162
+ let indexArr: Array<any> = value.split("/");
163
+ isNaN(indexArr[0])
164
+ ? (refObj.value.average01 = 0)
165
+ : (refObj.value.average01 = indexArr[0]);
166
+ refObj.value.average02 = indexArr[1];
167
+ insValue = 3;
168
+ } else {
169
+ if (name == "month" && value == "0") {
170
+ insValue = 1;
171
+ } else {
172
+ insValue = 4;
173
+ parseCheckList(refObj, value);
174
+ }
175
+ }
176
+ } else if (name == "day") {
177
+ if (value === "*") {
178
+ insValue = 1;
179
+ } else if (value == "?") {
180
+ insValue = 2;
181
+ } else if (value.indexOf("-") > -1) {
182
+ let indexArr: Array<any> = value.split("-");
183
+ isNaN(indexArr[0])
184
+ ? (refObj.value.cycle01 = 0)
185
+ : (refObj.value.cycle01 = parseInt(indexArr[0]));
186
+ refObj.value.cycle02 = parseInt(indexArr[1]);
187
+ insValue = 3;
188
+ } else if (value.indexOf("/") > -1) {
189
+ let indexArr: Array<any> = value.split("/");
190
+ isNaN(indexArr[0])
191
+ ? (refObj.value.average01 = 0)
192
+ : (refObj.value.average01 = parseInt(indexArr[0]));
193
+ refObj.value.average02 = parseInt(indexArr[1]);
194
+ insValue = 4;
195
+ } else if (value.indexOf("W") > -1) {
196
+ let indexArr: Array<any> = value.split("W");
197
+ isNaN(indexArr[0])
198
+ ? (refObj.value.workday = 0)
199
+ : (refObj.value.workday = parseInt(indexArr[0]));
200
+ insValue = 5;
201
+ } else if (value === "L") {
202
+ insValue = 6;
203
+ } else {
204
+ insValue = 7;
205
+ parseCheckList(refObj, value);
206
+ }
207
+ } else if (name == "week") {
208
+ if (value === "*") {
209
+ insValue = 1;
210
+ } else if (value == "?") {
211
+ insValue = 2;
212
+ } else if (value.indexOf("-") > -1) {
213
+ let indexArr: Array<any> = value.split("-");
214
+ isNaN(indexArr[0])
215
+ ? (refObj.value.cycle01 = 0)
216
+ : (refObj.value.cycle01 = parseInt(indexArr[0]));
217
+ refObj.value.cycle02 = parseInt(indexArr[1]);
218
+ insValue = 3;
219
+ } else if (value.indexOf("#") > -1) {
220
+ let indexArr: Array<any> = value.split("#");
221
+ isNaN(indexArr[0])
222
+ ? (refObj.value.average01 = 1)
223
+ : (refObj.value.average01 = parseInt(indexArr[0]));
224
+ refObj.value.average02 = parseInt(indexArr[1]);
225
+ insValue = 4;
226
+ } else if (value.indexOf("L") > -1) {
227
+ let indexArr: Array<any> = value.split("L");
228
+ isNaN(indexArr[0])
229
+ ? (refObj.value.weekday = 1)
230
+ : (refObj.value.weekday = parseInt(indexArr[0]));
231
+ insValue = 5;
232
+ } else {
233
+ insValue = 7;
234
+ parseCheckList(refObj, value);
235
+ }
236
+ } else if (name == "year") {
237
+ if (value == "") {
238
+ insValue = 1;
239
+ } else if (value == "*") {
240
+ insValue = 2;
241
+ } else if (value.indexOf("-") > -1) {
242
+ insValue = 3;
243
+ } else if (value.indexOf("/") > -1) {
244
+ insValue = 4;
245
+ } else {
246
+ insValue = 5;
247
+ parseCheckList(refObj, value);
248
+ }
249
+ }
250
+ refObj.value.radioValue = insValue;
251
+ };
252
+ // 表单选项的子组件校验数字格式(通过-props传递)
253
+ const checkNumber = (value: number, minLimit: number, maxLimit: number) => {
254
+ //检查必须为整数
255
+ value = Math.floor(value);
256
+ if (value < minLimit) {
257
+ value = minLimit;
258
+ } else if (value > maxLimit) {
259
+ value = maxLimit;
260
+ }
261
+ return value;
262
+ };
263
+
264
+ const clearCron = () => {
265
+ // 还原选择项
266
+ contabValueObj.value = {
267
+ second: "*",
268
+ min: "*",
269
+ hour: "*",
270
+ day: "*",
271
+ month: "*",
272
+ week: "?",
273
+ year: "",
274
+ };
275
+ for (let j in contabValueObj.value) {
276
+ changeRadio(j, contabValueObj.value[j]);
277
+ }
278
+ };
279
+ onMounted(() => {
280
+ resolveExp();
281
+ });
282
+ watch(
283
+ () => contabValueObj.value,
284
+ () => {
285
+ contabValueStringFun();
286
+ },
287
+ { immediate: false, deep: true },
288
+ );
289
+ defineExpose({
290
+ clearCron,
291
+ resolveExp,
292
+ });
293
+ </script>
294
+ <template>
295
+ <div class="flex flex-col h-full">
296
+ <div class="flex-grow-1 flex-1 overflow-auto min-h-0">
297
+ <el-tabs type="border-card" v-model="tabActive">
298
+ <el-tab-pane label="秒" name="0" v-if="shouldHide('second')">
299
+ <CrontabSecond
300
+ @update="updateContabValue"
301
+ :cron="contabValueObj"
302
+ :check="checkNumber"
303
+ ref="cronsecond"
304
+ />
305
+ </el-tab-pane>
306
+ <el-tab-pane label="分钟" name="1" v-if="shouldHide('min')">
307
+ <CrontabMin
308
+ @update="updateContabValue"
309
+ :check="checkNumber"
310
+ :cron="contabValueObj"
311
+ ref="cronmin"
312
+ />
313
+ </el-tab-pane>
314
+ <el-tab-pane label="小时" name="2" v-if="shouldHide('hour')">
315
+ <CrontabHour
316
+ @update="updateContabValue"
317
+ :check="checkNumber"
318
+ :cron="contabValueObj"
319
+ ref="cronhour"
320
+ />
321
+ </el-tab-pane>
322
+ <el-tab-pane label="日" name="3" v-if="shouldHide('day')">
323
+ <CrontabDay
324
+ @update="updateContabValue"
325
+ :check="checkNumber"
326
+ :cron="contabValueObj"
327
+ ref="cronday"
328
+ />
329
+ </el-tab-pane>
330
+ <el-tab-pane label="月" name="4" v-if="shouldHide('month')">
331
+ <Crontabmonth
332
+ @update="updateContabValue"
333
+ :check="checkNumber"
334
+ :cron="contabValueObj"
335
+ ref="cronmonth"
336
+ />
337
+ </el-tab-pane>
338
+ <el-tab-pane label="周" name="5" v-if="shouldHide('week')">
339
+ <CrontabWeek
340
+ @update="updateContabValue"
341
+ :check="checkNumber"
342
+ :cron="contabValueObj"
343
+ ref="cronweek"
344
+ />
345
+ </el-tab-pane>
346
+ <el-tab-pane label="年" name="6" v-if="shouldHide('year')">
347
+ <CrontabYear
348
+ @update="updateContabValue"
349
+ :check="checkNumber"
350
+ :cron="contabValueObj"
351
+ ref="cronyear"
352
+ />
353
+ </el-tab-pane>
354
+ </el-tabs>
355
+ </div>
356
+ <div class="popup-main">
357
+ <div class="popup-result">
358
+ <p class="title">时间表达式</p>
359
+ <table>
360
+ <thead>
361
+ <tr>
362
+ <th v-for="item of tabTitles" width="40" :key="item">
363
+ {{ item }}
364
+ </th>
365
+ <th>crontab完整表达式</th>
366
+ </tr>
367
+ </thead>
368
+ <tbody>
369
+ <tr>
370
+ <td>
371
+ <el-tag>{{ contabValueObj.second }}</el-tag>
372
+ </td>
373
+ <td>
374
+ <el-tag>{{ contabValueObj.min }}</el-tag>
375
+ </td>
376
+ <td>
377
+ <el-tag>{{ contabValueObj.hour }}</el-tag>
378
+ </td>
379
+ <td>
380
+ <el-tag>{{ contabValueObj.day }}</el-tag>
381
+ </td>
382
+ <td>
383
+ <el-tag>{{ contabValueObj.month }}</el-tag>
384
+ </td>
385
+ <td>
386
+ <el-tag>{{ contabValueObj.week }}</el-tag>
387
+ </td>
388
+ <td>
389
+ <el-tag>{{ contabValueObj.year }}</el-tag>
390
+ </td>
391
+ <td>
392
+ <el-tag
393
+ style="cursor: pointer"
394
+ @click="copyText(contabValueString)"
395
+ >{{ contabValueString }}</el-tag
396
+ >
397
+ </td>
398
+ </tr>
399
+ </tbody>
400
+ </table>
401
+ </div>
402
+ <CrontabResult :ex="contabValueString" />
403
+ </div>
404
+ </div>
405
+ </template>
406
+ <style lang="scss" scoped>
407
+ :deep {
408
+ .el-tabs__content {
409
+ padding: 5px !important;
410
+ height: 100%;
411
+ }
412
+
413
+ .el-tab-pane {
414
+ height: 100%; /* 显式设置tab面板高度为100% */
415
+ display: flex; /* 配合flex布局撑满空间 */
416
+ flex-direction: column;
417
+ }
418
+ }
419
+
420
+ :deep(.el-form-item__content) {
421
+ display: flex;
422
+ align-items: center;
423
+ justify-content: space-between;
424
+ flex-direction: row;
425
+ }
426
+
427
+ .popup-main {
428
+ background: #fff;
429
+ width: 100%;
430
+ font-size: 12px;
431
+ overflow: hidden;
432
+ display: flex;
433
+ flex-direction: column;
434
+
435
+ .popup-result {
436
+ box-sizing: border-box;
437
+ margin: 5px auto;
438
+ line-height: 24px;
439
+ width: 100%;
440
+ border: 1px solid #ccc;
441
+ font-size: 14px;
442
+
443
+ .title {
444
+ display: flex;
445
+ width: 100%;
446
+ justify-content: center;
447
+ align-items: center;
448
+ flex-direction: row;
449
+ overflow: hidden;
450
+ line-height: 34px;
451
+ background: #f2f2f2;
452
+ }
453
+
454
+ table {
455
+ text-align: center;
456
+ width: 100%;
457
+ margin: 0 auto;
458
+ border-spacing: 5px; /* 新增:控制单元格间距(上下左右) */
459
+ border-collapse: separate; /* 必须设置,否则border-spacing无效 */
460
+
461
+ span {
462
+ display: block;
463
+ width: 100%;
464
+ line-height: 30px;
465
+ height: 30px;
466
+ font-size: 12px;
467
+ white-space: nowrap;
468
+ overflow: hidden;
469
+ border: 1px solid #e8e8e8;
470
+ }
471
+ }
472
+ }
473
+ }
474
+ </style>
@@ -0,0 +1,10 @@
1
+ export enum ModuleEnums {
2
+ /**
3
+ * 动态表单
4
+ */
5
+ DYNAMIC_FORM = "dynamic-form",
6
+ /**
7
+ * 动态页面
8
+ */
9
+ DYNAMIC_PAGE = "dynamic-page",
10
+ }
@@ -0,0 +1,18 @@
1
+ export enum ServiceEnums {
2
+ /**
3
+ * 系统服务
4
+ */
5
+ SYSTEM_SERVICE = "system-config",
6
+ /**
7
+ * 数据库服务
8
+ */
9
+ DBUSER_SERVICE = "dbuser-manage",
10
+ /**
11
+ * 公共接口前缀
12
+ */
13
+ GLOBAL_PREFIX = `${SYSTEM_SERVICE}/global/`,
14
+ /**
15
+ * 系统服务接口前缀
16
+ */
17
+ SYSTEM_PREFIX = `${SYSTEM_SERVICE}/system/`,
18
+ }
@@ -0,0 +1,162 @@
1
+ <script setup lang="ts" name="box-container">
2
+ import { computed, PropType } from "vue";
3
+ import { warning } from "@/utils/message";
4
+ import { useDesignFormStore } from "@/store/DesignForm";
5
+ import piniaInstance from "@/store/index";
6
+ import { itemCheck } from "@/api/system";
7
+
8
+ const props = defineProps({
9
+ parentField: { type: String },
10
+ isDesign: { type: Boolean, default: false },
11
+ showFormItem: { type: Boolean, default: false },
12
+ disabled: { type: Object as PropType<Boolean | String> },
13
+ formInfo: { type: Object as PropType<any> },
14
+ field: { type: Object as PropType<any> },
15
+ });
16
+ let designForm = useDesignFormStore(piniaInstance);
17
+ let draggingItem = computed(() => designForm.draggingItem);
18
+ const formData = defineModel("formData");
19
+ let isEdit = computed(() => props.isDesign);
20
+ const isDragging = computed(() => designForm.isDragging);
21
+ let boxCompList = computed(() => props.field);
22
+ let excludeContainerType: Array<string> = [
23
+ "box",
24
+ "tab",
25
+ "table",
26
+ "dytable",
27
+ "collapse",
28
+ "card",
29
+ ];
30
+
31
+ const checkItem = (items: any) => {
32
+ if (!items["items"]) {
33
+ items["items"] = [];
34
+ }
35
+ };
36
+ const onDragAdd = (evt: Event | any, dataList: any) => {
37
+ let newIndex = evt.newIndex;
38
+ if (excludeContainerType.includes(draggingItem.value.itemType)) {
39
+ warning("栅格容器不允许嵌套其他容器");
40
+ let elements = props.field.preps.elements;
41
+ for (let inde in elements) {
42
+ let element = elements[inde];
43
+ for (let sind in element?.columns) {
44
+ let column = element.columns[sind];
45
+ for (let i in column?.items) {
46
+ let item = column.items[i];
47
+ if (draggingItem.value.id == item.id) {
48
+ column.items.splice(i, 1);
49
+ }
50
+ }
51
+ }
52
+ }
53
+ return false;
54
+ }
55
+ if (newIndex != null && newIndex != "undefined") {
56
+ let dataInfo = dataList[newIndex];
57
+ designForm.selectItem(dataInfo, dataInfo.itemType, "");
58
+ }
59
+ };
60
+ </script>
61
+ <template>
62
+ <group-box-container
63
+ class="star-horse-form-container"
64
+ :showFormItem="showFormItem"
65
+ :isDesign="isDesign"
66
+ :disabled="disabled"
67
+ :parentField="parentField"
68
+ :form-item="boxCompList"
69
+ >
70
+ <el-row
71
+ v-for="element in boxCompList.preps.elements"
72
+ :gutter="boxCompList.preps?.gutter || 10"
73
+ :justify="boxCompList.preps?.justify || 'start'"
74
+ :align="boxCompList.preps?.align || 'top'"
75
+ :tag="boxCompList.preps?.tag || 'div'"
76
+ >
77
+ <el-col
78
+ class="edit_col"
79
+ :class="{ 'dragging-area': isDragging }"
80
+ :item-key="index"
81
+ :span="sdata.colspan || 24"
82
+ v-for="(sdata, index) in element.columns"
83
+ v-if="isEdit"
84
+ >
85
+ <draggable
86
+ @add="(evt: Event) => onDragAdd(evt, sdata.items)"
87
+ @dragover="checkItem(sdata)"
88
+ class="smain-design"
89
+ tag="div"
90
+ group="starHorseGroup"
91
+ ghostClass="ghost"
92
+ animation="200"
93
+ :list="sdata.items"
94
+ >
95
+ <template #item="{ element: data }">
96
+ <div class="comp-item">
97
+ <component
98
+ :key="data.id"
99
+ :field="data"
100
+ :formInfo="formInfo"
101
+ :showFormItem="showFormItem"
102
+ :isDesign="isDesign"
103
+ :disabled="disabled"
104
+ :is="itemCheck(data)"
105
+ :parentField="boxCompList"
106
+ v-model:formData="formData"
107
+ />
108
+ </div>
109
+ </template>
110
+ </draggable>
111
+ </el-col>
112
+ <el-col
113
+ :item-key="index"
114
+ :span="sdata.colspan || 24"
115
+ :class="{ 'dragging-area': isDragging }"
116
+ style="border: none"
117
+ v-else
118
+ v-for="(sdata, index) in element.columns"
119
+ >
120
+ <template v-for="data in sdata.items">
121
+ <component
122
+ :field="data"
123
+ :isDesign="isDesign"
124
+ :disabled="disabled"
125
+ :showFormItem="showFormItem"
126
+ :is="itemCheck(data)"
127
+ v-model:formData="formData"
128
+ :formInfo="formInfo"
129
+ />
130
+ </template>
131
+ </el-col>
132
+ </el-row>
133
+ </group-box-container>
134
+ </template>
135
+ <style lang="scss" scoped>
136
+ .smain-design {
137
+ width: 100%;
138
+ background: var(--star-horse-background);
139
+ border-radius: 3px;
140
+ min-height: 50px;
141
+ display: flex;
142
+ flex-direction: column;
143
+ vertical-align: middle;
144
+ justify-content: center;
145
+ align-items: center;
146
+
147
+ .ghost {
148
+ content: "";
149
+ font-size: 0;
150
+ height: 3px;
151
+ box-sizing: border-box;
152
+ outline-width: 0;
153
+ padding: 0;
154
+ overflow: hidden;
155
+ }
156
+ }
157
+
158
+ .edit_col {
159
+ border: 1px dashed var(--star-horse-border—color);
160
+ min-height: 50px;
161
+ }
162
+ </style>
@@ -0,0 +1,9 @@
1
+ import { App, defineAsyncComponent } from "vue";
2
+
3
+ const containers = import.meta.glob("@/components/formcomp/container/*.vue");
4
+ export default function install(app: App<Element>) {
5
+ for (const [key, value] of Object.entries(containers)) {
6
+ const name = key.slice(key.lastIndexOf("/") + 1, key.lastIndexOf("."));
7
+ app.component(name, defineAsyncComponent(value as any));
8
+ }
9
+ }