|
252 | 252 | <a-form-item :label="$t('label.ostypeid')"> |
253 | 253 | <a-select |
254 | 254 | showSearch |
| 255 | + optionFilterProp="children" |
| 256 | + :filterOption="(input, option) => { |
| 257 | + return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| 258 | + }" |
255 | 259 | v-decorator="['ostypeid', { |
256 | | - initialValue: defaultOsType, |
| 260 | + initialValue: defaultOsId, |
257 | 261 | rules: [ |
258 | 262 | { |
259 | 263 | required: true, |
|
263 | 267 | }]" |
264 | 268 | :loading="osTypes.loading" |
265 | 269 | :placeholder="apiParams.ostypeid.description"> |
266 | | - <a-select-option v-for="opt in osTypes.opts" :key="opt.name || opt.description"> |
| 270 | + <a-select-option v-for="opt in osTypes.opts" :key="opt.id"> |
267 | 271 | {{ opt.name || opt.description }} |
268 | 272 | </a-select-option> |
269 | 273 | </a-select> |
@@ -792,12 +796,9 @@ export default { |
792 | 796 | } |
793 | 797 | params[key] = input.join() |
794 | 798 | } else if (key === 'zoneid') { |
795 | | - params[key] = values[key] |
| 799 | + params[key] = input |
796 | 800 | } else if (key === 'ostypeid') { |
797 | | - const osTypeSelected = this.osTypes.opts.filter(item => item.description === input) |
798 | | - if (osTypeSelected && osTypeSelected[0]) { |
799 | | - params[key] = osTypeSelected[0].id |
800 | | - } |
| 801 | + params[key] = input |
801 | 802 | } else if (key === 'hypervisor') { |
802 | 803 | params[key] = this.hyperVisor.opts[input].name |
803 | 804 | } else if (key === 'groupenabled') { |
|
0 commit comments