代码调整

This commit is contained in:
dong 2022-08-31 15:35:59 +08:00
parent 4f99b40a2b
commit 0162aa45a9
2 changed files with 25 additions and 19 deletions

View File

@ -7,7 +7,8 @@
</el-button-group>
</div>
<TrainingList ref="trainingList" @updateDetails="updateDetails" @gradeRules="gradeRules" />
<EditDetails ref="editDetails" v-dialogDrag :edit-data="editData" @openEditOperate="openEditOperate" />
<EditDetails ref="editDetails" v-dialogDrag :edit-data="editData" @openEditOperate="openEditOperate" @handleCondition="handleCondition" />
<EditCondition ref="editCondition" v-dialogDrag :materials-list="materialsList" @editConditionFn="editConditionFn" />
<edit-operate ref="editOperate" v-dialogDrag @backStepList="backStepList" />
<grade-rules ref="gradeRules" />
</div>
@ -15,14 +16,17 @@
<script>
import TrainingList from './trainingList.vue';
import EditDetails from './editDetails.vue';
import EditCondition from './editCondition.vue';
import EditOperate from './editOperate.vue';
import GradeRules from './gradeRules.vue';
import { getTrainingMaterials } from '@/api/trainingManage';
export default {
name:'DemonMenu',
components:{
TrainingList,
EditDetails,
EditCondition,
EditOperate,
GradeRules
},
@ -32,6 +36,7 @@ export default {
return {
hoverBtn: false,
btnWidth: -600,
materialsList: [],
editData: {}
};
},
@ -47,8 +52,24 @@ export default {
}
},
mounted() {
this.getMaterials();
},
methods:{
editConditionFn(data, index, key) {
this.$refs.editDetails.editConditionFn(data, index, key);
},
handleCondition(index, row, key) {
this.$refs.editCondition.doShow(row[key], index, key);
},
getMaterials() {
getTrainingMaterials().then(res => {
console.log(res, 'Materials');
this.materialsList = res.data;
}).catch(err => {
console.log(err, 'Materials----');
this.materialsList = [];
});
},
menuClick() {
this.hoverBtn = !this.hoverBtn;
if (this.hoverBtn) {

View File

@ -63,22 +63,18 @@
<el-button size="small" type="success" @click="saveStepData">{{ $t('trainingManage.saveStepData') }}</el-button>
</span>
</el-dialog>
<EditCondition ref="editCondition" v-dialogDrag :materials-list="materialsList" @editConditionFn="editConditionFn" />
</div>
</template>
<script>
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation, getTrainingMaterials } from '@/api/trainingManage';
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation } from '@/api/trainingManage';
import { assignUsersPlayRoles } from '@/api/jointSimulation';
import Vue from 'vue';
import {covertMemberData} from '@/views/newMap/displayNew/utils';
import EditCondition from './editCondition.vue';
export default {
name: 'EditDetails',
components:{
EditCondition
},
components:{},
props: {
editData: {
type: Object,
@ -94,7 +90,6 @@ export default {
dialogVisible: false,
roleList: [],
tableData: [],
materialsList: [],
formModel: {
mapLocationJson: '',
// runPlanId:'',
@ -208,7 +203,7 @@ export default {
},
handleCondition(index, row, key) {
console.log(key, '条件', index, row);
this.$refs.editCondition.doShow(row[key], index, key);
this.$emit('handleCondition', index, row, key);
this.doClose();
},
handleEditOperate(index, row) {
@ -229,16 +224,6 @@ export default {
this.getStepList(data);
this.dialogVisible = true;
this.tabVisible = true;
this.getMaterials();
},
getMaterials() {
getTrainingMaterials().then(res => {
console.log(res, 'Materials');
this.materialsList = res.data;
}).catch(err => {
console.log(err, 'Materials----');
this.materialsList = [];
});
},
saveStepData() {
const list = [];