@@ -52,7 +52,7 @@ export default {
this.fileList = []
this.files.map(file => {
let fileName = file.substring(file.lastIndexOf('/') + 1)
- fileName = fileName.substring(0, fileName.indexOf('_')) + fileName.substring(fileName.lastIndexOf('.'))
+ fileName = fileName.substring(0, fileName.lastIndexOf('_', fileName.lastIndexOf('_') - 1)) + fileName.substring(fileName.lastIndexOf('.'))
this.fileList.push({ name: fileName, url: file })
})
}
@@ -47,7 +47,7 @@ export default {
this.fileList.push({ url: file })
- })
+ })
@@ -139,6 +139,9 @@ export default {
screenshots: []
},
+ clearDefect () {
+ this.defect = this.init()
+ },
submitForm (callback) {
this.$refs['defectForm'].validate(valid => {
if (valid) {
@@ -151,6 +151,15 @@ export default {
this.getList()
+ watch: {
+ dialogFormVisible: {
+ handler (nv, ov) {
+ if (!nv) {
+ this.$refs.defectForm.clearDefect()
+ }
methods: {
...TestCaseUtils,
...mapGetters(['getRefreshTestCaseListFunc', 'getRefreshDefectListFunc']),
@@ -186,6 +186,15 @@ export default {
this.initData()
+ this.$refs.testCaseForm.clearTestCaseData()
@@ -167,6 +167,9 @@ export default {
associatedCode: ''
+ clearTestCaseData () {
+ this.testCase = this.init()
getList () {
let url = Api.TESTCASE.USER_TEST_CASES.replace('{taskCode}', this.testCase.taskCode)
.replace('{designerId}', this.testCase.designerId)