Browse Source

设备更改

qinhb 1 năm trước cách đây
mục cha
commit
6b6289ee18

+ 4 - 0
src/views/device/alias/index.vue

@@ -144,6 +144,10 @@ option.value = Object.assign(option.value, {
     {
       label: "字段解释",
       prop: "filedExplain"
+    },
+    {
+      label: "字段排序",
+      prop: "sort"
     }
   ],
 });

+ 30 - 4
src/views/device/data/index.vue

@@ -43,8 +43,8 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const deviceList = ref([])
 const searchPage = (params, done) =>{
-  if(!search.value.deviceNo || search.value.ts.length == 0){
-    ElMessage.warning("设备或者日期不能为空");
+  if(!search.value.deviceNo){
+    ElMessage.warning("请先选择设备进行查询");
     done()
     return;
   }
@@ -60,6 +60,18 @@ const searchPage = (params, done) =>{
         props: { label: "deviceName", value: "deviceNo", },
       },
         {
+          label: "任务编号",
+          prop: "taskNo",
+          search: true,
+          hide: true,
+        },
+        {
+          label: "序列号",
+          prop: "seqNo",
+          search: true,
+          hide: true,
+        },
+        {
           label: "采集时间",
           prop: "ts",
           search: true,
@@ -84,8 +96,10 @@ const searchPage = (params, done) =>{
       })
     }
   })
-  search.value.startTime = search.value.ts[0]
-  search.value.endTime = search.value.ts[1]
+  if(search.value.ts){
+    search.value.startTime = search.value.ts[0]
+    search.value.endTime = search.value.ts[1]
+  }
   dataList()
   done()
 
@@ -109,6 +123,18 @@ option.value = Object.assign(option.value, {
     props: { label: "deviceName", value: "deviceNo", },
   },
     {
+      label: "任务编号",
+      prop: "taskNo",
+      search: true,
+      hide: true,
+    },
+    {
+      label: "序列号",
+      prop: "seqNo",
+      search: true,
+      hide: true,
+    },
+    {
       label: "采集时间",
       prop: "ts",
       search: true,

+ 19 - 5
src/views/device/instance/index.vue

@@ -16,7 +16,7 @@
         @current-change="dataList"
         @selection-change="selectionChange"
     >
-      <template #collect="scope">
+<!--      <template #collect="scope">
         <el-switch
             active-value="1"
             inactive-value="0"
@@ -26,9 +26,9 @@
             v-model="scope.row.collect"
             @click="changeItem($event,scope.row)"
             class="ml-2"
-            style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
+            style="&#45;&#45;el-switch-on-color: #13ce66; &#45;&#45;el-switch-off-color: #ff4949"
         />
-      </template>
+      </template>-->
       <template #menu="{size,row,index}">
         <el-button
             v-hasPerm="[buttonPermission.DEVICE.BTNS.maintenance_edit]"
@@ -296,6 +296,20 @@ option.value = Object.assign(option.value, {
       },
     },
     {
+      label: "连接状态",
+      prop: "collectState",
+      width: 100,
+      display: false,
+      html: true,
+      formatter: (val) => {
+        if (val.onlineState === "1") {
+          return '<b class="el-tag el-tag--success el-tag--light">已连接</b>';
+        } else {
+          return '<b class="el-tag el-tag--warning el-tag--light">未连接</b>';
+        }
+      },
+    },
+    {
       label: "负责人",
       prop: "head",
       width: 120,
@@ -337,14 +351,14 @@ option.value = Object.assign(option.value, {
         value: "deviceNo",
       }
     },
-    {
+    /*{
       label: "是否采集",
       prop: "collect",
       editDisplay: false,
       addDisplay: false,
       slot: true,
       width: 100,
-    },
+    },*/
     {
       label: "供应厂商",
       prop: "manufacturer",

+ 5 - 5
src/views/device/log/index.vue

@@ -66,14 +66,14 @@ option.value = Object.assign(option.value, {
       prop: "logType",
       search: true,
       type: 'select',
-      dicData: [{label: "通知",value:"0"},{label: "预警",value:"1"},{label: "错误",value:"2"}],
+      dicData: [{label: "通知",value:"1"},{label: "预警",value:"2"},{label: "错误",value:"3"}],
       html: true,
       formatter: (val) => {
-        if (val.logType === "0") {
+        if (val.logType === "1") {
           return '<b class="el-tag el-tag--info el-tag--light">通知</b>';
-        } else if (val.logType === "1") {
-          return '<b class="el-tag el-tag--warning el-tag--light">预警</b>';
         } else if (val.logType === "2") {
+          return '<b class="el-tag el-tag--warning el-tag--light">预警</b>';
+        } else if (val.logType === "3") {
           return '<b class="el-tag el-tag--danger el-tag--light">错误</b>';
         }
       },
@@ -81,7 +81,7 @@ option.value = Object.assign(option.value, {
     {
       label: "日志内容",
       prop: "logContent",
-      width: 350,
+      width: 550,
       overHidden: true
     },
     {

+ 33 - 4
src/views/device/pac/index.vue

@@ -16,6 +16,19 @@
         @current-change="dataList"
         @selection-change="selectionChange"
     >
+      <template #collect="scope">
+        <el-switch
+            active-value="1"
+            inactive-value="0"
+            inline-prompt
+            active-text="是"
+            inactive-text="否"
+            v-model="scope.row.collect"
+            @click="changeItem($event,scope.row)"
+            class="ml-2"
+            style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
+        />
+      </template>
       <template #menu-left="{ size }">
         <el-button
           :disabled="toDeleteIds.length < 1"
@@ -32,8 +45,7 @@
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
-import buttonPermission from "@/common/configs/buttonPermission";
-import {configList} from "@/api/device";
+import {configSave,configList,deviceUpdateCollect} from "@/api/device";
 import { useCommonStoreHook } from "@/store";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
@@ -59,7 +71,16 @@ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
-
+const changeItem =(obj,row) => {
+  deviceUpdateCollect({id: row.id,collect: row.collect,deviceNo: row.deviceNo}).then((data)=>{
+    if(data.code === '200'){
+      ElMessage.success(data.msg);
+    }else{
+      row.collect = row.collect === '0' ? '1' : '0'
+      ElMessage.error(data.msg);
+    }
+  })
+}
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   delBtn: false,
@@ -98,8 +119,8 @@ option.value = Object.assign(option.value, {
       prop: "deviceType",
       type: "select",
       width: 130,
+      editDisabled: true,
       overHidden: true,
-      search: true,
       dicUrl:
         dictDataUtil.request_url +
         dictDataUtil.TYPE_CODE.device_type,
@@ -152,6 +173,14 @@ option.value = Object.assign(option.value, {
       },
     },
     {
+      label: "是否采集",
+      prop: "collect",
+      editDisplay: false,
+      addDisplay: false,
+      slot: true,
+      width: 100,
+    },
+    {
       label: "负责人",
       prop: "head",
       width: 160,

+ 1 - 1
src/views/plan/prepare/index.vue

@@ -47,7 +47,7 @@
         <el-button
             type="primary"
             link
-            v-if="row.materialState === '-' || row.deviceState === '-' || row.bom === '-' || row.craftFile === '-'"
+            v-if="row.deviceState === '0' || row.bom === '-' || row.craftFile === '-' || row.materialState === '0'"
             size="small"
             @click="handleRefresh(row.workOrderCode)"
         ><i-ep-edit />刷新