fix: format code style
diff --git a/ui-vue3/src/views/resources/services/tabs/paramRoute.vue b/ui-vue3/src/views/resources/services/tabs/paramRoute.vue
index d2592f2..6bcfce3 100644
--- a/ui-vue3/src/views/resources/services/tabs/paramRoute.vue
+++ b/ui-vue3/src/views/resources/services/tabs/paramRoute.vue
@@ -27,22 +27,19 @@
</a-flex>
</template>
<a-form :labelCol="{ span: 3 }">
- <a-form-item
- label="选择方法"
- >
- <a-select
- v-model:value="method.value"
- style="width: 120px"
- >
- <a-select-option v-for="item, index in method.selectArr" :value="item" :key="index">
+ <a-form-item label="选择方法">
+ <a-select v-model:value="method.value" style="width: 120px">
+ <a-select-option v-for="(item, index) in method.selectArr" :value="item" :key="index">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
- <a-form-item
- label="指定方法参数"
- >
- <a-table :columns="functionParamsColumn" :data-source="props.paramRouteForm.functionParams" :pagination="false">
+ <a-form-item label="指定方法参数">
+ <a-table
+ :columns="functionParamsColumn"
+ :data-source="props.paramRouteForm.functionParams"
+ :pagination="false"
+ >
<template #bodyCell="{ column, index: idx }">
<template v-if="column.dataIndex === 'param'">
<a-input v-model:value="functionParamsEdit[idx].param" />
@@ -55,17 +52,25 @@
</template>
<template v-if="column.dataIndex === 'handle'">
<a-flex justify="space-between">
- <PlusOutlined class="edit-icon" @click="emit('addRow', 'functionParams', props.index, idx)" />
- <MinusOutlined class="edit-icon" @click="emit('deleteRow', 'functionParams', props.index, idx)" />
+ <PlusOutlined
+ class="edit-icon"
+ @click="emit('addRow', 'functionParams', props.index, idx)"
+ />
+ <MinusOutlined
+ class="edit-icon"
+ @click="emit('deleteRow', 'functionParams', props.index, idx)"
+ />
</a-flex>
</template>
</template>
</a-table>
</a-form-item>
- <a-form-item
- label="路由目的地"
- >
- <a-table :columns="destinationColumn" :data-source="props.paramRouteForm.destination" :pagination="false">
+ <a-form-item label="路由目的地">
+ <a-table
+ :columns="destinationColumn"
+ :data-source="props.paramRouteForm.destination"
+ :pagination="false"
+ >
<template #bodyCell="{ column, index: idx }">
<template v-if="column.dataIndex === 'label'">
<a-input v-model:value="destinationEdit[idx].label" />
@@ -81,8 +86,14 @@
</template>
<template v-if="column.dataIndex === 'handle'">
<a-flex justify="space-between">
- <PlusOutlined class="edit-icon" @click="emit('addRow', 'destination', props.index, idx)" />
- <MinusOutlined class="edit-icon" @click="emit('deleteRow', 'destination', props.index, idx)" />
+ <PlusOutlined
+ class="edit-icon"
+ @click="emit('addRow', 'destination', props.index, idx)"
+ />
+ <MinusOutlined
+ class="edit-icon"
+ @click="emit('deleteRow', 'destination', props.index, idx)"
+ />
</a-flex>
</template>
</template>
@@ -94,22 +105,22 @@
</template>
<script setup lang="ts">
-import { EditOutlined, DeleteOutlined, PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
+import { EditOutlined, DeleteOutlined, PlusOutlined, MinusOutlined } from '@ant-design/icons-vue'
import { ref } from 'vue'
const props = defineProps<{
paramRouteForm: {
- type: Object,
+ type: Object
default: {}
- },
+ }
index: {
type: Number
}
}>()
-console.log('props', props.paramRouteForm);
+console.log('props', props.paramRouteForm)
-const method = ref(JSON.parse(JSON.stringify(props.paramRouteForm.method)));
+const method = ref(JSON.parse(JSON.stringify(props.paramRouteForm.method)))
const functionParamsEdit = ref(JSON.parse(JSON.stringify(props.paramRouteForm.functionParams)))
const destinationEdit = ref(JSON.parse(JSON.stringify(props.paramRouteForm.destination)))
@@ -137,11 +148,11 @@
key: 'handle',
dataIndex: 'handle',
width: '10%'
- },
+ }
]
const destinationColumn = [
-{
+ {
title: '标签',
key: 'label',
dataIndex: 'label',
@@ -170,7 +181,7 @@
key: 'handle',
dataIndex: 'handle',
width: '10%'
- },
+ }
]
</script>
diff --git a/ui-vue3/src/views/resources/services/tabs/sceneConfig.vue b/ui-vue3/src/views/resources/services/tabs/sceneConfig.vue
index 3a4cc97..2fc5d3e 100644
--- a/ui-vue3/src/views/resources/services/tabs/sceneConfig.vue
+++ b/ui-vue3/src/views/resources/services/tabs/sceneConfig.vue
@@ -60,7 +60,14 @@
</a-descriptions>
</a-tab-pane>
<a-tab-pane key="paramRoute" tab="参数路由">
- <paramRoute v-for="item, index in paramRouteForms" :key="index" :paramRouteForm="item" :index="index" @addRow="()=>{}" @deleteRow="()=>{}" />
+ <paramRoute
+ v-for="(item, index) in paramRouteForms"
+ :key="index"
+ :paramRouteForm="item"
+ :index="index"
+ @addRow="() => {}"
+ @deleteRow="() => {}"
+ />
<a-button type="primary" style="margin-top: 20px">增加路由</a-button>
</a-tab-pane>
</a-tabs>
@@ -68,57 +75,57 @@
</template>
<script setup lang="ts">
-import { ref, reactive } from 'vue';
-import { EditOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons-vue';
+import { ref, reactive } from 'vue'
+import { EditOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons-vue'
import paramRoute from './paramRoute.vue'
const editForm = reactive({
timeout: {
isEdit: false,
- value: '',
+ value: ''
},
retryNum: {
isEdit: false,
- value: '',
+ value: ''
},
sameArea: {
- value: 'close',
+ value: 'close'
},
paramRoute: {
isEdit: false,
- value: {},
+ value: {}
}
})
-const activeKey = ref('timeout');
+const activeKey = ref('timeout')
const showEdit = (param: string) => {
- editForm[param].isEdit = true;
+ editForm[param].isEdit = true
}
const hideEdit = (param: string) => {
- editForm[param].isEdit = false;
+ editForm[param].isEdit = false
}
const paramRouteForms = [
{
method: {
value: 'getUserInfo',
- selectArr: [
- 'getUserInfo',
- 'register',
- 'login'
- ]
+ selectArr: ['getUserInfo', 'register', 'login']
},
- functionParams: [{
- param: '',
- relation: '',
- value: '',
- }],
- destination: [{
- label: '',
- relation: '',
- value: '',
- weight: '',
- }]
+ functionParams: [
+ {
+ param: '',
+ relation: '',
+ value: ''
+ }
+ ],
+ destination: [
+ {
+ label: '',
+ relation: '',
+ value: '',
+ weight: ''
+ }
+ ]
}
]
</script>