浏览代码

修改设备列表空字段报错

龙三郎 10 月之前
父节点
当前提交
3c10527fd1
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 5 5
      src/pages/device/list/Index.vue
  2. 2 2
      vite.config.ts

+ 5 - 5
src/pages/device/list/Index.vue

@@ -81,13 +81,13 @@
               </div>
             </div>
           </template>
-          <van-cell clickable :to="'/device/detail/'+item.mac">
+          <van-cell :clickable="true" :to="'/device/detail/'+item.mac">
             <div style="text-align: left;">
               <!-- 第一行 -->
               <div style="display: flex; justify-content: space-between; margin-bottom: 5px;">
                 <div style="font-weight: bold; color: #000;">
                   <span>住院号:</span>
-                  <span>{{ item.data.patientCode.value }}</span>
+                  <span>{{ item.data?.patientCode.value }}</span>
                   <!-- <span v-if="item.username" style="color: #000;">{{item.username}}</span>
                   <span v-else>未知用户</span> -->
                 </div>
@@ -121,7 +121,7 @@
               </div>
               <!-- 第四行 -->
               <div style="display: flex; justify-content: space-between;">
-                <div v-if="item.data.lat" style="display: flex; color: #000;" @click.stop="onLocation(item.mac)">
+                <div v-if="item.data?.lat" style="display: flex; color: #000;" @click.stop="onLocation(item.mac)">
                   <div>
                     <van-icon name="static/images/icon-location2.png" size="1.5rem" />
                   </div>
@@ -135,12 +135,12 @@
                   </div>
                   <div style="margin-left: 3px;">传输日志</div>
                 </div>
-                <!-- <div style="display: flex; color: #000;">
+                <div style="display: flex; color: #000;">
                   <div>
                     <van-icon name="static/images/icon-edit.png" size="1.5rem" />
                   </div>
                   <div style="margin-left: 3px;">编辑</div>
-                </div> -->
+                </div>
               </div>
               
             </div>

+ 2 - 2
vite.config.ts

@@ -27,8 +27,8 @@ export default defineConfig({
     open: true,
     proxy: {
       '/forward-service': {
-        target: 'http://192.168.103.33:8585/',
-        // target: 'http://192.168.100.115:8585/', // 生产环境
+        // target: 'http://192.168.103.33:8585/',
+        target: 'http://192.168.100.115:8585/', // 生产环境
         changeOrigin: true,
         rewrite: (path) => {
           // console.log('path', path)