xiaochan 1 anno fa
parent
commit
0c9a8dfc62

+ 35 - 4
src/components/system/password-layer/PasswordLayer.vue

@@ -6,7 +6,7 @@
              :close-on-press-escape="false"
              :show-close="false"
              @closed="closeLayout"
-             width="360px">
+             width="460px">
 
     <div v-if="!closable" style="margin-bottom: 12px; margin-top: -8px">
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@@ -18,8 +18,13 @@
       <el-form-item label="原密码:" prop="old">
         <el-input v-model="form.old" placeholder="请输入原密码" class="security"></el-input>
       </el-form-item>
-      <el-form-item label="新密码:" prop="new">
-        <el-input v-model="form.new" placeholder="至少8位,包含大小写字母和数字" class="security"></el-input>
+      <el-form-item :label="`新密码:${form.new.length}位`" prop="new">
+        <el-input v-model.trim="form.new" placeholder="至少8位,包含大小写字母和数字" class="security"
+                  show-word-limit></el-input>
+      </el-form-item>
+      <el-form-item :label="`再次确认:${form.newConfirm.length}位`" prop="newConfirm">
+        <el-input v-model.trim="form.newConfirm" placeholder="至少8位,包含大小写字母和数字" class="security"
+                  show-word-limit></el-input>
       </el-form-item>
     </el-form>
     <template #footer>
@@ -58,13 +63,39 @@ const form = ref({
   name: '',
   old: '',
   new: '',
+  newConfirm: ''
 })
+
+function checkPasswordNew(rule, value, callback) {
+  if (value !== form.value.new) {
+    callback(new Error('新老密码不一致'))
+  }
+  callback()
+}
+
 const rules = {
   old: [{required: true, message: '请输入原密码', trigger: 'blur'}],
-  new: [{required: true, message: '请输入新密码', trigger: 'blur'}],
+  new: [{required: true, message: '请输入新密码', trigger: 'blur'},
+    {
+      validator: function (rule, value, callback) {
+        if (/[\u4E00-\u9FA5]/g.test(value)) {
+          callback(new Error("请输入英文"));
+        } else {
+          //校验通过
+          callback();
+        }
+      },
+      trigger: "blur"
+    }
+  ],
+  newConfirm: [
+    {required: true, message: '请输入新密码', trigger: 'blur'},
+    {validator: checkPasswordNew, trigger: 'change'}
+  ]
 }
 
 const needRedirect = ref(false)
+
 function submit() {
   if (ruleForm.value) {
     ruleForm.value.validate((valid) => {

+ 3 - 3
src/components/system/password-layer/index.ts

@@ -1,9 +1,9 @@
+// @ts-ignore
 import PasswordLayer from './PasswordLayer.vue'
-import {render} from "vue";
-import {createVNode} from "vue";
+import {render, createVNode} from "vue";
 
 const changePassword = (closable: boolean = true) => {
-    return new Promise((resolve,reject) => {
+    return new Promise((resolve, reject) => {
         const div = document.createElement('div')
         document.body.appendChild(div)
 

+ 4 - 4
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrAuxiliaryTools.vue

@@ -86,7 +86,6 @@ const drawer = ref(false)
 
 const toFillInData = (data) => {
   emits('toFillInData', data)
-  close()
 }
 
 const index = ref(-1)
@@ -127,7 +126,8 @@ function openWindow() {
 const propsPatientInfo = computed(() => {
   return {
     patNo: patInfo.value.inpatientNo,
-    times: patInfo.value.admissTimes
+    times: patInfo.value.admissTimes,
+    onClose: close
   }
 })
 
@@ -191,12 +191,12 @@ const drawerRange: {
     {
       name: '检查',
       comp: () => {
-        return h(EmrInspect, {...propsPatientInfo.value, onClose: close})
+        return h(EmrInspect, {...propsPatientInfo.value})
       }
     }, {
       name: '检验',
       comp: () => {
-        return h(EmrTestV2, {...propsPatientInfo.value, onClose: close, isEmr: true})
+        return h(EmrTestV2, {...propsPatientInfo.value, isEmr: true})
       }
     },
     {

+ 7 - 3
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrGroupConsultation.vue

@@ -50,7 +50,7 @@
   </div>
 </template>
 
-<script setup>
+<script setup lang="ts">
 // 电子病历 查询会诊
 import {chaKanHuiZhenShenQing} from "@/api/case-front-sheet";
 import {getHuanZheXinXi} from "@/api/case-front-sheet/jie-shou-hui-zhen";
@@ -59,15 +59,19 @@ import {
   copyEnum,
   setEmrCopy
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
-import {xcMessage} from "@/utils/xiaochan-element-plus";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 import XEUtils from 'xe-utils'
+import {onMounted, ref} from 'vue'
 
 const props = defineProps({
   patNo: String,
   times: Number
 })
 
+const emits = defineEmits<{
+  (e: "close"): void
+}>()
+
 const rightData = ref([])
 
 const hzData = ref({})
@@ -102,7 +106,7 @@ const copyClick = () => {
     '会诊时间': temp.hzDate
   }
   setEmrCopy(copyEnum.会诊, data)
-  xcMessage.success('复制成功。')
+  emits('close')
 }
 
 const formatTime = ({cellValue}) => {

+ 7 - 3
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOperation.vue

@@ -26,17 +26,20 @@
   </div>
 </template>
 
-<script setup>
+<script setup lang="ts">
 import XEUtils from 'xe-utils'
 import {getOpRecord, getSurgeryDetail} from "@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing";
+import {onMounted, ref} from 'vue'
 
 const {patNo, times} = defineProps({
   patNo: String,
   times: Number,
-
 })
 
-const emits = defineEmits(['to-fill-in-data'])
+const emits = defineEmits<{
+  (e: "close"): void,
+  (e: 'to-fill-in-data', data: any): void
+}>()
 
 const paddingClick = async (row) => {
   const res = await getSurgeryDetail(row.inpatientNo, row.admissTimes, row.recordId)
@@ -57,6 +60,7 @@ const paddingClick = async (row) => {
   }
 
   emits('to-fill-in-data', data)
+  emits('close')
 }
 
 const toArray = (code, name) => {

+ 10 - 5
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrOrderList.vue

@@ -12,7 +12,8 @@
       <el-option :value="3" label="当前"/>
       <el-option :value="4" label="今日"/>
     </el-select>
-    <el-button @click="copyClick">复制值</el-button>
+    <el-button @click="copyClick(false)">复制值</el-button>
+    <el-button @click="copyClick(true)">引用</el-button>
   </div>
 
   <div style="height: 95%">
@@ -68,7 +69,7 @@
   </div>
 </template>
 
-<script setup name='EmrOrderList' lang="tsx">
+<script setup lang="tsx">
 import {computed, Ref, ref, onMounted} from "vue";
 import {
   huoQuYiZhuShuJu
@@ -87,6 +88,10 @@ const props = defineProps({
   inTheHospital: Boolean,
 })
 
+const emits = defineEmits<{
+  (e: "close"): void
+}>()
+
 const list: Ref<Array<any>> = ref([])
 const radio = ref(1)
 const orderType = ref(3)
@@ -133,7 +138,7 @@ const open = () => {
   })
 }
 
-const copyClick = () => {
+const copyClick = (quote) => {
   let tempData = tableRef.value.getCheckboxRecords(true)
   let str = ''
   if (tempData.length > 0) {
@@ -159,8 +164,8 @@ const copyClick = () => {
       }
       str += i + 1 === tempData.length ? '。' : '、';
     }
-    emrCopyFunc(str)
-
+    emrCopyFunc(str, quote)
+    emits('close')
   } else {
     xcMessage.error('请先选择医嘱。')
   }

+ 4 - 3
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2/EmrTestV2.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import {nextTick, onMounted, ref} from "vue";
+import {nextTick, onMounted, Ref, ref} from "vue";
 import {
   getDetail,
   getNormal,
@@ -40,7 +40,7 @@ const {height: queryHeight} = useElementSize(queryDivHeight)
 const emits = defineEmits(['close'])
 const dateRange = ref<string[]>([])
 const sidebarData = ref<SidebarData[]>([])
-const inspectionHeader = ref<InspectionHeader>({
+const inspectionHeader: Ref<InspectionHeader> = ref({
   aply_cntn: "",
   aply_date: "",
   audt_time: "",
@@ -219,7 +219,8 @@ onMounted(async () => {
                 复制
               </el-button>
               <el-button v-if="props.isEmr" @click="copyAndPaste(true)" type="primary"
-                         v-title="'和复制功能一样,只是多一步直接粘贴'">粘贴
+                         v-title="'和复制功能一样,只是多一步直接粘贴'">
+                引用
               </el-button>
             </el-button-group>
           </div>

+ 24 - 8
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrYzTemperature.vue

@@ -12,13 +12,18 @@
   <div style="height: 90%">
     <el-auto-resizer>
       <template #default="{ height, width }">
-        <div style="height: 40px; ">
-          <el-date-picker v-model="dateRange"
-                          type="daterange"
-                          format="YYYY-MM-DD"
-                          value-format="YYYY-MM-DD"
-                          :shortcuts="shortcuts"/>
-          <el-button @click="query">查询</el-button>
+        <div style="height: 40px; display: flex;align-items: center ">
+          <div>
+            <el-date-picker v-model="dateRange"
+                            type="daterange"
+                            format="YYYY-MM-DD"
+                            value-format="YYYY-MM-DD"
+                            :shortcuts="shortcuts"/>
+          </div>
+          <div>
+            <el-button @click="query">查询</el-button>
+            <el-button @click="quoteClick" type="primary">引用</el-button>
+          </div>
         </div>
         <vxe-table :height="height - 40"
                    border
@@ -102,7 +107,7 @@
   </div>
 </template>
 
-<script setup name='EmrYzTemperature' lang="tsx">
+<script setup lang="tsx">
 import {Ref, ref, onMounted} from "vue";
 import {getYzTemperature} from "@/api/zhu-yuan-yi-sheng/emr-patient";
 import {stringIsBlank} from '@/utils/blank-utils';
@@ -111,6 +116,7 @@ import {shortcuts} from '@/data/shortcuts'
 import {getServerDateApi} from "@/api/public-api";
 import moment from "moment";
 import {getFormatDatetime, currentAndAFewDaysAgo} from '@/utils/date'
+import {emrCopyFunc} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 
 
 const props = defineProps({
@@ -118,6 +124,10 @@ const props = defineProps({
   times: Number
 })
 
+const emits = defineEmits<{
+  (e: "close"): void
+}>()
+
 const dateRange = ref([])
 
 
@@ -217,6 +227,12 @@ const rowClick = ({row}) => {
   }
   otherInfo.value = str
 }
+
+function quoteClick() {
+  emrCopyFunc(otherInfo.value, true)
+  emits('close')
+}
+
 const query = () => {
 
   let param = {

+ 35 - 26
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -152,28 +152,31 @@
       <EmrStyleBar ref="styleBarRef"/>
       <div class="emr-iframe">
         <div :id="emrTutorialGetId('editor_tabs')">
+          <!--           @click="showIframe  = 1" :type="btnIframeTabs(IframeTabs.正在编辑 , showIframe)"-->
           <el-button :id="emrTutorialGetId('editor1')"
-                     @click="showIframe  = 1" :type="showIframe === 1 ? 'primary' : ''">正在编辑
+                     v-iframe-tabs="IframeTabs.正在编辑">
+            正在编辑
           </el-button>
           <el-button :id="emrTutorialGetId('editor2')"
                      @click="showIframe  = 2"
-                     :type="showIframe === 2? 'primary' : ''">
+                     v-iframe-tabs="IframeTabs.已保存病历"
+                     :type="btnIframeTabs(IframeTabs.已保存病历 , showIframe)">
             已保存病历
           </el-button>
-          <el-button :id="emrTutorialGetId('editor3')" @click="showIframe  = 3"
-                     :type="showIframe === 3? 'primary' : ''">同时打开
+          <el-button :id="emrTutorialGetId('editor3')" v-iframe-tabs="IframeTabs.同时打开">
+            同时打开
           </el-button>
-          <el-button :id="emrTutorialGetId('editor4')" @click="showIframe  = 4"
-                     :type="showIframe === 4? 'primary' : ''">病案首页
+          <el-button :id="emrTutorialGetId('editor4')" v-iframe-tabs="IframeTabs.病案首页">
+            病案首页
           </el-button>
-          <el-button :id="emrTutorialGetId('editor5')" @click="showIframe  = 5"
-                     :type="showIframe === 5? 'primary' : ''">审核
+          <el-button :id="emrTutorialGetId('editor5')" v-iframe-tabs="IframeTabs.审核">
+            审核
           </el-button>
         </div>
         <div style="display: flex;width: 100%"
              :id="emrTutorialGetId('editor')">
           <div :style="emrMainWidth()"
-               v-show="showIframe === 1 || showIframe === 3 || showIframe === 5">
+               v-show="showIframeIsList(IframeTabs.正在编辑 , IframeTabs.同时打开, IframeTabs.审核)">
             <div style="position: relative">
               <emr-popup ref="popupRef"
                          @fill-data="popupFunc.fillData"/>
@@ -209,16 +212,16 @@
             </div>
           </div>
 
-          <div v-show="showIframe === 5" style="width: 40%;">
+          <div v-show="showIframeIsList(IframeTabs.审核)" style="width: 40%;">
             <emr-audit/>
           </div>
 
-          <div :style="{width: showIframe === 3 ? '50%' : '100%',height :iframeHeight()}"
+          <div :style="{width:showIframeIsList(IframeTabs.同时打开)  ? '50%' : '100%',height :iframeHeight()}"
                ref="hisSaveEmrDivRef"
-               v-show="showIframe === 2 || showIframe === 3">
+               v-show="showIframeIsList(IframeTabs.已保存病历 , IframeTabs.同时打开)">
           </div>
 
-          <div v-show="showIframe === 4"
+          <div v-show="showIframeIsList(IframeTabs.病案首页)"
                style="width: 100%;overflow-y:auto"
                :style="{height : iframeHeight() }">
             <!--             病案首页           -->
@@ -298,12 +301,20 @@
 <script setup lang="ts">
 import EmrSidebar from "@/components/zhu-yuan-yi-sheng/emr/emr-template/EmrSidebar.vue";
 import {
+  btnIframeTabs,
   copyEnum,
   delEmrCopy,
   emrConfig,
-  emrMitt, EmrParam,
-  getEmrCopy, loadingTime, parsingDataElements, patientInfo,
-  query
+  emrMitt,
+  EmrParam,
+  getEmrCopy,
+  IframeTabs,
+  loadingTime,
+  parsingDataElements,
+  patientInfo,
+  query,
+  vIframeTabs,
+  showIframe, showIframeIsList
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 import {ElInput, ElMessage, ElMessageBox} from "element-plus";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
@@ -318,7 +329,7 @@ import {
   hotSearchSorting,
   submitMedicalRecord
 } from "@/api/zhu-yuan-yi-sheng/emr-patient";
-import {useDocumentVisibility, useElementSize} from "@vueuse/core";
+import {MaybeComputedElementRef, useDocumentVisibility, useElementSize} from "@vueuse/core";
 import XcDialogV2 from "@/components/xiao-chan/dialog/XcDialogV2.vue";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
 import HistoricalEmr from "@/components/zhu-yuan-yi-sheng/emr/HistoricalEmr.vue";
@@ -473,12 +484,12 @@ const getId = () => {
 }
 
 const emrMainWidth = () => {
-  if (showIframe.value === 3) {
+  if (showIframeIsList(IframeTabs.同时打开)) {
     return {
       width: '50%'
     }
   }
-  if (showIframe.value === 5) {
+  if (showIframeIsList(IframeTabs.审核)) {
     return {
       width: '60%'
     }
@@ -1546,7 +1557,6 @@ const queryHistoryFunc = () => {
   })
 }
 
-const showIframe = ref(1)
 const visibility = useDocumentVisibility()
 
 // 创建和编辑病历
@@ -1630,8 +1640,8 @@ const restoreDefaultSettings = () => {
 const loadDocument = (param: EmrParam): Promise<void> => {
   return new Promise((resolve, reject) => {
     const {loadDocument: load} = editMain
-    if (!(showIframe.value === 1 || showIframe.value == 3)) {
-      showIframe.value = 1
+    if (!(showIframeIsList(IframeTabs.正在编辑, IframeTabs.同时打开))) {
+      showIframe.value = IframeTabs.正在编辑
     }
     if (emrConfig.value.loadDocument) {
       resolve()
@@ -1682,9 +1692,9 @@ const emrMittInit = () => {
   })
   emrMitt.on('只读病历', (id: string) => {
     if (getId()) {
-      showIframe.value = 3
+      showIframe.value = IframeTabs.同时打开
     } else {
-      showIframe.value = 2
+      showIframe.value = IframeTabs.已保存病历
     }
     hisSaveEmr.loadDocument({documentId: id}).then(res => {
       hisSaveEmr.editor.setDocument(res, true);
@@ -1916,7 +1926,7 @@ const outlineData = ref<Outline[]>([])
 const outlineRef = ref<{
   changeElementById: (id: string) => void
 }>()
-const fragmentOrOutlineRef = ref<HTMLDivElement>()
+const fragmentOrOutlineRef = ref<MaybeComputedElementRef>()
 const {height: fragmentOrOutlineHeight} = useElementSize(fragmentOrOutlineRef)
 
 function fragmentOrOutlineActivationClassName(val: number) {
@@ -1972,7 +1982,6 @@ defineExpose({
   closeWebSocket,
   changeClear
 })
-
 </script>
 
 <style scoped lang="scss">

+ 2 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrAudit.vue

@@ -132,7 +132,7 @@
 <script setup lang="ts">
 import {
   Audit,
-  emrMitt,
+  emrMitt, IframeTabs,
   patientInfo
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 import {
@@ -280,7 +280,7 @@ const queryAudit = (val: Audit) => {
     }
 
     if (tempList.length > 0) {
-      emrMitt.emit('setShowIframe', 5);
+      emrMitt.emit('setShowIframe', IframeTabs.审核);
     }
 
     if (!permissions()) {

+ 47 - 9
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init.ts

@@ -93,16 +93,23 @@ export const copyEnum = {
     "会诊": 'huizhenjilv'
 }
 
-export function emrCopyFunc(str) {
-    let copyData = {
-        content: [{type: 'text', str}],
-        plainText: str,
+export function emrCopyFunc(str: string, quote: boolean = false) {
+    if (quote) {
+        const edit = emrMitt.emit('editor')
+        edit.execute('insertContents', {
+            value: [{type: 'text', data: str}]
+        })
+    } else {
+        let copyData = {
+            content: [{type: 'text', data: str}],
+            plainText: str,
+        }
+        window.localStorage.setItem(
+            "clipBoardData",
+            JSON.stringify(copyData)
+        )
+        xcMessage.success('复制成功')
     }
-    window.localStorage.setItem(
-        "clipBoardData",
-        JSON.stringify(copyData)
-    )
-    xcMessage.success('复制成功')
 }
 
 /**
@@ -465,3 +472,34 @@ export function parsingDataElements(data: any, name: string, codeName: string |
     return null
 }
 
+export enum IframeTabs {
+    "正在编辑",
+    "已保存病历",
+    "同时打开",
+    "病案首页",
+    "审核",
+}
+
+export function btnIframeTabs(tabs: IframeTabs, current: number): "default" | "primary" {
+    if (tabs === current) {
+        return 'primary'
+    }
+    return 'default'
+}
+
+export const showIframe = ref(IframeTabs.正在编辑)
+
+export const vIframeTabs = {
+    mounted: (el: HTMLHtmlElement, binding, vnode, prevVnod) => {
+        el.addEventListener('click', () => {
+            showIframe.value = binding.value
+        })
+    },
+    updated: (el, binding, vnode, prevVnod) => {
+        vnode.ref.i.props.type = showIframe.value === binding.value ? 'primary' : 'default'
+    },
+}
+
+export function showIframeIsList(...val: number[]) {
+    return val.includes(showIframe.value)
+}

+ 6 - 1
src/views/system/login.vue

@@ -43,7 +43,7 @@ import {useRoute, useRouter} from 'vue-router'
 import {addRoutes} from '@/router'
 import {ElMessage} from 'element-plus'
 import {closeWebSocket} from '@/utils/websocket'
-import {SYSTEM_CONFIG} from '@/utils/public'
+import {isDev, SYSTEM_CONFIG} from '@/utils/public'
 import changePassword, {checkPasswordStrength} from "@/components/system/password-layer";
 
 const store = useStore()
@@ -79,6 +79,11 @@ const submit = () => {
       password: form.password,
     }
     store.dispatch('user/login', params).then(() => {
+      // if (isDev) {
+      //   addRoutes();
+      //   router.push(route.query.redirect || '/')
+      //   return
+      // }
       if (!checkPasswordStrength(params.password)) {
         changePassword(false).then(newPassword => {
           form.password = newPassword

+ 0 - 4
vite.config.js

@@ -1,5 +1,4 @@
 import {defineConfig} from 'vite'
-import legacy from '@vitejs/plugin-legacy'
 import vue from '@vitejs/plugin-vue'
 import {resolve} from 'path'
 // vue setup 的糖语法
@@ -38,9 +37,6 @@ export default defineConfig({
         vue({
             refTransform: true
         }),
-        legacy({
-            targets: 'chrome 49',
-        }),
         AutoImport({
             dts: 'src/auto-imports.d.ts',
             imports: ['vue']