| | |
| | | "pinia": "^2.0.26", |
| | | "vue": "^3.2.45", |
| | | "vue-i18n": "^9.8.0", |
| | | "vue-router": "^4.1.6" |
| | | "vue-router": "^4.1.6", |
| | | "xlsx": "^0.18.5" |
| | | }, |
| | | "devDependencies": { |
| | | "@babel/cli": "^7.19.3", |
| | |
| | | "node": ">=0.4.0" |
| | | } |
| | | }, |
| | | "node_modules/adler-32": { |
| | | "version": "1.3.1", |
| | | "resolved": "https://registry.npmmirror.com/adler-32/-/adler-32-1.3.1.tgz", |
| | | "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/agent-base": { |
| | | "version": "6.0.2", |
| | | "dev": true, |
| | |
| | | "dev": true, |
| | | "license": "Apache-2.0" |
| | | }, |
| | | "node_modules/cfb": { |
| | | "version": "1.2.2", |
| | | "resolved": "https://registry.npmmirror.com/cfb/-/cfb-1.2.2.tgz", |
| | | "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", |
| | | "dependencies": { |
| | | "adler-32": "~1.3.0", |
| | | "crc-32": "~1.2.0" |
| | | }, |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/chai": { |
| | | "version": "4.3.7", |
| | | "dev": true, |
| | |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/codepage": { |
| | | "version": "1.15.0", |
| | | "resolved": "https://registry.npmmirror.com/codepage/-/codepage-1.15.0.tgz", |
| | | "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/color-convert": { |
| | | "version": "2.0.1", |
| | | "dev": true, |
| | |
| | | "version": "1.0.2", |
| | | "dev": true, |
| | | "license": "MIT" |
| | | }, |
| | | "node_modules/crc-32": { |
| | | "version": "1.2.2", |
| | | "resolved": "https://registry.npmmirror.com/crc-32/-/crc-32-1.2.2.tgz", |
| | | "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", |
| | | "bin": { |
| | | "crc32": "bin/crc32.njs" |
| | | }, |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/cross-spawn": { |
| | | "version": "7.0.3", |
| | |
| | | }, |
| | | "engines": { |
| | | "node": ">= 0.12" |
| | | } |
| | | }, |
| | | "node_modules/frac": { |
| | | "version": "1.1.2", |
| | | "resolved": "https://registry.npmmirror.com/frac/-/frac-1.1.2.tgz", |
| | | "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/fraction.js": { |
| | |
| | | "node": "*" |
| | | } |
| | | }, |
| | | "node_modules/ssf": { |
| | | "version": "0.11.2", |
| | | "resolved": "https://registry.npmmirror.com/ssf/-/ssf-0.11.2.tgz", |
| | | "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", |
| | | "dependencies": { |
| | | "frac": "~1.1.2" |
| | | }, |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/sshpk": { |
| | | "version": "1.17.0", |
| | | "dev": true, |
| | |
| | | "node": ">= 8" |
| | | } |
| | | }, |
| | | "node_modules/wmf": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmmirror.com/wmf/-/wmf-1.0.2.tgz", |
| | | "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/word": { |
| | | "version": "0.3.0", |
| | | "resolved": "https://registry.npmmirror.com/word/-/word-0.3.0.tgz", |
| | | "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/word-wrap": { |
| | | "version": "1.2.3", |
| | | "dev": true, |
| | |
| | | "utf-8-validate": { |
| | | "optional": true |
| | | } |
| | | } |
| | | }, |
| | | "node_modules/xlsx": { |
| | | "version": "0.18.5", |
| | | "resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz", |
| | | "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", |
| | | "dependencies": { |
| | | "adler-32": "~1.3.0", |
| | | "cfb": "~1.2.1", |
| | | "codepage": "~1.15.0", |
| | | "crc-32": "~1.2.1", |
| | | "ssf": "~0.11.2", |
| | | "wmf": "~1.0.1", |
| | | "word": "~0.3.0" |
| | | }, |
| | | "bin": { |
| | | "xlsx": "bin/xlsx.njs" |
| | | }, |
| | | "engines": { |
| | | "node": ">=0.8" |
| | | } |
| | | }, |
| | | "node_modules/xml-name-validator": { |
| | |
| | | "version": "8.2.0", |
| | | "dev": true |
| | | }, |
| | | "adler-32": { |
| | | "version": "1.3.1", |
| | | "resolved": "https://registry.npmmirror.com/adler-32/-/adler-32-1.3.1.tgz", |
| | | "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==" |
| | | }, |
| | | "agent-base": { |
| | | "version": "6.0.2", |
| | | "dev": true, |
| | |
| | | "version": "0.12.0", |
| | | "dev": true |
| | | }, |
| | | "cfb": { |
| | | "version": "1.2.2", |
| | | "resolved": "https://registry.npmmirror.com/cfb/-/cfb-1.2.2.tgz", |
| | | "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", |
| | | "requires": { |
| | | "adler-32": "~1.3.0", |
| | | "crc-32": "~1.2.0" |
| | | } |
| | | }, |
| | | "chai": { |
| | | "version": "4.3.7", |
| | | "dev": true, |
| | |
| | | "string-width": "^4.2.0" |
| | | } |
| | | }, |
| | | "codepage": { |
| | | "version": "1.15.0", |
| | | "resolved": "https://registry.npmmirror.com/codepage/-/codepage-1.15.0.tgz", |
| | | "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==" |
| | | }, |
| | | "color-convert": { |
| | | "version": "2.0.1", |
| | | "dev": true, |
| | |
| | | "core-util-is": { |
| | | "version": "1.0.2", |
| | | "dev": true |
| | | }, |
| | | "crc-32": { |
| | | "version": "1.2.2", |
| | | "resolved": "https://registry.npmmirror.com/crc-32/-/crc-32-1.2.2.tgz", |
| | | "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" |
| | | }, |
| | | "cross-spawn": { |
| | | "version": "7.0.3", |
| | |
| | | "combined-stream": "^1.0.6", |
| | | "mime-types": "^2.1.12" |
| | | } |
| | | }, |
| | | "frac": { |
| | | "version": "1.1.2", |
| | | "resolved": "https://registry.npmmirror.com/frac/-/frac-1.1.2.tgz", |
| | | "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==" |
| | | }, |
| | | "fraction.js": { |
| | | "version": "4.2.0", |
| | |
| | | "through": "2" |
| | | } |
| | | }, |
| | | "ssf": { |
| | | "version": "0.11.2", |
| | | "resolved": "https://registry.npmmirror.com/ssf/-/ssf-0.11.2.tgz", |
| | | "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", |
| | | "requires": { |
| | | "frac": "~1.1.2" |
| | | } |
| | | }, |
| | | "sshpk": { |
| | | "version": "1.17.0", |
| | | "dev": true, |
| | |
| | | "isexe": "^2.0.0" |
| | | } |
| | | }, |
| | | "wmf": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmmirror.com/wmf/-/wmf-1.0.2.tgz", |
| | | "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==" |
| | | }, |
| | | "word": { |
| | | "version": "0.3.0", |
| | | "resolved": "https://registry.npmmirror.com/word/-/word-0.3.0.tgz", |
| | | "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==" |
| | | }, |
| | | "word-wrap": { |
| | | "version": "1.2.3", |
| | | "dev": true |
| | |
| | | "dev": true, |
| | | "requires": {} |
| | | }, |
| | | "xlsx": { |
| | | "version": "0.18.5", |
| | | "resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz", |
| | | "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", |
| | | "requires": { |
| | | "adler-32": "~1.3.0", |
| | | "cfb": "~1.2.1", |
| | | "codepage": "~1.15.0", |
| | | "crc-32": "~1.2.1", |
| | | "ssf": "~0.11.2", |
| | | "wmf": "~1.0.1", |
| | | "word": "~0.3.0" |
| | | } |
| | | }, |
| | | "xml-name-validator": { |
| | | "version": "4.0.0", |
| | | "dev": true |
| | |
| | | "pinia": "^2.0.26", |
| | | "vue": "^3.2.45", |
| | | "vue-i18n": "^9.8.0", |
| | | "vue-router": "^4.1.6" |
| | | "vue-router": "^4.1.6", |
| | | "xlsx": "^0.18.5" |
| | | }, |
| | | "devDependencies": { |
| | | "@babel/cli": "^7.19.3", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Base64 } from 'js-base64'; |
| | | import { $fysp } from '../index'; |
| | | |
| | | export default { |
| | | /** |
| | | * ä¸è½½æ°æ®äº§å |
| | | */ |
| | | downloadProduct(area, type, forceUpdate) { |
| | | return $fysp |
| | | .post(`dataProduct/download?`, area, { |
| | | responseType: 'arraybuffer', |
| | | params: { type, forceUpdate } |
| | | }) |
| | | .then((res) => { |
| | | // ææ¡£æªçæï¼å·²å¯å¨ææ¡£çæåå°ä»»å¡ |
| | | if (res.data.type == 'application/json') { |
| | | return false; |
| | | } |
| | | // ææ¡£å·²åå¨ï¼è¿åæä»¶æ°æ®æµ |
| | | else { |
| | | return res.data |
| | | // const name = Base64.decode(res.headers.get('filename')); |
| | | // const url = window.URL.createObjectURL(res.data); |
| | | // const link = document.createElement('a'); |
| | | // link.href = url; |
| | | // link.setAttribute('download', name); |
| | | // document.body.appendChild(link); |
| | | // link.click(); |
| | | // document.body.removeChild(link); |
| | | // window.URL.revokeObjectURL(url); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | |
| | | let ip2_file = 'https://fyami.com.cn/'; |
| | | |
| | | if (debug) { |
| | | ip1 = 'http://192.168.0.138:8080/'; |
| | | ip1 = 'http://192.168.0.138:9001/'; |
| | | // ip1_file = 'http://192.168.0.138:8080/'; |
| | | // ip2 = 'http://192.168.0.138:8080/'; |
| | | // ip2_file = 'https://fyami.com.cn/'; |
| | |
| | | BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default'] |
| | | CompQuickSet: typeof import('./components/search-option/CompQuickSet.vue')['default'] |
| | | Content: typeof import('./components/core/Content.vue')['default'] |
| | | ElAffix: typeof import('element-plus/es')['ElAffix'] |
| | | ElAside: typeof import('element-plus/es')['ElAside'] |
| | | ElAvatar: typeof import('element-plus/es')['ElAvatar'] |
| | | ElBadge: typeof import('element-plus/es')['ElBadge'] |
| | | ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] |
| | | ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElCalendar: typeof import('element-plus/es')['ElCalendar'] |
| | | ElCard: typeof import('element-plus/es')['ElCard'] |
| | | ElCascader: typeof import('element-plus/es')['ElCascader'] |
| | | ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] |
| | | ElCol: typeof import('element-plus/es')['ElCol'] |
| | | ElCollapse: typeof import('element-plus/es')['ElCollapse'] |
| | | ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] |
| | | ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] |
| | | ElContainer: typeof import('element-plus/es')['ElContainer'] |
| | | ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] |
| | | ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] |
| | | ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] |
| | | ElDialog: typeof import('element-plus/es')['ElDialog'] |
| | |
| | | ElIcon: typeof import('element-plus/es')['ElIcon'] |
| | | ElImage: typeof import('element-plus/es')['ElImage'] |
| | | ElInput: typeof import('element-plus/es')['ElInput'] |
| | | ElLink: typeof import('element-plus/es')['ElLink'] |
| | | ElMain: typeof import('element-plus/es')['ElMain'] |
| | | ElMenu: typeof import('element-plus/es')['ElMenu'] |
| | | ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] |
| | | ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] |
| | | ElOption: typeof import('element-plus/es')['ElOption'] |
| | | ElPagination: typeof import('element-plus/es')['ElPagination'] |
| | | ElPopover: typeof import('element-plus/es')['ElPopover'] |
| | | ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] |
| | | ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
| | | ElRow: typeof import('element-plus/es')['ElRow'] |
| | | ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] |
| | | ElSegmented: typeof import('element-plus/es')['ElSegmented'] |
| | | ElSelect: typeof import('element-plus/es')['ElSelect'] |
| | | ElSpace: typeof import('element-plus/es')['ElSpace'] |
| | | ElStep: typeof import('element-plus/es')['ElStep'] |
| | |
| | | ElTabs: typeof import('element-plus/es')['ElTabs'] |
| | | ElTag: typeof import('element-plus/es')['ElTag'] |
| | | ElText: typeof import('element-plus/es')['ElText'] |
| | | ElTooltip: typeof import('element-plus/es')['ElTooltip'] |
| | | ElTree: typeof import('element-plus/es')['ElTree'] |
| | | ElUpload: typeof import('element-plus/es')['ElUpload'] |
| | | Footer: typeof import('./components/core/Footer.vue')['default'] |
| | |
| | | data() { |
| | | return { |
| | | popVisible: false, |
| | | menuHeight: '800px', |
| | | menuHeight: '600px', |
| | | title: 'çæç¯å¢çº¿ä¸ç管', |
| | | subTitle: 'Â©ä¸æµ·é£ç¾½ç¯ä¿ç§ææéå
¬å¸', |
| | | sysIndex: 0, |
| | |
| | | this.navPage(...this.menuPath(this.menus[0])); |
| | | }, |
| | | mounted() { |
| | | // this.menuHeight = this.calMenuHeight(); |
| | | this.menuHeight = this.calMenuHeight(); |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | .el-menu-vertical-demo:not(.el-menu--collapse) { |
| | | /* width: 200px; */ |
| | | min-height: 100vh; |
| | | /* max-height: 100vh; */ |
| | | max-height: 100vh; |
| | | } |
| | | |
| | | .el-menu--collapse { |
| | |
| | | <template> |
| | | <BaseDataProduct product-type="3"></BaseDataProduct> |
| | | </template> |
| | | <script setup> |
| | | /** |
| | | * é®é¢æ´æ¹åæ |
| | | */ |
| | | import BaseDataProduct from './components/BaseDataProduct.vue'; |
| | | |
| | | |
| | | </script> |
| | |
| | | <template> |
| | | <BaseDataProduct product-type="1"></BaseDataProduct> |
| | | </template> |
| | | <script setup> |
| | | /** |
| | | * é®é¢å¨æè·è¸ª |
| | | */ |
| | | import BaseDataProduct from './components/BaseDataProduct.vue'; |
| | | |
| | | |
| | | </script> |
| | |
| | | <template> |
| | | åºæ¯æ¥å管ç |
| | | </template> |
| | |
| | | <template> |
| | | <BaseDataProduct product-type="2"></BaseDataProduct> |
| | | </template> |
| | | <script setup> |
| | | /** |
| | | * è§èæ§è¯ä¼° |
| | | */ |
| | | import BaseDataProduct from './components/BaseDataProduct.vue'; |
| | | |
| | | |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <FYSearchBar ref="searchRef" @search="handleSearch"> |
| | | <template #options> |
| | | <!-- åºå¿ --> |
| | | <FYOptionLocation |
| | | :allOption="false" |
| | | :level="3" |
| | | :checkStrictly="false" |
| | | v-model:value="formSearch.locations" |
| | | ></FYOptionLocation> |
| | | <!-- åºæ¯ç±»å --> |
| | | <FYOptionScene |
| | | :allOption="false" |
| | | :type="2" |
| | | v-model:value="formSearch.scenetype" |
| | | ></FYOptionScene> |
| | | <!-- æ¶é´ --> |
| | | <FYOptionTime |
| | | :initValue="false" |
| | | type="month" |
| | | v-model:value="formSearch.time" |
| | | ></FYOptionTime> |
| | | </template> |
| | | <template #buttons> |
| | | <CompReportDownloadDialog |
| | | name="é®é¢ä¸æ´æ¹æ±æ»åæä¸å¨æè·è¸ªæ¸
å" |
| | | :locations="formSearch.locations" |
| | | :scenetype="formSearch.scenetype" |
| | | :time="formSearch.time" |
| | | @submit="handleSearch" |
| | | ></CompReportDownloadDialog> |
| | | </template> |
| | | </FYSearchBar> |
| | | <el-form ref="expandRef" :inline="true"> |
| | | <CompQuickSet @quick-set="setOptions"></CompQuickSet> |
| | | </el-form> |
| | | <el-space> |
| | | <el-segmented |
| | | :model-value="activeSheet" |
| | | :options="sheetNames" |
| | | @change="tabChange" |
| | | /> |
| | | </el-space> |
| | | <el-table |
| | | ref="tableRef" |
| | | :data="excelData" |
| | | v-loading="loading" |
| | | table-layout="fixed" |
| | | size="small" |
| | | :height="tableHeight" |
| | | border |
| | | > |
| | | <template v-if="excelData"> |
| | | <el-table-column |
| | | v-for="(value, key, index) in excelData[0]" |
| | | :key="index" |
| | | :prop="key" |
| | | :label="key" |
| | | > |
| | | </el-table-column> |
| | | </template> |
| | | </el-table> |
| | | <div v-if="excelHtml" v-html="excelHtml"></div> |
| | | </template> |
| | | <script setup> |
| | | /** |
| | | * é®é¢å¨æè·è¸ª |
| | | */ |
| | | import { ref, onMounted } from 'vue'; |
| | | import dayjs from 'dayjs'; |
| | | import * as XLSX from 'xlsx'; |
| | | import dataproductApi from '@/api/fysp/dataproductApi'; |
| | | import CompReportDownloadDialog from './CompReportDownloadDialog.vue'; |
| | | |
| | | const emit = defineEmits(['search']); |
| | | |
| | | const props = defineProps({ |
| | | // æ°æ®äº§åç±»åï¼1ï¼é®é¢å¨æè·è¸ªï¼2ï¼è§èæ§è¯ä¼°ï¼3ï¼é®é¢æ´æ¹åæ |
| | | productType: Number, |
| | | // 卿°æ®å±ç¤ºä¹åï¼åé¢å¤çï¼ä¸»è¦æ¯å¤çåå¹¶è¡¨å¤´ï¼ |
| | | beforeDataShow: { |
| | | type: Function, |
| | | default: (data) => { |
| | | return data; |
| | | } |
| | | }, |
| | | // æ°æ®è¡¨æ ¼çè¡¨å¤´è¡æ° |
| | | headNum: { |
| | | type: Number, |
| | | default: 1 |
| | | } |
| | | }); |
| | | |
| | | const formSearch = ref({ |
| | | locations: {}, |
| | | scenetype: {}, |
| | | time: dayjs().add(-1, 'M').date(1).toDate() |
| | | }); |
| | | const loading = ref(false); |
| | | const tableHeight = ref('500'); |
| | | let workbook; |
| | | const sheetNames = ref(); |
| | | const activeSheet = ref(); |
| | | const excelData = ref(); |
| | | const excelHtml = ref(); |
| | | |
| | | const searchRef = ref(null); |
| | | const expandRef = ref(null); |
| | | |
| | | function setOptions(param) { |
| | | formSearch.value.locations = param.locations; |
| | | formSearch.value.scenetype = param.scenetype; |
| | | formSearch.value.sourceType = param.sourceType; |
| | | handleSearch(false); |
| | | } |
| | | |
| | | function tabChange(tabName) { |
| | | activeSheet.value = tabName; |
| | | getTable(activeSheet.value); |
| | | } |
| | | |
| | | function handleSearch(forceUpdate) { |
| | | const locations = formSearch.value.locations; |
| | | const time = formSearch.value.time; |
| | | const scenetype = formSearch.value.scenetype; |
| | | const area = { |
| | | provincecode: locations.pCode, |
| | | provincename: locations.pName, |
| | | citycode: locations.cCode, |
| | | cityname: locations.cName, |
| | | districtcode: locations.dCode, |
| | | districtname: locations.dName, |
| | | starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'), |
| | | scensetypeid: scenetype.value |
| | | }; |
| | | |
| | | loading.value = true; |
| | | dataproductApi |
| | | .downloadProduct(area, props.productType, forceUpdate ? forceUpdate : false) |
| | | .then((res) => { |
| | | const data = new Uint8Array(res); |
| | | workbook = XLSX.read(data, { type: 'array' }); |
| | | sheetNames.value = workbook.SheetNames; |
| | | activeSheet.value = sheetNames.value[0]; |
| | | getTable(activeSheet.value); |
| | | }) |
| | | .finally(() => (loading.value = false)); |
| | | } |
| | | |
| | | function getTable(sheetName) { |
| | | const worksheet = workbook.Sheets[sheetName]; |
| | | const tableData = XLSX.utils.sheet_to_json(worksheet, { header: 3 }); |
| | | // const tableData = XLSX.utils.sheet_to_csv(worksheet); |
| | | console.log(tableData); |
| | | console.log(tableData[0]); |
| | | combineTableHead(tableData); |
| | | |
| | | excelData.value = props.beforeDataShow(tableData); |
| | | } |
| | | |
| | | // æ ¹æ®è¡¨å¤´çè¡æ°ï¼å并表头 |
| | | function combineTableHead(excelData) { |
| | | if (excelData.length < props.headNum) return; |
| | | |
| | | // const newHead = {}; |
| | | // excelData.splice(0, props.headNum).forEach((row) => { |
| | | // for (const key in row) { |
| | | // console.log(key); |
| | | // } |
| | | // }); |
| | | } |
| | | |
| | | function calcTableHeight() { |
| | | const h1 = searchRef.value.$el.offsetHeight; |
| | | const h2 = expandRef.value.$el.offsetHeight; |
| | | |
| | | const h = h1 + h2; |
| | | return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`; |
| | | } |
| | | |
| | | onMounted(() => { |
| | | tableHeight.value = calcTableHeight(); |
| | | // handleSearch() |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-button icon="Download" type="success" @click="dialogVisible = true" |
| | | >å¯¼åºæ¥å</el-button |
| | | > |
| | | <el-dialog v-model="dialogVisible" :title="name" width="500"> |
| | | <el-text tag="b" size="large">æ°æ®èå´ç¡®è®¤</el-text> |
| | | <el-text tag="div">åºåï¼{{ locationText }}</el-text> |
| | | <el-text tag="div">ç±»åï¼{{ scenetype.label }}</el-text> |
| | | <el-text tag="div">æ¶é´ï¼{{ timeText }}</el-text> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-row align="middle"> |
| | | <el-checkbox v-model="forceUpdate" label="强å¶çææ°æ¥å" /> |
| | | <el-tooltip placement="bottom-start" effect="light"> |
| | | <template #content> |
| | | <el-text tag="b" size="small">ä¸å¾éï¼</el-text><br /> |
| | | <el-text size="small" |
| | | >ä¸å¾éæ¶ï¼å¦æå·²çæè¿ç¸ååºåçæ¥åï¼åç´æ¥è·å该份æ¥åè®°å½</el-text |
| | | ><br /> |
| | | <el-text tag="b" size="small">å¾éï¼</el-text><br /> |
| | | <el-text size="small" |
| | | >å¾éæ¶ï¼æ 论æ¯å¦æåå²è®°å½ï¼é½ä¼å¯å¨æ¥åçæä»»å¡è¦çæ§è®°å½ï¼å¯å¨åå°ä»»å¡ç颿¥çä»»å¡è¿åº¦</el-text |
| | | ><br /> |
| | | </template> |
| | | <el-icon |
| | | class="m-l-8 cursor-p" |
| | | :size="16" |
| | | color="var(--el-color-warning)" |
| | | ><QuestionFilled |
| | | /></el-icon> |
| | | </el-tooltip> |
| | | </el-row> |
| | | <div> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" @click="handleSubmit">ç¡®å®</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from 'dayjs'; |
| | | |
| | | export default { |
| | | props: ['name', 'locations', 'time', 'scenetype'], |
| | | emits: ['submit'], |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | forceUpdate: false |
| | | }; |
| | | }, |
| | | computed: { |
| | | locationText() { |
| | | const loc = this.locations; |
| | | let text = ''; |
| | | text = loc.pName == loc.cName ? loc.pName : loc.pName + loc.cName; |
| | | text += loc.dName; |
| | | return text; |
| | | }, |
| | | timeText() { |
| | | return dayjs(this.time).format('YYYYå¹´MMæ'); |
| | | } |
| | | }, |
| | | methods: { |
| | | handleSubmit() { |
| | | this.$emit('submit', this.forceUpdate); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .dialog-footer { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | gap: 2px; |
| | | } |
| | | </style> |