chore: 流水线有效期优化

This commit is contained in:
xiaojunnuo
2025-10-24 23:48:32 +08:00
parent fea808ca5f
commit 6531002d61
10 changed files with 58 additions and 27 deletions
@@ -466,7 +466,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
},
column: {
sorter: true,
width: 80,
width: 100,
align: "center",
component: {
name: "fs-dict-switch",
@@ -513,7 +513,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
{ value: "cert", label: t("certd.types.certApply") },
{ value: "cert_upload", label: t("certd.types.certUpload") },
{ value: "custom", label: t("certd.types.custom") },
{ value: "template", label: "模版" },
{ value: "template", label: t("certd.types.template") },
],
}),
form: {
@@ -522,7 +522,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
},
column: {
sorter: true,
width: 90,
width: 110,
align: "center",
show: true,
component: {
@@ -560,7 +560,7 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
type: "date",
form: {
show: computed(() => {
return settingStore.isPlus && settingStore.sysPublic.pipelineValidTimeEnabled;
return settingStore.isPlus && settingStore.sysPublic.pipelineValidTimeEnabled && userStore.isAdmin;
}),
helper: t("certd.pi.validTimeHelper"),
valueResolve({ form, key, value }) {
@@ -573,6 +573,18 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
form[key] = dayjs(value);
}
},
component: {
presets: [
{ label: t("certd.dates.months", { count: 3 }), value: dayjs().add(3, "month") },
{ label: t("certd.dates.months", { count: 6 }), value: dayjs().add(6, "month") },
{ label: t("certd.dates.years", { count: 1 }), value: dayjs().add(1, "year") },
{ label: t("certd.dates.years", { count: 2 }), value: dayjs().add(2, "year") },
{ label: t("certd.dates.years", { count: 3 }), value: dayjs().add(3, "year") },
{ label: t("certd.dates.years", { count: 4 }), value: dayjs().add(4, "year") },
{ label: t("certd.dates.years", { count: 5 }), value: dayjs().add(5, "year") },
{ label: t("certd.dates.years", { count: 6 }), value: dayjs().add(6, "year") },
],
},
},
column: {
show: computed(() => {
@@ -26,7 +26,6 @@
import { onActivated, onMounted, ref } from "vue";
import { dict, useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import PiCertdForm from "./certd-form/index.vue";
import ChangeGroup from "./components/change-group.vue";
import ChangeTrigger from "./components/change-trigger.vue";
import { Modal, notification } from "ant-design-vue";
@@ -20,8 +20,8 @@
<a-tab-pane key="captcha" :tab="t('certd.sys.setting.captchaSetting')">
<SettingCaptcha v-if="activeKey === 'captcha'" />
</a-tab-pane>
<a-tab-pane key="cert" :tab="t('certd.sys.setting.certSetting')">
<SettingCert v-if="activeKey === 'cert'" />
<a-tab-pane key="pipeline" :tab="t('certd.sys.setting.pipelineSetting')">
<SettingPipeline v-if="activeKey === 'pipeline'" />
</a-tab-pane>
</a-tabs>
</div>
@@ -34,7 +34,7 @@ import SettingRegister from "/@/views/sys/settings/tabs/register.vue";
import SettingPayment from "/@/views/sys/settings/tabs/payment.vue";
import SettingSafe from "/@/views/sys/settings/tabs/safe.vue";
import SettingCaptcha from "/@/views/sys/settings/tabs/captcha.vue";
import SettingCert from "/@/views/sys/settings/tabs/cert.vue";
import SettingPipeline from "/@/views/sys/settings/tabs/pipeline.vue";
import { useRoute, useRouter } from "vue-router";
import { ref } from "vue";
import { useSettingStore } from "/@/store/settings";
@@ -1,6 +1,13 @@
<template>
<div class="sys-settings-form sys-settings-cert">
<div class="sys-settings-form sys-settings-pipeline">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
<a-form-item :label="t('certd.manageOtherUserPipeline')" :name="['public', 'managerOtherUserPipeline']">
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item :label="t('certd.limitUserPipelineCount')" :name="['public', 'limitUserPipelineCount']">
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">{{ t("certd.limitUserPipelineCountHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.pipelineValidTimeEnabled')" :name="['public', 'pipelineValidTimeEnabled']">
<div class="flex items-center">
<a-switch v-model:checked="formState.public.pipelineValidTimeEnabled" :disabled="!settingsStore.isPlus" />
@@ -35,7 +42,7 @@ import { useI18n } from "/src/locales";
const { t } = useI18n();
defineOptions({
name: "SettingCert",
name: "SettingPipeline",
});
const formState = reactive<Partial<SysSettings>>({
@@ -65,7 +72,4 @@ const onFinish = async (form: any) => {
}
};
</script>
<style lang="less">
.sys-settings-cert {
}
</style>
<style lang="less"></style>
@@ -1,13 +1,6 @@
<template>
<div class="sys-settings-form sys-settings-register">
<a-form :model="formState" name="register" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
<a-form-item :label="t('certd.manageOtherUserPipeline')" :name="['public', 'managerOtherUserPipeline']">
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item :label="t('certd.limitUserPipelineCount')" :name="['public', 'limitUserPipelineCount']">
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">{{ t("certd.limitUserPipelineCountHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.enableSelfRegistration')" :name="['public', 'registerEnabled']">
<a-switch v-model:checked="formState.public.registerEnabled" />
</a-form-item>