当前位置: 首页 > news >正文

el-select控制单选还是多选

在这里插入图片描述

 <el-form :inline="true" :model="form" class="demo-form-inline"><el-form-item><el-select v-model="form.properties_id" placeholder="请选择样品性质" clearable :multiple="multiple_properties"  @change="getData()" @focus="focus_properties()" style="width: 300px"><el-option v-for="item in sample_properties" :label="item.label" :value="item.value" :key="item.value"></el-option></el-select></el-form-item><el-form-item><el-select v-model="form.place_id" placeholder="请选择品名" clearable :multiple="multiple_place" @change="getData()" @focus="focus_place()" style="width: 300px"><el-option v-for="item in place_data" :label="item.label" :value="item.value" :key="item.value"></el-option></el-select></el-form-item></el-form>
  form: {properties_id : [],place_id      : [],},multiple_properties: true,multiple_place: true,
 //properties 获得焦点focus_properties(){var that = thisthat.form.properties_id = [];if(that.form.place_id.length > 1){that.multiple_place = true;that.multiple_properties = false;}else{that.multiple_properties = true;//that.multiple_place = true;}},//place 获得焦点focus_place(){var that = thisthat.form.place_id = [];if(that.form.properties_id.length > 1){that.multiple_place = false;that.multiple_properties = true;}else{//that.multiple_properties = true;that.multiple_place = true;}},getData(){var that = this//样品性质var properties_id = [];var properties_id_len = that.form.properties_id.length;if(properties_id_len == undefined){//此时会变成字符串var str = that.form.properties_idproperties_id= JSON.parse("[" + str + "]");//变成数组形式}else{properties_id = that.form.properties_id;}//品名var place_id = [];var place_id_len = that.form.place_id.length;if(place_id_len == undefined){//此时会变成字符串var str = that.form.place_idplace_id= JSON.parse("[" + str + "]");//变成数组形式}else{place_id = that.form.place_id;}if(properties_id.length == 0){properties_id = null;}if(place_id.length == 0){place_id = null;}$.ajax({url: "/admin/report/getDevetimeData",type: "GET",data : {properties_id : properties_id,place_id      : place_id,},dataType:'json',success: function (res) {if (res.code == 100) {that.data = res.data;}}});},
http://www.lryc.cn/news/110062.html

相关文章:

  • nginx使用
  • 基于Jenkins+Python+Ubuntu+Docker的接口/UI自动化测试环境部署详细过程
  • Linux|ubuntu下运行python
  • 使用FreeMarker导出word文档(支持导出图片)
  • C/C++中变量按位操作
  • uni、css——制作表格样式的模型
  • mac前端代码编辑 Sublime Text 4 Dev 中文v4.0(4151)
  • 面试之HashMap
  • promethues mysql-rules
  • Maven项目中Lifecycle和Plugins下的install的区别
  • 02-状态模式
  • Python异常处理中异常的种类有哪些?你知道几个?
  • COBOL语言介绍及使用场景
  • 【计算机视觉 | 图像分割】arxiv 计算机视觉关于图像分割的学术速递(8 月 1 日论文合集)
  • Jetson nano 安装swapfile 解决Cannot allocate memory 问题
  • ElasticsSearch基础概念和安装
  • 【GEMM预备工作】行主序和列主序矩阵的内存中的连续性,解决理解问题
  • 利用el-button 画圆 ,通过border-radius >50% 就成圆形
  • 在tensorflow分布式训练过程中突然终止(终止)
  • windows永久暂停更新
  • Android 9系统源码_音频管理(一)按键音效源码解析
  • PyTorch搭建神经网络
  • TiDB 优雅关闭
  • 食品厂能源管理系统助力节能减排,提升可持续发展
  • ABAP读取文本函数效率优化,read_text --->zread_text
  • Spring Data Repository 使用详解
  • [ MySQL ] — 数据库环境安装、概念和基本使用
  • Apache Thrift C++库的TThreadPoolServer模式的完整示例
  • 图解java.util.concurrent并发包源码系列——深入理解ReentrantLock,看完可以吊打面试官
  • 【计算机网络】网络基础(上)