lushixing 2 月之前
父节点
当前提交
bd77939363

+ 1 - 1
src/router/modules/designAgentManager.js

@@ -22,7 +22,7 @@ const designAgentManagerRouter = {
       meta: { title: "智能体对话" }
     },
     {
-      path: "imagetextToImage",
+      path: "/designAgent/imagetextToImage/:id",
       component: () => import("@/views/design-agent/feature-mod-index"),
       name: "imagetextToImage",
       hidden: true,

+ 4 - 1
src/store/modules/permission.js

@@ -16,8 +16,11 @@ function hasPermission(menu, route,parentRouter) {
     let routerPath = route.path;
     routerPath = parentRouterPath +"/" + routerPath;
     if(menu[routerPath]){
-        return true;
+      return true;
     }
+		if (routerPath.indexOf('/:id') > -1) {
+			return true;
+		}
   }
   return false;
 }

+ 11 - 8
src/views/design-agent/feature-mod-index.vue

@@ -360,7 +360,7 @@ export default {
       viewLoading: false,
       resultImage: '',
       pagesData: {},
-      pagesId: 1,
+      pagesId: null,
       replaceIndex: null,
       ruleForm: {
         imageUrl: '',
@@ -399,30 +399,33 @@ export default {
   },
   //页面创建的时候执行
   mounted() {
-    const id = this.$route.params.id;
+    if (!this.pagesId) {
+      this.pagesId = this.$route.params.id;
+    }
     this.clearFormData();
-    if (id == 1) {
+    if (this.pagesId == 1) {
       this.pagesData = {
         title: '创意生图',
-        applicationId: id, // 1:文生图 2:图生图 3:图片生成线稿
+        applicationId: this.pagesId, // 1:文生图 2:图生图 3:图片生成线稿
         desc: '通过详细的文字描述,AI将为您生成符合要求的服装设计方案。'
       }
     }
-    if (id == 2) {
+    if (this.pagesId == 2) {
       this.pagesData = {
         title: '图生图',
-        applicationId: id, // 1:文生图 2:图生图 3:图片生成线稿
+        applicationId: this.pagesId, // 1:文生图 2:图生图 3:图片生成线稿
         desc: '上传参考图片,AI将基于图片内容创作新的服装设计。'
       }
     }
-    if (id == 3) {
+    if (this.pagesId == 3) {
       this.pagesData = {
         title: '线稿生成',
-        applicationId: id, // 1:文生图 2:图生图 3:图片生成线稿
+        applicationId: this.pagesId, // 1:文生图 2:图生图 3:图片生成线稿
         desc: '上传确定好的服装设计图,AI将提取静物轮廓生成专业的线稿。'
       }
     }
   },
+
   computed: {
     token() {
       return getToken();

+ 1 - 2
src/views/design-agent/index.vue

@@ -423,8 +423,7 @@ export default {
     },
     gotoTools(id) {
       this.$router.push({
-        name: 'imagetextToImage',
-        params: { id: id }
+        path: `/designAgent/imagetextToImage/${id}`
       })
     }
   }