This commit is contained in:
41
src/components/business/gateway/GatewayRuleFields.vue
Normal file
41
src/components/business/gateway/GatewayRuleFields.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<ElForm label-width="130px" :disabled="disabled">
|
||||
<ElFormItem label="错误分类" required>
|
||||
<ElSelect v-model="model.category"
|
||||
><ElOption v-for="opt in options.error_categories" :key="opt.value" v-bind="opt"
|
||||
/></ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="关键字或正则" required
|
||||
><ElInput v-model="model.keyword" maxlength="200" show-word-limit
|
||||
/></ElFormItem>
|
||||
<ElFormItem label="匹配方式" required>
|
||||
<ElSelect v-model="model.match_type"
|
||||
><ElOption v-for="opt in options.match_types" :key="opt.value" v-bind="opt"
|
||||
/></ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="适用操作">
|
||||
<ElSelect v-model="model.operations" multiple clearable placeholder="留空表示全部操作"
|
||||
><ElOption v-for="opt in options.gateway_operations" :key="opt.value" v-bind="opt"
|
||||
/></ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="上游可能已受理"><ElSwitch v-model="model.maybe_accepted" /></ElFormItem>
|
||||
<ElFormItem label="匹配优先级"
|
||||
><ElInputNumber v-model="model.priority" :min="1" :max="10000" :precision="0" /><span
|
||||
>数值越小越先匹配</span
|
||||
></ElFormItem
|
||||
>
|
||||
<ElFormItem label="状态"
|
||||
><ElSelect v-model="model.status"
|
||||
><ElOption label="启用" :value="1" /><ElOption label="停用" :value="0" /></ElSelect
|
||||
></ElFormItem>
|
||||
<ElFormItem label="备注"
|
||||
><ElInput v-model="model.remark" type="textarea" maxlength="500" show-word-limit
|
||||
/></ElFormItem>
|
||||
</ElForm>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { GatewayRuleInput, GatewayOptions } from '@/types/api/gateway'
|
||||
const model = defineModel<GatewayRuleInput>({ required: true })
|
||||
defineProps<{ options: GatewayOptions; disabled?: boolean }>()
|
||||
</script>
|
||||
Reference in New Issue
Block a user