zoukankan      html  css  js  c++  java
  • 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();
    	});
      },
    
    

    三、截图预览




  • 相关阅读:
    Go语言从入门到放弃(三) 布尔/数字/格式化输出
    11. GLOBAL_VARIABLES 与 SESSION_VARIABLES
    10. GLOBAL_STATUS 与 SESSION_STATUS
    9. FILES
    8. EVENTS
    7. ENGINES
    6. COLUMN_PRIVILEGES
    5. COLUMNS
    4. COLLATION_CHARACTER_SET_APPLICABILITY
    3. COLLATIONS
  • 原文地址:https://www.cnblogs.com/guxingy/p/13890877.html
Copyright © 2011-2022 走看看