|
@@ -77,34 +77,34 @@
|
|
|
</div>
|
|
|
<div v-if="formInline.serviceType == 4" class="cj-form">
|
|
|
<div class="title">采集配置</div>
|
|
|
- <el-form class="flex" :inline="true" :model="formInline">
|
|
|
- <el-form-item label="采集类型">
|
|
|
- <el-select clearable size="small" v-model="formInline.taskType" placeholder="请选择采集类型">
|
|
|
+ <el-form class="flex" style="flex-wrap: wrap;justify-content: flex-start;" :inline="true" :model="formInline">
|
|
|
+ <el-form-item label="采集类型" style="margin-left: 50px;">
|
|
|
+ <el-select clearable size="small" style="width: 175px;" v-model="formInline.taskType" placeholder="请选择采集类型">
|
|
|
<el-option label="CRON表达式" :value="0"></el-option>
|
|
|
<el-option label="轮询方式" :value="1"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="循环数">
|
|
|
- <el-input clearable style="width:150px" v-model="formInline.loopCount" size="small" placeholder="请输入循环数"></el-input>
|
|
|
+ <el-form-item label="循环次数 " style="margin-left: 50px;">
|
|
|
+ <el-input clearable style="width:175px" v-model="formInline.loopCount" size="small" placeholder="循环次数"></el-input>
|
|
|
</el-form-item>
|
|
|
<template v-if="formInline.taskType == 1">
|
|
|
- <el-form-item label="采集频率">
|
|
|
- <el-input clearable style="width:150px" v-model="formInline.frequencyCount" size="small" placeholder="请输入采集频率"></el-input>
|
|
|
+ <el-form-item label="采集频率" style="margin-left: 50px;">
|
|
|
+ <el-input clearable style="width:170px" v-model="formInline.frequencyCount" size="small" placeholder="请输入采集频率"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="频率单位">
|
|
|
- <el-input clearable style="width:150px" v-model="formInline.frequencyUnit" size="small" placeholder="请输入频率单位"></el-input>
|
|
|
+ <el-form-item label="频率单位" style="margin-left: 50px;">
|
|
|
+ <el-input clearable style="width:170px" v-model="formInline.frequencyUnit" size="small" placeholder="请输入频率单位"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
<template v-else-if="formInline.taskType == 0">
|
|
|
- <el-form-item label="CRON表达式">
|
|
|
- <el-input clearable style="width:200px" v-model="formInline.cronExpress" size="small" placeholder="请输入CRON表达式"></el-input>
|
|
|
+ <el-form-item label="CRON表达式" style="margin-left: 50px;">
|
|
|
+ <el-input clearable style="width:300px" v-model="formInline.cronExpress" size="small" placeholder="请输入CRON表达式"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
- <el-form-item label="有效时间" prop="startTime">
|
|
|
- <el-date-picker size="small" v-model="formInline.taskValid" type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" placeholder="有效时间" />
|
|
|
+ <el-form-item label="有效时间" prop="startTime" style="margin-left: 50px;">
|
|
|
+ <el-date-picker size="small" style="width: 175px;" v-model="formInline.taskValid" type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" placeholder="有效时间" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="失效时间" prop="stopTime">
|
|
|
- <el-date-picker size="small" v-model="formInline.taskInvalid" type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" placeholder="有效时间" />
|
|
|
+ <el-form-item label="失效时间" prop="stopTime" style="margin-left: 50px;">
|
|
|
+ <el-date-picker size="small" style="width: 175px;" v-model="formInline.taskInvalid" type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" placeholder="有效时间" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -119,7 +119,7 @@
|
|
|
|
|
|
<script>
|
|
|
import Table from '@/views/newTable/index.vue'
|
|
|
-import { Query, newData, modifyData, moveData } from "@/api/webApi"
|
|
|
+import { Query, newData, modifyData, moveData,start,stop } from "@/api/webApi"
|
|
|
import * as _ from 'lodash'
|
|
|
export default {
|
|
|
name: 'NewService',
|
|
@@ -261,10 +261,10 @@ export default {
|
|
|
handleStart () {
|
|
|
if (this.dataObj.serviceID && this.dataType == 'edit') {
|
|
|
this.dataObj.runState = 1
|
|
|
- this.generalDataReception(2, this.dataObj)
|
|
|
+ this.controlService(1, this.dataObj)
|
|
|
} else if (this.dataType == 'add' && this.arrs[this.arrs.length - 1].serviceID) {
|
|
|
this.arrs[this.arrs.length - 1].runState = 1
|
|
|
- this.generalDataReception(2, this.arrs[this.arrs.length - 1])
|
|
|
+ this.controlService(1, this.arrs[this.arrs.length - 1])
|
|
|
}
|
|
|
else {
|
|
|
this.$message.error('请先添加当前服务后再操作')
|
|
@@ -274,10 +274,10 @@ export default {
|
|
|
handleStop () {
|
|
|
if (this.dataObj.serviceID && this.dataType == 'edit') {
|
|
|
this.dataObj.runState = 0
|
|
|
- this.generalDataReception(2, this.dataObj)
|
|
|
+ this.controlService(0, this.dataObj.serviceID)
|
|
|
} else if (this.dataType == 'add' && this.arrs[this.arrs.length - 1].serviceID) {
|
|
|
this.arrs[this.arrs.length - 1].runState = 0
|
|
|
- this.generalDataReception(2, this.arrs[this.arrs.length - 1])
|
|
|
+ this.controlService(0, this.arrs[this.arrs.length - 1].serviceID)
|
|
|
}
|
|
|
else {
|
|
|
this.$message.error('请先添加当前服务后再操作')
|
|
@@ -365,7 +365,7 @@ export default {
|
|
|
event: `${event}`,
|
|
|
};
|
|
|
const { code } =
|
|
|
- event == 1
|
|
|
+ event == 1
|
|
|
? await newData(params)
|
|
|
: event == 2
|
|
|
? await modifyData(params)
|
|
@@ -381,10 +381,30 @@ export default {
|
|
|
this.$message.error("操作失败");
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ //服务启停
|
|
|
+ async controlService (event, data) {
|
|
|
+ try {
|
|
|
+ const params = {
|
|
|
+ serviceId: data.serviceId
|
|
|
+ };
|
|
|
+ const { code } =
|
|
|
+ event == 1
|
|
|
+ ? await start(params)
|
|
|
+ : await stop(params);
|
|
|
+ if (code == 0) {
|
|
|
+ this.generalDataReception(2, data)
|
|
|
+ } else {
|
|
|
+ this.$message.error("操作失败");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error("操作失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@import "./css/index.scss";
|
|
|
-</style>
|
|
|
+</style>
|