Преглед на файлове

Merge branch 'master' of http://gitlab.pubdata.cn/liangyibo/CameraMachine

rambo преди 8 месеца
родител
ревизия
7c125c0daa

+ 1 - 0
electron/controller/utils.js

@@ -35,6 +35,7 @@ class UtilsController extends Controller {
    * upload
    */
   async shellFun (params) {
+    console.log(params)
     shell[params.action](params.params)
   }
 

+ 6 - 0
frontend/src/components/login/index.vue

@@ -211,6 +211,9 @@ const handleLogin = async () => {
     default:
       await  useUserInfoStore.getInfo()
       useUserInfoStore.updateLoginShow(false)
+      setTimeout(()=>{
+        window.location.reload()
+      },100)
         break;
   }
 
@@ -248,6 +251,9 @@ async function toggleCompany() {
   })
   await  useUserInfoStore.getInfo()
   useUserInfoStore.updateLoginShow(false)
+  setTimeout(()=>{
+    window.location.reload()
+  },100)
 }
 
 const sendVerificationCode = () => {

+ 1 - 1
frontend/src/composables/userCheck.ts

@@ -6,7 +6,7 @@ export function useCheckInfo() {
             ShowError()
         }
         window.addEventListener('storage',(e)=>{
-            if(e.key === 'check' && e.newValue === false && e.oldValue === true){
+            if(e.key === 'check' && e.newValue === 'false' && e.oldValue === 'true'){
                 ShowError()
             }
         })

+ 1 - 2
frontend/src/views/Developer/index.vue

@@ -209,14 +209,13 @@ async function changeNum(action_name, type, key, min, max) {
         editRowData.value[key] = max;
       }
       ElMessage.error(`${action_name}值应在${min}到${max}之间`);
-      return;
     }
   }
   socketStore.sendMessage({
     type,
     data: {
       action_name,
-      value:Number(editRowData.value[key])
+      value:Number(editRowData.value[key]) || 0
     }
   });
 

+ 16 - 0
frontend/src/views/Home/index.vue

@@ -50,6 +50,7 @@
     <el-button type="info"  @click="connect_mcu__init">MCU初始化</el-button>
     <el-button type="info"  @click="connect_bluetooth">连接蓝牙</el-button>
     <el-button @click="socketDisconnect">socket 断开</el-button>
+    <el-button type="info"  @click="openFilePath">打开文件夹</el-button>
     <router-link
         class="mar-left-10"
         :to="{
@@ -267,6 +268,21 @@ async function connect_mcu__init(){
 }
 
 
+const openFilePath = () => {
+  // 这里可以添加打开目录的逻辑
+  /*
+  *
+  * E:\顶层\221
+  * */
+  clientStore.ipc.removeAllListeners(icpList.utils.shellFun);
+  let params = {
+    action: 'openPath',
+    params: paramsKey.value.replaceAll('/','\\')
+  }
+  clientStore.ipc.send(icpList.utils.shellFun, params);
+}
+
+
 
 async function connect_bluetooth(){
 

+ 7 - 3
frontend/src/views/Photography/check.vue

@@ -88,9 +88,12 @@ function checkConfirm(init){
     menu.push({
       type:'setting'
     })
-    menu.push({
-      type:'developer'
-    })
+    if(useUserInfoStore.userInfo.brand_company_code === '1300'){
+
+      menu.push({
+        type:'developer'
+      })
+    }
   }
   if(!init) previewKey.value++;
 
@@ -102,6 +105,7 @@ function checkConfirm(init){
 
 
 
+
 let interval:any = null
 function showVideo(){
 

+ 7 - 8
frontend/src/views/Photography/detail.vue

@@ -333,10 +333,11 @@ const generate = async function () {
     if (result.code === 0) {
       const { output_folder, list } = result.data
       // 若out_put_dir为空,说明全部生成失败,走失败处理
-      if (output_folder === '') {
-        console.log('全部生成失败')
-        handleFail('生成失败! 请联系管理员处理, 或稍后重试')
-      } else {
+      // if (output_folder === '') {
+      //   console.log('全部生成失败')
+      //   handleFail('生成失败! 请联系管理员处理, 或稍后重试')
+      // } else {
+
         // 判断  result.data.list 中 是否存在 success 为fals的  若存在 则走部分成功处理  否则走全部成功处理
         let hasFail = false
         list.map(item => {
@@ -352,7 +353,7 @@ const generate = async function () {
           console.log('全部成功')
           handleSuccess(output_folder, '全部生成成功')
         }
-      }
+      // }
 
     } else {
       console.log('code全部生成失败')
@@ -375,7 +376,6 @@ const generate = async function () {
           errorList.push(item)
         }
       })
-      console.log("%c Line:376 🍖 errorList", "color:#2eafb0", errorList);
       partErrList.value = errorList
       handleSuccess(output_folder, '部分货号生成失败',)
     }
@@ -448,11 +448,10 @@ function openPhotographySeniorDetail() {
 const handleComplete = () => {
   loadingDialogVisible.value = false
   // 这里可以添加打开目录的逻辑
-  clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
   clientStore.ipc.removeAllListeners(icpList.utils.shellFun);
   let params = {
     action: 'openPath',
-    params: completeDirectory.value
+    params: completeDirectory.value?.replaceAll('/','\\')
   }
   clientStore.ipc.send(icpList.utils.shellFun, params);
 }

+ 15 - 1
frontend/src/views/Photography/shot.vue

@@ -344,6 +344,10 @@ onMounted(async () => {
     console.log('_image_process')
     console.log(result)
     getPhotoRecords()
+    // 延迟两秒再获取一遍数据
+    setTimeout(()=>{
+      getPhotoRecords()
+    },3000)
   })
 
   // 监听拍照完成事件
@@ -355,7 +359,7 @@ onMounted(async () => {
       // 延迟两秒再获取一遍数据
       setTimeout(()=>{
         getPhotoRecords()
-      },2000)
+      },3000)
       takePictureLoading.value = false;
     }
 
@@ -385,6 +389,12 @@ onMounted(async () => {
       socketStore.sendMessage(result.data)
       takePictureLoading.value = true;
 
+      getPhotoRecords()
+      // 延迟两秒再获取一遍数据
+      setTimeout(()=>{
+        getPhotoRecords()
+      },3000)
+
     }
 
   })
@@ -420,6 +430,10 @@ onBeforeUnmount(() => {
  */
 function openPhotographyDetail() {
 
+  if(takePictureLoading.value){
+    ElMessage.error('正在拍摄中,请稍候')
+    return;
+  }
   const { href } = Router.resolve({
     name: 'PhotographyDetail',
     query:{

+ 7 - 8
frontend/src/views/Setting/index.vue

@@ -9,11 +9,11 @@
         <img src="@/assets/images/setting/icon1a.png" class="nav-icon" v-else/>
         <span>基础配置</span>
       </div>
-      <div class="nav-item" :class="{'active': activeIndex === 1}" @click="activeIndex = 1">
+<!--      <div class="nav-item" :class="{'active': activeIndex === 1}" @click="activeIndex = 1">
         <img src="@/assets/images/setting/icon2.png" class="nav-icon" v-if="activeIndex !== 1"/>
         <img src="@/assets/images/setting/icon2a.png" class="nav-icon" v-else/>
         <span>拍照设置</span>
-      </div>
+      </div>-->
       <div class="nav-item" :class="{'active': activeIndex === 2}" @click="activeIndex = 2">
         <img src="@/assets/images/setting/icon3.png" class="nav-icon" v-if="activeIndex !== 2"/>
         <img src="@/assets/images/setting/icon3a.png" class="nav-icon" v-else/>
@@ -142,14 +142,14 @@
                     </el-select>
                     </div>
                 </div>
-                <div class="form-item">
+<!--                <div class="form-item">
                     <label>运行模式:</label>
                     <div class="select-wrapper">
                     <el-select v-model="formData.other_configs.running_mode" placeholder="请选择">
                       <el-option v-for="item in runModeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
                     </el-select>
                     </div>
-                </div>
+                </div>-->
           </div>
       <!--其他设置-->
           <div class="selectBox" style="padding-top: 0px" v-if="activeIndex === 3">
@@ -435,8 +435,7 @@ const productTypeList = ref([
 ]);
 const defaultCutoutModeList = ref([
   { label: '普通抠图', value: '普通抠图' },
-  { label: '智能抠图', value: '智能抠图' },
-  { label: '手动抠图', value: '手动抠图' },
+  { label: '精细化抠图', value: '精细化抠图' },
 ]);
 const deviceSpeedList = ref([
   { label: '一档', value: '1' },
@@ -444,8 +443,8 @@ const deviceSpeedList = ref([
   { label: '三档', value: '3' },
 ]);
 const runModeList = ref([
-  { label: '普通抠图', value: '普通抠图' },
-  { label: '精细化抠图', value: '精细化抠图' }
+  { label: '普通模式', value: '普通模式' },
+  { label: '待用户确认模式', value: '待用户确认模式' }
 ]);
 const receiverList = ref([
   { label: '蓝牙', value: '1' },