7ac06c40 by 任超

style:定时任务

1 parent 40dcaf8d
import request from '@/utils/request'
import SERVER from './config'
class system {
class sjsbTask {
// 定时任务
// 定时任务查询接口
async getTaskListByName (data) {
return request({
url: '/sjsbTask/getTaskListByName',
url: SERVER.SERVERAPI + '/sjsbTask/getTaskListByName',
method: 'post',
data
})
......@@ -14,7 +14,7 @@ class system {
// 定时任务新增接口
async sjsbTaskSave (data) {
return request({
url: '/sjsbTask/save',
url: SERVER.SERVERAPI + '/sjsbTask/save',
method: 'post',
data
})
......@@ -22,7 +22,7 @@ class system {
// 修改定时任务执行时间接口
async updateCron (data) {
return request({
url: '/sjsbTask/updateCron',
url: SERVER.SERVERAPI + '/sjsbTask/updateCron',
method: 'post',
data
})
......@@ -30,7 +30,7 @@ class system {
// 定时任务删除接口
async sjsbTaskRemove (id) {
return request({
url: '/sjsbTask/remove',
url: SERVER.SERVERAPI + '/sjsbTask/remove',
method: 'get',
params: {
id: id
......@@ -40,7 +40,7 @@ class system {
// 暂停任务接口
async pauseJob (id) {
return request({
url: '/sjsbTask/pauseJob',
url: SERVER.SERVERAPI + '/sjsbTask/pauseJob',
method: 'get',
params: {
id: id
......@@ -50,7 +50,7 @@ class system {
// 恢复任务接口
async resumeJob (id) {
return request({
url: '/sjsbTask/resumeJob',
url: SERVER.SERVERAPI + '/sjsbTask/resumeJob',
method: 'get',
params: {
id: id
......@@ -60,7 +60,7 @@ class system {
// 激活任务接口
async activateJob (id) {
return request({
url: '/sjsbTask/activateJob',
url: SERVER.SERVERAPI + '/sjsbTask/activateJob',
method: 'get',
params: {
id: id
......@@ -70,7 +70,7 @@ class system {
// 手动测试
async sjsbTaskRun (id) {
return request({
url: '/sjsbTask/run',
url: SERVER.SERVERAPI + '/sjsbTask/run',
method: 'get',
params: {
id: id
......@@ -78,4 +78,4 @@ class system {
})
}
}
export default new system()
\ No newline at end of file
export default new sjsbTask()
\ No newline at end of file
......
......@@ -40,7 +40,7 @@
</template>
<script>
import system from '@/api/system.js'
import sjsbTask from '@/api/sjsbTask.js'
export default {
props: {
taskData: {
......@@ -92,7 +92,7 @@ export default {
if (valid) {
if (!_this.taskData) {
try {
let res = await system.sjsbTaskSave(_this.ruleForm)
let res = await sjsbTask.sjsbTaskSave(_this.ruleForm)
if (res.code == 200) {
_this.loading = false
_this.$message({
......@@ -108,7 +108,7 @@ export default {
}
} else {
try {
let res = await system.updateCron(_this.ruleForm)
let res = await sjsbTask.updateCron(_this.ruleForm)
if (res.code == 200) {
_this.$message({
message: res.message,
......
......@@ -28,7 +28,7 @@
<script>
// 定时任务
import data from "./data"
import system from '@/api/system.js'
import sjsbTask from '@/api/sjsbTask.js'
import tableMixin from '@/mixins/tableMixin.js'
import addTask from '../components/addTask.vue'
export default {
......@@ -114,7 +114,7 @@ export default {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await system.getTaskListByName(this.form)
} = await sjsbTask.getTaskListByName(this.form)
this.tableData.data = list
this.pageData = {
pageSize,
......@@ -134,7 +134,7 @@ export default {
type: 'warning',
})
.then(() => {
system.pauseJob(row.id)
sjsbTask.pauseJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -166,7 +166,7 @@ export default {
type: 'warning',
})
.then(() => {
system.activateJob(row.id)
sjsbTask.activateJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -198,7 +198,7 @@ export default {
type: 'warning',
})
.then(() => {
system.resumeJob(row.id)
sjsbTask.resumeJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -230,7 +230,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRun(row.id)
sjsbTask.sjsbTaskRun(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$alert(res.message, '提示', {
......@@ -265,7 +265,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRemove(row.id)
sjsbTask.sjsbTaskRemove(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......
......@@ -28,7 +28,7 @@
<script>
// 定时任务
import data from "./data"
import system from '@/api/system.js'
import sjsbTask from '@/api/sjsbTask.js'
import tableMixin from '@/mixins/tableMixin.js'
import addTask from '../components/addTask.vue'
export default {
......@@ -114,7 +114,7 @@ export default {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await system.getTaskListByName(this.form)
} = await sjsbTask.getTaskListByName(this.form)
this.tableData.data = list
this.pageData = {
pageSize,
......@@ -134,7 +134,7 @@ export default {
type: 'warning',
})
.then(() => {
system.pauseJob(row.id)
sjsbTask.pauseJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -166,7 +166,7 @@ export default {
type: 'warning',
})
.then(() => {
system.activateJob(row.id)
sjsbTask.activateJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -198,7 +198,7 @@ export default {
type: 'warning',
})
.then(() => {
system.resumeJob(row.id)
sjsbTask.resumeJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -230,7 +230,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRun(row.id)
sjsbTask.sjsbTaskRun(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$alert(res.message, '提示', {
......@@ -265,7 +265,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRemove(row.id)
sjsbTask.sjsbTaskRemove(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......
......@@ -28,7 +28,7 @@
<script>
// 定时任务
import data from "./data"
import system from '@/api/system.js'
import sjsbTask from '@/api/sjsbTask.js'
import tableMixin from '@/mixins/tableMixin.js'
import addTask from '../components/addTask.vue'
export default {
......@@ -114,7 +114,7 @@ export default {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await system.getTaskListByName(this.form)
} = await sjsbTask.getTaskListByName(this.form)
this.tableData.data = list
this.pageData = {
pageSize,
......@@ -134,7 +134,7 @@ export default {
type: 'warning',
})
.then(() => {
system.pauseJob(row.id)
sjsbTask.pauseJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -166,7 +166,7 @@ export default {
type: 'warning',
})
.then(() => {
system.activateJob(row.id)
sjsbTask.activateJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -198,7 +198,7 @@ export default {
type: 'warning',
})
.then(() => {
system.resumeJob(row.id)
sjsbTask.resumeJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -230,7 +230,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRun(row.id)
sjsbTask.sjsbTaskRun(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$alert(res.message, '提示', {
......@@ -265,7 +265,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRemove(row.id)
sjsbTask.sjsbTaskRemove(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......
......@@ -6,7 +6,7 @@
<script>
// 定时任务
import data from "./data"
import system from '@/api/system.js'
import sjsbTask from '@/api/sjsbTask.js'
import tableMixin from '@/mixins/tableMixin.js'
import addTask from '../components/addTask.vue'
export default {
......@@ -92,7 +92,7 @@ export default {
try {
this.form = Object.assign(this.form, this.formData)
let { result: { list, total, pages: pageSize, pageNum: current }
} = await system.getTaskListByName(this.form)
} = await sjsbTask.getTaskListByName(this.form)
this.tableData.data = list
this.pageData = {
pageSize,
......@@ -112,7 +112,7 @@ export default {
type: 'warning',
})
.then(() => {
system.pauseJob(row.id)
sjsbTask.pauseJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -144,7 +144,7 @@ export default {
type: 'warning',
})
.then(() => {
system.activateJob(row.id)
sjsbTask.activateJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -176,7 +176,7 @@ export default {
type: 'warning',
})
.then(() => {
system.resumeJob(row.id)
sjsbTask.resumeJob(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......@@ -208,7 +208,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRun(row.id)
sjsbTask.sjsbTaskRun(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$alert(res.message, '提示', {
......@@ -243,7 +243,7 @@ export default {
type: 'warning',
})
.then(() => {
system.sjsbTaskRemove(row.id)
sjsbTask.sjsbTaskRemove(row.id)
.then((res) => {
if ((res.code = 200)) {
this.$message({
......