Explorar el Código

Merge branch 'main' of github.com:le5le-com/visualization-design

Alsmile hace 1 año
padre
commit
3464aad6dc
Se han modificado 2 ficheros con 32 adiciones y 5 borrados
  1. 11 2
      src/services/defaults.ts
  2. 21 3
      src/views/components/Network.vue

+ 11 - 2
src/services/defaults.ts

@@ -2603,8 +2603,17 @@ export const formComponents = [
       },
       {
         name: '船型开关',
-        icon: 'l-pc', //l-chuanxingkaiguan
-        data: {},
+        icon: 'l-chuanxingkaiguan',
+        data: {
+          name: 'rockerSwitch',
+          width: 72,
+          height: 128,
+          disableInput: true,
+          offColor: '#BFBFBF',
+          onColor: '#1890ff',
+          color: '#4583FF', //66 33
+          background: '#4583FF33',
+        },
       },
       {
         name: '转换开关',

+ 21 - 3
src/views/components/Network.vue

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