代码调整

This commit is contained in:
dong 2022-11-03 18:32:36 +08:00
parent 1443d7d2fa
commit cb5da8a7b2
3 changed files with 152 additions and 32 deletions

View File

@ -4216,6 +4216,60 @@ export const OperationEvent = {
domId: '_Tips-TrainingDesign-menuButton-faultMode'
}
}
},
// 调度台
DispatcherManage: {
menu: {
schedulingPlan: {
operation: '1601',
domId: '_Tips-DispatcherManage-menu-schedulingPlan'
},
dispatchingCommand: {
operation: '1602',
domId: '_Tips-DispatcherManage-menu-dispatchingCommand'
},
dispatchWork: {
operation: '1603',
domId: '_Tips-DispatcherManage-menu-dispatchWork'
},
dataUpdate: {
operation: '1604',
domId: '_Tips-DispatcherManage-menu-dataUpdate'
},
timeLock: {
operation: '1605',
domId: '_Tips-DispatcherManage-menu-timeLock'
}
}
},
// 调度命令
DispatchCmd: {
menuButton: {
refreshSearch: {
operation: '1701',
domId: '_Tips-DispatchCmd-menuButton-refreshSearch'
},
createCmd: {
operation: '1702',
domId: '_Tips-DispatchCmd-menuButton-createCmd'
},
search: {
operation: '1703',
domId: '_Tips-DispatchCmd-menuButton-search'
},
allographCmd: {
operation: '1704',
domId: '_Tips-DispatchCmd-menuButton-allographCmd{TOP}'
},
sendCmd: {
operation: '1705',
domId: '_Tips-DispatchCmd-menuButton-sendCmd{TOP}'
},
saveCacheData: {
operation: '1706',
domId: '_Tips-DispatchCmd-menuButton-saveCacheData{TOP}'
}
}
}
};

View File

@ -19,8 +19,8 @@
</div>
<div class="create-cmd">
<!-- <span>通信正常</span> -->
<el-button type="primary" @click="refreshSearch">刷新</el-button>
<el-button type="primary" style="width: 100px" @click="createCmd">新建调度命令</el-button>
<el-button :id="getDomObj('refreshSearch').domId" type="primary" @click="refreshSearch">刷新</el-button>
<el-button :id="getDomObj('createCmd').domId" type="primary" style="width: 100px" @click="createCmd">新建调度命令</el-button>
</div>
<div class="box-title">
<div class="contant-null" />
@ -212,7 +212,7 @@
</div>
</div>
<div class="condition-btn">
<el-button type="primary" @click="search">查询</el-button>
<el-button :id="getDomObj('search').domId" type="primary" @click="search">查询</el-button>
<el-button type="primary" style="width: 100px" @click="clearCondition">清除</el-button>
</div>
</div>
@ -403,9 +403,9 @@
</div>
</div>
<div class="midle-bottom">
<el-button type="primary" :disabled="!allographRow" @click="allographCmd">代签</el-button>
<el-button type="primary" :disabled="disabledSent" @click="sendCmd">下达</el-button>
<el-button type="primary" :disabled="disabledSent" @click="saveCacheData(true)">缓存</el-button>
<el-button :id="getDomObj('allographCmd').domId" type="primary" :disabled="!allographRow" @click="allographCmd">代签</el-button>
<el-button :id="getDomObj('sendCmd').domId" type="primary" :disabled="disabledSent" @click="sendCmd">下达</el-button>
<el-button :id="getDomObj('saveCacheData').domId" type="primary" :disabled="disabledSent" @click="saveCacheData(true)">缓存</el-button>
</div>
</div>
</el-col>
@ -421,6 +421,7 @@
import { sendCommandNew } from '@/api/jmap/training';
import { mapState } from 'vuex';
import { parseTime } from '@/utils/index';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name:'DispatcherCmd',
data() {
@ -645,6 +646,9 @@ export default {
this.getTableHeight();
},
methods:{
getDomObj(key) {
return OperationEvent.DispatchCmd.menuButton[key];
},
activeChange(key) {
this[key] = !this[key];
this.getOperateTableHeight();
@ -749,10 +753,19 @@ export default {
});
},
search() {
const operate = {
operation: this.getDomObj('search').operation,
param: this.searchObj,
userOperationType: 'leftClick'
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.searchTable = [];
this.searchCmd().then(res => {
this.getSearchTable();
});
}
});
},
getSearchTable() {
const list = Object.values(this.queryResData.disCmdMap).reverse().filter(item => {
@ -868,6 +881,11 @@ export default {
},
refreshSearch() {
console.log('刷新');
const operate = {
operation: this.getDomObj('refreshSearch').operation,
userOperationType: 'leftClick'
};
this.$store.dispatch('training/nextNew', operate);
this.searchCmd();
},
clearCondition() {
@ -913,6 +931,11 @@ export default {
resolve();
}
}).then(() => {
const operate = {
operation: this.getDomObj('createCmd').operation,
userOperationType: 'leftClick'
};
this.$store.dispatch('training/nextNew', operate);
this.initData();
this.getSenderName();
sendCommandNew(this.group, 'CTC_NEW_DIS_COMMAND', {}).then((res) => {
@ -979,7 +1002,7 @@ export default {
};
if (obj) {
data = {
name: obj.label,
name: obj.label || '',
rsCompany: false,
cpType: this.typeTransition[obj.type] || obj.type,
code: obj.deviceCode || this.DisStationId
@ -1037,12 +1060,21 @@ export default {
this.$messageBox('请选择受令单位');
return;
}
const operate = {
operation: this.getDomObj('saveCacheData').operation,
param: this.command,
userOperationType: 'leftClick'
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.cacheCmd(showMsg).then(suc => {
this.searchCmd();
this.initData();
});
}
});
}
});
},
cacheCmd(showMsg) {
console.log('缓存', this.command);
@ -1088,7 +1120,15 @@ export default {
type: 'warning'
}).then(() => {
console.log('代签');
sendCommandNew(this.group, 'CTC_SIGN_DIS_COMMAND', {cmdId: this.command.cmdId, rcId: this.allographRow.cpId, proxySign: true}).then((res) => {
const params = {cmdId: this.command.cmdId, rcId: this.allographRow.cpId, proxySign: true};
const operate = {
operation: this.getDomObj('allographCmd').operation,
param: params,
userOperationType: 'leftClick'
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'CTC_SIGN_DIS_COMMAND', params).then((res) => {
console.log(res, '---res');
this.$message.success('代签成功!');
this.searchCmd();
@ -1096,6 +1136,8 @@ export default {
}).catch(error => {
this.$messageBox('代签令失败:' + error.message);
});
}
});
}).catch(() => {
console.log('取消代签');
});
@ -1125,8 +1167,16 @@ export default {
this.$messageBox('请选择受令单位');
return;
}
const params = {cmdId: this.command.cmdId};
const operate = {
operation: this.getDomObj('sendCmd').operation,
param: params,
userOperationType: 'leftClick'
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.cacheCmd().then(suc => {
sendCommandNew(this.group, 'CTC_SEND_DIS_COMMAND', {cmdId: this.command.cmdId}).then((res) => {
sendCommandNew(this.group, 'CTC_SEND_DIS_COMMAND', params).then((res) => {
console.log(res, '---res');
this.$message.success('发送调度命令成功!');
this.searchCmd();
@ -1139,6 +1189,8 @@ export default {
});
}
});
}
});
});
},
searchCmd() {

View File

@ -13,7 +13,7 @@
:src="item.imgUrl"
/>
</div>
<div class="text">{{ item.label }}</div>
<div :id="DispatcherManageDomObj[item.domId].domId" class="text">{{ item.label }}</div>
</div>
</div>
</div>
@ -24,6 +24,7 @@
import ZhanchangIcon from '@/assets/dispatcherStation/zhanchang.png';
import YunxingIcon from '@/assets/dispatcherStation/yunxing.png';
import CmdIcon from '@/assets/dispatcherStation/cmd.png';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'DispatcherManage',
components: {
@ -37,26 +38,31 @@ export default {
{
label: '运行图',
refPath: 'schedulingPlan',
domId: 'schedulingPlan',
imgUrl: YunxingIcon
},
{
label: '调度命令',
refPath: 'dispatchingCommand',
domId: 'dispatchingCommand',
imgUrl: CmdIcon
},
{
label: '站场图',
refPath: 'dispatchWork',
domId: 'dispatchWork',
imgUrl: ZhanchangIcon
},
{
label: '数据更新',
refPath: '',
domId: 'dataUpdate',
imgUrl: CmdIcon
},
{
label: '时间同步',
refPath: '',
domId: 'timeLock',
imgUrl: CmdIcon
}
],
@ -75,6 +81,9 @@ export default {
computed: {
group() {
return this.$route.query.group;
},
DispatcherManageDomObj() {
return OperationEvent.DispatcherManage.menu || {};
}
},
mounted() {
@ -95,6 +104,11 @@ export default {
this.$emit('pictureChange', refPath);
}, 100);
}
const operate = {
operation: this.DispatcherManageDomObj[refPath].operation,
userOperationType: 'leftClick'
};
this.$store.dispatch('training/nextNew', operate);
},
clickMenu(refPath) {
this.$alert('实现中......', '提示', {