{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!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\\projectBatchZB.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\BigScreen\\components\\subComponents\\projectBatchZB.vue","mtime":1741616770417},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport apiList from '@/api/bigScreen/majorView.js';\nimport utils from '@/utils.js';\nimport ExcelJS from 'exceljs';\nexport default {\n props: {\n tableOptions: {\n type: Object,\n default: function _default() {\n return {};\n }\n }\n },\n data: function data() {\n return {\n loading: false,\n loadingColor: 'rgba(6, 46, 106, 0.4)',\n tableData: [],\n workbook: null,\n projectCategory: ''\n };\n },\n beforeDestroy: function beforeDestroy() {\n this.$bus.$off('changeDate');\n },\n mounted: function mounted() {\n var _this = this;\n\n this.getData();\n this.$bus.$on('changeDate', function (searchDate) {\n _this.getData();\n });\n this.$bus.$on('monthExportExcel', function (comp) {\n if (comp === 'projectBatchZB') {\n _this.clickZBExport();\n }\n });\n },\n created: function created() {\n this.$emit('searchDateChange');\n },\n methods: {\n setStyle: function setStyle(value) {\n var style = value < 13 ? 'background :#38a846;font-weight: bold;' : value == 13 ? 'background:#00b0f0;font-weight: bold;' : value == 14 ? 'background:#e8e8e8;color:#333;font-weight: bold;' : 'background:#a0a0a0;font-weight: bold;';\n style = style + ';margin: 0 auto;border-radius:2px;';\n return style;\n },\n getDictName: function getDictName(code, value) {\n return utils.getDictName(code, value);\n },\n getData: function getData() {\n var _this2 = this;\n\n this.loading = true;\n\n var _JSON$parse = JSON.parse(sessionStorage.getItem('searchDate')),\n year = _JSON$parse.year,\n month = _JSON$parse.month;\n\n apiList.getReadyAndPlanningData({\n year: year,\n month: month,\n type: '2',\n projectCategory: this.projectCategory\n }, function (res) {\n if (res) {\n _this2.tableData = res;\n var arr = res.map(function (item) {\n return item.orderNo;\n });\n var index = arr.lastIndexOf(1);\n _this2.tableData = res;\n\n _this2.$nextTick(function () {\n var tableRow = _this2.$refs.myTable.$el.querySelectorAll('.el-table__body tbody .el-table__row');\n\n for (var i = 0; i < index; i++) {\n tableRow[i].style = 'background-color: rgb(5 54 127) !important;';\n }\n });\n\n _this2.exportToExcel();\n }\n\n _this2.loading = false;\n });\n },\n exportToExcel: function exportToExcel() {\n var columns = [{\n title: '项目名称',\n dataIndex: 'projectName'\n }, {\n title: '主责单位',\n dataIndex: 'unitName'\n }, {\n title: '专项小组',\n dataIndex: 'groupName'\n }, {\n title: '形成\\n调研报告',\n dataIndex: 'produceReport',\n type: 'value'\n }, {\n title: '形成\\n改革方案初稿',\n dataIndex: \"formScheme\",\n type: 'value'\n }, {\n title: '搭建\\n体系架构图',\n dataIndex: \"buildArchitecture\",\n type: 'value'\n }, {\n title: '明确3个以上\\n年度核心指标',\n dataIndex: \"defineThreeCoreIndicators\",\n type: 'value'\n }, {\n title: '形成\\n改革措施清单',\n dataIndex: \"formList\",\n type: 'value'\n }, {\n title: '形成拟出台\\n政策文件清单',\n dataIndex: \"issueDocument\",\n type: 'value'\n }, {\n title: '提出调整加快\\n实施一批的申请',\n dataIndex: \"requestToStart\",\n type: 'value'\n }];\n var columnWidths = {\n A: 32,\n B: 13,\n C: 15,\n D: 15,\n E: 18,\n F: 15,\n G: 18,\n H: 18,\n I: 18,\n J: 20,\n K: 20\n };\n var workbook = new ExcelJS.Workbook();\n var worksheet = workbook.addWorksheet('Sheet1');\n var data = JSON.parse(JSON.stringify(this.tableData));\n var headerRow = worksheet.addRow(columns.map(function (column) {\n return column.title;\n }));\n headerRow.eachCell(function (cell) {\n cell.font = {\n bold: true,\n size: 14\n };\n cell.alignment = {\n horizontal: \"center\",\n // 水平居中\n vertical: 'middle' // 垂直居中\n\n };\n cell.border = {\n top: {\n style: 'thin'\n },\n left: {\n style: 'thin'\n },\n bottom: {\n style: 'thin'\n },\n right: {\n style: 'thin'\n }\n };\n cell.alignment = {\n wrapText: true,\n vertical: 'middle',\n horizontal: 'center'\n };\n });\n data.forEach(function (rowData) {\n var newRow = worksheet.addRow(columns.map(function (column) {\n return column.type === 'value' ? utils.getDictName('zbqdyp_zt', rowData[column.dataIndex] - 0) : rowData[column.dataIndex] || '';\n }));\n newRow.eachCell(function (cell, rowNum) {\n cell.border = {\n top: {\n style: 'thin'\n },\n left: {\n style: 'thin'\n },\n bottom: {\n style: 'thin'\n },\n right: {\n style: 'thin'\n }\n };\n cell.alignment = {\n wrapText: true\n };\n\n if (rowNum > 3) {\n cell.fill = returnColor(cell.value);\n }\n\n cell.alignment.vertical = 'middle';\n cell.alignment.horizontal = 'center';\n });\n });\n Object.keys(columnWidths).forEach(function (columnLetter) {\n worksheet.getColumn(columnLetter).width = columnWidths[columnLetter];\n });\n\n function returnColor(value) {\n var argb = value.indexOf('已完成') !== -1 ? '38a846' : value.indexOf('推进中') !== -1 ? '00b0f0' : value.indexOf('未启动') !== -1 ? 'e8e8e8' : value.indexOf('未完成') !== -1 ? 'f43308' : value.indexOf('不涉及') !== -1 ? 'a0a0a0' : '';\n return {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: argb\n }\n };\n }\n\n this.workbook = workbook;\n },\n clickZBExport: function clickZBExport() {\n this.workbook.xlsx.writeBuffer().then(function (buffer) {\n var blob = new Blob([buffer], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n });\n var url = window.URL.createObjectURL(blob);\n var a = document.createElement('a');\n a.href = url;\n a.download = '准备启动的重大改革项目关键环节和重要事项进度统计表.xlsx';\n a.click();\n window.URL.revokeObjectURL(url);\n });\n }\n }\n};",null]}