Преглед на файлове

优化代码以及操作

DESKTOP-MINPJAU\Administrator преди 3 години
родител
ревизия
49e69b4d49
променени са 2 файла, в които са добавени 19 реда и са изтрити 9 реда
  1. 7 8
      src/components/xc/code/XcCode.vue
  2. 12 1
      src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TianJiaYiZhu.vue

+ 7 - 8
src/components/xc/code/XcCode.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div style="margin: 0 5px 0 5px">
       <span class="xc-code">
         {{ props.code }}
       </span>
@@ -7,7 +7,6 @@
       {{ props.description }}
     </strong>
   </div>
-
 </template>
 
 <script name="XcCode" setup>
@@ -30,15 +29,15 @@ div {
   display: inline-flex;
   justify-content: center;
   align-items: center;
-  line-height: 20px;
+  line-height: 10px;
 
   .xc-code {
-    background-color: #000;
+    background-color: hsl(0, 0%, 7%);
+    border-radius: 3px;
+    border: 1px solid hsl(0, 0%, 7%);
+    padding: 4px 5px;
+    font-weight: bold;
     color: white;
-    padding: 5px;
-    border-radius: 5px;
-    text-align: center;
-    margin: 3px;
   }
 
 

+ 12 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TianJiaYiZhu.vue

@@ -213,6 +213,7 @@
     </el-row>
   </el-form>
   <el-button icon="el-icon-plus" type="primary" @click="tianJiaYiZhu">添加</el-button>
+  <xc-code code="Alt+Enter" description="键盘添加"></xc-code>
   <el-button @click="dianJiXiuGaiZhiXingKeShi">修改执行科室</el-button>
   <el-table :data="yiZhuList" :height="windowSize.h / 2.4" @selection-change="dianJiXuanZhongShuJu">
     <el-table-column type="selection"></el-table-column>
@@ -763,6 +764,7 @@ const qingKong = () => {
 let daoJiShi = null
 
 onMounted(() => {
+  enableKeyboardMonitoring()
   yiZhuList.value = clone(fuZhiYiZhu.value)
   for (let i = 0; i < yiZhuList.value.length; i++) {
     yiZhuList.value[i].id = yiZhuList.value[i].actOrderNo
@@ -785,14 +787,23 @@ onMounted(() => {
     ]
   }
   fuZhiYiZhu.value = []
-
 })
 
 onUnmounted(() => {
   ElMessageBox.close()
   clearInterval(daoJiShi)
+  document.onkeydown = null
 })
 
+
+const enableKeyboardMonitoring = () => {
+  document.onkeydown = function (e) {
+    if (event.altKey && event.keyCode === 13) {
+      event.returnValue = false
+      tianJiaYiZhu()
+    }
+  }
+}
 // 倒计时功能
 const kaiQiDaoJiShi = () => {
   seconds.value = 600