|
@@ -72,7 +72,12 @@
|
|
<label>URL地址</label>
|
|
<label>URL地址</label>
|
|
<t-input v-model="modelValue.url" />
|
|
<t-input v-model="modelValue.url" />
|
|
</div>
|
|
</div>
|
|
- <template v-if="modelValue.protocol === 'websocket'"> </template>
|
|
|
|
|
|
+ <template v-if="modelValue.protocol === 'websocket'">
|
|
|
|
+ <div class="form-item mt-8">
|
|
|
|
+ <label>protocols</label>
|
|
|
|
+ <t-input v-model="modelValue.options.protocols" />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
<template v-else-if="modelValue.protocol === 'http'">
|
|
<template v-else-if="modelValue.protocol === 'http'">
|
|
<div class="form-item mt-8">
|
|
<div class="form-item mt-8">
|
|
<label>请求方式</label>
|
|
<label>请求方式</label>
|
|
@@ -83,18 +88,30 @@
|
|
</div>
|
|
</div>
|
|
<div class="form-item mt-8">
|
|
<div class="form-item mt-8">
|
|
<label>请求头</label>
|
|
<label>请求头</label>
|
|
- <t-textarea
|
|
|
|
|
|
+ <!-- <t-textarea
|
|
v-model="modelValue.headers"
|
|
v-model="modelValue.headers"
|
|
:autosize="{ minRows: 3, maxRows: 5 }"
|
|
:autosize="{ minRows: 3, maxRows: 5 }"
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
|
|
+ /> -->
|
|
|
|
+ <CodeEditor
|
|
|
|
+ :json="true"
|
|
|
|
+ v-model="modelValue.headers"
|
|
|
|
+ class="mt-4"
|
|
|
|
+ style="height: 50px"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div v-if="modelValue.method === 'POST'" class="form-item mt-8">
|
|
<div v-if="modelValue.method === 'POST'" class="form-item mt-8">
|
|
<label>请求体</label>
|
|
<label>请求体</label>
|
|
- <t-textarea
|
|
|
|
|
|
+ <!-- <t-textarea
|
|
v-model="modelValue.body"
|
|
v-model="modelValue.body"
|
|
:autosize="{ minRows: 3, maxRows: 5 }"
|
|
:autosize="{ minRows: 3, maxRows: 5 }"
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
|
|
+ /> -->
|
|
|
|
+ <CodeEditor
|
|
|
|
+ :json="true"
|
|
|
|
+ v-model="modelValue.body"
|
|
|
|
+ class="mt-4"
|
|
|
|
+ style="height: 50px"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -138,6 +155,7 @@ import { onBeforeMount, ref } from 'vue';
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
import { debounce } from '@/services/debouce';
|
|
import { debounce } from '@/services/debouce';
|
|
import { MessagePlugin } from 'tdesign-vue-next';
|
|
import { MessagePlugin } from 'tdesign-vue-next';
|
|
|
|
+import CodeEditor from '@/views/components/common/CodeEditor.vue';
|
|
|
|
|
|
const { modelValue, mode } = defineProps<{
|
|
const { modelValue, mode } = defineProps<{
|
|
modelValue: any;
|
|
modelValue: any;
|