diff --git a/src/components/360View/commonForm/optometryForm.vue b/src/components/360View/commonForm/optometryForm.vue
index 43410f0..8e8cee9 100644
--- a/src/components/360View/commonForm/optometryForm.vue
+++ b/src/components/360View/commonForm/optometryForm.vue
@@ -361,6 +361,12 @@ export default {
},
data() {
return {
+ ws: null, // 建立的连接
+ lockReconnect: false, // 是否真正建立连接
+ timeout: 28 * 1000, // 30秒一次心跳
+ timeoutObj: null, // 心跳心跳倒计时
+ serverTimeoutObj: null, // 心跳倒计时
+ timeoutnum: null, // 断开 重连倒计时
dataForm: {
patientId: '',
patientName: '',
@@ -414,12 +420,12 @@ export default {
type: ''
}, {
name: '3',
+ type: '',
a: '',
b: '',
c: '',
d: '',
- e: '',
- type: ''
+ e: ''
}, {
name: '4',
type: '',
@@ -506,7 +512,11 @@ export default {
immediate: true
}
},
+ destroyed() {
+ this.ws.close()
+ },
mounted() {
+ this.initWebSoket()
this.originTableData = JSON.parse(JSON.stringify(this.tableData))
this.getPatientData()
const shili = window.localStorage.getItem('shili') ? JSON.parse(window.localStorage.getItem('shili')) : []
@@ -557,19 +567,86 @@ export default {
this.$message.error(res.msg)
}
},
- queryData() {
- const ws = new WebSocket('ws://192.168.4.24:8036/xiangan-crf/websocket/0071')
- ws.onopen = function() {
+ reconnect() { // 重新连接
+ const that = this
+ if (that.lockReconnect) {
+ return
+ }
+ that.lockReconnect = true
+ // 没连接上会一直重连,设置延迟避免请求过多
+ that.timeoutnum && clearTimeout(that.timeoutnum)
+ that.timeoutnum = setTimeout(function() {
+ // 新连接
+ that.initWebSoket()
+ that.lockReconnect = false
+ }, 5000)
+ },
+ reset() { // 重置心跳
+ const that = this
+ // 清除时间
+ clearTimeout(that.timeoutObj)
+ clearTimeout(that.serverTimeoutObj)
+ // 重启心跳
+ that.start()
+ },
+ start() { // 开启心跳
+ const self = this
+ self.timeoutObj && clearTimeout(self.timeoutObj)
+ self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj)
+ self.timeoutObj = setTimeout(function() {
+ // 这里发送一个心跳,后端收到后,返回一个心跳消息,
+ if (self.ws.readyState == 1) { // 如果连接正常
+ self.ws.send('heartCheck')
+ } else { // 否则重连
+ self.reconnect()
+ }
+ self.serverTimeoutObj = setTimeout(function() {
+ // 超时关闭
+ self.ws.close()
+ }, self.timeout)
+ }, self.timeout)
+ },
+ initWebSoket() {
+ // wss://127.0.0.1:8030/data
+ // const url = 'ws://47.110.224.240:8036/xiangan-crf/websocket/0071'
+ // const url = 'ws://192.168.0.167:8036/xiangan-crf/websocket/0071'
+ const url = 'wss://127.0.0.1:8030/data'
+ console.log(123)
+ const self = this
+ this.ws = new WebSocket(url)
+ this.ws.onopen = function() {
console.log('连接成功')
+ self.start();
}
- ws.onerror = function() {
+ this.ws.onclose = function() {
+ console.log('连接关闭')
+ self.reconnect();
+ }
+ this.ws.onerror = function() {
console.log('连接失败')
+ self.reconnect();
}
- // ws.send()
- ws.onmessage = function(msg) {
- const data = JSON.parse(JSON.stringify(msg.data))
- // console.log(msg.data)
- console.log(data)
+ this.ws.onmessage = function(msg) {
+ console.log(msg)
+ const message = JSON.parse(msg.data)
+ // const message = JSON.parse(data.msgTxt)
+ console.log(message)
+ self.tableData.forEach(item => {
+ if (item.name == '3') {
+ item.a = message.RData.DS
+ item.b = message.RData.DC
+ item.c = message.RData.AXIS
+ item.d = message.RData.VA
+ item.e = message.RData.ADD
+ } else if (item.name == '4') {
+ item.a = message.LData.DS
+ item.b = message.LData.DC
+ item.c = message.LData.AXIS
+ item.d = message.LData.VA
+ item.e = message.LData.ADD
+ }
+ })
+ self.reset();
}
},
handleSaveTable() {
diff --git a/src/components/360View/forePart/index.vue b/src/components/360View/forePart/index.vue
index 70143d4..bb0ed5a 100644
--- a/src/components/360View/forePart/index.vue
+++ b/src/components/360View/forePart/index.vue
@@ -47,12 +47,12 @@
- 结膜:充血
+ 结膜:充血
- 结膜:分泌物
+ 结膜:分泌物
- 结膜:分泌物结膜:分泌物
{{ scope.row.name }}
- 视盘:视神经
+ 视盘:视神经
+
- 视盘:CDR
+ 视盘:CDR
+
@@ -52,10 +54,12 @@
{{ scope.row.name }}
- 视盘:视神经
+ 视盘:视神经
+
- 视盘:CDR
+ 视盘:CDR
+
diff --git a/src/components/progress-ods/index-all.vue b/src/components/progress-ods/index-all.vue
deleted file mode 100644
index 7b604ee..0000000
--- a/src/components/progress-ods/index-all.vue
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ item.name }}
- {{ yearSelect }}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/progress-ods/index.vue b/src/components/progress-ods/index.vue
deleted file mode 100644
index e927d86..0000000
--- a/src/components/progress-ods/index.vue
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/components/ranking-table/index.vue b/src/components/ranking-table/index.vue
deleted file mode 100644
index 0478869..0000000
--- a/src/components/ranking-table/index.vue
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/ren-dept-tree/index.js b/src/components/ren-dept-tree/index.js
deleted file mode 100644
index 7c7e8c8..0000000
--- a/src/components/ren-dept-tree/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import RenDeptTree from './src/ren-dept-tree'
-
-RenDeptTree.install = function(Vue) {
- Vue.component(RenDeptTree.name, RenDeptTree)
-}
-
-export default RenDeptTree
diff --git a/src/components/ren-dept-tree/src/ren-dept-tree.vue b/src/components/ren-dept-tree/src/ren-dept-tree.vue
deleted file mode 100644
index 1977758..0000000
--- a/src/components/ren-dept-tree/src/ren-dept-tree.vue
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('query') }}
-
-
-
-
- {{ $t('cancel') }}
- {{ $t('clear') }}
- {{ $t('confirm') }}
-
-
-
-
-
diff --git a/src/components/ren-radio-group/index.js b/src/components/ren-radio-group/index.js
deleted file mode 100644
index 20a1b37..0000000
--- a/src/components/ren-radio-group/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import RenRadioGroup from './src/ren-radio-group'
-
-RenRadioGroup.install = function(Vue) {
- Vue.component(RenRadioGroup.name, RenRadioGroup)
-}
-
-export default RenRadioGroup
diff --git a/src/components/ren-radio-group/src/ren-radio-group.vue b/src/components/ren-radio-group/src/ren-radio-group.vue
deleted file mode 100644
index 26e54b3..0000000
--- a/src/components/ren-radio-group/src/ren-radio-group.vue
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- {{ data.dictLabel }}
-
-
-
diff --git a/src/components/ren-region-tree/index.js b/src/components/ren-region-tree/index.js
deleted file mode 100644
index c957f14..0000000
--- a/src/components/ren-region-tree/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import RenRegionTree from './src/ren-region-tree'
-
-RenRegionTree.install = function(Vue) {
- Vue.component(RenRegionTree.name, RenRegionTree)
-}
-
-export default RenRegionTree
diff --git a/src/components/ren-region-tree/src/ren-region-tree.vue b/src/components/ren-region-tree/src/ren-region-tree.vue
deleted file mode 100644
index 03878d7..0000000
--- a/src/components/ren-region-tree/src/ren-region-tree.vue
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('query') }}
-
-
-
-
- {{ $t('cancel') }}
- {{ $t('clear') }}
- {{ $t('confirm') }}
-
-
-
-
-
-
diff --git a/src/components/ren-select/index.js b/src/components/ren-select/index.js
deleted file mode 100644
index bc09113..0000000
--- a/src/components/ren-select/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import RenSelect from './src/ren-select'
-
-RenSelect.install = function(Vue) {
- Vue.component(RenSelect.name, RenSelect)
-}
-
-export default RenSelect
diff --git a/src/components/ren-select/src/ren-select.vue b/src/components/ren-select/src/ren-select.vue
deleted file mode 100644
index ca2755c..0000000
--- a/src/components/ren-select/src/ren-select.vue
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- {{ data.dictLabel }}
-
-
-
diff --git a/src/components/searchContents/index.vue b/src/components/searchContents/index.vue
deleted file mode 100644
index f60ed4e..0000000
--- a/src/components/searchContents/index.vue
+++ /dev/null
@@ -1,404 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- {{ scope.row.register_patient.name | f_desensitize_name }}
-
-
-
-
-
- {{ scope.row.register_patient.sex | f_sex }}
-
-
-
-
-
- {{ scope.row.register_patient.birthday | f_getAge }}
-
-
-
-
-
- {{ scope.row.register_patient.patientIdNumber | f_desensitize_idNumber }}
-
-
-
-
-
-
-
-
-
- 查看详情
-
-
-
-
-
-
-
-
-
-
-
-
-
- 姓名:{{ scope.row.register_patient.name }}
- 性别:{{ scope.row.register_patient.sex }}
-
-
-
-
- 查看详情
-
-
-
-
-
- {{ item.examineItem }}
- {{ item.count + "次" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 引入受试者
-
-
-
-
-
-
-
-
- 身份证:
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/page-subspecialty/main.js b/src/page-subspecialty/main.js
index ba4c294..3ee427c 100644
--- a/src/page-subspecialty/main.js
+++ b/src/page-subspecialty/main.js
@@ -1,29 +1,22 @@
// system入口
import Vue from 'vue'
import Element from 'element-ui'
-// import 'lib-flexible/flexible'
import App from './App.vue'
import router from './router'
import store from './store'
import http from './utils/request'
-import jQuery from 'jquery'
import 'element-ui/lib/theme-chalk/index.css'
import '@/icons'
import '@/assets/scss/aui.scss'
import '@/assets/scss/reset.scss'
import i18n from '@/i18n'
import * as filters from '@/filters'
-import renRadioGroup from '@/components/ren-radio-group'
-import renDeptTree from '@/components/ren-dept-tree'
import { hasPermission, getDictLabel } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
-import 'xe-utils'
-import VXETable from 'vxe-table'
import 'vxe-table/lib/index.css'
// import echarts from 'echarts'
import * as echarts from 'echarts'
import moment from 'moment'
-import VueChatScroll from 'vue-chat-scroll'
// import jsNSV from '@/utils/js-NSV.js'
@@ -36,6 +29,8 @@ Vue.use(Print)
import { confirm } from '@/utils/confirm'
Vue.prototype.$confirmFun = confirm
+import jquery from 'jquery'
+Vue.prototype.$ = jquery
// import VueDragResize from 'vue-drag-resize'
// Vue.component('vue-drag-resize', VueDragResize)
@@ -43,15 +38,6 @@ Vue.prototype.$confirmFun = confirm
import VueCropper from 'vue-cropper'
Vue.use(VueCropper)
-import Recorder from 'js-audio-recorder'
-const recorder = new Recorder({
- sampleBits: 16, // 采样位数,支持 8 或 16,默认是16
- sampleRate: 16000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000
- numChannels: 1 // 声道,支持 1 或 2, 默认是1
-// compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false
-})
-Vue.prototype.$recorder = recorder
-
// 全局监听DOM元素
import ElementResizeDetectorMaker from 'element-resize-detector'
Vue.prototype.$erd = ElementResizeDetectorMaker()
@@ -70,12 +56,6 @@ Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
-// 全局组件
-Vue.use(renRadioGroup)
-Vue.use(renDeptTree)
-Vue.use(VueChatScroll)
-Vue.use(VXETable)
-
// DICOM
import cornerstone from 'cornerstone-core'
import cornerstoneMath from 'cornerstone-math'
@@ -100,7 +80,6 @@ Vue.prototype.$cornerstoneTools = cornerstoneTools
// 挂载全局
Vue.prototype.$http = http
-Vue.prototype.$ = jQuery
Vue.prototype.$hasPermission = hasPermission
Vue.prototype.$getDictLabel = getDictLabel
Vue.prototype.$moment = moment
diff --git a/src/page-subspecialty/router/index.js b/src/page-subspecialty/router/index.js
index c3db663..09cd834 100644
--- a/src/page-subspecialty/router/index.js
+++ b/src/page-subspecialty/router/index.js
@@ -104,23 +104,13 @@ export function addDynamicRoute(routeParams, router) {
title: `${routeParams.title}`
}
}
- const dynamicRoutes = [
+ router.addRoutes([
{
...moduleRoutes,
name: `main-dynamic__${dynamicRoute.name}`,
children: [dynamicRoute]
}
- ]
- dynamicRoutes.forEach(res => {
- router.addRoute(res)
- })
- // router.addRoutes([
- // {
- // ...moduleRoutes,
- // name: `main-dynamic__${dynamicRoute.name}`,
- // children: [dynamicRoute]
- // }
- // ])
+ ])
window.SITE_CONFIG['dynamicRoutes'].push(dynamicRoute)
router.push({ name: dynamicRoute.name, params: routeParams.params })
}
@@ -183,7 +173,7 @@ router.beforeEach((to, from, next) => {
}
// window.SITE_CONFIG['menuList'] = res.data
const menuListChild = res.data.filter(item => item.children.length > 0)
- // console.log(menuListChild)
+ // this.$store.commit('activeIndexFun', menuListChild[0].children[0].id)
fnAddDynamicMenuRoutes(JSON.parse(JSON.stringify(res.data)), menuListChild.length)
next({ ...to, replace: true })
@@ -272,7 +262,6 @@ function fnCurrentRouteIsPageRoute(route, pageRoutes = []) {
*/
function fnAddDynamicMenuRoutes(menuList = [], menuListChildLength, routes = []) {
let index = 0
- // console.log(menuList)
menuList.forEach((item, i) => {
// eslint-disable-next-line
let URL = (item.url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
@@ -307,33 +296,20 @@ function fnAddDynamicMenuRoutes(menuList = [], menuListChildLength, routes = [])
fnAddDynamicMenuRoutes(item.children)
}
})
- // routes = menuList
- // console.log(routes)
// 此处一定要加判断,因为此方法在递归,要等到递归完成后再执行下面的内容
// 坑!!!如果不加此判断,this.$route.matched面包屑的父级就不会展示
if (menuListChildLength === index) {
routes = menuList
// PH:底层调用一次
// 添加路由
- const dynamicRoutes = [
+ router.addRoutes([
{
...moduleRoutes,
name: 'main-dynamic-menu',
children: [...routes]
},
{ path: '*', redirect: { name: '404' }}
- ]
- dynamicRoutes.forEach(res => {
- router.addRoute(res)
- })
- // router.addRoutes([
- // {
- // ...moduleRoutes,
- // name: 'main-dynamic-menu',
- // children: [...routes]
- // },
- // { path: '*', redirect: { name: '404' }}
- // ])
+ ])
// console.log('----------------------')
window.SITE_CONFIG['dynamicMenuRoutes'] = routes
window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true
diff --git a/src/page-subspecialty/views/main-sidebar.vue b/src/page-subspecialty/views/main-sidebar.vue
index 24fbe2b..d527d54 100644
--- a/src/page-subspecialty/views/main-sidebar.vue
+++ b/src/page-subspecialty/views/main-sidebar.vue
@@ -39,8 +39,7 @@ export default {
wordData: {
user_name: 'XXX',
remark: ''
- },
- drgsName: window.localStorage.getItem('identity')
+ }
}
},
computed: {
@@ -55,7 +54,7 @@ export default {
},
created() {
const defauleActiveIndex = window.localStorage.getItem('defauleActiveIndex')
- ? window.localStorage.getItem('defauleActiveIndex') : window.SITE_CONFIG.menuList[0].id
+ ? window.localStorage.getItem('defauleActiveIndex') : window.SITE_CONFIG.menuList[0].children[0].id
setTimeout(() => {
this.$store.state.sidebarMenuList = window.SITE_CONFIG.menuList
}, 200)
@@ -73,7 +72,6 @@ export default {
// 读取并获得模板文件的二进制内容
JSZipUtils.getBinaryContent(docxsrc, function(error, content) {
// docxsrc是模板。我们在导出的时候,会根据此模板来导出对应的数据
- // 抛出异常
if (error) {
throw error
}
diff --git a/src/page-subspecialty/views/modules/optometryManagement/cornea/index.vue b/src/page-subspecialty/views/modules/optometryManagement/cornea/index.vue
index 340cee6..467c6d7 100644
--- a/src/page-subspecialty/views/modules/optometryManagement/cornea/index.vue
+++ b/src/page-subspecialty/views/modules/optometryManagement/cornea/index.vue
@@ -31,22 +31,13 @@
-
-
-
-
-
-
-
-
@@ -55,7 +46,7 @@
{{ scope.row.patientBirthday ? $options.filters.dateFilterTwo( scope.row.patientBirthday): '- ' }}
-
+
更新
- 填写
+
如需补充患者首诊记录信息请点击“填写”按钮
-
-
-
-
-
-
-
-
-
+
@@ -29,27 +21,15 @@
diff --git a/src/page-subspecialty/views/modules/optometryManagement/seeDoctor/historyRecord.vue b/src/page-subspecialty/views/modules/optometryManagement/seeDoctor/historyRecord.vue
index e35cbdf..f2280a2 100644
--- a/src/page-subspecialty/views/modules/optometryManagement/seeDoctor/historyRecord.vue
+++ b/src/page-subspecialty/views/modules/optometryManagement/seeDoctor/historyRecord.vue
@@ -35,7 +35,6 @@
-