From bb521d9a7815288e0e667f9f1df62f93b02018dc Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 8 Jan 2024 18:04:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E7=BB=B4=E5=BA=A6=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=9E=B6=E6=9E=84=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + src/api/chart.js | 18 ++- src/axios.js | 2 +- src/components/ViewDialog.vue | 17 +- src/views/organization-chart.vue | 257 +++++++++++++++++-------------- src/views/resource-chart.vue | 4 +- yarn.lock | 4 +- 7 files changed, 179 insertions(+), 125 deletions(-) diff --git a/package.json b/package.json index e07bef9..c673826 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,10 @@ "axios": "^1.6.4", "dom-to-image": "^2.6.0", "element-plus": "^2.4.4", + "html2canvas": "^1.4.1", "html2pdf.js": "^0.10.1", "js-cookie": "^3.0.5", + "jspdf": "^2.5.1", "vue": "^3.3.11", "vue-router": "^4.2.5", "vue3-tree-org": "^4.2.2" diff --git a/src/api/chart.js b/src/api/chart.js index 8678ef9..23eac60 100644 --- a/src/api/chart.js +++ b/src/api/chart.js @@ -13,4 +13,20 @@ export function selectPerson(params){ }) } -//机能组织 \ No newline at end of file +//机能组织(虚拟组织) +export function selectOrganizationChart(params){ + return request.get('/sship/organization/chart/organization-tree',{ + params + }) +} + +//虚拟维度 人员信息 +export function selectVirtualPerson(params){ + return request.get('/sship/organization/chart/virtual-person',{ + params + }) +} + +export function selectVirtualTop(){ + return request.get('/sship/organization/chart/virtual-top') +} \ No newline at end of file diff --git a/src/axios.js b/src/axios.js index 76c89fd..eb33b3c 100644 --- a/src/axios.js +++ b/src/axios.js @@ -8,7 +8,7 @@ const TokenKey = 'ecology_JSessionid=aaaTjPF0rg2oWfJEKdiZy; JSESSIONID=aaaTjPF0r const service = axios.create({ baseURL: '/api', // 超时 - timeout: 10000 + timeout: 100000 }) // request拦截器 diff --git a/src/components/ViewDialog.vue b/src/components/ViewDialog.vue index 6576461..03918f7 100644 --- a/src/components/ViewDialog.vue +++ b/src/components/ViewDialog.vue @@ -24,7 +24,7 @@ diff --git a/src/views/organization-chart.vue b/src/views/organization-chart.vue index a973b42..57c36d9 100644 --- a/src/views/organization-chart.vue +++ b/src/views/organization-chart.vue @@ -1,128 +1,155 @@ - - \ No newline at end of file + }, +}; + diff --git a/src/views/resource-chart.vue b/src/views/resource-chart.vue index e95fe02..57103c4 100644 --- a/src/views/resource-chart.vue +++ b/src/views/resource-chart.vue @@ -84,7 +84,7 @@ const element = document.getElementById('tree-container') // 获取 TreeOrg 组件的容器元素 const options = { filename: 'tree-structure.pdf', // 导出的文件名,可以根据实际需求更改 - jsPDF: { format: 'letter' } + jsPDF: { format: 'a4',orientation: 'landscape',unit: 'pt', } } html2pdf().set(options).from(element).save(); @@ -96,7 +96,7 @@ console.log(b) }, onNodeClick(e, data) { - this.$refs.viewDialog.openDialog(data); + this.$refs.viewDialog.openDialog(data,1); }, expandChange() { // this.toggleExpand(this.data, this.expandAll); diff --git a/yarn.lock b/yarn.lock index ff3b8f2..024d538 100644 --- a/yarn.lock +++ b/yarn.lock @@ -553,7 +553,7 @@ fsevents@~2.3.2, fsevents@~2.3.3: resolved "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -html2canvas@^1.0.0, html2canvas@^1.0.0-rc.5: +html2canvas@^1.0.0, html2canvas@^1.0.0-rc.5, html2canvas@^1.4.1: version "1.4.1" resolved "https://registry.npmmirror.com/html2canvas/-/html2canvas-1.4.1.tgz#7cef1888311b5011d507794a066041b14669a543" integrity sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA== @@ -575,7 +575,7 @@ js-cookie@^3.0.5: resolved "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.5.tgz#0b7e2fd0c01552c58ba86e0841f94dc2557dcdbc" integrity sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw== -jspdf@^2.3.1: +jspdf@^2.3.1, jspdf@^2.5.1: version "2.5.1" resolved "https://registry.npmmirror.com/jspdf/-/jspdf-2.5.1.tgz#00c85250abf5447a05f3b32ab9935ab4a56592cc" integrity sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA==