smfw-analysis.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. var reqList = [],reqLists = [[],[],[]]; //记录请求的参数和url,用于后退时使用
  2. var colors={"0":"#73acff","1":"#fdd56a","2":"#fdb36a",
  3. "3":"#fd866a","4":"#9e87ff","5":"#58d5ff",
  4. "6":"#20d7ad","7":"#fd866a","8":"#fdb36a","9":"#fdd56a","10":"#264478","11":"#43682b","12":"#5b9db5"}
  5. Vue.use(Vuedals.default);
  6. new Vue({
  7. el: "#main",
  8. data: {
  9. isloading:false, //加载中
  10. pageData2:{},
  11. pageData:{},
  12. tabledata0:[],
  13. tabledata1:[],
  14. tabledata2:[],
  15. hastopbar0:true,
  16. slaveKey1:"",
  17. reqListLength0:1,
  18. reqListLength1:1,
  19. reqListLength2:1,
  20. data0:[],
  21. data1:[],
  22. data2:[],
  23. pieShow0:true,
  24. pieShow1:true,
  25. pieShow2:true,
  26. selDateType:undefined, // 1-日,2-周, 3-月
  27. index:150,
  28. pageIndex:1,
  29. rhfs:"",
  30. informationList:[{},{code:"1",title:"上门服务",name:"smfu",tip:"统计当前年度至今上门服务情况,点击右上角可切换时间范围查询",lineChartTitle:"新增服务工单趋势",lineChartIndex:"",lineChartName:"服务工单"},
  31. {code:"2",title:"入户访视",name:"rhfs",tip:"统计当前年度至今入户访视情况,点击右上角可切换时间范围查询",lineChartTitle:"访视量新增趋势",lineChartIndex:"",lineChartName:"访视量"}],
  32. informationShow:true,
  33. information:{},
  34. ltabList:[{},{indexNames:{"serviceOrderTrend": "服务工单"},xDatas:{},yDatas:{},names:[]},
  35. {indexNames:{"serviceOrderTrend": "访视量"},xDatas:{},yDatas:{},names:[]},],
  36. //请求页面所需参数
  37. levelList:[{level:"4",areaLevel:"2"},{level:"3",areaLevel:"3"},{level:"2",areaLevel:"4"}], //两种搜索,地区等级对比
  38. areaLevel:"", // 2、市,3、区,4、社区,5、团队\
  39. initareaLevel:"",
  40. initlevel: '',
  41. initarea: '',
  42. level: '',
  43. area: '',
  44. areaTitle: '',
  45. initareaTitle: '',
  46. lowLevel:3,
  47. initlowLevel:3,
  48. selectedDateType: 1, //折线图坐标值1-日,2-周,3-月
  49. lowCode: '',
  50. chooseYear: '',
  51. start: "",
  52. end: "",
  53. userRole: '',
  54. tabnumber:3,
  55. reqListLength:1,
  56. appname:"上门服务",
  57. },
  58. components: {
  59. vuedals: Vuedals.Component
  60. },
  61. watch:{
  62. areaTitle:function(val){
  63. //更新区域名称
  64. EventBus.$emit('update-area-name', {
  65. 'areaName': val
  66. });
  67. },
  68. chooseYear:function(val){
  69. //更新年份
  70. EventBus.$emit('update-statistics-year', {
  71. 'selectDate': val
  72. });
  73. },
  74. },
  75. mounted: function () {
  76. var vm=this
  77. //初始化数据
  78. initData(vm);
  79. vm.bindEvent()
  80. },
  81. methods: {
  82. getData:function(isNext,index ){ //是否下转
  83. var vm = this
  84. var params={
  85. areaTitle:vm.areaTitle,
  86. areaLevel: vm.areaLevel,
  87. level: vm.level,
  88. area: vm.area,
  89. endDate: vm.end,
  90. startDate: vm.start,
  91. lowLevel: vm.lowLevel,
  92. index:index
  93. }
  94. // if(index!=undefined){
  95. // loadData([index], vm); //刷新数据
  96. // }else
  97. if(vm.pageIndex == 1){
  98. loadData([1,3,4,5], vm); //刷新数据
  99. }else{
  100. loadData([2,6,7,8], vm); //刷新数据
  101. }
  102. if(isNext){
  103. //存储请求所带的参数
  104. reqList.push(params);
  105. if(index!=undefined){
  106. reqLists[index].push(params)
  107. vm["reqListLength"+index] = reqLists[index].length+1
  108. }
  109. }
  110. },
  111. //表格tab切换/下转
  112. getnewdata:function(arg,index){
  113. var vm = this
  114. if(arg.level){
  115. vm.level = arg.level
  116. vm.areaLevel = _.find(vm.levelList,{level:vm.level}).areaLevel
  117. }
  118. if(arg.area){
  119. vm.area = arg.area
  120. }
  121. if(arg.areaTitle){
  122. vm.areaTitle = arg.areaTitle
  123. }
  124. if(arg.lowLevel){
  125. vm.lowLevel=arg.lowLevel
  126. }else{
  127. if(vm.areaLevel){
  128. vm.lowLevel=arg.area == '350200' ? 3 : vm.area.length == 6 ? 4 : 5;
  129. }else{
  130. vm.lowLevel = arg.lowLevel || ""
  131. }
  132. }
  133. vm.getData(arg.level,index) //有传level,说明是下转
  134. },
  135. getnewdata0:function(arg){
  136. var vm = this
  137. if(vm.hastopbar0){ //服务项时
  138. vm.hastopbar0 = false
  139. vm.slaveKey1 = arg.area
  140. vm.area=vm.initarea
  141. vm.areaLevel=vm.initareaLevel
  142. vm.level=vm.initlevel
  143. vm.lowLevel = vm.initlowLevel
  144. vm.getData(true,0)
  145. }else{
  146. vm.getnewdata(arg,0)
  147. }
  148. },
  149. getnewdata1:function(arg){
  150. var vm = this
  151. vm.getnewdata(arg,1)
  152. },
  153. getnewdata2:function(arg){
  154. var vm = this
  155. vm.getnewdata(arg,2)
  156. },
  157. backClickHandel:function(index,lIndex,refIndex){
  158. var vm=this
  159. var hasIndex = _.findLastIndex(reqList,{index:index})
  160. reqList.splice(hasIndex,1);
  161. var preInfo = reqLists[lIndex].pop();
  162. var info = reqLists[lIndex][reqLists[lIndex].length - 1];
  163. if(reqLists[lIndex].length==0){
  164. if(refIndex=='0'){
  165. vm["hastopbar"+refIndex] = true
  166. vm["slaveKey1"] = ""
  167. info = preInfo
  168. }else{
  169. info = reqList[0]
  170. }
  171. }
  172. vm.areaLevel = info.areaLevel;
  173. vm.level = info.level;
  174. vm.area = info.area;
  175. vm.lowLevel = info.lowLevel;
  176. vm.areaTitle = info.areaTitle;
  177. vm["reqListLength"+index] = reqLists[lIndex].length+1
  178. if(reqLists[lIndex].length==0 && refIndex=='0'){
  179. vm.getData(false,3)
  180. }else{
  181. vm.getData(false,index)
  182. }
  183. vm.$refs["tableRef_"+refIndex].changeTab({level:vm.level,lowlevel:vm.lowLevel}) //表格tab
  184. },
  185. backClick0:function(){
  186. var vm=this
  187. vm.backClickHandel(0,0,'0')
  188. },
  189. backClick1:function(){
  190. var vm=this
  191. vm.backClickHandel(1,1,'1')
  192. },
  193. backClick2:function(){
  194. var vm=this
  195. vm.backClickHandel(2,2,'2')
  196. },
  197. //时间选择
  198. changeDate: function () {
  199. var vm=this
  200. //搜索时,取消下转记录
  201. vm.area=vm.initarea
  202. vm.areaLevel=vm.initareaLevel
  203. vm.areaTitle=vm.initareaTitle
  204. vm.level=vm.initlevel
  205. vm.lowLevel = vm.initlowLevel
  206. reqHistoryInit(vm)
  207. vm.getData(true)
  208. vm.initTable()
  209. },
  210. //切换line
  211. showTab:function(ptab){
  212. var vm=this
  213. setTimeout(function(){
  214. EventBus.$emit("draw-line-chart", {
  215. panelName : "分级诊疗情况",
  216. quotaNames : vm.ltabList[ptab].names,
  217. xData : vm.ltabList[ptab].xDatas[0],
  218. yDatas : vm.ltabList[ptab].yDatas,
  219. colors : ["#17b3ec",'#FF9526'],
  220. nowlineid : 'lineChart'+ptab,
  221. noDateType: true,
  222. chartheight:"320",
  223. unit:"人",
  224. noshowDate:false,
  225. });
  226. },300)
  227. },
  228. backClick:function(){
  229. var vm=this
  230. // if (reqList.length == 1) {
  231. history.go(-1);
  232. // } else {
  233. // var lastInfo = reqList[reqList.length-1]
  234. // if(lastInfo.index){
  235. // var idx = lastInfo.index - 8
  236. // vm["backClick"+idx]()
  237. // }
  238. // }
  239. },
  240. bindEvent:function(){
  241. var vm=this
  242. //监听后退按钮的操作
  243. EventBus.$on("back-click", function (arg) {
  244. EventBus.$emit('update-statistics-time', {}); //更新统计时间
  245. vm.backClick()
  246. });
  247. //监听页面刷新
  248. EventBus.$on("refresh-click", function (arg) {
  249. EventBus.$emit('update-statistics-time', {}); //更新统计时间
  250. initData(vm)
  251. });
  252. //弹出筛选框
  253. EventBus.$on('filter-click', function(arg) {
  254. //弹框显示筛选条件
  255. Vuedals.Bus.$emit('new', {
  256. title: '条件筛选',
  257. onClose:function(data){
  258. vm.chooseYear = data.chooseYear;
  259. if(vm.chooseYear){
  260. vm.selDateType = undefined
  261. vm.end = getEndDate(vm.chooseYear)
  262. vm.start = getStartDate(vm.chooseYear)
  263. }else{
  264. vm.selDateType = "按"+data.dimensionVal
  265. vm.end = getDateBefore(0)
  266. if(data.dimensionVal == '日'){
  267. vm.start = getDateBefore(1)
  268. }else if(data.dimensionVal == '周'){
  269. vm.start = getDateBefore(7)
  270. }else if(data.dimensionVal == '月'){
  271. vm.start = getDateBefore(30)
  272. }
  273. }
  274. vm.rhfs = data.rhfs
  275. vm.pageIndex = data.smfu
  276. vm.pageIndex == 1?vm.appname="上门服务":vm.appname="入户访视"
  277. vm.changeDate()
  278. EventBus.$emit('update-statistics-time', {});//更新统计时间
  279. //更新维度名称
  280. EventBus.$emit('update-dimension-name', {
  281. "dimensionVal" : vm.selDateType
  282. });
  283. },
  284. component: 'smfw-filter',
  285. props: {
  286. chooseYear: vm.chooseYear,
  287. minYear:2016,
  288. dimensionValList:['日','周','月'],
  289. }
  290. });
  291. });
  292. $("#main").removeClass("c-hide");
  293. },
  294. initTable:function(){
  295. var vm=this
  296. var tabList = [{name:"各区",level:"4",lowlevel:"3",isShow:true},{name:"社区",level:"3",lowlevel:"4",isShow:true},{name:"团队",level:"2",lowlevel:"5",isShow:true}]
  297. var tabList1 = JSON.parse(JSON.stringify(tabList))
  298. vm.$refs.tableRef_1.initTable({
  299. //表格表头
  300. tabList:tabList1,
  301. headers:[{thead:"地区",param:"name",canclick:true},{thead:"服务工单(个)",param:"num"},{thead:"服务费用(元)",param:"price"}],
  302. tabnumber:vm.tabnumber,
  303. })
  304. vm.$refs.tableRef_2.initTable({
  305. //表格表头
  306. tabList:tabList1,
  307. headers:[{thead:"地区",param:"name",canclick:true},{thead:"访视量",param:"num"}],
  308. tabnumber:vm.tabnumber,
  309. })
  310. var tabItem = {name:"服务项目"}
  311. tabList.splice(3-vm.tabnumber,0,tabItem)
  312. vm.$refs.tableRef_0.initTable({
  313. //表格表头
  314. tabList:tabList,
  315. headers:[{thead:"服务项目",param:"name"},{thead:"服务次数(次)",param:"num"},{thead:"服务费用(元)",param:"price"}],
  316. tabnumber:vm.tabnumber+1,
  317. })
  318. },
  319. gotoServerList:function(){
  320. var vm = this
  321. var hreftext = httpRequest.server+"ichat-web/#/service-order-List?roleCode="+vm.area //"http://192.168.131.103:8080/" + vm.hreftext +"?roleCode="+vm.area
  322. window.open(hreftext)
  323. //弹框显示筛选条件
  324. // Vuedals.Bus.$emit('new', {
  325. // title: '服务工单记录',
  326. // onClose:function(data){
  327. // },
  328. // component: 'iframe-page',
  329. // props: {
  330. // hreftext: hreftext,
  331. // },
  332. // size:'w90'
  333. // });
  334. },
  335. }
  336. })
  337. function initData(vm) {
  338. //获得缓存中缓存的角色权限
  339. var userRole = window.sessionStorage.getItem("selectedRole");
  340. if (!userRole) {
  341. return false;
  342. }
  343. vm.userRole = JSON.parse(userRole);
  344. //level:2、市,3、区,4、社区,5、团队
  345. vm.initareaLevel = vm.areaLevel = vm.userRole.code == '350200' ? 2 : vm.userRole.code.length == 6 ? 3 : 4;
  346. vm.initlevel = vm.level = vm.userRole.code == '350200' ? 4 : vm.userRole.code.length == 6 ? 3 : 2;
  347. vm.initlowLevel = vm.lowLevel = vm.userRole.code == '350200' ? 3 : vm.userRole.code.length == 6 ? 4 : 5;
  348. vm.initarea =vm.area = vm.userRole.code;
  349. vm.initareaTitle = vm.areaTitle = vm.userRole.name;
  350. vm.tabnumber=vm.areaLevel==4?1:vm.areaLevel==3?2:3 //表格显示的tab数
  351. //初始化时间
  352. vm.chooseYear = getSignDate()
  353. vm.selDateType = undefined
  354. vm.end = getEndDate(vm.chooseYear)
  355. vm.start = getStartDate(vm.chooseYear)
  356. vm.changeDate()
  357. }
  358. function reqHistoryInit(vm){
  359. reqList = []
  360. reqLists = [[],[],[],[]]
  361. _.each(reqLists,function(item,idx){
  362. var index = 8+idx
  363. vm["reqListLength"+index] = item.length+1
  364. })
  365. vm.slaveKey1_1 = ""
  366. vm.slaveKey1_2 = ""
  367. vm.hastopbar1 = true
  368. vm.hastopbar2 = true
  369. }
  370. function initReqParams(vm) {
  371. var reqParam = [{
  372. url: "/doctor/statisticAnalyze/doorServiceOrderLowlevelAll", //服务项目分析(下转)
  373. reqType: 'get',
  374. data:{
  375. startDate: vm.start,
  376. endDate: vm.end,
  377. area: vm.area,
  378. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  379. lowLevel:vm.lowLevel, //等级 1:团队 2社区机构 3区级 4市级
  380. slaveKey1:vm.slaveKey1,
  381. },
  382. },{
  383. url: "/doctor/statisticAnalyze/doorServiceOrderLowlevelAll", //服务项目排名分析
  384. reqType: 'get',
  385. data:{
  386. startDate: vm.start,
  387. endDate: vm.end,
  388. area: vm.area,
  389. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  390. lowLevel:vm.lowLevel, //等级 1:团队 2社区机构 3区级 4市级
  391. slaveKey1:'',
  392. },
  393. },{
  394. url: "/doctor/statisticAnalyze/generalLowlevelAll", //入户访视-访视量排行
  395. reqType: 'get',
  396. data:{
  397. startDate: vm.start,
  398. endDate: vm.end,
  399. area: vm.area,
  400. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  401. slaveKey1:vm.rhfs,
  402. index:vm.index,
  403. lowLevel:vm.lowLevel, //等级 1:团队 2社区机构 3区级 4市级
  404. },
  405. },{
  406. url: "/doctor/statisticAnalyze/doorServiceItemAnalysis", //服务项目分析
  407. reqType: 'get',
  408. data:{
  409. startDate: vm.start,
  410. endDate: vm.end,
  411. area: vm.area,
  412. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  413. pageSize:999,
  414. },
  415. },{
  416. url: "/doctor/statisticAnalyze/doorServiceAnalysis", //总体分析
  417. reqType: 'get',
  418. data:{
  419. startDate: vm.start,
  420. endDate: vm.end,
  421. area: vm.area,
  422. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  423. },
  424. },{
  425. url: "/doctor/statisticAnalyze/serviceOrderTrend", //新增服务工单趋势
  426. reqType: 'get',
  427. data:{
  428. startDate: vm.start,
  429. endDate: vm.end,
  430. area: vm.area,
  431. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  432. interval:1,
  433. },
  434. },{
  435. url: "/doctor/statisticAnalyze/getHomeVisitTotalHead", //入户访视-总体分析
  436. reqType: 'get',
  437. data:{
  438. startDate: vm.start,
  439. endDate: vm.end,
  440. area: vm.area,
  441. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  442. slaveKey1:vm.rhfs,
  443. },
  444. },{
  445. url: "/doctor/statisticAnalyze/generalSingleLineChartTrend", //入户访视-访视量新增趋势
  446. reqType: 'get',
  447. data:{
  448. startDate: vm.start,
  449. endDate: vm.end,
  450. area: vm.area,
  451. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  452. interval:1,
  453. slaveKey1:vm.rhfs,
  454. index:vm.index
  455. },
  456. },{
  457. url: "/doctor/statisticAnalyze/generalPieChartTrend", //入户访视-访视人群分析
  458. reqType: 'get',
  459. data:{
  460. startDate: vm.start,
  461. endDate: vm.end,
  462. area: vm.area,
  463. level: vm.areaLevel, //2、市,3、区,4、社区,5、团队
  464. slaveKey1:vm.rhfs,
  465. index:vm.index
  466. },
  467. }];
  468. return reqParam;
  469. }
  470. function loadData(loadArr, vm) {
  471. //获取其他请求的参数
  472. var reqParams = initReqParams(vm),
  473. reqPromise = [],
  474. newArr = []; //记录非顶部请求的请求数组
  475. for (i = 0; i < loadArr.length; i++) {
  476. var j = loadArr[i];
  477. var param = reqParams[j];
  478. reqPromise.push(httpRequest.get(param.url, {
  479. data: param.data
  480. }));
  481. newArr.push(loadArr[i]);
  482. }
  483. vm.isloading=true
  484. if (reqPromise.length > 0) {
  485. Promise.all(reqPromise).then(function (ress) {
  486. var res1, res2, res3, res4, res5, res6, res7, res8, res9;
  487. for (var i = 0; i < loadArr.length; i++) {
  488. var j = loadArr[i] + 1;
  489. if (j == 1) { res1 = ress[i]; }
  490. if (j == 2) { res2 = ress[i]; }
  491. if (j == 3) { res3 = ress[i]; }
  492. if (j == 4) { res4 = ress[i]; }
  493. if (j == 5) { res5 = ress[i]; }
  494. if (j == 6) { res6 = ress[i]; }
  495. if (j == 7) { res7 = ress[i]; }
  496. if (j == 8) { res8 = ress[i]; }
  497. if (j == 9) { res9 = ress[i]; }
  498. }
  499. if(res1&& res1.status == 200){
  500. vm.tabledata0=listHandle(res1.data.index_177,"num");
  501. }
  502. if(res2&& res2.status == 200){
  503. vm.tabledata1=listHandle(res2.data.index_177,"num");
  504. }
  505. if(res3&& res3.status == 200){
  506. vm.tabledata2=listHandle(res3.data,"num");
  507. }
  508. if(res4&& res4.status == 200){
  509. vm.tabledata0=listHandle(res4.data,"num");
  510. }
  511. if(res5&& res5.status == 200){
  512. vm.pageData=res5.data
  513. vm.data0=_.map(vm.pageData.doorServiceTypeList,function(item,index){
  514. return {
  515. code:item.code,
  516. amount:item.num,
  517. name:item.name,
  518. }
  519. })
  520. vm.data1=_.map(vm.pageData.voucherList,function(item,index){
  521. return {
  522. code:item.code,
  523. amount:item.num,
  524. name:item.name,
  525. }
  526. })
  527. pieChartShow(vm,0)
  528. pieChartShow(vm,1)
  529. }
  530. if (res6 && res6.status == 200) {
  531. var data1={}
  532. data1.serviceOrderTrend = res6.data
  533. handleSecondPanelData(data1 ,1, vm)
  534. }
  535. if(res7&& res7.status == 200){
  536. vm.pageData2=res7.data
  537. }
  538. if (res8 && res8.status == 200) {
  539. var data2={}
  540. data2.serviceOrderTrend = res8.data
  541. handleSecondPanelData(data2 ,2, vm)
  542. }
  543. if(res9&& res9.status == 200){
  544. vm.data2=_.map(res9.data,function(item,index){
  545. return {
  546. code:item.code,
  547. amount:item.num,
  548. name:item.name,
  549. }
  550. })
  551. pieChartShow(vm,2)
  552. }
  553. vm.isloading=false
  554. })
  555. }
  556. }
  557. function pieChartShow(vm,index){
  558. if(vm['data'+index].length==0||(vm['data'+index].length==1&&!vm['data'+index][0].name)){
  559. vm["pieShow"+index]=false
  560. }else{
  561. vm["pieShow"+index]=true
  562. }
  563. setTimeout(function(){
  564. //服务人群分析-饼图
  565. handlePieData({elId:"pieChart"+index,arry: vm['data'+index], title:{},colors: colors,position:['25%', '45%'],radius:['61%', '90%'],hasNum:true,legendRight:"7%"})
  566. },100)
  567. }
  568. function handleSecondPanelData(data,index, vm) {
  569. var xDatas = [],
  570. yDatas = [],
  571. names = []
  572. for(var p in data){
  573. names.push(vm.ltabList[index].indexNames[p]);
  574. xData = _.map(data[p], function(o){
  575. return o.range;
  576. });
  577. yData = _.map(data[p], function(o){
  578. return o.amount;
  579. });
  580. xDatas.push(xData);
  581. yDatas.push(yData);
  582. }
  583. vm.ltabList[index].xDatas = xDatas
  584. vm.ltabList[index].yDatas = yDatas
  585. vm.ltabList[index].names = names
  586. vm.showTab(index)
  587. }
  588. function listHandle(list, sort){
  589. var topArr = [],newList=[];
  590. if(list.length==1&&!list[0].name){
  591. list=[]
  592. }
  593. topArr = soreRank(getKeyValueArr(list, sort||'total'));
  594. newList = _.map(list, function(o, index){
  595. o.rank=topArr[index]
  596. return o
  597. });
  598. return newList
  599. }