This commit is contained in:
fan 2020-11-03 18:24:00 +08:00
commit 13913841de
5 changed files with 42 additions and 5 deletions

View File

@ -118,3 +118,11 @@ export function getScriptExport(id) {
method: 'get' method: 'get'
}); });
} }
/** 删除会话动作(新版)*/
export function deleteScriptAction(group, actionId) {
return request({
url: `/api/scriptSimulation/${group}/${actionId}/delete`,
method: 'delete'
});
}

View File

@ -152,7 +152,9 @@ export default {
this.oldDevice = this.selectedObj; this.oldDevice = this.selectedObj;
break; break;
case 'StationStand': case 'StationStand':
if (this.$store.state.menuOperation.subType == 'trainSetButton') {
this.handleStandMenu(); this.handleStandMenu();
}
break; break;
case 'DirectionRod': case 'DirectionRod':
this.handleDirectionRodMenu(); this.handleDirectionRodMenu();
@ -432,10 +434,16 @@ export default {
}, },
handleStandMenu() { handleStandMenu() {
this.clearAllMenuShow(); this.clearAllMenuShow();
if (this.$store.state.training.prdType === '02') {
this.deviceHighLight(this.oldDevice, false);
this.deviceHighLight(this.selectedObj, true);
this.oldDevice = this.selectedObj;
}
this.centralizedStationList = new Array(15).fill({}); this.centralizedStationList = new Array(15).fill({});
this.standParamList.forEach((stand, index) => { this.standParamList.forEach((stand, index) => {
this.centralizedStationList[index] = stand; this.centralizedStationList[index] = stand;
}); });
this.tempData = []; this.tempData = [];
const data = Object.assign(this.selectedObj); const data = Object.assign(this.selectedObj);
const station = this.$store.getters['map/getDeviceByCode'](this.selectedObj.stationCode); const station = this.$store.getters['map/getDeviceByCode'](this.selectedObj.stationCode);

View File

@ -116,11 +116,14 @@ export default {
.settingBtn{ .settingBtn{
color: #409eff; color: #409eff;
cursor: pointer; cursor: pointer;
padding: 5px 10px; padding: 2px 10px;
border-radius: 4px; border-radius: 4px;
border: 1px #409eff solid;
} }
.hasSetted{ .hasSetted{
width: 50px;
text-align: center;
display: inline-block;
} }
</style> </style>
<style> <style>

View File

@ -46,7 +46,7 @@
<el-button v-if="actionInfo.visible && !actionInfo.isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button> <el-button v-if="actionInfo.visible && !actionInfo.isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo)">确定</el-button> <el-button v-if="actionInfo.visible && actionInfo.isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo)">确定</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify(actionInfo)">取消</el-button> <el-button v-if="actionInfo.visible && actionInfo.isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify(actionInfo)">取消</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> --> <el-button v-if="actionInfo.visible && !actionInfo.isModify" type="danger" size="mini" :loading="deleteLoading" @click="deleteAction(actionInfo.id)">删除</el-button>
</div> </div>
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>
@ -55,6 +55,7 @@
</template> </template>
<script> <script>
import {getScriptAllAction, modifyScriptActionNew } from '@/api/simulation'; import {getScriptAllAction, modifyScriptActionNew } from '@/api/simulation';
import {deleteScriptAction } from '@/api/script';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default { export default {
@ -82,6 +83,7 @@ export default {
// isModify:false, // isModify:false,
// modifyText:'', // modifyText:'',
modifyTextLoading:false, modifyTextLoading:false,
deleteLoading:false,
// behaviorName:"", // behaviorName:"",
memberName: '' memberName: ''
}; };
@ -257,6 +259,16 @@ export default {
actionInfo.isModify = false; actionInfo.isModify = false;
} }
} }
},
deleteAction(actionId) {
this.deleteLoading = true;
deleteScriptAction(this.group, actionId).then(res=>{
this.deleteLoading = false;
this.reloadTable();
}).catch(error=>{
this.deleteLoading = false;
this.$messageBox('删除会话/动作失败:' + error.message);
});
} }
} }
}; };

View File

@ -583,8 +583,9 @@ export default {
.settingBtn{ .settingBtn{
color: #409eff; color: #409eff;
cursor: pointer; cursor: pointer;
padding: 5px 10px; padding: 2px 10px;
border-radius: 4px; border-radius: 4px;
border: 1px #409eff solid;
} }
.setGroupOut{ .setGroupOut{
padding: 4px 6px; padding: 4px 6px;
@ -592,5 +593,10 @@ export default {
.setGroupOut:hover{ .setGroupOut:hover{
background-color:#ccc; background-color:#ccc;
} }
.hasSetted{
width: 50px;
text-align: center;
display: inline-block;
}
</style> </style>