diff --git a/src/App.vue b/src/App.vue index 7c276ec..99edf30 100644 --- a/src/App.vue +++ b/src/App.vue @@ -36,6 +36,9 @@ export default { const params = { userId }; this.getUserId(params); this.getHospitalId(); + if (sessionStorage.getItem('patientId')) { + this.setPatientId(sessionStorage.getItem('patientId')); + } const that = this; window.plugin = window.TallPlugin.init(); // 调用created方法 向主窗体发送created消息,以便来接受、存储主窗体传递来的参数 @@ -49,7 +52,7 @@ export default { methods: { ...mapActions('home', ['getUserId']), - ...mapMutations('home', ['setPtProps', 'setHospitalId']), + ...mapMutations('home', ['setPtProps', 'setHospitalId', 'setPatientId']), async getHospitalId() { try { diff --git a/src/components/Echarts/Categorymap.vue b/src/components/Echarts/Categorymap.vue index b766d30..deeb8ef 100644 --- a/src/components/Echarts/Categorymap.vue +++ b/src/components/Echarts/Categorymap.vue @@ -12,7 +12,7 @@ diff --git a/src/components/Echarts/Cisualmap.vue b/src/components/Echarts/Cisualmap.vue index 6344cad..9757f49 100644 --- a/src/components/Echarts/Cisualmap.vue +++ b/src/components/Echarts/Cisualmap.vue @@ -16,46 +16,63 @@ export default { height: '', timer: null, list: [], + dateList1: [], // 新建日期数组 + dataList1: [], // 新建数据数组 + dateList2: [], // 已完成日期数组 + dataList2: [], // 已完成数据数组 }; }, mounted() { this.drawLine(); - this.timer = setInterval(() => { - this.drawLine(); - }, 10000); - let wh = window.innerWidth; - let hg = window.innerHeight; - this.width = wh + 'px'; - this.height = hg + 'px'; - console.log(this.height); - window.onresize = () => { - return (() => { - wh = window.innerWidth; - hg = window.innerHeight; - this.width = wh + 'px'; - this.height = hg + 'px'; - })(); - }; + // this.timer = setInterval(() => { + // this.drawLine(); + // }, 10000); + // let wh = window.innerWidth; + // let hg = window.innerHeight; + // this.width = wh + 'px'; + // this.height = hg + 'px'; + // console.log(this.height); + // window.onresize = () => { + // return (() => { + // wh = window.innerWidth; + // hg = window.innerHeight; + // this.width = wh + 'px'; + // this.height = hg + 'px'; + // })(); + // }; }, methods: { - drawLine() { + async drawLine() { // 基于准备好的dom,初始化echarts实例 let myChart1 = this.$echarts.init(document.getElementById('Cisualmap1')); let myChart2 = this.$echarts.init(document.getElementById('Cisualmap2')); + await this.getData(); // 绘制图表 var option1 = { title: { left: 'center', text: '新建病例', }, + dataZoom: [ + { + type: 'slider', + xAxisIndex: 0, + filterMode: 'empty', + }, + { + type: 'inside', + xAxisIndex: 0, + filterMode: 'empty', + }, + ], xAxis: { type: 'category', - data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + data: this.dateList1, }, yAxis: { type: 'value' }, series: [ { - data: [820, 932, 901, 934, 1290, 1330, 1320], + data: this.dataList1, type: 'line', areaStyle: { color: 'rgba(229,244,254,1)' }, lineStyle: { color: 'rgb(45,151,213)' }, @@ -69,14 +86,26 @@ export default { left: 'center', text: '已完成病例', }, + dataZoom: [ + { + type: 'slider', + xAxisIndex: 0, + filterMode: 'empty', + }, + { + type: 'inside', + xAxisIndex: 0, + filterMode: 'empty', + }, + ], xAxis: { type: 'category', - data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + data: this.dateList2, }, yAxis: { type: 'value' }, series: [ { - data: [820, 932, 901, 934, 1290, 1330, 1320], + data: this.dataList2, type: 'line', areaStyle: { color: 'rgba(229,244,254,1)' }, lineStyle: { color: 'rgb(45,151,213)' }, @@ -101,7 +130,12 @@ export default { const res = await countCase(params); const { code, msg, data } = res.data; if (code === 200) { - this.list = data; + for (let i = 0; i < data.newNums.length; i++) { + this.forNewList(data.newNums[i]); + } + for (let i = 0; i < data.overNums.length; i++) { + this.forOverList(data.overNums[i]); + } } else { console.log(msg); } @@ -109,6 +143,14 @@ export default { this.$message.error('获取数据失败'); } }, + forNewList(obj) { + this.dateList1.push(obj.shijian); + this.dataList1.push(obj.nums); + }, + forOverList(obj) { + this.dateList2.push(obj.shijian); + this.dataList2.push(obj.nums); + }, }, }; diff --git a/src/components/Echarts/Piemap.vue b/src/components/Echarts/Piemap.vue index ea80cf0..a0a9adb 100644 --- a/src/components/Echarts/Piemap.vue +++ b/src/components/Echarts/Piemap.vue @@ -5,6 +5,7 @@ diff --git a/src/components/Echarts/Treemap.vue b/src/components/Echarts/Treemap.vue index 9e481b7..3805006 100644 --- a/src/components/Echarts/Treemap.vue +++ b/src/components/Echarts/Treemap.vue @@ -90,7 +90,7 @@ export default { async getData() { const params = { param: { - hospitalId: this.hospitalId ? this.ptProps.hospitalId : '', + hospitalId: this.ptProps && this.ptProps.hospitalId ? this.ptProps.hospitalId : '', userId: this.ptProps && this.ptProps.userId ? this.ptProps.userId : '', }, }; diff --git a/src/components/PatientInfo/PatientTable.vue b/src/components/PatientInfo/PatientTable.vue index 42203dc..d296bc1 100644 --- a/src/components/PatientInfo/PatientTable.vue +++ b/src/components/PatientInfo/PatientTable.vue @@ -110,6 +110,7 @@ export default { // 选择病患 chooseItem(id) { this.setPatientId(id); + sessionStorage.setItem('patientId', id); }, handleTableChange(pagination) { diff --git a/src/config/api.js b/src/config/api.js index 9e5b347..453ae5e 100644 --- a/src/config/api.js +++ b/src/config/api.js @@ -16,6 +16,10 @@ const statistics = `${tcm}/statistics`; // 数据统计相关接口 const conferenceRecords = `${tcm}/conferenceRecords`; // 会议纪要相关接口 const biologicalSamples = `${tcm}/biologicalSamples`; // 生物样本相关接口 const hospatil = `${tcm}/hospatil`; // 医院相关接口 +const file = `${tcm}/file`; // 文件相关接口 + +// 上传文件 +export const upload = `${file}/upload`; // 通过任务Id查询项目Id export const getHId = params => axios.get(`${hospatil}/byProjectId?projectId=${params}`); @@ -37,7 +41,8 @@ export const selPatientMesList = params => axios.post(`${patient}/selPatientMesL export const selSearchCriteriaList = params => axios.post(`${patient}/selSearchCriteriaList`, params); // 试题相关接口:按code查看题目信息,code为空则查询全部 -export const queryAll = params => axios.post(`${tcm}/question/queryAll`, params); +export const queryAll = params => axios.post(`${tcm}/question/query`, params); + // 查询所有对照组的信息 export const getQuery = params => axios.post(`${inpatient}/query`, params); @@ -47,9 +52,15 @@ export const complete = params => axios.post(`${statistics}/complete`, params); // 查询病例分析 export const countAnalysis = params => axios.post(`${statistics}/countAnalysis`, params); +// 查询各医院病例完成情况 +export const HospitalComplete = params => axios.post(`${statistics}/hospital/complete`, params); + // 查询每日病例统计 export const countCase = params => axios.post(`${statistics}/countCase`, params); +// 统计生物样本数量 +export const selAllYBS = params => axios.get(`${biologicalSamples}/selAllYBS`); + // 添加会议记录 export const saveConRec = params => axios.post(`${conferenceRecords}/save`, params); diff --git a/src/views/PatientInfo/PatientInfo.vue b/src/views/PatientInfo/PatientInfo.vue index 9ae22e5..3df55ea 100644 --- a/src/views/PatientInfo/PatientInfo.vue +++ b/src/views/PatientInfo/PatientInfo.vue @@ -10,106 +10,124 @@