From fc4643995c226e48818a1fe29f301d3f018662c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A2=86=E6=82=9F?= <735033209@qq.com> Date: Mon, 17 Feb 2025 10:14:05 +0800 Subject: [PATCH] init --- src/api/index.js | 19 +- src/config/axios.js | 168 +++-- src/config/code.js | 540 +++++++------- src/layouts/BasicLayout.vue | 26 +- src/main.js | 21 +- .../Patient/components/patient-create.vue | 132 ++-- .../Patient/components/patient-detail.vue | 4 +- src/views/Patient/index.vue | 2 +- src/views/document/index.vue | 35 +- .../components/throm-ing-date.vue | 700 ++++++++++++++++++ .../thrombolysis/components/throm-ing.vue | 39 +- .../thrombolysis/components/throm-report.vue | 2 +- 12 files changed, 1251 insertions(+), 437 deletions(-) create mode 100644 src/views/thrombolysis/components/throm-ing-date.vue diff --git a/src/api/index.js b/src/api/index.js index 638a04f..9194594 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -25,6 +25,17 @@ export const queryTriageList = (params) => export const create = (params) => axios.post(`${proxyUrl1}/firstAid/create`, params); + +//根据id,查询患者信息,回写患者信息 +export const queryById = (params) => +axios.post(`${proxyUrl1}/firstAid/queryById`, params); + +// 编辑患者 + +export const eduitPatient = (params) => +axios.post(`${proxyUrl1}//firstAid/eduitPatient`, params); + + // 查病历数据 export const queryAidRecord = (firstAidId, codeList) => axios.post(`${proxyUrl1}/firstAid/queryAidRecord`, { @@ -310,7 +321,7 @@ export const createPatient = (params) => axios.post(`${proxyUrl1}/firstAid/createPatient`, { ...params }); -export const eduitPatient = (params) => - axios.post(`${proxyUrl1}/firstAid/eduitPatient`, { - ...params - }); \ No newline at end of file +// export const eduitPatient = (params) => +// axios.post(`${proxyUrl1}/firstAid/eduitPatient`, { +// ...params +// }); \ No newline at end of file diff --git a/src/config/axios.js b/src/config/axios.js index a428a8a..8654965 100644 --- a/src/config/axios.js +++ b/src/config/axios.js @@ -4,8 +4,12 @@ import Vue from 'vue'; import axios from 'axios'; import router from '../router/index'; import store from '../store/index'; -import { message } from 'ant-design-vue'; -let { proxyUrl } = require('@/config/setting'); +import { + message +} from 'ant-design-vue'; +let { + proxyUrl +} = require('@/config/setting'); let config = { timeout: 10000, // Timeout }; @@ -37,87 +41,93 @@ axios.interceptors.request.use( // Add a response interceptor axios.interceptors.response.use( async (res) => { - store.commit('storm/setSpinning', false); - const { code, msg, data } = res.data; - if (code === 200) { - return res.data; - } else if (code === 401) { - localStorage.setItem('anyringToken', null); - let [err, data] = await store.dispatch('storm/toLogin', { - padNo: store.state.storm.padNo, - }); - let token = data.access_token; - const config = res.config; - let reTry = config.reTry + 1; - let cfg = Object.assign({}, config); - cfg.reTry = reTry; - cfg.headers['Authorization'] = `Bearer ${token}`; - // console.log('token222: ', token); - let resNew; - if (reTry < 3 && token) { - resNew = await axios(cfg); + store.commit('storm/setSpinning', false); + const { + code, + msg, + data + } = res.data; + if (code === 200) { + return res.data; + } else if (code === 401) { + router.replace('/login') + return Promise.resolve(res.data); + // localStorage.setItem('anyringToken', null); + // let [err, data] = await store.dispatch('storm/toLogin', { + // padNo: store.state.storm.padNo, + // }); + // let token = data.access_token; + // const config = res.config; + // let reTry = config.reTry + 1; + // let cfg = Object.assign({}, config); + // cfg.reTry = reTry; + // cfg.headers['Authorization'] = `Bearer ${token}`; + // // console.log('token222: ', token); + // let resNew; + // if (reTry < 3 && token) { + // resNew = await axios(cfg); + // } + // return Promise.resolve(resNew || res.data); + } else { + message.error(msg || '请求发生错误'); + return Promise.resolve(res.data); } - return Promise.resolve(resNew || res.data); - } else { - message.error(msg || '请求发生错误'); - return Promise.resolve(res.data); - } - }, - (error) => { - //异常关闭loading - store.commit('storm/setSpinning', false); - // Do something with response error - if (error && error.response) { - switch (error.response.status) { - case 400: - error.message = '请求错误'; - break; - case 401: - error.message = ''; - // executeSkip(); - break; - case 403: - error.message = '拒绝访问'; - break; - case 404: - error.message = '请求出错'; - break; - case 408: - error.message = '请求超时'; - break; - case 500: - error.message = '请求错误,请稍后重试'; - //设置响应后加载状态 - break; - case 501: - error.message = '服务未实现'; - break; - case 502: - error.message = '网络错误'; - break; - case 503: - error.message = '服务不可用'; - break; - case 504: - error.message = '网络超时'; - break; - case 505: - error.message = 'HTTP版本不受支持'; - break; - default: - error.message = '连接出错'; + }, + (error) => { + //异常关闭loading + store.commit('storm/setSpinning', false); + // Do something with response error + if (error && error.response) { + switch (error.response.status) { + case 400: + error.message = '请求错误'; + break; + case 401: + error.message = ''; + // executeSkip(); + break; + case 403: + error.message = '拒绝访问'; + break; + case 404: + error.message = '请求出错'; + break; + case 408: + error.message = '请求超时'; + break; + case 500: + error.message = '请求错误,请稍后重试'; + //设置响应后加载状态 + break; + case 501: + error.message = '服务未实现'; + break; + case 502: + error.message = '网络错误'; + break; + case 503: + error.message = '服务不可用'; + break; + case 504: + error.message = '网络超时'; + break; + case 505: + error.message = 'HTTP版本不受支持'; + break; + default: + error.message = '连接出错'; + } + } else { + error.message = '网络异常,请稍后重试'; } - } else { - error.message = '网络异常,请稍后重试'; - } - if (error.message) { - message.error(error.message); + if (error.message) { + message.error(error.message); + } + return Promise.reject(error); } - return Promise.reject(error); - } ); -Plugin.install = function (Vue) { +Plugin.install = function(Vue) { Vue.axios = _axios; window.axios = _axios; Object.defineProperties(Vue.prototype, { @@ -141,4 +151,4 @@ Plugin.install = function (Vue) { Vue.use(Plugin); -export default Plugin; +export default Plugin; \ No newline at end of file diff --git a/src/config/code.js b/src/config/code.js index be429dd..3e8f253 100644 --- a/src/config/code.js +++ b/src/config/code.js @@ -918,90 +918,90 @@ export const AID_CODE = { }; // 静脉溶栓 export const JMRS_CODE = { - 'JMRS-Y': { - text: '是否进行静脉溶栓', - type: 'radio', - default: '', - range: { - 是: '是', - 否: '否', - }, - }, - 'JMRS-WRSYY': { - text: '未溶栓原因', - type: 'checkbox', - default: [''], - range: ['超时间创', '禁忌症', '患者/家属拒绝', '其他'], - showType: { - type: 'value', - code: 'JMRS-Y', - value: '否', - }, - }, - 'JMRS-WRSYY-ELSE': { - text: '', - type: 'input', - inputType: 'text', - default: '', - showType: { - type: 'valueInclude', - code: 'JMRS-WRSYY', - value: '其他', - }, - }, - 'JMRS-TH-TIME': { - text: '谈话开始时间', - type: 'datetime', - default: '', - valueType: 'string', - }, - 'JMRS-SIGN': { - text: '签署知情同意书', - type: 'modal', - rightText: '去签署', - rightArrow: true, - path: { - name: 'Informed', - }, - }, - 'JMRS-Q-NIHSS': { - text: 'NIHSS评分', - description: '', - type: 'pageText', - rightArrow: true, - default: '', - operate: 'collapse', - operateData: { - text: '溶栓开始前', - code: [ - 'JMRS-Q-NIHSS', - 'JMRS-Q-SYSTOLIC-PRESSURE', - 'JMRS-Q-DIASTOLIC-PRESSURE', - ], - }, - }, - 'JMRS-Q-SYSTOLIC-PRESSURE': { - text: '收缩压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: 'JMRS-Q-NIHSS', - }, - }, - 'JMRS-Q-DIASTOLIC-PRESSURE': { - text: '舒张压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: 'JMRS-Q-NIHSS', - }, - }, + // 'JMRS-Y': { + // text: '是否进行静脉溶栓', + // type: 'radio', + // default: '', + // range: { + // 是: '是', + // 否: '否', + // }, + // }, + // 'JMRS-WRSYY': { + // text: '未溶栓原因', + // type: 'checkbox', + // default: [''], + // range: ['超时间创', '禁忌症', '患者/家属拒绝', '其他'], + // showType: { + // type: 'value', + // code: 'JMRS-Y', + // value: '否', + // }, + // }, + // 'JMRS-WRSYY-ELSE': { + // text: '', + // type: 'input', + // inputType: 'text', + // default: '', + // showType: { + // type: 'valueInclude', + // code: 'JMRS-WRSYY', + // value: '其他', + // }, + // }, + // 'JMRS-TH-TIME': { + // text: '谈话开始时间', + // type: 'datetime', + // default: '', + // valueType: 'string', + // }, + // 'JMRS-SIGN': { + // text: '签署知情同意书', + // type: 'modal', + // rightText: '去签署', + // rightArrow: true, + // path: { + // name: 'Informed', + // }, + // }, + // 'JMRS-Q-NIHSS': { + // text: 'NIHSS评分', + // description: '', + // type: 'pageText', + // rightArrow: true, + // default: '', + // operate: 'collapse', + // operateData: { + // text: '溶栓开始前', + // code: [ + // 'JMRS-Q-NIHSS', + // 'JMRS-Q-SYSTOLIC-PRESSURE', + // 'JMRS-Q-DIASTOLIC-PRESSURE', + // ], + // }, + // }, + // 'JMRS-Q-SYSTOLIC-PRESSURE': { + // text: '收缩压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: 'JMRS-Q-NIHSS', + // }, + // }, + // 'JMRS-Q-DIASTOLIC-PRESSURE': { + // text: '舒张压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: 'JMRS-Q-NIHSS', + // }, + // }, 'JMRS-RSCS': { text: '开始静脉溶栓场所', type: 'select', @@ -1019,192 +1019,192 @@ export const JMRS_CODE = { default: '', valueType: 'string', }, - 'JMRS-RSYW': { - text: '静脉溶栓药物', - type: 'select', - range: { - 'rt-PA': 'rt-PA', - 尿激酶: '尿激酶', - 替奈普酶: '替奈普酶', - 瑞替普酶: '瑞替普酶', - 阿尼普酶: '阿尼普酶', - }, - default: 'rt-PA', - }, - 'JMRS-RSYW-ZL': { - text: 'rt-PA', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'value', - code: 'JMRS-RSYW', - value: 'rt-PA', - }, - }, - 'JMRS-TZJL': { - text: '团注剂量', - description: '(mg)', - type: 'input', - inputType: 'number', - default: '', - }, - 'JMRS-JDJL': { - text: '静滴剂量', - description: '(mg)', - type: 'input', - inputType: 'number', - default: '', - }, - 'JMRS-15-NIHSS': { - text: 'NIHSS评分', - description: '', - type: 'pageText', - rightArrow: true, - default: '', - operate: 'collapse', - operateData: { - text: '15min', - code: [ - 'JMRS-15-NIHSS', - 'JMRS-15-SYSTOLIC-PRESSURE', - 'JMRS-15-DIASTOLIC-PRESSURE', - ], - }, - }, - 'JMRS-15-SYSTOLIC-PRESSURE': { - text: '收缩压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '15min', - }, - }, - 'JMRS-15-DIASTOLIC-PRESSURE': { - text: '舒张压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '15min', - }, - }, - 'JMRS-30-NIHSS': { - text: 'NIHSS评分', - description: '', - type: 'pageText', - default: '', - operate: 'collapse', - operateData: { - text: '30min', - code: [ - 'JMRS-30-NIHSS', - 'JMRS-30-SYSTOLIC-PRESSURE', - 'JMRS-30-DIASTOLIC-PRESSURE', - ], - }, - }, - 'JMRS-30-SYSTOLIC-PRESSURE': { - text: '收缩压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '30min', - }, - }, - 'JMRS-30-DIASTOLIC-PRESSURE': { - text: '舒张压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '30min', - }, - }, - 'JMRS-45-NIHSS': { - text: 'NIHSS评分', - description: '', - type: 'pageText', - default: '', - operate: 'collapse', - operateData: { - text: '45min', - code: [ - 'JMRS-45-NIHSS', - 'JMRS-45-SYSTOLIC-PRESSURE', - 'JMRS-45-DIASTOLIC-PRESSURE', - ], - }, - }, - 'JMRS-45-SYSTOLIC-PRESSURE': { - text: '收缩压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '45min', - }, - }, - 'JMRS-45-DIASTOLIC-PRESSURE': { - text: '舒张压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '45min', - }, - }, - 'JMRS-60-NIHSS': { - text: 'NIHSS评分', - description: '', - type: 'pageText', - default: '', - operate: 'collapse', - operateData: { - text: '60min', - code: [ - 'JMRS-60-NIHSS', - 'JMRS-60-SYSTOLIC-PRESSURE', - 'JMRS-60-DIASTOLIC-PRESSURE', - ], - }, - }, - 'JMRS-60-SYSTOLIC-PRESSURE': { - text: '收缩压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '60min', - }, - }, - 'JMRS-60-DIASTOLIC-PRESSURE': { - text: '舒张压', - description: '(mmHg)', - type: 'input', - inputType: 'number', - default: '', - showType: { - type: 'collapse', - code: '60min', - }, - }, + // 'JMRS-RSYW': { + // text: '静脉溶栓药物', + // type: 'select', + // range: { + // 'rt-PA': 'rt-PA', + // 尿激酶: '尿激酶', + // 替奈普酶: '替奈普酶', + // 瑞替普酶: '瑞替普酶', + // 阿尼普酶: '阿尼普酶', + // }, + // default: 'rt-PA', + // }, + // 'JMRS-RSYW-ZL': { + // text: 'rt-PA', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'value', + // code: 'JMRS-RSYW', + // value: 'rt-PA', + // }, + // }, + // 'JMRS-TZJL': { + // text: '团注剂量', + // description: '(mg)', + // type: 'input', + // inputType: 'number', + // default: '', + // }, + // 'JMRS-JDJL': { + // text: '静滴剂量', + // description: '(mg)', + // type: 'input', + // inputType: 'number', + // default: '', + // }, + // 'JMRS-15-NIHSS': { + // text: 'NIHSS评分', + // description: '', + // type: 'pageText', + // rightArrow: true, + // default: '', + // operate: 'collapse', + // operateData: { + // text: '15min', + // code: [ + // 'JMRS-15-NIHSS', + // 'JMRS-15-SYSTOLIC-PRESSURE', + // 'JMRS-15-DIASTOLIC-PRESSURE', + // ], + // }, + // }, + // 'JMRS-15-SYSTOLIC-PRESSURE': { + // text: '收缩压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '15min', + // }, + // }, + // 'JMRS-15-DIASTOLIC-PRESSURE': { + // text: '舒张压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '15min', + // }, + // }, + // 'JMRS-30-NIHSS': { + // text: 'NIHSS评分', + // description: '', + // type: 'pageText', + // default: '', + // operate: 'collapse', + // operateData: { + // text: '30min', + // code: [ + // 'JMRS-30-NIHSS', + // 'JMRS-30-SYSTOLIC-PRESSURE', + // 'JMRS-30-DIASTOLIC-PRESSURE', + // ], + // }, + // }, + // 'JMRS-30-SYSTOLIC-PRESSURE': { + // text: '收缩压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '30min', + // }, + // }, + // 'JMRS-30-DIASTOLIC-PRESSURE': { + // text: '舒张压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '30min', + // }, + // }, + // 'JMRS-45-NIHSS': { + // text: 'NIHSS评分', + // description: '', + // type: 'pageText', + // default: '', + // operate: 'collapse', + // operateData: { + // text: '45min', + // code: [ + // 'JMRS-45-NIHSS', + // 'JMRS-45-SYSTOLIC-PRESSURE', + // 'JMRS-45-DIASTOLIC-PRESSURE', + // ], + // }, + // }, + // 'JMRS-45-SYSTOLIC-PRESSURE': { + // text: '收缩压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '45min', + // }, + // }, + // 'JMRS-45-DIASTOLIC-PRESSURE': { + // text: '舒张压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '45min', + // }, + // }, + // 'JMRS-60-NIHSS': { + // text: 'NIHSS评分', + // description: '', + // type: 'pageText', + // default: '', + // operate: 'collapse', + // operateData: { + // text: '60min', + // code: [ + // 'JMRS-60-NIHSS', + // 'JMRS-60-SYSTOLIC-PRESSURE', + // 'JMRS-60-DIASTOLIC-PRESSURE', + // ], + // }, + // }, + // 'JMRS-60-SYSTOLIC-PRESSURE': { + // text: '收缩压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '60min', + // }, + // }, + // 'JMRS-60-DIASTOLIC-PRESSURE': { + // text: '舒张压', + // description: '(mmHg)', + // type: 'input', + // inputType: 'number', + // default: '', + // showType: { + // type: 'collapse', + // code: '60min', + // }, + // }, }; // 血管内治疗 export const XGZL_CODE = { diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index b17a390..935e4e2 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -27,11 +27,12 @@
-
+
姓名: {{patientData.patientName || '-'}} 性别: - {{patientData.patientGender == 1 ? '女' : patientData.patientGender == 0 ? '男' : '-'}} + {{patientData.patientGender == 1 ? '女' : patientData.patientGender == 0 ? '男' : '-'}} 年龄: {{patientData.patientAge || '-'}} 证件号: @@ -46,7 +47,7 @@
- +
@@ -85,14 +86,14 @@
- +
@@ -103,7 +104,9 @@ mapMutations, mapState } from 'vuex'; - import { loginInfo } from 'api'; + import { + loginInfo + } from 'api'; import icon01 from '@/assets/images/slice/icon01.png' import icon01H from '@/assets/images/slice/icon01H.png' import icon02 from '@/assets/images/slice/icon02.png' @@ -159,7 +162,7 @@ vm.current_ = 0 if (to.fullPath != '/firstaid/patientList') { vm.$router.replace('/firstaid/patientList') - } + } } }); }, @@ -177,10 +180,13 @@ this.$router.replace(item.path) } }, + onClickPat(){ + this.$router.push('/firstaid/thrombolysis') + }, async showPersion() { this.visible = true; document.getElementById('globalLayoutContent').style.overflowY = 'hidden'; - if(!this.loginInfo){ + if (!this.loginInfo) { var res = await loginInfo(); this.loginInfo = res.data || {} } @@ -192,7 +198,7 @@ document.getElementById('globalLayoutContent').style.overflowY = 'auto'; this.current = this.current_ }, - logout(){ + logout() { this.$router.replace('/login') } } diff --git a/src/main.js b/src/main.js index cf27010..aac2f9b 100644 --- a/src/main.js +++ b/src/main.js @@ -40,7 +40,16 @@ Vue.prototype.home = home; Vue.prototype.utils = util; router.beforeEach(async (to, from, next) => { - const { back, more } = to.meta; + let token = localStorage.getItem('anyringToken'); + console.log(to) + if (to.path != '/login' && !token) { + next('/login') + return + } + const { + back, + more + } = to.meta; store.commit('storm/setShowBack', back); store.commit('storm/setShowMore', more); //患者列表清楚定时器 @@ -48,7 +57,9 @@ router.beforeEach(async (to, from, next) => { util.AnimationFrame.done('timerTask'); util.AnimationFrame.done('countTask'); } - const { deviceNo } = to.query; + const { + deviceNo + } = to.query; if (deviceNo) { if (deviceNo !== localStorage.getItem('APP_DEVICE_NO')) { localStorage.setItem('anyringToken', null); @@ -61,8 +72,8 @@ router.beforeEach(async (to, from, next) => { next(); } }); -document.addEventListener('UniAppJSBridgeReady', function () { - uni.getEnv(function (res) { +document.addEventListener('UniAppJSBridgeReady', function() { + uni.getEnv(function(res) { console.log('当前环境:' + JSON.stringify(res)); }); new Vue({ @@ -70,4 +81,4 @@ document.addEventListener('UniAppJSBridgeReady', function () { store, render: (h) => h(App), }).$mount('#app'); -}); +}); \ No newline at end of file diff --git a/src/views/Patient/components/patient-create.vue b/src/views/Patient/components/patient-create.vue index 3583836..fc9bd89 100644 --- a/src/views/Patient/components/patient-create.vue +++ b/src/views/Patient/components/patient-create.vue @@ -14,7 +14,7 @@ :closable="false" :destroyOnClose="true" v-model="createVisible" - title="新建患者" + :title="title" @ok="handleSubmit" :footer="null" > @@ -30,12 +30,12 @@ - + - + - + @@ -67,10 +67,10 @@ @@ -118,7 +118,7 @@ - 新建 + 提交 取消 @@ -129,18 +129,19 @@ + + + diff --git a/src/views/thrombolysis/components/throm-ing.vue b/src/views/thrombolysis/components/throm-ing.vue index d023d3d..f045381 100644 --- a/src/views/thrombolysis/components/throm-ing.vue +++ b/src/views/thrombolysis/components/throm-ing.vue @@ -2,37 +2,41 @@
- - + - - - - - - + +
- - - - - - - - + + + + + + + + +