Browse Source

设备历史

liqianyi 6 tháng trước cách đây
mục cha
commit
fb8f88d0d3

+ 5 - 2
src/views/modules/device/device-add-or-update.vue

@@ -105,7 +105,7 @@
               <upload-component
                 :displayStar="false"
                 :accept="'*'"
-                v-model="fileList1"
+                :file-obj-list="fileList1"
                 @uploadSuccess="uploadSuccess1"
               />
             </el-form-item>
@@ -115,7 +115,7 @@
               <upload-component
                 :displayStar="false"
                 :accept="'*'"
-                v-model="fileList2"
+                :file-obj-list="fileList2"
                 @uploadSuccess="uploadSuccess2"
               />
             </el-form-item>
@@ -149,6 +149,7 @@ export default {
         fileList2: [],
         dataForm: {},
         dataRule: {
+          code: [{ required: true, message: '网关编码不能为空', trigger: 'blur' }],
           codeNumber: [{ required: true, message: '设备编号不能为空', trigger: 'blur' }],
           name: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }]
         }
@@ -168,6 +169,7 @@ export default {
             this.dataForm = data.data
             // 操作说明书
             if (this.dataForm.attachList) {
+              this.fileList1 = []
               this.dataForm.attachList.forEach((item) => {
                 this.fileList1.push({
                   name: item.fileName,
@@ -178,6 +180,7 @@ export default {
             }
             // 检定报告附件
             if (this.dataForm.attachListVerification) {
+              this.fileList2 = []
               this.dataForm.attachListVerification.forEach((item) => {
                 this.fileList2.push({
                   name: item.fileName,

+ 280 - 4
src/views/modules/device/device-history.vue

@@ -83,13 +83,289 @@
         label="经度">
       </el-table-column>
       <el-table-column
-        fixed="right"
         header-align="center"
         align="center"
-        width="60"
-        label="操作">
+        min-width="150"
+        label="NC软件版本">
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="detailHandle(scope.row)">详情</el-button>
+          <span v-for="item in scope.row.points" v-if="item.name==='NCVersion'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="NC名称">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='NCInfo'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="第一轴下一指令">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos1'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="第二轴下一指令">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos2'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="第三轴下一指令">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos3'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="第四轴下一指令">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos4'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="第五轴下一指令">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos5'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        label="第六轴下一指令">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos6'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="自动运行时间">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='RunTime'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="自动启动时间">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='StartTime'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="循环时间">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='CycleTime'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="上电时间">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='KeepAliveTime'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="系统日期">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='SystemDate'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="系统时间">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='SystemTime'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="100"
+        :show-overflow-tooltip="true"
+        label="主程序名">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='MainProName'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="当前运行程序号">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='CuRunProNum'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="120"
+        :show-overflow-tooltip="true"
+        label="当前运行程序内容">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='CuRunProContent'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="120"
+        :show-overflow-tooltip="true"
+        label="设备报警">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='AlarmMsg'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="100"
+        :show-overflow-tooltip="true"
+        label="进给设定转速FA">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='FeedSetSpeed'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="100"
+        :show-overflow-tooltip="true"
+        label="进给实际速度FE">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='FeedActualSpeed'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="主轴设定转速">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='SpindleSetSpeed'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="主轴实际转速">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='SpindleActualSpeed'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="主轴倍率">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='SpindleRate'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="进给倍率">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='FeedRate'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="快速移动倍率">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='MoveRate'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="主轴负载">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='SpindleLoad'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="第一轴伺服轴负载">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad1'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="第二轴伺服轴负载">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad2'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="第三轴伺服轴负载">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad3'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="第四轴伺服轴负载">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad4'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="90"
+        label="第五轴伺服轴负载">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad5'">{{ item.value }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        header-align="center"
+        align="center"
+        min-width="100"
+        label="第六轴伺服轴负载">
+        <template slot-scope="scope">
+          <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad6'">{{ item.value }}</span>
         </template>
       </el-table-column>
     </el-table>

+ 3 - 3
src/views/modules/device/device-list.vue

@@ -222,14 +222,14 @@
           fixed="right"
           header-align="center"
           align="center"
-          width="240"
+          width="190"
           label="操作">
           <template slot-scope="scope">
-            <el-button v-if="isAuth('prod:equipment:info')" type="text" size="small" @click="detailHandle(scope.row.id)">查看</el-button>
+<!--            <el-button v-if="isAuth('prod:equipment:info')" type="text" size="small" @click="detailHandle(scope.row.id)">查看</el-button>-->
+            <el-button v-if="isAuth('prod:equipment:info')" type="text" size="small" @click="historyHandle(scope.row)">历史数据</el-button>
             <el-button v-if="isAuth('prod:equipment:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button>
             <el-button v-if="isAuth('prod:updateVerification:update')" type="text" size="small" @click="historyHandle(scope.row)">检定</el-button>
             <el-button v-if="isAuth('prod:updateBreakage:update')" type="text" size="small" @click="historyHandle(scope.row)">报损</el-button>
-            <el-button v-if="isAuth('prod:equipment:info')" type="text" size="small" @click="historyHandle(scope.row)">历史数据</el-button>
           </template>
         </el-table-column>
       </el-table>