Browse Source

病例分析相关接口

master
aBin 4 years ago
parent
commit
11f797d7b0
  1. 10
      src/App.vue
  2. 130
      src/components/Echarts/Analysis.vue
  3. 2
      src/components/PatientInfo/PatientTable.vue
  4. 5
      src/config/api.js
  5. 13
      src/main.js
  6. 2
      src/plugins/ant-design-vue.js
  7. 1
      src/store/modules/home/actions.js
  8. 10
      src/store/modules/home/mutations.js
  9. 1207
      src/views/CaseAnalysis/CaseAnalysis.vue
  10. 1
      src/views/CaseSearch/CaseSearch.vue
  11. 6
      src/views/PatientInfo/PatientInfo.vue
  12. 3
      src/views/SelectPatient/SelectPatient.vue

10
src/App.vue

@ -27,6 +27,7 @@ export default {
if (val.userId) {
const params = { userId: val.userId };
this.getUserId(params);
console.log('val.userId:' + val.userId);
}
},
},
@ -35,9 +36,10 @@ export default {
const userId = '1218763410024566784';
const params = { userId };
this.getUserId(params);
// this.getToken();
this.getHospitalId();
if (sessionStorage.getItem('patientId')) {
this.setPatientId(sessionStorage.getItem('patientId'));
if (localStorage.getItem('patientId')) {
this.setPatientId(localStorage.getItem('patientId'));
}
const that = this;
window.plugin = window.TallPlugin.init();
@ -45,14 +47,14 @@ export default {
// created created
// PT ididididuserId
window.plugin.created(function(props) {
that.setPtProps(props);
console.log('props: ', props);
that.setPtProps(props);
});
},
methods: {
...mapActions('home', ['getUserId']),
...mapMutations('home', ['setPtProps', 'setHospitalId', 'setPatientId']),
...mapMutations('home', ['setPtProps', 'setHospitalId', 'setPatientId', 'getToken']),
async getHospitalId() {
try {

130
src/components/Echarts/Analysis.vue

@ -0,0 +1,130 @@
<!--
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-29 14:45:02
* @LastEditors: wally
* @LastEditTime: 2021-02-19 15:50:23
-->
<template>
<!-- <div>数据统计组件</div> -->
<div style="width: 100%; height: 500px" class="chart-box">
<div id="Analysis" style="height: 500px"></div>
</div>
</template>
<script>
import { HospitalComplete } from 'config/api';
export default {
name: 'Analysis',
props: {
lists: {
type: Object,
default: function() {
return {};
},
},
},
data() {
return {
// msg: 'Welcome to Your Vue.js App',
width: '',
height: '',
nameList: [], //
dataList: [],
series: [],
colorList: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'],
};
},
watch: {
lists() {
this.nameList = [];
this.dataList = [];
this.series = [];
//
for (let i = 0; i < this.lists.selGroupNums.length; i++) {
// Y
this.nameList.push(this.lists.selGroupNums[i].name);
let arr = [];
//
for (let j = 0; j < this.lists.stringList.length; j++) {
// list
for (let k = 0; k < this.lists.selGroupNums[i].list.length; k++) {
// listcontent content value
if (this.lists.selGroupNums[i].list[k].content === this.lists.stringList[j]) {
let obj = {
name: this.lists.selGroupNums[i].list[k].content,
value: this.lists.selGroupNums[i].list[k].nums,
};
arr.push(obj);
break;
// list
} else if (k === this.lists.selGroupNums[i].list.length - 1) {
let obj = {
name: this.lists.stringList[i],
value: 0,
};
arr.push(obj);
break;
}
}
}
this.dataList.push(arr);
}
//
for (let i = 0; i < this.dataList[0].length; i++) {
let arr1 = [];
for (let k = 0; k < this.dataList.length; k++) {
arr1.push(this.dataList[k][i].value);
}
let obj = {
name: this.dataList[0][i].name,
type: 'bar',
stack: 'total',
label: { show: true },
itemStyle: { color: this.colorList[`${i % 5}`] },
emphasis: { focus: 'series' },
data: arr1,
};
this.series.push(obj);
}
this.drawLine();
console.log(this.dataList);
console.log(this.series);
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
let myChart = this.$echarts.init(document.getElementById('Analysis'));
//
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow', // 线'line' | 'shadow'
},
},
legend: { data: this.lists.stringList },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: { type: 'value' },
yAxis: {
type: 'category',
data: this.nameList,
},
series: this.series,
};
myChart.setOption(option);
},
},
};
</script>
<style lang="stylus" scoped ></style>

2
src/components/PatientInfo/PatientTable.vue

@ -110,7 +110,7 @@ export default {
//
chooseItem(id) {
this.setPatientId(id);
sessionStorage.setItem('patientId', id);
localStorage.setItem('patientId', id);
},
handleTableChange(pagination) {

5
src/config/api.js

@ -23,8 +23,10 @@ export const upload = `${file}/upload`;
// 通过任务Id查询项目Id
export const getHId = params => axios.get(`${hospatil}/byProjectId?projectId=${params}`);
// 查询医院列表
export const getHList = params => axios.get(`${hospatil}/selHospatil`);
// 保存患者病例信息
export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params);
@ -43,6 +45,9 @@ export const selSearchCriteriaList = params => axios.post(`${patient}/selSearchC
// 试题相关接口:按code查看题目信息,code为空则查询全部
export const queryAll = params => axios.post(`${tcm}/question/query`, params);
// 查询所有得题目的类型和题目相关信息
export const queryQuestion = params => axios.get(`${tcm}/question/queryQuestion`);
// 查询所有对照组的信息
export const getQuery = params => axios.post(`${inpatient}/query`, params);

13
src/main.js

@ -19,6 +19,8 @@ import 'echarts-gl';
import 'echarts/map/js/province/shanxi.js'; //对应的省份
import './plugins/vue-quill-editor.js';
import VueDOMPurifyHTML from 'vue-dompurify-html';
// import { getUserId } from 'config/api-user';
// Vue.use(echarts);
Vue.use(VueDOMPurifyHTML);
Vue.prototype.$echarts = echarts;
@ -28,6 +30,17 @@ import moment from 'moment'; //导入文件
Vue.prototype.$moment = moment; //赋值使用
Vue.config.productionTip = false;
// router.beforeEach((to, from, next) => {
// const token = sessionStorage.getItem('anyringToken');
// if (token) {
// next();
// } else {
// const userId = '1218763410024566784';
// const params = { userId };
// getUserId(params).then(next());
// }
// });
window.vm = new Vue({
router,
store,

2
src/plugins/ant-design-vue.js

@ -39,6 +39,7 @@ import {
Card,
List,
Collapse,
Cascader,
} from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider);
@ -72,6 +73,7 @@ Vue.use(Spin);
Vue.use(Card);
Vue.use(List);
Vue.use(Collapse);
Vue.use(Cascader);
Vue.prototype.$message = message;
Vue.prototype.$notification = notification;

1
src/store/modules/home/actions.js

@ -16,6 +16,7 @@ const actions = {
if (code === 200) {
commit('sign', data.token);
commit('setUser', data);
console.log(data.token);
return data;
} else {
throw msg;

10
src/store/modules/home/mutations.js

@ -8,7 +8,15 @@ const mutations = {
state.anyringToken = token;
sessionStorage.setItem('anyringToken', token);
},
/**
* 设置token
* @param { object } state
* @param { string } token
*/
getToken(state, token) {
state.anyringToken = sessionStorage.getItem('anyringToken');
console.log('anyringToken' + sessionStorage.getItem('anyringToken'));
},
/**
* 设置user用户信息
* @param {object} state

1207
src/views/CaseAnalysis/CaseAnalysis.vue

File diff suppressed because it is too large

1
src/views/CaseSearch/CaseSearch.vue

@ -797,6 +797,7 @@ export default {
this.getControlGroups();
this.handleSearchCriteriaList();
this.getHos();
this.setData();
},

6
src/views/PatientInfo/PatientInfo.vue

@ -719,7 +719,7 @@ export default {
action: upload, //
fileList: [], //
files: '', // Id
dateFormat: 'YYYY-MM-DD',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
dateChoose: new Date(),
subDateTime: '',
};
@ -980,7 +980,7 @@ export default {
},
//
changeDate(date) {
this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD');
this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD HH:mm:ss');
},
//
async setData() {
@ -989,7 +989,7 @@ export default {
param: {
list: this.contentList,
patientId: this.patientId,
timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD'),
timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD HH:mm:ss'),
},
};
const res = await saveCaseMes(params);

3
src/views/SelectPatient/SelectPatient.vue

@ -51,6 +51,7 @@ export default {
};
const res = await selPatientMes(params);
const { code, msg, data } = res.data;
console.log('获取列表');
if (code === 200) {
this.lists = data;
} else {
@ -58,7 +59,7 @@ export default {
throw msg;
}
} catch (error) {
throw new Error(`CaseSearch.vue method selSearchCriteriaList: ${error}`);
throw new Error(error);
}
},
},

Loading…
Cancel
Save