添加select查询及新增项选择

This commit is contained in:
junleea 2025-05-10 15:09:18 +08:00
parent 870a70222c
commit 64daeaeb56
3 changed files with 4 additions and 2 deletions

View File

@ -9,7 +9,7 @@
<el-input-number v-else-if="item.type === 'number'" v-model="form[item.prop]"
:disabled="item.disabled" controls-position="right"></el-input-number>
<el-select v-else-if="item.type === 'select'" v-model="form[item.prop]" :disabled="item.disabled"
:placeholder="item.placeholder" clearable :multiple="item.multiple?true:false">
:placeholder="item.placeholder" clearable :multiple="item.multiple?true:false" filterable :allow-create="item.allowcreate?true:false" >
<el-option v-for="opt in item.opts" :label="opt.label" :value="opt.value"></el-option>
</el-select>
<el-date-picker v-else-if="item.type === 'date'" type="date" v-model="form[item.prop]"

View File

@ -16,6 +16,8 @@ export interface FormOptionList {
format?: string;
activeValue?: any;
multiple?: boolean;
allowcreate?: boolean;
filterable?: boolean;
inactiveValue?: any;
activeText?: string;
inactiveText?: string;

View File

@ -154,7 +154,7 @@ let options = ref<FormOption>({
labelWidth: '100px',
span: 12,
list: [
{ type: 'select', label: '类型', prop: 'Type', required: true , opts:[{label: '本地部署模型', value: 'ollama'},{label: '星火', value: 'spark'},{label: '豆包', value: 'doubao'}]},
{ type: 'select', label: '类型', prop: 'Type', required: true, allowcreate:true, opts:[{label: '本地部署模型', value: 'ollama'},{label: '星火', value: 'spark'},{label: '豆包', value: 'doubao'}]},
{ type: 'input', label: 'URL', prop: 'Url', required: true },
{ type: 'input', label: '参数', prop: 'Parameter', required: true },
{ type: 'input', label: '描述', prop: 'Description', required: true },