From 9b7759edde9f713d71b7084a277c8f696054477f Mon Sep 17 00:00:00 2001 From: kola-web Date: Thu, 7 Nov 2024 18:02:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/doctorAvatar/index.wxml | 6 + src/echart/components/homeLevel1/index.ts | 38 +- src/echart/components/homeLevel1/index.wxml | 52 +-- src/echart/components/homeLevel2/index.ts | 105 ++++- src/echart/components/homeLevel2/index.wxml | 140 +++--- src/echart/components/homeLevel3/index.ts | 74 +++- src/echart/components/homeLevel3/index.wxml | 91 ++-- src/echart/components/homeLevel4/index.scss | 4 +- src/echart/components/homeLevel4/index.ts | 545 +++++++++++++++-------- src/echart/components/homeLevel4/index.wxml | 130 +++--- src/images/doctor-level4.png | Bin 0 -> 7552 bytes src/images/empty-3.png | Bin 0 -> 7695 bytes src/images/empty-4.png | Bin 0 -> 16993 bytes src/module1/pages/doctorRankList/index.json | 4 +- src/module1/pages/doctorRankList/index.scss | 3 +- src/module1/pages/doctorRankList/index.ts | 45 +- src/module1/pages/doctorRankList/index.wxml | 15 +- src/module1/pages/org3/index.scss | 36 +- src/module1/pages/org3/index.ts | 43 +- src/module1/pages/org3/index.wxml | 355 +++++++-------- src/module1/pages/org4/index.scss | 68 ++- src/module1/pages/org4/index.ts | 130 +++++- src/module1/pages/org4/index.wxml | 640 +++++++++++++++++++--------- src/pages/cases/index.ts | 2 +- src/pages/home/index.ts | 19 +- src/pages/home/index.wxml | 32 +- 26 files changed, 1728 insertions(+), 849 deletions(-) create mode 100644 src/images/doctor-level4.png create mode 100644 src/images/empty-3.png create mode 100644 src/images/empty-4.png diff --git a/src/components/doctorAvatar/index.wxml b/src/components/doctorAvatar/index.wxml index 20f3df3..7ad1cdb 100644 --- a/src/components/doctorAvatar/index.wxml +++ b/src/components/doctorAvatar/index.wxml @@ -12,4 +12,10 @@ wx:elif="{{level==2}}" src="{{imageUrl}}doctor-level2.png?t={{Timestamp}}" > + diff --git a/src/echart/components/homeLevel1/index.ts b/src/echart/components/homeLevel1/index.ts index 2415761..2f60ff3 100644 --- a/src/echart/components/homeLevel1/index.ts +++ b/src/echart/components/homeLevel1/index.ts @@ -8,6 +8,8 @@ Component({ properties: { userInfo: Object, DoctorTitleType: Object, + hospitalClassification: Object, + hospitalLevel: Object, }, /** @@ -17,13 +19,15 @@ Component({ fold1: false, foldHeight1: 10000, take: {}, + case: {}, + cooperateList: [], }, lifetimes: { attached() { - this.getHeight(); this.getTake(); this.getCase(); + this.getCooperate(); }, }, /** @@ -44,6 +48,11 @@ Component({ fold1: !this.data.fold1, }); }, + handleEntryCase() { + wx.navigateTo({ + url: "/module1/pages/entryCases/index", + }); + }, getTake() { wx.ajax({ method: "GET", @@ -66,5 +75,32 @@ Component({ }); }); }, + getCooperate() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/cooperation-doctor-list", + data: {}, + }).then((res) => { + this.setData({ + cooperateList: res.list, + }); + this.getHeight(); + }); + }, + handleQuestion(e) { + const { index } = e.currentTarget.dataset; + const message = { + 1: "属于您所在科室的公开的病历", + 2: "平台所有优质的病历", + }[index]; + wx.showModal({ + confirmColor: "#00B4C5", + showCancel: false, + confirmText: "知道了", + content: message, + }); + }, }, }); + +export {}; diff --git a/src/echart/components/homeLevel1/index.wxml b/src/echart/components/homeLevel1/index.wxml index e481dd7..e71e624 100644 --- a/src/echart/components/homeLevel1/index.wxml +++ b/src/echart/components/homeLevel1/index.wxml @@ -36,13 +36,13 @@ 我提交的病历 总数 - 54 + {{case.totalCaseCount}} @@ -50,7 +50,7 @@ 新病历 - 54 + {{case.newCaseCount}} @@ -58,7 +58,7 @@ 讨论中 - 54 + {{case.feedbackCaseCount}} @@ -66,7 +66,7 @@ 已归档 - 54 + {{case.archiveCaseCount}} @@ -79,12 +79,12 @@ 还没有提交病历 - 提交病历 + 提交病历 - + - 我合作的医生(2) + 我合作的医生({{inviteList.length}}) 展开 @@ -97,30 +97,30 @@ - - + + - 徐萌 - 主任医师 - - 心内科 + {{item.DoctorName}} + {{item.DoctorOtherTitle}} + {{DoctorTitleType[item.DoctorTitleType]}} + + + {{item.DepartmentName}} + - 北京天坛医院 - 三甲 - 广州市/番禺区 + {{item.HospitalName}} + + {{hospitalClassification[item.HospitalClassification]}}{{hospitalLevel[item.HospitalLevel]}} + + + {{item.CityName}}{{item.CountyName?'/':''}}{{item.CountyName}} + - + - 心律失常 - 心律失常 - 心律失常 - 心律失常 + {{item.SpecialtyName}} diff --git a/src/echart/components/homeLevel2/index.ts b/src/echart/components/homeLevel2/index.ts index 6539630..2ea2e71 100644 --- a/src/echart/components/homeLevel2/index.ts +++ b/src/echart/components/homeLevel2/index.ts @@ -1,11 +1,16 @@ -const _app = getApp() +const _app = getApp(); // pages/story/a.ts Component({ /** * 组件的属性列表 */ - properties: {}, + properties: { + userInfo: Object, + DoctorTitleType: Object, + hospitalClassification: Object, + hospitalLevel: Object, + }, /** * 组件的初始数据 @@ -15,35 +20,109 @@ Component({ foldHeight1: 10000, fold2: false, foldHeight2: 10000, + take: {}, + case: {}, + cooperateList: [], + inviteList: [], }, - attached() { - this.getHeight() + lifetimes: { + attached() { + this.getTake(); + this.getCase(); + this.getCooperate(); + this.getInvite(); + }, }, /** * 组件的方法列表 */ methods: { - getHeight() { - const query = wx.createSelectorQuery().in(this) - query.select('#fold1').boundingClientRect() - query.select('#fold2').boundingClientRect() + getHeight1() { + const query = wx.createSelectorQuery().in(this); + query.select("#fold1").boundingClientRect(); query.exec((res) => { this.setData({ foldHeight1: res[0].height, + }); + }); + }, + getHeight2() { + const query = wx.createSelectorQuery().in(this); + query.select("#fold2").boundingClientRect(); + query.exec((res) => { + this.setData({ foldHeight2: res[1].height, - }) - }) + }); + }); }, toggleFold1() { this.setData({ fold1: !this.data.fold1, - }) + }); }, toggleFold2() { this.setData({ fold2: !this.data.fold2, - }) + }); + }, + getTake() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/todo", + data: {}, + }).then((res) => { + this.setData({ + take: res, + }); + }); + }, + getCase() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/case", + data: {}, + }).then((res) => { + this.setData({ + case: res, + }); + }); + }, + getCooperate() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/cooperation-doctor-list", + data: {}, + }).then((res) => { + this.setData({ + cooperateList: res.list, + }); + this.getHeight1(); + }); + }, + getInvite() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/invite-doctor-list", + data: {}, + }).then((res) => { + this.setData({ + inviteList: res.list, + }); + this.getHeight2(); + }); + }, + handleInvite() { + wx.navigateTo({ + url: "/module1/pages/invite/index", + }); + }, + handleEntryCase() { + wx.navigateTo({ + url: "/module1/pages/entryCases/index", + }); }, }, -}) +}); + +export {}; diff --git a/src/echart/components/homeLevel2/index.wxml b/src/echart/components/homeLevel2/index.wxml index 23a47d7..42670a8 100644 --- a/src/echart/components/homeLevel2/index.wxml +++ b/src/echart/components/homeLevel2/index.wxml @@ -1,53 +1,54 @@ - - + + - 徐萌 + {{userInfo.Name}} - 主治医师 - - 心内科 + {{userInfo.OtherTitle}} + {{DoctorTitleType[userInfo.TitleType]}} + + + {{item.DepartmentName}} + - 北京天坛医院 - 三甲 - 广州市/番禺区 + {{userInfo.HospitalName}} + {{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevelName}} + + {{userInfo.CityName}}{{userInfo.CountyName?'/':''}}{{userInfo.CountyName}} + - + - 心律失常 - 心律失常 - 心律失常 - 心律失常 + {{item.SpecialtyName}} @@ -103,12 +104,12 @@ 还没有提交病历 - 提交病历 + 提交病历 - + - 我合作的医生(2) + 我合作的医生({{inviteList.length}}) 展开 @@ -121,30 +122,30 @@ - - + + - 徐萌 - 主任医师 - - 心内科 + {{item.DoctorName}} + {{item.DoctorOtherTitle}} + {{DoctorTitleType[item.DoctorTitleType]}} + + + {{item.DepartmentName}} + - 北京天坛医院 - 三甲 - 广州市/番禺区 + {{item.HospitalName}} + + {{hospitalClassification[item.HospitalClassification]}}{{hospitalLevel[item.HospitalLevel]}} + + + {{item.CityName}}{{item.CountyName?'/':''}}{{item.CountyName}} + - + - 心律失常 - 心律失常 - 心律失常 - 心律失常 + {{item.SpecialtyName}} @@ -162,9 +163,9 @@ - + - 我邀约的医生(1) + 我邀约的医生({{inviteList.length}}) 展开 @@ -177,31 +178,30 @@ - - - 蒋亮医生指派 + + - 徐萌 - 主任医师 - - 心内科 + {{item.DoctorName}} + {{item.DoctorOtherTitle}} + {{DoctorTitleType[item.DoctorTitleType]}} + + + {{item.DepartmentName}} + - 北京天坛医院 - 三甲 - 广州市/番禺区 + {{item.HospitalName}} + + {{hospitalClassification[item.HospitalClassification]}}{{hospitalLevel[item.HospitalLevel]}} + + + {{item.CityName}}{{item.CountyName?'/':''}}{{item.CountyName}} + - + - 心律失常 - 心律失常 - 心律失常 - 心律失常 + {{item.SpecialtyName}} diff --git a/src/echart/components/homeLevel3/index.ts b/src/echart/components/homeLevel3/index.ts index 38a9289..4b5a41e 100644 --- a/src/echart/components/homeLevel3/index.ts +++ b/src/echart/components/homeLevel3/index.ts @@ -1,26 +1,86 @@ -const _app = getApp() +const _app = getApp(); // pages/story/a.ts Component({ /** * 组件的属性列表 */ - properties: {}, + properties: { + userInfo: Object, + DoctorTitleType: Object, + hospitalClassification: Object, + hospitalLevel: Object, + }, /** * 组件的初始数据 */ - data: {}, + data: { + take: {}, + case: {}, + doctorCount: {}, + }, - attached() {}, + lifetimes: { + attached() { + this.getTake(); + this.getCase(); + this.getManageDoctor(); + }, + }, /** * 组件的方法列表 */ methods: { + getTake() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/todo", + data: {}, + }).then((res) => { + this.setData({ + take: res, + }); + }); + }, + getCase() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/case", + data: {}, + }).then((res) => { + this.setData({ + case: res, + }); + }); + }, + getManageDoctor() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/manage-doctor-count", + data: {}, + }).then((res) => { + this.setData({ + doctorCount: res.count, + }); + }); + }, + handleInvite() { + wx.navigateTo({ + url: "/module1/pages/invite/index", + }); + }, handleOrg() { wx.navigateTo({ - url: '/module1/pages/org3/index', - }) + url: "/module1/pages/org3/index", + }); + }, + handleEntryCase() { + wx.navigateTo({ + url: "/module1/pages/entryCases/index", + }); }, }, -}) +}); + +export {}; diff --git a/src/echart/components/homeLevel3/index.wxml b/src/echart/components/homeLevel3/index.wxml index 0a96729..35b8bdc 100644 --- a/src/echart/components/homeLevel3/index.wxml +++ b/src/echart/components/homeLevel3/index.wxml @@ -1,51 +1,54 @@ - - + + - 徐萌 + {{userInfo.Name}} - 主治医师 - - 心内科 + {{userInfo.OtherTitle}} + {{DoctorTitleType[userInfo.TitleType]}} + + + {{item.DepartmentName}} + - 北京天坛医院 - 三甲 - 广州市/番禺区 + {{userInfo.HospitalName}} + {{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevelName}} + + {{userInfo.CityName}}{{userInfo.CountyName?'/':''}}{{userInfo.CountyName}} + - + - 心律失常 - 心律失常 - 心律失常 - 心律失常 + {{item.SpecialtyName}} 我管理的医生 @@ -112,32 +117,26 @@ - 全部 - 54 - - - - 新病历 + 全部 - 54 + {{doctorCount.TotalCount}} - 讨论中 + 二级医生 - 54 + {{doctorCount.TwoCount}} - - 已归档 + 一级医生 - 54 + {{doctorCount.OneCount}} diff --git a/src/echart/components/homeLevel4/index.scss b/src/echart/components/homeLevel4/index.scss index e91d99f..e3a6fd8 100644 --- a/src/echart/components/homeLevel4/index.scss +++ b/src/echart/components/homeLevel4/index.scss @@ -388,7 +388,6 @@ } } .table { - margin-top: 40rpx; .thead { padding: 22rpx 0; display: flex; @@ -422,8 +421,9 @@ background-color: rgba(248, 248, 248, 1); } .td1 { - padding: 12rpx 0; + padding: 12rpx 10rpx; width: 338rpx; + text-align-last: left; } .td2, .td3, diff --git a/src/echart/components/homeLevel4/index.ts b/src/echart/components/homeLevel4/index.ts index 950b9f0..7d450d2 100644 --- a/src/echart/components/homeLevel4/index.ts +++ b/src/echart/components/homeLevel4/index.ts @@ -1,12 +1,18 @@ -const app = getApp() -const echarts = require('../ec-canvas/echarts.js') +import dayjs from "dayjs"; + +const echarts = require("../ec-canvas/echarts.js"); // pages/story/a.ts Component({ /** * 组件的属性列表 */ - properties: {}, + properties: { + userInfo: Object, + DoctorTitleType: Object, + hospitalClassification: Object, + hospitalLevel: Object, + }, /** * 组件的初始数据 @@ -15,14 +21,46 @@ Component({ ec: { lazyLoad: true, }, + take: {}, + case: {}, + doctorCount: {}, + + DepartmentId: "", + DepartmentName: "", + + endYear: dayjs().year(), + year1: dayjs().year(), + year2: dayjs().year(), + year3: dayjs().year(), + empty1: false, + empty2: false, + empty3: false, + + rankList: [], }, - attached() { - this.waitEchart(async () => { - const chart1: any = await this.initChart1() - const chart2: any = await this.initChart2() - const chart3: any = await this.initChart3() - }) + lifetimes: { + attached() { + const { DepartmentId, DepartmentName } = this.data.userInfo.Department[0]; + this.setData({ + Department: this.data.userInfo.Department, + DepartmentId, + DepartmentName, + }); + this.getTake(); + this.getCase(); + this.getManageDoctor(); + this.getRankList(); + + this.waitEchart(async () => { + this.getChat1(); + this.getChat2(); + this.getChat3(); + // const chart1: any = await this.initChart1(); + // const chart2: any = await this.initChart2(); + // const chart3: any = await this.initChart3(); + }); + }, }, /** * 组件的方法列表 @@ -33,54 +71,81 @@ Component({ ecDataTrendComponent3: null as any, waitEchart(callback) { const time = setInterval(() => { - if (this.selectComponent('#chart1')) { - console.log(this.selectComponent('#chart1')) - clearInterval(time) - callback() + if (this.selectComponent("#chart1")) { + clearInterval(time); + callback(); } - }, 30) + }, 30); + }, + handleYear1(e) { + this.setData({ + year1: e.detail.value, + }); + this.getChat1(); + }, + getChat1() { + wx.ajax({ + method: "GET", + url: "?r=takeda/stat/department-doctor-list", + data: { + Year: this.data.year1, + DepartmentId: this.data.DepartmentId, + }, + }).then((res) => { + this.setData({ + empty1: Boolean(res.list.length === 0), + }); + this.initChart1(res.list); + }); }, - initChart1() { + initChart1(list) { return new Promise((reslove) => { - this.ecDataTrendComponent1 = this.selectComponent('#chart1') + this.ecDataTrendComponent1 = this.selectComponent("#chart1"); this.ecDataTrendComponent1.init((canvas, width, height, dpr) => { const chart = echarts.init(canvas, null, { width, height, devicePixelRatio: dpr, // new - }) - canvas.setChart(chart) - const x: string[] = ['2024-09', '2024-10'] - const y1: string[] = ['10', '30'] - const y2: string[] = ['10', '30'] - const y3: string[] = ['10', '30'] - const y4: string[] = ['30', '90'] + }); + canvas.setChart(chart); + const x: string[] = []; + const y1: string[] = []; + const y2: string[] = []; + const y3: string[] = []; + const y4: string[] = []; + list.forEach((item) => { + x.push(item.YearMonth); + y1.push(item.DoctorLevel1Count); + y2.push(item.DoctorLevel2Count); + y3.push(item.DoctorLevel3Count); + y4.push(item.DoctorCount); + }); const option = { legend: { bottom: 0, itemWidth: 8, itemHeight: 8, - icon: 'circle', + icon: "circle", lineStyle: { - width: '0', + width: "0", }, textStyle: { - color: 'rgba(103, 113, 114, 1)', - fontSize: '12', + color: "rgba(103, 113, 114, 1)", + fontSize: "12", }, - data: ['一级医生', '核心医生', '质控医生'], + data: ["一级医生", "核心医生", "质控医生"], }, grid: { - top: '10%', - left: '3%', - right: '4%', - bottom: '30', + top: "10%", + left: "3%", + right: "4%", + bottom: "30", containLabel: true, }, xAxis: [ { - type: 'category', + type: "category", axisTick: { show: false, }, @@ -89,148 +154,175 @@ Component({ }, axisLabel: { fontSize: 10, - color: 'rgba(40, 48, 49, 1)', + color: "rgba(40, 48, 49, 1)", }, data: x, }, ], yAxis: [ { - type: 'value', + type: "value", minInterval: 1, splitLine: { show: false, }, axisLabel: { fontSize: 10, - color: 'rgba(40, 48, 49, 1)', + color: "rgba(40, 48, 49, 1)", formatter(value) { - return Math.abs(value) + return Math.abs(value); }, }, }, ], series: [ { - name: '质控医生', - type: 'bar', - stack: 'a', + name: "质控医生", + type: "bar", + stack: "a", label: { show: true, - color: '#fff', + color: "#fff", fontSize: 10, - overflow: 'truncate', + overflow: "truncate", width: 30, formatter(params) { - return Math.abs(params.value) + return Math.abs(params.value); }, }, - color: 'rgba(0, 180, 197, 1)', + color: "rgba(0, 180, 197, 1)", data: y3, }, { - name: '核心医生', - type: 'bar', - stack: 'a', + name: "核心医生", + type: "bar", + stack: "a", label: { show: true, - color: '#fff', + color: "#fff", fontSize: 10, - overflow: 'truncate', + overflow: "truncate", width: 30, formatter(params) { - return Math.abs(params.value) + return Math.abs(params.value); }, }, - color: 'rgba(84, 226, 180, 1)', + color: "rgba(84, 226, 180, 1)", data: y2, }, { - name: '一级医生', - type: 'bar', - stack: 'a', + name: "一级医生", + type: "bar", + stack: "a", label: { show: true, - color: 'rgba(0, 180, 197, 1)', + color: "rgba(0, 180, 197, 1)", fontSize: 10, - overflow: 'truncate', + overflow: "truncate", width: 30, }, - color: 'rgba(225, 248, 242, 1)', + color: "rgba(225, 248, 242, 1)", data: y1, }, { - name: '总数', // 总数显示,生成一个总数的柱状图,将颜色设为透明, - type: 'line', // label将位置设备内部底部,造成一个总数显示在 - stack: '', // 柱状图上方的假象 - color: 'rgba(0, 0, 0, 0)', + name: "总数", // 总数显示,生成一个总数的柱状图,将颜色设为透明, + type: "line", // label将位置设备内部底部,造成一个总数显示在 + stack: "", // 柱状图上方的假象 + color: "rgba(0, 0, 0, 0)", data: y4, symbolSize: 0, label: { normal: { show: true, - position: 'top', - color: 'rgba(133, 133, 133, 1)', + position: "top", + color: "rgba(133, 133, 133, 1)", fontSize: 10, - formatter: '{c}', + formatter: "{c}", }, }, }, ], dataZoom: { - type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + type: "inside", // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 startValue: x.length - 6, endValue: x.length - 1, - filterMode: 'none', + filterMode: "none", }, - } + }; - chart.setOption(option) - reslove(chart) - return chart - }) - }) + chart.setOption(option); + reslove(chart); + return chart; + }); + }); }, - initChart2() { + handleYear2(e) { + this.setData({ + year2: e.detail.value, + }); + this.getChat2(); + }, + getChat2() { + wx.ajax({ + method: "GET", + url: "?r=takeda/stat/department-doctor-total-case-list", + data: { + Year: this.data.year2, + DepartmentId: this.data.DepartmentId, + }, + }).then((res) => { + this.setData({ + empty2: Boolean(res.list.length === 0), + }); + this.initChart2(res.list); + }); + }, + initChart2(list) { return new Promise((reslove) => { - this.ecDataTrendComponent2 = this.selectComponent('#chart2') + this.ecDataTrendComponent2 = this.selectComponent("#chart2"); this.ecDataTrendComponent2.init((canvas, width, height, dpr) => { const chart = echarts.init(canvas, null, { width, height, devicePixelRatio: dpr, // new - }) - canvas.setChart(chart) - const x: string[] = ['2024-09', '2024-10'] - const y1: string[] = ['10', '30'] - const y2: string[] = ['10', '30'] - const y3: string[] = ['20', '60'] + }); + canvas.setChart(chart); + const x: string[] = ["2024-09", "2024-10"]; + const y1: string[] = ["10", "30"]; + const y2: string[] = ["10", "30"]; + const y3: string[] = ["20", "60"]; + list.forEach((item) => { + x.push(item.YearMonth); + y1.push(item.DoctorLevel1TotalCases); + y2.push(item.DoctorLevel2TotalCases); + y3.push(item.TotalCaseCount); + }); const option = { legend: { bottom: 0, itemWidth: 8, itemHeight: 8, - icon: 'circle', + icon: "circle", lineStyle: { - width: '0', + width: "0", }, textStyle: { - color: 'rgba(103, 113, 114, 1)', - fontSize: '12', + color: "rgba(103, 113, 114, 1)", + fontSize: "12", }, - data: ['一级医生提交', '核心医生提交'], + data: ["一级医生提交", "核心医生提交"], }, grid: { - top: '10%', - left: '3%', - right: '4%', - bottom: '30', + top: "10%", + left: "3%", + right: "4%", + bottom: "30", containLabel: true, }, xAxis: [ { - type: 'category', + type: "category", axisTick: { show: false, }, @@ -239,131 +331,158 @@ Component({ }, axisLabel: { fontSize: 10, - color: 'rgba(40, 48, 49, 1)', + color: "rgba(40, 48, 49, 1)", }, data: x, }, ], yAxis: [ { - type: 'value', + type: "value", minInterval: 1, splitLine: { show: false, }, axisLabel: { fontSize: 10, - color: 'rgba(40, 48, 49, 1)', + color: "rgba(40, 48, 49, 1)", formatter(value) { - return Math.abs(value) + return Math.abs(value); }, }, }, ], series: [ { - name: '核心医生提交', - type: 'bar', - stack: 'a', + name: "核心医生提交", + type: "bar", + stack: "a", label: { show: true, - color: '#fff', + color: "#fff", fontSize: 10, - overflow: 'truncate', + overflow: "truncate", width: 30, formatter(params) { - return Math.abs(params.value) + return Math.abs(params.value); }, }, - color: 'rgba(84, 226, 180, 1)', + color: "rgba(84, 226, 180, 1)", data: y2, }, { - name: '一级医生提交', - type: 'bar', - stack: 'a', + name: "一级医生提交", + type: "bar", + stack: "a", label: { show: true, - color: 'rgba(0, 180, 197, 1)', + color: "rgba(0, 180, 197, 1)", fontSize: 10, - overflow: 'truncate', + overflow: "truncate", width: 30, }, - color: 'rgba(225, 248, 242, 1)', + color: "rgba(225, 248, 242, 1)", data: y1, }, { - name: '总数', // 总数显示,生成一个总数的柱状图,将颜色设为透明, - type: 'line', // label将位置设备内部底部,造成一个总数显示在 - stack: '', // 柱状图上方的假象 - color: 'rgba(0, 0, 0, 0)', + name: "总数", // 总数显示,生成一个总数的柱状图,将颜色设为透明, + type: "line", // label将位置设备内部底部,造成一个总数显示在 + stack: "", // 柱状图上方的假象 + color: "rgba(0, 0, 0, 0)", data: y3, symbolSize: 0, label: { normal: { show: true, - position: 'top', - color: 'rgba(133, 133, 133, 1)', + position: "top", + color: "rgba(133, 133, 133, 1)", fontSize: 10, - formatter: '{c}', + formatter: "{c}", }, }, }, ], dataZoom: { - type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + type: "inside", // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 startValue: x.length - 6, endValue: x.length - 1, - filterMode: 'none', + filterMode: "none", }, - } + }; - chart.setOption(option) - reslove(chart) - return chart - }) - }) + chart.setOption(option); + reslove(chart); + return chart; + }); + }); + }, + handleYear3(e) { + this.setData({ + year3: e.detail.value, + }); + this.getChat3(); }, - initChart3() { + getChat3() { + wx.ajax({ + method: "GET", + url: "?r=takeda/stat/department-doctor-month-case-list", + data: { + Year: this.data.year3, + DepartmentId: this.data.DepartmentId, + }, + }).then((res) => { + this.setData({ + empty3: Boolean(res.list.length === 0), + }); + this.initChart3(res.list); + }); + }, + initChart3(list) { return new Promise((reslove) => { - this.ecDataTrendComponent3 = this.selectComponent('#chart3') + this.ecDataTrendComponent3 = this.selectComponent("#chart3"); this.ecDataTrendComponent3.init((canvas, width, height, dpr) => { const chart = echarts.init(canvas, null, { width, height, devicePixelRatio: dpr, // new - }) - canvas.setChart(chart) - const x: string[] = ['2024-09', '2024-10'] - const y1: string[] = ['10', '30'] - const y2: string[] = ['10', '30'] - const y3: string[] = ['20', '60'] + }); + canvas.setChart(chart); + const x: string[] = ["2024-09", "2024-10"]; + const y1: string[] = ["10", "30"]; + const y2: string[] = ["10", "30"]; + const y3: string[] = ["20", "60"]; + list.forEach((item) => { + x.push(item.YearMonth); + y1.push(item.DoctorLevel1MonthCases); + y2.push(item.DoctorLevel2MonthCases); + y3.push(item.TotalCaseCount); + }); const option = { legend: { bottom: 0, itemWidth: 8, itemHeight: 8, - icon: 'circle', + icon: "circle", lineStyle: { - width: '0', + width: "0", }, textStyle: { - color: 'rgba(103, 113, 114, 1)', - fontSize: '12', + color: "rgba(103, 113, 114, 1)", + fontSize: "12", }, - data: ['一级医生提交', '核心医生提交'], + data: ["一级医生提交", "核心医生提交"], }, grid: { - top: '10%', - left: '3%', - right: '4%', - bottom: '30', + top: "10%", + left: "3%", + right: "4%", + bottom: "30", containLabel: true, }, xAxis: [ { - type: 'category', + type: "category", axisTick: { show: false, }, @@ -372,95 +491,171 @@ Component({ }, axisLabel: { fontSize: 10, - color: 'rgba(40, 48, 49, 1)', + color: "rgba(40, 48, 49, 1)", }, data: x, }, ], yAxis: [ { - type: 'value', + type: "value", minInterval: 1, splitLine: { show: false, }, axisLabel: { fontSize: 10, - color: 'rgba(40, 48, 49, 1)', + color: "rgba(40, 48, 49, 1)", formatter(value) { - return Math.abs(value) + return Math.abs(value); }, }, }, ], series: [ { - name: '核心医生提交', - type: 'bar', - stack: 'a', + name: "核心医生提交", + type: "bar", + stack: "a", label: { show: true, - color: '#fff', + color: "#fff", fontSize: 10, - overflow: 'truncate', + overflow: "truncate", width: 30, formatter(params) { - return Math.abs(params.value) + return Math.abs(params.value); }, }, - color: 'rgba(84, 226, 180, 1)', + color: "rgba(84, 226, 180, 1)", data: y2, }, { - name: '一级医生提交', - type: 'bar', - stack: 'a', + name: "一级医生提交", + type: "bar", + stack: "a", label: { show: true, - color: 'rgba(0, 180, 197, 1)', + color: "rgba(0, 180, 197, 1)", fontSize: 10, - overflow: 'truncate', + overflow: "truncate", width: 30, }, - color: 'rgba(225, 248, 242, 1)', + color: "rgba(225, 248, 242, 1)", data: y1, }, { - name: '总数', // 总数显示,生成一个总数的柱状图,将颜色设为透明, - type: 'line', // label将位置设备内部底部,造成一个总数显示在 - stack: '', // 柱状图上方的假象 - color: 'rgba(0, 0, 0, 0)', + name: "总数", // 总数显示,生成一个总数的柱状图,将颜色设为透明, + type: "line", // label将位置设备内部底部,造成一个总数显示在 + stack: "", // 柱状图上方的假象 + color: "rgba(0, 0, 0, 0)", data: y3, symbolSize: 0, label: { normal: { show: true, - position: 'top', - color: 'rgba(133, 133, 133, 1)', + position: "top", + color: "rgba(133, 133, 133, 1)", fontSize: 10, - formatter: '{c}', + formatter: "{c}", }, }, }, ], dataZoom: { - type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 + type: "inside", // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 startValue: x.length - 6, endValue: x.length - 1, - filterMode: 'none', + filterMode: "none", }, - } + }; - chart.setOption(option) - reslove(chart) - return chart - }) - }) + chart.setOption(option); + reslove(chart); + return chart; + }); + }); + }, + getTake() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/todo", + data: {}, + }).then((res) => { + this.setData({ + take: res, + }); + }); + }, + handleChangeDept(e) { + const index = e.detail.value; + const { DepartmentId, DepartmentName } = this.data.userInfo.Department[index]; + this.setData({ + DepartmentId, + DepartmentName, + }); + this.getCase(); + this.getManageDoctor(); + this.getChat1(); + this.getChat2(); + this.getChat3(); + }, + getCase() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/case", + data: {}, + }).then((res) => { + this.setData({ + case: res, + }); + }); + }, + getManageDoctor() { + wx.ajax({ + method: "GET", + url: "?r=takeda/doctor/manage-doctor-count", + data: { DepartmentId: this.data.DepartmentId }, + }).then((res) => { + this.setData({ + doctorCount: res.count, + }); + }); + }, + getRankList() { + wx.ajax({ + method: "GET", + url: "?r=takeda/stat/hospital-doctor-rank-list", + data: { + count: 5, + }, + }).then((res) => { + this.setData({ + rankList: res.list, + }); + }); }, handleRankDetail() { wx.navigateTo({ - url: '/module1/pages/doctorRankList/index', - }) + url: "/module1/pages/doctorRankList/index", + }); + }, + handleInvite() { + wx.navigateTo({ + url: "/module1/pages/invite/index", + }); + }, + handleCase() { + wx.switchTab({ + url: "/pages/cases/index", + }); + }, + handleAllDoctor() { + wx.navigateTo({ + url: "/module1/pages/org4/index", + }); }, }, -}) +}); + +export {}; diff --git a/src/echart/components/homeLevel4/index.wxml b/src/echart/components/homeLevel4/index.wxml index 25850e0..4941496 100644 --- a/src/echart/components/homeLevel4/index.wxml +++ b/src/echart/components/homeLevel4/index.wxml @@ -1,53 +1,55 @@ - - + + - 徐萌 + {{userInfo.Name}} - 主治医师 - - 心内科 + {{userInfo.OtherTitle}} + {{DoctorTitleType[userInfo.TitleType]}} + + + {{item.DepartmentName}} + - 北京天坛医院 - 三甲 - 广州市/番禺区 + {{userInfo.HospitalName}} + {{userInfo.HospitalClassificationName}}{{userInfo.HospitalLevelName}} + + {{userInfo.CityName}}{{userInfo.CountyName?'/':''}}{{userInfo.CountyName}} + - + - 心律失常 - 心律失常 - 心律失常 - 心律失常 + {{item.SpecialtyName}}