Parcourir la source

创建场景包数量和场景限制

zhangliang2 il y a 2 ans
Parent
commit
cb3ac41ce0

+ 6 - 4
src/views/sceneLibrary/scenarioTestPackageManagementList.vue

@@ -207,11 +207,13 @@ export default {
             this.doSearch();
         },
         async addConfig() {
-            await this.getCount();
+            if (this.roleCode != "0" && this.roleCode != "1") {
+                await this.getCount();
 
-            if (this.createdPackageCount >= this.maxPackageCount) {
-                this.$message.error("已达到测试包创建数量上限");
-                return;
+                if (this.createdPackageCount >= this.maxPackageCount) {
+                    this.$message.error("已达到测试包创建数量上限");
+                    return;
+                }
             }
 
             this.$router.push({ path: "/scenePacketList" });

+ 13 - 7
src/views/sceneLibrary/scenePacketList.vue

@@ -283,6 +283,7 @@ import generalizationList from "./components/generalizationList";
 import generalizationDetail from "./components/generalizationDetail";
 // import viewTree from "./components/elTree";
 import templateView from "./components/templateView";
+import { mapState } from "vuex";
 
 export default {
     name: "scenePacketList", // 场景数据包
@@ -457,7 +458,7 @@ export default {
         };
     },
 
-    computed: {},
+    computed: { ...mapState(["roleCode"]) },
 
     methods: {
         viewTree() {
@@ -933,11 +934,13 @@ export default {
                     return;
                 }
 
-                if (element.sceneNum > this.maxSceneCount) {
-                    this.$message.error(
-                        `场景数量不能超过${this.maxSceneCount}`
-                    );
-                    return;
+                if (this.roleCode != "0" && this.roleCode != "1") {
+                    if (element.sceneNum > this.maxSceneCount) {
+                        this.$message.error(
+                            `场景数量不能超过${this.maxSceneCount}`
+                        );
+                        return;
+                    }
                 }
 
                 if (element.children && element.children.length > 0) {
@@ -1059,7 +1062,10 @@ export default {
         }
 
         this.getRuleList();
-        this.getCount();
+
+        if (this.roleCode != "0" && this.roleCode != "1") {
+            this.getCount();
+        }
     },
 };
 </script>