star-horse-lowcode 2.7.62 → 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.
- package/.env.development +3 -0
- package/.env.production +3 -0
- package/.eslintrc-auto-import.json +77 -0
- package/.gitignore +27 -0
- package/.idea/.gitignore +5 -0
- package/.idea/MarsCodeWorkspaceAppSettings.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/modules.xml +8 -0
- package/.idea/testcode.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.idea/workspace.xml +207 -0
- package/.npmignore +21 -0
- package/.prettierignore +26 -0
- package/README.md +2 -0
- package/auto-imports.d.ts +137 -0
- package/components.d.ts +189 -0
- package/dist/assets/index.css +1 -1
- package/dist/index.es.js +941 -720
- package/dist/types/index.d.ts +8 -8
- package/eslint.config.js +37 -0
- package/index.html +14 -0
- package/package-lock.json +8276 -0
- package/package.json +6 -6
- package/prettier.config.js +20 -0
- package/public/logo.svg +660 -0
- package/src/App.vue +11 -0
- package/src/api/date_utils.ts +219 -0
- package/src/api/finger_utils.ts +71 -0
- package/src/api/form_utils.ts +281 -0
- package/src/api/jquery.min.js +2 -0
- package/src/api/pcas-code.json +1 -0
- package/src/api/settings.ts +81 -0
- package/src/api/star_horse_apis.ts +196 -0
- package/src/api/star_horse_utils.ts +797 -0
- package/src/api/system.ts +351 -0
- package/src/api/user_func.ts +147 -0
- package/src/api/valid_utils.ts +165 -0
- package/src/assets/css/index.scss +908 -0
- package/src/assets/icons.css +574 -0
- package/src/assets/star-horse-icons.woff +0 -0
- package/src/components/comp/ShDynamicForm.vue +160 -0
- package/src/components/comp/ShForm.vue +30 -0
- package/src/components/comp/ShTableListColumn.vue +61 -0
- package/src/components/comp/StarHorseDataSelector.vue +139 -0
- package/src/components/comp/StarHorseDataView.vue +110 -0
- package/src/components/comp/StarHorseDataViewItems.vue +61 -0
- package/src/components/comp/StarHorseDataViewTable.vue +102 -0
- package/src/components/comp/StarHorseDialog.vue +383 -0
- package/src/components/comp/StarHorseDraggable.vue +401 -0
- package/src/components/comp/StarHorseForm.vue +458 -0
- package/src/components/comp/StarHorseFormItem.vue +82 -0
- package/src/components/comp/StarHorseFormList.vue +516 -0
- package/src/components/comp/StarHorseFormTable.vue +56 -0
- package/src/components/comp/StarHorseIcon.vue +76 -0
- package/src/components/comp/StarHorseItem.vue +302 -0
- package/src/components/comp/StarHorseJsonEditor.vue +115 -0
- package/src/components/comp/StarHorsePopover.vue +66 -0
- package/src/components/comp/StarHorseSearchComp.vue +253 -0
- package/src/components/comp/StarHorseStaticTable.vue +395 -0
- package/src/components/comp/StarHorseTableColumn.vue +249 -0
- package/src/components/comp/StarHorseTableComp.vue +1193 -0
- package/src/components/comp/StarHorseTableViewColumn.vue +61 -0
- package/src/components/comp/StarHorseTree.vue +494 -0
- package/src/components/comp/index.ts +22 -0
- package/src/components/comp/items/UTableColumn.vue +65 -0
- package/src/components/comp/items/boxItem.vue +98 -0
- package/src/components/comp/items/callitem.ts +9 -0
- package/src/components/comp/items/cardItem.vue +152 -0
- package/src/components/comp/items/collapseItem.vue +134 -0
- package/src/components/comp/items/dytableItem.vue +135 -0
- package/src/components/comp/items/otherItem.vue +65 -0
- package/src/components/comp/items/tabItem.vue +155 -0
- package/src/components/comp/items/tabPanelItem.vue +110 -0
- package/src/components/comp/items/tableColumn.vue +129 -0
- package/src/components/comp/items/tableItem.vue +97 -0
- package/src/components/comp/items/tablebtn.vue +158 -0
- package/src/components/comp/items/viewBoxItem.vue +55 -0
- package/src/components/comp/items/viewCardItem.vue +47 -0
- package/src/components/comp/items/viewCollapseItem.vue +71 -0
- package/src/components/comp/items/viewDytableItem.vue +77 -0
- package/src/components/comp/items/viewOtherItem.vue +55 -0
- package/src/components/comp/items/viewTabItem.vue +77 -0
- package/src/components/comp/items/viewTabPanelItem.vue +54 -0
- package/src/components/comp/items/viewTableItem.vue +74 -0
- package/src/components/comp/selfcomp.ts +9 -0
- package/src/components/comp/utils/DataPicker.vue +302 -0
- package/src/components/comp/utils/DataTag.vue +51 -0
- package/src/components/cron/Crontab-Day.vue +230 -0
- package/src/components/cron/Crontab-Hour.vue +165 -0
- package/src/components/cron/Crontab-Min.vue +166 -0
- package/src/components/cron/Crontab-Month.vue +166 -0
- package/src/components/cron/Crontab-Result.vue +615 -0
- package/src/components/cron/Crontab-Second.vue +185 -0
- package/src/components/cron/Crontab-Week.vue +208 -0
- package/src/components/cron/Crontab-Year.vue +183 -0
- package/src/components/cron/Crontab.vue +474 -0
- package/src/components/enums/ModuleEnums.ts +10 -0
- package/src/components/enums/ServiceEnums.ts +18 -0
- package/src/components/formcomp/container/box-container.vue +162 -0
- package/src/components/formcomp/container/callitem.ts +9 -0
- package/src/components/formcomp/container/card-container.vue +170 -0
- package/src/components/formcomp/container/collapse-container.vue +133 -0
- package/src/components/formcomp/container/dytable-col.vue +448 -0
- package/src/components/formcomp/container/dytable-container.vue +57 -0
- package/src/components/formcomp/container/dytableUtils.ts +358 -0
- package/src/components/formcomp/container/group-box-container.vue +331 -0
- package/src/components/formcomp/container/index.ts +6 -0
- package/src/components/formcomp/container/tab-container.vue +153 -0
- package/src/components/formcomp/container/table-container.vue +249 -0
- package/src/components/formcomp/items/allitem.ts +9 -0
- package/src/components/formcomp/items/area-item.vue +116 -0
- package/src/components/formcomp/items/audio-item.vue +163 -0
- package/src/components/formcomp/items/autocomplete-item.vue +118 -0
- package/src/components/formcomp/items/barcode-item.vue +87 -0
- package/src/components/formcomp/items/base-json-item.vue +207 -0
- package/src/components/formcomp/items/button-item.vue +228 -0
- package/src/components/formcomp/items/cascade-item.vue +113 -0
- package/src/components/formcomp/items/checkbox-item.vue +97 -0
- package/src/components/formcomp/items/color-item.vue +70 -0
- package/src/components/formcomp/items/cron-item.vue +115 -0
- package/src/components/formcomp/items/datetime-item.vue +99 -0
- package/src/components/formcomp/items/depart-item.vue +51 -0
- package/src/components/formcomp/items/dialog-input-item.vue +207 -0
- package/src/components/formcomp/items/divider-item.vue +66 -0
- package/src/components/formcomp/items/html-item.vue +65 -0
- package/src/components/formcomp/items/htmleditor-item.vue +104 -0
- package/src/components/formcomp/items/icon-item.vue +195 -0
- package/src/components/formcomp/items/image-item.vue +247 -0
- package/src/components/formcomp/items/index.ts +44 -0
- package/src/components/formcomp/items/input-item.vue +150 -0
- package/src/components/formcomp/items/json-array-item.vue +67 -0
- package/src/components/formcomp/items/json-item.vue +66 -0
- package/src/components/formcomp/items/markdown-item.vue +77 -0
- package/src/components/formcomp/items/number-item.vue +94 -0
- package/src/components/formcomp/items/number-range-item.vue +278 -0
- package/src/components/formcomp/items/page-select-item.vue +407 -0
- package/src/components/formcomp/items/password-item.vue +71 -0
- package/src/components/formcomp/items/qrcode-item.vue +84 -0
- package/src/components/formcomp/items/radio-item.vue +112 -0
- package/src/components/formcomp/items/rate-item.vue +68 -0
- package/src/components/formcomp/items/select-item.vue +133 -0
- package/src/components/formcomp/items/signature-item.vue +216 -0
- package/src/components/formcomp/items/slider-item.vue +68 -0
- package/src/components/formcomp/items/starhorse-form-item.vue +334 -0
- package/src/components/formcomp/items/switch-item.vue +77 -0
- package/src/components/formcomp/items/tag-item.vue +77 -0
- package/src/components/formcomp/items/text-item.vue +75 -0
- package/src/components/formcomp/items/textarea-item.vue +85 -0
- package/src/components/formcomp/items/time-item.vue +77 -0
- package/src/components/formcomp/items/time-picker-item.vue +74 -0
- package/src/components/formcomp/items/transfer-item.vue +93 -0
- package/src/components/formcomp/items/tselect-item.vue +121 -0
- package/src/components/formcomp/items/unknown-item.vue +51 -0
- package/src/components/formcomp/items/upload-item.vue +189 -0
- package/src/components/formcomp/items/user-item.vue +177 -0
- package/src/components/formcomp/items/usercomp-item.vue +85 -0
- package/src/components/formcomp/items/view-markdown-item.vue +77 -0
- package/src/components/formcomp/utils/EditDataDialog.vue +67 -0
- package/src/components/formcomp/utils/FieldList.vue +125 -0
- package/src/components/formcomp/utils/ItemRelationEventUtils.ts +284 -0
- package/src/components/help.vue +31 -0
- package/src/components/menu/MenuItem.vue +95 -0
- package/src/components/menu/SubMenu.vue +68 -0
- package/src/components/menu/SubSystemMenu.vue +142 -0
- package/src/components/register.ts +24 -0
- package/src/components/system/ContentMenu.vue +260 -0
- package/src/components/system/StarHorseButtonList.vue +344 -0
- package/src/components/system/StarHorseMenu.vue +97 -0
- package/src/components/system/StarHorseSvg.vue +62 -0
- package/src/components/system/SystemComp.ts +9 -0
- package/src/components/system/index.ts +4 -0
- package/src/components/types/ApiUrls.ts +168 -0
- package/src/components/types/BtnAction.ts +51 -0
- package/src/components/types/BtnAuth.ts +43 -0
- package/src/components/types/CompInfo.ts +81 -0
- package/src/components/types/DialogProps.ts +55 -0
- package/src/components/types/DyCompField.ts +23 -0
- package/src/components/types/DynamicNode.ts +42 -0
- package/src/components/types/MenusInfo.ts +45 -0
- package/src/components/types/PageFieldInfo.ts +530 -0
- package/src/components/types/PageProps.ts +25 -0
- package/src/components/types/Params.ts +93 -0
- package/src/components/types/RuleType.ts +10 -0
- package/src/components/types/SearchProps.ts +42 -0
- package/src/components/types/ShortKey.ts +30 -0
- package/src/components/types/StarHorseType.ts +18 -0
- package/src/components/types/index.ts +15 -0
- package/src/config/element.ts +15 -0
- package/src/config/styles.ts +4 -0
- package/src/index.ts +98 -0
- package/src/install.ts +33 -0
- package/src/lang/en_US.ts +81 -0
- package/src/lang/index.ts +35 -0
- package/src/lang/zh_CN.ts +84 -0
- package/src/main.ts +57 -0
- package/src/plugins/AblesPlugin.ts +618 -0
- package/src/plugins/registerCompPlugin.ts +15 -0
- package/src/sample/test.vue +9 -0
- package/src/store/ButtonPermission.ts +101 -0
- package/src/store/ConsumerView.ts +52 -0
- package/src/store/ContinusConfig.ts +78 -0
- package/src/store/CopyerOperation.ts +74 -0
- package/src/store/DesignForm.ts +481 -0
- package/src/store/DesignPage.ts +59 -0
- package/src/store/DynamicForm.ts +241 -0
- package/src/store/GlobalConfig.ts +90 -0
- package/src/store/SelfOperation.ts +95 -0
- package/src/store/UserInfo.ts +88 -0
- package/src/store/index.ts +6 -0
- package/src/theme/localStorge.ts +16 -0
- package/src/theme/theme.ts +27 -0
- package/src/utils/FieldOperationUtils.ts +91 -0
- package/src/utils/auth.ts +83 -0
- package/src/utils/message.ts +69 -0
- package/src/utils/preview.ts +125 -0
- package/tsconfig.json +39 -0
- package/tsconfig.node.json +10 -0
- package/vite-env.d.ts +16 -0
- package/vite.config.ts +162 -0
- package/yarn.lock +4627 -0
|
@@ -0,0 +1,185 @@
|
|
|
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" :value="2" :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="1"
|
|
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" :value="3" :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: 5px; 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: 5px; margin-right: 5px">秒执行一次</span>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="cron-item">
|
|
53
|
+
<el-radio size="small" v-model="radioValue" :value="4" :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 60"
|
|
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-second">
|
|
71
|
+
import { computed, onMounted, PropType, 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 as PropType<String> },
|
|
83
|
+
radioParent: {},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const emits = defineEmits(["update"]);
|
|
87
|
+
// 计算两个周期值
|
|
88
|
+
const cycleTotalFun = () => {
|
|
89
|
+
cycle01.value = props.check?.(cycle01.value, 0, 59);
|
|
90
|
+
cycle02.value = props.check?.(cycle02.value, 0, 59);
|
|
91
|
+
return cycle01.value + "-" + cycle02.value;
|
|
92
|
+
};
|
|
93
|
+
// 计算平均用到的值
|
|
94
|
+
const averageTotalFun = () => {
|
|
95
|
+
average01.value = props.check?.(average01.value, 0, 59);
|
|
96
|
+
average02.value = props.check?.(average02.value, 1, 59);
|
|
97
|
+
return average01.value + "/" + average02.value;
|
|
98
|
+
};
|
|
99
|
+
// 计算勾选的checkbox值合集
|
|
100
|
+
const checkboxStringFun = () => {
|
|
101
|
+
let str = checkboxList.value.join();
|
|
102
|
+
return str == "" ? "?" : str;
|
|
103
|
+
};
|
|
104
|
+
let cycleTotal = computed(() => cycleTotalFun());
|
|
105
|
+
let averageTotal = computed(() => averageTotalFun());
|
|
106
|
+
let checkboxString = computed(() => checkboxStringFun());
|
|
107
|
+
// 单选按钮值变化时
|
|
108
|
+
const radioChange = () => {
|
|
109
|
+
switch (radioValue.value) {
|
|
110
|
+
case 1:
|
|
111
|
+
emits("update", "second", "*", "second");
|
|
112
|
+
break;
|
|
113
|
+
case 2:
|
|
114
|
+
emits("update", "second", cycle01.value + "-" + cycle02.value);
|
|
115
|
+
break;
|
|
116
|
+
case 3:
|
|
117
|
+
emits("update", "second", average01.value + "/" + average02.value);
|
|
118
|
+
break;
|
|
119
|
+
case 4:
|
|
120
|
+
emits("update", "second", checkboxString.value);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
// 周期两个值变化时
|
|
125
|
+
const cycleChange = () => {
|
|
126
|
+
if (radioValue.value == 2) {
|
|
127
|
+
emits("update", "second", cycleTotal.value);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
// 平均两个值变化时
|
|
131
|
+
const averageChange = () => {
|
|
132
|
+
if (radioValue.value == 3) {
|
|
133
|
+
emits("update", "second", averageTotal.value);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
// checkbox值变化时
|
|
137
|
+
const checkboxChange = () => {
|
|
138
|
+
if (radioValue.value == 4) {
|
|
139
|
+
emits("update", "second", checkboxString.value);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
// const othChange = () => {
|
|
143
|
+
// //反解析
|
|
144
|
+
// let ins = props.cron?.second;
|
|
145
|
+
// console.log('second', ins);
|
|
146
|
+
// if (ins === '*') {
|
|
147
|
+
// radioValue.value = 1;
|
|
148
|
+
// } else if (ins.indexOf('-') > -1) {
|
|
149
|
+
// radioValue.value = 2;
|
|
150
|
+
// } else if (ins.indexOf('/') > -1) {
|
|
151
|
+
// radioValue.value = 3;
|
|
152
|
+
// } else {
|
|
153
|
+
// radioValue.value = 4;
|
|
154
|
+
// checkboxList.value = ins.split(',');
|
|
155
|
+
// }
|
|
156
|
+
// };
|
|
157
|
+
watch(
|
|
158
|
+
() => radioValue.value,
|
|
159
|
+
(_val) => radioChange(),
|
|
160
|
+
);
|
|
161
|
+
watch(
|
|
162
|
+
() => cycleTotal.value,
|
|
163
|
+
(_val) => cycleChange(),
|
|
164
|
+
);
|
|
165
|
+
watch(
|
|
166
|
+
() => averageTotal.value,
|
|
167
|
+
(_val) => averageChange(),
|
|
168
|
+
);
|
|
169
|
+
watch(
|
|
170
|
+
() => checkboxString.value,
|
|
171
|
+
(_val) => checkboxChange(),
|
|
172
|
+
);
|
|
173
|
+
onMounted(() => {
|
|
174
|
+
// radioValue.value = props.radioParent;
|
|
175
|
+
// othChange();
|
|
176
|
+
});
|
|
177
|
+
defineExpose({
|
|
178
|
+
cycle01,
|
|
179
|
+
cycle02,
|
|
180
|
+
average01,
|
|
181
|
+
average02,
|
|
182
|
+
checkboxList,
|
|
183
|
+
radioValue,
|
|
184
|
+
});
|
|
185
|
+
</script>
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cron-content">
|
|
3
|
+
<div class="cron-item">
|
|
4
|
+
<el-radio size="small" v-model="radioValue" :label="1" border>
|
|
5
|
+
周,允许的通配符[, - * / L #]</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
|
+
</div>
|
|
13
|
+
<div class="cron-item">
|
|
14
|
+
<el-radio size="small" v-model="radioValue" :label="3" border>
|
|
15
|
+
周期</el-radio
|
|
16
|
+
>
|
|
17
|
+
<span style="margin-left: 10px; margin-right: 5px">从星期</span>
|
|
18
|
+
<el-input-number
|
|
19
|
+
size="small"
|
|
20
|
+
v-model="cycle01"
|
|
21
|
+
:min="1"
|
|
22
|
+
:max="7"
|
|
23
|
+
controls-position="right"
|
|
24
|
+
/>
|
|
25
|
+
<span style="margin-left: 10px; margin-right: 5px">至</span>
|
|
26
|
+
<el-input-number
|
|
27
|
+
size="small"
|
|
28
|
+
v-model="cycle02"
|
|
29
|
+
:min="1"
|
|
30
|
+
:max="7"
|
|
31
|
+
controls-position="right"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="cron-item">
|
|
35
|
+
<el-radio size="small" v-model="radioValue" :label="4" border>
|
|
36
|
+
循环</el-radio
|
|
37
|
+
>
|
|
38
|
+
<span style="margin-left: 10px; margin-right: 5px">第</span>
|
|
39
|
+
<el-input-number
|
|
40
|
+
size="small"
|
|
41
|
+
v-model="average01"
|
|
42
|
+
:min="1"
|
|
43
|
+
:max="4"
|
|
44
|
+
controls-position="right"
|
|
45
|
+
/>
|
|
46
|
+
<span style="margin-left: 10px; margin-right: 5px">周的星期</span>
|
|
47
|
+
<el-input-number
|
|
48
|
+
size="small"
|
|
49
|
+
v-model="average02"
|
|
50
|
+
:min="1"
|
|
51
|
+
:max="7"
|
|
52
|
+
controls-position="right"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="cron-item">
|
|
56
|
+
<el-radio size="small" v-model="radioValue" :label="5" border
|
|
57
|
+
>本月最后一个</el-radio
|
|
58
|
+
>
|
|
59
|
+
<span style="margin-left: 10px; margin-right: 5px">星期</span>
|
|
60
|
+
<el-input-number
|
|
61
|
+
size="small"
|
|
62
|
+
v-model="weekday"
|
|
63
|
+
:min="1"
|
|
64
|
+
:max="7"
|
|
65
|
+
controls-position="right"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="cron-item">
|
|
69
|
+
<el-radio size="small" v-model="radioValue" :label="6" border>
|
|
70
|
+
指定</el-radio
|
|
71
|
+
>
|
|
72
|
+
<el-checkbox-group size="small" v-model="checkboxList">
|
|
73
|
+
<el-checkbox
|
|
74
|
+
class="my-[5px]"
|
|
75
|
+
:border="true"
|
|
76
|
+
v-for="item of weekList"
|
|
77
|
+
:key="item"
|
|
78
|
+
:value="item + 1"
|
|
79
|
+
:label="Number(item) < 10 ? '0' + item : item"
|
|
80
|
+
/>
|
|
81
|
+
</el-checkbox-group>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
<style lang="scss" scoped></style>
|
|
86
|
+
<script setup lang="ts" name="crontab-week">
|
|
87
|
+
import { computed, ref, watch } from "vue";
|
|
88
|
+
|
|
89
|
+
const props = defineProps({
|
|
90
|
+
check: { type: Function },
|
|
91
|
+
cron: { type: Object },
|
|
92
|
+
});
|
|
93
|
+
const emits = defineEmits(["update"]);
|
|
94
|
+
let weekday = ref(0);
|
|
95
|
+
let radioValue = ref(1);
|
|
96
|
+
let cycle01 = ref(0);
|
|
97
|
+
let cycle02 = ref(0);
|
|
98
|
+
let average01 = ref(0);
|
|
99
|
+
let average02 = ref(1);
|
|
100
|
+
|
|
101
|
+
let checkboxList = ref([]);
|
|
102
|
+
let weekList = ref(["周一", "周二", "周三", "周四", "周五", "周六", "周日"]);
|
|
103
|
+
|
|
104
|
+
// 计算两个周期值
|
|
105
|
+
const cycleTotalFun = () => {
|
|
106
|
+
cycle01.value = props.check?.(cycle01.value, 1, 7);
|
|
107
|
+
cycle02.value = props.check?.(cycle02.value, 2, 7);
|
|
108
|
+
return cycle01.value + "-" + cycle02.value;
|
|
109
|
+
};
|
|
110
|
+
// 计算平均用到的值
|
|
111
|
+
const averageTotalFun = () => {
|
|
112
|
+
average01.value = props.check?.(average01.value, 1, 4);
|
|
113
|
+
average02.value = props.check?.(average02.value, 1, 7);
|
|
114
|
+
return average01.value + "#" + average02.value;
|
|
115
|
+
};
|
|
116
|
+
// 最近的工作日(格式)
|
|
117
|
+
const weekdayCheckFun = () => {
|
|
118
|
+
weekday.value = props.check?.(weekday.value, 1, 7);
|
|
119
|
+
return weekday.value;
|
|
120
|
+
};
|
|
121
|
+
// 计算勾选的checkbox值合集
|
|
122
|
+
const checkboxStringFun = () => {
|
|
123
|
+
let str = checkboxList.value.join();
|
|
124
|
+
return str == "" ? "?" : str;
|
|
125
|
+
};
|
|
126
|
+
let cycleTotal = computed(() => cycleTotalFun());
|
|
127
|
+
let averageTotal = computed(() => averageTotalFun());
|
|
128
|
+
let weekdayCheck = computed(() => weekdayCheckFun());
|
|
129
|
+
let checkboxString = computed(() => checkboxStringFun());
|
|
130
|
+
// 单选按钮值变化时
|
|
131
|
+
const radioChange = () => {
|
|
132
|
+
switch (radioValue.value) {
|
|
133
|
+
case 1:
|
|
134
|
+
emits("update", "week", "*");
|
|
135
|
+
break;
|
|
136
|
+
case 2:
|
|
137
|
+
emits("update", "week", "?");
|
|
138
|
+
break;
|
|
139
|
+
case 3:
|
|
140
|
+
emits("update", "week", cycle01.value + "-" + cycle02.value);
|
|
141
|
+
break;
|
|
142
|
+
case 4:
|
|
143
|
+
emits("update", "week", average01.value + "#" + average02.value);
|
|
144
|
+
break;
|
|
145
|
+
case 5:
|
|
146
|
+
emits("update", "week", weekday.value + "L");
|
|
147
|
+
break;
|
|
148
|
+
case 6:
|
|
149
|
+
emits("update", "week", checkboxString.value);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
// 根据互斥事件,更改radio的值
|
|
154
|
+
// 周期两个值变化时
|
|
155
|
+
const cycleChange = () => {
|
|
156
|
+
if (radioValue.value == 3) {
|
|
157
|
+
emits("update", "week", cycleTotal.value);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
// 平均两个值变化时
|
|
161
|
+
const averageChange = () => {
|
|
162
|
+
if (radioValue.value == 4) {
|
|
163
|
+
emits("update", "week", averageTotal.value);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
// 最近工作日值变化时
|
|
167
|
+
const weekdayChange = () => {
|
|
168
|
+
if (radioValue.value == 5) {
|
|
169
|
+
emits("update", "week", weekday.value + "L");
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
// checkbox值变化时
|
|
173
|
+
const checkboxChange = () => {
|
|
174
|
+
if (radioValue.value == 6) {
|
|
175
|
+
emits("update", "week", checkboxString.value);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
watch(
|
|
179
|
+
() => radioValue.value,
|
|
180
|
+
(_val) => radioChange(),
|
|
181
|
+
);
|
|
182
|
+
watch(
|
|
183
|
+
() => cycleTotal.value,
|
|
184
|
+
(_val) => cycleChange(),
|
|
185
|
+
);
|
|
186
|
+
watch(
|
|
187
|
+
() => averageTotal.value,
|
|
188
|
+
(_val) => averageChange(),
|
|
189
|
+
);
|
|
190
|
+
watch(
|
|
191
|
+
() => weekdayCheck.value,
|
|
192
|
+
(_val) => weekdayChange(),
|
|
193
|
+
);
|
|
194
|
+
watch(
|
|
195
|
+
() => checkboxString.value,
|
|
196
|
+
(_val) => checkboxChange(),
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
defineExpose({
|
|
200
|
+
cycle01,
|
|
201
|
+
cycle02,
|
|
202
|
+
average01,
|
|
203
|
+
average02,
|
|
204
|
+
checkboxList,
|
|
205
|
+
weekday,
|
|
206
|
+
radioValue,
|
|
207
|
+
});
|
|
208
|
+
</script>
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cron-content">
|
|
3
|
+
<div class="cron-item">
|
|
4
|
+
<el-radio size="small" :label="1" v-model="radioValue" border>
|
|
5
|
+
不填,允许的通配符[, - * /]</el-radio
|
|
6
|
+
>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="cron-item">
|
|
9
|
+
<el-radio size="small" :label="2" v-model="radioValue" border>
|
|
10
|
+
每年</el-radio
|
|
11
|
+
>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="cron-item">
|
|
14
|
+
<el-radio size="small" :label="3" v-model="radioValue" border
|
|
15
|
+
>周期</el-radio
|
|
16
|
+
>
|
|
17
|
+
<span style="margin-left: 10px; margin-right: 5px">从</span>
|
|
18
|
+
<el-input-number
|
|
19
|
+
size="small"
|
|
20
|
+
v-model="cycle01"
|
|
21
|
+
:min="fullYear"
|
|
22
|
+
controls-position="right"
|
|
23
|
+
/>
|
|
24
|
+
<span style="margin-left: 10px; margin-right: 5px">至</span>
|
|
25
|
+
<el-input-number
|
|
26
|
+
size="small"
|
|
27
|
+
v-model="cycle02"
|
|
28
|
+
:min="fullYear"
|
|
29
|
+
controls-position="right"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="cron-item">
|
|
33
|
+
<el-radio size="small" :label="4" v-model="radioValue" border
|
|
34
|
+
>循环</el-radio
|
|
35
|
+
>
|
|
36
|
+
<span style="margin-left: 10px; margin-right: 5px">从</span>
|
|
37
|
+
<el-input-number
|
|
38
|
+
size="small"
|
|
39
|
+
v-model="average01"
|
|
40
|
+
:min="fullYear"
|
|
41
|
+
controls-position="right"
|
|
42
|
+
/>
|
|
43
|
+
<span style="margin-left: 10px; margin-right: 5px">年开始,每</span>
|
|
44
|
+
<el-input-number
|
|
45
|
+
size="small"
|
|
46
|
+
v-model="average02"
|
|
47
|
+
:min="fullYear"
|
|
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" :label="5" v-model="radioValue" 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 20"
|
|
61
|
+
:key="item"
|
|
62
|
+
:value="item - 1 + fullYear"
|
|
63
|
+
:label="item - 1 + fullYear"
|
|
64
|
+
/>
|
|
65
|
+
</el-checkbox-group>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<style lang="scss" scoped></style>
|
|
70
|
+
<script lang="ts" setup name="crontab-year">
|
|
71
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
72
|
+
|
|
73
|
+
const props = defineProps({
|
|
74
|
+
check: { type: Function },
|
|
75
|
+
month: {},
|
|
76
|
+
cron: { type: Object },
|
|
77
|
+
});
|
|
78
|
+
const emits = defineEmits(["update"]);
|
|
79
|
+
let fullYear = ref(0);
|
|
80
|
+
let radioValue = ref(1);
|
|
81
|
+
let cycle01 = ref(0);
|
|
82
|
+
let cycle02 = ref(0);
|
|
83
|
+
let average01 = ref(0);
|
|
84
|
+
let average02 = ref(1);
|
|
85
|
+
let checkboxList = ref([]);
|
|
86
|
+
// 计算两个周期值
|
|
87
|
+
const cycleTotalFun = () => {
|
|
88
|
+
cycle01.value = props.check?.(
|
|
89
|
+
cycle01.value,
|
|
90
|
+
fullYear.value,
|
|
91
|
+
fullYear.value + 100,
|
|
92
|
+
);
|
|
93
|
+
cycle02.value = props.check?.(
|
|
94
|
+
cycle02.value,
|
|
95
|
+
fullYear.value + 1,
|
|
96
|
+
fullYear.value + 101,
|
|
97
|
+
);
|
|
98
|
+
return cycle01.value + "-" + cycle02.value;
|
|
99
|
+
};
|
|
100
|
+
// 计算平均用到的值
|
|
101
|
+
const averageTotalFun = () => {
|
|
102
|
+
average01.value = props.check?.(
|
|
103
|
+
average01.value,
|
|
104
|
+
fullYear.value,
|
|
105
|
+
fullYear.value + 100,
|
|
106
|
+
);
|
|
107
|
+
average02.value = props.check?.(average02.value, 1, 10);
|
|
108
|
+
return average01.value + "/" + average02.value;
|
|
109
|
+
};
|
|
110
|
+
// 计算勾选的checkbox值合集
|
|
111
|
+
const checkboxStringFun = () => {
|
|
112
|
+
return checkboxList.value.join();
|
|
113
|
+
};
|
|
114
|
+
let cycleTotal = computed(() => cycleTotalFun());
|
|
115
|
+
let averageTotal = computed(() => averageTotalFun());
|
|
116
|
+
let checkboxString = computed(() => checkboxStringFun());
|
|
117
|
+
// 单选按钮值变化时
|
|
118
|
+
const radioChange = () => {
|
|
119
|
+
switch (radioValue.value) {
|
|
120
|
+
case 1:
|
|
121
|
+
emits("update", "year", "");
|
|
122
|
+
break;
|
|
123
|
+
case 2:
|
|
124
|
+
emits("update", "year", "*");
|
|
125
|
+
break;
|
|
126
|
+
case 3:
|
|
127
|
+
emits("update", "year", cycle01.value + "-" + cycle02.value);
|
|
128
|
+
break;
|
|
129
|
+
case 4:
|
|
130
|
+
emits("update", "year", average01.value + "/" + average02.value);
|
|
131
|
+
break;
|
|
132
|
+
case 5:
|
|
133
|
+
emits("update", "year", checkboxString.value);
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
// 周期两个值变化时
|
|
138
|
+
const cycleChange = () => {
|
|
139
|
+
if (radioValue.value == 3) {
|
|
140
|
+
emits("update", "year", cycleTotal.value);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
// 平均两个值变化时
|
|
144
|
+
const averageChange = () => {
|
|
145
|
+
if (radioValue.value == 4) {
|
|
146
|
+
emits("update", "year", averageTotal.value);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
// checkbox值变化时
|
|
150
|
+
const checkboxChange = () => {
|
|
151
|
+
if (radioValue.value == 5) {
|
|
152
|
+
emits("update", "year", checkboxString.value);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
watch(
|
|
156
|
+
() => radioValue.value,
|
|
157
|
+
(_val) => radioChange(),
|
|
158
|
+
);
|
|
159
|
+
watch(
|
|
160
|
+
() => cycleTotal.value,
|
|
161
|
+
(_val) => cycleChange(),
|
|
162
|
+
);
|
|
163
|
+
watch(
|
|
164
|
+
() => averageTotal.value,
|
|
165
|
+
(_val) => averageChange(),
|
|
166
|
+
);
|
|
167
|
+
watch(
|
|
168
|
+
() => checkboxString.value,
|
|
169
|
+
(_val) => checkboxChange(),
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
onMounted(() => {
|
|
173
|
+
fullYear.value = Number(new Date().getFullYear());
|
|
174
|
+
});
|
|
175
|
+
defineExpose({
|
|
176
|
+
cycle01,
|
|
177
|
+
cycle02,
|
|
178
|
+
average01,
|
|
179
|
+
average02,
|
|
180
|
+
checkboxList,
|
|
181
|
+
radioValue,
|
|
182
|
+
});
|
|
183
|
+
</script>
|