查詢頁面:
後臺部分
@GetMapping("/queryProjectName")
public Result<?> queryProjectName(){
QueryWrapper<YsxProject> queryWrapper=new QueryWrapper<YsxProject>();
queryWrapper.eq("del_flag",0).eq("project_status",2);
List<YsxProject> list = ysxProjectService.list(queryWrapper);
return Result.ok(list);
}
vue部分
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="項目名稱">
<a-select name="projectNameList" v-model="queryParam.projectId" placeholder="請選擇項目名稱">
<a-select-option value="">請選擇</a-select-option>
<a-select-option v-for="item in projectNameList" :value="item.id"> {{item.projectName}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
打印日誌
添加頁面
<a-form-item label="項目名稱" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select name="projectNameList" v-decorator="['projectId', validatorRules.projectId]" placeholder="請選擇項目名稱">
<a-select-option value="">請選擇</a-select-option>
<a-select-option v-for="(item, index) in projectNameList" :key="index.toString()" :value="item.id"> {{item.projectName}}</a-select-option>
</a-select>
</a-form-item>