feat: add system quality improvement plan and implementation

This commit is contained in:
张翔
2026-03-12 18:20:50 +08:00
parent c8646974d8
commit fe2e4110dd
238 changed files with 21864 additions and 2026 deletions
@@ -1,59 +1,58 @@
<template>
<div class="config-management">
<a-card>
<template #title>
<el-card>
<template #header>
<div class="card-title">
<span>参数配置</span>
<a-button type="primary" @click="handleAdd">新增配置</a-button>
<el-button type="primary" @click="handleAdd">新增配置</el-button>
</div>
</template>
<a-table :columns="columns" :data-source="dataSource" :loading="loading">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'configType'">
<a-tag :color="record.configType === 'Y' ? 'blue' : 'orange'">
{{ record.configType === 'Y' ? '内置' : '自定义' }}
</a-tag>
<el-table :data="dataSource" v-loading="loading" style="width: 100%">
<el-table-column prop="id" label="ID" />
<el-table-column prop="configName" label="参数名称" />
<el-table-column prop="configKey" label="参数键名" />
<el-table-column prop="configValue" label="参数值" />
<el-table-column label="类型">
<template #default="{ row }">
<el-tag :type="row.configType === 'Y' ? '' : 'info'">
{{ row.configType === 'Y' ? '内置' : '自定义' }}
</el-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a-button type="link" size="small" @click="handleEdit(record)">编辑</a-button>
<a-button type="link" size="small" danger @click="handleDelete(record)">删除</a-button>
</a-space>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button type="primary" link size="small" @click="handleEdit(row)">编辑</el-button>
<el-button type="danger" link size="small" @click="handleDelete(row)">删除</el-button>
</template>
</template>
</a-table>
</a-card>
</el-table-column>
</el-table>
</el-card>
<a-modal v-model:open="modalVisible" :title="modalTitle" @ok="handleModalOk">
<a-form :model="formState" :label-col="{ span: 6 }">
<a-form-item label="参数名称" name="configName">
<a-input v-model:value="formState.configName" />
</a-form-item>
<a-form-item label="参数键名" name="configKey">
<a-input v-model:value="formState.configKey" />
</a-form-item>
<a-form-item label="参数值" name="configValue">
<a-input v-model:value="formState.configValue" />
</a-form-item>
</a-form>
</a-modal>
<el-dialog v-model="modalVisible" :title="modalTitle" width="500px">
<el-form :model="formState" label-width="80px">
<el-form-item label="参数名称">
<el-input v-model="formState.configName" />
</el-form-item>
<el-form-item label="参数键名">
<el-input v-model="formState.configKey" />
</el-form-item>
<el-form-item label="参数值">
<el-input v-model="formState.configValue" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="modalVisible = false">取消</el-button>
<el-button type="primary" @click="handleModalOk">确定</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { message } from 'ant-design-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import request from '@/utils/request'
const columns = [
{ title: 'ID', dataIndex: 'id', key: 'id' },
{ title: '参数名称', dataIndex: 'configName', key: 'configName' },
{ title: '参数键名', dataIndex: 'configKey', key: 'configKey' },
{ title: '参数值', dataIndex: 'configValue', key: 'configValue' },
{ title: '类型', key: 'configType' },
{ title: '操作', key: 'action', width: 150 }
]
const loading = ref(false)
const dataSource = ref([])
const modalVisible = ref(false)
@@ -76,18 +75,23 @@ const handleAdd = () => {
modalVisible.value = true
}
const handleEdit = (record: any) => {
const handleEdit = (row: any) => {
modalTitle.value = '编辑配置'
Object.assign(formState, record)
Object.assign(formState, row)
modalVisible.value = true
}
const handleDelete = async (record: any) => {
const handleDelete = async (row: any) => {
try {
await request.delete(`/config/${record.id}`)
message.success('删除成功')
await ElMessageBox.confirm('确定要删除该配置吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
await request.delete(`/config/${row.id}`)
ElMessage.success('删除成功')
fetchData()
} catch { message.error('删除失败') }
} catch {}
}
const handleModalOk = async () => {
@@ -97,10 +101,12 @@ const handleModalOk = async () => {
} else {
await request.post('/config', formState)
}
message.success('操作成功')
ElMessage.success('操作成功')
modalVisible.value = false
fetchData()
} catch { message.error('操作失败') }
} catch {
ElMessage.error('操作失败')
}
}
onMounted(() => fetchData())
@@ -1,65 +1,64 @@
<template>
<div class="dict-management">
<a-card>
<template #title>
<el-card>
<template #header>
<div class="card-title">
<span>字典管理</span>
<a-button type="primary" @click="handleAdd">新增字典</a-button>
<el-button type="primary" @click="handleAdd">新增字典</el-button>
</div>
</template>
<a-table :columns="columns" :data-source="dataSource" :loading="loading">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<a-tag :color="record.status === '0' ? 'green' : 'red'">
{{ record.status === '0' ? '正常' : '停用' }}
</a-tag>
<el-table :data="dataSource" v-loading="loading" style="width: 100%">
<el-table-column prop="id" label="ID" />
<el-table-column prop="dictName" label="字典名称" />
<el-table-column prop="dictType" label="字典类型" />
<el-table-column label="状态">
<template #default="{ row }">
<el-tag :type="row.status === '0' ? 'success' : 'danger'">
{{ row.status === '0' ? '正常' : '停用' }}
</el-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a-button type="link" size="small" @click="handleEdit(record)">编辑</a-button>
<a-button type="link" size="small" danger @click="handleDelete(record)">删除</a-button>
</a-space>
</el-table-column>
<el-table-column prop="remark" label="备注" />
<el-table-column label="操作" width="200">
<template #default="{ row }">
<el-button type="primary" link size="small" @click="handleEdit(row)">编辑</el-button>
<el-button type="danger" link size="small" @click="handleDelete(row)">删除</el-button>
</template>
</a-table>
</template>
</a-card>
</el-table-column>
</el-table>
</el-card>
<a-modal v-model:open="modalVisible" :title="modalTitle" @ok="handleModalOk">
<a-form :model="formState" :label-col="{ span: 6 }">
<a-form-item label="字典名称" name="dictName">
<a-input v-model:value="formState.dictName" />
</a-form-item>
<a-form-item label="字典类型" name="dictType">
<a-input v-model:value="formState.dictType" />
</a-form-item>
<a-form-item label="状态" name="status">
<a-select v-model:value="formState.status">
<a-select-option value="0">正常</a-select-option>
<a-select-option value="1">停用</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="备注" name="remark">
<a-textarea v-model:value="formState.remark" />
</a-form-item>
</a-form>
</a-modal>
<el-dialog v-model="modalVisible" :title="modalTitle" width="500px">
<el-form :model="formState" label-width="80px">
<el-form-item label="字典名称">
<el-input v-model="formState.dictName" />
</el-form-item>
<el-form-item label="字典类型">
<el-input v-model="formState.dictType" />
</el-form-item>
<el-form-item label="状态">
<el-select v-model="formState.status">
<el-option value="0" label="正常" />
<el-option value="1" label="停用" />
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="formState.remark" type="textarea" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="modalVisible = false">取消</el-button>
<el-button type="primary" @click="handleModalOk">确定</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { message } from 'ant-design-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import request from '@/utils/request'
const columns = [
{ title: 'ID', dataIndex: 'id', key: 'id' },
{ title: '字典名称', dataIndex: 'dictName', key: 'dictName' },
{ title: '字典类型', dataIndex: 'dictType', key: 'dictType' },
{ title: '状态', key: 'status' },
{ title: '备注', dataIndex: 'remark', key: 'remark' },
{ title: '操作', key: 'action', width: 200 }
]
const loading = ref(false)
const dataSource = ref([])
const modalVisible = ref(false)
@@ -82,18 +81,23 @@ const handleAdd = () => {
modalVisible.value = true
}
const handleEdit = (record: any) => {
const handleEdit = (row: any) => {
modalTitle.value = '编辑字典'
Object.assign(formState, record)
Object.assign(formState, row)
modalVisible.value = true
}
const handleDelete = async (record: any) => {
const handleDelete = async (row: any) => {
try {
await request.delete(`/dict/types/${record.id}`)
message.success('删除成功')
await ElMessageBox.confirm('确定要删除该字典吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
await request.delete(`/dict/types/${row.id}`)
ElMessage.success('删除成功')
fetchData()
} catch { message.error('删除失败') }
} catch {}
}
const handleModalOk = async () => {
@@ -103,10 +107,12 @@ const handleModalOk = async () => {
} else {
await request.post('/dict/types', formState)
}
message.success('操作成功')
ElMessage.success('操作成功')
modalVisible.value = false
fetchData()
} catch { message.error('操作失败') }
} catch {
ElMessage.error('操作失败')
}
}
onMounted(() => fetchData())