From a98f2720c316131ce9826cdf7504aa978f97c43e Mon Sep 17 00:00:00 2001 From: chenjianan Date: Thu, 18 Jul 2019 17:48:21 +0800 Subject: [PATCH] dashboard --- src/icons/svg/CreateProject.svg | 2 +- src/icons/svg/DeliveryApplication.svg | 2 +- src/icons/svg/EquipmentCapabilitySetting.svg | 2 +- src/icons/svg/MaintenanceEquipmentPerson.svg | 2 +- src/icons/svg/OutsourcingPriceBudget.svg | 2 +- src/views/dashboard/index.vue | 64 +++++++++++++++++++- 6 files changed, 67 insertions(+), 7 deletions(-) diff --git a/src/icons/svg/CreateProject.svg b/src/icons/svg/CreateProject.svg index 92be1095..0523dd88 100644 --- a/src/icons/svg/CreateProject.svg +++ b/src/icons/svg/CreateProject.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/DeliveryApplication.svg b/src/icons/svg/DeliveryApplication.svg index fca39892..7959ba59 100644 --- a/src/icons/svg/DeliveryApplication.svg +++ b/src/icons/svg/DeliveryApplication.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/EquipmentCapabilitySetting.svg b/src/icons/svg/EquipmentCapabilitySetting.svg index f265e976..f8bdb9e0 100644 --- a/src/icons/svg/EquipmentCapabilitySetting.svg +++ b/src/icons/svg/EquipmentCapabilitySetting.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/MaintenanceEquipmentPerson.svg b/src/icons/svg/MaintenanceEquipmentPerson.svg index 61e37ab8..3f686721 100644 --- a/src/icons/svg/MaintenanceEquipmentPerson.svg +++ b/src/icons/svg/MaintenanceEquipmentPerson.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/OutsourcingPriceBudget.svg b/src/icons/svg/OutsourcingPriceBudget.svg index 2c64d68b..20046d83 100644 --- a/src/icons/svg/OutsourcingPriceBudget.svg +++ b/src/icons/svg/OutsourcingPriceBudget.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 1a9ca162..991c102e 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -13,6 +13,16 @@ + +
+ {{ value1.title }} + + +
+
{{ value2.title }}
+
+
+
@@ -29,7 +39,9 @@ export default { sudokus: [], curSelect: null, number: '', - timer: '' + timer: '', + fathers: [], + sons: [] } }, computed: { @@ -41,11 +53,53 @@ export default { mounted() { this.getFileList() this.timer = setInterval(this.getFileList, 60 * 60 * 1000) // 60 分钟一刷新 + this.initFirstModule() + this.initSecondModule() }, beforeDestroy() { clearInterval(this.timer) }, methods: { + async initFirstModule() { + await request({ + url: '', + method: 'post', + data: { + type: '3', + name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号= ${this.token} and [path] = '/'` + } + }).then(data => { + this.fathers = [] + data.data.map(v => { + this.fathers.push({ + id: v.id, + title: v.title + }) + }) + }) + }, + async initSecondModule() { + await request({ + url: '', + method: 'post', + data: { + type: '3', + name: `select * from 基础表_角色模块信息 inner join 基础表_模块信息 on 基础表_角色模块信息.id = 基础表_模块信息.id where 角色编号= ${this.token} and [path] <> '/'` + } + }).then(data => { + console.log(data) + this.sons = [] + data.data.map(v => { + this.sons.push({ + id: v.id, + pid: v.pid, + path: v.path, + icon: v.icon, + title: v.title + }) + }) + }) + }, async getFileList() { await request({ url: '', @@ -82,7 +136,13 @@ export default { } } - +