|
|
@@ -6,6 +6,14 @@
|
|
|
{
|
|
|
type:'setting'
|
|
|
},
|
|
|
+ {
|
|
|
+ name:'首页',
|
|
|
+ click:()=>{
|
|
|
+ this.$router.push({
|
|
|
+ name: 'home'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
]"
|
|
|
/>
|
|
|
<div class="photography-page flex-col">
|
|
|
@@ -39,9 +47,9 @@
|
|
|
<span class="method-description">手工输入货号</span>
|
|
|
</div>
|
|
|
<div class="input-container flex-row">
|
|
|
- <el-input class="input-item" v-model="input2" placeholder="请输入货号">
|
|
|
+ <el-input class="input-item" v-model="goods_art_no" placeholder="请输入货号">
|
|
|
<template #append>
|
|
|
- <el-button class="input-button" type="primary" @click="input2 = ''">确认</el-button>
|
|
|
+ <el-button class="input-button" type="primary" @click="runGoods">确认</el-button>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
|
|
|
@@ -199,13 +207,77 @@
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import headerBar from '@/components/header-bar/index.vue'
|
|
|
-import { ref } from 'vue'
|
|
|
+import { ref,reactive, onMounted } from 'vue'
|
|
|
import { ossResize } from '@/utils/appfun'
|
|
|
-const input2 = ref('')
|
|
|
+import icpList from '@/utils/ipc'
|
|
|
+import client from "@/stores/modules/client";
|
|
|
+import socket from "@/stores/modules/socket";
|
|
|
+const goods_art_no = ref('')
|
|
|
const loading = ref(true)
|
|
|
const test_image_url = ref('https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png')
|
|
|
|
|
|
|
|
|
+const clientStore = client();
|
|
|
+const runAction = ref({
|
|
|
+ "action": "",
|
|
|
+ "goods_art_no": ""
|
|
|
+})
|
|
|
+
|
|
|
+onMounted(()=>{
|
|
|
+
|
|
|
+ clientStore.ipc.on(icpList.socket.message+'_blue_tooth_scan', (event, result) => {
|
|
|
+ console.log('blue_tooth_scan')
|
|
|
+ console.log(result)
|
|
|
+ if(result.code === 0 && result.data?.data){
|
|
|
+ runGoods(result.data?.data)
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ *
|
|
|
+ {
|
|
|
+ "code": 0,
|
|
|
+ "msg": "准备执行[执行左脚程序]",
|
|
|
+ "status": 2,
|
|
|
+ "data": {
|
|
|
+ "data": {
|
|
|
+ "action": "执行左脚程序",
|
|
|
+ "goods_art_no": "6957535123138"
|
|
|
+ },
|
|
|
+ "type": "run_mcu"
|
|
|
+ },
|
|
|
+ "msg_type": "blue_tooth_scan"
|
|
|
+ }
|
|
|
+ *
|
|
|
+ * */
|
|
|
+ });
|
|
|
+
|
|
|
+ //mcu信息 监听 调试用
|
|
|
+ clientStore.ipc.on(icpList.socket.message+'_mcu', (event, result) => {
|
|
|
+ console.log('mcu')
|
|
|
+ console.log(result)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
+// 初始化 WebSocket 状态管理
|
|
|
+const socketStore = socket()
|
|
|
+
|
|
|
+async function runGoods(data){
|
|
|
+ socketStore.sendMessage({
|
|
|
+ type: 'run_mcu',
|
|
|
+ data,
|
|
|
+ })
|
|
|
+
|
|
|
+ runAction.value = data
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|