From d149f4806af2f91669f27737a179bb15278e01bd Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 06 五月 2026 17:07:23 +0800
Subject: [PATCH] 1.定时任务修改
---
src/views/basicSettings/cronTime.vue | 77 +++++++++++++++++++++++++++++++++++---
1 files changed, 70 insertions(+), 7 deletions(-)
diff --git a/src/views/basicSettings/cronTime.vue b/src/views/basicSettings/cronTime.vue
index b828741..16d94cc 100644
--- a/src/views/basicSettings/cronTime.vue
+++ b/src/views/basicSettings/cronTime.vue
@@ -248,8 +248,21 @@
</el-input>
</el-form-item>
- <el-form-item label="ApiUrl" prop="ApiUrl">
- <el-input v-model="dialogForm.ApiUrl" style="width: 200px" />
+ <el-form-item label="璇锋眰鏂瑰紡" prop="RequestType">
+ <!-- <el-input v-model="dialogForm.RequestType" style="width: 200px" />-->
+ <el-select
+ v-model="dialogForm.RequestType"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in RequestTypeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
</el-form-item>
<el-form-item label="header(Key)" prop="AuthKey">
<el-input v-model="dialogForm.AuthKey" style="width: 200px" />
@@ -257,12 +270,42 @@
<el-form-item label="header(value)" prop="AuthValue">
<el-input v-model="dialogForm.AuthValue" style="width: 200px" />
</el-form-item>
+ <el-form-item label="ApiUrl" prop="ApiUrl">
+ <el-input v-model="dialogForm.ApiUrl" style="width: 520px" />
+ </el-form-item>
- <!-- <el-form-item label="璇锋眰鏂瑰紡" prop="RequestType">-->
- <!-- <el-input v-model="dialogForm.RequestType" style="width: 200px" />-->
- <!-- </el-form-item>-->
<el-form-item label="鎻忚堪" prop="Describe">
<el-input v-model="dialogForm.Describe" type="textarea" style="width: 200px" />
+ </el-form-item>
+
+ <el-form-item required label="鏄惁鎺ㄩ��">
+ <el-switch
+ v-model="dialogForm.MessagePush"
+ style="width: 200px"
+ active-color="#13ce66"
+ inactive-color="#eee"
+ active-value="Y"
+ inactive-value="N"
+ />
+ </el-form-item>
+
+ <el-form-item v-if="dialogForm.MessagePush==='Y'" label="鎺ㄩ�佷汉鍛�">
+ <el-select
+ v-model="dialogForm.PushUserCode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ clearable
+ multiple
+ collapse-tags
+ >
+ <el-option
+ v-for="item in userArr"
+ :key="item.usercode"
+ :label="item.username"
+ :value="item.usercode"
+ />
+ </el-select>
</el-form-item>
</el-form>
@@ -336,6 +379,7 @@
import { cron } from 'vue-cron'
import cronstrue from 'cronstrue/i18n'
import vcrontab from '../../components/VcronTab/index'
+import { PersonPermissions } from '@/api/GeneralBasicData'
export default {
name: 'CronTime',
@@ -374,7 +418,9 @@
Describe: '', // 鎻忚堪
RequestType: 'POST', // 璇锋眰绫诲瀷
LastRunTime: '', // 鏈�鍚庢墽琛屾椂闂�
- Status: 0// 鐘舵��
+ Status: 0, // 鐘舵��
+ MessagePush: 'Y',
+ PushUserCode: []
},
cronPopover: false,
@@ -411,7 +457,12 @@
},
dialogVisible2: false,
OrgTypeArrxx: [],
- recordData: []// 鏌ョ湅璁板綍鏁扮粍
+ recordData: [], // 鏌ョ湅璁板綍鏁扮粍
+ userArr: [],
+ RequestTypeArr: [
+ { code: 'POST', name: 'POST' },
+ { code: 'GET', name: 'GET' }
+ ]
}
},
@@ -422,12 +473,17 @@
},
created() {
this.getTaskBackGroundGetJobs()
+ this.getPersonPermissions()
},
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
methods: {
+ async getPersonPermissions() {
+ const { data: res } = await PersonPermissions()
+ this.userArr = res
+ },
crontabFill(val) {
this.dialogForm.Interval = val
// const t = cronstrue.toString(this.dialogForm.Interval, { locale: 'zh_CN' })
@@ -491,6 +547,8 @@
this.dialogForm.AuthKey = row.AuthKey
this.dialogForm.AuthValue = row.AuthValue
this.dialogForm.Describe = row.Describe
+ this.dialogForm.RequestType = row.RequestType
+ this.dialogForm.PushUserCode = row.MessagePush === 'Y' ? row.PushUserCode.split(',') : ''
})
},
// 鍒犻櫎鎸夐挳
@@ -562,6 +620,8 @@
this.dialogForm.Describe = ''
this.dialogForm.RequestType = 'POST'
this.dialogForm.LastRunTime = ''
+ this.dialogForm.MessagePush = 'Y'
+ this.dialogForm.PushUserCode = []
this.dialogForm.Status = 0
this.$refs.dialogForm.clearValidate()
},
@@ -585,6 +645,7 @@
// }
if (this.operation === 'add') {
+ this.dialogForm.PushUserCode = this.dialogForm.MessagePush === 'Y' ? this.dialogForm.PushUserCode.join(',') : ''
TaskBackGroundAdd(this.dialogForm).then(res => {
if (res.code === '200') {
this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
@@ -595,6 +656,8 @@
}
})
} else {
+ // console.log(this.dialogForm.MessagePush === 'Y')
+ this.dialogForm.PushUserCode = this.dialogForm.MessagePush === 'Y' ? this.dialogForm.PushUserCode.join(',') : ''
TaskBackGroundUpdate(this.dialogForm).then(res => {
if (res.code === '200') {
this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
--
Gitblit v1.9.3