1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/.cache/babel-loader/f521f217905cd3ef4df5358c4a0...

1 line
15 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\utils\\mergeCell.js","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\utils\\mergeCell.js","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\n\n/**\n * 构建合并列数据\n * 思路遍历所有数据将需要合并的列的内容作为key数据id作为value然后依次遍历获取对应的合并列的行数\n * @param\tdataList\t列表数据\n * @param\tlabel1\t\t第1列合并的字段名称\n * @param label2\t\t第2列合并的字段名称\n * @param label3\t\t第3列合并的字段名称\n * @param label4\t\t第4列合并的字段名称\n */\nexport function buildMerge(dataList) {\n var label1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'label1';\n var label2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'label2';\n var label3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'label3';\n var label4 = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'label4';\n\n // 当列表数据没有主键时,添加主键\n if (dataList.length > 0 && (dataList[0].id !== 0 || dataList[0].id !== '0')) {\n dataList.forEach(function (item, index) {\n item.id = [index];\n });\n }\n\n var firstObj = {},\n secondObj = {},\n thirdObj = {},\n fourthObj = {};\n var firstObjKey = '',\n secondObjKey = '',\n thirdObjKey = '',\n fourthObjKey = ''; // 本示例合并的前四列对应的字段分别label1、label2、label3、label4\n // 如果你需要合并其他的字段,需修改此处字段名称\n\n for (var i = 0, len = dataList.length; i < len; i++) {\n firstObjKey = dataList[i][label1];\n secondObjKey = dataList[i][label2];\n thirdObjKey = dataList[i][label3];\n fourthObjKey = dataList[i][label4];\n if (!firstObj[firstObjKey]) firstObj[firstObjKey] = new Array(dataList[i].id);else {\n firstObj[firstObjKey].push(dataList[i].id);\n }\n if (!secondObj[secondObjKey]) secondObj[secondObjKey] = new Array(dataList[i].id);else {\n secondObj[secondObjKey].push(dataList[i].id);\n }\n if (!thirdObj[thirdObjKey]) thirdObj[thirdObjKey] = new Array(dataList[i].id);else {\n thirdObj[thirdObjKey].push(dataList[i].id);\n }\n if (!fourthObj[fourthObjKey]) fourthObj[fourthObjKey] = new Array(dataList[i].id);else {\n fourthObj[fourthObjKey].push(dataList[i].id);\n }\n }\n\n computeFirstSpan(dataList, firstObj, secondObj, thirdObj, fourthObj);\n} // 计算第一列合并总数\n\nfunction computeFirstSpan(dataList, firstObj, secondObj, thirdObj, fourthObj) {\n var _loop = function _loop(obj) {\n var fristData = dataList.filter(function (d) {\n return d.id === firstObj[obj][0];\n })[0]; // 获取第一条数据,对其添加 'firstSpan' 属性,并设置值\n\n if (fristData) fristData['firstSpan'] = firstObj[obj].length;\n computeSecondSpan(dataList, firstObj[obj], secondObj, thirdObj, fourthObj);\n };\n\n // 遍历计算第一列合并行数\n for (var obj in firstObj) {\n _loop(obj);\n }\n} // 计算第二列合并总数\n\n\nfunction computeSecondSpan(dataList, classList, secondObj, thirdObj, fourthObj) {\n var secondList = []; // 遍历计算第二列合并行数\n\n var _loop2 = function _loop2(obj) {\n // 判断两个id数组取其并集并集的长度就是合并列的行数\n var secondIds = secondObj[obj].filter(function (val) {\n return classList.indexOf(val) > -1;\n });\n var fristData = dataList.filter(function (d) {\n return d.id === secondIds[0];\n })[0]; // 获取第一条数据,对其添加 'secondSpan' 属性,并设置值\n\n if (fristData) fristData['secondSpan'] = secondIds.length;\n secondList.push(secondIds);\n };\n\n for (var obj in secondObj) {\n _loop2(obj);\n }\n\n secondList.forEach(function (list) {\n computeThirdSpan(dataList, list, thirdObj, fourthObj);\n });\n} // 计算第三列合并总数\n\n\nfunction computeThirdSpan(dataList, list, thirdObj, fourthObj) {\n var thirdList = []; // 遍历计算第三列合并行数\n\n var _loop3 = function _loop3(obj) {\n var thirdIds = thirdObj[obj].filter(function (val) {\n return list.indexOf(val) > -1;\n });\n var fristData = dataList.filter(function (d) {\n return d.id === thirdIds[0];\n })[0]; // 获取第一条数据,对其添加 'thirdSpan' 属性,并设置值\n\n if (fristData) fristData['thirdSpan'] = thirdIds.length;\n thirdList.push(thirdIds);\n };\n\n for (var obj in thirdObj) {\n _loop3(obj);\n }\n\n thirdList.forEach(function (list) {\n computeFourthSpan(dataList, list, fourthObj);\n });\n} // 计算第四列合并总数\n\n\nfunction computeFourthSpan(dataList, list, fourthObj) {\n var _loop4 = function _loop4(obj) {\n var fourthIds = fourthObj[obj].filter(function (val) {\n return list.indexOf(val) > -1;\n });\n var fristData = dataList.filter(function (d) {\n return d.id === fourthIds[0];\n })[0]; // 获取第一条数据,对其添加 'fourthSpan' 属性,并设置值\n\n if (fristData) fristData['fourthSpan'] = fourthIds.length;\n };\n\n // 遍历计算第四列合并行数\n for (var obj in fourthObj) {\n _loop4(obj);\n }\n}",{"version":3,"sources":["C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\utils\\mergeCell.js"],"names":["buildMerge","dataList","label1","label2","label3","label4","length","id","forEach","item","index","firstObj","secondObj","thirdObj","fourthObj","firstObjKey","secondObjKey","thirdObjKey","fourthObjKey","i","len","Array","push","computeFirstSpan","obj","fristData","filter","d","computeSecondSpan","classList","secondList","secondIds","val","indexOf","list","computeThirdSpan","thirdList","thirdIds","computeFourthSpan","fourthIds"],"mappings":";;AAAA;;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BpB,SAAjB,CAAjB;AACA,GAFD;AAGA,C,CACD;;;AACA,SAASwB,iBAAT,CAA2BrC,QAA3B,EAAqCiC,IAArC,EAA2CpB,SAA3C,EAAsD;AAAA,+BAE5CU,GAF4C;AAGpD,QAAIe,SAAS,GAAGzB,SAAS,CAACU,GAAD,CAAT,CAAeE,MAAf,CAAsB,UAAAM,GAAG,EAAI;AAC5C,aAAOE,IAAI,CAACD,OAAL,CAAaD,GAAb,IAAoB,CAAC,CAA5B;AACA,KAFe,CAAhB;AAGA,QAAIP,SAAS,GAAGxB,QAAQ,CAACyB,MAAT,CAAgB,UAAAC,CAAC;AAAA,aAAIA,CAAC,CAACpB,EAAF,KAASgC,SAAS,CAAC,CAAD,CAAtB;AAAA,KAAjB,EAA4C,CAA5C,CAAhB,CANoD,CAOpD;;AACA,QAAId,SAAJ,EAAeA,SAAS,CAAC,YAAD,CAAT,GAA0Bc,SAAS,CAACjC,MAApC;AARqC;;AACrD;AACA,OAAK,IAAIkB,GAAT,IAAgBV,SAAhB,EAA2B;AAAA,WAAlBU,GAAkB;AAO1B;AACD","sourcesContent":["/**\n * 构建合并列数据\n * 思路遍历所有数据将需要合并的列的内容作为key数据id作为value然后依次遍历获取对应的合并列的行数\n * @param\tdataList\t列表数据\n * @param\tlabel1\t\t第1列合并的字段名称\n * @param label2\t\t第2列合并的字段名称\n * @param label3\t\t第3列合并的字段名称\n * @param label4\t\t第4列合并的字段名称\n */\nexport function buildMerge(dataList, label1 = 'label1', label2 = 'label2', label3 = 'label3', label4 = 'label4') {\n\t// 当列表数据没有主键时,添加主键\n\tif (dataList.length > 0 && (dataList[0].id !== 0 || dataList[0].id !== '0')) {\n\t\tdataList.forEach((item, index) => {\n\t\t\titem.id = [index]\n\t\t})\n\t}\n\n\tlet firstObj = {},\n\t\tsecondObj = {},\n\t\tthirdObj = {},\n\t\tfourthObj = {}\n\tlet firstObjKey = '',\n\t\tsecondObjKey = '',\n\t\tthirdObjKey = '',\n\t\tfourthObjKey = ''\n\t// 本示例合并的前四列对应的字段分别label1、label2、label3、label4\n\t// 如果你需要合并其他的字段,需修改此处字段名称\n\tfor (let i = 0, len = dataList.length; i < len; i++) {\n\t\tfirstObjKey = dataList[i][label1]\n\t\tsecondObjKey = dataList[i][label2]\n\t\tthirdObjKey = dataList[i][label3]\n\t\tfourthObjKey = dataList[i][label4]\n\n\t\tif (!firstObj[firstObjKey])\n\t\t\tfirstObj[firstObjKey] = new Array(dataList[i].id)\n\t\telse {\n\t\t\tfirstObj[firstObjKey].push(dataList[i].id)\n\t\t}\n\t\tif (!secondObj[secondObjKey])\n\t\t\tsecondObj[secondObjKey] = new Array(dataList[i].id)\n\t\telse {\n\t\t\tsecondObj[secondObjKey].push(dataList[i].id)\n\t\t}\n\t\tif (!thirdObj[thirdObjKey])\n\t\t\tthirdObj[thirdObjKey] = new Array(dataList[i].id)\n\t\telse {\n\t\t\tthirdObj[thirdObjKey].push(dataList[i].id)\n\t\t}\n\t\tif (!fourthObj[fourthObjKey])\n\t\t\tfourthObj[fourthObjKey] = new Array(dataList[i].id)\n\t\telse {\n\t\t\tfourthObj[fourthObjKey].push(dataList[i].id)\n\t\t}\n\t}\n\tcomputeFirstSpan(dataList, firstObj, secondObj, thirdObj, fourthObj)\n}\n// 计算第一列合并总数\nfunction computeFirstSpan(dataList, firstObj, secondObj, thirdObj, fourthObj) {\n\t// 遍历计算第一列合并行数\n\tfor (let obj in firstObj) {\n\t\tlet fristData = dataList.filter(d => d.id === firstObj[obj][0])[0]\n\t\t// 获取第一条数据,对其添加 'firstSpan' 属性,并设置值\n\t\tif (fristData) fristData['firstSpan'] = firstObj[obj].length\n\t\tcomputeSecondSpan(dataList, firstObj[obj], secondObj, thirdObj, fourthObj)\n\t}\n}\n\n// 计算第二列合并总数\nfunction computeSecondSpan(dataList, classList, secondObj, thirdObj, fourthObj) {\n\tlet secondList = []\n\t// 遍历计算第二列合并行数\n\tfor (let obj in secondObj) {\n\t\t// 判断两个id数组取其并集并集的长度就是合并列的行数\n\t\tlet secondIds = secondObj[obj].filter(val => {\n\t\t\treturn classList.indexOf(val) > -1\n\t\t})\n\t\tlet fristData = dataList.filter(d => d.id === secondIds[0])[0]\n\t\t// 获取第一条数据,对其添加 'secondSpan' 属性,并设置值\n\t\tif (fristData) fristData['secondSpan'] = secondIds.length\n\t\tsecondList.push(secondIds)\n\t}\n\tsecondList.forEach(list => {\n\t\tcomputeThirdSpan(dataList, list, thirdObj, fourthObj)\n\t})\n}\n// 计算第三列合并总数\nfunction computeThirdSpan(dataList, list, thirdObj, fourthObj) {\n\tlet thirdList = []\n\t// 遍历计算第三列合并行数\n\tfor (let obj in thirdObj) {\n\t\tlet thirdIds = thirdObj[obj].filter(val => {\n\t\t\treturn list.indexOf(val) > -1\n\t\t})\n\t\tlet fristData = dataList.filter(d => d.id === thirdIds[0])[0]\n\t\t// 获取第一条数据,对其添加 'thirdSpan' 属性,并设置值\n\t\tif (fristData) fristData['thirdSpan'] = thirdIds.length\n\t\tthirdList.push(thirdIds)\n\t}\n\tthirdList.forEach(list => {\n\t\tcomputeFourthSpan(dataList, list, fourthObj)\n\t})\n}\n// 计算第四列合并总数\nfunction computeFourthSpan(dataList, list, fourthObj) {\n\t// 遍历计算第四列合并行数\n\tfor (let obj in fourthObj) {\n\t\tlet fourthIds = fourthObj[obj].filter(val => {\n\t\t\treturn list.indexOf(val) > -1\n\t\t})\n\t\tlet fristData = dataList.filter(d => d.id === fourthIds[0])[0]\n\t\t// 获取第一条数据,对其添加 'fourthSpan' 属性,并设置值\n\t\tif (fristData) fristData['fourthSpan'] = fourthIds.length\n\t}\n}\n"]}]}