Merge remote-tracking branch 'origin/v1.7' into v1.7
This commit is contained in:
commit
353d047854
|
@ -49,6 +49,9 @@ public class MsScenario extends MsTestElement {
|
||||||
@JSONField(ordinal = 24)
|
@JSONField(ordinal = 24)
|
||||||
private boolean enableCookieShare;
|
private boolean enableCookieShare;
|
||||||
|
|
||||||
|
@JSONField(ordinal = 26)
|
||||||
|
private List<KeyValue> headers;
|
||||||
|
|
||||||
private static final String BODY_FILE_DIR = "/opt/metersphere/data/body";
|
private static final String BODY_FILE_DIR = "/opt/metersphere/data/body";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,7 +90,7 @@ public class MsScenario extends MsTestElement {
|
||||||
}
|
}
|
||||||
// 场景变量和环境变量
|
// 场景变量和环境变量
|
||||||
tree.add(arguments(config));
|
tree.add(arguments(config));
|
||||||
//this.addCsvDataSet(tree, variables);
|
this.addCsvDataSet(tree, variables);
|
||||||
this.addCounter(tree, variables);
|
this.addCounter(tree, variables);
|
||||||
this.addRandom(tree, variables);
|
this.addRandom(tree, variables);
|
||||||
if (CollectionUtils.isNotEmpty(hashTree)) {
|
if (CollectionUtils.isNotEmpty(hashTree)) {
|
||||||
|
@ -131,6 +134,12 @@ public class MsScenario extends MsTestElement {
|
||||||
arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=")
|
arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(this.headers)) {
|
||||||
|
this.headers.stream().filter(KeyValue::isValid).filter(KeyValue::isEnable).forEach(keyValue ->
|
||||||
|
arguments.addArgument(keyValue.getName(), keyValue.getValue(), "=")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ public class HistoricalDataUpgradeService {
|
||||||
scenario.setReferenced("Upgrade");
|
scenario.setReferenced("Upgrade");
|
||||||
scenario.setId(oldScenario.getId());
|
scenario.setId(oldScenario.getId());
|
||||||
scenario.setResourceId(UUID.randomUUID().toString());
|
scenario.setResourceId(UUID.randomUUID().toString());
|
||||||
|
scenario.setHeaders(oldScenario.getHeaders());
|
||||||
LinkedList<MsTestElement> testElements = new LinkedList<>();
|
LinkedList<MsTestElement> testElements = new LinkedList<>();
|
||||||
int index = 1;
|
int index = 1;
|
||||||
for (Request request : oldScenario.getRequests()) {
|
for (Request request : oldScenario.getRequests()) {
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3" class="ms-col-one ms-font">
|
<el-col :span="3" class="ms-col-one ms-font">
|
||||||
<el-link class="head" @click="showScenarioParameters">{{$t('api_test.automation.scenario_total')}}</el-link>
|
<el-link class="head" @click="showScenarioParameters">{{$t('api_test.automation.scenario_total')}}</el-link>
|
||||||
:{{this.currentScenario.variables!=undefined?this.currentScenario.variables.length: 0}}
|
:{{getVariableSize()}}
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3" class="ms-col-one ms-font">
|
<el-col :span="3" class="ms-col-one ms-font">
|
||||||
<el-checkbox v-model="enableCookieShare">共享cookie</el-checkbox>
|
<el-checkbox v-model="enableCookieShare">共享cookie</el-checkbox>
|
||||||
|
@ -196,7 +196,7 @@
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<!--场景公共参数-->
|
<!--场景公共参数-->
|
||||||
<ms-variable-list @setVariables="setVariables" ref="scenarioParameters"/>
|
<ms-variable-list @setVariables="setVariables" ref="scenarioParameters" class="ms-sc-variable-header"/>
|
||||||
<!--外部导入-->
|
<!--外部导入-->
|
||||||
<api-import ref="apiImport" :saved="false" @refresh="apiImport"/>
|
<api-import ref="apiImport" :saved="false" @refresh="apiImport"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -427,8 +427,9 @@
|
||||||
getIdx(index) {
|
getIdx(index) {
|
||||||
return index - 0.33
|
return index - 0.33
|
||||||
},
|
},
|
||||||
setVariables(v) {
|
setVariables(v, headers) {
|
||||||
this.currentScenario.variables = v;
|
this.currentScenario.variables = v;
|
||||||
|
this.currentScenario.headers = headers;
|
||||||
if (this.path.endsWith("/update")) {
|
if (this.path.endsWith("/update")) {
|
||||||
// 直接更新场景防止编辑内容丢失
|
// 直接更新场景防止编辑内容丢失
|
||||||
this.editScenario();
|
this.editScenario();
|
||||||
|
@ -679,7 +680,7 @@
|
||||||
this.editScenario();
|
this.editScenario();
|
||||||
this.debugData = {
|
this.debugData = {
|
||||||
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
||||||
variables: this.currentScenario.variables, referenced: 'Created', enableCookieShare: this.enableCookieShare,
|
variables: this.currentScenario.variables, referenced: 'Created', enableCookieShare: this.enableCookieShare, headers: this.currentScenario.headers,
|
||||||
environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
||||||
};
|
};
|
||||||
this.reportId = getUUID().substring(0, 8);
|
this.reportId = getUUID().substring(0, 8);
|
||||||
|
@ -863,6 +864,9 @@
|
||||||
if (!this.currentScenario.variables) {
|
if (!this.currentScenario.variables) {
|
||||||
this.currentScenario.variables = [];
|
this.currentScenario.variables = [];
|
||||||
}
|
}
|
||||||
|
if (!this.currentScenario.headers) {
|
||||||
|
this.currentScenario.headers = [];
|
||||||
|
}
|
||||||
if (this.currentScenario.id) {
|
if (this.currentScenario.id) {
|
||||||
this.result = this.$get("/api/automation/getApiScenario/" + this.currentScenario.id, response => {
|
this.result = this.$get("/api/automation/getApiScenario/" + this.currentScenario.id, response => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
@ -887,6 +891,9 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (obj.headers) {
|
||||||
|
this.currentScenario.headers = obj.headers;
|
||||||
|
}
|
||||||
this.enableCookieShare = obj.enableCookieShare;
|
this.enableCookieShare = obj.enableCookieShare;
|
||||||
this.scenarioDefinition = obj.hashTree;
|
this.scenarioDefinition = obj.hashTree;
|
||||||
}
|
}
|
||||||
|
@ -905,8 +912,9 @@
|
||||||
this.currentScenario.modulePath = this.getPath(this.currentScenario.apiScenarioModuleId);
|
this.currentScenario.modulePath = this.getPath(this.currentScenario.apiScenarioModuleId);
|
||||||
// 构建一个场景对象 方便引用处理
|
// 构建一个场景对象 方便引用处理
|
||||||
let scenario = {
|
let scenario = {
|
||||||
id: this.currentScenario.id, enableCookieShare: this.enableCookieShare, name: this.currentScenario.name, variables: this.currentScenario.variables,
|
id: this.currentScenario.id, enableCookieShare: this.enableCookieShare, name: this.currentScenario.name, type: "scenario",
|
||||||
type: "scenario", referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
variables: this.currentScenario.variables, headers: this.currentScenario.headers,
|
||||||
|
referenced: 'Created', environmentId: this.currentEnvironmentId, hashTree: this.scenarioDefinition
|
||||||
};
|
};
|
||||||
this.currentScenario.scenarioDefinition = scenario;
|
this.currentScenario.scenarioDefinition = scenario;
|
||||||
if (this.currentScenario.tags instanceof Array) {
|
if (this.currentScenario.tags instanceof Array) {
|
||||||
|
@ -924,7 +932,7 @@
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
showScenarioParameters() {
|
showScenarioParameters() {
|
||||||
this.$refs.scenarioParameters.open(this.currentScenario.variables);
|
this.$refs.scenarioParameters.open(this.currentScenario.variables, this.currentScenario.headers);
|
||||||
},
|
},
|
||||||
apiImport(importData) {
|
apiImport(importData) {
|
||||||
if (importData && importData.data) {
|
if (importData && importData.data) {
|
||||||
|
@ -934,6 +942,16 @@
|
||||||
this.sort();
|
this.sort();
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
getVariableSize() {
|
||||||
|
let size = 0;
|
||||||
|
if (this.currentScenario.variables) {
|
||||||
|
size += this.currentScenario.variables.length;
|
||||||
|
}
|
||||||
|
if (this.currentScenario.headers && this.currentScenario.headers.length > 1) {
|
||||||
|
size += this.currentScenario.headers.length - 1;
|
||||||
|
}
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1066,4 +1084,7 @@
|
||||||
content: "\e722";
|
content: "\e722";
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
.ms-sc-variable-header >>> .el-dialog__body {
|
||||||
|
padding: 0px 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -248,8 +248,8 @@
|
||||||
this.request.customizeReq = this.isCustomizeReq;
|
this.request.customizeReq = this.isCustomizeReq;
|
||||||
let debugData = {
|
let debugData = {
|
||||||
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
||||||
variables: this.currentScenario.variables, referenced: 'Created', enableCookieShare: this.enableCookieShare,
|
variables: this.currentScenario.variables, referenced: 'Created', headers: this.currentScenario.headers,
|
||||||
environmentId: this.currentEnvironmentId, hashTree: [this.request]
|
enableCookieShare: this.enableCookieShare, environmentId: this.currentEnvironmentId, hashTree: [this.request]
|
||||||
};
|
};
|
||||||
this.runData.push(debugData);
|
this.runData.push(debugData);
|
||||||
/*触发执行操作*/
|
/*触发执行操作*/
|
||||||
|
|
|
@ -205,8 +205,8 @@
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.debugData = {
|
this.debugData = {
|
||||||
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
id: this.currentScenario.id, name: this.currentScenario.name, type: "scenario",
|
||||||
variables: this.currentScenario.variables, referenced: 'Created', enableCookieShare: this.enableCookieShare,
|
variables: this.currentScenario.variables, headers: this.currentScenario.headers,
|
||||||
environmentId: this.currentEnvironmentId, hashTree: [this.controller]
|
referenced: 'Created', enableCookieShare: this.enableCookieShare, environmentId: this.currentEnvironmentId, hashTree: [this.controller]
|
||||||
};
|
};
|
||||||
this.reportId = getUUID().substring(0, 8);
|
this.reportId = getUUID().substring(0, 8);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,57 +1,88 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog :title="$t('api_test.scenario.variables')" :close-on-click-modal="false"
|
<el-dialog title="场景变量" :close-on-click-modal="false"
|
||||||
:visible.sync="visible" class="visible-dialog" width="60%"
|
:visible.sync="visible" class="visible-dialog" width="60%"
|
||||||
@close="close" v-loading="loading">
|
@close="close" v-loading="loading">
|
||||||
<div>
|
<el-tabs v-model="activeName">
|
||||||
<el-input placeholder="变量名称搜索" style="width: 50%;margin: 0px 0px 10px" v-model="selectVariable" size="small" @change="filter" @keyup.enter="filter">
|
<el-tab-pane :label="$t('api_test.scenario.variables')" name="variable">
|
||||||
<el-select v-model="searchType" slot="prepend" placeholder="类型" style="width: 90px" @change="filter">
|
<div style="margin-top: 10px">
|
||||||
<el-option value="CONSTANT" label="常量"></el-option>
|
<el-row style="margin-bottom: 10px">
|
||||||
<el-option value="LIST" label="列表"></el-option>
|
<el-col :span="8">
|
||||||
<el-option value="CSV" label="CSV"></el-option>
|
<el-input placeholder="变量名称搜索" v-model="selectVariable" size="small" @change="filter" @keyup.enter="filter">
|
||||||
<el-option value="COUNTER" label="计数器"></el-option>
|
<el-select v-model="searchType" slot="prepend" placeholder="类型" style="width: 90px" @change="filter">
|
||||||
<el-option value="RANDOM" label="随机数"></el-option>
|
<el-option value="CONSTANT" label="常量"></el-option>
|
||||||
</el-select>
|
<el-option value="LIST" label="列表"></el-option>
|
||||||
</el-input>
|
<el-option value="CSV" label="CSV"></el-option>
|
||||||
<el-row>
|
<el-option value="COUNTER" label="计数器"></el-option>
|
||||||
<el-col :span="12">
|
<el-option value="RANDOM" label="随机数"></el-option>
|
||||||
<div style="border:1px #DCDFE6 solid; min-height: 400px;border-radius: 4px ;width: 100% ;">
|
</el-select>
|
||||||
<el-table ref="table" border :data="variables" class="adjust-table" @select-all="select" @select="select"
|
</el-input>
|
||||||
v-loading="loading" @row-click="edit" height="400px" :row-class-name="tableRowClassName">
|
</el-col>
|
||||||
<el-table-column type="selection" width="38"/>
|
|
||||||
<el-table-column prop="num" label="ID" sortable/>
|
|
||||||
<el-table-column prop="name" :label="$t('api_test.variable_name')" sortable show-overflow-tooltip/>
|
|
||||||
<el-table-column prop="type" :label="$t('test_track.case.type')">
|
|
||||||
<template v-slot:default="scope">
|
|
||||||
<span>{{types.get(scope.row.type)}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="value" :label="$t('api_test.value')" show-overflow-tooltip/>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<ms-edit-constant v-if="editData.type=='CONSTANT'" ref="parameters" :editData.sync="editData"/>
|
|
||||||
<ms-edit-counter v-if="editData.type=='COUNTER'" ref="counter" :editData.sync="editData"/>
|
|
||||||
<ms-edit-random v-if="editData.type=='RANDOM'" ref="random" :editData.sync="editData"/>
|
|
||||||
<ms-edit-list-value v-if="editData.type=='LIST'" ref="listValue" :editData="editData"/>
|
|
||||||
<ms-edit-csv v-if="editData.type=='CSV'" ref="csv" :editData.sync="editData"/>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-dropdown split-button type="primary" @command="handleClick" @click="handleClick('CONSTANT')" size="small" style="margin-left: 10px">
|
||||||
|
{{$t('commons.add')}}
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="CONSTANT">常量</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="LIST">列表</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="CSV">CSV</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="COUNTER">计数器</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="RANDOM">随机数</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<el-button size="small" style="margin-left: 10px" @click="deleteVariable">{{$t('commons.delete')}}</el-button>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div style="border:1px #DCDFE6 solid; min-height: 400px;border-radius: 4px ;width: 100% ;">
|
||||||
|
<el-table ref="table" border :data="variables" class="adjust-table" @select-all="select" @select="select"
|
||||||
|
v-loading="loading" @row-click="edit" height="400px" :row-class-name="tableRowClassName">
|
||||||
|
<el-table-column type="selection" width="38"/>
|
||||||
|
<el-table-column prop="num" label="ID" sortable/>
|
||||||
|
<el-table-column prop="name" :label="$t('api_test.variable_name')" sortable show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="type" :label="$t('test_track.case.type')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<span>{{types.get(scope.row.type)}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="value" :label="$t('api_test.value')" show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<ms-edit-constant v-if="editData.type=='CONSTANT'" ref="parameters" :editData.sync="editData"/>
|
||||||
|
<ms-edit-counter v-if="editData.type=='COUNTER'" ref="counter" :editData.sync="editData"/>
|
||||||
|
<ms-edit-random v-if="editData.type=='RANDOM'" ref="random" :editData.sync="editData"/>
|
||||||
|
<ms-edit-list-value v-if="editData.type=='LIST'" ref="listValue" :editData="editData"/>
|
||||||
|
<ms-edit-csv v-if="editData.type=='CSV'" ref="csv" :editData.sync="editData"/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane :label="$t('api_test.scenario.headers')" name="headers">
|
||||||
|
<!-- 请求头-->
|
||||||
|
<el-tooltip class="item-tabs" effect="dark" :content="$t('api_test.request.headers')" placement="top-start" slot="label">
|
||||||
|
<span>{{$t('api_test.request.headers')}}
|
||||||
|
<div class="el-step__icon is-text ms-api-col ms-variable-header" v-if="headers.length>1">
|
||||||
|
<div class="el-step__icon-inner">{{headers.length-1}}</div>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-row>
|
||||||
|
<el-link class="ms-variable-link" @click="batchAdd" style="color: #783887"> {{$t("commons.batch_add")}}</el-link>
|
||||||
|
</el-row>
|
||||||
|
<div style="min-height: 400px">
|
||||||
|
<ms-api-key-value :items="headers"/>
|
||||||
|
<batch-add-parameter @batchSave="batchSave" ref="batchAddParameter"/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<div>
|
<div>
|
||||||
<el-button style="margin-right:10px" @click="deleteVariable">{{$t('commons.delete')}}</el-button>
|
<el-button type="primary" @click="save">{{$t('commons.confirm')}}</el-button>
|
||||||
<el-dropdown split-button type="primary" @command="handleClick" @click="handleClick('CONSTANT')" placement="top-end">
|
|
||||||
{{$t('commons.add')}}
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item command="CONSTANT">常量</el-dropdown-item>
|
|
||||||
<el-dropdown-item command="LIST">列表</el-dropdown-item>
|
|
||||||
<el-dropdown-item command="CSV">CSV</el-dropdown-item>
|
|
||||||
<el-dropdown-item command="COUNTER">计数器</el-dropdown-item>
|
|
||||||
<el-dropdown-item command="RANDOM">随机数</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -67,6 +98,9 @@
|
||||||
import MsEditListValue from "./EditListValue";
|
import MsEditListValue from "./EditListValue";
|
||||||
import MsEditCsv from "./EditCsv";
|
import MsEditCsv from "./EditCsv";
|
||||||
import {getUUID} from "@/common/js/utils";
|
import {getUUID} from "@/common/js/utils";
|
||||||
|
import MsApiKeyValue from "../../../definition/components/ApiKeyValue";
|
||||||
|
import BatchAddParameter from "../../../definition/components/basis/BatchAddParameter";
|
||||||
|
import {KeyValue} from "../../../definition/model/ApiTestModel";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsVariableList",
|
name: "MsVariableList",
|
||||||
|
@ -78,11 +112,15 @@
|
||||||
MsEditCounter,
|
MsEditCounter,
|
||||||
MsEditRandom,
|
MsEditRandom,
|
||||||
MsEditListValue,
|
MsEditListValue,
|
||||||
MsEditCsv
|
MsEditCsv,
|
||||||
|
MsApiKeyValue,
|
||||||
|
BatchAddParameter
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
variables: [],
|
variables: [],
|
||||||
|
headers: [],
|
||||||
|
activeName: "variable",
|
||||||
searchType: "",
|
searchType: "",
|
||||||
selectVariable: "",
|
selectVariable: "",
|
||||||
condition: {},
|
condition: {},
|
||||||
|
@ -103,6 +141,26 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
batchAdd() {
|
||||||
|
this.$refs.batchAddParameter.open();
|
||||||
|
},
|
||||||
|
batchSave(data) {
|
||||||
|
if (data) {
|
||||||
|
let params = data.split("\n");
|
||||||
|
let keyValues = [];
|
||||||
|
params.forEach(item => {
|
||||||
|
let line = item.split(/,|,/);
|
||||||
|
let required = false;
|
||||||
|
if (line[1] === '必填' || line[1] === 'true') {
|
||||||
|
required = true;
|
||||||
|
}
|
||||||
|
keyValues.push(new KeyValue({name: line[0], required: required, value: line[2], description: line[3], type: "text", valid: false, file: false, encode: true, enable: true, contentType: "text/plain"}));
|
||||||
|
})
|
||||||
|
keyValues.forEach(item => {
|
||||||
|
this.headers.unshift(item);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
handleClick(command) {
|
handleClick(command) {
|
||||||
this.editData = {};
|
this.editData = {};
|
||||||
this.editData.type = command;
|
this.editData.type = command;
|
||||||
|
@ -135,12 +193,16 @@
|
||||||
isSelect(row) {
|
isSelect(row) {
|
||||||
return this.selection.includes(row.id)
|
return this.selection.includes(row.id)
|
||||||
},
|
},
|
||||||
open: function (variables) {
|
open: function (variables, headers) {
|
||||||
this.variables = variables;
|
this.variables = variables;
|
||||||
|
this.headers = headers;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
this.editData = {type: "CONSTANT"};
|
this.editData = {type: "CONSTANT"};
|
||||||
this.addParameters(this.editData);
|
this.addParameters(this.editData);
|
||||||
},
|
},
|
||||||
|
save() {
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
close() {
|
close() {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
let saveVariables = [];
|
let saveVariables = [];
|
||||||
|
@ -152,7 +214,7 @@
|
||||||
})
|
})
|
||||||
this.selectVariable = "";
|
this.selectVariable = "";
|
||||||
this.searchType = "";
|
this.searchType = "";
|
||||||
this.$emit('setVariables', saveVariables);
|
this.$emit('setVariables', saveVariables, this.headers);
|
||||||
},
|
},
|
||||||
deleteVariable() {
|
deleteVariable() {
|
||||||
let ids = Array.from(this.selection);
|
let ids = Array.from(this.selection);
|
||||||
|
@ -208,4 +270,16 @@
|
||||||
.ms-variable-hidden-row {
|
.ms-variable-hidden-row {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ms-variable-header {
|
||||||
|
background: #783887;
|
||||||
|
color: white;
|
||||||
|
height: 18px;
|
||||||
|
border-radius: 42%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-variable-link {
|
||||||
|
float: right;
|
||||||
|
margin-right: 45px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue