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 = {
sidebarRouters: state => state.permission.sidebarRouters,
companyFiles: state => state.processing.companyFiles,
standard: state => state.standard.standard,
standardList: state => state.standard.standardList
standardList: state => state.standard.standardList,
testScenarioList: state => state.testScenario.testScenarioList
}
export default getters
......@@ -8,6 +8,7 @@ import permission from './modules/permission'
import settings from './modules/settings'
import processing from './modules/processing'
import standard from './modules/standard'
import testScenario from './modules/testScenario'
import getters from './getters'
Vue.use(Vuex)
......@@ -21,7 +22,8 @@ const store = new Vuex.Store({
permission,
processing,
standard,
settings
settings,
testScenario
},
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 {
taskCreateRequest: {
standardId: '', // 检验依据
taskList: [], // 选择的任务(检查项目)
testScenarioList: [], // 选择的测试场景
taskNo: '', // 任务编号
taskName: '', // 任务名称
taskName: '', // 任务名称测试
confidentialityLevel: '', // 保密等级
productName: '', // 产品名称
productModel: '', // 车辆型号
......@@ -413,29 +414,29 @@ export default {
// 小组成员回显数据
tableData: [],
inspectionItemList: [],
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 }
],
// 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: {
testScenarioList: [
{
......@@ -600,6 +601,7 @@ export default {
}
},
created() {
this.$store.dispatch('testScenario/setTestScenarioList')
// 对字典:inspection_item, 做处理
this.getUserByRole()
// this.initWebSocket()
......@@ -612,7 +614,7 @@ export default {
this.$store.dispatch('standard/setStandardList')
},
computed: {
...mapGetters(['standard', 'standardList'])
...mapGetters(['standard', 'standardList', 'testScenarioList'])
},
// destroyed() {
// this.websock.close() // 离开路由之后断开websocket连接
......@@ -639,6 +641,15 @@ export default {
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
console.log('ddd', this.tableData)
......@@ -910,7 +921,7 @@ export default {
handleTestScenario(item) {
if (this.model.testScenarioList.includes(item.value)) {
this.model.testScenarioList.splice(
this.model.testScenarioList.indexOf(item.label),
this.model.testScenarioList.indexOf(item.value),
1
)
item.check = false
......
......@@ -425,29 +425,7 @@ export default {
// { value: 1, label: '汽车信息安全一般要求', check: false },
// { value: 2, label: '汽车信息安全技术要求', check: false }
],
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 }
],
// testScenarioList: [],
rules: {
testScenarioList: [
{
......@@ -618,9 +596,7 @@ export default {
}
},
created() {
setTimeout(() => {
console.log('standardList', this.standardList)
}, 3000)
this.$store.dispatch('testScenario/setTestScenarioList')
// 对字典:inspection_item, 做处理
this.getUserByRole()
// this.initWebSocket()
......@@ -633,7 +609,7 @@ export default {
this.$store.dispatch('standard/setStandardList')
},
computed: {
...mapGetters(['standard', 'standardList'])
...mapGetters(['standard', 'standardList', 'testScenarioList'])
},
// destroyed() {
// this.websock.close() // 离开路由之后断开websocket连接
......@@ -736,6 +712,16 @@ export default {
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)
// 把detail转到model里(任务信息)
for (const key in this.taskTemporaryStorage) {
......
......@@ -355,29 +355,7 @@ export default {
// 小组成员回显数据
tableData: [],
inspectionItemList: [],
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 }
],
// testScenarioList: [],
rules: {
testScenarioList: [
{
......@@ -539,20 +517,12 @@ export default {
},
created() {
// 接收路由传参
this.$store.dispatch('standard/setStandardList')
this.$store.dispatch('testScenario/setTestScenarioList')
this.getInspectionItemDict()
// 对字典:inspection_item, 做处理
// // 查询样品信息(整车、零件)
// this.getSampleInformation()
// this.getUserByRole()
// this.getManufacturer()
// this.$nextTick(() => {
// this.leaderTop()
// this.rowDrop()
// })
this.$store.dispatch('standard/setStandardList')
},
computed: {
...mapGetters(['standard', 'standardList'])
...mapGetters(['standard', 'standardList', 'testScenarioList'])
},
methods: {
getTaskDetail(taskId) {
......@@ -567,11 +537,13 @@ export default {
}
})
// 测试场景
this.testScenarioList.forEach(item => {
if (this.taskDetail.testScenarioList.includes(item.value)) {
item.check = true
}
})
if (this.taskDetail.testScenarioList !== null) {
this.testScenarioList.forEach(item => {
if (this.taskDetail.testScenarioList.includes(item.value)) {
item.check = true
}
})
}
console.log('检验项目', this.inspectionItemList)
// 把detail转到model里(任务信息)
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