Commit 770c330c authored by 盖献康's avatar 盖献康

feat: 把车型试验(第三个子任务)融合到总任务的 新增、编辑、详情、暂存

parent b2064b35
import request from '@/utils/request'
// 获取测试场景
export function getTestScenario(data) {
return request({
url: '/system/scenario/getListAll',
method: 'post',
data
})
}
...@@ -18,6 +18,7 @@ const getters = { ...@@ -18,6 +18,7 @@ const getters = {
sidebarRouters: state => state.permission.sidebarRouters, sidebarRouters: state => state.permission.sidebarRouters,
companyFiles: state => state.processing.companyFiles, companyFiles: state => state.processing.companyFiles,
standard: state => state.standard.standard, standard: state => state.standard.standard,
standardList: state => state.standard.standardList standardList: state => state.standard.standardList,
testScenarioList: state => state.testScenario.testScenarioList
} }
export default getters export default getters
...@@ -8,6 +8,7 @@ import permission from './modules/permission' ...@@ -8,6 +8,7 @@ import permission from './modules/permission'
import settings from './modules/settings' import settings from './modules/settings'
import processing from './modules/processing' import processing from './modules/processing'
import standard from './modules/standard' import standard from './modules/standard'
import testScenario from './modules/testScenario'
import getters from './getters' import getters from './getters'
Vue.use(Vuex) Vue.use(Vuex)
...@@ -21,7 +22,8 @@ const store = new Vuex.Store({ ...@@ -21,7 +22,8 @@ const store = new Vuex.Store({
permission, permission,
processing, processing,
standard, standard,
settings settings,
testScenario
}, },
getters getters
}) })
......
import {getTestScenario} from "@/api/scenario/scenario";
const testScenario = {
namespaced: true,
state: {
testScenarioList: []
},
mutations: {
SET_TEST_SCENARIO_LIST: (state, testScenarioList) => {
state.testScenarioList = testScenarioList
}
},
actions: {
setTestScenarioList({ commit }) {
getTestScenario({}).then(res => {
if (res.code === 200) {
const obj = res.data.map(
({ id, testScenario, ...rest }) => ({
label: testScenario,
value: parseInt(id),
check: false,
...rest
})
)
console.log('测试场景', obj)
commit('SET_TEST_SCENARIO_LIST', obj)
}
})
}
}
}
export default testScenario
...@@ -335,8 +335,9 @@ export default { ...@@ -335,8 +335,9 @@ export default {
taskCreateRequest: { taskCreateRequest: {
standardId: '', // 检验依据 standardId: '', // 检验依据
taskList: [], // 选择的任务(检查项目) taskList: [], // 选择的任务(检查项目)
testScenarioList: [], // 选择的测试场景
taskNo: '', // 任务编号 taskNo: '', // 任务编号
taskName: '', // 任务名称 taskName: '', // 任务名称测试
confidentialityLevel: '', // 保密等级 confidentialityLevel: '', // 保密等级
productName: '', // 产品名称 productName: '', // 产品名称
productModel: '', // 车辆型号 productModel: '', // 车辆型号
...@@ -413,29 +414,29 @@ export default { ...@@ -413,29 +414,29 @@ export default {
// 小组成员回显数据 // 小组成员回显数据
tableData: [], tableData: [],
inspectionItemList: [], inspectionItemList: [],
testScenarioList: [ // testScenarioList: [
{ value: 0, label: 'TBOX-蜂窝以太网接口', check: false }, // { value: 0, label: 'TBOX-蜂窝以太网接口', check: false },
{ value: 1, label: 'WiFi AP接口', check: false }, // { value: 1, label: 'WiFi AP接口', check: false },
{ value: 2, label: 'WiFi Client接口', check: false }, // { value: 2, label: 'WiFi Client接口', check: false },
{ value: 3, label: '充电以太网接口', check: false }, // { value: 3, label: '充电以太网接口', check: false },
{ value: 4, label: 'CAN 诊断接口(OBD)', check: false }, // { value: 4, label: 'CAN 诊断接口(OBD)', check: false },
{ value: 5, label: '以太网诊断接口(OBD)', check: false }, // { value: 5, label: '以太网诊断接口(OBD)', check: false },
{ value: 6, label: '车载摄像头以太网接口(无线)', check: false }, // { value: 6, label: '车载摄像头以太网接口(无线)', check: false },
{ value: 7, label: '第三方应用软件', check: false }, // { value: 7, label: '第三方应用软件', check: false },
{ value: 8, label: '远程控车应用', check: false }, // { value: 8, label: '远程控车应用', check: false },
{ value: 9, label: 'USB接口', check: false }, // { value: 9, label: 'USB接口', check: false },
{ value: 10, label: 'XCB标定', check: false }, // { value: 10, label: 'XCB标定', check: false },
{ value: 11, label: 'CCP标定', check: false }, // { value: 11, label: 'CCP标定', check: false },
{ value: 12, label: '安全启动', check: false }, // { value: 12, label: '安全启动', check: false },
{ value: 13, label: '远程控车', check: false }, // { value: 13, label: '远程控车', check: false },
{ value: 14, label: 'V2X', check: false }, // { value: 14, label: 'V2X', check: false },
{ value: 15, label: 'BT', check: false }, // { value: 15, label: 'BT', check: false },
{ value: 16, label: 'BLE', check: false }, // { value: 16, label: 'BLE', check: false },
{ value: 17, label: 'NFC', check: false }, // { value: 17, label: 'NFC', check: false },
{ value: 18, label: '射频钥匙', check: false }, // { value: 18, label: '射频钥匙', check: false },
{ value: 19, label: '软件升级', check: false }, // { value: 19, label: '软件升级', check: false },
{ value: 20, label: 'ECU固件', check: false } // { value: 20, label: 'ECU固件', check: false }
], // ],
rules: { rules: {
testScenarioList: [ testScenarioList: [
{ {
...@@ -600,6 +601,7 @@ export default { ...@@ -600,6 +601,7 @@ export default {
} }
}, },
created() { created() {
this.$store.dispatch('testScenario/setTestScenarioList')
// 对字典:inspection_item, 做处理 // 对字典:inspection_item, 做处理
this.getUserByRole() this.getUserByRole()
// this.initWebSocket() // this.initWebSocket()
...@@ -612,7 +614,7 @@ export default { ...@@ -612,7 +614,7 @@ export default {
this.$store.dispatch('standard/setStandardList') this.$store.dispatch('standard/setStandardList')
}, },
computed: { computed: {
...mapGetters(['standard', 'standardList']) ...mapGetters(['standard', 'standardList', 'testScenarioList'])
}, },
// destroyed() { // destroyed() {
// this.websock.close() // 离开路由之后断开websocket连接 // this.websock.close() // 离开路由之后断开websocket连接
...@@ -639,6 +641,15 @@ export default { ...@@ -639,6 +641,15 @@ export default {
this.model[key] = this.taskDetail[key] this.model[key] = this.taskDetail[key]
} }
} }
if (this.taskDetail.testScenarioList !== null) {
this.testScenarioList.forEach(item => {
if (this.taskDetail.testScenarioList.includes(item.value)) {
item.check = true
}
})
} else {
this.model.testScenarioList = []
}
// 小组信息 // 小组信息
this.tableData = this.taskDetail.auditors this.tableData = this.taskDetail.auditors
console.log('ddd', this.tableData) console.log('ddd', this.tableData)
...@@ -910,7 +921,7 @@ export default { ...@@ -910,7 +921,7 @@ export default {
handleTestScenario(item) { handleTestScenario(item) {
if (this.model.testScenarioList.includes(item.value)) { if (this.model.testScenarioList.includes(item.value)) {
this.model.testScenarioList.splice( this.model.testScenarioList.splice(
this.model.testScenarioList.indexOf(item.label), this.model.testScenarioList.indexOf(item.value),
1 1
) )
item.check = false item.check = false
......
...@@ -425,29 +425,7 @@ export default { ...@@ -425,29 +425,7 @@ export default {
// { value: 1, label: '汽车信息安全一般要求', check: false }, // { value: 1, label: '汽车信息安全一般要求', check: false },
// { value: 2, label: '汽车信息安全技术要求', check: false } // { value: 2, label: '汽车信息安全技术要求', check: false }
], ],
testScenarioList: [ // testScenarioList: [],
{ value: 0, label: 'TBOX-蜂窝以太网接口', check: false },
{ value: 1, label: 'WiFi AP接口', check: false },
{ value: 2, label: 'WiFi Client接口', check: false },
{ value: 3, label: '充电以太网接口', check: false },
{ value: 4, label: 'CAN 诊断接口(OBD)', check: false },
{ value: 5, label: '以太网诊断接口(OBD)', check: false },
{ value: 6, label: '车载摄像头以太网接口(无线)', check: false },
{ value: 7, label: '第三方应用软件', check: false },
{ value: 8, label: '远程控车应用', check: false },
{ value: 9, label: 'USB接口', check: false },
{ value: 10, label: 'XCB标定', check: false },
{ value: 11, label: 'CCP标定', check: false },
{ value: 12, label: '安全启动', check: false },
{ value: 13, label: '远程控车', check: false },
{ value: 14, label: 'V2X', check: false },
{ value: 15, label: 'BT', check: false },
{ value: 16, label: 'BLE', check: false },
{ value: 17, label: 'NFC', check: false },
{ value: 18, label: '射频钥匙', check: false },
{ value: 19, label: '软件升级', check: false },
{ value: 20, label: 'ECU固件', check: false }
],
rules: { rules: {
testScenarioList: [ testScenarioList: [
{ {
...@@ -618,9 +596,7 @@ export default { ...@@ -618,9 +596,7 @@ export default {
} }
}, },
created() { created() {
setTimeout(() => { this.$store.dispatch('testScenario/setTestScenarioList')
console.log('standardList', this.standardList)
}, 3000)
// 对字典:inspection_item, 做处理 // 对字典:inspection_item, 做处理
this.getUserByRole() this.getUserByRole()
// this.initWebSocket() // this.initWebSocket()
...@@ -633,7 +609,7 @@ export default { ...@@ -633,7 +609,7 @@ export default {
this.$store.dispatch('standard/setStandardList') this.$store.dispatch('standard/setStandardList')
}, },
computed: { computed: {
...mapGetters(['standard', 'standardList']) ...mapGetters(['standard', 'standardList', 'testScenarioList'])
}, },
// destroyed() { // destroyed() {
// this.websock.close() // 离开路由之后断开websocket连接 // this.websock.close() // 离开路由之后断开websocket连接
...@@ -736,6 +712,16 @@ export default { ...@@ -736,6 +712,16 @@ export default {
item.check = true item.check = true
} }
}) })
// 测试场景
if (this.taskTemporaryStorage.testScenarioList !== null) {
this.testScenarioList.forEach(item => {
if (
this.taskTemporaryStorage.testScenarioList.includes(item.value)
) {
item.check = true
}
})
}
console.log('检验项目', this.inspectionItemList) console.log('检验项目', this.inspectionItemList)
// 把detail转到model里(任务信息) // 把detail转到model里(任务信息)
for (const key in this.taskTemporaryStorage) { for (const key in this.taskTemporaryStorage) {
......
...@@ -355,29 +355,7 @@ export default { ...@@ -355,29 +355,7 @@ export default {
// 小组成员回显数据 // 小组成员回显数据
tableData: [], tableData: [],
inspectionItemList: [], inspectionItemList: [],
testScenarioList: [ // testScenarioList: [],
{ value: 0, label: 'TBOX-蜂窝以太网接口', check: false },
{ value: 1, label: 'WiFi AP接口', check: false },
{ value: 2, label: 'WiFi Client接口', check: false },
{ value: 3, label: '充电以太网接口', check: false },
{ value: 4, label: 'CAN 诊断接口(OBD)', check: false },
{ value: 5, label: '以太网诊断接口(OBD)', check: false },
{ value: 6, label: '车载摄像头以太网接口(无线)', check: false },
{ value: 7, label: '第三方应用软件', check: false },
{ value: 8, label: '远程控车应用', check: false },
{ value: 9, label: 'USB接口', check: false },
{ value: 10, label: 'XCB标定', check: false },
{ value: 11, label: 'CCP标定', check: false },
{ value: 12, label: '安全启动', check: false },
{ value: 13, label: '远程控车', check: false },
{ value: 14, label: 'V2X', check: false },
{ value: 15, label: 'BT', check: false },
{ value: 16, label: 'BLE', check: false },
{ value: 17, label: 'NFC', check: false },
{ value: 18, label: '射频钥匙', check: false },
{ value: 19, label: '软件升级', check: false },
{ value: 20, label: 'ECU固件', check: false }
],
rules: { rules: {
testScenarioList: [ testScenarioList: [
{ {
...@@ -539,20 +517,12 @@ export default { ...@@ -539,20 +517,12 @@ export default {
}, },
created() { created() {
// 接收路由传参 // 接收路由传参
this.$store.dispatch('standard/setStandardList') this.$store.dispatch('testScenario/setTestScenarioList')
this.getInspectionItemDict() this.getInspectionItemDict()
// 对字典:inspection_item, 做处理 this.$store.dispatch('standard/setStandardList')
// // 查询样品信息(整车、零件)
// this.getSampleInformation()
// this.getUserByRole()
// this.getManufacturer()
// this.$nextTick(() => {
// this.leaderTop()
// this.rowDrop()
// })
}, },
computed: { computed: {
...mapGetters(['standard', 'standardList']) ...mapGetters(['standard', 'standardList', 'testScenarioList'])
}, },
methods: { methods: {
getTaskDetail(taskId) { getTaskDetail(taskId) {
...@@ -567,11 +537,13 @@ export default { ...@@ -567,11 +537,13 @@ export default {
} }
}) })
// 测试场景 // 测试场景
this.testScenarioList.forEach(item => { if (this.taskDetail.testScenarioList !== null) {
if (this.taskDetail.testScenarioList.includes(item.value)) { this.testScenarioList.forEach(item => {
item.check = true if (this.taskDetail.testScenarioList.includes(item.value)) {
} item.check = true
}) }
})
}
console.log('检验项目', this.inspectionItemList) console.log('检验项目', this.inspectionItemList)
// 把detail转到model里(任务信息) // 把detail转到model里(任务信息)
for (const key in this.taskDetail) { for (const key in this.taskDetail) {
......
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