From 107d2455b8f2797cab7964689f20d8a731b58904 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 18 Oct 2024 15:12:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=84=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/components/bar-charts-model.vue | 11 +- .../components/pie-charts-model-ring-two.vue | 9 +- .../components/pie-charts-model-ring.vue | 9 +- .../index/components/pie-charts-model.vue | 11 +- pages/realName/index/index.vue | 324 ++++++++++++------ 5 files changed, 248 insertions(+), 116 deletions(-) diff --git a/pages/realName/index/components/bar-charts-model.vue b/pages/realName/index/components/bar-charts-model.vue index 6509fab..db0e866 100644 --- a/pages/realName/index/components/bar-charts-model.vue +++ b/pages/realName/index/components/bar-charts-model.vue @@ -1,6 +1,6 @@ @@ -150,7 +150,7 @@ export default { categories: ['基建线路', '基建变电', '生产线路', '生成变电', '配网', '其他'], series: [ { - name: '目标值', + name: '', data: [constructionLine, infrastructureSubstation, productionLine, productionSubstation, network, other] } ] @@ -158,6 +158,13 @@ export default { this.chartData = JSON.parse(JSON.stringify(data)) }, 500) }) + }, + handleChartClick(index) { + // console.log('index', index) + const currentIndex = index.currentIndex.index // 获取当前点击的图表索引 + const currenName = this.chartData.categories[currentIndex] + console.log('currenName选中的工程类型', currenName) + uni.navigateTo({ url: `/pages/realName/index/pages/project?xxx=${currenName}` }) } } } diff --git a/pages/realName/index/components/pie-charts-model-ring-two.vue b/pages/realName/index/components/pie-charts-model-ring-two.vue index 50ce55a..58dac3e 100644 --- a/pages/realName/index/components/pie-charts-model-ring-two.vue +++ b/pages/realName/index/components/pie-charts-model-ring-two.vue @@ -1,6 +1,6 @@ @@ -145,6 +145,13 @@ export default { this.chartData = JSON.parse(JSON.stringify(data)) }, 500) }) + }, + handleChartClick(index) { + const { currentIndex } = index // 获取当前点击的图表索引 + const chartsData = this.chartData.series[0].data + const currenRows = chartsData[currentIndex] + console.log('currenRows选中的工种类型', currenRows.name) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${currenRows.name}` }) } } } diff --git a/pages/realName/index/components/pie-charts-model-ring.vue b/pages/realName/index/components/pie-charts-model-ring.vue index fa11c90..fdfa327 100644 --- a/pages/realName/index/components/pie-charts-model-ring.vue +++ b/pages/realName/index/components/pie-charts-model-ring.vue @@ -1,6 +1,6 @@ @@ -145,6 +145,13 @@ export default { this.chartData = JSON.parse(JSON.stringify(data)) }, 500) }) + }, + handleChartClick(index) { + const { currentIndex } = index // 获取当前点击的图表索引 + const chartsData = this.chartData.series[0].data + const currenRows = chartsData[currentIndex] + console.log('currenRows选中的人员类型(这个应该时年龄范围)', currenRows.name) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${currenRows.name}` }) } } } diff --git a/pages/realName/index/components/pie-charts-model.vue b/pages/realName/index/components/pie-charts-model.vue index b8c2d61..bf8f631 100644 --- a/pages/realName/index/components/pie-charts-model.vue +++ b/pages/realName/index/components/pie-charts-model.vue @@ -80,9 +80,6 @@ export default { labelBgOpacity: 0.7, labelFontColor: '#666666' } - }, - onClick: e => { - console.log('eeeee图表点击了---', e) } } } @@ -137,8 +134,12 @@ export default { }, 500) }) }, - handleChartClick() { - console.log('图表点击-------') + handleChartClick(index) { + const { currentIndex } = index // 获取当前点击的图表索引 + const chartsData = this.chartData.series[0].data + const currenRows = chartsData[currentIndex] + console.log('currenRows选中的工程类型', currenRows.name) + uni.navigateTo({ url: `/pages/realName/index/pages/project?xxx=${currenRows.name}` }) } } } diff --git a/pages/realName/index/index.vue b/pages/realName/index/index.vue index 6ac45df..0be49cf 100644 --- a/pages/realName/index/index.vue +++ b/pages/realName/index/index.vue @@ -127,7 +127,7 @@

人员考勤率

- + {{ item.progress_title }} {{ item.progress_proportion }}% @@ -146,7 +146,7 @@

工程概况

- + {{ item.project_title }} {{ item.project_num }} @@ -172,17 +172,17 @@

在场人员概况

- + {{ ((greenNum / colorAmount) * 100).toFixed(2) }}% {{ greenNum }} - + {{ ((yellowNum / colorAmount) * 100).toFixed(2) }}% {{ yellowNum }} - + {{ ((redNum / colorAmount) * 100).toFixed(2) }}% {{ redNum }} @@ -196,10 +196,18 @@ 男({{ maleNum }}) - + - + {{ ((femaleNum / sexAmount) * 100).toFixed(2) }}% 女({{ femaleNum }}) @@ -210,7 +218,7 @@
固定、临时人员
- + {{ formalPersonNum }} - + - - - - - - - - 选择工程 - - - - {{item.abbreviation}} - - - + + + + + + + 选择工程 + + + + + + {{ item.abbreviation }} + + + + @@ -293,10 +319,10 @@ export default { return { userId: uni.getStorageSync('userId'), tabbar: TabbarConfig, - type:uni.getStorageSync('realNameUser').type, - subId:uni.getStorageSync('realNameUser').subId, - showPopup:false, - proList:[], + type: uni.getStorageSync('realNameUser').type, + subId: uni.getStorageSync('realNameUser').subId, + showPopup: false, + proList: [], msgList: [], dataOverviewList: [ { @@ -427,7 +453,9 @@ export default { maleNum: 0, femaleNum: 0, - sexAmount: 0 + sexAmount: 0, + + colorAmount: 0 // planProNum: 0, // redPersonNum: 0, @@ -444,17 +472,19 @@ export default { console.log('?? ~ mounted ~ mounted-index:') this.getLogin() this.getHomePageListData() - if(this.type.indexOf("4")>-1){//监督端 - this.getPro() - } + if (this.type.indexOf('4') > -1) { + //监督端 + this.getPro() + } }, onShow() { - if(this.type.indexOf("4")>-1){ //监督端 - let hasChosenPro=uni.getStorageSync('hasChosenPro') - if(!hasChosenPro){ - this.showPopup=true - } - } + if (this.type.indexOf('4') > -1) { + //监督端 + let hasChosenPro = uni.getStorageSync('hasChosenPro') + if (!hasChosenPro) { + this.showPopup = true + } + } }, methods: { getLogin() { @@ -495,57 +525,57 @@ export default { } }) }, - - //监督端获取工程列表 - getPro(){ - let param={ - id:-1, - subId:this.subId - } - console.log(param) - uni.request({ - url: config.realAppUrl + '/offLine/getPro', - method: 'post', - data: param, - header: { - 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: uni.getStorageSync('realNameToken') - }, - success: res => { - console.log(res) - res = res.data; - if(res.code==200){ - this.proList = res.data; - } - }, - fail: err => { - console.log(err) - } - }) - }, - //展示工程选择弹窗 - leftClick() { - console.log('返回') - if(this.type.indexOf("4")>-1){ - this.showPopup=true; - } + + //监督端获取工程列表 + getPro() { + let param = { + id: -1, + subId: this.subId + } + console.log(param) + uni.request({ + url: config.realAppUrl + '/offLine/getPro', + method: 'post', + data: param, + header: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: uni.getStorageSync('realNameToken') + }, + success: res => { + console.log(res) + res = res.data + if (res.code == 200) { + this.proList = res.data + } + }, + fail: err => { + console.log(err) + } + }) + }, + //展示工程选择弹窗 + leftClick() { + console.log('返回') + if (this.type.indexOf('4') > -1) { + this.showPopup = true + } + }, + //选择工程 + chosenPro(item) { + let obj = uni.getStorageSync('realNameUser') + obj.proId = item.id + uni.setStorageSync('realNameUser', obj) + uni.setStorageSync('hasChosenPro', '1') + this.showPopup = false + }, + closePopup() { + this.showPopup = false + }, + openFaceScan() { + face.open(['a', 'c'], function (e) { + face.close() + }) }, - //选择工程 - chosenPro(item){ - let obj = uni.getStorageSync('realNameUser') - obj.proId=item.id - uni.setStorageSync('realNameUser', obj) - uni.setStorageSync('hasChosenPro', "1") - this.showPopup=false; - }, - closePopup() { - this.showPopup=false; - }, - openFaceScan() { - face.open(['a', 'c'], function (e) { - face.close() - }) - }, /* 获取首页数据 */ async getHomePageListData() { @@ -642,25 +672,105 @@ export default { onJumpWorkPlan() { uni.navigateTo({ url: '/pages/realName/workPlan/index' }) }, - - //数据概览跳转 - godataView(item) { - console.log(item) - if(item.data_title=='在建工程'){ - uni.navigateTo({ url: '/pages/realName/index/pages/project' }) - } - if(item.data_title=='在用分包单位'){ - uni.navigateTo({ url: '/pages/realName/index/pages/subList' }) - } - if(item.data_title=='在用班组'){ - uni.navigateTo({ url: '/pages/realName/index/pages/teamList' }) - } - if(item.data_title=='在场人数'){ - uni.navigateTo({ url: '/pages/realName/index/pages/personList' }) - } - - }, - }, + + //数据概览跳转 + godataView(item) { + console.log(item) + if (item.data_title == '在建工程') { + uni.navigateTo({ url: '/pages/realName/index/pages/project' }) + } + if (item.data_title == '在用分包单位') { + uni.navigateTo({ url: '/pages/realName/index/pages/subList' }) + } + if (item.data_title == '在用班组') { + uni.navigateTo({ url: '/pages/realName/index/pages/teamList' }) + } + if (item.data_title == '在场人数') { + uni.navigateTo({ url: '/pages/realName/index/pages/personList' }) + } + }, + /* 人员考勤等跳转 */ + onJumpPersonList(title) { + let params = '' + // 跳转人员列表 + switch (title) { + case '在场考勤率': + params = '在场考勤率' + break + case '作业考勤率': + params = '作业考勤率' + break + case '在场人员(固定)': + params = '在场人员(固定)' + break + case '在场人员(临时)': + params = '在场人员(临时)' + break + case '考勤率(固定人员)': + params = '考勤率(固定人员)' + break + case '考勤率(临时人员)': + params = '考勤率(临时人员)' + break + } + + console.log('params路由参数考勤固定等··', params) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${params}` }) + }, + /* 工程概况跳转 */ + onJumpProjectList(title) { + let params = '' + // 跳转人员列表 + switch (title) { + case '在建': + params = '在建' + break + case '筹建': + params = '筹建' + break + case '停工': + params = '停工' + break + case '完工': + params = '完工' + break + } + + console.log('params路由参数工程概况', params) + uni.navigateTo({ url: `/pages/realName/index/pages/project?xxx=${params}` }) + }, + /* 在场人员概况跳转人员信息 */ + onJumpColorLight(type) { + let params = '' + // 跳转人员列表 + switch (type) { + case 1: + params = '绿灯' + break + case 2: + params = '黄灯' + break + case 3: + params = '红灯' + break + case 4: + params = '男性' + break + case 5: + params = '女性' + break + case 6: + params = '固定人员' + break + case 7: + params = '临时人员' + break + } + + console.log('params路由参数红黄灯以及性别··和固定、临时', params) + uni.navigateTo({ url: `/pages/realName/index/pages/personList?xxx=${params}` }) + } + } }