Ver Fonte

更改APS设备同步到工位同步

qinhb há 6 meses atrás
pai
commit
4dd62e207a

+ 26 - 2
src/views/base/modeling/station/index.vue

@@ -38,6 +38,14 @@
           @click="multipleDelete"
           >删除</el-button
         >
+        <el-button
+            :disabled="toDeleteIds.length < 1"
+            type="refresh"
+            icon="el-icon-refresh"
+            :size="size"
+            @click="apsSync"
+        >APS同步</el-button
+        >
       </template>
       <template #menu="{ row, index, type }">
         <el-button @click="binding(row)" text type="primary"
@@ -66,11 +74,12 @@
 <script setup="ts">
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
-import ButtonPermKeys from "@/common/configs/buttonPermission";
+import {syncAps} from "@/api/aps";
 import { useCommonStoreHook } from "@/store";
 import { updateStation } from "@/api/station";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 import { useDictionaryStore } from "@/store";
+import {ElMessage, ElMessageBox} from "element-plus";
 const { dicts } = useDictionaryStore();
 const test = () => {
   isShowTable.value = true;
@@ -116,7 +125,22 @@ function rowSave(form, done, loading) {
   createRow(form, done, loading);
 }
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
-
+const apsSync = () =>{
+  ElMessageBox.confirm("是否同步所选中数据?", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(async () => {
+    let param = {type: 1,codes: toDeleteIds.value}
+    syncAps(param).then((data)=>{
+      if (data.code === "200") {
+        ElMessage.success(data.msg);
+      } else {
+        ElMessage.error(data.msg);
+      }
+    })
+  });
+}
 onMounted(() => {
   // console.log("crudRef", crudRef)
   dataList();

+ 2 - 2
src/views/device/instance/index.vue

@@ -54,14 +54,14 @@
           >删除</el-button
         >
 
-        <el-button
+<!--        <el-button
             :disabled="toDeleteIds.length < 1"
             type="refresh"
             icon="el-icon-refresh"
             :size="size"
             @click="apsSync"
         >APS同步</el-button
-        >
+        >-->
 
       </template>
       <template #menu-right="{}">