chore: group dict刷新

This commit is contained in:
xiaojunnuo
2025-11-30 02:16:04 +08:00
parent 6be7591332
commit 52ebeab90b
4 changed files with 17 additions and 12 deletions

View File

@@ -15,8 +15,9 @@ import GroupSelector from "/@/views/certd/pipeline/group/group-selector.vue";
import { useCertViewer } from "/@/views/certd/pipeline/use";
import { useI18n } from "/src/locales";
import { GetDetail, GetObj } from "./api";
import { groupDictRef } from "./group/dicts";
export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter();
const lastResRef = ref();
@@ -495,6 +496,11 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
component: {
name: GroupSelector,
vModel: "modelValue",
on: {
refresh: async () => {
await groupDictRef.reloadDict();
},
},
},
},
column: {

View File

@@ -0,0 +1,7 @@
import { dict } from "@fast-crud/fast-crud";
export const groupDictRef = dict({
url: "/pi/pipeline/group/all",
value: "id",
label: "name",
});

View File

@@ -35,6 +35,7 @@
<script setup lang="ts">
import createCrudOptions from "./crud";
import { dict, FsDictSelect } from "@fast-crud/fast-crud";
import { groupDictRef } from "./dicts";
const props = defineProps<{
modelValue?: number;
@@ -43,11 +44,7 @@ const props = defineProps<{
defineOptions({
name: "GroupSelector",
});
const groupDictRef = dict({
url: "/pi/pipeline/group/all",
value: "id",
label: "name",
});
const emit = defineEmits(["refresh", "update:modelValue"]);
function doRefresh() {
emit("refresh");

View File

@@ -35,19 +35,14 @@ import { useI18n } from "/src/locales";
const { t } = useI18n();
import ChangeNotification from "/@/views/certd/pipeline/components/change-notification.vue";
import { useSettingStore } from "/@/store/settings";
import { groupDictRef } from "./group/dicts";
defineOptions({
name: "PipelineManager",
});
const groupDictRef = dict({
url: "/pi/pipeline/group/all",
value: "id",
label: "name",
});
const selectedRowKeys = ref([]);
const context: any = {
groupDictRef,
selectedRowKeys,
};
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });