This commit is contained in:
u2nyakim 2025-08-22 15:11:03 +08:00
parent a166d6c368
commit 5e0bbfdaa1
2 changed files with 53 additions and 16 deletions

View File

@ -1,11 +1,56 @@
<script setup lang="ts">
</script>
<template>
<div></div>
<ele-page>
<ele-tabs
type="card"
v-model="configGroup"
:items="groupItems"
@tabChange="reload()"
/>
<ele-card :body-style="{ paddingTop: '8px' }">
<el-button
type="danger"
class="ele-btn-icon"
:icon="Refresh"
>
同步配置
</el-button>
{{ configList }}
</ele-card>
</ele-page>
</template>
<style scoped lang="scss">
<script lang="ts" setup>
import {onMounted, ref} from 'vue';
import { Refresh } from "@element-plus/icons-vue"
import {listConfig} from "@/api/system/config";
import {getSysConfig} from "@/utils/sys-config";
</style>
defineOptions({name: 'SystemConfigSet'});
const configList = ref([]);
/** 搜索 */
const reload = () => {
listConfig({group: configGroup.value, limit: 999}).then((data)=>{
configList.value = data || [];
});
};
const groupItems = ref([]);
const configGroup = ref("");
onMounted(async () => {
//
const group = [];
const {valueData} = await getSysConfig("config_group");
for (const name in valueData) {
group.push({name: name, label: valueData[name]})
}
groupItems.value = group
if (group.length > 0) {
configGroup.value = group[0].name
}
reload();
})
</script>

View File

@ -33,13 +33,6 @@
>
添加
</el-button>
<!-- <el-button-->
<!-- type="danger"-->
<!-- class="ele-btn-icon"-->
<!-- :icon="Refresh"-->
<!-- >-->
<!-- 同步配置-->
<!-- </el-button>-->
</template>
<template #action="{ row }">
<el-link type="primary" underline="never" @click="openEdit(row)">
@ -75,7 +68,6 @@ import type {
DatasourceFunction,
Columns
} from 'ele-admin-plus/es/ele-pro-table/types';
// import { Refresh } from "@element-plus/icons-vue"
import {PlusOutlined,} from '@/components/icons';
import ConfigSearch from './components/config-search.vue';
import ConfigEdit from './components/config-edit.vue';
@ -155,7 +147,7 @@ const showEdit = ref(false);
/** 表格数据源 */
const datasource: DatasourceFunction = ({pages, where, orders}) => {
return listConfig({...where, ...orders, ...pages, group: configGroup.value});
return listConfig({...where, ...orders, ...pages, group: configGroup.value, limit: 999});
};
/** 搜索 */