Commit 095ced7af04a9c09d25f57cf6fb657fef6fad218

Authored by xingyu
1 parent de6fc546

fix: todo

yudao-ui-admin-vue3/src/components/Form/src/Form.vue
@@ -227,6 +227,7 @@ export default defineComponent({ @@ -227,6 +227,7 @@ export default defineComponent({
227 {...(autoSetPlaceholder && setTextPlaceholder(item))} 227 {...(autoSetPlaceholder && setTextPlaceholder(item))}
228 {...setComponentProps(item)} 228 {...setComponentProps(item)}
229 style={item.componentProps?.style} 229 style={item.componentProps?.style}
  230 + {...item.componentProps?.props}
230 {...(notRenderOptions.includes(item?.component as string) && 231 {...(notRenderOptions.includes(item?.component as string) &&
231 item?.componentProps?.options 232 item?.componentProps?.options
232 ? { options: item?.componentProps?.options || [] } 233 ? { options: item?.componentProps?.options || [] }
yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts
1 import { reactive } from 'vue' 1 import { reactive } from 'vue'
2 import { useI18n } from '@/hooks/web/useI18n' 2 import { useI18n } from '@/hooks/web/useI18n'
3 import { required } from '@/utils/formRules' 3 import { required } from '@/utils/formRules'
4 -import { DICT_TYPE } from '@/utils/dict' 4 +import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
5 import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' 5 import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
6 const { t } = useI18n() // 国际化 6 const { t } = useI18n() // 国际化
7 7
  8 +const authorizedGrantOptions = getStrDictOptions(DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE)
  9 +
8 // 表单校验 10 // 表单校验
9 export const rules = reactive({ 11 export const rules = reactive({
10 clientId: [required], 12 clientId: [required],
@@ -76,36 +78,105 @@ const crudSchemas = reactive<VxeCrudSchema>({ @@ -76,36 +78,105 @@ const crudSchemas = reactive<VxeCrudSchema>({
76 title: '授权类型', 78 title: '授权类型',
77 field: 'authorizedGrantTypes', 79 field: 'authorizedGrantTypes',
78 table: { 80 table: {
79 - width: 300, 81 + width: 400,
80 slots: { 82 slots: {
81 default: 'authorizedGrantTypes_default' 83 default: 'authorizedGrantTypes_default'
82 } 84 }
  85 + },
  86 + form: {
  87 + component: 'Select',
  88 + componentProps: {
  89 + options: authorizedGrantOptions,
  90 + props: {
  91 + multiple: true,
  92 + filterable: true
  93 + }
  94 + }
83 } 95 }
84 }, 96 },
85 { 97 {
86 title: '授权范围', 98 title: '授权范围',
87 - field: 'scopes', // TODO @星语:带输入的 SELECT  
88 - isTable: false 99 + field: 'scopes',
  100 + isTable: false,
  101 + form: {
  102 + component: 'Select',
  103 + componentProps: {
  104 + options: [],
  105 + props: {
  106 + multiple: true,
  107 + filterable: true,
  108 + allowCreate: true,
  109 + defaultFirstOption: true
  110 + }
  111 + }
  112 + }
89 }, 113 },
90 { 114 {
91 title: '自动授权范围', 115 title: '自动授权范围',
92 - field: 'autoApproveScopes', // TODO @星语:带输入的 SELECT  
93 - isTable: false 116 + field: 'autoApproveScopes',
  117 + isTable: false,
  118 + form: {
  119 + component: 'Select',
  120 + componentProps: {
  121 + options: [],
  122 + props: {
  123 + multiple: true,
  124 + filterable: true,
  125 + allowCreate: true,
  126 + defaultFirstOption: true
  127 + }
  128 + }
  129 + }
94 }, 130 },
95 { 131 {
96 title: '可重定向的 URI 地址', 132 title: '可重定向的 URI 地址',
97 - field: 'redirectUris', // TODO @星语:带输入的 SELECT  
98 - isTable: false 133 + field: 'redirectUris',
  134 + isTable: false,
  135 + form: {
  136 + component: 'Select',
  137 + componentProps: {
  138 + options: [],
  139 + props: {
  140 + multiple: true,
  141 + filterable: true,
  142 + allowCreate: true,
  143 + defaultFirstOption: true
  144 + }
  145 + }
  146 + }
99 }, 147 },
100 { 148 {
101 title: '权限', 149 title: '权限',
102 field: 'authorities', 150 field: 'authorities',
103 - isTable: false 151 + isTable: false,
  152 + form: {
  153 + component: 'Select',
  154 + componentProps: {
  155 + options: [],
  156 + props: {
  157 + multiple: true,
  158 + filterable: true,
  159 + allowCreate: true,
  160 + defaultFirstOption: true
  161 + }
  162 + }
  163 + }
104 }, 164 },
105 { 165 {
106 title: '资源', 166 title: '资源',
107 field: 'resourceIds', 167 field: 'resourceIds',
108 - isTable: false 168 + isTable: false,
  169 + form: {
  170 + component: 'Select',
  171 + componentProps: {
  172 + options: [],
  173 + props: {
  174 + multiple: true,
  175 + filterable: true,
  176 + defaultFirstOption: true
  177 + }
  178 + }
  179 + }
109 }, 180 },
110 { 181 {
111 title: '附加信息', 182 title: '附加信息',