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

莱芜住房和城乡建设厅网站市场营销活动策划方案

莱芜住房和城乡建设厅网站,市场营销活动策划方案,如何个人创建微信公众号,wordpress 搜索页最后的效果就是树形的下拉多选&#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.hkea.cn/news/448013/

相关文章:

  • seo外包平台福州百度快照优化
  • 橙子建站广告怎么投放竞价网络推广
  • 中国公司查询网站网络公司起名
  • wordpress邮箱内容更改一键关键词优化
  • 楼市最新消息2022年房价走势seo网络推广经理
  • wordpress免费中文企业主题seo权重优化软件
  • 周口网站建设哪家好济南专业seo推广公司
  • 济南网站忧化怎么把抖音关键词做上去
  • 网站建设与维护的题目网站点击软件排名
  • 网站收录服务企业网络的组网方案
  • nba排名灰色词seo排名
  • 如何建自己的个人网站深圳市seo上词多少钱
  • 迎访问中国建设银行网站_永久免费的电销外呼系统
  • 类似AG网站建设网络营销的十大特点
  • 河北盘古做的网站用的什么服务器品牌策划与推广
  • 做网站开发的是不是程序员品牌营销与推广
  • 安卓android软件seo搜索引擎优化方式
  • 网站设计培训课程引流推广平台
  • 做淘宝美工需要知道的网站app软件推广平台
  • 做自己个人网站搜索竞价
  • 兰州网站优化哪家好手机系统流畅神器
  • 广东深圳住房和城乡建设部网站文章优化软件
  • java制作动态网站开发怎么可以让百度快速收录视频
  • 做网站管理好吗阳泉seo
  • 网站排名优化建设seo人人网
  • html5可以做动态网站惠州seo计费
  • 商城网站带宽控制河南网站建设哪家公司好
  • 贵阳网络公司网站建设网络推广公司深圳
  • 企业网站建设公司电话西安seo分析报告怎么写
  • 岳阳市政府网网站seo优化报告