Quellcode durchsuchen

点名记录列表

Hwf vor 7 Monaten
Ursprung
Commit
e02882c799

BIN
src/assets/images/onlineRollCall/box10.png


BIN
src/assets/images/onlineRollCall/box11.png


BIN
src/assets/images/onlineRollCall/box12.png


BIN
src/assets/images/onlineRollCall/icon10.png


BIN
src/assets/images/onlineRollCall/icon6.png


BIN
src/assets/images/onlineRollCall/icon7.png


BIN
src/assets/images/onlineRollCall/icon8.png


BIN
src/assets/images/onlineRollCall/icon9.png


+ 2 - 2
src/components/DateRangePicker/index.vue

@@ -26,7 +26,7 @@
       </div>
     </div>
 
-    <van-popup v-model="isShowStartTime" position="bottom">
+    <van-popup v-model:show="isShowStartTime" round position="bottom">
       <van-date-picker
           v-model="startTime"
           :type="mode"
@@ -36,7 +36,7 @@
       />
     </van-popup>
 
-    <van-popup v-model="isShowEndTime" position="bottom">
+    <van-popup v-model:show="isShowEndTime" round position="bottom">
       <van-date-picker
           v-model="endTime"
           :type="mode"

+ 9 - 0
src/router/routes.ts

@@ -48,6 +48,15 @@ const routes: Array<RouteRecordRaw> = [
           noCache: true
         }
       },
+      {
+        path: "/rollCallDetails2",
+        name: "RollCallDetails2",
+        component: () => import("@/views/onlineRollCall/rollCallDetails2.vue"),
+        meta: {
+          title: "点名记录",
+          noCache: true
+        }
+      },
       // {
       //   path: "mobile_control2",
       //   name: "MobileControl2",

+ 3 - 4
src/views/event/index.vue

@@ -4,10 +4,9 @@
         v-model="queryParams.search_keyword"
         class="common-search"
         :left-icon="searchImg"
-        clearable
-        :clear-icon="closeImg"
+        :right-icon="closeImg"
         @search="on_search_keyword"
-        @cancel="on_search_cancel"
+        @click-right-icon.stop="on_search_cancel"
     />
 
     <van-dropdown-menu>
@@ -380,7 +379,7 @@ const handleCloseEvent = (item) => {
       height: 12px;
     }
   }
-  :deep(.van-field__clear) {
+  :deep(.van-field__right-icon) {
     width: 30px;
     height: 30px;
     padding: 0;

+ 27 - 1
src/views/leader/index.vue

@@ -9,6 +9,7 @@
             :right-icon="closeImg"
             placeholder="请输入搜索内容"
             @search="on_search_keyword"
+            @click-right-icon.stop="on_search_cancel"
         />
         <div v-show="showSearch" class="search-list">
           <van-list
@@ -16,7 +17,7 @@
               v-model:error="error"
               error-text="请求失败,点击重新加载"
               :finished="finished"
-              finished-text="没有更多事件了"
+              finished-text="没有更多了"
               :immediate-check="false"
               @load="getSearchList"
           >
@@ -181,6 +182,13 @@ const on_search_keyword = (val) => {
   queryParams.page = 0;
   getSearchList();
 }
+const on_search_cancel = () => {
+  showSearch.value = false;
+  queryParams.keywords = '';
+  queryParams.page = 0;
+  finished.value = false;
+  searchList.value = [];
+}
 const handleClickItem = (item) => {
   showSearch.value = false;
   queryParams.keywords = '';
@@ -360,4 +368,22 @@ onMounted(() => {
     border-bottom: 1px solid #eeeeee;
   }
 }
+.common-search {
+  :deep(.van-field__left-icon) {
+
+    .van-icon__image {
+      width: 12px;
+      height: 12px;
+    }
+  }
+  :deep(.van-field__right-icon) {
+    width: 30px;
+    height: 30px;
+    padding: 0;
+    .van-icon__image {
+      width: 30px;
+      height: 30px;
+    }
+  }
+}
 </style>

+ 20 - 2
src/views/mobileControl/SearchBtn.vue

@@ -10,14 +10,14 @@
             :right-icon="closeImg"
             placeholder="请输入搜索内容"
             @search="on_search_keyword"
-            @cancel="on_search_cancel"
+            @click-right-icon.stop="on_search_cancel"
         />
         <van-list
             v-model:loading="loading"
             v-model:error="error"
             error-text="请求失败,点击重新加载"
             :finished="finished"
-            finished-text="没有更多事件了"
+            finished-text="没有更多了"
             :immediate-check="false"
             @load="getList"
         >
@@ -131,4 +131,22 @@ const handleClickItem = (item) => {
   cursor: pointer;
   margin-bottom: 10px;
 }
+.common-search {
+  :deep(.van-field__left-icon) {
+
+    .van-icon__image {
+      width: 12px;
+      height: 12px;
+    }
+  }
+  :deep(.van-field__right-icon) {
+    width: 30px;
+    height: 30px;
+    padding: 0;
+    .van-icon__image {
+      width: 30px;
+      height: 30px;
+    }
+  }
+}
 </style>

+ 127 - 0
src/views/onlineRollCall/rollCallDetails2.vue

@@ -0,0 +1,127 @@
+<template>
+  <div class="container">
+    <div class="box1">
+      <div class="card1">
+        <div class="line1">
+          <i class="icon" />
+          <div class="text1">点名总次数</div>
+        </div>
+        <div class="line2">
+          <div class="text-blue">16</div>
+          <div class="text2">次</div>
+        </div>
+      </div>
+      <div class="card2">
+        <div class="line1">
+          <i class="icon" />
+          <div class="text1">已应答次数</div>
+        </div>
+        <div class="line2">
+          <div class="text-green">16</div>
+          <div class="text2">次</div>
+        </div>
+      </div>
+      <div class="card3">
+        <div class="line1">
+          <i class="icon" />
+          <div class="text1">未应答次数</div>
+        </div>
+        <div class="line2">
+          <div class="text-red">16</div>
+          <div class="text2">次</div>
+        </div>
+      </div>
+    </div>
+    <van-search
+        v-model="queryParams.search_keyword"
+        class="common-search"
+        :left-icon="searchImg"
+        :right-icon="closeImg"
+        @search="on_search_keyword"
+        @click-right-icon.stop="on_search_cancel"
+    />
+  </div>
+</template>
+
+<script lang="ts" setup name="rollCallDetails2">
+
+import searchImg from "@/assets/images/search.png";
+import closeImg from "@/assets/images/close.png";
+</script>
+
+<style  lang="scss" scoped>
+.container {
+  padding: 16px;
+  height: calc(100vh - 55px) !important;
+}
+.box1 {
+  display: flex;
+  justify-content: space-between;
+  .card1 {
+    background: url('@/assets/images/onlineRollCall/box10.png') no-repeat;
+    .icon {
+      background: url('@/assets/images/onlineRollCall/icon8.png') no-repeat;
+    }
+  }
+  .card2 {
+    background: url('@/assets/images/onlineRollCall/box11.png') no-repeat;
+    .icon {
+      background: url('@/assets/images/onlineRollCall/icon9.png') no-repeat;
+    }
+  }
+  .card3 {
+    background: url('@/assets/images/onlineRollCall/box12.png') no-repeat;
+    .icon {
+      background: url('@/assets/images/onlineRollCall/icon10.png') no-repeat;
+    }
+  }
+  .card1, .card2, .card3 {
+    width: 106px;
+    height: 71px;
+    background-size: 100% 100%;
+    padding: 8px;
+    .line1 {
+      display: flex;
+      align-items: center;
+      .icon {
+        display: inline-block;
+        width: 16px;
+        height: 16px;
+        background-size: 100% 100%;
+        margin-right: 4px;
+      }
+      .text1 {
+        font-size: 14px;
+        line-height: 26px;
+      }
+    }
+    .line2 {
+      display: flex;
+      justify-content: center;
+      align-items: flex-end;
+      .text2 {
+        font-size: 12px;
+        line-height: 26px;
+      }
+      .text-blue {
+        font-size: 24px;
+        color: #2C81FF;
+        font-weight: bold;
+        margin-right: 6px;
+      }
+      .text-green {
+        font-size: 24px;
+        color: #40C75F;
+        font-weight: bold;
+        margin-right: 6px;
+      }
+      .text-red {
+        font-size: 24px;
+        color: #FF2F3C;
+        font-weight: bold;
+        margin-right: 6px;
+      }
+    }
+  }
+}
+</style>

+ 236 - 7
src/views/onlineRollCall/rollCallRecord.vue

@@ -1,23 +1,252 @@
 <template>
 <div class="container">
-  <DateRangePicker v-model="queryParams.dateRange" @change="initData" />
+  <van-field
+      v-model="dateRangeText"
+      class="common-search"
+      :left-icon="searchImg"
+      :right-icon="closeImg"
+      placeholder="请选择时间段"
+      readonly
+      @click="show = true"
+      @click-right-icon.stop="handleClear"
+  />
+  <van-list
+      v-model:loading="loading"
+      v-model:error="error"
+      error-text="请求失败,点击重新加载"
+      :finished="finished"
+      finished-text="没有更多记录了"
+      class="list"
+      @load="getList">
+    <div v-for="(item, index) in dataList" :key="index" class="card">
+      <div class="line1">
+        <div class="data-box1">
+          <div class="data-item">
+            <i class="icon1" />
+            <div class="text1">点名开始时间:{{ item.time1 }}</div>
+          </div>
+          <div class="data-item">
+            <i class="icon2" />
+            <div class="text1">点名结束时间:{{item.time2}}</div>
+          </div>
+        </div>
+        <div class="btn" @click="handleToDetails(item.id)">查看详情</div>
+      </div>
+      <div class="line2">
+        <div class="data-item1">
+          <div class="text1">点名时长</div>
+          <div class="text2">{{ item.time3 }}</div>
+        </div>
+        <div class="data-item2">
+          <div class="text1">已应答</div>
+          <div class="text2">{{ item.data1 }}</div>
+        </div>
+        <div class="data-item3">
+          <div class="text1">未应答</div>
+          <div class="text2">{{ item.data2 }}</div>
+        </div>
+      </div>
+    </div>
+  </van-list>
+  <van-calendar v-model:show="show" type="range" @confirm="onConfirm" />
 </div>
 </template>
 
 <script lang="ts" setup name="rollCallRecord">
-import DateRangePicker from "@/components/DateRangePicker/index.vue";
-import { reactive } from "vue";
+import {onMounted, reactive, ref} from "vue";
+import closeImg from "@/assets/images/close.png";
+import searchImg from "@/assets/images/search.png";
+import {parseTime} from "@/utils/ruoyi";
+import {useRouter} from "vue-router";
 
+const router = useRouter();
 const queryParams = reactive({
   page: 0,
   page_size: 15,
-  dateRange: ''
+  dateRange: []
 });
-const initData = () => {
-debugger
+const total = ref(0);
+const loading = ref(false);
+const error = ref(false);
+const finished = ref(false);
+let dataList = ref([]);
+let dateRangeText = ref('');
+let show = ref(false);
+let timer;
+const onConfirm = (data) => {
+  show.value = false;
+  const startDate = parseTime(data[0], '{y}-{m}-{d}');
+  const endDate = parseTime(data[1], '{y}-{m}-{d}');
+  queryParams.dateRange = [startDate, endDate];
+  dateRangeText.value = startDate + '至' + endDate;
+  getList();
 }
+const handleClear = () => {
+  queryParams.dateRange = [];
+  dateRangeText.value = '';
+  getList();
+}
+const calculateDuration = (startTimeStr) => {
+  // 将起始时间字符串转换为日期对象
+  const startTime = new Date(startTimeStr);
+
+  // 获取当前时间作为结束时间
+  const endTime = new Date();
+
+  // 确保起始时间在结束时间之前(可选,用于验证输入)
+  if (startTime > endTime) {
+    return '';
+  }
+
+  // 计算时间差(以毫秒为单位)
+  let timeDifference = endTime - startTime;
+
+  // 将毫秒转换为秒、分钟和小时
+  const seconds = Math.floor((timeDifference / 1000) % 60);
+  const minutes = Math.floor((timeDifference / (1000 * 60)) % 60);
+  const hours = Math.floor((timeDifference / (1000 * 60 * 60)));
+
+  // 格式化时间为 HH:MM:SS
+  const formattedDuration = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
+
+  // 返回格式化的持续时间
+  return formattedDuration;
+};
+const updateTime = () => {
+  dataList.value.forEach((item) => {
+    item.time3 = calculateDuration(item.time1);
+  })
+}
+const getList = () => {
+  dataList.value = [
+    { id: 1, time1: '2024-10-22 11:10:08', time2: '2024-10-22 12:00:00', time3: '00:01:06', data1: 23, data2: 12 },
+    { id: 2, time1: '2024-10-22 11:10:08', time2: '2024-10-22 12:00:00', time3: '00:01:06', data1: 23, data2: 12 },
+    { id: 3, time1: '2024-10-22 11:10:08', time2: '2024-10-23 12:00:00', time3: '00:01:06', data1: 23, data2: 12 },
+    { id: 4, time1: '2024-10-22 11:10:08', time2: '2024-10-23 12:00:00', time3: '00:01:06', data1: 23, data2: 12 },
+    { id: 5, time1: '2024-10-22 11:10:08', time2: '2024-10-23 12:00:00', time3: '00:01:06', data1: 23, data2: 12 },
+    { id: 6, time1: '2024-10-22 11:10:08', time2: '2024-10-23 12:00:00', time3: '00:01:06', data1: 23, data2: 12 },
+    { id: 7, time1: '2024-10-22 11:10:08', time2: '2024-10-23 12:00:00', time3: '00:01:06', data1: 23, data2: 12 }
+  ]
+  loading.value = false;
+  finished.value = true;
+  total.value = 7;
+  if (!timer) {
+    timer = setInterval(updateTime, 1000)
+  }
+}
+
+const handleToDetails = (id) => {
+  router.push({
+    name: 'RollCallDetails2',
+    query: { id }
+  });
+}
+onMounted(() => {
+  getList();
+})
 </script>
 
 <style scoped lang="scss">
-
+.list {
+  margin-top: 9px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  .card {
+    width: 343px;
+    height: 150px;
+    background: url("@/assets/images/onlineRollCall/card2.png") no-repeat;
+    background-size: 100% 100%;
+    margin-top: 16px;
+    padding: 16px 5px;
+    &:first-child {
+      margin-top: 0;
+    }
+    .line1 {
+      display: flex;
+      justify-content: space-between;
+      align-items: flex-start;
+      .data-item{
+        display: flex;
+        align-items: center;
+        .icon1 {
+          width: 16px;
+          height: 17px;
+          background: url("@/assets/images/onlineRollCall/icon6.png") no-repeat;
+          background-size: 100% 100%;
+          margin-right: 3px;
+        }
+        .icon2 {
+          width: 17px;
+          height: 17px;
+          background: url("@/assets/images/onlineRollCall/icon7.png") no-repeat;
+          background-size: 100% 100%;
+          margin-right: 3px;
+        }
+        .text1 {
+          font-size: 14px;
+          line-height: 26px;
+        }
+      }
+      .btn {
+        background: #2C81FF;
+        border-radius: 2px;
+        font-size: 14px;
+        color: #FFFFFF;
+        padding: 0 12px;
+        height: 24px;
+        line-height: 24px;
+      }
+    }
+    .line2 {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      margin: 23px;
+      .data-item1, .data-item2, .data-item3 {
+        font-weight: bold;
+        line-height: 26px;
+        .text1 {
+          font-size: 14px;
+        }
+        .text2 {
+          font-size: 18px;
+        }
+      }
+      .data-item1 {
+        color: #2C81FF;
+      }
+      .data-item2 {
+        color: #40C75F;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+      .data-item3 {
+        color: #FF2F3C;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+      }
+    }
+  }
+}
+.common-search {
+  //:deep(.van-field__left-icon) {
+  //  .van-icon__image {
+  //    width: 12px;
+  //    height: 12px;
+  //  }
+  //}
+  :deep(.van-field__right-icon) {
+    width: 30px;
+    height: 30px;
+    padding: 0;
+    .van-icon__image {
+      width: 30px;
+      height: 30px;
+    }
+  }
+}
 </style>

+ 3 - 4
src/views/onlineRollCall/spotCheckUnits.vue

@@ -4,10 +4,9 @@
         v-model="keyword"
         class="common-search"
         :left-icon="searchImg"
-        clearable
-        :clear-icon="closeImg"
+        :right-icon="closeImg"
         @search="onSearchKeyword"
-        @cancel="onSearchCancel"
+        @click-right-icon.stop="onSearchCancel"
     />
     <div class="content">
       <el-tree
@@ -117,7 +116,7 @@ onMounted(() => {
       height: 12px;
     }
   }
-  :deep(.van-field__clear) {
+  :deep(.van-field__right-icon) {
     width: 30px;
     height: 30px;
     padding: 0;