@fuxishi/el-cron-picker 1.0.6 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cron-picker
2
2
 
3
- vue3 element-plus cron 表达式生成器 正式版本 verision 1.0.6
3
+ vue3 element-plus cron 表达式生成器 正式版本 verision 1.1.1
4
4
 
5
5
  # 使用方式
6
6
 
@@ -17,26 +17,26 @@ npm i @fuxishi/el-cron-picker
17
17
  ## 全局引入
18
18
 
19
19
  ```ts
20
- import { createApp } from "vue"
21
- import App from "./App.vue"
22
- import ElementPlus from "element-plus"
23
- import "element-plus/dist/index.css"
20
+ import { createApp } from "vue";
21
+ import App from "./App.vue";
22
+ import ElementPlus from "element-plus";
23
+ import "element-plus/dist/index.css";
24
24
 
25
25
  // 全局引入
26
- import { ElCronPicker, ElCronConfig } from "@fuxishi/el-cron-picker"
27
- import "@fuxishi/el-cron-picker/dist/el-cron-picker.css"
26
+ import { ElCronPicker, ElCronConfig } from "@fuxishi/el-cron-picker";
27
+ import "@fuxishi/el-cron-picker/dist/el-cron-picker.css";
28
28
 
29
- const app = createApp(App)
30
- app.use(ElementPlus)
31
- app.use(ElCronPicker)
32
- app.mount("#app")
29
+ const app = createApp(App);
30
+ app.use(ElementPlus);
31
+ app.use(ElCronPicker);
32
+ app.mount("#app");
33
33
  ```
34
34
 
35
35
  ## 局部引入
36
36
 
37
37
  ```ts
38
- import { ElCronPicker, ElCronConfig } from "@fuxishi/el-cron-picker"
39
- import "@fuxishi/el-cron-picker/dist/el-cron-picker.css"
38
+ import { ElCronPicker, ElCronConfig } from "@fuxishi/el-cron-picker";
39
+ import "@fuxishi/el-cron-picker/dist/el-cron-picker.css";
40
40
  ```
41
41
 
42
42
  ## 示例
@@ -49,16 +49,43 @@ import "@fuxishi/el-cron-picker/dist/el-cron-picker.css"
49
49
  <el-cron-config v-model="cron" v-model:numberCount="numberCount" />
50
50
  </template>
51
51
  <script setup lang="ts">
52
- import { ref } from "vue"
53
- import { ElCronPicker, ElCronConfig } from "@fuxishi/el-cron-picker"
54
- import "@fuxishi/el-cron-picker/dist/el-cron-picker.css"
55
- const cron = ref("* * * * * ?")
56
- const numberCount = ref(50)
52
+ import { ref } from "vue";
53
+ import { ElCronPicker, ElCronConfig } from "@fuxishi/el-cron-picker";
54
+ import "@fuxishi/el-cron-picker/dist/el-cron-picker.css";
55
+ const cron = ref("* * * * * ?");
56
+ const numberCount = ref(50);
57
57
  </script>
58
58
  ```
59
59
 
60
60
  # 参数属性配置
61
61
 
62
+ ## langType 类型
63
+
64
+ 配置语言的时候可以引入
65
+ 例如:
66
+
67
+ ```ts
68
+ import { zh } from "@fuxishi/el-cron-picker";
69
+ ```
70
+
71
+ 也可自定义
72
+ 例如:
73
+
74
+ ```html
75
+ <template>
76
+ <ElCronPicker v-model="cron" :language="lang" />
77
+ <ElCronConfig v-model="cron" :language="lang" />
78
+ </template>
79
+ <script setup lang="ts">
80
+ import { ref } from "vue"
81
+ import { ElCronPicker,ElCronConfig } from "@fuxishi/el-cron-picker"
82
+ const lang = {
83
+ ......
84
+ }
85
+ const cron = ref("* * * * * ?")
86
+ </script>
87
+ ```
88
+
62
89
  ## ElCronPickerType 类型
63
90
 
64
91
  | 值 | 说明 |
@@ -77,13 +104,32 @@ import "@fuxishi/el-cron-picker/dist/el-cron-picker.css"
77
104
  | icon | 图标 | VNode \| string | - |
78
105
  | placeholder | 输入框占位符 | string | - |
79
106
  | width | 宽度 type 表示的 popover dialog drawer 的宽度 | string | - |
107
+ | language | 语言包 | [langType](./dist/types/lang.d.ts) | - |
80
108
 
81
109
  ## ElCronConfig 配置项
82
110
 
83
- | 属性 | 说明 | 类型 | 默认值 |
84
- | -------------------------------- | -------- | ------ | ------------------ |
85
- | modelValue\/v-model | 绑定值 | string | '\* \* \* \* \* ?' |
86
- | numberCount\/v-model:numberCount | 执行次数 | number | 50 |
111
+ | 属性 | 说明 | 类型 | 默认值 |
112
+ | -------------------------------- | -------- | ---------------------------------- | ------------------ |
113
+ | modelValue\/v-model | 绑定值 | string | '\* \* \* \* \* ?' |
114
+ | numberCount\/v-model:numberCount | 执行次数 | number | 50 |
115
+ | language | 语言包 | [langType](./dist/types/lang.d.ts) | - |
116
+
117
+ ## 事件
118
+
119
+ ### ElCronPicker
120
+
121
+ | 事件名 | 参数 | 说明 |
122
+ | ----------------- | ----------- | ---------------- |
123
+ | update:modelValue | - | 绑定值改变时触发 |
124
+ | executionError | error:Error | 执行错误时触发 |
125
+
126
+ ### ElCronConfig
127
+
128
+ | 事件名 | 参数 | 说明 |
129
+ | ------------------ | ----------- | ---------------- |
130
+ | update:modelValue | - | 绑定值改变时触发 |
131
+ | update:numberCount | - | 值改变 |
132
+ | executionError | error:Error | 执行错误时触发 |
87
133
 
88
134
  # 更新日志
89
135
 
@@ -96,5 +142,7 @@ import "@fuxishi/el-cron-picker/dist/el-cron-picker.css"
96
142
  | 1.0.4 | 解决 cronConfig 添加实时更新后数据错误问题 | 2025-11-06 |
97
143
  | 1.0.5 | 组件添加在编辑器中鼠标悬浮组件时显示提示信息,完善 docs 文档 修复打包时将 public 打包进去的问题 | 2025-11-06 |
98
144
  | 1.0.6 | 修复周期情况下如果出现例如"MON-FRI"变为"NAN-NAN"问题, 解决如果是已经输入到周的时候无法继续输入空格或删除最后方空格 解决月份如果是如的是类似 JAN 转换为 NAN 的问题 ,修复周部分的第 n 周的星期 n 转换错误问题, 解决年部分用"\/"分割报错的情况 | 2025-11-06 |
145
+ | 1.1.0 | 新增语言包配置 | 2025-11-07 |
146
+ | 1.1.1 | ①. 新增 executionError 执行错误事件 ②. isCron 正则校验增强 解决日参数 W LW L 错误返回 false 问题 ③. 最近运行事件计算方式如果 cron 表达式不满足条件自动清空最近运行 | 2025-11-10 |
99
147
 
100
148
  # 如遇到错误或什么问题 可邮箱zhangzjx1422@163.com联系
@@ -2,11 +2,14 @@ import { ElCronConfigProps } from '../types/ElCronConfig';
2
2
  declare const _default: import('vue').DefineComponent<ElCronConfigProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
3
  "update:modelValue": (...args: any[]) => void;
4
4
  "update:numberCount": (...args: any[]) => void;
5
+ executionError: (...args: any[]) => void;
5
6
  }, string, import('vue').PublicProps, Readonly<ElCronConfigProps> & Readonly<{
6
7
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
7
8
  "onUpdate:numberCount"?: ((...args: any[]) => any) | undefined;
9
+ onExecutionError?: ((...args: any[]) => any) | undefined;
8
10
  }>, {
9
11
  modelValue: string;
10
12
  numberCount: number;
13
+ language: import('../types/lang').langType;
11
14
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
15
  export default _default;
@@ -1,11 +1,14 @@
1
1
  import { ElCronPickerProps } from '../types/ElCronPicker';
2
2
  declare const _default: import('vue').DefineComponent<ElCronPickerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
3
  "update:modelValue": (...args: any[]) => void;
4
+ executionError: (...args: any[]) => void;
4
5
  }, string, import('vue').PublicProps, Readonly<ElCronPickerProps> & Readonly<{
5
6
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
7
+ onExecutionError?: ((...args: any[]) => any) | undefined;
6
8
  }>, {
7
9
  type: import('../types/ElCronPicker').ElCronPickerType;
8
10
  modelValue: string;
11
+ language: import('../types/lang').langType;
9
12
  placeholder: string;
10
13
  isVerify: boolean;
11
14
  width: string;
@@ -1,2 +1,2 @@
1
- .border-container[data-v-9230d5d4]{border:1px solid #eee;border-radius:5px;margin-bottom:10px;padding:10px}.el-radio-group[data-v-9230d5d4]{flex-direction:column;align-items:flex-start;display:flex}.el-radio-group .el-radio[data-v-9230d5d4]{margin:0 0 8px}.time-tag[data-v-9230d5d4]{margin-top:5px;margin-right:5px}.icon-span[data-v-38d4d8a7],.icon-span[data-v-38d4d8a7] svg{width:16px;height:16px}.el-drawer-header-custom{margin:0!important}
1
+ .border-container[data-v-4a630d49]{border:1px solid #eee;border-radius:5px;margin-bottom:10px;padding:10px}.el-radio-group[data-v-4a630d49]{flex-direction:column;align-items:flex-start;display:flex}.el-radio-group .el-radio[data-v-4a630d49]{margin:0 0 8px}.time-tag[data-v-4a630d49]{margin-top:5px;margin-right:5px}.icon-span[data-v-bee12c87],.icon-span[data-v-bee12c87] svg{width:16px;height:16px}.el-drawer-header-custom{margin:0!important}
2
2
  /*$vite$:1*/