Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
f244fe18
提交
f244fe18
authored
12月 29, 2021
作者:
若依
提交者:
Gitee
12月 29, 2021
浏览文件
操作
浏览文件
下载
差异文件
!395 fix
https://gitee.com/y_project/RuoYi-Vue/issues/I4O5WD
Merge pull request !395 from 马小法/master
上级
0e771a6c
1294f682
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
114 行增加
和
115 行删除
+114
-115
hour.vue
ruoyi-ui/src/components/Crontab/hour.vue
+114
-115
没有找到文件。
ruoyi-ui/src/components/Crontab/hour.vue
浏览文件 @
f244fe18
<
template
>
<el-form
size=
"small"
>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"1"
>
小时,允许的通配符[, - * /]
</el-radio>
</el-form-item>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"2"
>
周期从
<el-input-number
v-model=
'cycle01'
:min=
"0"
:max=
"22"
/>
-
<el-input-number
v-model=
'cycle02'
:min=
"cycle01 ? cycle01 + 1 : 1"
:max=
"23"
/>
小时
</el-radio>
</el-form-item>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"3"
>
从
<el-input-number
v-model=
'average01'
:min=
"0"
:max=
"22"
/>
小时开始,每
<el-input-number
v-model=
'average02'
:min=
"1"
:max=
"23 - average01 || 0"
/>
小时执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"4"
>
指定
<el-select
clearable
v-model=
"checkboxList"
placeholder=
"可多选"
multiple
style=
"width:100%"
>
<el-option
v-for=
"item in 60"
:key=
"item"
:value=
"item-1"
>
{{
item
-
1
}}
</el-option>
</el-select>
</el-radio>
</el-form-item>
</el-form>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
radioValue
:
1
,
cycle01
:
0
,
cycle02
:
1
,
average01
:
0
,
average02
:
1
,
checkboxList
:
[],
checkNum
:
this
.
$options
.
propsData
.
check
}
},
name
:
'crontab-hour'
,
props
:
[
'check'
,
'cron'
],
methods
:
{
// 单选按钮值变化时
radioChange
()
{
switch
(
this
.
radioValue
)
{
case
1
:
this
.
$emit
(
'update'
,
'hour'
,
'*'
)
break
;
case
2
:
this
.
$emit
(
'update'
,
'hour'
,
this
.
cycleTotal
);
break
;
case
3
:
this
.
$emit
(
'update'
,
'hour'
,
this
.
averageTotal
);
break
;
case
4
:
this
.
$emit
(
'update'
,
'hour'
,
this
.
checkboxString
);
break
;
}
},
// 周期两个值变化时
cycleChange
()
{
if
(
this
.
radioValue
==
'2'
)
{
this
.
$emit
(
'update'
,
'hour'
,
this
.
cycleTotal
);
}
},
// 平均两个值变化时
averageChange
()
{
if
(
this
.
radioValue
==
'3'
)
{
this
.
$emit
(
'update'
,
'hour'
,
this
.
averageTotal
);
}
},
// checkbox值变化时
checkboxChange
()
{
if
(
this
.
radioValue
==
'4'
)
{
this
.
$emit
(
'update'
,
'hour'
,
this
.
checkboxString
);
}
}
},
watch
:
{
'radioValue'
:
'radioChange'
,
'cycleTotal'
:
'cycleChange'
,
'averageTotal'
:
'averageChange'
,
'checkboxString'
:
'checkboxChange'
},
computed
:
{
// 计算两个周期值
cycleTotal
:
function
()
{
const
cycle01
=
this
.
checkNum
(
this
.
cycle01
,
0
,
22
)
const
cycle02
=
this
.
checkNum
(
this
.
cycle02
,
cycle01
?
cycle01
+
1
:
1
,
23
)
return
cycle01
+
'-'
+
cycle02
;
},
// 计算平均用到的值
averageTotal
:
function
()
{
const
average01
=
this
.
checkNum
(
this
.
average01
,
0
,
22
)
const
average02
=
this
.
checkNum
(
this
.
average02
,
1
,
23
-
average01
||
0
)
return
average01
+
'/'
+
average02
;
},
// 计算勾选的checkbox值合集
checkboxString
:
function
()
{
let
str
=
this
.
checkboxList
.
join
();
return
str
==
''
?
'*'
:
str
;
}
}
}
</
script
>
\ No newline at end of file
<
template
>
<el-form
size=
"small"
>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"1"
>
小时,允许的通配符[, - * /]
</el-radio>
</el-form-item>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"2"
>
周期从
<el-input-number
v-model=
'cycle01'
:min=
"0"
:max=
"22"
/>
-
<el-input-number
v-model=
'cycle02'
:min=
"cycle01 ? cycle01 + 1 : 1"
:max=
"23"
/>
小时
</el-radio>
</el-form-item>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"3"
>
从
<el-input-number
v-model=
'average01'
:min=
"0"
:max=
"22"
/>
小时开始,每
<el-input-number
v-model=
'average02'
:min=
"1"
:max=
"23 - average01 || 0"
/>
小时执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio
v-model=
'radioValue'
:label=
"4"
>
指定
<el-select
clearable
v-model=
"checkboxList"
placeholder=
"可多选"
multiple
style=
"width:100%"
>
<el-option
v-for=
"item in 24"
:key=
"item"
:value=
"item-1"
>
{{
item
-
1
}}
</el-option>
</el-select>
</el-radio>
</el-form-item>
</el-form>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
radioValue
:
1
,
cycle01
:
0
,
cycle02
:
1
,
average01
:
0
,
average02
:
1
,
checkboxList
:
[],
checkNum
:
this
.
$options
.
propsData
.
check
}
},
name
:
'crontab-hour'
,
props
:
[
'check'
,
'cron'
],
methods
:
{
// 单选按钮值变化时
radioChange
()
{
switch
(
this
.
radioValue
)
{
case
1
:
this
.
$emit
(
'update'
,
'hour'
,
'*'
)
break
;
case
2
:
this
.
$emit
(
'update'
,
'hour'
,
this
.
cycleTotal
);
break
;
case
3
:
this
.
$emit
(
'update'
,
'hour'
,
this
.
averageTotal
);
break
;
case
4
:
this
.
$emit
(
'update'
,
'hour'
,
this
.
checkboxString
);
break
;
}
},
// 周期两个值变化时
cycleChange
()
{
if
(
this
.
radioValue
==
'2'
)
{
this
.
$emit
(
'update'
,
'hour'
,
this
.
cycleTotal
);
}
},
// 平均两个值变化时
averageChange
()
{
if
(
this
.
radioValue
==
'3'
)
{
this
.
$emit
(
'update'
,
'hour'
,
this
.
averageTotal
);
}
},
// checkbox值变化时
checkboxChange
()
{
if
(
this
.
radioValue
==
'4'
)
{
this
.
$emit
(
'update'
,
'hour'
,
this
.
checkboxString
);
}
}
},
watch
:
{
'radioValue'
:
'radioChange'
,
'cycleTotal'
:
'cycleChange'
,
'averageTotal'
:
'averageChange'
,
'checkboxString'
:
'checkboxChange'
},
computed
:
{
// 计算两个周期值
cycleTotal
:
function
()
{
const
cycle01
=
this
.
checkNum
(
this
.
cycle01
,
0
,
22
)
const
cycle02
=
this
.
checkNum
(
this
.
cycle02
,
cycle01
?
cycle01
+
1
:
1
,
23
)
return
cycle01
+
'-'
+
cycle02
;
},
// 计算平均用到的值
averageTotal
:
function
()
{
const
average01
=
this
.
checkNum
(
this
.
average01
,
0
,
22
)
const
average02
=
this
.
checkNum
(
this
.
average02
,
1
,
23
-
average01
||
0
)
return
average01
+
'/'
+
average02
;
},
// 计算勾选的checkbox值合集
checkboxString
:
function
()
{
let
str
=
this
.
checkboxList
.
join
();
return
str
==
''
?
'*'
:
str
;
}
}
}
</
script
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论