配置、字典

This commit is contained in:
陈红丽 2024-12-17 13:46:59 +08:00
parent 0b06f4ca58
commit 5a12e91bc8
2 changed files with 68 additions and 60 deletions

View File

@ -1,34 +1,30 @@
<template> <template>
<PageWrapper> <PageWrapper>
<n-grid x-gap="12" cols="1 s:1 m:1 l:3 xl:3 2xl:3" responsive="screen"> <n-grid x-gap="12" cols="1 s:1 m:1 l:24 xl:24 2xl:24" responsive="screen">
<n-grid-item span="1"> <n-grid-item span="7">
<n-card shadow="hover" class="border-0"> <n-card shadow="hover" class="border-0">
<template #header> <template #header>
<n-grid cols="24"> <n-space>
<n-gi span="18"> <n-input
<n-input type="text"
type="text" v-model:value="params.name"
v-model:value="params.name" placeholder="请输入配置名称"
placeholder="请输入配置名称" clearable
clearable />
/> <n-button
</n-gi> type="primary"
<n-gi span="6" style="text-align: right"> @click="
<n-button pager.page = 1;
type="primary" loadDataTable();
@click=" "
pager.page = 1; >
loadDataTable(); <template #icon>
" <n-icon>
> <SearchOutlined />
<template #icon> </n-icon> </template
<n-icon> >查询
<SearchOutlined /> </n-button>
</n-icon> </template </n-space>
>查询
</n-button>
</n-gi>
</n-grid>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<n-space> <n-space>
<n-button type="primary" @click="handleAdd" v-perm="['sys:config:add']"> <n-button type="primary" @click="handleAdd" v-perm="['sys:config:add']">
@ -79,7 +75,7 @@
</template> </template>
</n-card> </n-card>
</n-grid-item> </n-grid-item>
<n-grid-item span="2"> <n-grid-item span="17">
<n-card shadow="hover" class="mb-4 border-0 proCard"> <n-card shadow="hover" class="mb-4 border-0 proCard">
<configItem :configId="configId" v-if="configItemShow" /> <configItem :configId="configId" v-if="configItemShow" />
</n-card> </n-card>

View File

@ -1,34 +1,33 @@
<template> <template>
<PageWrapper> <PageWrapper>
<n-grid x-gap="12" cols="1 s:1 m:1 l:3 xl:3 2xl:3" responsive="screen"> <n-grid x-gap="12" cols="1 s:1 m:1 l:24 xl:24 2xl:24" responsive="screen">
<n-grid-item span="1"> <n-grid-item span="7">
<n-card shadow="hover" class="border-0"> <n-card shadow="hover" class="border-0" size="small">
<template #header> <template #header>
<n-grid cols="24"> <n-space :size="4">
<n-gi span="18"> <n-input
<n-input type="text"
type="text" v-model:value="params.name"
v-model:value="params.name" placeholder="请输入字典名称"
placeholder="请输入字典名称" clearable
clearable />
/> <n-button
</n-gi> type="primary"
<n-gi span="6" style="text-align: right; margin-left: 5px"> @click="
<n-button pager.page = 1;
type="primary" loadDataTable();
@click=" "
pager.page = 1; >
loadDataTable(); <template #icon>
" <n-icon>
> <SearchOutlined />
<template #icon> </n-icon> </template
<n-icon> >查询
<SearchOutlined /> </n-button>
</n-icon> </template <n-button type="primary" @click="dictRefresh" v-perm="['sys:dict:cache']">
>查询 <template #icon> <RedoOutlined /> </template>刷新缓存</n-button
</n-button> >
</n-gi> </n-space>
</n-grid>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<n-space> <n-space>
<n-button type="primary" @click="handleAdd" v-perm="['sys:dict:add']"> <n-button type="primary" @click="handleAdd" v-perm="['sys:dict:add']">
@ -79,8 +78,8 @@
</template> </template>
</n-card> </n-card>
</n-grid-item> </n-grid-item>
<n-grid-item span="2"> <n-grid-item span="17">
<n-card shadow="hover" class="mb-4 border-0 proCard"> <n-card shadow="hover" class="border-0 proCard" size="small">
<dictItem :dictId="dictId" v-if="dictItemShow" /> <dictItem :dictId="dictId" v-if="dictItemShow" />
</n-card> </n-card>
</n-grid-item> </n-grid-item>
@ -97,8 +96,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, nextTick, defineAsyncComponent, onMounted } from 'vue'; import { ref, nextTick, defineAsyncComponent, onMounted } from 'vue';
import { getDictList, dictDelete } from '@/api/data/dictionary'; import { getDictList, refreshCache, dictDelete } from '@/api/data/dictionary';
import { PlusOutlined, FormOutlined, DeleteOutlined, SearchOutlined } from '@vicons/antd'; import {
PlusOutlined,
FormOutlined,
DeleteOutlined,
SearchOutlined,
RedoOutlined,
} from '@vicons/antd';
import editDialog from './edit.vue'; import editDialog from './edit.vue';
import dictItem from './dictItem.vue'; import dictItem from './dictItem.vue';
import { useMessage, useDialog } from 'naive-ui'; import { useMessage, useDialog } from 'naive-ui';
@ -149,6 +154,13 @@
await nextTick(); await nextTick();
createModalRef.value.openModal(); createModalRef.value.openModal();
}; };
/**
* 刷新缓存
*/
async function dictRefresh() {
await refreshCache();
message.success('刷新成功');
}
/** /**
* 数据行选中事件 * 数据行选中事件