fix (接口自动化): 部分嵌套组件较多页面改成懒加载

This commit is contained in:
fit2-zhao 2021-09-02 10:25:45 +08:00 committed by fit2-zhao
parent e35a4614ca
commit 7b1447d2c4
4 changed files with 61 additions and 115 deletions

View File

@ -97,23 +97,17 @@
<script> <script>
import MsContainer from "@/business/components/common/components/MsContainer";
import MsAsideContainer from "@/business/components/common/components/MsAsideContainer";
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
import MsApiScenarioList from "@/business/components/api/automation/scenario/ApiScenarioList";
import {getCurrentProjectID, getCurrentUser, getUUID, hasPermission} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentUser, getUUID, hasPermission} from "@/common/js/utils";
import MsApiScenarioModule from "@/business/components/api/automation/scenario/ApiScenarioModule";
import MsEditApiScenario from "./scenario/EditApiScenario";
export default { export default {
name: "ApiAutomation", name: "ApiAutomation",
components: { components: {
MsApiScenarioModule, MsApiScenarioModule: () => import("@/business/components/api/automation/scenario/ApiScenarioModule"),
MsApiScenarioList, MsApiScenarioList: () => import("@/business/components/api/automation/scenario/ApiScenarioList"),
MsMainContainer, MsMainContainer: () => import("@/business/components/common/components/MsMainContainer"),
MsAsideContainer, MsAsideContainer: () => import("@/business/components/common/components/MsAsideContainer"),
MsContainer, MsContainer: () => import("@/business/components/common/components/MsContainer"),
MsEditApiScenario MsEditApiScenario: () => import("./scenario/EditApiScenario")
}, },
comments: {}, comments: {},
computed: { computed: {

View File

@ -229,63 +229,41 @@
</template> </template>
<script> <script>
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import {downloadFile, getCurrentProjectID, getUUID, strMapToObj} from "@/common/js/utils";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import MsTag from "../../../common/components/MsTag";
import {downloadFile, getCurrentProjectID, getUUID, objToStrMap, strMapToObj} from "@/common/js/utils";
import SysnApiReportDetail from "../report/SysnApiReportDetail";
import MsApiReportDetail from "../report/ApiReportDetail";
import MsTableMoreBtn from "./TableMoreBtn";
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
import MsTestPlanList from "./testplan/TestPlanList";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import {API_SCENARIO_CONFIGS} from "@/business/components/common/components/search/search-components"; import {API_SCENARIO_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton"; import {API_SCENARIO_LIST} from "../../../../../common/js/constants";
import PriorityTableItem from "../../../track/common/tableItems/planview/PriorityTableItem";
import PlanStatusTableItem from "../../../track/common/tableItems/plan/PlanStatusTableItem";
import BatchEdit from "../../../track/case/components/BatchEdit";
import {API_SCENARIO_LIST, PROJECT_NAME, WORKSPACE_ID} from "../../../../../common/js/constants";
import EnvironmentSelect from "../../definition/components/environment/EnvironmentSelect";
import BatchMove from "../../../track/case/components/BatchMove";
import MsRunMode from "./common/RunMode";
import MsTaskCenter from "../../../task/TaskCenter";
import { import {
getCustomTableHeader, getCustomTableWidth, getLastTableSortField, saveLastTableSortField getCustomTableHeader, getCustomTableWidth, getLastTableSortField, saveLastTableSortField
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import {API_SCENARIO_FILTERS} from "@/common/js/table-constants"; import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import MsTable from "@/business/components/common/components/table/MsTable";
import {scenario} from "@/business/components/track/plan/event-bus"; import {scenario} from "@/business/components/track/plan/event-bus";
export default { export default {
name: "MsApiScenarioList", name: "MsApiScenarioList",
components: { components: {
MsTable, MsTable: () => import("@/business/components/common/components/table/MsTable"),
MsTableColumn, MsTableColumn: () => import("@/business/components/common/components/table/MsTableColumn"),
HeaderLabelOperate, HeaderLabelOperate: () => import("@/business/components/common/head/HeaderLabelOperate"),
HeaderCustom, HeaderCustom: () => import("@/business/components/common/head/HeaderCustom"),
BatchMove, BatchMove: () => import("../../../track/case/components/BatchMove"),
EnvironmentSelect, EnvironmentSelect: () => import("../../definition/components/environment/EnvironmentSelect"),
BatchEdit, BatchEdit: () => import("../../../track/case/components/BatchEdit"),
PlanStatusTableItem, PlanStatusTableItem: () => import("../../../track/common/tableItems/plan/PlanStatusTableItem"),
PriorityTableItem, PriorityTableItem: () => import("../../../track/common/tableItems/planview/PriorityTableItem"),
MsTableHeaderSelectPopover, MsTableHeaderSelectPopover: () => import("@/business/components/common/components/table/MsTableHeaderSelectPopover"),
MsTablePagination, MsTablePagination: () => import("@/business/components/common/pagination/TablePagination"),
MsTableMoreBtn, MsTableMoreBtn: () => import("./TableMoreBtn"),
ShowMoreBtn, ShowMoreBtn: () => import("@/business/components/track/case/components/ShowMoreBtn"),
MsTableHeader, MsTableHeader: () => import("@/business/components/common/components/MsTableHeader"),
MsTag, MsTag: () => import("../../../common/components/MsTag"),
MsApiReportDetail, MsApiReportDetail: () => import("../report/ApiReportDetail"),
SysnApiReportDetail, SysnApiReportDetail: () => import("../report/SysnApiReportDetail"),
MsScenarioExtendButtons, MsScenarioExtendButtons: () => import("@/business/components/api/automation/scenario/ScenarioExtendBtns"),
MsTestPlanList, MsTestPlanList: () => import("./testplan/TestPlanList"),
MsTableOperatorButton, MsTableOperatorButton: () => import("@/business/components/common/components/MsTableOperatorButton"),
MsRunMode, MsRunMode: () => import("./common/RunMode"),
MsTaskCenter MsTaskCenter: () => import("../../../task/TaskCenter")
}, },
props: { props: {
referenced: { referenced: {

View File

@ -326,7 +326,6 @@ import {API_STATUS, PRIORITY} from "../../definition/model/JsonData";
import {buttons, setComponent} from './menu/Menu'; import {buttons, setComponent} from './menu/Menu';
import {parseEnvironment} from "../../definition/model/EnvironmentModel"; import {parseEnvironment} from "../../definition/model/EnvironmentModel";
import {ELEMENT_TYPE, ELEMENTS} from "./Setting"; import {ELEMENT_TYPE, ELEMENTS} from "./Setting";
import MsApiCustomize from "./ApiCustomize";
import { import {
getUUID, getUUID,
objToStrMap, objToStrMap,
@ -335,25 +334,9 @@ import {
getCurrentProjectID, getCurrentProjectID,
handleCtrlREvent handleCtrlREvent
} from "@/common/js/utils"; } from "@/common/js/utils";
import ApiEnvironmentConfig from "@/business/components/api/test/components/ApiEnvironmentConfig";
import MsInputTag from "./MsInputTag";
import MsRun from "./DebugRun";
import MsApiReportDetail from "../report/SysnApiReportDetail";
import MsVariableList from "./variable/VariableList";
import ApiImport from "../../definition/components/import/ApiImport";
import "@/common/css/material-icons.css" import "@/common/css/material-icons.css"
import OutsideClick from "@/common/js/outside-click"; import OutsideClick from "@/common/js/outside-click";
import ScenarioApiRelevance from "./api/ApiRelevance";
import ScenarioRelevance from "./api/ScenarioRelevance";
import MsComponentConfig from "./component/ComponentConfig";
import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover";
import MaximizeScenario from "./maximize/MaximizeScenario";
import ScenarioHeader from "./maximize/ScenarioHeader";
import MsDrawer from "../../../common/components/MsDrawer";
import MsSelectTree from "../../../common/select-tree/SelectTree";
import {saveScenario} from "@/business/components/api/automation/api-automation"; import {saveScenario} from "@/business/components/api/automation/api-automation";
import MsChangeHistory from "../../../history/ChangeHistory";
import MsTaskCenter from "../../../task/TaskCenter";
let jsonPath = require('jsonpath'); let jsonPath = require('jsonpath');
export default { export default {
@ -368,22 +351,23 @@ export default {
} }
}, },
components: { components: {
MsVariableList, MsVariableList: () => import("./variable/VariableList"),
ScenarioRelevance, ScenarioRelevance: () => import("./api/ScenarioRelevance"),
ScenarioApiRelevance, ScenarioApiRelevance: () => import("./api/ApiRelevance"),
ApiEnvironmentConfig, ApiEnvironmentConfig: () => import("@/business/components/api/test/components/ApiEnvironmentConfig"),
MsApiReportDetail, MsApiReportDetail: () => import("../report/SysnApiReportDetail"),
MsInputTag, MsRun, MsInputTag: () => import("./MsInputTag"),
MsApiCustomize, MsRun: () => import("./DebugRun"),
ApiImport, MsApiCustomize: () => import("./ApiCustomize"),
MsComponentConfig, ApiImport: () => import("../../definition/components/import/ApiImport"),
EnvPopover, MsComponentConfig: () => import("./component/ComponentConfig"),
MaximizeScenario, EnvPopover: () => import("@/business/components/api/automation/scenario/EnvPopover"),
ScenarioHeader, MaximizeScenario: () => import("./maximize/MaximizeScenario"),
MsDrawer, ScenarioHeader: () => import("./maximize/ScenarioHeader"),
MsSelectTree, MsDrawer: () => import("../../../common/components/MsDrawer"),
MsChangeHistory, MsSelectTree: () => import("../../../common/select-tree/SelectTree"),
MsTaskCenter MsChangeHistory: () => import("../../../history/ChangeHistory"),
MsTaskCenter: () => import("../../../task/TaskCenter")
}, },
data() { data() {
return { return {

View File

@ -150,26 +150,15 @@
import {API_STATUS, PRIORITY} from "../../../definition/model/JsonData"; import {API_STATUS, PRIORITY} from "../../../definition/model/JsonData";
import {parseEnvironment} from "../../../definition/model/EnvironmentModel"; import {parseEnvironment} from "../../../definition/model/EnvironmentModel";
import {ELEMENT_TYPE, ELEMENTS} from "../Setting"; import {ELEMENT_TYPE, ELEMENTS} from "../Setting";
import MsApiCustomize from "../ApiCustomize";
import {getCurrentProjectID, getUUID, strMapToObj} from "@/common/js/utils"; import {getCurrentProjectID, getUUID, strMapToObj} from "@/common/js/utils";
import ApiEnvironmentConfig from "@/business/components/api/test/components/ApiEnvironmentConfig";
import MsInputTag from "../MsInputTag";
import MsRun from "../DebugRun";
import MsApiReportDetail from "../../report/ApiReportDetail";
import MsVariableList from "../variable/VariableList";
import ApiImport from "../../../definition/components/import/ApiImport";
import "@/common/css/material-icons.css" import "@/common/css/material-icons.css"
import OutsideClick from "@/common/js/outside-click"; import OutsideClick from "@/common/js/outside-click";
import ScenarioApiRelevance from "../api/ApiRelevance";
import ScenarioRelevance from "../api/ScenarioRelevance";
import MsComponentConfig from "../component/ComponentConfig";
import {handleCtrlSEvent} from "../../../../../../common/js/utils"; import {handleCtrlSEvent} from "../../../../../../common/js/utils";
import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover"; import {saveScenario} from "@/business/components/api/automation/api-automation";
import {buttons, setComponent} from '../menu/Menu';
import MsContainer from "../../../../common/components/MsContainer"; import MsContainer from "../../../../common/components/MsContainer";
import MsMainContainer from "../../../../common/components/MsMainContainer"; import MsMainContainer from "../../../../common/components/MsMainContainer";
import MsAsideContainer from "./MsLeftContainer"; import MsAsideContainer from "./MsLeftContainer";
import {saveScenario} from "@/business/components/api/automation/api-automation";
import {buttons, setComponent} from '../menu/Menu';
let jsonPath = require('jsonpath'); let jsonPath = require('jsonpath');
export default { export default {
@ -190,19 +179,20 @@ export default {
message: String, message: String,
}, },
components: { components: {
MsVariableList,
ScenarioRelevance,
ScenarioApiRelevance,
ApiEnvironmentConfig,
MsApiReportDetail,
MsInputTag, MsRun,
MsApiCustomize,
ApiImport,
MsComponentConfig,
EnvPopover,
MsContainer, MsContainer,
MsMainContainer, MsMainContainer,
MsAsideContainer MsAsideContainer,
MsVariableList: () => import("../variable/VariableList"),
ScenarioRelevance: () => import("../api/ScenarioRelevance"),
ScenarioApiRelevance: () => import("../api/ApiRelevance"),
ApiEnvironmentConfig: () => import("@/business/components/api/test/components/ApiEnvironmentConfig"),
MsApiReportDetail: () => import("../../report/ApiReportDetail"),
MsInputTag: () => import("../MsInputTag"),
MsRun: () => import("../DebugRun"),
MsApiCustomize: () => import("../ApiCustomize"),
ApiImport: () => import("../../../definition/components/import/ApiImport"),
MsComponentConfig: () => import("../component/ComponentConfig"),
EnvPopover: () => import("@/business/components/api/automation/scenario/EnvPopover"),
}, },
data() { data() {
return { return {