|
@@ -536,7 +536,7 @@ const emrEvent = {
|
|
|
await editJudgment()
|
|
|
},
|
|
|
|
|
|
- 'contentchange': (event) => {
|
|
|
+ 'contentChange': (event) => {
|
|
|
if (!readonlyPattern()) {
|
|
|
// 如果是空的编辑器就不触发了
|
|
|
if (!emrRef.value.src.includes('/emr/runtime/#/editor')) {
|
|
@@ -1112,16 +1112,6 @@ const clickToSubmitTheMedicalRecord = async () => {
|
|
|
|
|
|
}
|
|
|
|
|
|
-const visibility = useDocumentVisibility()
|
|
|
-
|
|
|
-watch(() => visibility.value, () => {
|
|
|
- if (visibility.value === 'hidden' && isEditorChange) {
|
|
|
- document.title = `患者【${props.huanZheXinXi.name}】,未保存数据`
|
|
|
- } else {
|
|
|
- document.title = `电子病历-正在编辑【${props.huanZheXinXi.name}】`
|
|
|
- }
|
|
|
-}, {immediate: true})
|
|
|
-
|
|
|
/**
|
|
|
* 查询患者信息
|
|
|
* @returns {Promise<void>}
|
|
@@ -1407,6 +1397,9 @@ let interval = null
|
|
|
let intervalTime = 1000 * 60 * 5
|
|
|
const autoSaveChange = () => {
|
|
|
store.commit('app/setEmrAutosave', autoSave)
|
|
|
+ if (interval != null) {
|
|
|
+ clearInterval(interval)
|
|
|
+ }
|
|
|
if (autoSave) {
|
|
|
interval = setInterval(() => {
|
|
|
autoSaveFunc()
|
|
@@ -1478,9 +1471,10 @@ const openAndSaveTheMedicalRecord = (id) => {
|
|
|
const showIframe = ref(1)
|
|
|
const saveDocumentId = ref()
|
|
|
|
|
|
+const visibility = useDocumentVisibility()
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
autoSave = store.state.app.emrAutosave;
|
|
|
- autoSaveChange()
|
|
|
extractData = await getExtractDataElement(props.huanZheXinXi.inpatientNo, props.huanZheXinXi.admissTimes)
|
|
|
await nextTick()
|
|
|
emrSidebarRef.value.queryData()
|
|
@@ -1504,6 +1498,19 @@ onMounted(async () => {
|
|
|
})
|
|
|
autoSaveFunc()
|
|
|
|
|
|
+ watch(() => visibility.value, () => {
|
|
|
+ // 离开页面的时候清空定时器
|
|
|
+ if (visibility.value === 'hidden' && isEditorChange) {
|
|
|
+ if (interval != null) {
|
|
|
+ clearInterval(interval)
|
|
|
+ }
|
|
|
+ document.title = `患者【${props.huanZheXinXi.name}】,未保存数据`
|
|
|
+ } else {
|
|
|
+ autoSaveChange()
|
|
|
+ document.title = `电子病历-正在编辑【${props.huanZheXinXi.name}】`
|
|
|
+ }
|
|
|
+ }, {immediate: true})
|
|
|
+
|
|
|
})
|
|
|
|
|
|
onDeactivated(() => {
|