{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\BigScreen\\components\\subComponents\\airTable.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\BigScreen\\components\\subComponents\\airTable.vue","mtime":1745582908256},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport $ from 'jquery'\r\n\r\nexport default {\r\n name: \"list\",\r\n props: {\r\n data: {\r\n type: Array,\r\n default: function () {\r\n return []\r\n }\r\n },\r\n tableColumn: {\r\n type: Array,\r\n default: function () {\r\n return []\r\n }\r\n },\r\n lsFd: {\r\n type: Object,\r\n default: function () {\r\n // return { A: true, B: true, C: true, D: true, E: true }\r\n return { A: true, B: true, C: true, D: true }\r\n }\r\n },\r\n isFirm: {\r\n type: Boolean,\r\n default: false\r\n },\r\n isSub: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n watch: {\r\n data: {\r\n handler(nv, ov) {\r\n this.$nextTick(() => {\r\n this.initTableData(nv)\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n mounted() {\r\n\r\n },\r\n data() {\r\n return {\r\n tableData: [],\r\n tapHei: 32,//档类标题高度\r\n tableHeadHei: 32,//表头高度\r\n maxColLen: 17, //每列最大长度\r\n firstLen: 0,//首列长度\r\n secondLen: 0,//第二列长度\r\n threeLen: 0,//第三列长度\r\n firstHei: 0,//首列行高\r\n secondHei: 0,//第二列行高\r\n threeHei: 0,//第三列行高\r\n mainHeight: 0\r\n }\r\n },\r\n // mounted() {\r\n // // this.initTableData(this.data)\r\n\r\n // },\r\n methods: {\r\n initTableData(data) {\r\n let { comp } = this.$route.query\r\n let { year, quarter } = JSON.parse(sessionStorage.getItem('searchDate'))\r\n if (data.length == 0) {\r\n return\r\n }\r\n this.tableData = []\r\n let taps = ['A', 'B', 'C', 'D', 'E']\r\n // let taps = ['A', 'B', 'C', 'D']\r\n // 绿色:#20A367 蓝色:#3877B2 黄色:#E3C428 橙色:#E49317 红色:#B04332\r\n // let colors = ['rgb(57, 140, 143)', 'rgb(25, 112, 193)', 'rgb(163, 163, 85)', 'rgb(176, 130, 92)', 'rgb(155, 78, 85)']\r\n let colors = ['#20A367', '#3877B2', '#E3C428', '#E49317', '#B04332']\r\n let temp = {};\r\n for (let i = 0; i < 3; i++) {\r\n temp = {\r\n col: i + 1,\r\n list: []\r\n }\r\n this.tableData.push(temp)\r\n }\r\n let dataLen = 0\r\n data.forEach((item, index) => {\r\n if (this.lsFd[taps[index]]) {\r\n dataLen += item.length + 2\r\n }\r\n })\r\n this.tableData.forEach((tableItem, tableIndex) => {\r\n let tempLen = 0\r\n let colLen = this.isFirm ? 16 : Math.ceil(dataLen / 3)\r\n\r\n if (tableItem.col === 1) {\r\n data.forEach((item, index) => {\r\n if (item.length > 0 && ((tempLen + item.length + 2) < colLen + 1) || ((tempLen + item.length + 2) === colLen + 1)) {\r\n this.pushData(1, taps[index], item, colors[index], taps[index])\r\n tempLen += item.length + 2\r\n } else if (item.length > 0 && (tempLen + item.length + 2) > colLen) {\r\n let overLen = colLen - tempLen\r\n if (tempLen > 0 && overLen > 2) {\r\n this.pushData(1, taps[index], item.slice(0, (overLen - 2)), colors[index], taps[index])\r\n tempLen += overLen\r\n } else if (tempLen > 0 && overLen < 3 && overLen > 0) {\r\n this.pushData(1, taps[index], item.slice(0, 1), colors[index], taps[index])\r\n tempLen += 3\r\n } else if (tempLen === 0 && (tempLen + item.length + 2) > colLen + 1) {\r\n this.pushData(1, taps[index], item.slice(0, colLen - 2), colors[index], taps[index])\r\n tempLen += colLen\r\n }\r\n } else if (item.length === 0 && this.lsFd[taps[index]] && (tempLen + item.length + 2) <= colLen) {\r\n this.pushData(1, taps[index], [], colors[index], taps[index])\r\n tempLen += item.length + 2\r\n }\r\n })\r\n } else if (tableItem.col === 2) {\r\n tempLen = 0\r\n colLen = 0\r\n this.tableData[0].list.forEach(item => {\r\n colLen += item.list.length + 2\r\n })\r\n let dataIndex = taps.indexOf(this.tableData[0].list[this.tableData[0].list.length - 1].dc)\r\n if (data[dataIndex].length === this.tableData[0].list[this.tableData[0].list.length - 1].list.length) {\r\n data.forEach((item, index) => {\r\n if (index > dataIndex) {\r\n if (item.length > 0 && ((tempLen + item.length + 2) < colLen + 1) || ((tempLen + item.length + 2) === colLen + 1)) {\r\n this.pushData(2, taps[index], item, colors[index], taps[index])\r\n tempLen += item.length + 2\r\n } else if (item.length > 0 && (tempLen + item.length + 2) > colLen) {\r\n let overLen = colLen - tempLen\r\n if (tempLen > 0 && overLen > 2) {\r\n this.pushData(2, taps[index], item.slice(0, (overLen - 2)), colors[index], taps[index])\r\n tempLen += overLen\r\n } else if (tempLen > 0 && overLen < 3 && overLen > 0) {\r\n this.pushData(2, taps[index], item.slice(0, 1), colors[index], taps[index])\r\n tempLen += 3\r\n } else if (tempLen === 0 && (tempLen + item.length + 2) > colLen + 1) {\r\n this.pushData(2, taps[index], item.slice(0, colLen - 2), colors[index], taps[index])\r\n tempLen += colLen\r\n }\r\n } else if (item.length === 0 && this.lsFd[taps[index]] && (tempLen + item.length + 2) <= colLen) {\r\n this.pushData(2, taps[index], [], colors[index], taps[index])\r\n tempLen += item.length + 2\r\n }\r\n }\r\n })\r\n } else {\r\n data.forEach((item, index) => {\r\n if (index === dataIndex) {\r\n let lastIndex = 0\r\n this.tableData[0].list[this.tableData[0].list.length - 1].list.forEach(lItem => {\r\n lastIndex = item.indexOf(lItem) + 1\r\n })\r\n let overLen = item.length - lastIndex\r\n if (((tempLen + overLen + 1) < colLen + 1) || ((tempLen + overLen + 1) === colLen + 1)) {\r\n this.pushData(2, '', item.slice(lastIndex, item.length), colors[index], taps[index])\r\n tempLen += overLen + 1\r\n } else if (item.length > 0 && (tempLen + overLen + 1) > colLen) {\r\n this.pushData(2, '', item.slice(lastIndex, (this.tableData[0].list[this.tableData[0].list.length - 1].list.length + colLen - 1)), colors[index], taps[dataIndex])\r\n tempLen += colLen\r\n }\r\n } else if (index > dataIndex) {\r\n if (item.length > 0 && ((tempLen + item.length + 2) < colLen + 1) || ((tempLen + item.length + 2) === colLen + 1)) {\r\n this.pushData(2, taps[index], item, colors[index], taps[index])\r\n tempLen += item.length + 2\r\n } else if (item.length > 0 && (tempLen + item.length + 2) > colLen) {\r\n let overLen = colLen - tempLen\r\n if (tempLen > 0 && overLen > 2) {\r\n this.pushData(2, taps[index], item.slice(0, (overLen - 2)), colors[index], taps[index])\r\n tempLen += overLen\r\n } else if (tempLen > 0 && overLen < 3 && overLen > 0) {\r\n this.pushData(2, taps[index], item.slice(0, 1), colors[index], taps[index])\r\n tempLen += 3\r\n } else if (tempLen === 0 && (tempLen + item.length + 2) > colLen + 1) {\r\n this.pushData(2, taps[index], item.slice(0, colLen - 2), colors[index], taps[index])\r\n tempLen += colLen\r\n }\r\n } else if (item.length === 0 && this.lsFd[taps[index]] && (tempLen + item.length + 2) <= colLen) {\r\n this.pushData(2, taps[index], [], colors[index], taps[index])\r\n tempLen += item.length + 2\r\n }\r\n }\r\n })\r\n }\r\n } else if (tableItem.col === 3) {\r\n tempLen = 0\r\n let dataIndex = taps.indexOf(this.tableData[1].list[this.tableData[1].list.length - 1].dc)\r\n\r\n if (data[dataIndex].length === this.tableData[1].list[this.tableData[1].list.length - 1].list.length) {\r\n data.forEach((item, index) => {\r\n if (item.length > 0 && index > dataIndex) {\r\n this.pushData(3, taps[index], item, colors[index], taps[index])\r\n } else if (item.length === 0 && this.lsFd[taps[index]]) {\r\n this.pushData(3, taps[index], [], colors[index], taps[index])\r\n }\r\n })\r\n } else {\r\n data.forEach((item, index) => {\r\n if (index === dataIndex) {\r\n let lastIndex = 0\r\n this.tableData[1].list[this.tableData[1].list.length - 1].list.forEach(lItem => {\r\n lastIndex = item.indexOf(lItem) + 1\r\n })\r\n if (lastIndex < item.length) {\r\n this.pushData(3, '', item.slice(lastIndex, item.length), '', taps[dataIndex])\r\n }\r\n } else if (index > dataIndex) {\r\n if (item.length > 0) {\r\n this.pushData(3, taps[index], item, colors[index], taps[index])\r\n } else if (item.length === 0 && this.lsFd[taps[index]]) {\r\n this.pushData(3, taps[index], [], colors[index], taps[index])\r\n }\r\n }\r\n })\r\n }\r\n }\r\n\r\n })\r\n this.firstLen = 0\r\n this.secondLen = 0\r\n this.threeLen = 0\r\n this.firstHei = 0\r\n this.secondHei = 0\r\n this.threeHei = 0\r\n this.mainHeight = $('.airTable').height()\r\n this.tableData.forEach((item, index) => {\r\n if (index === 0) {\r\n let fds = 0\r\n item.list.forEach((citem, cindex) => {\r\n fds++\r\n this.firstLen += citem.list.length + 1\r\n })\r\n this.firstHei = (this.mainHeight - fds * 32 - (fds - 1) * 12) / this.firstLen\r\n } else if (index === 1) {\r\n let fds = 0\r\n let jgs = 0\r\n item.list.forEach((citem, cindex) => {\r\n jgs++\r\n if (citem.title !== '') {\r\n fds++\r\n }\r\n this.secondLen += citem.list.length + 1\r\n })\r\n this.secondHei = (this.mainHeight - fds * 32 - (jgs - 1) * 12) / this.secondLen\r\n } else if (index === 2) {\r\n let fds = 0\r\n let jgs = 0\r\n item.list.forEach((citem, cindex) => {\r\n jgs++\r\n if (citem.title !== '') {\r\n fds++\r\n }\r\n this.threeLen += citem.list.length + 1\r\n })\r\n this.threeHei = (this.mainHeight - fds * 32 - (jgs - 1) * 12) / this.threeLen\r\n }\r\n\r\n })\r\n this.$nextTick(() => {\r\n let getHeights = document.querySelectorAll('.getHeight')\r\n getHeights.forEach((item, index) => {\r\n if (index < 14 || 43 < index < 58) {\r\n // item.style.height = getHeights[getHeights.length - 1].style.height\r\n item.style.setProperty('height', getHeights[getHeights.length - 1].style.height, 'important');\r\n }\r\n })\r\n this.$emit('loadComplete')\r\n })\r\n },\r\n pushData(col, title, list, color, dc) {\r\n let temp1 = {\r\n title: title,\r\n list: list,\r\n color: color,\r\n dc: dc\r\n }\r\n this.tableData.forEach(item => {\r\n if (item.col === col) {\r\n item.list.push(temp1)\r\n }\r\n })\r\n\r\n },\r\n handleDetail(unitInfo) {\r\n let { comp } = this.$route.query\r\n let { unitName, unitCode } = unitInfo\r\n let tem = comp == \"mapTarget_1\" || comp == \"mapTarget_2\" || comp == \"mapTarget_4\" ? 'reformPilot' :\r\n comp == \"mapTarget_5\" || comp == \"mapTarget_6\" ? 'brandDetail' : ''\r\n if (tem == 'reformPilot') {\r\n this.$router.push({\r\n path: '/DetailComponent',\r\n name: 'DetailComponent',\r\n query: {\r\n unitName,\r\n unitCode,\r\n comp: tem,\r\n type: '1',\r\n numType: comp == \"mapTarget_1\" ? 'nationalNum' : 'nationalAddNum'\r\n }\r\n })\r\n } else if (tem == 'brandDetail' && comp != 'mapTarget_8') {\r\n this.$router.push({\r\n path: '/DetailComponent',\r\n name: 'DetailComponent',\r\n query: {\r\n comp: tem,\r\n code: unitCode,\r\n type: comp == \"mapTarget_5\" ? '1' : comp == \"mapTarget_6\" ? '2' : comp == \"mapTarget_7\" ? '3' : '',\r\n title: '品牌创建·' + unitName,\r\n },\r\n })\r\n }\r\n\r\n },\r\n }\r\n}\r\n",null]}