Răsfoiți Sursa

页面调整

敲代码的猫 3 săptămâni în urmă
părinte
comite
7aa30e701c
2 a modificat fișierele cu 84 adăugiri și 34 ștergeri
  1. 13 12
      src/utils/device.js
  2. 71 22
      src/views/screen/engineering/issueListDia.vue

+ 13 - 12
src/utils/device.js

@@ -1,14 +1,15 @@
-
 export function isPadDevice() {
-  const userAgent = navigator.userAgent || navigator.vendor || window.opera;
-  const platform = navigator.platform || '';
-  const maxTouchPoints = navigator.maxTouchPoints || 0;
-
-  // 检查是否是iPad
-  if (/MacIntel/.test(platform) && maxTouchPoints > 1) {
-      return true; // iOS 13+ iPad
+   const userAgent = navigator.userAgent || navigator.vendor || window.opera;
+   const platform = navigator.platform || '';
+   const maxTouchPoints = navigator.maxTouchPoints || 0;
+  
+   // 检查是否是iPad
+   if (/MacIntel/.test(platform) && maxTouchPoints > 1) {
+   return true; // iOS 13+ iPad
   }
-
-  return /iPad|Tablet/i.test(userAgent);
-  // return /iPad|Tablet|Android|Mobile/i.test(userAgent) && !/Phone/i.test(userAgent);
-}
+  
+   // 使用正则表达式匹配用户代理字符串以确定是否为移动设备
+   return /iPad|Tablet|Android|Mobile|iPod|iPhone/i.test(userAgent);
+  }
+  
+  

+ 71 - 22
src/views/screen/engineering/issueListDia.vue

@@ -8,6 +8,17 @@
         placeholder="选择日期"
         @change="handleDateChange">
       </el-date-picker>
+      <!-- <div class="choose-area">
+      <el-select v-model="food" placeholder="请选择" @change="changeFoods">
+        <el-option
+          v-for="item in foods"
+          :key="item"
+          :label="item"
+          :value="item"
+        >
+        </el-option>
+      </el-select>
+    </div> -->
       <!-- <div style="border: 1px #00ffff solid;display: flex;justify-content: center;align-items: center;margin-left: 10px;width: 100px;color: #00ffff;cursor: pointer" @click="choose">
         <i class="el-icon-plus"><span style="margin-left: 10px">上报问题</span></i>
       </div> -->
@@ -16,6 +27,8 @@
       </div>
     </div>
 
+    
+
     <!-- 表格数据 -->
     <div class="flex-container">
       <div class="header">
@@ -71,6 +84,8 @@ export default {
   data() {
     return {
       value: null,
+      food: "",
+      foods: ["处理中", "已完结",],
       getProList: [],
       // showPost:false,
       currentPage: 1,
@@ -104,29 +119,28 @@ methods: {
 
     // 获取近一周问题列表
     getIssueListLastWeek() {
-      if (this.value) {
-        const selectedDate = this.formatDate(this.value);
-        getIssueListLastWeek(this.$props.appOrg, selectedDate).then((res) => {
-          if (Number(res.code) === 200) {
-            this.getProList = (res.data || []).map(item => ({
-              ...item,
-              isShowPost: false
-            }));
-            this.total = this.getProList.length;
-          }
-        });
-      } else {
-        getIssueListLastWeek(this.$props.appOrg).then((res) => {
-          if (Number(res.code) === 200) {
-            this.getProList = (res.data || []).map(item => ({
-              ...item,
-              isShowPost: false
-            }));
-            this.total = this.getProList.length;
-          }
-        });
+    let selectedFood = null;
+    let selectedDate = null;
+
+    if (this.food) {
+      selectedFood = this.food === "处理中" ? 0 : 1;
+    }
+    if (this.value) {
+      selectedDate = this.formatDate(this.value);
+    }
+
+    getIssueListLastWeek(this.$props.appOrg, selectedDate, selectedFood).then((res) => {
+      if (Number(res.code) === 200) {
+        this.getProList = (res.data || []).map(item => ({
+          ...item,
+          isShowPost: false
+        }));
+        this.total = this.getProList.length;
       }
-    },
+    }).catch(error => {
+      console.error("Error fetching data:", error);
+    });
+  },
     // 日期格式化方法
     formatDate(date) {
       const d = new Date(date);
@@ -140,6 +154,11 @@ methods: {
       this.currentPage = 1; // 重置分页
       this.getIssueListLastWeek(); // 刷新数据
     },
+    changeFoods() {
+      this.currentPage = 1; // 重置分页
+      this.getIssueListLastWeek(); // 刷新数据
+    },
+
     togglePost(item) {
       // 关闭所有其他条目
       this.getProList.forEach(i => {
@@ -196,6 +215,33 @@ methods: {
   display: flex;  /* 每行使用 flexbox 布局 */
   position: relative;
 }
+.choose-area {
+  margin-left: 20px;
+    width: 91.05px;
+    height: 35px;
+    line-height: 30px;
+    /* padding-left: 15px; */
+    font-size: 14px;
+    color: #00ffff;
+    background: url("../../../assets/images/main/choose_short.png") no-repeat;
+    cursor: pointer;
+    background-size: 100%;
+  }
+
+  .choose-area {
+    .el-select {
+      width: 90%;
+    }
+    .el-input {
+      input {
+        background: rgba(255, 255, 255, 0);
+        color: #00ffff;
+        border: none;
+        padding: 0;
+        width: 50px;
+      }
+    }
+  }
 
 .flex-row::before{
   content: "";
@@ -239,6 +285,9 @@ methods: {
 .el-select .el-input .el-select__caret {
   display: none;
 }
+.choose-area .el-select[data-v-856d8f0c] {
+    width: 100%;
+}
 .myDia{
   width: 1050px;
   height: 710px;