fix(接口定义): csv优化

This commit is contained in:
fit2-zhao 2021-11-09 14:17:41 +08:00 committed by fit2-zhao
parent a1e41339ec
commit 407e177d81
3 changed files with 151 additions and 102 deletions

View File

@ -7,9 +7,9 @@ import org.springframework.kafka.config.TopicBuilder;
@Configuration
public class KafkaConfig {
// 执行内容监听
public final static String EXEC_TOPIC = "ms-automation-exec-topic";
public final static String EXEC_TOPIC = "ms-automation-exec-topic123";
//执行结果回传
public static final String TOPICS = "ms-api-exec-topic";
public static final String TOPICS = "ms-api-exec-topic123";
@Bean
public NewTopic apiExecTopic() {

View File

@ -1,5 +1,7 @@
<template>
<span>
<el-row>
<el-col :span="18">
<el-upload
action="#"
class="api-body-upload"
@ -10,7 +12,6 @@
:limit="1"
:on-exceed="exceed"
ref="upload">
<div class="upload-default">
<i class="el-icon-plus"/>
</div>
@ -22,8 +23,12 @@
</span>
</span>
</div>
</el-upload>
</el-col>
<el-col :span="6">
<el-button size="small" style="margin: 3px 5px" @click="download">下载</el-button>
</el-col>
</el-row>
</span>
</template>
@ -42,6 +47,28 @@
}
},
methods: {
download() {
//
if (this.parameter.files && this.parameter.files.length > 0 && this.parameter.files[0].file) {
console.log("local",this.parameter.files[0].file)
}
//
if (this.parameter.files && this.parameter.files.length > 0 && !this.parameter.files[0].file) {
let file = this.parameter.files[0];
let conf = {
url: "/api/automation/file/download",
method: 'post',
data: file,
responseType: 'blob',
};
this.result = this.$request(conf).then(response => {
const content = response.data;
const blob = new Blob([content]);
console.log(content)
});
}
},
handleRemove(file) {
this.$refs.upload.handleRemove(file);
for (let i = 0; i < this.parameter.files.length; i++) {

View File

@ -298,10 +298,32 @@ export default {
this.$warning("请选择一条数据删除");
return;
}
let message = "";
ids.forEach(row => {
const v = this.variables.find(d => d.id === row);
if (v && v.type === 'CSV' && v.name) {
message += v.name + ";";
}
});
if (message !== "") {
message = message.substr(0, message.length - 1);
this.$alert('是否确认删除CSV【 ' + message + " 】?", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
ids.forEach(row => {
const index = this.variables.findIndex(d => d.id === row);
this.variables.splice(index, 1);
});
}
}
});
} else {
ids.forEach(row => {
const index = this.variables.findIndex(d => d.id === row);
this.variables.splice(index, 1);
});
}
this.selection = [];
this.editData = {type: "CONSTANT"};
},