代码调整

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

View File

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