Browse Source

Merge remote-tracking branch 'origin/main'

zhanghao 2 months ago
parent
commit
2ea0a8978b

+ 11 - 3
src/api/screen/service.js

@@ -873,11 +873,19 @@ export function getProjectCameraNumList(appOrg) {
 }
 
 // 近一周问题列表
-export function getIssueListLastWeek(appOrg, date = null) {
+export function getIssueListLastWeek(appOrg, date = null, status = null) {
   let url = `large/check/getIssueListLastWeek/${appOrg}`;
-  if (date) {
-    url += `?day=${date}`;
+  let isFirstParam = true;
+
+  if (date !== null) { 
+    url += `${isFirstParam ? '?' : '&'}day=${date}`;
+    isFirstParam = false;
+  }
+  if (status !== null) {
+    url += `${isFirstParam ? '?' : '&'}status=${status}`;
+    isFirstParam = false;
   }
+
   return request({
     url,
     method: 'get'

+ 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);
+  }
+  
+  

+ 98 - 47
src/views/pad/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,
@@ -86,47 +101,46 @@ export default {
     },
   },
   created() {
-    this.getIssueListLastWeek();
+    this.fetchData();
   },
   mounted() {
-    const style = document.createElement('style');
-    style.innerHTML = `
+  const style = document.createElement('style');
+  style.innerHTML = `
     .el-picker-panel.el-date-picker {
       background: #062223 !important;
     }
   `;
-    document.head.appendChild(style);
+  document.head.appendChild(style);
+},
+methods: {
+  dealIssue(y){
+    this.$emit('dealIssue',y)
   },
-  methods: {
-    dealIssue(y){
-      this.$emit('dealIssue',y)
-    },
 
     // 获取近一周问题列表
-    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;
-          }
-        });
+    fetchData() {
+    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);
@@ -136,10 +150,17 @@ export default {
       return `${year}-${month}-${day}`;
     },
     // 处理日期选择器变化
-    handleDateChange() {
+    handleDateChange(value) {
+      this.value = value;
+      this.currentPage = 1; // 重置分页
+      this.fetchData(); // 刷新数据
+    },
+    changeFoods(food) {
+      this.food = food;
       this.currentPage = 1; // 重置分页
-      this.getIssueListLastWeek(); // 刷新数据
+      this.fetchData();// 刷新数据
     },
+
     togglePost(item) {
       // 关闭所有其他条目
       this.getProList.forEach(i => {
@@ -196,6 +217,33 @@ export default {
   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: 100%;
+    }
+    .el-input {
+      input {
+        background: rgba(255, 255, 255, 0);
+        color: #00ffff;
+        border: none;
+        padding: 0;
+        width: 50px;
+      }
+    }
+  }
 
 .flex-row::before{
   content: "";
@@ -239,6 +287,9 @@ export default {
 .el-select .el-input .el-select__caret {
   display: none;
 }
+.choose-area .el-select[data-v-856d8f0c] {
+    width: 100%;
+}
 .myDia{
   width: 1050px;
   height: 710px;
@@ -246,23 +297,23 @@ export default {
   background-image: radial-gradient(circle at 50% 50%, #031417b3 0%, #0C1A1A 84%);
 }
 .myDia ::v-deep .el-picker-panel.el-date-picker {
-  background: #062223 !important;
+    background: #062223 !important;
 }
 .wanjie{
   position: absolute;
-  /* left: 30px; */
-  margin-left: 75px;
-  top: 25px;
-  width: 120px;
-  height: 60px;
-  background: #0017168f;
-  box-shadow: inset 0 0 17px 0 #05ffff7a;
-  background: #44f1ff1a;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  color: #00F0ff;
-  cursor: pointer;
+    /* left: 30px; */
+    margin-left: 75px;
+    top: 25px;
+    width: 120px;
+    height: 60px;
+    background: #0017168f;
+    box-shadow: inset 0 0 17px 0 #05ffff7a;
+    background: #44f1ff1a;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    color: #00F0ff;
+    cursor: pointer;
 }
 
 ::v-deep .el-input__inner{

+ 77 - 26
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,
@@ -86,7 +101,7 @@ export default {
     },
   },
   created() {
-    this.getIssueListLastWeek();
+    this.fetchData();
   },
   mounted() {
   const style = document.createElement('style');
@@ -103,30 +118,29 @@ 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;
-          }
-        });
+    fetchData() {
+    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);
@@ -136,10 +150,17 @@ methods: {
       return `${year}-${month}-${day}`;
     },
     // 处理日期选择器变化
-    handleDateChange() {
+    handleDateChange(value) {
+      this.value = value;
+      this.currentPage = 1; // 重置分页
+      this.fetchData(); // 刷新数据
+    },
+    changeFoods(food) {
+      this.food = food;
       this.currentPage = 1; // 重置分页
-      this.getIssueListLastWeek(); // 刷新数据
+      this.fetchData();// 刷新数据
     },
+
     togglePost(item) {
       // 关闭所有其他条目
       this.getProList.forEach(i => {
@@ -196,6 +217,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: 100%;
+    }
+    .el-input {
+      input {
+        background: rgba(255, 255, 255, 0);
+        color: #00ffff;
+        border: none;
+        padding: 0;
+        width: 50px;
+      }
+    }
+  }
 
 .flex-row::before{
   content: "";
@@ -239,6 +287,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;