router.js 5.9 KB
Newer Older
C
Captain.B 已提交
1 2 3
import Vue from "vue";
import VueRouter from 'vue-router'
import RouterSidebar from "./RouterSidebar";
C
chenjianxing 已提交
4 5
import Setting from "../../settings/Setting";
import User from "../../settings/system/User";
C
Captain.B 已提交
6 7
import EditPerformanceTestPlan from "../../performance/test/EditPerformanceTestPlan";
import PerformanceTestPlan from "../../performance/test/PerformanceTestPlan";
C
chenjianxing 已提交
8 9 10 11 12 13 14 15 16 17
import Organization from "../../settings/system/Organization";
import OrganizationMember from "../../settings/organization/OrganizationMember";
import Member from "../../settings/workspace/WorkspaceMember";
import TestResourcePool from "../../settings/system/TestResourcePool";
import MsProject from "../../project/MsProject";
import OrganizationWorkspace from "../../settings/organization/OrganizationWorkspace";
import PersonSetting from "../../settings/personal/PersonSetting";
import SystemWorkspace from "../../settings/system/SystemWorkspace";
import PerformanceChart from "../../performance/report/components/PerformanceChart";
import PerformanceTestReport from "../../performance/report/PerformanceTestReport";
C
chenjianxing 已提交
18 19
import ApiTestReport from "../../api/report/ApiTestReport";
import ApiTest from "../../api/ApiTest";
C
chenjianxing 已提交
20
import PerformanceTest from "../../performance/PerformanceTest";
Q
q4speed 已提交
21
import ApiTestConfig from "../../api/test/ApiTestConfig";
C
chenjianxing 已提交
22
import PerformanceTestHome from "../../performance/home/PerformanceTestHome";
C
chenjianxing 已提交
23
import ApiTestList from "../../api/test/ApiTestList";
C
chenjianxing 已提交
24
import ApiTestHome from "../../api/home/ApiTestHome";
C
chenjianxing 已提交
25
import PerformanceReportView from "../../performance/report/PerformanceReportView";
C
chenjianxing 已提交
26
import ApiReportView from "../../api/report/ApiReportView";
C
chenjianxing 已提交
27 28
import TrackHome from "../../track/home/TrackHome";
import TestPlan from "../../track/plan/TestPlan";
C
chenjianxing 已提交
29
import TestPlanView from "../../track/plan/TestPlanView";
C
chenjianxing 已提交
30 31
import TestCase from "../../track/case/TestCase";
import TestTrack from "../../track/TestTrack";
C
Captain.B 已提交
32 33 34 35 36

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
C
Captain.B 已提交
37
    {path: "/", redirect: '/setting/personsetting'},
C
Captain.B 已提交
38
    {
C
Captain.B 已提交
39 40
      path: "/sidebar",
      components: {
C
Captain.B 已提交
41 42 43 44
        sidebar: RouterSidebar
      }
    },
    {
C
Captain.B 已提交
45 46
      path: "/setting",
      components: {
C
Captain.B 已提交
47
        content: Setting
C
Captain.B 已提交
48 49
      },
      children: [
50 51
        {
          path: 'user',
C
Captain.B 已提交
52
          component: User,
S
shiziyuan9527 已提交
53 54 55
        },
        {
          path: 'organization',
C
Captain.B 已提交
56 57
          component: Organization,
        },
S
shiziyuan9527 已提交
58 59 60 61
        {
          path: 'organizationmember',
          component: OrganizationMember,
        },
62 63 64 65
        {
          path: 'organizationworkspace',
          component: OrganizationWorkspace,
        },
S
shiziyuan9527 已提交
66 67 68 69
        {
          path: 'personsetting',
          component: PersonSetting
        },
C
Captain.B 已提交
70
        {
W
W23123 已提交
71 72
          path: 'member',
          component: Member
S
shiziyuan9527 已提交
73
        },
74 75 76 77
        {
          path: 'systemworkspace',
          component: SystemWorkspace
        },
S
shiziyuan9527 已提交
78 79 80
        {
          path: 'testresourcepool',
          component: TestResourcePool
C
Captain.B 已提交
81 82
        }
      ]
H
haifeng414 已提交
83 84
    },
    {
C
chenjianxing 已提交
85 86 87
      path: "/api",
      name: "api",
      redirect: "/api/home",
H
haifeng414 已提交
88
      components: {
C
chenjianxing 已提交
89
        content: ApiTest
H
haifeng414 已提交
90
      },
91 92 93
      children: [
        {
          path: 'home',
C
chenjianxing 已提交
94
          name: 'fucHome',
C
chenjianxing 已提交
95
          component: ApiTestHome,
96 97
        },
        {
Q
q4speed 已提交
98 99
          path: "test/:type",
          name: "ApiTestConfig",
Q
q4speed 已提交
100
          component: ApiTestConfig,
Q
q4speed 已提交
101
          props: (route) => ({id: route.query.id})
102 103
        },
        {
Q
q4speed 已提交
104 105
          path: "test/list/:projectId",
          name: "ApiTestList",
C
chenjianxing 已提交
106
          component: ApiTestList
107 108 109
        },
        {
          path: "project/:type",
C
chenjianxing 已提交
110
          name: "fucProject",
111 112 113 114
          component: MsProject
        },
        {
          path: "report/:type",
C
chenjianxing 已提交
115
          name: "fucReport",
C
chenjianxing 已提交
116
          component: ApiTestReport
C
chenjianxing 已提交
117 118 119 120
        },
        {
          path: "report/view/:reportId",
          name: "fucReportView",
C
chenjianxing 已提交
121
          component: ApiReportView
H
haifeng414 已提交
122
        }
123
      ]
C
Captain.B 已提交
124
    },
H
haifeng414 已提交
125
    {
126 127 128
      path: "/performance",
      name: "performance",
      redirect: "/performance/home",
H
haifeng414 已提交
129
      components: {
130
        content: PerformanceTest
C
Captain.B 已提交
131
      },
132 133 134
      children: [
        {
          path: 'home',
C
chenjianxing 已提交
135
          name: 'perHome',
136 137 138
          component: PerformanceTestHome,
        },
        {
C
Captain.B 已提交
139
          path: 'test/create',
140 141 142 143
          name: "createPerTest",
          component: EditPerformanceTestPlan,
        },
        {
C
Captain.B 已提交
144
          path: "test/edit/:testId",
C
chenjianxing 已提交
145
          name: "editPerTest",
146 147 148 149 150 151 152 153 154 155
          component: EditPerformanceTestPlan,
          props: {
            content: (route) => {
              return {
                ...route.params
              }
            }
          }
        },
        {
C
Captain.B 已提交
156
          path: "test/:projectId",
C
chenjianxing 已提交
157
          name: "perPlan",
158 159 160 161
          component: PerformanceTestPlan
        },
        {
          path: "project/:type",
C
chenjianxing 已提交
162
          name: "perProject",
163 164 165 166
          component: MsProject
        },
        {
          path: "report/:type",
C
chenjianxing 已提交
167
          name: "perReport",
168 169 170 171
          component: PerformanceTestReport
        },
        {
          path: "chart",
C
chenjianxing 已提交
172
          name: "perChart",
173
          component: PerformanceChart
C
chenjianxing 已提交
174 175 176 177 178
        },
        {
          path: "report/view/:reportId",
          name: "perReportView",
          component: PerformanceReportView
179 180
        }
      ]
C
chenjianxing 已提交
181 182 183 184 185 186 187 188 189 190 191 192 193 194
    },
    {
      path: "/track",
      name: "track",
      redirect: "/track/home",
      components: {
        content: TestTrack
      },
      children: [
        {
          path: 'home',
          name: 'trackHome',
          component: TrackHome,
        },
C
chenjianxing 已提交
195
        {
C
chenjianxing 已提交
196
          path: 'case/:projectId',
C
chenjianxing 已提交
197 198 199
          name: 'testCase',
          component: TestCase,
        },
C
chenjianxing 已提交
200 201 202 203 204
        {
          path: 'case/edit/:caseId',
          name: 'testCaseEdit',
          component: TestCase,
        },
C
chenjianxing 已提交
205
        {
C
chenjianxing 已提交
206
          path: "plan/:type",
C
chenjianxing 已提交
207 208 209
          name: "testPlan",
          component: TestPlan
        },
C
chenjianxing 已提交
210 211 212 213 214
        {
          path: "plan/view/:planId",
          name: "planView",
          component: TestPlanView
        },
C
chenjianxing 已提交
215 216 217 218 219 220
        {
          path: "project/:type",
          name: "trackProject",
          component: MsProject
        }
      ]
C
Captain.B 已提交
221
    }
C
Captain.B 已提交
222
  ]
C
Captain.B 已提交
223 224 225
});

export default router