From eaee792bf53c73841ad8baab7b62784589d90729 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Tue, 31 May 2022 14:39:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4cron=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/modules/task/components/cron/cn.ts | 54 -- src/modules/task/components/cron/cron.vue | 792 --------------------- src/modules/task/components/cron/index.tsx | 66 -- src/modules/task/views/task.vue | 38 +- 5 files changed, 7 insertions(+), 945 deletions(-) delete mode 100644 src/modules/task/components/cron/cn.ts delete mode 100644 src/modules/task/components/cron/cron.vue delete mode 100644 src/modules/task/components/cron/index.tsx diff --git a/package.json b/package.json index 3a621f4..5bee8ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.2.2", + "version": "5.2.3", "scripts": { "dev": "vite --host", "build": "vite build", diff --git a/src/modules/task/components/cron/cn.ts b/src/modules/task/components/cron/cn.ts deleted file mode 100644 index 76c5993..0000000 --- a/src/modules/task/components/cron/cn.ts +++ /dev/null @@ -1,54 +0,0 @@ -export default { - Seconds: { - name: "秒", - every: "每一秒钟", - interval: ["每隔", "秒执行 从", "秒开始"], - specific: "具体秒数(可多选)", - cycle: ["周期从", "到", "秒"] - }, - Minutes: { - name: "分", - every: "每一分钟", - interval: ["每隔", "分执行 从", "分开始"], - specific: "具体分钟数(可多选)", - cycle: ["周期从", "到", "分"] - }, - Hours: { - name: "时", - every: "每一小时", - interval: ["每隔", "小时执行 从", "小时开始"], - specific: "具体小时数(可多选)", - cycle: ["周期从", "到", "小时"] - }, - Day: { - name: "天", - every: "每一天", - intervalWeek: ["每隔", "周执行 从", "开始"], - intervalDay: ["每隔", "天执行 从", "天开始"], - specificWeek: "具体星期几(可多选)", - specificDay: "具体天数(可多选)", - lastDay: "在这个月的最后一天", - lastWeekday: "在这个月的最后一个工作日", - lastWeek: ["在这个月的最后一个"], - beforeEndMonth: ["在本月底前", "天"], - nearestWeekday: ["最近的工作日(周一至周五)至本月", "日"], - someWeekday: ["在这个月的第", "个"] - }, - Week: ["天", "一", "二", "三", "四", "五", "六"].map((val) => "星期" + val), - Month: { - name: "月", - every: "每一月", - interval: ["每隔", "月执行 从", "月开始"], - specific: "具体月数(可多选)", - cycle: ["从", "到", "月之间的每个月"] - }, - Year: { - name: "年", - every: "每一年", - interval: ["每隔", "年执行 从", "年开始"], - specific: "具体年份(可多选)", - cycle: ["从", "到", "年之间的每一年"] - }, - Save: "保存", - Close: "关闭" -}; diff --git a/src/modules/task/components/cron/cron.vue b/src/modules/task/components/cron/cron.vue deleted file mode 100644 index 28a7e4b..0000000 --- a/src/modules/task/components/cron/cron.vue +++ /dev/null @@ -1,792 +0,0 @@ - - - - - diff --git a/src/modules/task/components/cron/index.tsx b/src/modules/task/components/cron/index.tsx deleted file mode 100644 index 1a02175..0000000 --- a/src/modules/task/components/cron/index.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { defineComponent, h, ref, watch } from "vue"; -import Cron from "./cron.vue"; - -export default defineComponent({ - name: "cl-cron", - - components: { - Cron - }, - - props: { - modelValue: { - type: String, - default: "" - }, - placeholder: { - type: String, - default: "请输入定时策略" - }, - disabled: Boolean, - readonly: Boolean - }, - - emits: ["update:modelValue", "change"], - - setup(props, { emit }) { - const cron = ref(""); - - watch(cron, (val: string) => { - emit("update:modelValue", val); - emit("change", val); - }); - - watch( - () => props.modelValue, - (val: string) => { - cron.value = val; - }, - { - immediate: true - } - ); - - return { - cron, - open, - close - }; - }, - - render(ctx: any) { - return ( -
- - - -
- ); - } -}); diff --git a/src/modules/task/views/task.vue b/src/modules/task/views/task.vue index a86f7d4..90685fd 100644 --- a/src/modules/task/views/task.vue +++ b/src/modules/task/views/task.vue @@ -199,11 +199,7 @@ - - - + @@ -214,7 +210,6 @@ import Draggable from "vuedraggable/src/vuedraggable"; import { checkPerm } from "/$/base"; import { useCool } from "/@/cool"; import { ContextMenu, useForm } from "@cool-vue/crud"; -import Cron from "../components/cron"; import { Refresh, CirclePlus, @@ -428,7 +423,6 @@ async function edit(params: any) { props: { onChange(v: number) { if (v == 0) { - Form.value?.setForm("limit", undefined); Form.value?.setForm("every", undefined); } else { Form.value?.setForm("cron", undefined); @@ -442,25 +436,16 @@ async function edit(params: any) { prop: "cron", hidden: ({ scope }) => scope.taskType == 1, component: { - name: "slot-cron" + name: "el-input", + props: { + placeholder: "* * * * * *" + } }, rules: { required: true, message: "cron不能为空" } }, - { - label: "次数", - prop: "limit", - hidden: ({ scope }) => scope.taskType == 0, - component: { - name: "el-input-number", - props: { - min: 1, - max: 10000 - } - } - }, { label: "间隔(秒)", prop: "every", @@ -490,18 +475,7 @@ async function edit(params: any) { { label: "开始时间", prop: "startDate", - hidden: ({ scope }: any) => scope.taskType == 1, - component: { - name: "el-date-picker", - props: { - type: "datetime", - "value-format": "YYYY-MM-DD HH:mm:ss" - } - } - }, - { - label: "结束时间", - prop: "endDate", + hidden: ({ scope }) => scope.taskType == 1, component: { name: "el-date-picker", props: {