feat: 添加脑图

This commit is contained in:
chenjianxing 2021-03-10 21:35:19 +08:00
parent e3bb866969
commit dc0cc7425a
10 changed files with 87 additions and 29 deletions

View File

@ -49,7 +49,8 @@
"vuex": "^3.1.2",
"xml-js": "^1.6.11",
"yan-progress": "^1.0.3",
"jsonpath": "^1.1.0"
"jsonpath": "^1.1.0",
"vue-minder-editor-plus": "^1.0.13"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",

View File

@ -24,9 +24,8 @@
:label="item.title"
:closable="item.closable"
:name="item.name">
<api-list-container-with-doc
<ms-tab-button
v-if="item.type === 'list'"
:is-api-list-enable="isApiListEnable"
:active-dom.sync="activeDom"
:left-tip="$t('api_test.definition.api_title')"
:right-tip="$t('api_test.definition.doc_title')"
@ -45,7 +44,6 @@
:currentRow="currentRow"
:select-node-ids="selectNodeIds"
:trash-enable="trashEnable"
:is-api-list-enable="isApiListEnable"
:queryDataType="queryDataType"
:selectDataRange="selectDataRange"
@changeSelectDataRangeAll="changeSelectDataRangeAll"
@ -70,7 +68,7 @@
v-if="activeDom==='right'"
:project-id="projectId"
:module-ids="selectNodeIds"/>
</api-list-container-with-doc>
</ms-tab-button>
<!-- 添加/编辑测试窗口-->
<div v-if="item.type=== 'ADD'" class="ms-api-div">
<ms-api-config :syncTabs="syncTabs" @runTest="runTest" @saveApi="saveApi" @createRootModel="createRootModel" ref="apiConfig"
@ -146,7 +144,7 @@ import ApiCaseSimpleList from "./components/list/ApiCaseSimpleList";
import ApiDocumentsPage from "@/business/components/api/definition/components/list/ApiDocumentsPage";
import MsTableButton from "@/business/components/common/components/MsTableButton";
import ApiListContainerWithDoc from "@/business/components/common/components/MsTabButton";
import MsTabButton from "@/business/components/common/components/MsTabButton";
export default {
name: "ApiDefinition",
@ -159,7 +157,7 @@ import ApiListContainerWithDoc from "@/business/components/common/components/MsT
},
},
components: {
ApiListContainerWithDoc,
MsTabButton,
MsTableButton,
ApiCaseSimpleList,
MsApiModule,
@ -206,7 +204,6 @@ import ApiListContainerWithDoc from "@/business/components/common/components/MsT
type: "list",
closable: false
}],
isApiListEnable: true,
activeDom: "left",
syncTabs: [],
projectId: "",

View File

@ -238,10 +238,6 @@ export default {
type: Boolean,
default: false,
},
isApiListEnable: {
type: Boolean,
default: false,
},
isReadOnly: {
type: Boolean,
default: false

View File

@ -21,10 +21,6 @@ export default {
projectId:String,
moduleIds:Array,
activeDom:String,
isApiListEnable: {
type: Boolean,
default: false,
},
},
created: function () {
},

View File

@ -222,7 +222,6 @@ import {downloadFile, getUUID} from "@/common/js/utils";
import {PROJECT_NAME} from '@/common/js/constants';
import {getCurrentProjectID, getCurrentUser} from "@/common/js/utils";
import {API_LIST, TEST_CASE_LIST, WORKSPACE_ID} from '@/common/js/constants';
import ApiListContainer from "./ApiListContainer";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import ApiStatus from "@/business/components/api/definition/components/list/ApiStatus";
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
@ -343,7 +342,6 @@ export default {
type: Boolean,
default: false,
},
isApiListEnable: Boolean,
isReadOnly: {
type: Boolean,
default: false

View File

@ -28,7 +28,7 @@
<script>
export default {
name: "ApiListContainerWithDoc",
name: "MsTabButton",
data() {
return {
isShow: true,

View File

@ -14,7 +14,15 @@
<ms-main-container>
<el-tabs v-model="activeName" @tab-click="addTab" @tab-remove="removeTab">
<el-tab-pane name="default" :label="$t('api_test.definition.case_title')">
<ms-tab-button
:active-dom.sync="activeDom"
:left-tip="'用例列表'"
:left-content="'CAS'"
:right-tip="'E脑图'"
:right-content="'脑图'"
:middle-button-enable="false">
<test-case-list
v-if="activeDom === 'left'"
:checkRedirectID="checkRedirectID"
:module-options="moduleOptions"
:select-node-ids="selectNodeIds"
@ -29,6 +37,10 @@
@setCondition="setCondition"
ref="testCaseList">
</test-case-list>
<testcase-minder
v-if="activeDom === 'right'"
ref="testCaseList"/>
</ms-tab-button>
</el-tab-pane>
<el-tab-pane
:key="item.name"
@ -85,10 +97,14 @@ import MsMainContainer from "../../common/components/MsMainContainer";
import {checkoutTestManagerOrTestUser, getCurrentProjectID, getUUID, hasRoles} from "../../../../common/js/utils";
import TestCaseNodeTree from "../common/TestCaseNodeTree";
import {TrackEvent,LIST_CHANGE} from "@/business/components/common/head/ListEvent";
import TestcaseMinder from "@/business/components/track/case/components/minder/TestcaseMinder";
import MsTabButton from "@/business/components/common/components/MsTabButton";
export default {
name: "TestCase",
components: {
MsTabButton,
TestcaseMinder,
TestCaseNodeTree,
MsMainContainer,
MsAsideContainer, MsContainer, TestCaseList, NodeTree, TestCaseEdit, SelectMenu
@ -109,8 +125,8 @@ export default {
tabs: [],
renderComponent:true,
loading: false,
type:''
type:'',
activeDom: 'left'
}
},
mounted() {

View File

@ -1,12 +1,9 @@
<template>
<div class="card-container">
<el-card class="card-content" v-loading="result.loading">
<template v-slot:header>
<div class="card-container" v-loading="result.loading">
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
:tip="$t('commons.search_by_name_or_id')" title="" :show-create="false"
/>
</template>
:tip="$t('commons.search_by_name_or_id')" title="" :show-create="false"/>
<el-table
border
:data="tableData"
@ -168,7 +165,6 @@
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
</el-card>
<batch-edit ref="batchEdit" @batchEdit="batchEdit"
:typeArr="typeArr" :value-arr="valueArr" :dialog-title="$t('test_track.case.batch_edit_case')"/>

View File

@ -0,0 +1,56 @@
<template>
<div class="minder">
<!-- <testcase-minder-header/>-->
<!-- <div id="minder-container"></div>-->
<minder-editor class="minder-container" :import-json="importJson"/>
</div>
</template>
<script>
export default {
name: "TestcaseMinder",
components: {},
data() {
return {
importJson: {
"root": {
"data": {
"text": "test111"
},
"children": [
{ "data": { "text": "新闻"}},
{ "data": { "text": "网页"} },
{ "data": { "text": "贴吧"} },
{ "data": { "text": "知道"} },
{ "data": { "text": "音乐" } },
{ "data": { "text": "图片"} },
{ "data": { "text": "视频"} },
{ "data": { "text": "地图" } },
{ "data": { "text": "百科","expandState":"collapse"}}
]
},
"template":"default"
}
}
},
mounted() {
}
}
</script>
<style scoped>
.minder-container {
width: 100%;
height: 600px;
}
.minder-container >>> .mind-editor {
position: revert;
height: 600px;
}
.minder {
padding: 20px;
}
</style>

View File

@ -22,6 +22,8 @@ import {left2RightDrag, bottom2TopDrag, right2LeftDrag} from "../common/js/direc
import JsonSchemaEditor from './components/common/json-schema/schema/index';
import JSONPathPicker from 'vue-jsonpath-picker';
import VueClipboard from 'vue-clipboard2'
import vueMinderEditor from 'vue-minder-editor-plus'
Vue.use(vueMinderEditor)
Vue.use(JsonSchemaEditor);
import VuePapaParse from 'vue-papa-parse'