Files
one-pipe-system/src/components/business/gateway/GatewayRuleFields.vue
luo 06684e1fc0
All checks were successful
构建并部署前端到测试环境 / deploy (push) Successful in 55s
fix: 轮询按运营商账户限流
2026-10-26 14:31:15 +08:00

53 lines
2.1 KiB
Vue

<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 v-if="model.category === 'terminal'" label="自动关闭轮询"
><ElSwitch v-model="model.auto_disable_polling" /><span>仅终态类别生效</span></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 { watch } from 'vue'
import type { GatewayRuleInput, GatewayOptions } from '@/types/api/gateway'
const model = defineModel<GatewayRuleInput>({ required: true })
watch(
() => model.value.category,
(value) => {
if (value !== 'terminal' && model.value.auto_disable_polling)
model.value.auto_disable_polling = false
}
)
defineProps<{ options: GatewayOptions; disabled?: boolean }>()
</script>