1. 统一化代码

2. 增加 DocAlert 关联文档
This commit is contained in:
YunaiV
2023-04-05 20:13:35 +08:00
parent bb88e3d77c
commit 4404554cfc
111 changed files with 640 additions and 567 deletions

View File

@@ -70,7 +70,7 @@ const formRules = reactive({
const formRef = ref() // Ref
/** 打开弹窗 */
const openModal = async (type: string, id?: number) => {
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
@@ -85,7 +85,7 @@ const openModal = async (type: string, id?: number) => {
}
}
}
defineExpose({ openModal }) // openModal
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success

View File

@@ -1,6 +1,8 @@
<template>
<doc-alert title="配置中心" url="https://doc.iocoder.cn/config-center/" />
<!-- 搜索 -->
<content-wrap>
<ContentWrap>
<el-form
class="-mb-15px"
:model="queryParams"
@@ -34,10 +36,10 @@
class="!w-240px"
>
<el-option
v-for="dict in getDictOptions(DICT_TYPE.INFRA_CONFIG_TYPE)"
:key="parseInt(dict.value)"
v-for="dict in getIntDictOptions(DICT_TYPE.INFRA_CONFIG_TYPE)"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
:value="dict.value"
/>
</el-select>
</el-form-item>
@@ -58,7 +60,7 @@
<el-button
type="primary"
plain
@click="openModal('create')"
@click="openForm('create')"
v-hasPermi="['infra:config:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
@@ -74,10 +76,10 @@
</el-button>
</el-form-item>
</el-form>
</content-wrap>
</ContentWrap>
<!-- 列表 -->
<content-wrap>
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table-column label="参数主键" align="center" prop="id" />
<el-table-column label="参数分类" align="center" prop="category" />
@@ -107,7 +109,7 @@
<el-button
link
type="primary"
@click="openModal('update', scope.row.id)"
@click="openForm('update', scope.row.id)"
v-hasPermi="['infra:config:update']"
>
编辑
@@ -130,17 +132,17 @@
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</content-wrap>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<config-form ref="modalRef" @success="getList" />
<ConfigForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts" name="Config">
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ConfigApi from '@/api/infra/config'
import ConfigForm from './form.vue'
import ConfigForm from './ConfigForm.vue'
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
@@ -183,9 +185,9 @@ const resetQuery = () => {
}
/** 添加/修改操作 */
const modalRef = ref()
const openModal = (type: string, id?: number) => {
modalRef.value.openModal(type, id)
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
@@ -208,7 +210,7 @@ const handleExport = async () => {
await message.exportConfirm()
// 发起导出
exportLoading.value = true
const data = await ConfigApi.exportConfigApi(queryParams)
const data = await ConfigApi.exportConfig(queryParams)
download.excel(data, '参数配置.xls')
} catch {
} finally {