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

郑州网站关建筑模板尺寸及价格

郑州网站关,建筑模板尺寸及价格,成都企业网站建设介绍,高端开发网站哪家专业最后的效果就是树形的下拉多选&#xff0c;可选择任意一级选项&#xff0c;下拉框中有一个按钮可以实现全选&#xff0c;也支持搜索功能。 在mounted生命周期里面获取全部部门的数据&#xff0c;handleTree是讲接口返回的数据整理成树形结构&#xff0c;可以自行解决 <div c…

最后的效果就是树形的下拉多选,可选择任意一级选项,下拉框中有一个按钮可以实现全选,也支持搜索功能。

在mounted生命周期里面获取全部部门的数据,handleTree是讲接口返回的数据整理成树形结构,可以自行解决

             <div class="LeftText"><span style="color: red; margin-right: 4px">*</span>部门:</div><el-selectv-model="executiveDepartName"filterable:filter-method="selectChange"multiple@visible-change="visibleChange"@remove-tag="seleRemoveTag"style="width: 80%"><el-option style="display: none" value=""></el-option><el-checkboxstyle="width: 100%;height: 40px;line-height: 40px;padding-left: 20px;border-bottom: 1px solid #dcdfe6;"class="allselect":indeterminate="isIndeterminate"v-model="allSelectModule"@change="allselect">全选</el-checkbox><el-cascader-panelref="cascaderModule":key="deptList.length":options="deptList"@change="cascaderChange"style="width: 80%":props="props"filterable:border="false":show-all-levels="false"v-model="executiveDepartment"></el-cascader-panel></el-select></div>

     props: {multiple: true,value: "deptId",label: "deptName",checkStrictly: true,emitPath: false,},   allDeptList:[];//所有的部门信息,内部结构为:{deptId:1,deptName:"一级部门"}isSeach:false;//是否搜索状态tempExecutive:[];// 搜索前已选中的数据//搜索查询事件--是因为在cascaderChange事件中,对v-model的值重新赋值,导致下拉选时,会触发el-select的搜索事件,所以加了一个isFilter判断selectChange(val) {if (val !== "") {this.deptList = [];this.deptList = this.allDeptList.filter((item) => {return item.deptName.toLowerCase().indexOf(val.toLowerCase()) > -1;});this.isSeach = true;this.tempExecutive = this.executiveDepartment;} else {if (!this.isFilter) {this.deptList = this.handleTree(this.allDeptList, "deptId");this.isFilter = !this.isFilter;}}},visibleChange(e) {if (e) {this.isSeach = false;this.isFilter = false;this.deptList = this.handleTree(this.allDeptList, "deptId");this.initStatus();}},对全选状态进行重新赋值initStatus() {if (this.executiveDepartment.length == this.allDeptList.length) {this.allSelectModule = true;this.isIndeterminate = false;} else if (this.executiveDepartment.length == 0) {this.allSelectModule = false;this.isIndeterminate = false;} else {this.allSelectModule = false;this.isIndeterminate = true;}},//select框里回显的是选中部门的名称getDeptName() {const result = [];this.executiveDepartment.filter((item) => {this.allDeptList.map((i) => {if (item == i.deptId) {result.push(i.deptName);}});});return result;},seleRemoveTag(val) {if (val) {const result = this.allDeptList.find((item) => {if (item.deptName == val) {return item;}});this.executiveDepartment = this.executiveDepartment.filter((item) => item !== result.deptId);}},// 下拉多选选中时触发的事件cascaderChange() {this.isFilter = true;//如果是搜索状态,讲之前选中的值和搜素状态下的值进行合并和去重,否则,之前选中的值会被清空if (this.isSeach) {this.executiveDepartment = [...new Set([...this.tempExecutive, ...this.executiveDepartment]),];}this.executiveDepartName = this.getDeptName();this.initStatus();},//全选事件allselect() {if (this.allSelectModule) {this.isIndeterminate = false;if (this.isSeach) {this.executiveDepartment = this.deptList.map((item) => item.deptId);this.executiveDepartName = this.getDeptName();} else {this.executiveDepartment = this.getAllIds(this.deptList);this.executiveDepartName = this.getDeptName();}} else {this.executiveDepartment = [];this.executiveDepartName = [];}},getAllIds(nodes) {let ids = [];(function getIds(nodes) {nodes.forEach((node) => {ids.push(node.deptId);if (node.children && node.children.length) {getIds(node.children);}});})(nodes);return ids;},

http://www.yayakq.cn/news/838252/

相关文章:

  • 西安网站建站品牌广西电力工程建设有限公司网站
  • h5网站开发语言选择中国乐清网app
  • 娱乐网站策划书绿色主色调网站
  • 泉州网站建设服务怎么查看网站公司
  • 公明做网站多少钱沈阳做网站好的
  • 网页设计与网站建设考试名词解释wordpress在线阅读pdf
  • 移动网站开发课程设计全国十大数字展馆设计公司
  • 上海做网站需要多少钱信息服务平台的优势和劣势
  • 山东建设厅官方网站一级建造师wordpress按钮编辑器
  • 深圳一元网站建设公司百度关键词seo公司
  • 手把手wordpress仿站东莞网站建设流程
  • 青岛网站建设效果建设网站找谁
  • 网站设计公司上海深圳网站建设公司968
  • 怎样做门户网站网站赏析
  • app网页设计网站一键转换图片wordpress
  • 做网站除了域名还用什么wordpress免费的模板
  • 中介网站模板东莞百度seo排名
  • 高端网站建设必须要满足哪些要求男女做爰视频网站在线
  • 网站名称有哪些国内搜索引擎排名第一的是
  • 寻找电子商务网站建设建筑平面设计图
  • 福田网站建设有限公司微页制作网站模板免费下载
  • wordpress评论框增强seo百度站长工具查询
  • 部分网站为什么网页打不开的原因及解决方法tp类似wordpress
  • 医保局网站建设公司网站维护与更新
  • 济南网站建设 选搜点o单页营销网站
  • 设计中国北京官网seo服务公司深圳
  • 网站建设首页该放什么seo优化公司排名
  • 企业网站建设的背景和目的中国建设银行对公网站首页
  • 高端定制手机网站好的seo
  • 如果是创建的网站重庆建筑模板