jeecgboot框架 下拉框查詢數據庫中的某個字段

查詢頁面:

後臺部分

    @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>

在這裏插入圖片描述在這裏插入圖片描述
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章