fix: 修复代码生成异常提示

This commit is contained in:
xlsea
2024-11-04 11:16:53 +08:00
parent d5479c2f68
commit df5dd24c29
10 changed files with 83 additions and 65 deletions

View File

@ -19,7 +19,7 @@ const value = defineModel<CommonType.IdType[] | null>('value', { required: false
const attrs: SelectProps = useAttrs();
const { loading: roleLoading, startLoading: startRoleLoading, endLoading: endRoleLoading } = useLoading();
const { loading: postLoading, startLoading: startPostLoading, endLoading: endPostLoading } = useLoading();
/** the enabled role options */
const roleOptions = ref<CommonType.Option<CommonType.IdType>[]>([]);
@ -34,7 +34,7 @@ watch(
);
async function getRoleOptions() {
startRoleLoading();
startPostLoading();
const { error, data } = await fetchGetPostSelect(props.deptId!);
if (!error) {
@ -43,14 +43,14 @@ async function getRoleOptions() {
value: item.postId
}));
}
endRoleLoading();
endPostLoading();
}
</script>
<template>
<NSelect
v-model:value="value"
:loading="roleLoading"
:loading="postLoading"
:options="roleOptions"
v-bind="attrs"
placeholder="请选择岗位"