@@ -41,6 +46,12 @@
default() {
return this.$t('commons.title')
}
+ },
+ withTip: {
+ type: Boolean,
+ default() {
+ return false
+ }
}
},
methods: {
@@ -80,5 +91,9 @@
font-weight: bold;
}
+ .tip {
+ margin-bottom: 20px;
+ color: red;
+ }
diff --git a/frontend/src/business/components/common/components/MsScheduleConfig.vue b/frontend/src/business/components/common/components/MsScheduleConfig.vue
index e78c3f3a38..9cb5093e99 100644
--- a/frontend/src/business/components/common/components/MsScheduleConfig.vue
+++ b/frontend/src/business/components/common/components/MsScheduleConfig.vue
@@ -73,7 +73,9 @@
this.$emit('scheduleChange');
},
flashResultList() {
- this.$refs.crontabResult.expressionChange();
+ if (this.$refs.crontabResult) {
+ this.$refs.crontabResult.expressionChange();
+ }
},
cancelRefresh() {
if (this.refreshScheduler) {
diff --git a/frontend/src/business/components/common/components/MsScheduleEdit.vue b/frontend/src/business/components/common/components/MsScheduleEdit.vue
index 499b7c45d5..9cb5eed4a8 100644
--- a/frontend/src/business/components/common/components/MsScheduleEdit.vue
+++ b/frontend/src/business/components/common/components/MsScheduleEdit.vue
@@ -31,7 +31,7 @@
-
+
@@ -46,6 +46,7 @@ import CrontabResult from "../cron/CrontabResult";
import {cronValidate} from "@/common/js/cron";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import ScheduleTaskNotification from "../../settings/organization/components/ScheduleTaskNotification";
+import {checkoutTestManagerOrTestUser} from "../../../../common/js/utils";
function defaultCustomValidate() {
return {pass: true};
}
@@ -113,10 +114,13 @@ export default {
name: '',
organizationId: this.currentUser().lastOrganizationId
};
- this.result = this.$post('user/org/member/list/all', param, response => {
- this.scheduleReceiverOptions = response.data
- });
+ if (this.isTesterPermission) {
+ this.result = this.$post('user/org/member/list/all', param, response => {
+ this.scheduleReceiverOptions = response.data
+ });
+ }
+
},
/* handleClick() {
if (this.activeName === "second") {
@@ -188,6 +192,11 @@ export default {
let time1 = new Date(resultList[0]);
let time2 = new Date(resultList[1]);
return time2 - time1;
+ },
+ },
+ computed: {
+ isTesterPermission() {
+ return checkoutTestManagerOrTestUser();
}
}
}
diff --git a/frontend/src/business/components/common/components/report/MsReportTitle.vue b/frontend/src/business/components/common/components/report/MsReportTitle.vue
index 8b58a77e22..fc661d81ba 100644
--- a/frontend/src/business/components/common/components/report/MsReportTitle.vue
+++ b/frontend/src/business/components/common/components/report/MsReportTitle.vue
@@ -9,9 +9,7 @@
-
-
-
+
diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue
index 0d105c2879..1257af30cd 100644
--- a/frontend/src/business/components/performance/report/PerformanceReportView.vue
+++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue
@@ -271,12 +271,14 @@ export default {
let reset = this.exportReportReset;
this.$nextTick(function () {
- html2canvas(document.getElementById('performanceReportExport'), {
- // scale: 2
- }).then(function (canvas) {
- exportPdf(name, [canvas]);
- reset();
- });
+ setTimeout(() => {
+ html2canvas(document.getElementById('performanceReportExport'), {
+ scale: 2
+ }).then(function (canvas) {
+ exportPdf(name, [canvas]);
+ reset();
+ });
+ }, 1000);
});
},
exportReportReset() {
diff --git a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue
index d94e02c8dc..7d51c4f387 100644
--- a/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue
+++ b/frontend/src/business/components/performance/test/components/PerformancePressureConfig.vue
@@ -30,7 +30,7 @@
:placeholder="$t('load_test.input_thread_num')"
v-model="threadGroup.threadNumber"
@change="calculateChart(threadGroup)"
- :min="1"
+ :min="resourcePoolResourceLength"
size="mini"/>
@@ -141,6 +141,7 @@ export default {
activeNames: ["0"],
threadGroups: [],
serializeThreadgroups: false,
+ resourcePoolResourceLength: 1
}
},
mounted() {
@@ -368,6 +369,11 @@ export default {
if (handler.rampUpTime < handler.step) {
handler.step = handler.rampUpTime;
}
+ // 线程数不能小于资源池节点的数量
+ let resourcePool = this.resourcePools.filter(v => v.id === this.resourcePool)[0];
+ if (resourcePool) {
+ this.resourcePoolResourceLength = resourcePool.resources.length;
+ }
handler.options = {
xAxis: {
type: 'category',
diff --git a/frontend/src/business/components/project/MsProject.vue b/frontend/src/business/components/project/MsProject.vue
index 147a478df8..54c45b8e19 100644
--- a/frontend/src/business/components/project/MsProject.vue
+++ b/frontend/src/business/components/project/MsProject.vue
@@ -204,6 +204,7 @@ export default {
});
}
},
+
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
@@ -282,7 +283,18 @@ export default {
},
openEnvironmentConfig(project) {
this.$refs.environmentConfig.open(project.id);
- }
+ },
+ handleEvent(event) {
+ if (event.keyCode === 13) {
+ this.submit('form')
+ }
+ },
+ },
+ created() {
+ document.addEventListener('keydown', this.handleEvent)
+ },
+ beforeDestroy() {
+ document.removeEventListener('keydown', this.handleEvent);
}
}
diff --git a/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue b/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue
index 2cf7f9b523..42002779e3 100644
--- a/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue
+++ b/frontend/src/business/components/settings/organization/components/ScheduleTaskNotification.vue
@@ -2,7 +2,7 @@
-
+
{{ $t('organization.message.create_new_notification') }}
@@ -69,12 +69,14 @@
type="primary"
size="mini"
v-show="scope.row.isSet"
+ :disabled="!isTesterPermission"
@click="handleAddTask(scope.$index,scope.row)"
>{{ $t('commons.add') }}
{{ $t('commons.cancel') }}
@@ -82,6 +84,7 @@
type="primary"
size="mini"
v-show="!scope.row.isSet"
+ :disabled="!isTesterPermission"
@click="handleEditTask(scope.$index,scope.row)"
>{{ $t('commons.edit') }}
@@ -106,6 +110,10 @@ export default {
props: {
testId:String,
scheduleReceiverOptions:Array,
+ isTesterPermission: {
+ type: Boolean,
+ default: true
+ }
},
data() {
return {
@@ -120,7 +128,6 @@ export default {
identification: "",
isReadOnly: false,
testId:this.testId,
-
}],
},
scheduleEventOptions: [
@@ -193,7 +200,6 @@ export default {
},
addTask(data) {
let list = [];
- data.isSet = false;
list.push(data);
let param = {};
param.messageDetail = list;
diff --git a/frontend/src/business/components/settings/personal/PersonSetting.vue b/frontend/src/business/components/settings/personal/PersonSetting.vue
index bff2281cf7..89b15fa6d3 100644
--- a/frontend/src/business/components/settings/personal/PersonSetting.vue
+++ b/frontend/src/business/components/settings/personal/PersonSetting.vue
@@ -86,6 +86,7 @@
import MsDialogFooter from "../../common/components/MsDialogFooter";
import {getCurrentUser, listenGoBack, removeGoBackListener} from "../../../../common/js/utils";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
+ import {PHONE_REGEX} from "@/common/js/regex";
export default {
name: "MsPersonSetting",
@@ -115,7 +116,7 @@
phone: [
{
required: false,
- pattern: '^1(3|4|5|7|8)\\d{9}$',
+ pattern: PHONE_REGEX,
message: this.$t('member.mobile_number_format_is_incorrect'),
trigger: 'blur'
}
diff --git a/frontend/src/business/components/settings/system/EmailSetting.vue b/frontend/src/business/components/settings/system/EmailSetting.vue
index 47d845993f..8de498081d 100644
--- a/frontend/src/business/components/settings/system/EmailSetting.vue
+++ b/frontend/src/business/components/settings/system/EmailSetting.vue
@@ -45,7 +45,7 @@
-
+
@@ -120,7 +120,7 @@ export default {
this.$set(this.formInline, "password", response.data[3].paramValue);
this.$set(this.formInline, "SSL", JSON.parse(response.data[4].paramValue));
this.$set(this.formInline, "TLS", JSON.parse(response.data[5].paramValue));
- this.$set(this.formInline, "SMTP", JSON.parse(response.data[6].paramValue));
+ this.$set(this.formInline, "ANON", JSON.parse(response.data[6].paramValue));
this.$nextTick(() => {
this.$refs.formInline.clearValidate();
})
@@ -143,7 +143,7 @@ export default {
"smtp.password": this.formInline.password,
"smtp.ssl": this.formInline.SSL,
"smtp.tls": this.formInline.TLS,
- "smtp.smtp": this.formInline.SMTP,
+ "smtp.anon": this.formInline.ANON,
};
this.$refs[formInline].validate((valid) => {
if (valid) {
@@ -173,7 +173,7 @@ export default {
{paramKey: "smtp.password", paramValue: this.formInline.password, type: "password", sort: 4},
{paramKey: "smtp.ssl", paramValue: this.formInline.SSL, type: "text", sort: 5},
{paramKey: "smtp.tls", paramValue: this.formInline.TLS, type: "text", sort: 6},
- {paramKey: "smtp.smtp", paramValue: this.formInline.SMTP, type: "text", sort: 7}
+ {paramKey: "smtp.anon", paramValue: this.formInline.ANON, type: "text", sort: 7}
]
this.$refs[formInline].validate(valid => {
diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue
index 4fc1069521..402b4413b1 100644
--- a/frontend/src/business/components/settings/system/User.vue
+++ b/frontend/src/business/components/settings/system/User.vue
@@ -338,6 +338,7 @@ import {hasRole, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsRolesTag from "../../common/components/MsRolesTag";
import {ROLE_ADMIN} from "@/common/js/constants";
import {getCurrentUser} from "../../../../common/js/utils";
+import {PHONE_REGEX} from "@/common/js/regex";
export default {
name: "MsUser",
@@ -380,7 +381,7 @@ export default {
rule: {
id: [
{required: true, message: this.$t('user.input_id'), trigger: 'blur'},
- {min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
+ {min: 1, max: 50, message: this.$t('commons.input_limit', [1, 50]), trigger: 'blur'},
{
required: true,
pattern: '^[^\u4e00-\u9fa5]+$',
@@ -401,7 +402,7 @@ export default {
{required: true, message: this.$t('user.input_phone'), trigger: 'blur'},
{
required: true,
- pattern: '^1(3|4|5|7|8)\\d{9}$',
+ pattern: PHONE_REGEX,
message: this.$t('user.mobile_number_format_is_incorrect'),
trigger: 'blur'
}
diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue
index b58b389157..ee8e4cd59d 100644
--- a/frontend/src/business/components/track/case/TestCase.vue
+++ b/frontend/src/business/components/track/case/TestCase.vue
@@ -55,204 +55,205 @@
diff --git a/frontend/src/business/components/track/case/components/TestCaseDetail.vue b/frontend/src/business/components/track/case/components/TestCaseDetail.vue
index cbc3742ee1..3fad9f2c17 100644
--- a/frontend/src/business/components/track/case/components/TestCaseDetail.vue
+++ b/frontend/src/business/components/track/case/components/TestCaseDetail.vue
@@ -161,6 +161,7 @@ export default {
data() {
return {
result: {},
+ testCase: {},
dialogFormVisible: false,
readOnly: true,
form: {
@@ -190,9 +191,15 @@ export default {
]
};
},
+ mounted() {
+ this.$get('test/case/get/' + this.testCaseId, response => {
+ this.testCase = response.data;
+ });
+ },
+ methods: {},
props: {
- testCase: {
- type: Object
+ testCaseId: {
+ type: String
}
},
}
diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue
index 3a186c0287..1b4a005605 100644
--- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue
+++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue
@@ -256,9 +256,9 @@
diff --git a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue
index 3ac4fc0864..71fe3ec801 100644
--- a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue
+++ b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue
@@ -193,8 +193,7 @@ export default {
let param = {};
Object.assign(param, this.form);
param.name = param.name.trim();
- if (param.name === '') {
- this.$warning(this.$t('test_track.plan.input_plan_name'));
+ if (!this.validate(param)) {
return;
}
param.workspaceId = localStorage.getItem(WORKSPACE_ID);
@@ -227,6 +226,17 @@ export default {
}
});
},
+ validate(param) {
+ if (param.name === '') {
+ this.$warning(this.$t('test_track.plan.input_plan_name'));
+ return false;
+ }
+ if (param.plannedStartTime > param.plannedEndTime) {
+ this.$warning(this.$t('commons.date.data_time_error'));
+ return false;
+ }
+ return true;
+ },
editTestPlan(param) {
this.$post('/test/plan/' + this.operationType, param, () => {
this.$success(this.$t('commons.save_success'));
diff --git a/frontend/src/business/components/track/plan/components/TestPlanList.vue b/frontend/src/business/components/track/plan/components/TestPlanList.vue
index 3f9d82821d..66763e9b36 100644
--- a/frontend/src/business/components/track/plan/components/TestPlanList.vue
+++ b/frontend/src/business/components/track/plan/components/TestPlanList.vue
@@ -137,7 +137,9 @@
-
+
+ {{$t('test_track.plan.plan_delete_tip')}}
+
@@ -171,6 +173,7 @@ export default {
data() {
return {
result: {},
+ enableDeleteTip: false,
queryPath: "/test/plan/list",
deletePath: "/test/plan/delete",
condition: {
@@ -249,6 +252,7 @@ export default {
});
},
handleDelete(testPlan) {
+ this.enableDeleteTip = testPlan.status === 'Underway' ? true : false;
this.$refs.deleteConfirm.open(testPlan);
},
_handleDelete(testPlan) {
diff --git a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue
index 9f7b8bfa66..d1dc718c3b 100644
--- a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue
@@ -215,6 +215,16 @@
item.checked = false;
});
flag ? this.testCases = tableData : this.testCases = this.testCases.concat(tableData);
+ // 去重处理
+ let hash = {}
+ this.testCases = this.testCases.reduce((item, next) => {
+ if (!hash[next.id]) {
+ hash[next.id] = true
+ item.push(next)
+ }
+ return item
+ }, [])
+
this.lineStatus = tableData.length === 50 && this.testCases.length < this.total;
});
}
diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue
index d5a022954b..001917f1f2 100644
--- a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue
@@ -127,7 +127,7 @@
this.listenGoBack();
},
initComponents() {
- this.componentMap.forEach((value, key) =>{
+ this.componentMap.forEach((value, key) => {
if (this.template.content.components.indexOf(key) < 0 && this.components.indexOf(key) < 0) {
this.components.push(key);
}
@@ -205,7 +205,7 @@
if (this.isReport) {
url = '/case/report/get/';
}
- this.$get(url + id, (response) =>{
+ this.$get(url + id, (response) => {
this.template = response.data;
this.template.content = JSON.parse(response.data.content);
if (this.template.content.customComponent) {
@@ -238,7 +238,7 @@
if (this.isReport) {
url = '/case/report/';
}
- this.$post(url + this.type, param, () =>{
+ this.$post(url + this.type, param, () => {
this.$success(this.$t('commons.save_success'));
this.handleClose();
this.$emit('refresh');
diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue
index d4d0f49b29..4e0cec0520 100644
--- a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportView.vue
@@ -210,14 +210,15 @@
let reset = this.exportReportReset;
this.$nextTick(function () {
- html2canvas(document.getElementById('testCaseReportExport'), {
- // scale: 2
- }).then(function(canvas) {
- exportPdf(name, [canvas]);
- reset();
- });
+ setTimeout(() => {
+ html2canvas(document.getElementById('testCaseReportExport'), {
+ scale: 2
+ }).then(function(canvas) {
+ exportPdf(name, [canvas]);
+ reset();
+ });
+ }, 1000);
});
-
},
exportReportReset() {
this.reportExportVisible = false;
@@ -225,7 +226,7 @@
},
}
}
-
+cd