Merge branch 'v1.7' of https://github.com/metersphere/metersphere into v1.7
This commit is contained in:
commit
aa73812c74
|
@ -9,27 +9,28 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsDrawer from "../../../../common/components/MsDrawer";
|
import MsDrawer from "../../../../common/components/MsDrawer";
|
||||||
import MsInstructionsIcon from "../../../../common/components/MsInstructionsIcon";
|
import MsInstructionsIcon from "../../../../common/components/MsInstructionsIcon";
|
||||||
|
|
||||||
export default {
|
let dotReplace = "#DOT_MASK#";
|
||||||
name: "MsApiJsonpathSuggest",
|
export default {
|
||||||
components: {MsInstructionsIcon, MsDrawer},
|
name: "MsApiJsonpathSuggest",
|
||||||
data() {
|
components: {MsInstructionsIcon, MsDrawer},
|
||||||
return {
|
data() {
|
||||||
visible: false,
|
return {
|
||||||
isCheckAll: false,
|
visible: false,
|
||||||
data: {},
|
isCheckAll: false,
|
||||||
};
|
data: {},
|
||||||
},
|
};
|
||||||
props: {
|
},
|
||||||
tip: {
|
props: {
|
||||||
type: String,
|
tip: {
|
||||||
default() {
|
type: String,
|
||||||
return ""
|
default() {
|
||||||
}
|
return ""
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
@ -50,14 +51,46 @@
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
},
|
},
|
||||||
pathChangeHandler(data) {
|
pathChangeHandler(data) {
|
||||||
let paramNames = data.split('.');
|
let paramNames = [];
|
||||||
let result = this.getParamValue(this.data, 0, paramNames);
|
let result = {};
|
||||||
|
try {
|
||||||
|
paramNames = this.parseSpecialChar(data);
|
||||||
|
result = this.getParamValue(this.data, 0, paramNames);
|
||||||
|
} catch (e) {
|
||||||
|
result = {};
|
||||||
|
result.key = 'var';
|
||||||
|
}
|
||||||
result.path = '$.' + data;
|
result.path = '$.' + data;
|
||||||
this.$emit('addSuggest', result);
|
this.$emit('addSuggest', result);
|
||||||
},
|
},
|
||||||
|
// 替换. 等特殊字符
|
||||||
|
parseSpecialChar(data) {
|
||||||
|
let paramNames = [];
|
||||||
|
let reg = /\['.*'\]/;
|
||||||
|
let searchStr = reg.exec(data);
|
||||||
|
if (searchStr) {
|
||||||
|
searchStr.forEach(item => {
|
||||||
|
if (data.startsWith("['")) {
|
||||||
|
data = data.replace(item, item.replace('.', dotReplace));
|
||||||
|
} else {
|
||||||
|
data = data.replace(item, '.' + item.replace('.', dotReplace));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
paramNames = data.split('.');
|
||||||
|
} else {
|
||||||
|
paramNames = data.split('.');
|
||||||
|
}
|
||||||
|
for (let i in paramNames) {
|
||||||
|
if (paramNames[i].search(reg) > -1) {
|
||||||
|
paramNames[i] = paramNames[i].substring(2, paramNames[i].length - 2);
|
||||||
|
}
|
||||||
|
paramNames[i] = paramNames[i].replace(dotReplace, '.');
|
||||||
|
}
|
||||||
|
return paramNames;
|
||||||
|
},
|
||||||
getParamValue(obj, index, params) {
|
getParamValue(obj, index, params) {
|
||||||
if (params.length < 1) {
|
if (params.length < 1) {
|
||||||
return "";
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
let param = params[index];
|
let param = params[index];
|
||||||
|
|
|
@ -145,8 +145,8 @@
|
||||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column fixed="right"
|
||||||
:label="$t('commons.operating')" min-width="150">
|
:label="$t('commons.operating')" min-width="150">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)"
|
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)"
|
||||||
@deleteClick="handleDelete(scope.row)">
|
@deleteClick="handleDelete(scope.row)">
|
||||||
|
|
|
@ -37,15 +37,15 @@
|
||||||
<plan-status-table-item :value="scope.row.status"/>
|
<plan-status-table-item :value="scope.row.status"/>
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown" chang>
|
<el-dropdown-menu slot="dropdown" chang>
|
||||||
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Prepare'}">
|
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{item: scope.row, status: 'Prepare'}">
|
||||||
{{ $t('test_track.plan.plan_status_prepare') }}
|
{{ $t('test_track.plan.plan_status_prepare') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item :disabled="!isTestManagerOrTestUser"
|
<el-dropdown-item :disabled="!isTestManagerOrTestUser"
|
||||||
:command="{id: scope.row.id, status: 'Underway'}">
|
:command="{item: scope.row, status: 'Underway'}">
|
||||||
{{ $t('test_track.plan.plan_status_running') }}
|
{{ $t('test_track.plan.plan_status_running') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item :disabled="!isTestManagerOrTestUser"
|
<el-dropdown-item :disabled="!isTestManagerOrTestUser"
|
||||||
:command="{id: scope.row.id, status: 'Completed'}">
|
:command="{item: scope.row, status: 'Completed'}">
|
||||||
{{ $t('test_track.plan.plan_status_completed') }}
|
{{ $t('test_track.plan.plan_status_completed') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
|
@ -257,20 +257,25 @@ export default {
|
||||||
this.$emit('testPlanEdit', testPlan);
|
this.$emit('testPlanEdit', testPlan);
|
||||||
},
|
},
|
||||||
statusChange(param) {
|
statusChange(param) {
|
||||||
|
console.log(this.tableData);
|
||||||
|
let oldStatus = param.item.status;
|
||||||
|
let newStatus = param.status;
|
||||||
|
param = param.item;
|
||||||
|
param.status = newStatus;
|
||||||
this.$post('/test/plan/edit', param, () => {
|
this.$post('/test/plan/edit', param, () => {
|
||||||
for (let i = 0; i < this.tableData.length; i++) {
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
if (this.tableData[i].id == param.id) { // 手动修改当前状态后,前端结束时间先用当前时间,等刷新后变成后台数据(相等)
|
if (this.tableData[i].id == param.id) { // 手动修改当前状态后,前端结束时间先用当前时间,等刷新后变成后台数据(相等)
|
||||||
if (this.tableData[i].status !== "Completed" && param.status === "Completed") {
|
if (oldStatus !== "Completed" && newStatus === "Completed") {
|
||||||
this.tableData[i].actualEndTime = new Date();
|
this.tableData[i].actualEndTime = Date.now();
|
||||||
} // 非完成->已完成,结束时间=null
|
} // 非完成->已完成,结束时间=null
|
||||||
else if (this.tableData[i].status !== "Underway" && param.status === "Underway") {
|
else if (oldStatus !== "Underway" && newStatus === "Underway") {
|
||||||
this.tableData[i].actualStartTime = new Date();
|
this.tableData[i].actualStartTime = Date.now();
|
||||||
this.tableData[i].actualEndTime = "";
|
this.tableData[i].actualEndTime = "";
|
||||||
} // 非进行中->进行中,结束时间=null
|
} // 非进行中->进行中,结束时间=null
|
||||||
else if (this.tableData[i].status !== "Prepare" && param.status === "Prepare") {
|
else if (oldStatus !== "Prepare" && newStatus === "Prepare") {
|
||||||
this.tableData[i].actualStartTime = this.tableData[i].actualEndTime = "";
|
this.tableData[i].actualStartTime = this.tableData[i].actualEndTime = "";
|
||||||
} // 非未开始->未开始,结束时间=null
|
} // 非未开始->未开始,结束时间=null
|
||||||
this.tableData[i].status = param.status;
|
this.tableData[i].status = newStatus;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue