From 095ced7af04a9c09d25f57cf6fb657fef6fad218 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 18 Nov 2022 00:18:20 +0800 Subject: [PATCH] fix: todo --- .../src/components/Form/src/Form.vue | 1 + .../views/system/oauth2/client/client.data.ts | 91 +++++++++++++++++-- 2 files changed, 82 insertions(+), 10 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/Form/src/Form.vue b/yudao-ui-admin-vue3/src/components/Form/src/Form.vue index 55060a97a..953585b8c 100644 --- a/yudao-ui-admin-vue3/src/components/Form/src/Form.vue +++ b/yudao-ui-admin-vue3/src/components/Form/src/Form.vue @@ -227,6 +227,7 @@ export default defineComponent({ {...(autoSetPlaceholder && setTextPlaceholder(item))} {...setComponentProps(item)} style={item.componentProps?.style} + {...item.componentProps?.props} {...(notRenderOptions.includes(item?.component as string) && item?.componentProps?.options ? { options: item?.componentProps?.options || [] } diff --git a/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts b/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts index 5de8f5e3d..ada75627d 100644 --- a/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts @@ -1,10 +1,12 @@ import { reactive } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { required } from '@/utils/formRules' -import { DICT_TYPE } from '@/utils/dict' +import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' const { t } = useI18n() // 国际化 +const authorizedGrantOptions = getStrDictOptions(DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE) + // 表单校验 export const rules = reactive({ clientId: [required], @@ -76,36 +78,105 @@ const crudSchemas = reactive({ title: '授权类型', field: 'authorizedGrantTypes', table: { - width: 300, + width: 400, slots: { default: 'authorizedGrantTypes_default' } + }, + form: { + component: 'Select', + componentProps: { + options: authorizedGrantOptions, + props: { + multiple: true, + filterable: true + } + } } }, { title: '授权范围', - field: 'scopes', // TODO @星语:带输入的 SELECT - isTable: false + field: 'scopes', + isTable: false, + form: { + component: 'Select', + componentProps: { + options: [], + props: { + multiple: true, + filterable: true, + allowCreate: true, + defaultFirstOption: true + } + } + } }, { title: '自动授权范围', - field: 'autoApproveScopes', // TODO @星语:带输入的 SELECT - isTable: false + field: 'autoApproveScopes', + isTable: false, + form: { + component: 'Select', + componentProps: { + options: [], + props: { + multiple: true, + filterable: true, + allowCreate: true, + defaultFirstOption: true + } + } + } }, { title: '可重定向的 URI 地址', - field: 'redirectUris', // TODO @星语:带输入的 SELECT - isTable: false + field: 'redirectUris', + isTable: false, + form: { + component: 'Select', + componentProps: { + options: [], + props: { + multiple: true, + filterable: true, + allowCreate: true, + defaultFirstOption: true + } + } + } }, { title: '权限', field: 'authorities', - isTable: false + isTable: false, + form: { + component: 'Select', + componentProps: { + options: [], + props: { + multiple: true, + filterable: true, + allowCreate: true, + defaultFirstOption: true + } + } + } }, { title: '资源', field: 'resourceIds', - isTable: false + isTable: false, + form: { + component: 'Select', + componentProps: { + options: [], + props: { + multiple: true, + filterable: true, + defaultFirstOption: true + } + } + } }, { title: '附加信息',