From 94e626ce495378dcc3816d3148d44950518c811b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 22 Oct 2020 09:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=90=86=E8=AE=BA=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index_Common.js | 6 +- src/store/index_HEB.js | 4 +- src/store/modules/race.js | 40 ++++++ .../bankList/dialog-modify-rich.vue | 1 + .../competitionManage/bankList/index.vue | 5 + .../bankList/item-answer.vue | 13 +- .../competitionManage/bankList/preImport.vue | 136 ++++++++++++++++++ 7 files changed, 196 insertions(+), 9 deletions(-) create mode 100644 src/store/modules/race.js create mode 100644 src/views/competitionManage/bankList/preImport.vue diff --git a/src/store/index_Common.js b/src/store/index_Common.js index dc1b2f8b5..e5553b3e4 100644 --- a/src/store/index_Common.js +++ b/src/store/index_Common.js @@ -17,6 +17,7 @@ import ibp from './modules/ibp'; import order from './modules/order'; import iscs from './modules/iscs'; import rpTools from './modules/rpTools'; +import race from './modules/race'; import getters from './getters'; @@ -39,8 +40,9 @@ const store = new Vuex.Store({ scriptRecord, ibp, order, - iscs, - rpTools + iscs, + rpTools, + race }, getters }); diff --git a/src/store/index_HEB.js b/src/store/index_HEB.js index 295be5d36..dbaf695f1 100644 --- a/src/store/index_HEB.js +++ b/src/store/index_HEB.js @@ -16,6 +16,7 @@ import scriptRecord from './modules/scriptRecord'; import ibp from './modules/ibp'; import order from './modules/order'; import iscs from './modules/iscs'; +import race from './modules/race'; import getters from './getters'; @@ -38,7 +39,8 @@ const store = new Vuex.Store({ scriptRecord, ibp, order, - iscs + iscs, + race }, getters }); diff --git a/src/store/modules/race.js b/src/store/modules/race.js new file mode 100644 index 000000000..a71c23aab --- /dev/null +++ b/src/store/modules/race.js @@ -0,0 +1,40 @@ +/** + * 竞赛状态数据 + */ +const race = { + namespaced: true, + state: { + preTheoryData: [] // 导入的理论预保存数据, + }, + getters: { + preTheoryData: (state)=>{ + return state.preTheoryData; + } + }, + mutations: { + setPreTheoryData: (state, preTheoryData) => { + state.orderList = preTheoryData; + } + }, + actions: { + /** + * 设置导入的理论预保存数据 + */ + setPreTheoryData: ({ commit }, preTheoryData) => { + commit('setPreTheoryData', preTheoryData); + } + // getRouteDataListByCode: ({ state, commit }, code) => { // 获取进路数据 + // return new Promise((resolve) => { + // const list = []; + // const routeList = Object.values(state.routeData); + // routeList.forEach(route => { + // if (route.startSignalCode == code) { + // list.push(route); + // } + // }); + // resolve(list); + // }); + // }, + } +}; +export default race; diff --git a/src/views/competitionManage/bankList/dialog-modify-rich.vue b/src/views/competitionManage/bankList/dialog-modify-rich.vue index e690f8e8f..0536570a1 100644 --- a/src/views/competitionManage/bankList/dialog-modify-rich.vue +++ b/src/views/competitionManage/bankList/dialog-modify-rich.vue @@ -38,6 +38,7 @@ export default { doInput() { const node = this.node; node.model[node.prop] = this.content; + // this.$emit('update'); this.doClose(); } } diff --git a/src/views/competitionManage/bankList/index.vue b/src/views/competitionManage/bankList/index.vue index ce3c7b146..cf01dda72 100644 --- a/src/views/competitionManage/bankList/index.vue +++ b/src/views/competitionManage/bankList/index.vue @@ -254,6 +254,11 @@ export default { }); } } + // this.$store.dispatch('race/setPreTheoryData', questionList).then(({ valid }) => { + // + // }).catch(() => { + // this.$message.error('导入题库失败!'); + // }); importQuestionBand(questionList, 'DRTS').then(resp => { this.$message.success('导入题库成功!'); }).catch(()=>{ diff --git a/src/views/competitionManage/bankList/item-answer.vue b/src/views/competitionManage/bankList/item-answer.vue index 648eef1b6..c5dc79a69 100644 --- a/src/views/competitionManage/bankList/item-answer.vue +++ b/src/views/competitionManage/bankList/item-answer.vue @@ -78,13 +78,13 @@ export default { } else if (this.type === 'answer') { this.answer = (this.optionList[0] || {content: ''}).content; } - }, - answerList: { - handler(val) { - this.onChange(val); - }, - deep: true } + // answerList: { + // handler(val) { + // this.onChange(val); + // }, + // deep: true + // } }, methods: { onChange(e) { @@ -95,6 +95,7 @@ export default { }, doModify(el) { this.$emit('modify', {model: el, prop: 'value'}); + console.log('-----------', this.answerList); }, doRemove(index) { this.answerList.splice(index, 1); diff --git a/src/views/competitionManage/bankList/preImport.vue b/src/views/competitionManage/bankList/preImport.vue new file mode 100644 index 000000000..8e00999ea --- /dev/null +++ b/src/views/competitionManage/bankList/preImport.vue @@ -0,0 +1,136 @@ + + +