|
@@ -210,8 +210,8 @@
|
|
|
</el-table>
|
|
|
</el-row>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="handelConfigSubmit()" size="mini">确定</el-button>
|
|
|
- <el-button @click="handelConfigCancel()" size="mini">取消</el-button>
|
|
|
+ <el-button v-if="false" type="primary" @click="handelConfigSubmit()" size="mini">确定</el-button>
|
|
|
+ <el-button @click="handelConfigCancel()" size="mini">关闭</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog title="日志" :visible.sync="dialogLog" width="800px" :close-on-click-modal="false">
|
|
@@ -423,7 +423,7 @@ export default {
|
|
|
this.statusTask = setInterval(() => {
|
|
|
this.getClientStatusByList();
|
|
|
this.getClientErrorList();
|
|
|
- }, 15000)
|
|
|
+ }, 60000)
|
|
|
|
|
|
},
|
|
|
beforeDestroy() {
|
|
@@ -584,41 +584,48 @@ export default {
|
|
|
this.$refs['configForm'].resetFields()
|
|
|
}
|
|
|
this.itemTableData = []
|
|
|
+ let data = this.configForm
|
|
|
+ this.refreshConfig(data.id)
|
|
|
},
|
|
|
handelConfigSubmit() {
|
|
|
- if (this.itemTableData.length === 0) {
|
|
|
- this.$message({
|
|
|
- message: '请配置需要采集的数据组',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: 'Loading',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- })
|
|
|
- let data = this.configForm;
|
|
|
- data.itemJson = JSON.stringify(this.itemTableData)
|
|
|
- saveConfigInfo(data).then((json) => {
|
|
|
- loading.close()
|
|
|
- if (json.code != 200) {
|
|
|
- this.$message({
|
|
|
- message: json.msg,
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$message({
|
|
|
- message: '配置成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.refreshConfig(data.id)
|
|
|
- this.handelConfigCancel()
|
|
|
- })
|
|
|
+ this.saveConfigInfo((data) => {
|
|
|
+ this.refreshConfig(data.id)
|
|
|
+ this.handelConfigCancel()
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
+ saveConfigInfo(callback){
|
|
|
+ if (this.itemTableData.length === 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '请配置需要采集的数据组',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
+ let data = this.configForm;
|
|
|
+ data.itemJson = JSON.stringify(this.itemTableData)
|
|
|
+ saveConfigInfo(data).then((json) => {
|
|
|
+ loading.close()
|
|
|
+ if (json.code != 200) {
|
|
|
+ this.$message({
|
|
|
+ message: json.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: '配置成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ if(callback)callback(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
handelStart(id) {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
@@ -702,8 +709,6 @@ export default {
|
|
|
}
|
|
|
return item
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
const arr = this.itemTableData.filter(item => {
|
|
|
return data.itemGroupId === item.itemGroupId
|
|
@@ -717,7 +722,10 @@ export default {
|
|
|
}
|
|
|
this.itemTableData.push(data)
|
|
|
}
|
|
|
- this.itemFormClose()
|
|
|
+ this.saveConfigInfo((data) => {
|
|
|
+ this.handelConfig(data.id)
|
|
|
+ this.itemFormClose()
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
itemFormClose() {
|
|
@@ -746,6 +754,9 @@ export default {
|
|
|
this.itemTableData = this.itemTableData.filter(item => {
|
|
|
return row.itemGroupId !== item.itemGroupId
|
|
|
})
|
|
|
+ this.saveConfigInfo((data) => {
|
|
|
+ this.handelConfig(data.id)
|
|
|
+ })
|
|
|
},
|
|
|
deleteCollector(row) {
|
|
|
if (row.runStatus === 1) {
|
|
@@ -760,7 +771,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.deleteCollectorApi(row.id).then(json => {
|
|
|
+ deleteCollectorApi(row.id).then(json => {
|
|
|
this.$message({
|
|
|
type: json.code === 200 ? 'success' : 'warning',
|
|
|
message: json.code === 200 ? '删除成功!' : json.msg
|
|
@@ -781,7 +792,10 @@ export default {
|
|
|
handelSettingSubmit() {
|
|
|
this.$refs['configForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.dialogSetting = false
|
|
|
+ this.saveConfigInfo((data) => {
|
|
|
+ this.handelConfig(data.id)
|
|
|
+ this.dialogSetting = false
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|