Browse Source

feat: Enable the management check setting feature

pull/1510/head
colin 4 months ago
parent
commit
6cf822e874
  1. 26
      apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue
  2. 2
      apps/vben5/packages/@abp/settings/src/constants/features.ts

26
apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue

@ -9,13 +9,14 @@ import { computed, onMounted, ref, toValue } from 'vue';
import { $t } from '@vben/locales'; import { $t } from '@vben/locales';
import { formatToDate } from '@abp/core'; import { formatToDate, useFeatures } from '@abp/core';
import { import {
Button, Button,
Card, Card,
Checkbox, Checkbox,
Collapse, Collapse,
DatePicker, DatePicker,
Empty,
Form, Form,
Input, Input,
InputNumber, InputNumber,
@ -26,6 +27,7 @@ import {
} from 'ant-design-vue'; } from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { SettingManagementEnable } from '../../constants/features';
import { ValueType } from '../../types'; import { ValueType } from '../../types';
defineOptions({ defineOptions({
@ -46,6 +48,8 @@ const defaultModel: SettingsUpdateInput = {
settings: [], settings: [],
}; };
const { isEnabled } = useFeatures();
const activeTab = ref(0); const activeTab = ref(0);
const submiting = ref(false); const submiting = ref(false);
const settingGroups = ref<SettingGroup[]>([]); const settingGroups = ref<SettingGroup[]>([]);
@ -61,7 +65,10 @@ const getExpandedCollapseKeys = computed(() => {
}); });
async function onGet() { async function onGet() {
settingGroups.value = await props.getApi(); settingGroups.value = [];
if (isEnabled(SettingManagementEnable)) {
settingGroups.value = await props.getApi();
}
} }
async function onSubmit() { async function onSubmit() {
@ -132,7 +139,11 @@ onMounted(onGet);
</Button> </Button>
</div> </div>
</template> </template>
<Form :label-col="{ span: 5 }" :wrapper-col="{ span: 15 }"> <Form
v-if="isEnabled(SettingManagementEnable)"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 15 }"
>
<Tabs tab-position="left" type="card" v-model="activeTab"> <Tabs tab-position="left" type="card" v-model="activeTab">
<TabPane <TabPane
v-for="(group, index) in settingGroups" v-for="(group, index) in settingGroups"
@ -226,6 +237,15 @@ onMounted(onGet);
</TabPane> </TabPane>
</Tabs> </Tabs>
</Form> </Form>
<Empty
:description="
$t('AbpFeature.Volo_Feature:010001', {
FeatureName: $t(
'AbpSettingManagement.Feature:SettingManagementEnable',
),
})
"
/>
</Card> </Card>
</template> </template>

2
apps/vben5/packages/@abp/settings/src/constants/features.ts

@ -0,0 +1,2 @@
/** 启用系统设置 */
export const SettingManagementEnable = 'SettingManagement.Enable';
Loading…
Cancel
Save