Переглянути джерело

feature:合肥四院移动端调整

liuzhenlin 3 днів тому
батько
коміт
dce1f888c3
1 змінених файлів з 20 додано та 72 видалено
  1. 20 72
      src/view/home/index.vue

+ 20 - 72
src/view/home/index.vue

@@ -27,10 +27,10 @@
           <img src="../../assets/img/仪器预约.png" alt="" />
           <p>仪器预约</p>
         </li>
-        <li @click="onRouterPush('/entry')" v-auth="'h5-home-entry'">
+        <!-- <li @click="onRouterPush('/entry')" v-auth="'h5-home-entry'">
           <img src="../../assets/img/入室申请.png" alt="" />
           <p>入室管理</p>
-        </li>
+        </li> -->
         <!-- <li>
           <img src="../../assets/img/入室预约.png" alt="" />
           <p>入室预约</p>
@@ -39,14 +39,14 @@
           <img src="../../assets/img/技术委托.png" alt="" />
           <p>技术委托</p>
         </li> -->
-        <li @click="onRouterPush('/training')" v-auth="'h5-home-training'">
+        <!-- <li @click="onRouterPush('/training')" v-auth="'h5-home-training'">
           <img src="../../assets/img/培训考试.png" alt="" />
           <p>培训考试</p>
         </li>
         <li @click="onRouterPush('/my-cage')" v-auth="'h5-home-animal'">
           <img src="../../assets/img/动物笼位.png" alt="" />
           <p>动物笼位</p>
-        </li>
+        </li> -->
         <!-- <li v-auth="'h5-home-reagent'">
           <img src="../../assets/img/试剂耗材.png" alt="" />
           <p>试剂耗材</p>
@@ -59,24 +59,12 @@
           <img src="../../assets/img/更多应用.png" alt="" />
           <p>仪器报修</p>
         </li>
-        <li @click="onRouterPush('/lab/inspection/home')" v-if="userInfos.userRoles !== 'project_group_member'">
+        <!-- <li @click="onRouterPush('/lab/inspection/home')" v-if="userInfos.userRoles !== 'project_group_member'">
           <img src="../../assets/img/更多应用.png" alt="" />
           <p>巡检任务</p>
-        </li>
+        </li> -->
       </ul>
     </div>
-    <div class="swipe-con flex justify-between mt10">
-      <van-swipe class="my-swipe" :autoplay="5000" :show-indicators="false" vertical height="30">
-        <van-swipe-item v-for="item in noticeList" :key="item.id"
-          @click="onRouterPush('/notice/detail', { id: item.id })">
-          <div class="flex justify-between">
-            <span>{{ `【${item.noticeType === '10' ? '公告' : '通知'}】${item.noticeTitle}` }}</span>
-            <span class="time">{{ formatDate(new Date(item.noticeTime), 'YYYY-mm-dd') }}</span>
-          </div>
-        </van-swipe-item>
-      </van-swipe>
-      <a href="javascript:void(0);" @click="onRouterPush('/notice')">更多</a>
-    </div>
     <!-- <div class="card">
       <h4>
         审批流程
@@ -95,22 +83,19 @@
         </li>
       </ul>
     </div> -->
-    <div class="card mb20">
+    <div class="card mb20 mt10">
       <h4>
-        培训通知
-        <span class="link" @click="onRouterPush('/training')">全部培训>></span>
+        通知公告
+        <span class="link" @click="onRouterPush('/notice')">更多>></span>
       </h4>
       <ul class="approval">
-        <li v-for="item in trainingList" :key="item.id" @click="onRouterPush('/training/enroll', { state: item.id })">
+        <li v-for="item in noticeList" :key="item.id" @click="onRouterPush('/notice/detail', { id: item.id })">
           <div class="flex justify-between">
-            <div class="item-title">{{ item.title }}</div>
-            <van-tag v-if="item.status === '40'">已结束</van-tag>
-            <van-tag v-if="item.status !== '40' && item.applyStatus === '10'" type="warning">未报名</van-tag>
-            <van-tag v-else-if="item.status !== '40' && item.applyStatus === '20'" type="primary">已报名</van-tag>
+            <div class="item-title">{{ `【${item.noticeType === '10' ? '公告' : '通知'}】${item.noticeTitle}` }}</div>
           </div>
           <footer class="flex justify-between">
             <span>发布人:{{ item.createdName }}</span>
-            <span>{{ formatDate(new Date(item.startTime), 'YYYY-mm-dd') }}</span>
+            <span class="time">{{ formatDate(new Date(item.noticeTime), 'YYYY-mm-dd') }}</span>
           </footer>
         </li>
       </ul>
@@ -128,7 +113,6 @@ import { useDeptApi } from '/@/api/system/dept'
 import { useExecutionApi } from '/@/api/execution'
 import { useNewsApi } from '/@/api/system/news'
 import { useUserApi } from '/@/api/system/user'
-import { useTrainingApi } from '/@/api/training'
 import { useRouter } from 'vue-router'
 import { useUserInfo } from '/@/stores/userInfo'
 
@@ -140,10 +124,8 @@ const dictApi = useDictApi()
 const proApi = useProApi()
 const deptApi = useDeptApi()
 const executionApi = useExecutionApi()
-const trainingApi = useTrainingApi()
 const approvalList = ref<any[]>([])
 const noticeList = ref<any[]>([])
-const trainingList = ref<any[]>([])
 const userTypeList = ref(<RowDicDataType[]>[])
 const userSexList = ref(<RowDicDataType[]>[])
 const userCertList = ref(<RowDicDataType[]>[])
@@ -180,14 +162,10 @@ const getApprovalList = async () => {
   approvalList.value = res?.data?.list || []
 }
 const getNotice = async () => {
-  const [err, res]: ToResponse = await to(newsApi.getNoticeList())
-  if (err) return
-  noticeList.value = res?.data?.list || []
-}
-const getTrainingList = async () => {
-  const [err, res]: ToResponse = await to(trainingApi.getListForUser({ pageNum: 1, pageSize: 3, isAll: "10" }))
+  const [err, res]: ToResponse = await to(newsApi.getNoticeList({ platformId: 1000103, pageNum: 1, pageSize: 10  }))
   if (err) return
-  trainingList.value = res?.data?.list || []
+  const list = res?.data?.list || []
+  noticeList.value = list.slice(0, 10)
 }
 const onSearch = () => { }
 const onRouterPush = (val: string, params?: any) => {
@@ -200,7 +178,6 @@ onMounted(() => {
   getDicts()
   getApprovalList()
   getNotice()
-  getTrainingList()
   useUserApi().updateUserWxInfo({
     wechatOpenId: localStorage.getItem('openId'),
     wechatUnionId: localStorage.getItem('unionId')
@@ -282,6 +259,11 @@ onMounted(() => {
         margin-left: auto;
       }
 
+      .link {
+        cursor: pointer;
+        color: #3c78e3;
+      }
+
       &::before {
         display: inline-block;
         content: '';
@@ -350,39 +332,5 @@ onMounted(() => {
       }
     }
   }
-
-  .swipe-con {
-    display: flex;
-
-    .my-swipe {
-      flex: 1;
-      height: 30px !important;
-      line-height: 30px !important;
-
-      :deep(.flex) {
-        height: 30px;
-        overflow: hidden;
-
-        span {
-          display: inline-block;
-          height: 30px;
-          line-height: 30px;
-        }
-
-        span:first-child {
-          flex: 1;
-          white-space: nowrap;
-          overflow: hidden;
-          text-overflow: ellipsis;
-        }
-      }
-    }
-
-    >a {
-      flex: 0 0 28px;
-      margin-left: 4px;
-      color: #3c78e3;
-    }
-  }
 }
 </style>