Commit 90c9e279 authored by jiaxu.yan's avatar jiaxu.yan

feat: 修改开始试验任务的接口

parent ccd0d795
......@@ -44,11 +44,11 @@
</template>
<script>
import {
getCaseByScenario,
getScenarioList,
reviewTaskStart
reviewTaskStart,
createProject,
getUseCaseListByScenario
} from '@/api/task/task'
import { FastTestProject } from '@/api/graphql/client.graphql'
export default {
props: {
dialogManger: {
......@@ -64,7 +64,9 @@ export default {
data() {
return {
model: {
scenarioNameList: []
searchFields: {
scenario: []
}
},
loading: false,
testScenarioList: []
......@@ -75,7 +77,9 @@ export default {
if (newValue) {
this.getScenario()
this.model = {
scenarioNameList: []
searchFields: {
scenario: []
}
}
}
}
......@@ -90,13 +94,13 @@ export default {
const params = {
id: this.dialogManger.item.id
}
const res = await getCaseByScenario(this.model)
const res = await getUseCaseListByScenario(this.model)
if (res.code === 200) {
const resp = await this.newFileTest({
name: this.dialogManger.item.taskName,
caseIdList: res.data
})
params.testSchemeId = resp.data.projectMutation.project.id
params.testSchemeId = resp.data
this.startTaskModel(params)
}
},
......@@ -121,17 +125,9 @@ export default {
* 对接车联网新建测试项目
*/
async newFileTest(task) {
const res = await this.$apollo.mutate({
// fetchPolicy: 'no-cache',
mutation: FastTestProject,
variables: {
const res = await createProject({
name: task.name,
lawId: 'law_items;106',
principalUserId: 'user_items;2',
systemId: 'system;1',
caseIdList: task.caseIdList,
fileList: ['file_management_items;2']
}
useCaseList: task.caseIdList
})
return res
},
......@@ -147,15 +143,16 @@ export default {
})
},
handleTestScenario(item) {
if (this.model.scenarioNameList.includes(item.label)) {
this.model.scenarioNameList.splice(
this.model.scenarioNameList.indexOf(item.label),
console.log(this.model)
if (this.model.searchFields.scenario.includes(item.label)) {
this.model.searchFields.scenario.splice(
this.model.searchFields.scenario.indexOf(item.label),
1
)
item.check = false
} else {
item.check = true
this.model.scenarioNameList.push(item.label)
this.model.searchFields.scenario.push(item.label)
}
},
// 全选
......@@ -163,7 +160,7 @@ export default {
this.testScenarioList.forEach(obj => {
obj.check = true
})
this.model.scenarioNameList = this.testScenarioList.map(obj => {
this.model.searchFields.scenario = this.testScenarioList.map(obj => {
return obj.label
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment