完善测试建表并统一前端格式

This commit is contained in:
yml2213
2026-07-14 01:32:14 +08:00
parent 2efcede800
commit 2ca6fd9306
36 changed files with 714 additions and 478 deletions
@@ -216,9 +216,15 @@ async function saveRule() {
</el-table-column>
<el-table-column label="操作" width="260" fixed="right">
<template #default="{ row }">
<el-button size="small" type="primary" :icon="Edit" @click="openEditChannel(row)">编辑</el-button>
<el-button size="small" type="primary" :icon="Edit" @click="openEditChannel(row)"
>编辑</el-button
>
<el-button size="small" type="primary" @click="handleTestChannel(row)">测试</el-button>
<el-button size="small" :type="row.enabled ? 'warning' : 'success'" @click="toggleChannel(row)">
<el-button
size="small"
:type="row.enabled ? 'warning' : 'success'"
@click="toggleChannel(row)"
>
{{ row.enabled ? '禁用' : '启用' }}
</el-button>
<el-button size="small" type="danger" :icon="Delete" @click="handleDeleteChannel(row)" />
@@ -226,7 +232,10 @@ async function saveRule() {
</el-table-column>
</el-table>
<el-empty v-if="!channelsLoading && channels.length === 0" description="暂无推送渠道,点击上方按钮新增" />
<el-empty
v-if="!channelsLoading && channels.length === 0"
description="暂无推送渠道,点击上方按钮新增"
/>
<!-- 规则管理 -->
<div class="section-header" style="margin-top: 32px">
@@ -251,7 +260,9 @@ async function saveRule() {
<el-table-column label="消息模板" min-width="250" prop="message_template" />
<el-table-column label="操作" width="100" fixed="right">
<template #default="{ row }">
<el-button size="small" type="primary" :icon="Edit" @click="openEditRule(row)">编辑</el-button>
<el-button size="small" type="primary" :icon="Edit" @click="openEditRule(row)"
>编辑</el-button
>
</template>
</el-table-column>
</el-table>
@@ -276,11 +287,12 @@ async function saveRule() {
/>
</el-select>
</el-form-item>
<el-form-item v-for="field in channelConfigFields(channelForm.type)" :key="field.key" :label="field.label">
<el-input
v-model="channelForm.config[field.key]"
:placeholder="field.placeholder"
/>
<el-form-item
v-for="field in channelConfigFields(channelForm.type)"
:key="field.key"
:label="field.label"
>
<el-input v-model="channelForm.config[field.key]" :placeholder="field.placeholder" />
</el-form-item>
</el-form>
<template #footer>
@@ -300,7 +312,12 @@ async function saveRule() {
<span class="form-hint">库存低于此值时触发预警</span>
</el-form-item>
<el-form-item label="消息模板">
<el-input v-model="ruleForm.message_template" type="textarea" :rows="3" placeholder="支持 {{.Count}} 占位符" />
<el-input
v-model="ruleForm.message_template"
type="textarea"
:rows="3"
placeholder="支持 {{.Count}} 占位符"
/>
</el-form-item>
</el-form>
<template #footer>