|
|
@@ -69,8 +69,8 @@
|
|
|
</el-form>
|
|
|
|
|
|
<el-dialog title="从模板导入营养素" :visible.sync="dialogFormVisible">
|
|
|
- <el-form ref="dialogForm" label-position="left" label-width="80px" style="width: 400px; margin-left:50px;">
|
|
|
- <el-form-item label="模板:" prop="templateId">
|
|
|
+ <el-form ref="dialogForm" label-position="left" label-width="60px" style="width: 80%; margin-left:50px;">
|
|
|
+ <el-form-item label="模板:" prop="templateId" >
|
|
|
<el-select
|
|
|
v-model="templateId"
|
|
|
class="filter-item"
|
|
|
@@ -80,6 +80,7 @@
|
|
|
placeholder="请输入模板关键词"
|
|
|
:loading="templateLoading"
|
|
|
:remote-method="queryTemplates"
|
|
|
+ style="width: 100%"
|
|
|
>
|
|
|
<el-option v-for="item in templates" :key="`template${item.id}`" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
@@ -192,6 +193,9 @@ export default {
|
|
|
queryTemplates(query='') {
|
|
|
getNutrientTemplates({ query }).then(res => {
|
|
|
this.templates = res.data.list
|
|
|
+ if (this.templates.length > 0) {
|
|
|
+ this.templateId = this.templates[0].id
|
|
|
+ }
|
|
|
}).catch(() => {
|
|
|
this.templates = []
|
|
|
})
|