|
@@ -59,7 +59,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <el-form-item label="bug描述" prop="bugDescribe" label-width="112px">
|
|
|
+ <el-form-item label="bug描述" label-width="112px">
|
|
|
<div id="wangeditorDescribe" class="force-height" style="margin-bottom:22px;width:89.6%;" />
|
|
|
</el-form-item>
|
|
|
<div class="line-between">
|
|
@@ -101,7 +101,12 @@
|
|
|
<el-form-item label="SDK版本" label-width="147px"><el-input v-model="form.sdkVersion" autocomplete="off" style="width:76%;" /></el-form-item>
|
|
|
</div>
|
|
|
<div :class="{'line-between': form.creatorList === userNames,'line-between-add':form.creatorList !== userNames}">
|
|
|
- <el-form-item label="app版本号" label-width="124px"><el-input v-model="form.appVersion" autocomplete="off" style="width:76%;" /></el-form-item>
|
|
|
+ <el-form-item label="app版本号" label-width="124px">
|
|
|
+ <el-input v-show="platFormApp" v-model="form.appVersion" autocomplete="off" style="width:76%;" />
|
|
|
+ <el-select v-show="!platFormApp" v-model="form.appVersionList" multiple filterable style="width:76%;">
|
|
|
+ <el-option v-for="item in platFormAppStr" :key="item.name" :label="item.name" :value="item.name" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item v-if="form.creatorList === userNames" label="等待测试时间" label-width="147px">
|
|
|
<el-date-picker
|
|
|
v-model="form.waitTestTime"
|
|
@@ -170,7 +175,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { bugGetEnum, taskListCreate, bugUpdate, bugGet } from '@/api/defectManage'
|
|
|
-import { projectGetTypeMap, teamMembers } from '@/api/projectPage'
|
|
|
+import { projectGetTypeMap, teamMembers, appDataGet } from '@/api/projectPage'
|
|
|
import axios from 'axios'
|
|
|
import E from 'wangeditor'
|
|
|
|
|
@@ -179,9 +184,18 @@ export default {
|
|
|
return {
|
|
|
form: {
|
|
|
id: '',
|
|
|
+ bizId: '',
|
|
|
+ taskId: '',
|
|
|
platformType: '',
|
|
|
- clientType: ''
|
|
|
+ clientType: '',
|
|
|
+ bugDescribe: '',
|
|
|
+ remark: '',
|
|
|
+ // creator: '',
|
|
|
+ currentHandler: [],
|
|
|
+ assigner: '',
|
|
|
+ appVersionList: []
|
|
|
},
|
|
|
+ platFormApp: true,
|
|
|
optionsAssigner: [],
|
|
|
optionsCurrentHandler: [],
|
|
|
businessTypeStr: [],
|
|
@@ -190,6 +204,7 @@ export default {
|
|
|
dialogVisible: false,
|
|
|
platformTypeStr: [],
|
|
|
bugTypeStr: [],
|
|
|
+ platFormAppStr: [],
|
|
|
discoveryMethodStr: [],
|
|
|
reasonStr: [],
|
|
|
bugStatusStr: [],
|
|
@@ -215,7 +230,7 @@ export default {
|
|
|
stage: [{ required: true, message: '所处阶段不能为空', trigger: 'change' }],
|
|
|
assigner: [{ required: true, message: 'bug责任人不能为空', trigger: 'blur' }],
|
|
|
currentHandler: [{ required: true, message: 'bug处理人不能为空', trigger: 'blur' }],
|
|
|
- bugDescribe: [{ required: true, message: 'bug描述不能为空', trigger: 'change' }],
|
|
|
+ // bugDescribe: [{ required: true, message: 'bug描述不能为空', trigger: 'change' }],
|
|
|
clientType: [{ required: true, message: '业务模块不能为空', trigger: 'change' }]
|
|
|
},
|
|
|
userData: '',
|
|
@@ -267,10 +282,10 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.bizOptions = res.data
|
|
|
} else {
|
|
|
- this.errorFun()
|
|
|
+ this.errorFun(res.msg)
|
|
|
}
|
|
|
})
|
|
|
- bugGet(this.$route.query.id).then(res => {
|
|
|
+ await bugGet(this.$route.query.id).then(res => {
|
|
|
this.form = res.data
|
|
|
this.form.bugDescribe = res.data.bugDescribe
|
|
|
const editorDescribe = new E('#wangeditorDescribe')
|
|
@@ -313,6 +328,11 @@ export default {
|
|
|
this.form.currentHandler = this.form.currentHandler.split(',')
|
|
|
}
|
|
|
})
|
|
|
+ await this.appGet()
|
|
|
+ if (!this.platFormApp) {
|
|
|
+ // console.log(this.form.appVersion)
|
|
|
+ this.form.appVersionList = this.form.appVersion.split(',')
|
|
|
+ }
|
|
|
},
|
|
|
// 获取任务数据
|
|
|
taskIdGet() {
|
|
@@ -325,11 +345,41 @@ export default {
|
|
|
this.platformTypeStr = this.bizOptions.filter(value => value.code === e)[0].child
|
|
|
this.businessTypeStr = []
|
|
|
this.moduleStr = []
|
|
|
+ this.platFormApp = true
|
|
|
this.$set(this.form, 'platformType', '')
|
|
|
this.$set(this.form, 'clientType', '')
|
|
|
this.$set(this.form, 'moduleId', '')
|
|
|
+ this.$set(this.form, 'currentHandler', [])
|
|
|
+ this.$set(this.form, 'assigner', [])
|
|
|
this.getMember() // 保证bizId存在
|
|
|
},
|
|
|
+ // 接口不接受空值处理
|
|
|
+ emptyJudge(obj) {
|
|
|
+ for (const key in obj) {
|
|
|
+ if (obj[key] === '' || obj[key].length === 0) {
|
|
|
+ delete obj[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 版本号获取
|
|
|
+ appGet() {
|
|
|
+ const sendData = { name: 'appVersion', bizId: this.form.bizId, plateId: this.form.platformType, clientId: this.form.clientType }
|
|
|
+ this.emptyJudge(sendData)
|
|
|
+ return appDataGet(sendData).then(res => {
|
|
|
+ // console.log(res.data[0].content.substring(2, res.data[0].content.length - 2).split(','))
|
|
|
+ if (res.data === null) {
|
|
|
+ this.platFormApp = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const newRxp = res.data[0].content.replace(/\"|\{|\}/g, '').split(',').map(eachData => ({
|
|
|
+ name: eachData
|
|
|
+ }))
|
|
|
+ // this.form.appVersionList = []
|
|
|
+ this.$set(this.form, 'appVersionList', [])
|
|
|
+ this.platFormAppStr = newRxp
|
|
|
+ this.platFormApp = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 业务线取子数据
|
|
|
clickChangeBusiness(e) {
|
|
|
if (this.platformTypeStr.filter(value => value.code === e)[0].child) {
|
|
@@ -339,6 +389,7 @@ export default {
|
|
|
} else {
|
|
|
this.businessTypeShow = false
|
|
|
}
|
|
|
+ this.appGet()
|
|
|
this.$set(this.form, 'clientType', '')
|
|
|
this.$set(this.form, 'moduleId', '')
|
|
|
},
|
|
@@ -350,6 +401,7 @@ export default {
|
|
|
} else {
|
|
|
this.moduleTypeShow = false
|
|
|
}
|
|
|
+ this.appGet()
|
|
|
this.$set(this.form, 'moduleId', '')
|
|
|
},
|
|
|
// 点击一次更新一次
|
|
@@ -379,12 +431,18 @@ export default {
|
|
|
if (form.currentHandler) {
|
|
|
form.currentHandler = form.currentHandler.join(',')
|
|
|
}
|
|
|
- form.reopenTimes = parseInt(form.reopenTimes)
|
|
|
+ if (this.platFormApp) {
|
|
|
+ delete this.form.appVersionList
|
|
|
+ } else {
|
|
|
+ this.form.appVersion = this.form.appVersionList.join(',')
|
|
|
+ delete this.form.appVersionList
|
|
|
+ }
|
|
|
+ // form.reopenTimes = parseInt(form.reopenTimes)
|
|
|
form.accessory = this.accessory
|
|
|
this.userData = { id: '', ename: this.userInformation, name: this.userNames }
|
|
|
this.objData = { bugBaseInfo: form, user: this.userData }
|
|
|
bugUpdate(this.objData).then(res => {
|
|
|
- res.code === 200 ? this.successFun() : this.errorFun()
|
|
|
+ res.code === 200 ? this.successFun() : this.errorFun(res.msg)
|
|
|
this.$router.go(-1)
|
|
|
})
|
|
|
}
|
|
@@ -393,8 +451,8 @@ export default {
|
|
|
successFun() {
|
|
|
this.$notify({ title: 'Success', message: 'Updated Successfully', type: 'success', duration: 2000 })
|
|
|
},
|
|
|
- errorFun() {
|
|
|
- this.$notify({ title: 'Failed', message: 'Updated Failed', type: 'error', duration: 2000 })
|
|
|
+ errorFun(msg) {
|
|
|
+ this.$notify({ title: 'Failed', message: msg, type: 'error', duration: 2000 })
|
|
|
}
|
|
|
}
|
|
|
}
|