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,165 @@
1
+ <template>
2
+ <div class="cron-content">
3
+ <div class="cron-item">
4
+ <el-radio size="small" v-model="radioValue" :label="1" border>
5
+ 小时,允许的通配符[, - * /]</el-radio
6
+ >
7
+ </div>
8
+ <div class="cron-item">
9
+ <el-radio size="small" v-model="radioValue" :label="2" border>
10
+ 周期</el-radio
11
+ >
12
+ <span style="margin-left: 10px; margin-right: 5px">从</span>
13
+ <el-input-number
14
+ size="small"
15
+ v-model="cycle01"
16
+ :min="0"
17
+ :max="60"
18
+ controls-position="right"
19
+ />
20
+ <span style="margin-left: 10px; margin-right: 5px">至</span>
21
+ <el-input-number
22
+ size="small"
23
+ v-model="cycle02"
24
+ :min="0"
25
+ :max="60"
26
+ controls-position="right"
27
+ />
28
+ <span style="margin-left: 10px; margin-right: 5px">小时</span>
29
+ </div>
30
+ <div class="cron-item">
31
+ <el-radio size="small" v-model="radioValue" :label="3" border
32
+ >循环</el-radio
33
+ >
34
+ <span style="margin-left: 10px; margin-right: 5px">从</span>
35
+ <el-input-number
36
+ size="small"
37
+ v-model="average01"
38
+ :min="0"
39
+ :max="60"
40
+ controls-position="right"
41
+ />
42
+ <span style="margin-left: 10px; margin-right: 5px">小时开始,每</span>
43
+ <el-input-number
44
+ size="small"
45
+ v-model="average02"
46
+ :min="0"
47
+ :max="60"
48
+ controls-position="right"
49
+ />
50
+ <span style="margin-left: 10px; margin-right: 5px">小时执行一次</span>
51
+ </div>
52
+ <div class="cron-item">
53
+ <el-radio size="small" v-model="radioValue" :label="4" border>
54
+ 指定</el-radio
55
+ >
56
+ <el-checkbox-group size="small" v-model="checkboxList">
57
+ <el-checkbox
58
+ class="my-[5px]"
59
+ :border="true"
60
+ v-for="item in 24"
61
+ :key="item"
62
+ :value="item - 1"
63
+ :label="item < 11 ? '0' + (item - 1) : item - 1"
64
+ />
65
+ </el-checkbox-group>
66
+ </div>
67
+ </div>
68
+ </template>
69
+ <style lang="scss" scoped></style>
70
+ <script lang="ts" setup name="crontab-hour">
71
+ import { computed, ref, watch } from "vue";
72
+
73
+ let radioValue = ref(1);
74
+ let cycle01 = ref(1);
75
+ let cycle02 = ref(2);
76
+ let average01 = ref(1);
77
+ let average02 = ref(1);
78
+
79
+ let checkboxList = ref([]);
80
+ const props = defineProps({
81
+ check: { type: Function },
82
+ cron: { type: Object },
83
+ });
84
+
85
+ const emits = defineEmits(["update"]);
86
+ // 计算两个周期值
87
+ const cycleTotalFun = () => {
88
+ cycle01.value = props.check?.(cycle01.value, 0, 23);
89
+ cycle02.value = props.check?.(cycle02.value, 0, 23);
90
+ return cycle01.value + "-" + cycle02.value;
91
+ };
92
+ // 计算平均用到的值
93
+ const averageTotalFun = () => {
94
+ average01.value = props.check?.(average01.value, 0, 23);
95
+ average02.value = props.check?.(average02.value, 1, 23);
96
+ return average01.value + "/" + average02.value;
97
+ };
98
+ // 计算勾选的checkbox值合集
99
+ const checkboxStringFun = () => {
100
+ let str = checkboxList.value.join();
101
+ return str == "" ? "?" : str;
102
+ };
103
+ let cycleTotal = computed(() => cycleTotalFun());
104
+ let averageTotal = computed(() => averageTotalFun());
105
+ let checkboxString = computed(() => checkboxStringFun());
106
+ // 单选按钮值变化时
107
+ const radioChange = () => {
108
+ switch (radioValue.value) {
109
+ case 1:
110
+ emits("update", "hour", "*", "hour");
111
+ break;
112
+ case 2:
113
+ emits("update", "hour", cycle01.value + "-" + cycle02.value);
114
+ break;
115
+ case 3:
116
+ emits("update", "hour", average01.value + "/" + average02.value);
117
+ break;
118
+ case 4:
119
+ emits("update", "hour", checkboxString.value);
120
+ break;
121
+ }
122
+ };
123
+ // 周期两个值变化时
124
+ const cycleChange = () => {
125
+ if (radioValue.value == 2) {
126
+ emits("update", "hour", cycleTotal.value);
127
+ }
128
+ };
129
+ // 平均两个值变化时
130
+ const averageChange = () => {
131
+ if (radioValue.value == 3) {
132
+ emits("update", "hour", averageTotal.value);
133
+ }
134
+ };
135
+ // checkbox值变化时
136
+ const checkboxChange = () => {
137
+ if (radioValue.value == 4) {
138
+ emits("update", "hour", checkboxString.value);
139
+ }
140
+ };
141
+ watch(
142
+ () => radioValue.value,
143
+ (_val) => radioChange(),
144
+ );
145
+ watch(
146
+ () => cycleTotal.value,
147
+ (_val) => cycleChange(),
148
+ );
149
+ watch(
150
+ () => averageTotal.value,
151
+ (_val) => averageChange(),
152
+ );
153
+ watch(
154
+ () => checkboxString.value,
155
+ (_val) => checkboxChange(),
156
+ );
157
+ defineExpose({
158
+ cycle01,
159
+ cycle02,
160
+ average01,
161
+ average02,
162
+ checkboxList,
163
+ radioValue,
164
+ });
165
+ </script>
@@ -0,0 +1,166 @@
1
+ <template>
2
+ <div class="cron-content">
3
+ <div class="cron-item">
4
+ <el-radio size="small" v-model="radioValue" :value="1" :label="1" border>
5
+ 分钟,允许的通配符[, - * /]</el-radio
6
+ >
7
+ </div>
8
+ <div class="cron-item">
9
+ <el-radio size="small" v-model="radioValue" :label="2" border
10
+ >周期</el-radio
11
+ >
12
+ <span style="margin-left: 10px; margin-right: 5px">从</span>
13
+ <el-input-number
14
+ size="small"
15
+ v-model="cycle01"
16
+ :min="0"
17
+ :max="60"
18
+ controls-position="right"
19
+ />
20
+ <span style="margin-left: 5px; margin-right: 5px">至</span>
21
+ <el-input-number
22
+ size="small"
23
+ v-model="cycle02"
24
+ :min="0"
25
+ :max="60"
26
+ controls-position="right"
27
+ />
28
+ <span style="margin-left: 5px; margin-right: 5px">分钟</span>
29
+ </div>
30
+ <div class="cron-item">
31
+ <el-radio size="small" v-model="radioValue" :label="3" border>
32
+ 循环</el-radio
33
+ >
34
+ <span style="margin-left: 10px; margin-right: 5px">从</span>
35
+ <el-input-number
36
+ size="small"
37
+ v-model="average01"
38
+ :min="0"
39
+ :max="60"
40
+ controls-position="right"
41
+ />
42
+ <span style="margin-left: 10px; margin-right: 5px"> 分钟开始,每</span>
43
+ <el-input-number
44
+ size="small"
45
+ v-model="average02"
46
+ :min="0"
47
+ :max="60"
48
+ controls-position="right"
49
+ />
50
+ <span style="margin-left: 10px; margin-right: 5px"> 分钟执行一次</span>
51
+ </div>
52
+ <div class="cron-item">
53
+ <el-radio size="small" v-model="radioValue" :label="4" border>
54
+ 指定</el-radio
55
+ >
56
+ <el-checkbox-group size="small" v-model="checkboxList">
57
+ <el-checkbox
58
+ class="my-[5px]"
59
+ :border="true"
60
+ v-for="item in 24"
61
+ :key="item"
62
+ :value="item - 1"
63
+ :label="item < 11 ? '0' + (item - 1) : item - 1"
64
+ />
65
+ </el-checkbox-group>
66
+ </div>
67
+ </div>
68
+ </template>
69
+ <style lang="scss" scoped></style>
70
+ <script setup lang="ts" name="crontab-min">
71
+ import { computed, ref, watch } from "vue";
72
+
73
+ let radioValue = ref(1);
74
+ let cycle01 = ref(1);
75
+ let cycle02 = ref(2);
76
+ let average01 = ref(1);
77
+ let average02 = ref(1);
78
+
79
+ let checkboxList = ref([]);
80
+ const props = defineProps({
81
+ check: { type: Function },
82
+ cron: { type: Object },
83
+ });
84
+
85
+ const emits = defineEmits(["update"]);
86
+ // 计算两个周期值
87
+ const cycleTotalFun = () => {
88
+ cycle01.value = props.check?.(cycle01.value, 0, 59);
89
+ cycle02.value = props.check?.(cycle02.value, 0, 59);
90
+ return cycle01.value + "-" + cycle02.value;
91
+ };
92
+ // 计算平均用到的值
93
+ const averageTotalFun = () => {
94
+ average01.value = props.check?.(average01.value, 0, 59);
95
+ average02.value = props.check?.(average02.value, 1, 59);
96
+ return average01.value + "/" + average02.value;
97
+ };
98
+ // 计算勾选的checkbox值合集
99
+ const checkboxStringFun = () => {
100
+ let str = checkboxList.value.join();
101
+ return str == "" ? "?" : str;
102
+ };
103
+ let cycleTotal = computed(() => cycleTotalFun());
104
+ let averageTotal = computed(() => averageTotalFun());
105
+ let checkboxString = computed(() => checkboxStringFun());
106
+ // 单选按钮值变化时
107
+ const radioChange = () => {
108
+ switch (radioValue.value) {
109
+ case 1:
110
+ emits("update", "min", "*", "min");
111
+ break;
112
+ case 2:
113
+ emits("update", "min", cycle01.value + "-" + cycle02.value, "min");
114
+ break;
115
+ case 3:
116
+ emits("update", "min", average01.value + "/" + average02.value, "min");
117
+ break;
118
+ case 4:
119
+ emits("update", "min", checkboxString.value, "min");
120
+ break;
121
+ }
122
+ };
123
+ // 周期两个值变化时
124
+ const cycleChange = () => {
125
+ if (radioValue.value == 2) {
126
+ emits("update", "min", cycleTotal.value, "min");
127
+ }
128
+ };
129
+ // 平均两个值变化时
130
+ const averageChange = () => {
131
+ if (radioValue.value == 3) {
132
+ emits("update", "min", averageTotal.value, "min");
133
+ }
134
+ };
135
+ // checkbox值变化时
136
+ const checkboxChange = () => {
137
+ if (radioValue.value == 4) {
138
+ emits("update", "min", checkboxString.value, "min");
139
+ }
140
+ };
141
+ watch(
142
+ () => radioValue.value,
143
+ (_val) => radioChange(),
144
+ );
145
+ watch(
146
+ () => cycleTotal.value,
147
+ (_val) => cycleChange(),
148
+ );
149
+ watch(
150
+ () => averageTotal.value,
151
+ (_val) => averageChange(),
152
+ );
153
+ watch(
154
+ () => checkboxString.value,
155
+ (_val) => checkboxChange(),
156
+ );
157
+
158
+ defineExpose({
159
+ cycle01,
160
+ cycle02,
161
+ average01,
162
+ average02,
163
+ checkboxList,
164
+ radioValue,
165
+ });
166
+ </script>
@@ -0,0 +1,166 @@
1
+ <template>
2
+ <div class="cron-content">
3
+ <div class="cron-item">
4
+ <el-radio size="small" v-model="radioValue" :label="1" border>
5
+ 月,允许的通配符[, - * /]</el-radio
6
+ >
7
+ </div>
8
+ <div class="cron-item">
9
+ <el-radio size="small" v-model="radioValue" border :label="2">
10
+ 周期</el-radio
11
+ >
12
+ <span style="margin-left: 10px; margin-right: 5px">从</span>
13
+ <el-input-number
14
+ size="small"
15
+ v-model="cycle01"
16
+ :min="1"
17
+ :max="12"
18
+ controls-position="right"
19
+ />
20
+ <span style="margin-left: 10px; margin-right: 5px">至</span>
21
+ <el-input-number
22
+ size="small"
23
+ v-model="cycle02"
24
+ :min="1"
25
+ :max="12"
26
+ controls-position="right"
27
+ />
28
+ <span style="margin-left: 10px; margin-right: 5px">月</span>
29
+ </div>
30
+ <div class="cron-item">
31
+ <el-radio size="small" v-model="radioValue" :label="3" border
32
+ >循环</el-radio
33
+ >
34
+ <span style="margin-left: 10px; margin-right: 5px">从</span>
35
+ <el-input-number
36
+ size="small"
37
+ v-model="average01"
38
+ :min="1"
39
+ :max="12"
40
+ controls-position="right"
41
+ />
42
+ <span style="margin-left: 10px; margin-right: 5px">月开始,每</span>
43
+ <el-input-number
44
+ size="small"
45
+ v-model="average02"
46
+ :min="1"
47
+ :max="12"
48
+ controls-position="right"
49
+ />
50
+ <span style="margin-left: 10px; margin-right: 5px">月执行一次</span>
51
+ </div>
52
+ <div class="cron-item">
53
+ <el-radio size="small" v-model="radioValue" :label="4" border>
54
+ 指定</el-radio
55
+ >
56
+ <el-checkbox-group size="small" v-model="checkboxList">
57
+ <el-checkbox
58
+ class="my-[5px]"
59
+ :border="true"
60
+ v-for="item in 12"
61
+ :key="item"
62
+ :value="item"
63
+ :label="item < 10 ? '0' + item : item"
64
+ />
65
+ </el-checkbox-group>
66
+ </div>
67
+ </div>
68
+ </template>
69
+ <style lang="scss" scoped></style>
70
+ <script setup lang="ts" name="crontab-month">
71
+ import { computed, ref, watch } from "vue";
72
+
73
+ let radioValue = ref(1);
74
+ let cycle01 = ref(1);
75
+ let cycle02 = ref(2);
76
+ let average01 = ref(1);
77
+ let average02 = ref(1);
78
+
79
+ let checkboxList = ref([]);
80
+ const props = defineProps({
81
+ check: { type: Function },
82
+ cron: { type: Object },
83
+ });
84
+
85
+ const emits = defineEmits(["update"]);
86
+ // 计算两个周期值
87
+ const cycleTotalFun = () => {
88
+ cycle01.value = props.check?.(cycle01.value, 1, 12);
89
+ cycle02.value = props.check?.(cycle02.value, 1, 12);
90
+ return cycle01.value + "-" + cycle02.value;
91
+ };
92
+ // 计算平均用到的值
93
+ const averageTotalFun = () => {
94
+ average01.value = props.check?.(average01.value, 1, 12);
95
+ average02.value = props.check?.(average02.value, 1, 12);
96
+ return average01.value + "/" + average02.value;
97
+ };
98
+ // 计算勾选的checkbox值合集
99
+ const checkboxStringFun = () => {
100
+ let str = checkboxList.value.join();
101
+ return str == "" || str == "0" ? "?" : str;
102
+ };
103
+ let cycleTotal = computed(() => cycleTotalFun());
104
+ let averageTotal = computed(() => averageTotalFun());
105
+ let checkboxString = computed(() => checkboxStringFun());
106
+ // 单选按钮值变化时
107
+ const radioChange = () => {
108
+ switch (radioValue.value) {
109
+ case 1:
110
+ emits("update", "month", "*");
111
+ break;
112
+ case 2:
113
+ emits("update", "month", cycle01.value + "-" + cycle02.value);
114
+ break;
115
+ case 3:
116
+ emits("update", "month", average01.value + "/" + average02.value);
117
+ break;
118
+ case 4:
119
+ emits("update", "month", checkboxString.value);
120
+ break;
121
+ }
122
+ };
123
+ // 周期两个值变化时
124
+ const cycleChange = () => {
125
+ if (radioValue.value == 2) {
126
+ emits("update", "month", cycleTotal.value);
127
+ }
128
+ };
129
+ // 平均两个值变化时
130
+ const averageChange = () => {
131
+ if (radioValue.value == 3) {
132
+ emits("update", "month", averageTotal.value);
133
+ }
134
+ };
135
+ // checkbox值变化时
136
+ const checkboxChange = () => {
137
+ if (radioValue.value == 4) {
138
+ emits("update", "month", checkboxString.value);
139
+ }
140
+ };
141
+ watch(
142
+ () => radioValue.value,
143
+ (_val) => radioChange(),
144
+ );
145
+ watch(
146
+ () => cycleTotal.value,
147
+ (_val) => cycleChange(),
148
+ );
149
+ watch(
150
+ () => averageTotal.value,
151
+ (_val) => averageChange(),
152
+ );
153
+ watch(
154
+ () => checkboxString.value,
155
+ (_val) => checkboxChange(),
156
+ );
157
+
158
+ defineExpose({
159
+ cycle01,
160
+ cycle02,
161
+ average01,
162
+ average02,
163
+ checkboxList,
164
+ radioValue,
165
+ });
166
+ </script>