AVUE 下拉 select 下拉項 為 一個表的數據


一、后端

	/**
	 * 數據源列表
	 */
	@GetMapping("/select")
	@ApiOperationSupport(order = 8)
	@ApiOperation(value = "下拉數據源", notes = "查詢列表")
	public R<List<Brand>> select() {
		List<Brand> list = brandService.list();
		return R.data(list);
	}

二、前端

1、顯示下拉

{
  label: "品牌",
  prop: "brandId",
  rules: [{
	required: false,
	message: "請輸入品牌",
	trigger: "blur"
  }],
  hide: true,// 在列上隱藏
  type: "select",
  dicUrl: "/api/blade-pms/brand/select",
  props: {
	label: "name",
	value: "id"
  },
},

2、下拉文本字段 在對話框中隱藏不顯示

            {
              label: "店鋪名稱",
              prop: "storeName",
              display: false,
            },

3、添加/編輯 寫入下拉文本 到字段

  rowSave(row, done, loading) {
	row.storeName = row.$storeId;
	add(row).then(() => {
	  done();
	  this.onLoad(this.page);
	  this.$message({
		type: "success",
		message: "操作成功!"
	  });
	}, error => {
	  window.console.log(error);
	  loading();
	});
  },
  rowUpdate(row, index, done, loading) {
	row.storeName = row.$storeId;
	update(row).then(() => {
	  done();
	  this.onLoad(this.page);
	  this.$message({
		type: "success",
		message: "操作成功!"
	  });
	}, error => {
	  window.console.log(error);
	  loading();
	});
  },

三、截圖預覽





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 AVUE 下拉 select 下拉項 為 字典 AVUE 下拉 select 獲取選中項的文本 AVUE bug select下拉顯示不完 下拉框