🎉 【字典管理】、【参数管理】同步缓存

This commit is contained in:
dh186609 2023-02-24 13:59:05 +08:00
parent bf77dacdb2
commit 7131f1ade4
3 changed files with 25 additions and 2 deletions

View File

@ -38,3 +38,9 @@ export function putObj(obj?: Object) {
data: obj data: obj
}) })
} }
export function refreshCache() {
return request({
url: '/admin/param/sync',
method: 'put'
})
}

View File

@ -29,6 +29,9 @@
@click="handleDelete(selectObjs)"> @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }} {{ $t('common.delBtn') }}
</el-button> </el-button>
<el-button class="ml10" formDialogRef icon="refresh-left" type="primary" @click="handleRefreshCache()">
{{ $t('common.refreshCacheBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px" <right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar> @queryTable="getDataList"></right-toolbar>
</div> </div>
@ -76,7 +79,7 @@
<script setup lang="ts" name="systemDic"> <script setup lang="ts" name="systemDic">
import { BasicTableProps, useTable } from "/@/hooks/table"; import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj } from "/@/api/admin/dict"; import { delObj, fetchList, refreshCache } from "/@/api/admin/dict";
import { useMessage, useMessageBox } from "/@/hooks/message"; import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from "/@/hooks/dict"; import { useDict } from "/@/hooks/dict";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
@ -134,6 +137,12 @@ const handleSelectionChange = (objs: any) => {
}); });
multiple.value = !objs.length multiple.value = !objs.length
} }
//
const handleRefreshCache = () =>{
refreshCache().then(() =>{
useMessage().success('同步成功')
})
}
// //
const handleDelete = (ids: string[]) => { const handleDelete = (ids: string[]) => {

View File

@ -29,6 +29,9 @@
@click="handleDelete(selectObjs)"> @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }} {{ $t('common.delBtn') }}
</el-button> </el-button>
<el-button class="ml10" formDialogRef icon="refresh-left" type="primary" @click="handleRefreshCache()">
{{ $t('common.refreshCacheBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px" <right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar> @queryTable="getDataList"></right-toolbar>
</div> </div>
@ -81,7 +84,7 @@
<script lang="ts" name="systemSysPublicParam" setup> <script lang="ts" name="systemSysPublicParam" setup>
import { BasicTableProps, useTable } from "/@/hooks/table"; import { BasicTableProps, useTable } from "/@/hooks/table";
import { delObj, fetchList } from "/@/api/admin/param"; import { delObj, fetchList,refreshCache } from "/@/api/admin/param";
import { useMessage, useMessageBox } from "/@/hooks/message"; import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from '/@/hooks/dict'; import { useDict } from '/@/hooks/dict';
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
@ -141,6 +144,11 @@ const handleSelectionChange = (objs: any) => {
}); });
multiple.value = !objs.length multiple.value = !objs.length
} }
const handleRefreshCache = () =>{
refreshCache().then(()=>{
useMessage().success('同步成功')
})
}
// //
const handleDelete = (ids: string[]) => { const handleDelete = (ids: string[]) => {