Compare commits

...

2 Commits

Author SHA1 Message Date
Cp0204
c8332049c1 🎨 运行星期全选框添加半选状态
Some checks failed
Docker Publish / build-and-push (push) Has been cancelled
2024-12-07 15:16:28 +08:00
Cp0204
33426f5fc8 运行星期添加“全选”复选框
- 添加“全选”复选框以快速选择或取消
- 实现 toggleAllWeekdays 方法以处理逻辑
2024-12-07 13:56:08 +08:00

View File

@ -262,6 +262,10 @@
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-2 col-form-label">运行星期</label> <label class="col-sm-2 col-form-label">运行星期</label>
<div class="col-sm-10 col-form-label"> <div class="col-sm-10 col-form-label">
<div class="form-check form-check-inline" title="也可用作任务总开关">
<input class="form-check-input" type="checkbox" :checked="task.runweek.length === 7" @change="toggleAllWeekdays(task)" :indeterminate.prop="task.runweek.length > 0 && task.runweek.length < 7">
<label class="form-check-label">全选</label>
</div>
<div class="form-check form-check-inline" v-for="(day, index) in weekdays" :key="index"> <div class="form-check form-check-inline" v-for="(day, index) in weekdays" :key="index">
<input class="form-check-input" type="checkbox" v-model="task.runweek" :value="index+1"> <input class="form-check-input" type="checkbox" v-model="task.runweek" :value="index+1">
<label class="form-check-label" v-html="day"></label> <label class="form-check-label" v-html="day"></label>
@ -646,6 +650,13 @@
isPluginDisabled(pluginName) { isPluginDisabled(pluginName) {
const pluginsFlagsArray = this.plugin_flags.split(','); const pluginsFlagsArray = this.plugin_flags.split(',');
return pluginsFlagsArray.includes(`-${pluginName}`); return pluginsFlagsArray.includes(`-${pluginName}`);
},
toggleAllWeekdays(task) {
if (task.runweek.length === 7) {
task.runweek = [];
} else {
task.runweek = [1, 2, 3, 4, 5, 6, 7];
}
} }
} }
}); });