瀏覽代碼

模拟硬件接口

lxf 2 年之前
父節點
當前提交
743b18292f
共有 4 個文件被更改,包括 39 次插入22 次删除
  1. 1 1
      .env.development
  2. 1 1
      .env.staging
  3. 35 18
      src/views/shengde/productionSystem/demo/simulation/index.vue
  4. 2 2
      vue.config.js

+ 1 - 1
.env.development

@@ -12,7 +12,7 @@ VUE_APP_IMG_URL='http://www.printmat.cn:8181/file'
 
 VUE_APP_FILE_PREFIX='ftp://www.printmat.cn/'
 
-VUE_APP_MESSAGE_URL='ws://192.168.1.164:8181/api'
+VUE_APP_MESSAGE_URL='ws://192.168.1.164/api'
 
 VUE_APP_TIME = 3000000
 

+ 1 - 1
.env.staging

@@ -14,7 +14,7 @@ VUE_APP_IMG_URL='http://www.printmat.cn:8181/file'
 
 VUE_APP_FILE_PREFIX='ftp://www.printmat.cn/'
 
-VUE_APP_MESSAGE_URL='ws://192.168.1.164:8181'
+VUE_APP_MESSAGE_URL='ws://192.168.1.164/api'
 
 VUE_APP_TIME = 3000000
 

+ 35 - 18
src/views/shengde/productionSystem/demo/simulation/index.vue

@@ -1,20 +1,13 @@
 <template>
   <el-card class="box-card">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
-      <el-form-item>
-        <el-button size="small" @click="getList" class="searchBtn">搜索</el-button>
-      </el-form-item>
-    </el-form>
+    <el-button size="small" @click="getDetail" class="searchBtn">查询</el-button>
 
-    <!-- <el-table :data="tableList" :cell-style="{ padding: '0' }" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
-      <el-table-column label="AAAA" align="center" prop="AAAA" />
-      <el-table-column label="操作" align="center" width="140" fixed="right">
-        <template slot-scope="scope">
-          <el-button type="text" @click="clickUpdate(scope.row)" v-db-click>修改</el-button>
-          <el-button type="text" @click="clickRemove(scope.row)" v-db-click>删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table> -->
+    <div>文件夹路径:</div>
+    <a v-if="detail.fileUrl" style="color: #027db4; cursor: pointer" @click="clickPath(detail.fileUrl)">{{ detail.fileUrl.replace(/\\/g, '/') }}</a>
+    <br />
+
+    <el-button size="small" @click="submit(0)" class="searchBtn">激光完成</el-button>
+    <el-button size="small" @click="submit(1)" style="margin-left: 16px">激光失败</el-button>
   </el-card>
 </template>
 
@@ -25,20 +18,44 @@ export default {
   name: 'simulation',
   data() {
     return {
-      queryParams: {},
-      tableList: [],
+      detail: {},
     }
   },
   created() {},
   mounted() {
-    this.getList()
+    this.getDetail()
   },
   methods: {
-    getList() {
+    getDetail() {
       API.getDrawing({}).then((res) => {
         console.log(res)
+        this.detail = res.data.data
       })
     },
+    clickPath(path) {
+      let a = document.createElement('a')
+      a.href = path.replace(/\//g, '/')
+      a.style.display = 'none'
+      document.body.appendChild(a)
+      a.click()
+      document.body.removeChild(a)
+    },
+    submit(status) {
+      if (this.detail && this.detail.artNum) {
+        let data = {
+          artNum: this.detail.artNum,
+          workshipId: this.detail.workshipId,
+          deviceIdent: '1533311222',
+          result: status,
+        }
+        API.laserEngraving(data).then(() => {
+          this.msgSuccess('提交成功')
+          this.detail = {}
+        })
+      } else {
+        this.msgInfo('请先查询激光图档')
+      }
+    },
   },
 }
 </script>

+ 2 - 2
vue.config.js

@@ -57,9 +57,9 @@ module.exports = {
     proxy: {
       [process.env.VUE_APP_BASE_API]: {
         //本地服务接口地址
-        // target: 'http://www.printmat.cn:8866',
+        target: 'http://www.printmat.cn:8866',
         // target: 'http://116.205.162.119:8866',
-        target: 'http://192.168.1.164:8866',
+        // target: 'http://192.168.1.164:8866',
         changeOrigin: true,
         pathRewrite: {
           [`^${process.env.VUE_APP_BASE_API}`]: '/',