Sfoglia il codice sorgente

feat(photography): 添加货号搜索功能并调整远程控制界面

- 在拍照和图像处理页面添加货号搜索栏
- 实现搜索功能支持按货号筛选照片记录
- 重构远程控制界面的LED开关按钮位置
- 添加搜索输入框的回车事件处理
- 更新样式确保搜索栏显示正常
panqiuyao 13 ore fa
parent
commit
e1fec5513e

+ 3 - 1
frontend/src/views/Photography/mixin/usePhotography.ts

@@ -37,6 +37,7 @@ export default function usePhotography() {
       action: null,
     })
     const goodsArtNo = ref()
+    const searchGoodsArtNo = ref('')
     let smartShooterTimeout: ReturnType<typeof setTimeout> | null = null
 
     // 初始化 WebSocket 状态管理
@@ -134,7 +135,7 @@ export default function usePhotography() {
      * 获取拍照记录。
      * @param params - 可选参数,用于分页或其他筛选条件。
      */
-    async function getPhotoRecords(params?: { page?: number; size?: number } ) {
+    async function getPhotoRecords(params?: { page?: number; size?: number; goods_art_no?: string }) {
       if (loading.value) return;
       loading.value = true;
       const page = params?.page ?? currentPage.value ?? 1
@@ -957,6 +958,7 @@ const onRemoteControl = async (type) => {
       lastPhoto,
       showlastPhoto,
       goodsArtNo,
+      searchGoodsArtNo,
       menu,
       configInfoStore,
       getTime,

+ 25 - 0
frontend/src/views/Photography/processImage.vue

@@ -10,6 +10,19 @@
   <div class="photography-page flex-col bg-F5F6F7 ">
     <div class="main-container page—wrap max-w-full">
       <div class="history-section flex-col koutu-section">
+          <div class="search-bar">
+            <el-input
+              v-model="searchGoodsArtNo"
+              placeholder="搜索货号"
+              clearable
+              style="width: 200px"
+              @keyup.enter="handleSearch"
+            >
+              <template #append>
+                <el-button @click="handleSearch">搜索</el-button>
+              </template>
+            </el-input>
+          </div>
 
           <div class="history-warp" ref="containerRef">
             <div v-if="!goodsList.length" class="fs-14 c-666 mar-top-50">
@@ -177,8 +190,14 @@ const {
   totalPages,
   importDirs,
   deleteAllGoods,
+  searchGoodsArtNo,
 } = usePhotography()
 
+// 搜索货号
+const handleSearch = () => {
+  getPhotoRecords({ page: 1, goods_art_no: searchGoodsArtNo.value })
+}
+
 // thumbnails
 const containerRef = ref<HTMLElement | null>(null)
 const { thumbnailMap, observe, stop } = useThumbnails(getFilePath)
@@ -405,6 +424,12 @@ watch(goodsList, () => {
         flex-direction: column;
         padding: 20px;
 
+        .search-bar {
+          margin-bottom: 15px;
+          display: flex;
+          justify-content: flex-start;
+        }
+
         ::v-deep {
           .el-checkbox__input {
             transform: scale(1.4);

+ 25 - 0
frontend/src/views/Photography/shot.vue

@@ -67,6 +67,19 @@
       </div>
 
       <div class="history-section flex-col koutu-section">
+          <div class="search-bar">
+            <el-input
+              v-model="searchGoodsArtNo"
+              placeholder="搜索货号"
+              clearable
+              style="width: 200px"
+              @keyup.enter="handleSearch"
+            >
+              <template #append>
+                <el-button @click="handleSearch">搜索</el-button>
+              </template>
+            </el-input>
+          </div>
           <div class="history-warp" ref="containerRef">
             <div v-if="!goodsList.length" class="fs-14 c-666 mar-top-50">
               {{ loading ? '数据正在加载中,请稍候...' : '暂无数据,请先进行拍摄'}}
@@ -219,6 +232,7 @@ const {
   lastPhoto,
   showlastPhoto,
   goodsArtNo,
+  searchGoodsArtNo,
   menu,
   getTime,
   getFilePath,
@@ -238,6 +252,11 @@ const {
   totalPages,
 } = usePhotography()
 
+// 搜索货号
+const handleSearch = () => {
+  getPhotoRecords({ page: 1, goods_art_no: searchGoodsArtNo.value })
+}
+
 // 关闭最后拍摄的照片预览
 const closeLastPhoto = () => {
   showlastPhoto.value = false
@@ -617,6 +636,12 @@ watch(goodsList, () => {
         overflow-y: auto;
          background:#F5F6F7;
 
+        .search-bar {
+          margin-bottom: 15px;
+          display: flex;
+          justify-content: flex-start;
+        }
+
         ::v-deep {
           .el-checkbox__input {
             transform: scale(1.4);

+ 2 - 2
frontend/src/views/RemoteControl/index.vue

@@ -31,10 +31,10 @@
         <div class="button up" @click="switchLED(1)" v-log="{ describe: { action: 'LED开启' } }">LED开</div>
       </el-col>
       <el-col :span="6">
-        <div class="button up" @click="switchLED(0)" v-log="{ describe: { action: 'LED关闭' } }">LED关</div>
+        <div class="button up" :class="{ disabled: !canStop }" @click="oneClickStop" v-log="{ describe: { action: '一键停止拍摄' } }">停止</div>
       </el-col>
       <el-col :span="6">
-        <div class="button up" :class="{ disabled: !canStop }" @click="oneClickStop" v-log="{ describe: { action: '一键停止拍摄' } }">停止</div>
+        <div class="button up" @click="switchLED(0)" v-log="{ describe: { action: 'LED关闭' } }">LED关</div>
       </el-col>
       <el-col :span="3"></el-col>
     </el-row>