From 80e623b70119663e6f91c7805ae921aadb839e57 Mon Sep 17 00:00:00 2001 From: chengdandan <2549057906@qq.com> Date: Tue, 21 Mar 2023 14:02:18 +0800 Subject: [PATCH 1/3] 20230321 --- config/dev.env.js | 2 +- config/index.js | 2 +- src/api/api.js | 13 +++++++-- src/views/login.vue | 71 ++++++++++++++++++++++++++++++--------------- 4 files changed, 60 insertions(+), 28 deletions(-) diff --git a/config/dev.env.js b/config/dev.env.js index 20ae3f7..43cd253 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -4,5 +4,5 @@ const prodEnv = require('./prod.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"', - BASE_API: '"/proxyApi"' + BASE_API: '"/api"' }) diff --git a/config/index.js b/config/index.js index 1e38bc5..bdee421 100644 --- a/config/index.js +++ b/config/index.js @@ -20,7 +20,7 @@ module.exports = { // }, '/api': { // target: 'http://10.6.0.26:81', - target: 'http://175.27.191.156:11000/', + target: 'http://175.27.191.156:11000/api/', changeOrigin: true, pathRewrite: { '^/api': '' diff --git a/src/api/api.js b/src/api/api.js index 3c7c533..9ff50ce 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -7,9 +7,16 @@ if (process.env.NODE_ENV === 'development') { axios.defaults.baseURL = '/' } //获取token -export const getToken = (params) => { - return axios.get('api/blade-auth/oauth/token', { - params +export const getToken = (data) => { + return axios.post('api/blade-auth/oauth/token'+'?grant_type='+data.grant_type+'&scope='+data.scope + +'&tenantId='+data.tenantId+'&username='+data.username+'&password='+data.password+'&type='+data.type,data, { + dataType: "JSON", + headers:{ + 'Content-Type': 'application/json', + 'Accept':'application/json', + 'Authorization':'Basic c2FiZXI6c2FiZXJfc2VjcmV0', + 'Tenant-Id': '748495' + } }) }; export function filterCompanyAPI (params) { diff --git a/src/views/login.vue b/src/views/login.vue index 11aa041..7fb2c18 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -49,6 +49,7 @@ import mdScreenPie from "@/components/common/mdScreenPie"; import Swiper from "@/components/common/carousel"; import Resize from '../utils/Resize.vue' import {getToken} from "../api/api"; +// import export default { name: "report", components: { @@ -82,35 +83,59 @@ export default { }, methods: { getTokenData(){ - // getToken({grant_type:'password',scope:'all',tenantId:'748495',username:'dlgc_pic',password:'e19d5cd5af0378da05f63f891c7467af',type:"account"}).then(res => { - // console.log("res",res.data) - // }) - var data = { + var data = { grant_type:'password', scope:'all', tenantId:'748495', username:'dlgc_pic', password:'e19d5cd5af0378da05f63f891c7467af', type:"account"} - axios({ - method: "get", - url: `${baseUrl}file/local/files`, - data: data, - headers: { - Authorization: "Bearer " + token, - }, - }) - .then(function(res) { - console.log(e.file.name); - z.modelshowdata.fileList = [ - { fileName: e.file.name, filePath: v.data.fileName }, - ]; - z.$message.success("上传成功"); - }) - .catch(function(err) { - z.$message.error("请求失败"); - }); - + getToken(data).then(res => { + console.log("res",res.data) + }) + + // this.$axios.post({ + // // method: "post", + // url: `http://175.27.191.156:11000/blade-auth/oauth/token`, + // data: data, + // headers: { + // Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0 ", + // tenantId:'748495' + // }, + // }) + // .then(function(res) { + // console.log("res11111",res); + + // }) + // .catch(function(err) { + // console.log("err",err); + // }); + // var resUrl = `http://175.27.191.156:11000/blade-auth/oauth/token` + // this.$axios.post({ + // type: "post", //请求方式 + // url: resUrl, + // data: JSON.stringify({ + // "grant_type":'password', + // "scope":'all', + // "tenantId":'748495', + // "username":'dlgc_pic', + // "password":'e19d5cd5af0378da05f63f891c7467af', + // "type":"account" + // }), + // dataType: "JSON", + // headers: { + // 'Content-Type': 'application/json', + // 'Accept':'application/json', + // 'Authorization': "Basic c2FiZXI6c2FiZXJfc2VjcmV0 ", + // 'tenantId':'748495' + // }, + // success: function(data, textStatus, request) { + // console.log("data",data) + // // const tokennew =JSON.parse(JSON.stringify(request.getResponseHeader('Access-Token'))) + // // setStorage("token",tokennew); + + // }, + // }); }, getType() { From 960cb31a67178e716409eddb1f6c3cd721f00960 Mon Sep 17 00:00:00 2001 From: chengdandan <2549057906@qq.com> Date: Wed, 22 Mar 2023 14:53:05 +0800 Subject: [PATCH 2/3] 20230321 --- src/api/personnel.js | 29 ++++++++++++ src/assets/weather/1.png | Bin 0 -> 430 bytes src/assets/weather/2.png | Bin 0 -> 376 bytes src/assets/weather/3.png | Bin 0 -> 442 bytes src/assets/weather/4.png | Bin 0 -> 485 bytes src/assets/weather/5.png | Bin 0 -> 455 bytes src/assets/weather/6.png | Bin 0 -> 388 bytes src/assets/weather/7.png | Bin 0 -> 338 bytes src/assets/weather/8.png | Bin 0 -> 455 bytes src/assets/weather/sun.png | Bin 0 -> 621 bytes src/components/common/pieDateChart.vue | 58 +++++++++++++++++++----- src/views/login.vue | 3 +- src/views/modelScreenComponents.vue | 4 ++ src/views/personnelComponents.vue | 59 +++++++++++-------------- 14 files changed, 108 insertions(+), 45 deletions(-) create mode 100644 src/api/personnel.js create mode 100644 src/assets/weather/1.png create mode 100644 src/assets/weather/2.png create mode 100644 src/assets/weather/3.png create mode 100644 src/assets/weather/4.png create mode 100644 src/assets/weather/5.png create mode 100644 src/assets/weather/6.png create mode 100644 src/assets/weather/7.png create mode 100644 src/assets/weather/8.png create mode 100644 src/assets/weather/sun.png diff --git a/src/api/personnel.js b/src/api/personnel.js new file mode 100644 index 0000000..7dc8cb9 --- /dev/null +++ b/src/api/personnel.js @@ -0,0 +1,29 @@ +import request from '@/utils/request' +import axios from 'axios' +import qs from 'qs' +if (process.env.NODE_ENV === 'development') { + axios.defaults.baseURL = '/' +} else if (process.env.NODE_ENV === 'production') { + axios.defaults.baseURL = '/' +} +//设置公共请求头 +let access_token = JSON.parse(sessionStorage.getItem("token")) +axios.defaults.headers.common['Blade-Auth'] = access_token; +// //获取token登录接口 +// export const getToken = (data) => { +// // axios.defaults.headers.common['Authorization'] = `Basic c2FiZXI6c2FiZXJfc2VjcmV0`; +// // axios.defaults.headers.common['Tenant-Id'] = `748495` +// return axios.post('api/blade-auth/oauth/token'+'?grant_type='+data.grant_type+'&scope='+data.scope +// +'&tenantId='+data.tenantId+'&username='+data.username+'&password='+data.password+'&type='+data.type, +// data, +// {headers: {'Authorization':'Basic c2FiZXI6c2FiZXJfc2VjcmV0', +// 'Tenant-Id': '748495','Content-Type': 'application/json;charset=UTF-8'}} +// ) +// }; +//人员统计 +export const getUserGroup = (params) => { + return axios.get('api/ems-third-party-service/user/group', + {params}, + ) +}; + diff --git a/src/assets/weather/1.png b/src/assets/weather/1.png new file mode 100644 index 0000000000000000000000000000000000000000..d434ac7347f6c3e663a3cad46379acbfa36743cf GIT binary patch literal 430 zcmV;f0a5;mP)J?Fl2pCO* zUH1to*O_cd&bgu|<(znm6)Q3d6m)hK2BMHo!bcODzs{~aw^;%fl%peHH!Sqw1PsOD zwGJ)E9|@4|*xU*e=|Bh=OlYZgwj}dPsHUYgP~mGZ1zf7DZ2~ijZ#kqIZDxanzFIt} zMMG6X2U0;=MiMx8=jT?K_OY%mraSC{deJ;!1KUAGp^l_wC>M{w7_cl%`!1+9(!ZGfiD9DK@%dsg#9G{@?Ljl)6_^KxVu7F^NCK6`BtnIH?>zJS z62~utMo--V-8I=TbqZ`M+tK5|R;i?dV7SUxnqI17DIdXL~sVwgz6wLx3<;a5P0Pq7F W3Ri3fFC-QK0000_WlR5l?Y)$EL3P}X2>PrYw(IbKUdl~ImEthb-QvsCO2q>(3K7dA$YjwAY( zd4pk%>;1%qOz6eoEKcJXo_0ektBb2FWDTz3Iu0b6aKA37u?wOPIF2Kj@5SNN|5o$` zPw*M9x}mk};Z)Fz!|5$s@m|D^Vi%DM{~Ry6q4l`vo7h^e#{<0VhSmyx;4R*jV|UUh k?ebw9N{?Kho0Ta10Zl|_*cJQpQvd(}07*qoM6N<$f^dP-N&o-= literal 0 HcmV?d00001 diff --git a/src/assets/weather/4.png b/src/assets/weather/4.png new file mode 100644 index 0000000000000000000000000000000000000000..6e46ec5b574b17bbb3870504e9c520e5b72bb92a GIT binary patch literal 485 zcmV8*jOwGN~Y3A(B3ByizSs? z8W0~rNR@C!xJu$G=k27kHgdtCE)}TaZ!U z(7oxV0>6rN&wme$n=r7GPpk80OY%-&#V1&66C~Q;q6Fpmzq?>UcK;ce3bF;s0!Ip_ zJv?_vw8NXuf239ZnsA@_1wP??2o!X+dPC97uDlH#_J&aYVHpDsj7A&42jeNnB;)&b z*Ws$fF>vY${jBroNKy}M37fQp$tR!gkeIf9*O3I4b8Znu}VowS+BN!a3hLx1u`aRI0*RazRJZ4zw7pUR23l1(EdI_1Q!F7}1Ys b9RzLxcn^vfbM|do00000NkvXXu0mjfZo}9% literal 0 HcmV?d00001 diff --git a/src/assets/weather/5.png b/src/assets/weather/5.png new file mode 100644 index 0000000000000000000000000000000000000000..10c43aae31b70b6755a4e878c41fb3d2c3efd30c GIT binary patch literal 455 zcmV;&0XY7NP)4u*Y0004wNkl^6o8-CjE{UIl%+H_Qpm?jlx%EfH7Q%HtcI{qSWtImLpJgQEG&k_WTO!l@*8Xv zk=JDjg_CUn@1?_l6q`u zE5AWpDUU#9X}B+*k}(5{{0H=hGy_{^M)N?gi4%yvW|%xCmFr9W=F zSd^9@&qZlz_v|@GuT@%(-PS)8rKJWqEI5>wR^U`=DYv%S`c`vMv>yU`gNru;qUMeVQ(gfoI?b$ZNXT^FSOED{lDF){&-*G>~Y{hveeM(fITN zuna7^>0QO!l*)=QuvxX4%72rnSgixfcK?n$;0?G0PNn$kbsdzLAnRLJbh{{)hyjWPl|aKx4p_C!PnklvGv>RBiTUi3z`5 z4Ta##fTB@P^)$6iI*;Qht;m0i^OYI^wYTP~Z2GpmYq}VA&fgZ|Rj}bK4O#_qPWcv? i?F2F{3P8!X2v5HaabYUtP)`0003QNkl&^~Z!IaDf%3$JE=zDw~) zTu=}(KyO5AuW<#eiVI))bPE}94{WvS&l5hT%^X^`^&MC<3n##-k7>BNy=d#UxX|%2 z%>gS`+tqiP0>*QrKqDKVp-TD$YV^Rzv;jP2Hp<}?npC4YiI22^2mM%J5EuiR3LUFa kA5$NoInW%H#~)9?H_@R}JNr@Tl>h($07*qoM6N<$g3#5Ei2wiq literal 0 HcmV?d00001 diff --git a/src/assets/weather/8.png b/src/assets/weather/8.png new file mode 100644 index 0000000000000000000000000000000000000000..3125cedb0082ad69504a598197127cb7cea03e3f GIT binary patch literal 455 zcmV;&0XY7NP);UuWgi{EzV!@4MMp}XX zl5l~B%*Z6LXJaoz#DV5Gzdq*wP+IzwmR^sjw2UY%Z9aQSX=w@yM?!8|239S}WMu4S%y-l)_y9ot=)x3~3${&5O&8H**I(T@<3>DpDA_u`w)X!J8TD zXWTx&Bx?%a&(O06HD!Ay%0(4)a4jsUm?HdCL^4aJX?G#39oO7xZr3NKo!DR5*dw>1 z@NU!1DTf{Y2*%uE{;cUPBOJoo9jvv3qhq(r6{YKf3lF^W{qTFc;Pw4W^a3B7U-wK> z6ff`Y7Si=oDrt%`N@V`>X5-=fGCyUe zY;lO?u1~8xT*4o(-L^Kx?o^vFhdlp=_Ss5S>kFqFeaLy!&2YA~rNQmygCxO^0Rha{ z9Qf}BWNl)7S+rA(osa9%_sexrQ)67;Ma+>lQ7+A{*v-QtVF{|&hehNL!oseLAeE#oK6?yl0zI_eNc>Z?t@iW>>g;Z*j s0z`MFiNC50Ik)`S)B?XR%bVXy?_GQ-a;?DjU!bV=boFyt=akR{0GoyPumAu6 literal 0 HcmV?d00001 diff --git a/src/components/common/pieDateChart.vue b/src/components/common/pieDateChart.vue index 30e6223..be22c22 100644 --- a/src/components/common/pieDateChart.vue +++ b/src/components/common/pieDateChart.vue @@ -2,22 +2,22 @@
项目总人数
- 100 + {{totalPer}}
-
+
- 项目管理组 + {{item.groupName}}
- 85 + {{item.number}}
-
+
From 28eeaa0e29512394ea2512f231e61eeb66e6c120 Mon Sep 17 00:00:00 2001 From: chengdandan <2549057906@qq.com> Date: Thu, 23 Mar 2023 08:44:17 +0800 Subject: [PATCH 3/3] 20230322 --- src/components/common/pieDateChart.vue | 475 +++++++++++++++++-------- 1 file changed, 336 insertions(+), 139 deletions(-) diff --git a/src/components/common/pieDateChart.vue b/src/components/common/pieDateChart.vue index be22c22..c416f25 100644 --- a/src/components/common/pieDateChart.vue +++ b/src/components/common/pieDateChart.vue @@ -9,7 +9,8 @@
- + + {{item.groupName}}
@@ -54,13 +55,13 @@ export default { data() { return { - totalPer:'', - // pieData:[], - color:['#00B3FF','#F1E453','#F85B60','#00A572', '#008AA4', '#7968D9', '#C7A73E'], + totalPer:0, + pieDataNew:[], + color:['background-color:#00B3FF','background-color:#F1E453','background-color:#F85B60','background-color:#00A572', 'background-color:#008AA4', 'background-color:#7968D9', 'background-color:#C7A73E'], }; }, mounted() { - // this.initCharts(); + this.initCharts(); }, watch: { // 监听父组件中的数据变化,重新触发Echarts @@ -74,7 +75,7 @@ export default { deep: true, handler(newVal) { console.log(newVal,'=============='); - this.initCharts(newVal) + // this.initCharts(newVal) this.changeNewVal(newVal) } @@ -85,144 +86,340 @@ export default { //获取人员数据 changeNewVal(newVal){ console.log("newVal",newVal) - // var pieDataN = this.pieData.map((item,index) => { - - // }) - var pieDataN = [] - this.color.forEach((items,indexs) => { - pieDataN = this.pieData.map((item,index) => { - if(index==indexs){ + this.pieDataNew = newVal + // var pieDataN = [] + newVal.map((item,index) => { + this.totalPer+=item.number + console.log("this.totalPer",this.totalPer) + this.color.forEach((items,indexs) => { + if(index==indexs){ return item.color = items - } + } + }) }) - - }) - console.log("this.pieDataN",pieDataN) }, - initCharts(value) { - console.log(value,'============'); + + initCharts() { let myChart = this.$echarts.init(this.$refs.chart); - var placeHolderStyle = { - normal: { - label: { - show: false, - position: "center" - }, - labelLine: { - show: false - }, - color: "#104841a3", - borderWidth: 0 - }, - emphasis: { - color: "#104841a3", - borderColor: "#00b3ff", - borderWidth: 0 - } - }; - // 绘制图表 - myChart.setOption({ - series: [ - { - name: '值', - type: 'pie', - clockWise: true, - hoverAnimation: false, - radius: ['92%', '97%'], - center: ['50%', '50%'], - itemStyle: { - normal: { - label: { - show: false - }, - labelLine: { - show: false, - length: 100, - smooth: 0.5 - }, - borderWidth: 5, - shadowBlur: 40, - borderColor: "#00B3FF", - shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影 - } - }, - data: [{ - value: 12, - }, { - value: 4, - name: '', - itemStyle: placeHolderStyle - }] - }, - // ------------2 - { - name: '值', - type: 'pie', - clockWise: true, - hoverAnimation: false, - radius: ['72%', '67%'], - center: ['50%', '50%'], - itemStyle: { - normal: { - label: { - show: false - }, - labelLine: { - show: false, - length: 100, - smooth: 0.5 - }, - borderWidth: 5, - shadowBlur: 40, - borderColor: "#F1E453", - shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影 - } - }, - data: [{ - value: 6, - }, { - value: 4, - name: '', - itemStyle: placeHolderStyle - }] - }, - // ------------3 - { - name: '值', - type: 'pie', - clockWise: true, - hoverAnimation: false, - radius: ['48%', '44%'], - center: ['50%', '50%'], - itemStyle: { - normal: { - label: { - show: false - }, - labelLine: { - show: false, - length: 100, - smooth: 0.5 - }, - borderWidth: 5, - shadowBlur: 40, - borderColor: "#f85b60", - shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影 - } - }, - data: [{ - value: 9, - }, { - value: 44, - name: '', - itemStyle: placeHolderStyle - }] - }, - ] - }); - //默认第一条高亮 - myChart.dispatchAction({ type: 'highlight', seriesIndex: [0, 1, 2], dataIndex: 0 }); + // var placeHolderStyle = { + // normal: { + // label: { + // show: false, + // position: "center" + // }, + // labelLine: { + // show: false + // }, + // color: "#104841a3", + // borderWidth: 0 + // }, + // emphasis: { + // color: "#104841a3", + // borderColor: "#00b3ff", + // borderWidth: 0 + // } + // }; + // // 绘制图表 + // myChart.setOption({ + // series: [ + // { + // name: '值', + // type: 'pie', + // clockWise: true, + // hoverAnimation: false, + // radius: ['92%', '97%'], + // center: ['50%', '50%'], + // itemStyle: { + // normal: { + // label: { + // show: false + // }, + // labelLine: { + // show: false, + // length: 100, + // smooth: 0.5 + // }, + // borderWidth: 5, + // shadowBlur: 40, + // borderColor: "#00B3FF", + // shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影 + // } + // }, + // data: [{ + // value: 12, + // }, { + // value: 4, + // name: '', + // itemStyle: placeHolderStyle + // }] + // }, + // // ------------2 + // { + // name: '值', + // type: 'pie', + // clockWise: true, + // hoverAnimation: false, + // radius: ['72%', '67%'], + // center: ['50%', '50%'], + // itemStyle: { + // normal: { + // label: { + // show: false + // }, + // labelLine: { + // show: false, + // length: 100, + // smooth: 0.5 + // }, + // borderWidth: 5, + // shadowBlur: 40, + // borderColor: "#F1E453", + // shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影 + // } + // }, + // data: [{ + // value: 6, + // }, { + // value: 4, + // name: '', + // itemStyle: placeHolderStyle + // }] + // }, + // // ------------3 + // { + // name: '值', + // type: 'pie', + // clockWise: true, + // hoverAnimation: false, + // radius: ['48%', '44%'], + // center: ['50%', '50%'], + // itemStyle: { + // normal: { + // label: { + // show: false + // }, + // labelLine: { + // show: false, + // length: 100, + // smooth: 0.5 + // }, + // borderWidth: 5, + // shadowBlur: 40, + // borderColor: "#f85b60", + // shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影 + // } + // }, + // data: [{ + // value: 9, + // }, { + // value: 44, + // name: '', + // itemStyle: placeHolderStyle + // }] + // }, + // ] + // }); + var data = [{ + name: "本科及以上", + value: 13211 + }, + { + name: "高中", + value: 42111 + }, + { + name: "初中及以下", + value: 81711 + }, + { + name: "其他", + value: 121711 } +]; +function getArrayValue(array, key) { + var key = key || "value"; + var res = []; + if (array) { + array.forEach(function(t) { + res.push(t[key]); + }); + } + return res; +} +function array2obj(array,key) { + var resObj = {}; + for(var i=0;i{b}:{c}({d}%)" + }, + color: ['#FF8700', '#ffc300', '#00e473', '#009DFF'], + grid: { + top: '20%', + bottom: '48%', + left: "30%", + containLabel: false + }, + yAxis: [{ + type: 'category', + inverse: true, + axisLine: { + show: false + }, + axisTick: { + show: false + }, + axisLabel: { + interval: 0, + inside: true, + textStyle: { + color: "#000", + fontSize: 10, + }, + show: true + }, + data: optionData.yAxis + }], + xAxis: [{ + show: false + }], + series: optionData.series +}; + //默认第一条高亮 + // myChart.dispatchAction({ type: 'highlight', seriesIndex: [0, 1, 2], dataIndex: 0 }); + }, + } };