Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
47d9e6573d
@ -178,3 +178,12 @@ export function getBindWxQrCodeUrl() {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 绑定单位
|
||||
export function bindCompany(data) {
|
||||
return request({
|
||||
url: `/api/company/bind/company?${data}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -569,11 +569,9 @@ export default {
|
||||
signalSectionSuccessful: 'Signal close section created successfully!',
|
||||
signalSectionUpdateSucceeded: 'Update signal close to section successful!',
|
||||
|
||||
crossCoding:'Cross code',
|
||||
crossName:'Cross name',
|
||||
relateSwitchList:'Related switchList',
|
||||
relateSectionList:'Related sectionList',
|
||||
cross:'cross',
|
||||
generateCross:'generate cross',
|
||||
|
||||
belongsSection: 'Belongs section:',
|
||||
coordinateMode: 'Coordinate mode',
|
||||
|
@ -25,9 +25,7 @@ export default {
|
||||
linkSelectName: 'Enter the Link name',
|
||||
linkSelectDisplayLength: 'Please enter the actual length of the Link',
|
||||
|
||||
pleaseSelectCross:'Please select cross',
|
||||
pleaseInputCrossName:'Please input cross name',
|
||||
pleaseSelectSwitch:'Please select switch',
|
||||
|
||||
lengthShow: 'According to the length of the:',
|
||||
lengthFact: 'The real length:',
|
||||
|
@ -563,11 +563,9 @@ export default {
|
||||
interlockingBlocks: '联锁区段',
|
||||
alwaysRed: '是否总是显示红灯',
|
||||
|
||||
crossCoding:'岔心编号',
|
||||
crossName:'岔心名称',
|
||||
relateSwitchList:'关联道岔',
|
||||
relateSectionList:'关联区段',
|
||||
cross:'岔心',
|
||||
generateCross:'一键生成岔心',
|
||||
|
||||
belongsSection: '所属区段:',
|
||||
coordinateMode: '坐标方式',
|
||||
|
@ -24,9 +24,7 @@ export default {
|
||||
linkSelectName: '请输入Link名称',
|
||||
linkSelectDisplayLength: '请输入Link实际长度',
|
||||
|
||||
pleaseSelectCross:'请选择岔心',
|
||||
pleaseInputCrossName:'请输入岔心名称',
|
||||
pleaseSelectSwitch:'请选择道岔',
|
||||
|
||||
lengthShow: '显示长度:',
|
||||
lengthFact: '真实长度:',
|
||||
|
@ -116,7 +116,9 @@ export function sandBoxConnect(manager,routegroup,section,signal,station,train )
|
||||
train.trainGroup.add(train.trainlist[data.body[i].code]);
|
||||
}else{
|
||||
let realprogress = section.topSectionList[data.body[i].section].leftProgress+(section.topSectionList[data.body[i].section].rightProgress - section.topSectionList[data.body[i].section].leftProgress)*data.body[i].offset;
|
||||
train.trainlist[data.body[i].code].position.copy(manager.topCurve.getPoint(realprogress));
|
||||
let realpos = manager.topCurve.getPoint(realprogress);
|
||||
train.trainlist[data.body[i].code].position.x = realpos.x;
|
||||
train.trainlist[data.body[i].code].position.z = realpos.z;
|
||||
|
||||
train.trainlist[data.body[i].code].up = new THREE.Vector3(1,0,0);
|
||||
let tangent = manager.topCurve.getTangentAt(realprogress).normalize();
|
||||
@ -144,7 +146,10 @@ export function sandBoxConnect(manager,routegroup,section,signal,station,train )
|
||||
}else{
|
||||
|
||||
let realprogress = section.downSectionList[data.body[i].section].leftProgress +(section.downSectionList[data.body[i].section].rightProgress - section.downSectionList[data.body[i].section].leftProgress)*data.body[i].offset;
|
||||
train.trainlist[data.body[i].code].position.copy(manager.downCurve.getPoint(realprogress));
|
||||
let realpos = manager.downCurve.getPoint(realprogress);
|
||||
train.trainlist[data.body[i].code].position.x = realpos.x;
|
||||
train.trainlist[data.body[i].code].position.z = realpos.z;
|
||||
|
||||
|
||||
train.trainlist[data.body[i].code].up = new THREE.Vector3(-1,0,0);
|
||||
let tangent = manager.downCurve.getTangentAt(realprogress).normalize();
|
||||
|
@ -23,6 +23,15 @@ export function signalModel(scene) {
|
||||
|
||||
newsignal.position.copy(downCurve.getPoint(downData[j].leftProgress));
|
||||
|
||||
newsignal.up = new THREE.Vector3(1,0,0);
|
||||
newsignal.axis = new THREE.Vector3();
|
||||
let tangent = downCurve.getTangentAt(downData[j].leftProgress).normalize();
|
||||
newsignal.axis.crossVectors(newsignal.up, tangent).normalize();
|
||||
let radians = Math.acos(newsignal.up.dot(tangent));
|
||||
newsignal.quaternion.setFromAxisAngle(newsignal.axis, radians);
|
||||
|
||||
|
||||
|
||||
scene.add( newsignal );
|
||||
j = downData.length;
|
||||
}
|
||||
|
@ -11,9 +11,11 @@ export function trainModel(scene) {
|
||||
var trainBox = new THREE.Mesh( geometry, material );
|
||||
trainBox.code = trainData[i].code;
|
||||
trainBox.groupNumber = trainData[i].groupNumber;
|
||||
|
||||
trainBox.dispose = false;
|
||||
trainBox.up = new THREE.Vector3(1, 0, 0);
|
||||
trainBox.axis = new THREE.Vector3();
|
||||
trainBox.position.y = 5;
|
||||
scope.trainlist[trainData[i].groupNumber] = trainBox;
|
||||
}
|
||||
}
|
||||
|
@ -829,6 +829,14 @@ class SkinCode extends defaultStyle {
|
||||
fontOffsetY: 24
|
||||
};
|
||||
|
||||
// /** 岔心 */
|
||||
// this[deviceType.Cross] = {
|
||||
// centerSquare:{
|
||||
// defaultColor:'#fff'
|
||||
// }
|
||||
|
||||
// };
|
||||
|
||||
this[deviceType.Responder] = {
|
||||
block: {
|
||||
mapStyle: {
|
||||
|
@ -275,4 +275,5 @@ deviceRender[deviceType.Responder] = {
|
||||
_type: deviceType.Responder,
|
||||
zlevel: 1
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -253,5 +253,5 @@ deviceState[deviceType.Train] = {
|
||||
|
||||
};
|
||||
deviceState[deviceType.Responder] = {
|
||||
}
|
||||
};
|
||||
export default deviceState;
|
||||
|
95
src/jmapNew/shape/Cross/index.js
Normal file
95
src/jmapNew/shape/Cross/index.js
Normal file
@ -0,0 +1,95 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Polyline from 'zrender/src/graphic/shape/Polyline';
|
||||
|
||||
export default class Cross extends Group {
|
||||
// _type: 'Cross',
|
||||
// code: getUID('Cross', this.crossList),
|
||||
// position:each.position,
|
||||
// relatedSwitch:each.relatedSwitch
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 0;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
// position;
|
||||
// relatedSwitch;
|
||||
// model.position.x,
|
||||
// model.position.y,
|
||||
// const relatedSwitchList = model.relatedSwitch;
|
||||
const offset = this.style.Section.line.width / (2 * 0.7071);
|
||||
const points = [
|
||||
[model.position.x, model.position.y + offset],
|
||||
[model.position.x + offset, model.position.y + offset],
|
||||
[model.position.x, model.position.y + 2 * offset],
|
||||
[model.position.x - offset, model.position.y + offset],
|
||||
[model.position.x, model.position.y + offset]
|
||||
];
|
||||
this.centerSquare = new Polyline({
|
||||
zlevel: this.zlevel,
|
||||
z:this.z + 1,
|
||||
shape: {
|
||||
points:points
|
||||
},
|
||||
style: {
|
||||
stroke: this.style.Cross.centerSquare.defaultColor,
|
||||
fill:this.style.Cross.centerSquare.defaultColor
|
||||
}
|
||||
});
|
||||
this.add(this.centerSquare);
|
||||
// let relatedSwitchList[0].sectionCCode
|
||||
// if (model && model.points.length > 1) {
|
||||
// const points = [];
|
||||
// const modelPoints = model.points;
|
||||
// const length = modelPoints.length;
|
||||
// for (let i = 0; i < length; i++) {
|
||||
// points.push([modelPoints[i].x, modelPoints[i].y]);
|
||||
// }
|
||||
// this.segment = new Polyline({
|
||||
// zlevel: this.zlevel,
|
||||
// z:this.z,
|
||||
// shape: {
|
||||
// points:points
|
||||
// },
|
||||
// style: {
|
||||
// lineWidth: model.width,
|
||||
// stroke: model.lineColor || this.style.lineColor
|
||||
// }
|
||||
// });
|
||||
// this.add(this.segment);
|
||||
// }
|
||||
}
|
||||
|
||||
setLineType(type) {
|
||||
switch (type) {
|
||||
case '01': break;
|
||||
case '02':
|
||||
this.segment && this.segment.setStyle('lineDash', this.style.lineDash || [4]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
this.setLineType(model.type);
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.segment && this.segment.show();
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.segment && this.segment.hide();
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -17,9 +17,9 @@ export default class Responder extends Group {
|
||||
this.isShowShape = true;
|
||||
this.z = model.zIndex || 1;
|
||||
if (model.previewOrMapDraw) {
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
this.create();
|
||||
this.setState(model);
|
||||
}
|
||||
}
|
||||
|
||||
create() {
|
||||
|
@ -21,6 +21,9 @@ export default class ELines extends Group {
|
||||
if ((model.type == '01' && (!model.logicSectionCodeList || !model.logicSectionCodeList.length)) || model.type == '02' || model.type == '03') {
|
||||
this.createLine();
|
||||
}
|
||||
if (model.type == '05') {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
createLine() {
|
||||
|
@ -34,7 +34,7 @@ export default class Section extends Group {
|
||||
}
|
||||
|
||||
create() {
|
||||
// 区段type 01计轴区段;02逻辑区段;03道岔区段 04道岔计轴区段
|
||||
// 区段type 01计轴区段;02逻辑区段;03道岔区段 04道岔计轴区段 05 岔心
|
||||
// 站台所有的绘图元素
|
||||
const elementTypeList = {
|
||||
'name': ETextName, // 区段名称
|
||||
|
@ -26,105 +26,105 @@ export default {
|
||||
label: '发送',
|
||||
handler: this.sendRequestList
|
||||
},
|
||||
{
|
||||
label: '取消',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '全部扣车',
|
||||
children: [
|
||||
{
|
||||
label: '正线上全部扣车',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '全部发车',
|
||||
children: [
|
||||
{
|
||||
label: '缓解正线所有列车',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '停止所有列车',
|
||||
children: [
|
||||
{
|
||||
label: '停止正线所有列车',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// label: '取消',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '全部扣车',
|
||||
// children: [
|
||||
// {
|
||||
// label: '正线上全部扣车',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '全部发车',
|
||||
// children: [
|
||||
// {
|
||||
// label: '缓解正线所有列车',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '停止所有列车',
|
||||
// children: [
|
||||
// {
|
||||
// label: '停止正线所有列车',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
label: '车站选择',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
label: '列车选择',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '缩放',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '显示控制',
|
||||
children: [
|
||||
{
|
||||
label: '正线及车辆段',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '列车信息',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '下一窗口',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '上一窗口',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '激活所有菜单',
|
||||
children: [
|
||||
{
|
||||
label: '确认',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '恢复激活菜单',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '进路模式 - 授权车站',
|
||||
children: [
|
||||
{
|
||||
label: '自动',
|
||||
handler: this.undeveloped
|
||||
},
|
||||
{
|
||||
label: '人工',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '列车报警确认',
|
||||
children: [
|
||||
{
|
||||
label: '列车完整性报警确认',
|
||||
handler: this.undeveloped
|
||||
}
|
||||
]
|
||||
}
|
||||
// {
|
||||
// label: '列车选择',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '缩放',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '显示控制',
|
||||
// children: [
|
||||
// {
|
||||
// label: '正线及车辆段',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '列车信息',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '下一窗口',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '上一窗口',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '激活所有菜单',
|
||||
// children: [
|
||||
// {
|
||||
// label: '确认',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '恢复激活菜单',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '进路模式 - 授权车站',
|
||||
// children: [
|
||||
// {
|
||||
// label: '自动',
|
||||
// handler: this.undeveloped
|
||||
// },
|
||||
// {
|
||||
// label: '人工',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// label: '列车报警确认',
|
||||
// children: [
|
||||
// {
|
||||
// label: '列车完整性报警确认',
|
||||
// handler: this.undeveloped
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
]
|
||||
};
|
||||
},
|
||||
@ -174,7 +174,7 @@ export default {
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
this.menuNormal[5].children = this.initStationList();
|
||||
this.menuNormal[1].children = this.initStationList();
|
||||
this.menu = this.menuNormal;
|
||||
},
|
||||
doShow(point) {
|
||||
|
@ -140,6 +140,7 @@ const MessageBoard = () => import('@/views/messageBoard/index');
|
||||
const BoardManage = () => import('@/views/messageBoard/manage');
|
||||
const DraftLessonManage = () => import('@/views/teach/draftLessonManage');
|
||||
const OrganizationManage = () => import('@/views/organization/index');
|
||||
const RunPlanViewWindow = () => import('@/views/newMap/displayNew/demon/runPlanViewWindow');
|
||||
|
||||
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
|
||||
// import { getSessionStorage } from '@/utils/auth';
|
||||
@ -232,6 +233,11 @@ export const constantRoutes = [
|
||||
component: PlanMonitorEditAUSTool,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/runPlanViewWindow',
|
||||
component: RunPlanViewWindow,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/jlmap3d/sandbox',
|
||||
component: Jlmap3dSandbox,
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div class="btn-buy">
|
||||
<!-- <el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button> -->
|
||||
<el-button v-if="hasPermssion && !isComprehensive && !isLocal" type="primary" :disabled="disabled" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
|
||||
<el-button v-show="isStartDemon" :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
|
||||
<el-button :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -78,9 +78,6 @@ export default {
|
||||
isComprehensive() {
|
||||
return this.courseModel.prdType === '03';
|
||||
},
|
||||
isStartDemon() {
|
||||
return (this.hasPermssion || this.tryTime > 0);
|
||||
},
|
||||
mapId() {
|
||||
return this.$route.query.mapId;
|
||||
},
|
||||
@ -173,7 +170,11 @@ export default {
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
if (error.code == 10003) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
}
|
||||
this.disabled = false;
|
||||
});
|
||||
},
|
||||
@ -188,6 +189,11 @@ export default {
|
||||
this.$router.push({ path: `/displayIscs/system`, query: query });
|
||||
}
|
||||
} catch (error) {
|
||||
if (error.code == 10003) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
}
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
@ -200,7 +206,11 @@ export default {
|
||||
}
|
||||
this.$router.push({ path: `/displayBigScreen/${this.courseModel.mapId}`, query: query });
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
if (error.code == 10003) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
}
|
||||
this.disabled = false;
|
||||
});
|
||||
},
|
||||
@ -220,7 +230,11 @@ export default {
|
||||
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error=>{
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
if (error.code == 10003) {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
|
||||
} else {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
}
|
||||
this.disabled = false;
|
||||
});
|
||||
},
|
||||
|
@ -46,7 +46,7 @@
|
||||
<div class="btn-buy">
|
||||
<!-- <el-button v-if="!isLocal" :disabled="disabled" type="success" @click="buy">{{ $t('exam.buy') }}</el-button> -->
|
||||
<el-button v-if="hasPermssion && !isLocal" :disabled="disabled" type="primary" @click="distribute">{{ $t('exam.distributePermission') }}</el-button>
|
||||
<el-button v-if="hasPermssion && !$route.query.noPreLogout && !courseModel.systemFault" :disabled="disabled" type="primary" @click="checkCourse">{{ $t('exam.viewCoursePapers') }}</el-button>
|
||||
<el-button v-if=" (isAdmin || isShowPaper)&& !$route.query.noPreLogout && !courseModel.systemFault" :disabled="disabled" type="primary" @click="checkCourse">{{ $t('exam.viewCoursePapers') }}</el-button>
|
||||
<el-button v-if="!$route.query.noPreLogout" type="primary" :disabled="disabled" @click="backLessonList">{{ $t('exam.returnCourseList') }}</el-button>
|
||||
<el-button v-if="$route.query.noPreLogout" type="primary" :disabled="disabled" @click="quit">退出</el-button>
|
||||
</div>
|
||||
@ -59,6 +59,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import LimitList from '@/views/components/limits/index';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import localStore from 'storejs';
|
||||
import { superAdmin, admin } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'ExamDetailView',
|
||||
@ -111,6 +112,12 @@ export default {
|
||||
});
|
||||
}
|
||||
return sumRemains >= 10;
|
||||
},
|
||||
isShowPaper() {
|
||||
return this.$store.state.user.companyId && this.$store.state.user.companyAdmin;
|
||||
},
|
||||
isAdmin() {
|
||||
return this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(superAdmin);
|
||||
}
|
||||
// height() {
|
||||
// return this.$route.query.noPreLogout ? this.$store.state.app.height : this.$store.state.app.height - 91;
|
||||
@ -141,7 +148,7 @@ export default {
|
||||
treeList: resp.data.examDefinitionList,
|
||||
systemFault: resp.data.systemFault
|
||||
};
|
||||
if (this.hasPermssion) {
|
||||
if (this.hasPermssion || resp.data.available) {
|
||||
this.valid = true;
|
||||
}
|
||||
}
|
||||
@ -169,16 +176,12 @@ export default {
|
||||
},
|
||||
checkCourse() {
|
||||
this.loading = true;
|
||||
if (this.isAddRule) {
|
||||
const path = `${this.$route.path.match(/(\/.*)\/course/)[1]}${UrlConfig.examRuleManage}`;
|
||||
this.$router.push({
|
||||
path: path,
|
||||
query: { lessonId: this.courseModel.id },
|
||||
noPreLogout: this.$route.query.noPreLogout
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.notViewTheCoursePaper'));
|
||||
}
|
||||
const path = `${this.$route.path.match(/(\/.*)\/course/)[1]}${UrlConfig.examRuleManage}`;
|
||||
this.$router.push({
|
||||
path: path,
|
||||
query: { lessonId: this.courseModel.id },
|
||||
noPreLogout: this.$route.query.noPreLogout
|
||||
});
|
||||
},
|
||||
distribute() { // 分发
|
||||
this.disabled = true;
|
||||
|
@ -6,6 +6,49 @@
|
||||
'left': uiLeft,
|
||||
'display': uiDisplay,
|
||||
}">
|
||||
<el-card class="box-title">
|
||||
设备信息
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card">
|
||||
<!-- 列车 -->
|
||||
<div v-if="selectmodel.code" class="text item">
|
||||
列车编号:{{selectmodel.code}}
|
||||
</div>
|
||||
<div v-if="selectmodel.v" class="text item">
|
||||
速度:{{selectmodel.v}}
|
||||
</div>
|
||||
<div v-if="selectmodel.right" class="text item">
|
||||
行进方向:{{selectmodel.right}}
|
||||
</div>
|
||||
<div v-if="selectmodel.num" class="text item">
|
||||
车内人数:{{selectmodel.num}}
|
||||
</div>
|
||||
<div v-if="selectmodel.leftdoor" class="text item">
|
||||
左侧车门:{{selectmodel.leftdoor}}
|
||||
</div>
|
||||
<div v-if="selectmodel.rightdoor" class="text item">
|
||||
右侧车门:{{selectmodel.rightdoor}}
|
||||
</div>
|
||||
|
||||
<!-- 车站 -->
|
||||
<div v-if="selectmodel.name" class="text item">
|
||||
车站:{{selectmodel.name}}
|
||||
</div>
|
||||
<div v-if="selectmodel.topnum" class="text item">
|
||||
上行站台人数:{{selectmodel.topnum}}
|
||||
</div>
|
||||
<div v-if="selectmodel.downnum" class="text item">
|
||||
下行站台人数:{{selectmodel.downnum}}
|
||||
</div>
|
||||
<div v-if="selectmodel.topdoor" class="text item">
|
||||
上行车门:{{selectmodel.topdoor}}
|
||||
</div>
|
||||
<div v-if="selectmodel.downdoor" class="text item">
|
||||
下行车门:{{selectmodel.downdoor}}
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@ -26,6 +69,14 @@ export default {
|
||||
uiDisplay:'none',
|
||||
uiTop:'0px',
|
||||
uiLeft:'0px',
|
||||
selectmodel:{
|
||||
code:"asd123",
|
||||
v:"80km/h",
|
||||
right:"上行",
|
||||
num:100,
|
||||
leftdoor:"关闭",
|
||||
rightdoor:"关闭"
|
||||
},
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
@ -63,4 +114,37 @@ export default {
|
||||
background-size:100%;
|
||||
// display:none;
|
||||
}
|
||||
.text {
|
||||
font-size: 8px;
|
||||
color:#ffffff;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
.box-title{
|
||||
position: absolute;
|
||||
top:20px;
|
||||
left:7px;
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
}
|
||||
.box-card {
|
||||
position: absolute;
|
||||
top:45px;
|
||||
left:7px;
|
||||
width: 136px;
|
||||
background-color:rgba(0,0,0,0);
|
||||
}
|
||||
</style>
|
||||
|
564
src/views/newMap/displayNew/demon/runPlanViewWindow.vue
Normal file
564
src/views/newMap/displayNew/demon/runPlanViewWindow.vue
Normal file
@ -0,0 +1,564 @@
|
||||
<template>
|
||||
<div v-loading="dialogLoading" style="width: 100%;height: 100%;">
|
||||
<div style="text-align: center;font-size: 20px;padding-top: 10px;">{{ title }}</div>
|
||||
<div id="PlanSchedule" :style="{top: top+'px', height: height+'px'}">
|
||||
<div class="left">
|
||||
<div :id="runPlanId" />
|
||||
</div>
|
||||
<div class="right">
|
||||
<data-table
|
||||
ref="serviceTable1"
|
||||
:height="height/2 - 15"
|
||||
:config="serviceNumberConfig"
|
||||
:style="{top: top-height/2+'px'}"
|
||||
@touch="scheduleTouch"
|
||||
/>
|
||||
<data-table
|
||||
ref="tripTable1"
|
||||
:height="height/2 -15"
|
||||
:config="tripNumberConfig"
|
||||
:style="{top: top-height/2+'px'}"
|
||||
@touch="trainNumTouch"
|
||||
/>
|
||||
<div style="width: 100%;height: 30px;">
|
||||
<el-button style="float: right;" type="primary" size="mini" @click="quit">退出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import DataTable from '@/views/planSchedule/menusPlan/components/dataTable';
|
||||
import echarts from 'echarts';
|
||||
import {toTimeStamp, formatDuring} from '@/utils/date';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getByGroupStationList } from '@/api/jmap/map';
|
||||
import { loadRunPlanData } from '@/utils/loaddata';
|
||||
import { getSimulationInfoNew } from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'PlanSchedule',
|
||||
components: {
|
||||
DataTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
top: 0,
|
||||
height: 0,
|
||||
inter:null,
|
||||
runPlanId: 'run-plan-view',
|
||||
myChart: null,
|
||||
PlanConvert: {},
|
||||
dialogLoading: false,
|
||||
serviceNumberConfig: {
|
||||
data: [],
|
||||
highlightCurrentRow: true,
|
||||
handleChange: this.serviceNumberChange,
|
||||
showClose: false,
|
||||
columns: [
|
||||
{
|
||||
prop: 'serviceNumber',
|
||||
label: '表号'
|
||||
},
|
||||
{
|
||||
width: 40
|
||||
}
|
||||
]
|
||||
},
|
||||
tripNumberConfig: {
|
||||
data: [],
|
||||
highlightCurrentRow: true,
|
||||
handleChange: this.tripNumberChange,
|
||||
showClose: false,
|
||||
columns: [
|
||||
{
|
||||
prop: 'tripNumber',
|
||||
label: '车次号'
|
||||
},
|
||||
{
|
||||
width: 40
|
||||
}
|
||||
]
|
||||
},
|
||||
realData: {},
|
||||
kmRangeCoordMap: {},
|
||||
absoluteTime: 2 * 3600,
|
||||
indexKmRangeMap: {},
|
||||
seriesMap: {},
|
||||
staticSeries: [],
|
||||
runSeries: [],
|
||||
selectSeries: [],
|
||||
runPlanData: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('runPlan', [
|
||||
'stations'
|
||||
]),
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
maxWidth() {
|
||||
return this.$store.state.app.width > 1920 ? 1920 : this.$store.state.app.width;
|
||||
},
|
||||
maxHeight() {
|
||||
return this.$store.state.app.height > 1080 ? 1080 : this.$store.state.app.height;
|
||||
},
|
||||
title() {
|
||||
return this.$t('display.runPlan.previewRunDiagram');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
maxWidth() {
|
||||
this.setPosition();
|
||||
},
|
||||
maxHeight() {
|
||||
this.setPosition();
|
||||
},
|
||||
'$store.state.runPlan.planLoadedCount': async function () {
|
||||
try {
|
||||
await this.loadChartPage();
|
||||
this.selectSeries = []; this.runSeries = []; this.runPlanData = {};
|
||||
await this.loadInitData();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationReset': function (val) {
|
||||
this.selectSeries = []; this.runSeries = []; this.runPlanData = {};
|
||||
this.loadInitData();
|
||||
},
|
||||
'$store.state.runPlan.planSizeCount': function () {
|
||||
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
|
||||
},
|
||||
'$store.state.socket.trainStationList': function (val) {
|
||||
if (val.length) {
|
||||
this.updateRunPlanData(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.dialogLoading = true;
|
||||
getSimulationInfoNew(this.group).then(res => {
|
||||
this.$store.dispatch('runPlan/setRunPlanInfo', res.data.runPlan);
|
||||
getByGroupStationList(this.group).then(response => {
|
||||
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
|
||||
loadRunPlanData(this.group, this.dataError);
|
||||
this.staticSeries = []; this.selectSeries = []; this.runSeries = []; this.runPlanData = {};
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.lineCode);
|
||||
this.loadChartPage();
|
||||
EventBus.$on('clearRunSeries', () => {
|
||||
this.runSeries = [];
|
||||
});
|
||||
this.doShow();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('display.schema.getStationListFail'));
|
||||
});
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$store.dispatch('runPlan/setSelected', null);
|
||||
this.destroy();
|
||||
this.clearSubscribe();
|
||||
},
|
||||
methods: {
|
||||
async doShow() {
|
||||
try {
|
||||
await this.setPosition();
|
||||
await this.loadInitData();
|
||||
this.inter && clearInterval(this.inter);
|
||||
await this.subscribe();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
this.dialogLoading = false;
|
||||
}
|
||||
},
|
||||
async doClose() {
|
||||
this.inter && clearInterval(this.inter);
|
||||
},
|
||||
serviceNumberChange(row) {
|
||||
if (row) {
|
||||
this.$store.dispatch('runPlan/setSelected', { serviceNumber: row.serviceNumber, tripNumber: null });
|
||||
this.renderTripNumber({ serviceNumber: row.serviceNumber, tripNumber: null });
|
||||
const serviceObj = this.$store.state.runPlan.editData[row.serviceNumber];
|
||||
if (serviceObj) {
|
||||
this.analyticalTripNumber(serviceObj.trainMap);
|
||||
}
|
||||
}
|
||||
},
|
||||
tripNumberChange(row) {
|
||||
if (row) {
|
||||
this.$store.dispatch('runPlan/setSelected', { serviceNumber: this.$store.state.runPlan.selected.serviceNumber, tripNumber: row.tripNumber });
|
||||
this.renderTripNumber({ serviceNumber: this.$store.state.runPlan.selected.serviceNumber, tripNumber: row.tripNumber });
|
||||
}
|
||||
},
|
||||
async analyticalServiceNumber(data) {
|
||||
this.serviceNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return parseInt(data[a].serviceNumber) - parseInt(data[b].serviceNumber); })
|
||||
.map(serviceNumber => { return { serviceNumber }; });
|
||||
},
|
||||
async analyticalTripNumber(data) {
|
||||
this.tripNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return data[a].tripNumber - data[b].tripNumber; })
|
||||
.map(tripNumber => { return { tripNumber }; });
|
||||
},
|
||||
async setPosition() {
|
||||
this.$nextTick(() => {
|
||||
const top = 54;
|
||||
const width = this.maxWidth * 0.85;
|
||||
let height = this.maxHeight;
|
||||
|
||||
height = height - top;
|
||||
this.$store.dispatch('runPlan/resize', { width, height });
|
||||
|
||||
if (this.top != top) {
|
||||
this.top = top;
|
||||
}
|
||||
|
||||
if (this.height != height) {
|
||||
this.height = height - top;
|
||||
}
|
||||
});
|
||||
},
|
||||
updateRunPlanData(data) {
|
||||
const stations = this.$store.state.runPlan.stations;
|
||||
const initialPlanData = this.$store.state.runPlan.initialPlanData;
|
||||
data.forEach(item => {
|
||||
if (item && initialPlanData[item.serviceNumber]) {
|
||||
Object.keys(initialPlanData[item.serviceNumber].trainMap).forEach(ele => {
|
||||
if (initialPlanData[item.serviceNumber].trainMap[ele + ''].tripNumber == item.tripNumber) {
|
||||
item.directionCode = initialPlanData[item.serviceNumber].trainMap[ele + ''].directionCode;
|
||||
}
|
||||
});
|
||||
item.secondTime = item.second;
|
||||
}
|
||||
});
|
||||
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
|
||||
this.runSeries = this.PlanConvert.updateDataToModels(data, stations, this.kmRangeCoordMap,
|
||||
this.runPlanData, this.runSeries, { color: '#FF00DE', width: 2 }
|
||||
);
|
||||
const series = [...this.staticSeries, ...this.runSeries, ... this.selectSeries];
|
||||
this.myChart && this.myChart.setOption({series: series});
|
||||
},
|
||||
async loadChartPage() {
|
||||
try {
|
||||
this.seriesMap = {};
|
||||
this.staticSeries = [];
|
||||
const stations = this.$store.state.runPlan.stations;
|
||||
const planData = this.$store.state.runPlan.planData;
|
||||
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations);
|
||||
this.pushModels(this.staticSeries, [this.PlanConvert.initializeYaxis(stations)]);
|
||||
this.staticSeries = this.pushModels(this.staticSeries, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { color: '#000', width: 0.5 }));
|
||||
this.staticSeries.forEach(item => {
|
||||
this.seriesMap[item.name] = item;
|
||||
});
|
||||
await this.analyticalServiceNumber(this.$store.state.runPlan.editData);
|
||||
} catch (error) {
|
||||
this.$messageBox(`加载运行图数据失败`);
|
||||
}
|
||||
},
|
||||
|
||||
async loadInitData() {
|
||||
this.myChart && this.myChart.showLoading();
|
||||
const option = {
|
||||
tooltip: {
|
||||
axisPointer: {
|
||||
trigger: 'item',
|
||||
type: 'cross'
|
||||
},
|
||||
formatter: this.axisTooltip,
|
||||
borderWidth: 1
|
||||
},
|
||||
grid: {
|
||||
right: '40px',
|
||||
left: '120px',
|
||||
height: '85%'
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLine: {
|
||||
onZero: false,
|
||||
lineStyle: {
|
||||
width: 2,
|
||||
color: '#d14a61'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: this.xAxisLableFormat,
|
||||
textStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
axisPointer: {
|
||||
snap: true,
|
||||
label: {
|
||||
formatter: this.xAxisPointFormat,
|
||||
backgroundColor: 'rgb(255,0,0,0.5)',
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
yAxisIndex: 0,
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
onZero: false,
|
||||
lineStyle: {
|
||||
width: 2,
|
||||
color: '#d14a61'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 'auto',
|
||||
formatter: this.yAxisLableFormat
|
||||
},
|
||||
axisPointer: {
|
||||
xAxisIndex: 'all',
|
||||
label: {
|
||||
formatter: this.yAxisPointFormat,
|
||||
backgroundColor: 'rgb(0,100,0,0.5)',
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
dataZoom: [{
|
||||
type: 'inside'
|
||||
},
|
||||
{
|
||||
fiterMode: 'filter',
|
||||
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
|
||||
handleSize: '80%',
|
||||
handleStyle: {
|
||||
color: '#fff',
|
||||
shadowBlur: 3,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.6)',
|
||||
shadowOffsetX: 2,
|
||||
shadowOffsetY: 2
|
||||
},
|
||||
bottom: '20px'
|
||||
}],
|
||||
series: [
|
||||
|
||||
]
|
||||
};
|
||||
await this.xAxisInit(option);
|
||||
await this.yAxisInit(option);
|
||||
await this.loadInitChart(option);
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
},
|
||||
pushModels(series, models) {
|
||||
if (models && models.length) {
|
||||
models.forEach(elem => {
|
||||
if (elem) {
|
||||
series.push(elem);
|
||||
}
|
||||
});
|
||||
}
|
||||
return series;
|
||||
},
|
||||
loadInitChart(option) {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
this.destroy();
|
||||
let startValue = 3600 + this.PlanConvert.TranslationTime;
|
||||
const offsetTime = 3600;
|
||||
const initTime = toTimeStamp(formatDuring(parseInt(this.$route.query.initTime)));
|
||||
startValue = initTime - this.PlanConvert.TranslationTime;
|
||||
option.dataZoom[0].startValue = option.dataZoom[1].startValue = startValue - offsetTime;
|
||||
option.dataZoom[0].endValue = option.dataZoom[1].endValue = startValue + offsetTime;
|
||||
option.series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries];
|
||||
this.myChart = echarts.init(document.getElementById(this.runPlanId));
|
||||
if (this.myChart) {
|
||||
this.myChart.setOption(option);
|
||||
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
|
||||
this.myChart.on('click', this.mouseClick);
|
||||
}
|
||||
resolve(true);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
xAxisPointFormat(params) {
|
||||
return timeFormat(params.value);
|
||||
},
|
||||
yAxisPointFormat(params) {
|
||||
return this.PlanConvert.computedFormatYAxis(this.stations, params);
|
||||
},
|
||||
xAxisLableFormat(value, index) {
|
||||
return timeFormat(value);
|
||||
},
|
||||
yAxisLableFormat(value, index) {
|
||||
return '';
|
||||
},
|
||||
xAxisInit(option) {
|
||||
const list = [];
|
||||
for (var time = 0 + this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
|
||||
list.push(time);
|
||||
}
|
||||
const startValue = 3600 * 6;
|
||||
const offsetTime = 3600 * 1;
|
||||
|
||||
option.xAxis[0].data = list;
|
||||
if (!option.dataZoom[0].startValue) {
|
||||
option.dataZoom[0].startValue = option.dataZoom[1].startValue = startValue - offsetTime;
|
||||
}
|
||||
|
||||
if (!option.dataZoom[0].endValue) {
|
||||
option.dataZoom[0].endValue = option.dataZoom[1].endValue = startValue + offsetTime;
|
||||
}
|
||||
},
|
||||
yAxisInit(option) {
|
||||
if (Object.keys(this.PlanConvert).length) {
|
||||
option.yAxis[0].min = this.PlanConvert.computedYaxisMinValue(this.stations);
|
||||
option.yAxis[0].max = this.PlanConvert.computedYaxisMaxValue(this.stations);
|
||||
}
|
||||
},
|
||||
axisTooltip(param) {
|
||||
const station = (this.$store.getters['map/getDeviceByCode'](param.data[2])) || { name: '', kmRange: '' };
|
||||
return [
|
||||
`Point Data <hr size=1 style=" margin: 3px 0">`,
|
||||
`车站名称: ${station.name}<br>`,
|
||||
`车站公里标: ${station.kmRange} km <br>`,
|
||||
`到站时间: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
|
||||
].join('');
|
||||
},
|
||||
renderTripNumber(params) {
|
||||
const tripNumber = params.tripNumber; // 车次号
|
||||
const serviceNumber = params.serviceNumber; // 服务号
|
||||
let data, markPoint;
|
||||
if (tripNumber && this.seriesMap[serviceNumber]) {
|
||||
const temp = this.seriesMap[serviceNumber].data.filter(elem => elem[3] == tripNumber);
|
||||
if (temp.length) {
|
||||
data = temp;
|
||||
this.seriesMap[serviceNumber].markPoint.data.forEach(each=> {
|
||||
if (each.name == temp[0][4]) {
|
||||
markPoint = deepAssign({}, {data:[each]});
|
||||
markPoint.symbol = 'roundRect';
|
||||
markPoint.symbolSize = 1;
|
||||
markPoint.data[0].label.color = '#f00';
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (this.seriesMap[serviceNumber]) {
|
||||
markPoint = deepAssign({}, this.seriesMap[serviceNumber].markPoint);
|
||||
markPoint.data.forEach(each => {
|
||||
each.label.color = '#f00';
|
||||
});
|
||||
data = this.seriesMap[serviceNumber].data;
|
||||
}
|
||||
this.selectSeries = [{
|
||||
name: 'trainLabel',
|
||||
lineStyle: {
|
||||
color: '#f00',
|
||||
width: 2,
|
||||
type: 'solid'
|
||||
},
|
||||
z: 10,
|
||||
type: 'line',
|
||||
markPoint:markPoint,
|
||||
animation: false,
|
||||
data: data
|
||||
}];
|
||||
const series = [...this.staticSeries, ...this.runSeries, ...this.selectSeries];
|
||||
this.myChart && this.myChart.setOption({series: series});
|
||||
},
|
||||
mouseClick(params) {
|
||||
const model = {
|
||||
serviceNumber: params.seriesName
|
||||
};
|
||||
this.$store.dispatch('runPlan/setSelected', model);
|
||||
},
|
||||
reSize(opt) {
|
||||
if (this.myChart) {
|
||||
this.myChart.resize({
|
||||
width: opt.width,
|
||||
height: opt.height,
|
||||
silent: false
|
||||
});
|
||||
}
|
||||
},
|
||||
destroy() {
|
||||
if (this.myChart && this.myChart.isDisposed) {
|
||||
this.myChart.dispose();
|
||||
this.myChart = null;
|
||||
}
|
||||
},
|
||||
async subscribe() {
|
||||
this.clearSubscribe();
|
||||
const header = { group: this.group || '', 'X-Token': getToken() };
|
||||
creatSubscribe(`${displayTopic}\/${this.group}`, header);
|
||||
},
|
||||
clearSubscribe() {
|
||||
clearSubscribe(`${displayTopic}\/${this.group}`);
|
||||
},
|
||||
quit() {
|
||||
window.close();
|
||||
},
|
||||
scheduleTouch() {
|
||||
|
||||
},
|
||||
trainNumTouch() {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
#PlanSchedule {
|
||||
z-index: 5;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
|
||||
.left {
|
||||
height: 100%;
|
||||
width: 85%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.right {
|
||||
height: 100%;
|
||||
width: 15%;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ {
|
||||
.el-dialog {
|
||||
height: 100%;
|
||||
max-height: 1080px;
|
||||
}
|
||||
.el-dialog__body {
|
||||
padding: 0px !important;
|
||||
background-color: floralwhite !important;
|
||||
}
|
||||
.el-dialog__headerbtn .el-dialog__close {
|
||||
font-size: 18px;
|
||||
border: 1px solid #909399;
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -352,7 +352,7 @@ export default {
|
||||
let resp = {data: {}};
|
||||
resp = await this.getUserRole();
|
||||
if (resp && resp.code == 200) {
|
||||
this.setSimulationPrdType();
|
||||
this.setSimulationPrdType(resp.data.deviceCode);
|
||||
}
|
||||
loadMapDataById(this.mapId, 'simulation');
|
||||
} else {
|
||||
@ -362,6 +362,7 @@ export default {
|
||||
// 设置prdType和role
|
||||
setSimulationPrdType(deviceCode) {
|
||||
// Dispatcher 行调 STATION_SUPERVISOR 车站 Audience 观众 Driver 司机 MAINTAINER 通号
|
||||
this.showStation = '';
|
||||
switch (this.userRole) {
|
||||
case 'DISPATCHER':
|
||||
this.$store.dispatch('training/setPrdType', '02');
|
||||
@ -375,6 +376,7 @@ export default {
|
||||
this.$store.dispatch('training/setPrdType', '01');
|
||||
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
|
||||
this.$refs.menuSchema.chiShowStation = deviceCode;
|
||||
this.showStation = deviceCode;
|
||||
this.mapViewLoadedOver && this.switchStationMode(deviceCode);
|
||||
this.jl3dmaintainershow = false;
|
||||
this.drivingShow = false;
|
||||
@ -521,10 +523,11 @@ export default {
|
||||
}
|
||||
},
|
||||
switchStationMode(stationCode) {
|
||||
this.showStation = stationCode;
|
||||
this.showStation = this.centralizedStationMap[stationCode];
|
||||
this.setShowStation(this.showStation);
|
||||
},
|
||||
setShowStation(stationCode) {
|
||||
const showStation = this.centralizedStationMap[stationCode];
|
||||
const nameList = Object.keys(this.$store.state.map.map);
|
||||
let list = [];
|
||||
nameList.forEach(item => {
|
||||
@ -532,8 +535,8 @@ export default {
|
||||
list = [...list, ...this.$store.state.map.map[item]];
|
||||
}
|
||||
});
|
||||
this.$jlmap.updateShowStation(list, stationCode);
|
||||
this.$jlmap.setCenter(stationCode);
|
||||
this.$jlmap.updateShowStation(list, showStation);
|
||||
this.$jlmap.setCenter(showStation);
|
||||
},
|
||||
setStationList(map) {
|
||||
this.stationList = [];
|
||||
@ -546,7 +549,7 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
if (this.stationList.length) {
|
||||
if (this.stationList.length && !this.showStation) {
|
||||
this.showStation = this.stationList[0].value;
|
||||
}
|
||||
},
|
||||
|
@ -9,7 +9,7 @@
|
||||
<!-- 设备视图 -->
|
||||
<el-button v-if="isShow3dmodel && isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
|
||||
<!-- 三维视图 / 司机视角 -->
|
||||
<el-button v-if="isShowScheduling || isDriver" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
|
||||
<el-button v-if="isShowScheduling || isDriver || isDISPATCHER" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
|
||||
<!-- cctv视图 -->
|
||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
|
||||
<!-- 客流规划视图 -->
|
||||
@ -128,10 +128,13 @@ export default {
|
||||
},
|
||||
isShowScheduling() {
|
||||
// 行调与管理员 可显示
|
||||
return (this.$store.state.training.prdType == '02' || this.isAdmin) && !this.$route.query.projectDevice;
|
||||
return (this.$store.state.training.prdType == '02' || this.isAdmin) && (!this.$route.query.projectDevice);
|
||||
},
|
||||
isDISPATCHER(){
|
||||
return (this.$store.state.training.prdType == '02' || this.isAdmin) && (!this.$route.query.projectDevice || this.project == 'sdy');
|
||||
},
|
||||
isStationSupervisor() {
|
||||
return this.userRole == 'STATION_SUPERVISOR' && !this.$route.query.projectDevice;
|
||||
return this.userRole == 'STATION_SUPERVISOR' && (!this.$route.query.projectDevice || this.project == 'sdy');
|
||||
},
|
||||
isDriver() {
|
||||
return this.userRole == 'DRIVER' && !this.$route.query.projectDevice;
|
||||
|
@ -198,7 +198,21 @@ export default {
|
||||
this.$emit('runPlanLoadShow');
|
||||
},
|
||||
viewRunPlan() {
|
||||
this.$refs.runPlanView.doShow();
|
||||
if (this.$route.query.type === 'CW') {
|
||||
const routeData = this.$router.resolve({
|
||||
path:`/runPlanViewWindow`,
|
||||
query:{
|
||||
lineCode: this.$route.query.lineCode,
|
||||
mapId:this.$route.query.mapId,
|
||||
group:this.$route.query.group,
|
||||
initTime: this.$store.state.training.initTime,
|
||||
noPreLogout: true
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
} else {
|
||||
this.$refs.runPlanView.doShow();
|
||||
}
|
||||
},
|
||||
// 选择车站
|
||||
switchStationMode(stationCode) {
|
||||
|
@ -1,249 +0,0 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="card">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||
<operate-property
|
||||
ref="dataform"
|
||||
:form="form"
|
||||
:edit-model="editModel"
|
||||
:rules="rules"
|
||||
type="Line"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
<create-operate
|
||||
ref="createForm"
|
||||
:create-form="createForm"
|
||||
:add-model="addModel"
|
||||
:create-rules="rules"
|
||||
@create="create"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.batchOperation')" name="third" :lazy="lazy">
|
||||
<div class="view-content" style="text-align:center;">
|
||||
<el-button type="primary" size="big" style="margin-top:10px" @click="generateCross">{{ $t('map.generateCross') }}</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
<script>
|
||||
// import ConstConfig from '@/scripts/ConstConfig';
|
||||
// import Cookies from 'js-cookie';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmapNew/utils/Uid';
|
||||
import OperateProperty from './components/operateProperty';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
import CreateOperate from './components/createOperate';
|
||||
|
||||
export default {
|
||||
name:'CrossDraft',
|
||||
components: {
|
||||
OperateProperty,
|
||||
CreateOperate
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
lazy: true,
|
||||
field: '',
|
||||
crossList:[],
|
||||
editModel: {
|
||||
code: '',
|
||||
name: '',
|
||||
relateSwitchList: []
|
||||
},
|
||||
addModel:{
|
||||
name: '',
|
||||
relateSwitchList: []
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectCross'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseInputCrossName'), trigger: 'blur' }
|
||||
],
|
||||
relateSwitchList:[
|
||||
{ required: true, message: this.$t('rules.pleaseSelectSwitch'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'switchList',
|
||||
'crossList'
|
||||
]),
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: {
|
||||
draw: {
|
||||
name: this.$t('map.drawData'),
|
||||
item: [
|
||||
{ prop: 'code', label: this.$t('map.crossCoding'), type: 'select', optionLabel: 'code', optionValue: 'code',
|
||||
options: this.crossList, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.crossName'), type: 'input' },
|
||||
{ prop: 'relateSwitchList', label: this.$t('map.relateSwitchList'), type: 'multiSelect', optionLabel: 'name&&code',
|
||||
optionValue: 'code', options: this.switchList, disabled:true }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
return form;
|
||||
},
|
||||
createForm() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items:{
|
||||
all:{
|
||||
name:'',
|
||||
item: [
|
||||
{ prop: 'name', label: this.$t('map.crossName'), type: 'input' },
|
||||
{ prop: 'relateSwitchList', label:this.$t('map.relateSwitchList'), type: 'multiSelectHover',
|
||||
optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, hover: this.hover,
|
||||
buttonType: 'relatedSwitch', buttonShowType: this.relatedSwitchButtonShow, deviceChange: this.changeSwitch }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
return form;
|
||||
},
|
||||
relatedSwitchButtonShow() {
|
||||
return this.field === 'relatedSwitch';
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
hover(field) {
|
||||
this.field = field == this.field ? '' : field;
|
||||
if (this.field) {
|
||||
this.$emit('deviceSelect', 'Cross');
|
||||
} else {
|
||||
this.$emit('deviceSelect', '');
|
||||
}
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
create() {
|
||||
if (this.addModel.relateSwitchList.length != 4) {
|
||||
this.$message.error('关联的道岔只能是4个');
|
||||
return false;
|
||||
} else {
|
||||
const resultData = this.getCrossCenterPoint(this.addModel.relateSwitchList);
|
||||
if (resultData.length > 0) {
|
||||
this.updateMapDraw(resultData);
|
||||
this.$refs.createForm.resetForm();
|
||||
} else {
|
||||
this.$message.error('选择的关联道岔不对');
|
||||
}
|
||||
}
|
||||
},
|
||||
updateMapDraw(resultData) {
|
||||
resultData.forEach(each=>{
|
||||
const model = {
|
||||
_type: 'Cross',
|
||||
code: getUID('Cross', this.crossList),
|
||||
position:each.position,
|
||||
sectionList:each.sectionList
|
||||
};
|
||||
this.$emit('updateMapModel', model);
|
||||
});
|
||||
},
|
||||
generateCross() {
|
||||
if (this.switchList.length >= 4) {
|
||||
const resultData = this.getCrossCenterPoint(this.switchList);
|
||||
this.updateMapDraw(resultData);
|
||||
}
|
||||
},
|
||||
getCrossCenterPoint(switchList) {
|
||||
this.deleteCross();
|
||||
const swicthPList = {};
|
||||
switchList.forEach(data=>{
|
||||
if (data.code) { data = data.code; }
|
||||
const switchObj = this.$store.getters['map/getDeviceByCode'](data);
|
||||
const section = this.$store.getters['map/getDeviceByCode'](switchObj.sectionCCode);
|
||||
const endPoint = section.points[section.points.length - 1];
|
||||
const startPoint = section.points[0];
|
||||
const objStart = swicthPList[startPoint.x + '-' + startPoint.y];
|
||||
const objEnd = swicthPList[endPoint.x + '-' + endPoint.y];
|
||||
if (objStart) {
|
||||
objStart.count = objStart.count + 1;
|
||||
objStart.sectionList.push(section.code);
|
||||
} else {
|
||||
swicthPList[startPoint.x + '-' + startPoint.y] = {count:1, sectionList:[section.code]};
|
||||
}
|
||||
if (objEnd) {
|
||||
objEnd.count = objEnd.count + 1;
|
||||
objEnd.sectionList.push(section.code);
|
||||
} else {
|
||||
swicthPList[endPoint.x + '-' + endPoint.y] = {count:1, sectionList:[section.code]};
|
||||
}
|
||||
});
|
||||
const resultData = [];
|
||||
const values = Object.values(swicthPList);
|
||||
const keys = Object.keys(swicthPList);
|
||||
values.forEach((each, index)=>{
|
||||
if (each.count == 4) {
|
||||
resultData.push({position:keys[index], sectionList:swicthPList[keys[index]].sectionList});
|
||||
}
|
||||
});
|
||||
return resultData;
|
||||
},
|
||||
// 一键删除岔芯
|
||||
deleteCross() {
|
||||
const models = [];
|
||||
this.crossList.forEach(item => {
|
||||
models.push({...item, _dispose: true});
|
||||
});
|
||||
this.crossList.forEach(item => {
|
||||
if (item.type == '04') {
|
||||
models.push({...item, _dispose: true});
|
||||
}
|
||||
});
|
||||
this.$emit('updateMapModel', models);
|
||||
},
|
||||
changeSwitch(switchList) {
|
||||
const result = this.judgeRelateSwitch();
|
||||
if (!result) { this.addModel.relateSwitchList.pop(); }
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
if (selected && selected._type.toUpperCase() === 'Cross'.toUpperCase() && this.field != 'relatedSwitch') {
|
||||
this.$refs.createForm && this.$refs.createForm.resetFields();
|
||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
} else if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase() && this.field == 'relatedSwitch') {
|
||||
this.activeName = 'second';
|
||||
if (!this.addModel.relateSwitchList.includes(selected.code)) {
|
||||
this.judgeRelateSwitch() && this.addModel.relateSwitchList.push(selected.code);
|
||||
}
|
||||
}
|
||||
},
|
||||
judgeRelateSwitch() {
|
||||
if (this.addModel.relateSwitchList.length >= 4) {
|
||||
this.$message.error('关联的道岔不能超过4个');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.card {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
@ -67,7 +67,6 @@ import Arrow from './arrow';
|
||||
import SplitScreen from './splitScreen';
|
||||
import FloodGate from './floodGate';
|
||||
import DirectionRod from './directionRod';
|
||||
import Cross from './cross';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
@ -98,8 +97,7 @@ export default {
|
||||
Arrow,
|
||||
SplitScreen,
|
||||
FloodGate,
|
||||
DirectionRod,
|
||||
Cross
|
||||
DirectionRod
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -140,8 +138,7 @@ export default {
|
||||
{label: '站间分隔', name:'SplitStation', menus:SplitStation},
|
||||
{label: '箭头', name:'Arrow', menus:Arrow},
|
||||
{label: '防淹门', name: 'FloodGate', menus: FloodGate},
|
||||
{label: '方向杆', name: 'DirectionRod', menus: DirectionRod},
|
||||
{label: this.$t('map.cross'), name: 'Cross', menus: Cross}
|
||||
{label: '方向杆', name: 'DirectionRod', menus: DirectionRod}
|
||||
],
|
||||
selectDevice:'',
|
||||
enabledTab: 'Section',
|
||||
|
156
src/views/newMap/newMapdraft/mapoperate/section/crossSection.vue
Normal file
156
src/views/newMap/newMapdraft/mapoperate/section/crossSection.vue
Normal file
@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<create-operate
|
||||
ref="createForm"
|
||||
:create-form="createForm"
|
||||
:add-model="addModel"
|
||||
:create-rules="rules"
|
||||
@create="create"
|
||||
/>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmapNew/utils/Uid';
|
||||
import CreateOperate from '../components/createOperate';
|
||||
export default {
|
||||
name:'CrossDraft',
|
||||
components: {
|
||||
CreateOperate
|
||||
},
|
||||
props: {
|
||||
field: {
|
||||
type: String,
|
||||
default: function () {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addModel:{
|
||||
name: '',
|
||||
relateSectionList: []
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseInputCrossName'), trigger: 'blur' }
|
||||
],
|
||||
relateSectionList:[
|
||||
{ required: true, message: this.$t('rules.pleaseSelect'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'sectionList'
|
||||
]),
|
||||
activeSectionList() {
|
||||
return this.sectionList.filter(section=>{ return section.type === '01'; });
|
||||
},
|
||||
createForm() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items:{
|
||||
all:{
|
||||
name:'',
|
||||
item: [
|
||||
{ prop: 'name', label: this.$t('map.crossName'), type: 'input' },
|
||||
{ prop: 'relateSectionList', label:this.$t('map.relateSectionList'), type: 'multiSelectHover',
|
||||
optionLabel: 'name&&code', optionValue: 'code', options: this.activeSectionList, hover: this.hover,
|
||||
buttonType: 'relatedSection', buttonShowType: this.relatedSectionButtonShow, deviceChange: this.changeSection }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
return form;
|
||||
},
|
||||
relatedSectionButtonShow() {
|
||||
return this.field === 'relatedSection';
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
changeSection(switchList) {
|
||||
const result = this.judgeRelateSection();
|
||||
if (!result) { this.addModel.relateSectionList.pop(); }
|
||||
},
|
||||
hover(field) {
|
||||
this.$emit('hover', field);
|
||||
},
|
||||
judgeRelateSection() {
|
||||
if (this.addModel.relateSectionList.length > 2) {
|
||||
this.$message.error('关联的区段不能超过两个');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
addSectionData(selectedCode) {
|
||||
if (!this.addModel.relateSectionList.includes(selectedCode)) {
|
||||
this.addModel.relateSectionList.push(selectedCode);
|
||||
this.changeSection();
|
||||
}
|
||||
},
|
||||
create() {
|
||||
if (this.addModel.relateSectionList.length != 2) {
|
||||
this.$message.error('关联的区段只能为两个');
|
||||
return false;
|
||||
} else {
|
||||
const resultData = this.getCrossCenterPoint(this.addModel.relateSectionList);
|
||||
if (resultData) {
|
||||
const sectionA = this.$store.getters['map/getDeviceByCode'](this.addModel.relateSectionList[0]);
|
||||
this.updateMapDraw(sectionA.standCode);
|
||||
this.$refs.createForm.resetForm();
|
||||
} else {
|
||||
this.$message.error('选择的关联区段不对');
|
||||
}
|
||||
}
|
||||
},
|
||||
getCrossCenterPoint(relateSectionList) {
|
||||
const sectionA = this.$store.getters['map/getDeviceByCode'](relateSectionList[0]);
|
||||
const sectionB = this.$store.getters['map/getDeviceByCode'](relateSectionList[1]);
|
||||
const endPointA = sectionA.points[sectionA.points.length - 1];
|
||||
const startPointA = sectionA.points[0];
|
||||
const endPointB = sectionB.points[sectionB.points.length - 1];
|
||||
const startPointB = sectionB.points[0];
|
||||
return this.segmentsIntr(startPointA, endPointA, startPointB, endPointB);
|
||||
},
|
||||
|
||||
segmentsIntr(a, b, c, d) {
|
||||
// 三角形abc 面积的2倍
|
||||
var area_abc = (a.x - c.x) * (b.y - c.y) - (a.y - c.y) * (b.x - c.x);
|
||||
// 三角形abd 面积的2倍
|
||||
var area_abd = (a.x - d.x) * (b.y - d.y) - (a.y - d.y) * (b.x - d.x);
|
||||
// 面积符号相同则两点在线段同侧,不相交 (对点在线段上的情况,本例当作不相交处理);
|
||||
if ( area_abc * area_abd >= 0 ) {
|
||||
return false;
|
||||
}
|
||||
// 三角形cda 面积的2倍
|
||||
var area_cda = (c.x - a.x) * (d.y - a.y) - (c.y - a.y) * (d.x - a.x);
|
||||
// 三角形cdb 面积的2倍
|
||||
// 注意: 这里有一个小优化.不需要再用公式计算面积,而是通过已知的三个面积加减得出.
|
||||
var area_cdb = area_cda + area_abc - area_abd;
|
||||
if ( area_cda * area_cdb >= 0 ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
// // 计算交点坐标
|
||||
// var t = area_cda / ( area_abd - area_abc );
|
||||
// var dx = t * (b.x - a.x);
|
||||
// var dy = t * (b.y - a.y);
|
||||
// return { x: a.x + dx, y: a.y + dy };
|
||||
},
|
||||
|
||||
updateMapDraw(standCode) {
|
||||
const model = {
|
||||
_type: 'Section',
|
||||
code: getUID('T', this.sectionList),
|
||||
type:'05', // 岔心
|
||||
namePosition:{x:50, y:0},
|
||||
name:this.addModel.name,
|
||||
relateSectionList:this.addModel.relateSectionList,
|
||||
stationCode:standCode
|
||||
};
|
||||
this.$emit('updateMapModel', model);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -46,6 +46,9 @@
|
||||
@tipInfoHandle="tipInfoHandle"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.cross')" name="six" :lazy="lazy">
|
||||
<cross-section ref="crossSection" :field="field" @hover="hover" />
|
||||
</el-tab-pane>
|
||||
<tip-info ref="tipInfo" :tip-info-list="tipInfoList" />
|
||||
</el-tabs>
|
||||
</template>
|
||||
@ -60,6 +63,7 @@ import TipInfo from './tipInfo';
|
||||
import CreateSection from './create';
|
||||
import SplitOrMerge from './splitOrMerge';
|
||||
import BatchSettings from './batchSettings';
|
||||
import CrossSection from './crossSection';
|
||||
import getModel from '../models.js';
|
||||
|
||||
export default {
|
||||
@ -70,7 +74,8 @@ export default {
|
||||
TipInfo,
|
||||
CreateSection,
|
||||
SplitOrMerge,
|
||||
BatchSettings
|
||||
BatchSettings,
|
||||
CrossSection
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -408,7 +413,16 @@ export default {
|
||||
deviceSelect(selected) {
|
||||
// 判断是否激活选择站台
|
||||
if (selected && selected._type === 'Section') {
|
||||
if (this.field === 'leftSection') {
|
||||
if (this.field == 'relatedSection' ) {
|
||||
if (selected.type === '01') {
|
||||
this.activeName = 'six';
|
||||
this.$refs.crossSection.addSectionData(selected.code);
|
||||
this.$emit('deviceSelect', '');
|
||||
} else {
|
||||
this.$message.error('请选择物理区段');
|
||||
}
|
||||
return;
|
||||
} else if (this.field === 'leftSection') {
|
||||
if (selected.type === '01' || selected.type === '03') {
|
||||
this.editModel.leftSectionCode = selected.code;
|
||||
this.activeName = 'first';
|
||||
|
@ -257,7 +257,7 @@ export default {
|
||||
const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
|
||||
const studentIdJudge = !!studentId && !reg.test(studentId);
|
||||
if (studentIdJudge && name) {
|
||||
students.push({account:dataList[1][i], name: dataList[2][i]});
|
||||
students.push({account:dataList[0][i], name: dataList[1][i]});
|
||||
} else {
|
||||
if (!studentId && !name) {
|
||||
break;
|
||||
@ -301,9 +301,9 @@ export default {
|
||||
exportTemplate() {
|
||||
const wb = XLSX.utils.book_new();
|
||||
const data1 = [{ A: 'XXXX级', B:'XX班'}];
|
||||
const data2 = [{A: '学号', C:'姓名'}];
|
||||
const data3 = [{A: '00001', C:'张三'}];
|
||||
const data4 = [{A: '00002', C:'李四'}];
|
||||
const data2 = [{A: '学号', B:'姓名'}];
|
||||
const data3 = [{A: '00001', B:'张三'}];
|
||||
const data4 = [{A: '00002', B:'李四'}];
|
||||
const data = [...data1, ...data2, ...data3, ...data4];
|
||||
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
|
||||
ws['!cols'] = [
|
||||
|
@ -87,9 +87,9 @@ export default {
|
||||
}
|
||||
},
|
||||
handleCommit() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
this.$refs.form.validate(() => {
|
||||
if (this.$route.query.planId || this.loadRunPlanId) {
|
||||
checkServiceNumberExist({ planId: this.$route.query.planId || this.loadRunPlanId, serviceNumber: this.serviceNumber }).then(resp => {
|
||||
checkServiceNumberExist({ planId: this.$route.query.planId || this.loadRunPlanId, serviceNumber: this.formModel.serviceNumber }).then(resp => {
|
||||
if (resp.data) {
|
||||
this.$emit('dispatchDialog', {
|
||||
name: 'offLine',
|
||||
@ -117,8 +117,8 @@ export default {
|
||||
},
|
||||
handleConfirm(isNew = false) {
|
||||
this.doClose();
|
||||
this.$store.dispatch('runPlan/addserviceNumber', this.serviceNumber);
|
||||
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber: this.serviceNumber, isNew:isNew } });
|
||||
this.$store.dispatch('runPlan/addserviceNumber', this.formModel.serviceNumber);
|
||||
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber: this.formModel.serviceNumber, isNew:isNew } });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -23,10 +23,10 @@
|
||||
style="width: 100%;"
|
||||
value-format="timestamp"
|
||||
:default-value="new Date()"
|
||||
:disabled="isEdit"
|
||||
:picker-options="pickerOptions"
|
||||
@change="handle"
|
||||
/>
|
||||
<!-- :disabled="isEdit" -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col class="line" :span="2">-</el-col>
|
||||
@ -297,6 +297,8 @@ export default {
|
||||
const model = {
|
||||
id: this.$route.params.ruleId,
|
||||
name: this.form.name,
|
||||
endTime: this.getDate(this.form.endDate),
|
||||
startTime: this.getDate(this.form.startDate),
|
||||
classes: this.form.classes.map(ele => { return { id: ele}; }),
|
||||
trial: this.trial == 2
|
||||
};
|
||||
@ -304,6 +306,7 @@ export default {
|
||||
await updateExamRules(model);
|
||||
this.$store.dispatch('exam/setCourseDetail', this.form);
|
||||
this.$message.success(this.$t('publish.updateExamRuleSuccess'));
|
||||
// history.go(-1);
|
||||
} catch (error) {
|
||||
this.$messageBox(this.$t('publish.updateExamRuleFailed'));
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import RuleFrom from './rule';
|
||||
import ExamFrom from './examFrom';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam';
|
||||
import { getExamLessonDetail, setCourseList } from '@/api/management/exam';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
@ -71,9 +71,6 @@ export default {
|
||||
},
|
||||
isFastCreate() {
|
||||
return this.display == 1 && this.$route.params.mode != 'edit' && Number(this.$route.params.ruleId);
|
||||
},
|
||||
isGzbShow() {
|
||||
return getSessionStorage('project').startsWith('gzb');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -103,6 +100,7 @@ export default {
|
||||
});
|
||||
},
|
||||
async definition(data) {
|
||||
console.log(data, '====');
|
||||
this.course = data;
|
||||
this.formData = {};
|
||||
this.display = 2;
|
||||
@ -140,11 +138,7 @@ export default {
|
||||
};
|
||||
let res = {};
|
||||
try {
|
||||
if (this.isGzbShow) {
|
||||
res = await setCourseListGzb(result);
|
||||
} else {
|
||||
res = await setCourseList(result);
|
||||
}
|
||||
res = await setCourseList(result);
|
||||
this.$message.success({ message: res.message });
|
||||
this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据
|
||||
const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`;
|
||||
|
@ -25,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam';
|
||||
import { getExamLessonDetail, setCourseList } from '@/api/management/exam';
|
||||
import { UrlConfig, getTrainingOperateTypeMap } from '@/scripts/ConstDic';
|
||||
import editRule from './editRule';
|
||||
import LangStorage from '@/utils/lang';
|
||||
@ -72,9 +72,6 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isGzbShow() {
|
||||
return getSessionStorage('project').startsWith('gzb');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
@ -135,7 +132,6 @@ export default {
|
||||
examDefinitionRulesVOList: this.ruleList, // 规则
|
||||
fullPoint: Number(this.course.fullMark), // 满分
|
||||
lessonId: this.course.region, // 课程id
|
||||
classes: this.isGzbShow ? this.course.classes.map(ele => { return {id: ele}; }) : [],
|
||||
name: this.course.name, // 名称
|
||||
passingPoint: Number(this.course.passMark), // 及格分
|
||||
remarks: this.course.desc, // 考试说明
|
||||
@ -144,6 +140,7 @@ export default {
|
||||
type: this.course.type, // 类型
|
||||
trial: this.course.trial == 2 // 权限判断
|
||||
};
|
||||
if (this.course.classes) { result['classes'] = this.course.classes.map(ele => { return {id: ele}; }); }
|
||||
await this.save(result);
|
||||
} else {
|
||||
this.$messageBox(this.$t('publish.addExamRluesError'));
|
||||
@ -154,12 +151,7 @@ export default {
|
||||
},
|
||||
async save(data) {
|
||||
try {
|
||||
let res = {};
|
||||
if (this.isGzbShow) {
|
||||
res = await setCourseListGzb(data);
|
||||
} else {
|
||||
res = await setCourseList(data);
|
||||
}
|
||||
const res = await setCourseList(data);
|
||||
this.$message.success({ message: res.message });
|
||||
this.$store.dispatch('exam/setCourseDetail', this.formDetail); // 清空 form 表单数据
|
||||
this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据
|
||||
|
@ -12,6 +12,12 @@
|
||||
import { addCompany, updateCompany } from '@/api/company';
|
||||
export default {
|
||||
name: 'Add',
|
||||
props: {
|
||||
projectListNew:{
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@ -19,7 +25,8 @@ export default {
|
||||
address: '',
|
||||
name: '',
|
||||
phone: '',
|
||||
id: ''
|
||||
id: '',
|
||||
projectCode: ''
|
||||
},
|
||||
update: false
|
||||
};
|
||||
@ -31,7 +38,8 @@ export default {
|
||||
items: [
|
||||
{ prop: 'name', label: '名称', type: 'text' },
|
||||
{ prop: 'phone', label: '电话', type: 'text' },
|
||||
{ prop: 'address', label: '地址', type: 'text' }
|
||||
{ prop: 'address', label: '地址', type: 'text' },
|
||||
{ prop: 'projectCode', label: '关联项目', type: 'select', options: this.projectListNew}
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -47,12 +55,15 @@ export default {
|
||||
],
|
||||
address:[
|
||||
{ required: true, message: '请输入公司地址', trigger: 'blur'}
|
||||
],
|
||||
projectCode: [
|
||||
{ required: true, message: '请选择关联项目', trigger: 'change'}
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return this.update ? '添加单位' : '修改单位';
|
||||
return this.update ? '修改单位' : '添加单位';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -65,19 +76,22 @@ export default {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
phone: data.phone,
|
||||
address: data.address
|
||||
};
|
||||
} else {
|
||||
this.formModel = {
|
||||
address: '',
|
||||
name: '',
|
||||
phone: '',
|
||||
id: ''
|
||||
address: data.address,
|
||||
projectCode: data.projectCode
|
||||
};
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.update = false;
|
||||
this.formModel = {
|
||||
address: '',
|
||||
name: '',
|
||||
phone: '',
|
||||
id: '',
|
||||
projectCode: ''
|
||||
};
|
||||
this.$refs.dataform.resetFields();
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<edit-company ref="editCompany" @reloadTable="reloadTable" />
|
||||
<edit-company ref="editCompany" :project-list-new="projectListNew" @reloadTable="reloadTable" />
|
||||
<qr-code ref="qrCode" />
|
||||
</div>
|
||||
</template>
|
||||
@ -10,6 +10,7 @@
|
||||
import { getCompanyListPaging, deleteCompany } from '@/api/company';
|
||||
import EditCompany from './add';
|
||||
import QrCode from '@/components/QrCode';
|
||||
import { ProjectList } from '@/scripts/ProjectConfig';
|
||||
export default {
|
||||
name: 'CompanyManage',
|
||||
components: {
|
||||
@ -28,6 +29,8 @@ export default {
|
||||
queryObject: {
|
||||
}
|
||||
},
|
||||
projectMap: {},
|
||||
projectListNew: [],
|
||||
queryList: {
|
||||
query: getCompanyListPaging,
|
||||
selectCheckShow: false,
|
||||
@ -45,6 +48,13 @@ export default {
|
||||
title: '单位地址',
|
||||
prop: 'address'
|
||||
},
|
||||
{
|
||||
title: '关联项目',
|
||||
prop: 'projectCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.projectMap[row.projectCode]; },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '单位管理人员',
|
||||
prop: 'managerNames',
|
||||
@ -81,6 +91,12 @@ export default {
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
ProjectList.forEach(elem => {
|
||||
this.projectMap[elem.value.toUpperCase()] = elem.label;
|
||||
this.projectListNew.push({value: elem.value.toUpperCase(), label: elem.label});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
handlerAddCompany() {
|
||||
this.$refs.editCompany.doShow();
|
||||
@ -103,8 +119,12 @@ export default {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
handleGenerateQrCode(index, row) {
|
||||
let state = 2;
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
state = 3;
|
||||
}
|
||||
const param = {
|
||||
url: `companyName=${row.name}&&companyId=${row.id}`,
|
||||
url: `https://joylink.club/oss/joylink/company?state=${state}_${row.id}`,
|
||||
title: '单位二维码'
|
||||
};
|
||||
this.$refs.qrCode.doShow(param);
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
deviceTypeList:ConstConfig.ConstSelect.projectDeviceTypeList,
|
||||
projectList: [{label:'西铁院', value: 'XTY'}, {label: '贵州装备', value:'GZB'}, {label: '哈尔滨', value:'HEB'}],
|
||||
projectList: [{label:'西铁院', value: 'XTY'}, {label: '贵州装备', value:'GZB'}, {label: '哈尔滨', value:'HEB'}, {label: '苏电院', value:'SDY'}],
|
||||
projectMap: {
|
||||
designxty: 'XTY',
|
||||
designgzb: 'GZB',
|
||||
|
81
src/views/system/userControl/bindCompany.vue
Normal file
81
src/views/system/userControl/bindCompany.vue
Normal file
@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="绑定单位" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { bindCompany } from '@/api/management/user';
|
||||
|
||||
export default {
|
||||
name:'BindCompany',
|
||||
props: {
|
||||
companyList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
name: '',
|
||||
userId: '',
|
||||
companyId:''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: '名称', type: 'text', disabled:true, rightWidth:true },
|
||||
{ prop: 'companyId', label: '单位', type: 'select', options: this.companyList}
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
companyId: [
|
||||
{ required: true, message: '请选择单位', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
this.dialogVisible = true;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.userId = row.id;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
this.formModel = {
|
||||
name: '',
|
||||
userId: '',
|
||||
companyId:''
|
||||
};
|
||||
},
|
||||
doCreate() {
|
||||
let formModel = Object.assign({}, this.formModel);
|
||||
delete formModel.name;
|
||||
formModel = 'userId=' + formModel.userId + '&&companyId=' + formModel.companyId;
|
||||
bindCompany(formModel).then(res=>{
|
||||
this.doClose();
|
||||
this.$emit('create');
|
||||
}).catch((error) => {
|
||||
this.$message.error('绑定单位失败: ' + error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
@ -46,10 +46,10 @@ export default {
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
|
||||
],
|
||||
// name: [
|
||||
// { required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
|
||||
// { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
|
||||
// ],
|
||||
roles: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectPermission'), trigger: 'change' }
|
||||
]
|
||||
|
@ -3,6 +3,7 @@
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<dictionary-edit ref="edit" :company-list="companyList" @reloadTable="reloadTable" />
|
||||
<create-user ref="createUser" />
|
||||
<bind-company ref="bindCompany" :company-list="companyList" @create="create" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -11,12 +12,14 @@ import { getUserList } from '@/api/management/user';
|
||||
import { getCompanyList } from '@/api/company';
|
||||
import DictionaryEdit from './edit';
|
||||
import CreateUser from './createUser';
|
||||
import BindCompany from './bindCompany';
|
||||
|
||||
export default {
|
||||
name: 'UserControl',
|
||||
components: {
|
||||
DictionaryEdit,
|
||||
CreateUser
|
||||
CreateUser,
|
||||
BindCompany
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -87,6 +90,10 @@ export default {
|
||||
{
|
||||
name: this.$t('global.edit'),
|
||||
handleClick: this.handleUserEdit
|
||||
},
|
||||
{
|
||||
name: '绑定单位',
|
||||
handleClick: this.handleBind
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -129,6 +136,12 @@ export default {
|
||||
},
|
||||
companyManage() {
|
||||
this.$router.push({ path: `/system/companyManage`});
|
||||
},
|
||||
handleBind(index, row) {
|
||||
this.$refs.bindCompany.doShow(row);
|
||||
},
|
||||
create() {
|
||||
this.reloadTable();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div slot="header" class="lessonHeader">
|
||||
{{ $t('global.lessonSystem') }}
|
||||
</div>
|
||||
<el-button size="mini" type="primary" style="position: absolute;right: 10px;top: 10px;" @click="draftLessonManage">草稿课程管理</el-button>
|
||||
<el-button v-if="isCompanyAdmin || isAdmin" size="mini" type="primary" style="position: absolute;right: 10px;top: 10px;" @click="draftLessonManage">草稿课程管理</el-button>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<el-table :data="tableData" border style="width: 100%">
|
||||
@ -18,9 +18,9 @@
|
||||
<el-table-column :label="this.$t('global.operate')">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" @click="goLesson(scope.row)">{{ $t('teach.enterTheCourse') }}</el-button>
|
||||
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="primary" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="warning" @click="handleSoldOut(scope.row)">下架</el-button>
|
||||
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="danger" @click="handleDelete(scope.row)">删除课程</el-button>
|
||||
<el-button v-if="((isCompanyAdmin && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="primary" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button v-if="((isCompanyAdmin && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="warning" @click="handleSoldOut(scope.row)">下架</el-button>
|
||||
<el-button v-if="((isCompanyAdmin && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="danger" @click="handleDelete(scope.row)">删除课程</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -50,7 +50,8 @@ export default {
|
||||
loading: false,
|
||||
project: '',
|
||||
mapId: '',
|
||||
prdType: ''
|
||||
prdType: '',
|
||||
cityCode: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -60,8 +61,8 @@ export default {
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
},
|
||||
isLessonCreator() {
|
||||
return this.$store.state.user.roles.includes(lessonCreater);
|
||||
isCompanyAdmin() {
|
||||
return this.$store.state.user.companyId && this.$store.state.user.companyAdmin;
|
||||
},
|
||||
isAdmin() {
|
||||
return this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(superAdmin);
|
||||
@ -84,6 +85,7 @@ export default {
|
||||
this.mapId = resp.data.mapId;
|
||||
this.prdType = resp.data.prdType;
|
||||
this.tableData = resp.data.lessonList;
|
||||
this.cityCode = resp.data.cityCode;
|
||||
} else {
|
||||
this.tableData = [];
|
||||
}
|
||||
@ -129,7 +131,7 @@ export default {
|
||||
});
|
||||
},
|
||||
draftLessonManage() {
|
||||
const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.$route.query.cityCode};
|
||||
const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.cityCode};
|
||||
this.$router.push({ path: `/trainingPlatform/draftTeach/${this.$route.params.subSystem}`, query: query });
|
||||
},
|
||||
handleDelete(row) {
|
||||
|
@ -113,7 +113,7 @@ export default {
|
||||
break;
|
||||
case 'Lesson':
|
||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
|
||||
router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}?cityCode=${this.filterSelect}`};
|
||||
router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`};
|
||||
this.toNextPage(isReplace, router);
|
||||
break;
|
||||
case 'Simulation':
|
||||
@ -206,7 +206,7 @@ export default {
|
||||
},
|
||||
nodeCollapse(obj, node, ele) {
|
||||
const key = obj.key;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
this.expandList = this.expandList.filter(item => (item !== key && !item.startsWith(`${key}-`)));
|
||||
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
|
||||
},
|
||||
getExpandList(filterSelect) {
|
||||
|
Loading…
Reference in New Issue
Block a user