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

长春做网站的公司有哪些网页设计的主题

长春做网站的公司有哪些,网页设计的主题,宿迁手机网站建设公司,美橙互联网站备案文章目录 前言1.原本代码2.新增逻辑3.优化逻辑 前言 原逻辑#xff1a;后端data数据中返回数组#xff0c;数组中有两个对象#xff0c;一个是属性指标#xff0c;一个是应用指标#xff0c;根据这两个指标展示不同的多选框 1.原本代码 getIndicatorRange(indexReportLi… 文章目录 前言1.原本代码2.新增逻辑3.优化逻辑 前言 原逻辑后端data数据中返回数组数组中有两个对象一个是属性指标一个是应用指标根据这两个指标展示不同的多选框 1.原本代码 getIndicatorRange(indexReportList, target) {const indexList []const indexObj {}indexReportList.forEach(item {item.showReportFieldList.forEach(fieldItem {indexObj[fieldItem.showFieldTag] {checked: target.includes(fieldItem.showFieldTag),disabled: item.name 属性指标}if (target.includes(fieldItem.showFieldTag)) {indexList.push({...fieldItem,// isAttri: item.name 属性指标, // 判断是否是属性指标disabled: item.name 属性指标})}})})return {indexList,indexObj}},indexReportList.forEach(item {const tarList [...target] // 浅拷贝数组tarList.forEach(tarItem {item.showReportFieldList.forEach(fieldItem {indexObj[fieldItem.showFieldTag] {checked: tarItem fieldItem.showFieldTag,disabled: item.name 属性指标}if (tarItem fieldItem.showFieldTag) {indexList.push({...fieldItem,// isAttri: item.name 属性指标, // 判断是否是属性指标disabled: item.name 属性指标})}})})})2.新增逻辑 这个选中的指标可以进行拖拽然后拖获取回显逻辑中由于是遍历接口获取的源数组导致拖拽保存后重新进入页面还是原本的拖拽顺序也就是顺序没改。 3.优化逻辑 正常是在最外层使用遍历拖拽后的新数组获取一个新的源数组进行渲染但是这样加上本身的for循环就有三层for循环了。优化后的代码如下拷贝展示数据遍历这个数据将里面的是否存在直接和item 的数据进行判断即可 优化后的代码 getIndicatorRange(indexReportList, target) {const indexList []const indexObj {}const targetMap new Map();// 构建 targetMap保持 target 的顺序target.forEach((tarItem, index) {targetMap.set(tarItem, index);});indexReportList.forEach(item {item.showReportFieldList.forEach(fieldItem {const showFieldTag fieldItem.showFieldTag;const isAttri item.name 属性指标;// 更新 indexObjif (!indexObj[showFieldTag]) {indexObj[showFieldTag] {checked: false,disabled: isAttri};}// 如果 showFieldTag 在 target 中更新 indexObj 并插入 indexListif (targetMap.has(showFieldTag)) {indexObj[showFieldTag].checked true;// 插入 indexList保持 target 的顺序indexList[targetMap.get(showFieldTag)] {...fieldItem,disabled: isAttri};}})})return {indexList,indexObj} },
http://www.dnsts.com.cn/news/168026.html

相关文章:

  • 北京大学学术学风建设网站wordpress源码安装
  • 淮安做网站找哪家好家用电脑做网站后台
  • 做一份seo网站诊断wordpress源代码怎么修改
  • 网站制作网站开发ple id充值建设特效网站
  • 双桥集团网站建设Wordpress 插件购买
  • 网站如何发布到网上wordpress禁止访问模版页面
  • 普洱市交通建设集团官方网站中信建投证券股份有限公司
  • 石家庄云图网站建设哈尔滨公司做网站
  • 网站建设可行性方案接私活做网站
  • 北京安慧桥网站建设宁波高端网站建设
  • 怎么黑网站上海校园兼职网站建设
  • 晚上做设计挣钱的网站十大门户网站有哪些
  • 房地产型网站建设网站顶端flash
  • 广西医科大学网站建设素材免费下载网站
  • 设计一个商务网站vestacp配置wordpress
  • 浦东做营销网站公司做宣传网站
  • 无锡seo网站推广中企动力天津分公司
  • 装修公司网站建设的意义网站建站外包公司
  • 在线flash相册网站源码网站后台管理界面下载
  • 旅游投资公司网站建设建设银行个人网银登录
  • 网站404页面做晚了园林网站免费模板
  • 外外贸网站推广方案廊坊百度推广优化
  • 安徽品质网站建设创新网站建设_超速云建站
  • 北京东城做网站免费商标查询平台
  • 哪些网站用天平做logo滁州网站开发公司
  • 哈尔滨网站制作方案扬中网站推广
  • 在线简历免费制作网站电商数据
  • 户网站开发的小公司如何做一个个人做网站
  • 找最新游戏做视频网站湖南网站优化代运营
  • 在线网站代理浏览静态网站开发与实施的论文