Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
2ddd8f12d2
@ -54,6 +54,7 @@ export default {
|
|||||||
signalDeblock: 'Signal unsealing',
|
signalDeblock: 'Signal unsealing',
|
||||||
signalReopen: 'Signal reopen',
|
signalReopen: 'Signal reopen',
|
||||||
guideRouteHandle: 'Guide Route handling',
|
guideRouteHandle: 'Guide Route handling',
|
||||||
|
guide: 'Guide',
|
||||||
setInterlockAutoRoute: 'Set Interlock for Auto Routing',
|
setInterlockAutoRoute: 'Set Interlock for Auto Routing',
|
||||||
cancelInterlockAutoRoute: 'Cancel Interlock setting for Auto Routing',
|
cancelInterlockAutoRoute: 'Cancel Interlock setting for Auto Routing',
|
||||||
setInterlockAutoTrigger: 'Set Interlock for Auto Trigger',
|
setInterlockAutoTrigger: 'Set Interlock for Auto Trigger',
|
||||||
|
@ -54,6 +54,7 @@ export default {
|
|||||||
signalDeblock: '信号解封',
|
signalDeblock: '信号解封',
|
||||||
signalReopen: '信号重开',
|
signalReopen: '信号重开',
|
||||||
guideRouteHandle: '引导进路办理',
|
guideRouteHandle: '引导进路办理',
|
||||||
|
guide: '引导',
|
||||||
setInterlockAutoRoute: '设置联锁自动进路',
|
setInterlockAutoRoute: '设置联锁自动进路',
|
||||||
cancelInterlockAutoRoute: '取消联锁自动进路',
|
cancelInterlockAutoRoute: '取消联锁自动进路',
|
||||||
setInterlockAutoTrigger: '设置联锁自动触发',
|
setInterlockAutoTrigger: '设置联锁自动触发',
|
||||||
|
@ -207,53 +207,9 @@ function updateIscsListByDevice(state, name, device) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function updateIscsData(state, device) {
|
export function updateIscsData(state, device) {
|
||||||
// const state = store.state;
|
let type = device._type;
|
||||||
switch (device._type) {
|
if (type) {
|
||||||
case deviceType.Vidicon : updateIscsListByDevice(state, 'vidiconList', device); break;
|
type = type.replace(type[0], type[0].toLowerCase()) + 'List';
|
||||||
case deviceType.VidiconCloud : updateIscsListByDevice(state, 'vidiconCloudList', device); break;
|
updateIscsListByDevice(state, type, device);
|
||||||
case deviceType.ManualAlarmButton : updateIscsListByDevice(state, 'manualAlarmButtonList', device); break;
|
|
||||||
case deviceType.FireHydranAlarmButton: updateIscsListByDevice(state, 'fireHydranAlarmButtonList', device); break;
|
|
||||||
case deviceType.GasFireControl: updateIscsListByDevice(state, 'gasFireControlList', device); break;
|
|
||||||
case deviceType.SmokeDetector: updateIscsListByDevice(state, 'smokeDetectorList', device); break;
|
|
||||||
case deviceType.TemperatureDetector: updateIscsListByDevice(state, 'temperatureDetectorList', device); break;
|
|
||||||
case deviceType.PlatformScreenDoor: updateIscsListByDevice(state, 'platformScreenDoorList', device); break;
|
|
||||||
case deviceType.FrozenPump : updateIscsListByDevice(state, 'frozenPumpList', device); break;
|
|
||||||
case deviceType.Ventilator : updateIscsListByDevice(state, 'ventilatorList', device); break;
|
|
||||||
case deviceType.Chiller : updateIscsListByDevice(state, 'chillerList', device); break;
|
|
||||||
case deviceType.CoolTower : updateIscsListByDevice(state, 'coolTowerList', device); break;
|
|
||||||
case deviceType.EndDoor: updateIscsListByDevice(state, 'endDoorList', device); break;
|
|
||||||
case deviceType.BorderRadius: updateIscsListByDevice(state, 'borderRadiusList', device); break;
|
|
||||||
case deviceType.BrakeMachine: updateIscsListByDevice(state, 'brakeMachineList', device); break;
|
|
||||||
case deviceType.EntranceGuard: updateIscsListByDevice(state, 'entranceGuardList', device); break;
|
|
||||||
case deviceType.TicketMachine: updateIscsListByDevice(state, 'ticketMachineList', device); break;
|
|
||||||
case deviceType.SemiAutomaticTicketMachine: updateIscsListByDevice(state, 'semiAutomaticTicketMachineList', device); break;
|
|
||||||
case deviceType.AirConditioner: updateIscsListByDevice(state, 'airConditionerList', device); break;
|
|
||||||
case deviceType.OrbitalVentilator: updateIscsListByDevice(state, 'orbitalVentilatorList', device); break;
|
|
||||||
case deviceType.JetFan: updateIscsListByDevice(state, 'jetFanList', device); break;
|
|
||||||
case deviceType.TunnelFan: updateIscsListByDevice(state, 'tunnelFanList', device); break;
|
|
||||||
case deviceType.FireDamper: updateIscsListByDevice(state, 'fireDamperList', device); break;
|
|
||||||
case deviceType.SmookExhaustFd: updateIscsListByDevice(state, 'smookExhaustFdList', device); break;
|
|
||||||
case deviceType.SmookProofFd: updateIscsListByDevice(state, 'smookProofFdList', device); break;
|
|
||||||
case deviceType.VolumeControlDamper: updateIscsListByDevice(state, 'volumeControlDamperList', device); break;
|
|
||||||
case deviceType.IscsRect: updateIscsListByDevice(state, 'iscsRectList', device); break;
|
|
||||||
case deviceType.IscsText: updateIscsListByDevice(state, 'iscsTextList', device); break;
|
|
||||||
case deviceType.IscsLine: updateIscsListByDevice(state, 'iscsLineList', device); break;
|
|
||||||
case deviceType.Escalator: updateIscsListByDevice(state, 'escalatorList', device); break;
|
|
||||||
case deviceType.StairControl: updateIscsListByDevice(state, 'stairControlList', device); break;
|
|
||||||
case deviceType.FasBrakeMachine: updateIscsListByDevice(state, 'fasBrakeMachineList', device); break;
|
|
||||||
case deviceType.Staircase: updateIscsListByDevice(state, 'staircaseList', device); break;
|
|
||||||
case deviceType.SingleStaircase: updateIscsListByDevice(state, 'singleStaircaseList', device); break;
|
|
||||||
case deviceType.ArcStatus: updateIscsListByDevice(state, 'arcStatusList', device); break;
|
|
||||||
case deviceType.IscsButton: updateIscsListByDevice(state, 'iscsButtonList', device); break;
|
|
||||||
case deviceType.StateTable: updateIscsListByDevice(state, 'stateTableList', device); break;
|
|
||||||
case deviceType.LightingGroup: updateIscsListByDevice(state, 'lightingGroupList', device); break;
|
|
||||||
case deviceType.BalancedElectric: updateIscsListByDevice(state, 'balancedElectricList', device); break;
|
|
||||||
case deviceType.ElectricButterflyValve: updateIscsListByDevice(state, 'electricButterflyValveList', device); break;
|
|
||||||
case deviceType.Cistern: updateIscsListByDevice(state, 'cisternList', device); break;
|
|
||||||
case deviceType.Electrically: updateIscsListByDevice(state, 'electricallyList', device); break;
|
|
||||||
case deviceType.Stairs: updateIscsListByDevice(state, 'stairsList', device); break;
|
|
||||||
case deviceType.Elevator: updateIscsListByDevice(state, 'elevatorList', device); break;
|
|
||||||
case deviceType.Draught: updateIscsListByDevice(state, 'draughtList', device); break;
|
|
||||||
case deviceType.IscsImage: updateIscsListByDevice(state, 'iscsImageList', device); break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,12 +41,10 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'$store.state.socket.msgHead': function (elem) {
|
'$store.state.socket.msgHead': function (elem) {
|
||||||
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
||||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
const station = this.$store.getters['map/getDeviceByCode'](elem.stationCodes[0]);
|
||||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
|
||||||
const newOperate = {
|
const newOperate = {
|
||||||
name: station.name
|
name: station.name
|
||||||
};
|
};
|
||||||
|
|
||||||
if (elem.timeout) {
|
if (elem.timeout) {
|
||||||
newOperate['msg'] = this.$t('menu.passiveDialog.requestTimedOut');
|
newOperate['msg'] = this.$t('menu.passiveDialog.requestTimedOut');
|
||||||
this.doShow(newOperate);
|
this.doShow(newOperate);
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
<span class="base-label">{{ $t('menu.commandInformation') }}</span>
|
||||||
<el-form label-position="center" size="mini">
|
<el-form label-position="center" size="mini">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
<el-form-item :label="this.$t('menu.type')" label-width="40px">
|
||||||
<el-select v-model="operation" size="small" disabled>
|
<el-select v-model="operation" size="small" disabled>
|
||||||
<el-option
|
<el-option
|
||||||
@ -27,8 +27,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="9">
|
||||||
<el-form-item :label="this.$t('menu.stationName')" label-width="80px">
|
<el-form-item :label="this.$t('menu.stationName')" label-width="120px">
|
||||||
<el-input v-model="stationName" size="small" disabled />
|
<el-input v-model="stationName" size="small" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -116,7 +116,7 @@ export default {
|
|||||||
typeList() {
|
typeList() {
|
||||||
return [
|
return [
|
||||||
{ code: OperationEvent.Signal.unlock.menu.operation, name: this.$t('menu.menuSignal.signalDeblock') },
|
{ code: OperationEvent.Signal.unlock.menu.operation, name: this.$t('menu.menuSignal.signalDeblock') },
|
||||||
{ code: OperationEvent.Signal.guide.menu.operation, name: this.$t('menu.menuSignal.guideRouteHandle') }
|
{ code: OperationEvent.Signal.guide.menu.operation, name: '办理引导进路' }
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
|
@ -108,6 +108,11 @@ export default {
|
|||||||
handler: this.active,
|
handler: this.active,
|
||||||
cmdType: CMD.Section.CMD_SECTION_ACTIVE
|
cmdType: CMD.Section.CMD_SECTION_ACTIVE
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('menu.menuSection.sectionAxisPreReset'),
|
||||||
|
handler: this.axlePreReset,
|
||||||
|
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSection.sectionBlockade'),
|
label: this.$t('menu.menuSection.sectionBlockade'),
|
||||||
handler: this.lock,
|
handler: this.lock,
|
||||||
|
@ -108,6 +108,11 @@ export default {
|
|||||||
label: this.$t('menu.menuSignal.signalOff'),
|
label: this.$t('menu.menuSignal.signalOff'),
|
||||||
handler: this.signalClose,
|
handler: this.signalClose,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
|
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '查询进路控制模式',
|
||||||
|
handler: this.detail,
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
@ -141,6 +146,31 @@ export default {
|
|||||||
handler: this.reopenSignal,
|
handler: this.reopenSignal,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('menu.menuSignal.guide'),
|
||||||
|
handler: this.guide,
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('menu.menuSignal.setInterlockAutoRoute'),
|
||||||
|
handler: this.setAutoInterlock,
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'),
|
||||||
|
handler: this.cancelAutoInterlock,
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('menu.menuSignal.setInterlockAutoTrigger'),
|
||||||
|
handler: this.setAutoTrigger,
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'),
|
||||||
|
handler: this.cancelAutoTrigger,
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('menu.menuSignal.humanControl'),
|
label: this.$t('menu.menuSignal.humanControl'),
|
||||||
handler: this.humanControl,
|
handler: this.humanControl,
|
||||||
@ -150,6 +180,11 @@ export default {
|
|||||||
label: this.$t('menu.menuSignal.atsAutoControl'),
|
label: this.$t('menu.menuSignal.atsAutoControl'),
|
||||||
handler: this.atsAutoControl,
|
handler: this.atsAutoControl,
|
||||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '查询进路控制模式',
|
||||||
|
handler: this.detail,
|
||||||
|
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -346,27 +381,15 @@ export default {
|
|||||||
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected));
|
this.$refs.routeHandControl.doShow(operate, this.selected, this.getRouteList(this.selected));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
// 查询进路状态
|
// 查询进路状态
|
||||||
// detail() {
|
detail() {
|
||||||
// const step = {
|
commitOperate(menuOperate.Signal.detail, {signalCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||||
// start: true,
|
if (valid) {
|
||||||
// code: `${this.selected.code}`,
|
this.$refs.routeDetail.doShow(operate, this.selected, this.getRouteList(this.selected));
|
||||||
// operation: OperationEvent.Signal.detail.menu.operation,
|
}
|
||||||
// param: {
|
});
|
||||||
// Signal_Code: `${this.selected.code}`
|
}
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// this.$store.dispatch('training/next', step).then(({ valid }) => {
|
|
||||||
// if (valid) {
|
|
||||||
// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
|
||||||
// querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => {
|
|
||||||
// const tempData = resp.data;
|
|
||||||
// this.$refs.routeDetail.doShow(step, this.selected, tempData);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -41,8 +41,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'$store.state.socket.msgHead': function (elem) {
|
'$store.state.socket.msgHead': function (elem) {
|
||||||
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
||||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
const station = this.$store.getters['map/getDeviceByCode'](elem.stationCodes[0]);
|
||||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
|
||||||
const newOperate = {
|
const newOperate = {
|
||||||
name: station.name
|
name: station.name
|
||||||
};
|
};
|
||||||
@ -83,7 +82,6 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
operation: OperationEvent.Command.close.notice.operation
|
operation: OperationEvent.Command.close.notice.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
@ -41,12 +41,10 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'$store.state.socket.msgHead': function (elem) {
|
'$store.state.socket.msgHead': function (elem) {
|
||||||
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
if (elem && elem.type == 'resp' && (elem.timeout || !elem.agree)) {
|
||||||
const control = this.$store.getters['map/getDeviceByCode'](elem.stationControlCode);
|
const station = this.$store.getters['map/getDeviceByCode'](elem.stationCodes[0]);
|
||||||
const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
|
|
||||||
const newOperate = {
|
const newOperate = {
|
||||||
name: station.name
|
name: station.name
|
||||||
};
|
};
|
||||||
|
|
||||||
if (elem.timeout) {
|
if (elem.timeout) {
|
||||||
newOperate['msg'] = this.$t('menu.passiveDialog.requestTimedOut');
|
newOperate['msg'] = this.$t('menu.passiveDialog.requestTimedOut');
|
||||||
this.doShow(newOperate);
|
this.doShow(newOperate);
|
||||||
@ -84,7 +82,7 @@ export default {
|
|||||||
operation: OperationEvent.Command.close.notice.operation
|
operation: OperationEvent.Command.close.notice.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
@ -95,7 +93,7 @@ export default {
|
|||||||
const operate = {
|
const operate = {
|
||||||
operation: OperationEvent.Command.close.notice.operation
|
operation: OperationEvent.Command.close.notice.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
|
@ -174,6 +174,7 @@ import IbpKey from './ibpKey';
|
|||||||
import IbpClock from './ibpClock';
|
import IbpClock from './ibpClock';
|
||||||
import IbpRotateTip from './ibpRotateTip';
|
import IbpRotateTip from './ibpRotateTip';
|
||||||
import { putIbpDrawData, getIbpInfo } from '@/api/ibp';
|
import { putIbpDrawData, getIbpInfo } from '@/api/ibp';
|
||||||
|
import {getStationList} from '@/api/runplan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'IbpOperate',
|
name: 'IbpOperate',
|
||||||
@ -200,28 +201,34 @@ export default {
|
|||||||
return {
|
return {
|
||||||
enabledTab: 'Background',
|
enabledTab: 'Background',
|
||||||
data: '',
|
data: '',
|
||||||
stationOptions:[
|
stationOptions:[],
|
||||||
{
|
// stationOptions:[
|
||||||
value: 'Station_203_0.07533',
|
// {
|
||||||
// label: '通化门站'
|
// value: 'Station_203_0.07533',
|
||||||
label: '车站一'
|
// // label: '通化门站'
|
||||||
},
|
// label: '车站一'
|
||||||
{
|
// },
|
||||||
value: 'Station_207_0.62282',
|
// {
|
||||||
// label: '枣园站'
|
// value: 'Station_207_0.62282',
|
||||||
label: '车站二'
|
// // label: '枣园站'
|
||||||
},
|
// label: '车站二'
|
||||||
{
|
// },
|
||||||
value: 'Station_209_0.95175',
|
// {
|
||||||
label: '车站三'
|
// value: 'Station_209_0.95175',
|
||||||
// label: '后卫寨站'
|
// label: '车站三'
|
||||||
}
|
// // label: '后卫寨站'
|
||||||
],
|
// }
|
||||||
|
// ],
|
||||||
// drawData: {},
|
// drawData: {},
|
||||||
stationCode: '',
|
// stationCode: '',
|
||||||
height: this.$store.state.app.height - 190
|
height: this.$store.state.app.height - 190
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
stationCode() {
|
||||||
|
return this.$route.query.stationCode;
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.ibp.rightClickCount': function (val) {
|
'$store.state.ibp.rightClickCount': function (val) {
|
||||||
const model = this.$store.getters['ibp/updateDeviceData'];
|
const model = this.$store.getters['ibp/updateDeviceData'];
|
||||||
@ -230,6 +237,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
try {
|
try {
|
||||||
|
const resp = await getStationList(this.$route.query.mapId);
|
||||||
const res = await getIbpInfo(this.$route.query.ibpId);
|
const res = await getIbpInfo(this.$route.query.ibpId);
|
||||||
if (res.data.data) {
|
if (res.data.data) {
|
||||||
const drawData = JSON.parse(res.data.data).drawData;
|
const drawData = JSON.parse(res.data.data).drawData;
|
||||||
@ -237,6 +245,12 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.setEmptyShow();
|
this.setEmptyShow();
|
||||||
}
|
}
|
||||||
|
if (resp.data && resp.data.length > 0) {
|
||||||
|
const stationList = resp.data;
|
||||||
|
stationList.forEach(station=>{
|
||||||
|
this.stationOptions.push({label:station.name, value:station.code});
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div v-if="chapterShow" class="box">
|
<div v-if="chapterShow" class="box">
|
||||||
<chapter-edit ref="chapter" @refresh="refresh" />
|
<chapter-edit ref="chapter" @refresh="refresh" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="treeShow" class="box">
|
<div v-if="sortTreeShow" class="box">
|
||||||
<sort-tree ref="sortTree" @refresh="refresh" />
|
<sort-tree ref="sortTree" @refresh="refresh" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -30,7 +30,7 @@ export default {
|
|||||||
isNew: true,
|
isNew: true,
|
||||||
lessonShow: true,
|
lessonShow: true,
|
||||||
chapterShow: false,
|
chapterShow: false,
|
||||||
treeShow: false,
|
sortTreeShow: false,
|
||||||
menuoper: {},
|
menuoper: {},
|
||||||
demoObj: null
|
demoObj: null
|
||||||
};
|
};
|
||||||
@ -45,49 +45,19 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
const data = this.$route.query;
|
this.initData();
|
||||||
switch (this.$route.params.type) {
|
|
||||||
case 'lessonCreate':
|
|
||||||
this.lessonCreate(data);
|
|
||||||
break;
|
|
||||||
case 'lessonEdit':
|
|
||||||
this.lessonEdit(data);
|
|
||||||
break;
|
|
||||||
case 'chapterCreate':
|
|
||||||
this.chapterCreate(data);
|
|
||||||
break;
|
|
||||||
case 'chapterEdit':
|
|
||||||
this.chapterEdit(data);
|
|
||||||
break;
|
|
||||||
case 'treeSort':
|
|
||||||
this.treeSort(data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const data = this.$route.query;
|
this.initData();
|
||||||
switch (this.$route.params.type) {
|
|
||||||
case 'lessonCreate':
|
|
||||||
this.lessonCreate(data);
|
|
||||||
break;
|
|
||||||
case 'lessonEdit':
|
|
||||||
this.lessonEdit(data);
|
|
||||||
break;
|
|
||||||
case 'chapterCreate':
|
|
||||||
this.chapterCreate(data);
|
|
||||||
break;
|
|
||||||
case 'chapterEdit':
|
|
||||||
this.chapterEdit(data);
|
|
||||||
break;
|
|
||||||
case 'treeSort':
|
|
||||||
this.treeSort(data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
initData() {
|
||||||
|
const data = this.$route.query;
|
||||||
|
this.runFunc(this.$route.params.type, data);
|
||||||
|
},
|
||||||
exchangeShow(model) {
|
exchangeShow(model) {
|
||||||
['lessonShow', 'chapterShow', 'treeShow'].forEach(elem => {
|
['lessonShow', 'chapterShow', 'sortTreeShow'].forEach(elem => {
|
||||||
if (model[elem]) {
|
if (model[elem]) {
|
||||||
this[elem] = true;
|
this[elem] = true;
|
||||||
} else {
|
} else {
|
||||||
@ -95,40 +65,37 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
lessonCreate(data) {
|
runFunc(func, data) {
|
||||||
this.isNew = true;
|
// 策略模式
|
||||||
this.exchangeShow({ lessonShow: true });
|
return this[func](data);
|
||||||
|
},
|
||||||
|
toNextPage(type, isCreate, data) {
|
||||||
|
this.isNew = isCreate;
|
||||||
|
const typeShow = {};
|
||||||
|
typeShow[type + 'Show'] = true;
|
||||||
|
this.exchangeShow(typeShow);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.lesson.initData(true, data);
|
if (type != 'sortTree') {
|
||||||
|
this.$refs[type].initData(isCreate, data);
|
||||||
|
} else {
|
||||||
|
this.$refs[type].initData(data);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
lessonCreate(data) {
|
||||||
|
this.toNextPage('lesson', true, data);
|
||||||
|
},
|
||||||
lessonEdit(data) {
|
lessonEdit(data) {
|
||||||
this.isNew = false;
|
this.toNextPage('lesson', false, data);
|
||||||
this.exchangeShow({ lessonShow: true });
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.lesson.initData(false, data);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
chapterCreate(data) {
|
chapterCreate(data) {
|
||||||
this.isNew = true;
|
this.toNextPage('chapter', true, data);
|
||||||
this.exchangeShow({ chapterShow: true });
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.chapter.initData(true, data);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
chapterEdit(data) {
|
chapterEdit(data) {
|
||||||
this.isNew = false;
|
this.toNextPage('chapter', false, data);
|
||||||
this.exchangeShow({ chapterShow: true });
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.chapter.initData(false, data);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
treeSort(data) {
|
treeSort(data) {
|
||||||
this.isNew = false;
|
this.toNextPage('sortTree', false, data);
|
||||||
this.exchangeShow({ treeShow: true });
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.sortTree.initData(data);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
refresh(filterSelect) {
|
refresh(filterSelect) {
|
||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
|
Loading…
Reference in New Issue
Block a user