|
|
|
@ -5,7 +5,8 @@
|
|
|
|
|
|
|
|
|
|
<div class="custom-node"
|
|
|
|
|
:style="{width:props.dimensions.width+'px',height:props.dimensions.height+'px',pointerEvents:props.isView?'auto': 'none'}">
|
|
|
|
|
<el-button type="primary" :style="{width:props.dimensions.width +'px',height:props.dimensions.height+'px'}"
|
|
|
|
|
<el-button :type="isErr ? 'danger':'primary'"
|
|
|
|
|
:style="{width:props.dimensions.width +'px',height:props.dimensions.height+'px'}"
|
|
|
|
|
:icon="Connection">{{ props.data.customData.name }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<span style="color:#fff">
|
|
|
|
@ -24,6 +25,7 @@ import request from '@/utils/request';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import { options } from '../../tool.js';
|
|
|
|
|
|
|
|
|
|
const isErr = ref(false);
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
isView: {
|
|
|
|
|
type: Boolean,
|
|
|
|
@ -90,11 +92,16 @@ const getOutputData = () => {
|
|
|
|
|
params: props.data.customData.method === 'get' ? params : '',
|
|
|
|
|
data: props.data.customData.method === 'post' ? params : ''
|
|
|
|
|
}).then(res => {
|
|
|
|
|
isErr.value = false;
|
|
|
|
|
let data = (options.isD ? res : res.data);
|
|
|
|
|
let output = {};
|
|
|
|
|
props.data.customData.outputData.forEach(item => {
|
|
|
|
|
output[item.name] = parseData(res.data, item.tier);
|
|
|
|
|
output[item.name] = parseData(data, item.tier);
|
|
|
|
|
});
|
|
|
|
|
props.data.outputData = output;
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
isErr.value = true;
|
|
|
|
|
console.log(e);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -104,7 +111,7 @@ onMounted(() => {
|
|
|
|
|
|
|
|
|
|
let interval = setInterval(() => {
|
|
|
|
|
getOutputData();
|
|
|
|
|
}, 1000);
|
|
|
|
|
}, props.data.options?.timeout || 5 * 1000);
|
|
|
|
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
clearInterval(interval);
|
|
|
|
|