This commit is contained in:
fit2-zhao 2021-02-24 11:04:39 +08:00
commit aa6bf4cb6e
3 changed files with 495 additions and 485 deletions

View File

@ -27,6 +27,7 @@
<!-- 列表集合 -->
<ms-api-list
v-if="item.type === 'list' && activeDom==='api' "
@runTest="runTest"
:module-tree="nodeTree"
:module-options="moduleOptions"
:current-protocol="currentProtocol"

View File

@ -160,7 +160,7 @@
:key="index"/>
</template>
<el-table-column fixed="right" v-if="!isReadOnly" :label="$t('commons.operating')" min-width="130"
<el-table-column fixed="right" v-if="!isReadOnly" :label="$t('commons.operating')" min-width="180"
align="center">
<template slot="header">
<span>{{ $t('commons.operating') }}
@ -168,6 +168,10 @@
</span>
</template>
<template v-slot:default="scope">
<ms-table-operator-button class="run-button" :is-tester-permission="true"
:tip="$t('api_test.automation.execute')"
icon="el-icon-video-play"
@exec="runApi(scope.row)"/>
<ms-table-operator-button :tip="$t('commons.reduction')" icon="el-icon-refresh-left"
@exec="reductionApi(scope.row)" v-if="trashEnable" v-tester/>
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="editApi(scope.row)" v-else
@ -206,42 +210,42 @@
<script>
import MsTableHeader from '../../../../common/components/MsTableHeader';
import MsTableOperator from "../../../../common/components/MsTableOperator";
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
import MsTableButton from "../../../../common/components/MsTableButton";
import MsTablePagination from "../../../../common/pagination/TablePagination";
import MsTag from "../../../../common/components/MsTag";
import MsApiCaseList from "../case/ApiCaseList";
import MsContainer from "../../../../common/components/MsContainer";
import MsBottomContainer from "../BottomContainer";
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
import MsBatchEdit from "../basis/BatchEdit";
import {API_METHOD_COLOUR, API_STATUS, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData";
import {downloadFile} 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";
import {API_DEFINITION_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsTipButton from "@/business/components/common/components/MsTipButton";
import CaseBatchMove from "@/business/components/api/definition/components/basis/BatchMove";
import ApiListContainerWithDoc from "@/business/components/api/definition/components/list/ApiListContainerWithDoc";
import {
import MsTableHeader from '../../../../common/components/MsTableHeader';
import MsTableOperator from "../../../../common/components/MsTableOperator";
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
import MsTableButton from "../../../../common/components/MsTableButton";
import MsTablePagination from "../../../../common/pagination/TablePagination";
import MsTag from "../../../../common/components/MsTag";
import MsApiCaseList from "../case/ApiCaseList";
import MsContainer from "../../../../common/components/MsContainer";
import MsBottomContainer from "../BottomContainer";
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
import MsBatchEdit from "../basis/BatchEdit";
import {API_METHOD_COLOUR, API_STATUS, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData";
import {downloadFile} 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";
import {API_DEFINITION_CONFIGS} from "@/business/components/common/components/search/search-components";
import MsTipButton from "@/business/components/common/components/MsTipButton";
import CaseBatchMove from "@/business/components/api/definition/components/basis/BatchMove";
import ApiListContainerWithDoc from "@/business/components/api/definition/components/list/ApiListContainerWithDoc";
import {
_handleSelect,
_handleSelectAll, getLabel,
getSelectDataCounts, initCondition,
setUnSelectIds, toggleAllSelection
} from "@/common/js/tableUtils";
import {_filter, _sort} from "@/common/js/tableUtils";
import {Api_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
} from "@/common/js/tableUtils";
import {_filter, _sort} from "@/common/js/tableUtils";
import {Api_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
export default {
export default {
name: "ApiList",
components: {
HeaderCustom,
@ -329,7 +333,7 @@
currentProtocol: String,
selectNodeIds: Array,
isSelectThisWeek: String,
activeDom: String,
activeDom:String,
visible: {
type: Boolean,
default: false,
@ -396,8 +400,8 @@
isApiListEnableChange(data) {
this.$emit('isApiListEnableChange', data);
},
activeDomChange(tabType) {
this.$emit("activeDomChange", tabType);
activeDomChange(tabType){
this.$emit("activeDomChange",tabType);
},
initTable() {
getLabel(this, API_LIST);
@ -525,6 +529,11 @@
editApi(row) {
this.$emit('editApi', row);
},
runApi(row) {
let request = JSON.parse(row.request);
row.request = request
this.$emit('runTest', row);
},
reductionApi(row) {
let tmp = JSON.parse(JSON.stringify(row));
tmp.request = null;
@ -600,7 +609,7 @@
let ids = arr.map(row => row.id);
param.ids = ids;
param.projectId = getCurrentProjectID();
param.moduleId = param.nodeId;
param.moduleId=param.nodeId;
param.condition = this.condition;
param.selectAllDate = this.isSelectAllDate;
param.unSelectIds = this.unSelection;
@ -721,7 +730,7 @@
this.$refs.searchBar.open();
}
},
}
}
</script>
<style scoped>

View File

@ -40,7 +40,7 @@
<el-col>
<el-form-item :label="$t('system_parameter_setting.test_recipients')">
<el-input v-model="formInline.recipient" :placeholder="$t('system_parameter_setting.test_recipients')"
autocomplete="new-password" show-password type="text" ref="input">
autocomplete="new-password" type="text" ref="input">
</el-input>
<p style="color: #8a8b8d">({{ $t('system_parameter_setting.tip') }})</p>
</el-form-item>