Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
# Conflicts: # src/utils/baseUrl.js
This commit is contained in:
commit
eb9c9d8ee3
@ -183,6 +183,7 @@
|
||||
:placeholder="item.placeholder"
|
||||
:disabled="item.disabled"
|
||||
multiple
|
||||
@change="((val)=>{deviceChange(val, item)})"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in item.options"
|
||||
|
@ -159,7 +159,7 @@ export default {
|
||||
const deviceList = [];
|
||||
|
||||
// 信号机
|
||||
let nameShow = this.nameLevels.indexOf(1) !== -1;
|
||||
let nameShow = this.nameLevels.includes(1);
|
||||
const signalList = this.$store.getters['map/signalList'];
|
||||
if (signalList && signalList.length > 0) {
|
||||
signalList.forEach(elem => {
|
||||
@ -168,11 +168,11 @@ export default {
|
||||
}
|
||||
|
||||
// 按钮名称
|
||||
nameShow = this.nameLevels.indexOf(3) !== -1;
|
||||
nameShow = this.nameLevels.includes(3);
|
||||
|
||||
// 道岔
|
||||
nameShow = this.nameLevels.indexOf(7) !== -1; // 道岔名称
|
||||
const switchSectionNameShow = this.nameLevels.indexOf(9) !== -1; // 道岔轨名称
|
||||
nameShow = this.nameLevels.includes(7); // 道岔名称
|
||||
const switchSectionNameShow = this.nameLevels.includes(9); // 道岔轨名称
|
||||
const switchList = this.$store.getters['map/switchList'];
|
||||
if (switchList && switchList.length > 0) {
|
||||
switchList.forEach(elem => {
|
||||
@ -181,7 +181,7 @@ export default {
|
||||
}
|
||||
|
||||
// 控制模式
|
||||
const indicatorShow = this.nameLevels.indexOf(8) !== -1;
|
||||
const indicatorShow = this.nameLevels.includes(8);
|
||||
const control = this.$store.getters['map/stationControlList'];
|
||||
if (control && control.length > 0) {
|
||||
control.forEach(elem => {
|
||||
@ -204,28 +204,28 @@ export default {
|
||||
nameShow = false;
|
||||
} else if (elem.type === '01') {
|
||||
// 计轴区段名称
|
||||
nameShow = this.nameLevels.indexOf(11) !== -1;
|
||||
nameShow = this.nameLevels.includes(11);
|
||||
} else if (elem.type === '02') {
|
||||
// 轨道轨名称
|
||||
nameShow = this.nameLevels.indexOf(5) !== -1;
|
||||
nameShow = this.nameLevels.includes(5);
|
||||
} else if (elem.type === '04') {
|
||||
// 道岔区段名称
|
||||
nameShow = this.nameLevels.indexOf(9) !== -1;
|
||||
nameShow = this.nameLevels.includes(9);
|
||||
}
|
||||
|
||||
// 站台轨名称
|
||||
if (elem.standTrack) {
|
||||
standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
|
||||
standTrackNameShow = this.nameLevels.includes(2);
|
||||
}
|
||||
|
||||
// 折返轨名称
|
||||
if (elem.reentryTrack) {
|
||||
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1;
|
||||
reentryTrackNameShow = this.nameLevels.includes(4);
|
||||
}
|
||||
|
||||
// 转换轨名称
|
||||
if (elem.transferTrack) {
|
||||
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
|
||||
transferTrackNameShow = this.nameLevels.includes(6);
|
||||
}
|
||||
|
||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||
@ -233,7 +233,7 @@ export default {
|
||||
}
|
||||
|
||||
// 停车点
|
||||
const destCodeShow = this.nameLevels.indexOf(10) !== -1;
|
||||
const destCodeShow = this.nameLevels.includes(10);
|
||||
const stopPointList = this.$store.getters['map/stopPointList'];
|
||||
if (stopPointList && stopPointList.length > 0) {
|
||||
stopPointList.forEach(elem => {
|
||||
@ -242,7 +242,7 @@ export default {
|
||||
}
|
||||
|
||||
// 车站
|
||||
const kmPostShow = this.nameLevels.indexOf(12) !== -1;
|
||||
const kmPostShow = this.nameLevels.includes(12);
|
||||
const stationList = this.$store.getters['map/stationList'];
|
||||
if (stationList && stationList.length > 0) {
|
||||
stationList.forEach(elem => {
|
||||
|
@ -13,22 +13,23 @@
|
||||
</div>
|
||||
<div class="el-dialog__body">
|
||||
<el-row>
|
||||
<el-form ref="form" :model="formModel" :rules="rules">
|
||||
<el-form ref="form" :model="formModel" :rules="rules" label-width="80px">
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="groupNumber1" label="主动车:">
|
||||
<el-select v-model="formModel.groupNumber1" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-form-item prop="groupNumber" label="主动车:">
|
||||
<el-input v-model="formModel.groupNumber" size="small" style="width: 165px;height: 32px;line-height: 32px;" disabled />
|
||||
<!-- <el-select v-model="formModel.groupNumber" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in selectedList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
</el-select> -->
|
||||
<!-- <el-button
|
||||
:type="field == 'selectedCode1' ? 'danger' : 'primary'"
|
||||
size="small"
|
||||
@click="hover('selectedCode1')"
|
||||
>激活</el-button>
|
||||
>激活</el-button> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -87,14 +88,14 @@ export default {
|
||||
loading: false,
|
||||
operation: '',
|
||||
formModel: {
|
||||
groupNumber1: '',
|
||||
groupNumber: '',
|
||||
groupNumber2: ''
|
||||
},
|
||||
groupNumber: '',
|
||||
field: '',
|
||||
rules: {
|
||||
faultType: [
|
||||
{ required: true, message: '请选择故障类型', trigger: 'change'}
|
||||
groupNumber2: [
|
||||
{ required: true, message: '请选择被动车', trigger: 'change'}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -154,6 +155,7 @@ export default {
|
||||
this.cmdType = operate.cmdType;
|
||||
}
|
||||
if (selected._type) {
|
||||
this.formModel.groupNumber = selected.groupNumber;
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
@ -181,7 +183,7 @@ export default {
|
||||
operation: menuOperate.Common.setLink.operation,
|
||||
cmdType: menuOperate.Common.setLink.cmdType,
|
||||
param: {
|
||||
groupNumber1: this.formModel.groupNumber1,
|
||||
groupNumber: this.formModel.groupNumber,
|
||||
groupNumber2: this.formModel.groupNumber2
|
||||
}
|
||||
};
|
||||
@ -196,12 +198,12 @@ export default {
|
||||
this.doClose();
|
||||
} else {
|
||||
this.doClose();
|
||||
this.$messageBox('设置或取消故障操作失败!');
|
||||
this.$messageBox('设置连挂失败!');
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$messageBox(error.message || '设置或取消故障操作失败!');
|
||||
this.$messageBox(error.message || '设置连挂失败!');
|
||||
});
|
||||
},
|
||||
|
||||
@ -219,10 +221,11 @@ export default {
|
||||
});
|
||||
},
|
||||
deviceSelect(em) {
|
||||
if (this.field == 'selectedCode1' && em._type == 'Train') {
|
||||
this.formModel.groupNumber1 = em.code;
|
||||
this.field = '';
|
||||
} else if (this.field == 'selectedCode2' && em._type == 'Train') {
|
||||
// if (this.field == 'selectedCode1' && em._type == 'Train') {
|
||||
// this.formModel.groupNumber1 = em.code;
|
||||
// this.field = '';
|
||||
// } else
|
||||
if (this.field == 'selectedCode2' && em._type == 'Train') {
|
||||
this.formModel.groupNumber2 = em.code;
|
||||
this.field = '';
|
||||
}
|
||||
|
@ -21,8 +21,8 @@
|
||||
<el-table-column prop="settable" label="状态" style="margin-left:30px;" width="100px">
|
||||
<!--<template slot-scope="scope">-->
|
||||
<!--<span>{{ scope.row.settable == 1? '允许选排':'不能选排' }}</span>-->
|
||||
<span>允许选排</span>
|
||||
<!--</template>-->
|
||||
<span>允许选排</span>
|
||||
</el-table-column>
|
||||
<el-table-column style="margin-left:30px;" />
|
||||
</el-table>
|
||||
|
@ -408,6 +408,7 @@ export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'd
|
||||
export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目
|
||||
export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式
|
||||
export const NoQrcodeList = ['heb', 'designheb'];
|
||||
export const NoSimulationQrCodeList = ['heb', 'bjd'];
|
||||
export const goOtherPlatformMenu = { // 导航栏快速切换平台
|
||||
login: '/design/login',
|
||||
design: '/login',
|
||||
|
@ -662,7 +662,7 @@ export default {
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
columns && columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总分值';
|
||||
return;
|
||||
@ -674,8 +674,10 @@ export default {
|
||||
values.push(item.id);
|
||||
}
|
||||
});
|
||||
console.log(this.commandEvaluationRuleVOs);
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(this.commandEvaluationRuleVOs[curr].score);
|
||||
let value = 0;
|
||||
if (this.commandEvaluationRuleVOs[curr]) { value = Number(this.commandEvaluationRuleVOs[curr].score || 0); }
|
||||
if (!isNaN(value)) {
|
||||
return prev + value;
|
||||
} else {
|
||||
|
@ -673,7 +673,7 @@ export default {
|
||||
// this.$message.success('创建会话成功!');
|
||||
this.createLoading = false;
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建仿真失败!');
|
||||
this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建会话失败:' + error.message);
|
||||
this.createLoading = false;
|
||||
});
|
||||
} else {
|
||||
@ -691,6 +691,7 @@ export default {
|
||||
},
|
||||
// 语音录制开始
|
||||
startRecording() {
|
||||
this.audioPlay = true;
|
||||
const that = this;
|
||||
if (!this.recordSending) {
|
||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||
@ -709,11 +710,13 @@ export default {
|
||||
});
|
||||
that.recorders.startRecording();
|
||||
that.recordSending = true;
|
||||
that.audioPlay = false;
|
||||
that.inter = setInterval(() => {
|
||||
if (that.seconds < 60) {
|
||||
that.seconds++;
|
||||
} else {
|
||||
clearInterval(that.inter);
|
||||
that.stopRecording();
|
||||
}
|
||||
}, 1000);
|
||||
}, function (error) {
|
||||
@ -769,6 +772,7 @@ export default {
|
||||
},
|
||||
// 停止录制 发送语音
|
||||
stopRecording() {
|
||||
this.audioPlay = true;
|
||||
const that = this;
|
||||
this.recorders.stopRecording(function(blobURL) {
|
||||
clearInterval(that.inter);
|
||||
@ -779,10 +783,12 @@ export default {
|
||||
sendSimulationConversition(that.group, that.conversitionId, fd)
|
||||
.then((data) => {
|
||||
that.textContent = '';
|
||||
that.audioPlay = false;
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
that.$message.error('语音发送失败: ' + error.message);
|
||||
that.audioPlay = false;
|
||||
});
|
||||
if (that.microphone) {
|
||||
that.microphone.stop();
|
||||
|
@ -222,10 +222,10 @@ export const operateEnum = {
|
||||
Train_Link: {
|
||||
isList:true,
|
||||
params:[
|
||||
{
|
||||
code:'groupNumber1',
|
||||
name:'主动车'
|
||||
},
|
||||
// {
|
||||
// code:'groupNumber1',
|
||||
// name:'主动车'
|
||||
// },
|
||||
{
|
||||
code:'groupNumber2',
|
||||
name:'被动车'
|
||||
|
@ -7,22 +7,21 @@
|
||||
<div class="btn_hover" @click="menuClick">菜单</div>
|
||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
||||
<!-- 设备视图 -->
|
||||
<el-button v-if="isShow3dmodel && isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
|
||||
<el-button v-if="(isShow3dmodel && isShowScheduling)&&project !== 'bjd'" 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)&&project !== 'bjd'" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
|
||||
<!-- cctv视图 -->
|
||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
|
||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dfaultdevice">{{ $t('display.demon.maintainer') }}</el-button>
|
||||
<el-button v-if="(isShowScheduling || isStationSupervisor)&&project !== 'bjd'" size="small" @click="jumpjl3dfaultdevice">{{ $t('display.demon.maintainer') }}</el-button>
|
||||
<!-- <el-button v-if="isAdmin" size="small" @click="otherVrView">VR第三人称视角</el-button> -->
|
||||
<el-button v-if="isAdmin && !noQrcodeList.includes(project) && $route.query.type !== 'ILW'" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
|
||||
<el-button v-if="isAdmin && $route.query.type !== 'ILW'" size="small" @click="memberManage">成员管理</el-button>
|
||||
<el-button v-if="(isAdmin && isProject) || $route.query.type === 'ILW'" size="small" @click="handleEquipment">设备管理</el-button>
|
||||
<el-button v-if="isDeviceLogin" size="small" @click="handleTeach">教学系统</el-button>
|
||||
<el-button v-if="isDeviceLogin || $route.query.type === 'IM'" size="small" @click="handleExam">考试系统</el-button>
|
||||
<el-button v-if="qrCodeShow" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
|
||||
<el-button v-if="memberManageShow" size="small" @click="memberManage">成员管理</el-button>
|
||||
<el-button v-if="deviceManageShow" size="small" @click="handleEquipment">设备管理</el-button>
|
||||
<el-button v-if="teachSystemShow" size="small" @click="handleTeach">教学系统</el-button>
|
||||
<el-button v-if="examSystemShow" size="small" @click="handleExam">考试系统</el-button>
|
||||
<template v-if="project === 'bjd'">
|
||||
<el-button v-if="running && !dataError" size="small" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
||||
<el-button v-if="!running && !dataError" size="small" type="warning" @click="loadRunPlan">{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- 运行图加载 -->
|
||||
<el-button v-if="isAdmin && !dataError" size="small" :type="faultMode ? '' : 'primary' " @click="changeOperateMode()">{{ faultMode?' 切换到普通模式':'切换到故障模式' }}</el-button>
|
||||
<el-button v-if="running" size="small" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
||||
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- 运行图加载 -->
|
||||
</template>
|
||||
</el-button-group>
|
||||
</div>
|
||||
@ -60,10 +59,9 @@ import { exitFullscreen } from '@/utils/screen';
|
||||
import { getSimulationQrcode } from '@/api/jointSimulation';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
|
||||
import { NoQrcodeList } from '@/scripts/ProjectConfig';
|
||||
import { NoSimulationQrCodeList } from '@/scripts/ProjectConfig';
|
||||
import { getPublishLessonListByMapId } from '@/api/jmap/lesson';
|
||||
import localStore from 'storejs';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'MenuDemonJoint',
|
||||
@ -119,12 +117,11 @@ export default {
|
||||
chatShow: true,
|
||||
jsStart: true,
|
||||
isGoback: false,
|
||||
noQrcodeList: NoQrcodeList,
|
||||
noSimulationQrCodeList: NoSimulationQrCodeList,
|
||||
isShow3dmodel :false,
|
||||
jl3dname: this.$t('display.demon.threeDimensionalView'),
|
||||
hoverBtn: false,
|
||||
btnWidth: 0,
|
||||
faultMode: false
|
||||
btnWidth: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -155,7 +152,7 @@ export default {
|
||||
if ((this.isShow3dmodel && this.isShowScheduling) ||
|
||||
(this.isShowScheduling || this.isDriver) ||
|
||||
(this.isShowScheduling || this.isStationSupervisor) ||
|
||||
(this.isAdmin && !this.noQrcodeList.includes(this.project)) ||
|
||||
(this.isAdmin && !this.noSimulationQrCodeList.includes(this.project)) ||
|
||||
(this.isAdmin) || (this.isAdmin && this.isProject) || this.isDeviceLogin || this.$route.query.type === 'IM') {
|
||||
num++;
|
||||
}
|
||||
@ -165,6 +162,23 @@ export default {
|
||||
const typeList = ['LW', 'CW'];
|
||||
return typeList.includes(this.$route.query.type);
|
||||
},
|
||||
examSystemShow() {
|
||||
const typeList = ['LW', 'CW', 'IM'];
|
||||
return typeList.includes(this.$route.query.type);
|
||||
},
|
||||
teachSystemShow() {
|
||||
const typeList = ['LW', 'CW'];
|
||||
return typeList.includes(this.$route.query.type);
|
||||
},
|
||||
memberManageShow() {
|
||||
return this.isAdmin && this.$route.query.type !== 'ILW' && this.project !== 'bjd';
|
||||
},
|
||||
deviceManageShow() {
|
||||
return (this.isAdmin && this.isProject && this.project !== 'bjd') || this.$route.query.type === 'ILW';
|
||||
},
|
||||
qrCodeShow() {
|
||||
return this.isAdmin && !this.noSimulationQrCodeList.includes(this.project) && this.$route.query.type !== 'ILW';
|
||||
},
|
||||
isDisable() {
|
||||
return this.$store.state.training.started;
|
||||
},
|
||||
@ -503,14 +517,6 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
changeOperateMode() {
|
||||
this.faultMode = !this.faultMode;
|
||||
let mode = OperateMode.NORMAL;
|
||||
if (this.faultMode) {
|
||||
mode = OperateMode.FAULT;
|
||||
}
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: mode });
|
||||
},
|
||||
loadRunPlan() {
|
||||
this.$emit('runPlanLoadShow');
|
||||
},
|
||||
|
@ -158,8 +158,8 @@ export default {
|
||||
],
|
||||
actions: [
|
||||
{ text: '地图排序', handler: this.mapSort },
|
||||
{ text: '导出', handler: this.localExport, show: () => { return this.$store.state.user.roles.indexOf(superAdmin) > 0; }},
|
||||
{ text: '导入', handler: this.localImport, fileType: 'file', show: () => { return this.$store.state.user.roles.indexOf(superAdmin) > 0; }}
|
||||
{ text: '导出', handler: this.localExport, show: () => { return this.$store.state.user.roles.includes(superAdmin); }},
|
||||
{ text: '导入', handler: this.localImport, fileType: 'file', show: () => { return this.$store.state.user.roles.includes(superAdmin); }}
|
||||
]
|
||||
},
|
||||
|
||||
|
@ -56,7 +56,7 @@ export default {
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '450',
|
||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
||||
hide: () => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.preview'),
|
||||
|
@ -66,7 +66,7 @@ export default {
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
||||
hide: (row) => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.preview'),
|
||||
|
@ -66,7 +66,7 @@ export default {
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '550',
|
||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
||||
hide: () => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('publish.generateRunPlan'),
|
||||
|
@ -80,7 +80,7 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
filterNode(value, data) {
|
||||
return data.label.indexOf(value) !== -1;
|
||||
return data.label.includes(value);
|
||||
},
|
||||
changeRole(member) {
|
||||
if (member) {
|
||||
|
@ -249,7 +249,7 @@ export default {
|
||||
// }
|
||||
},
|
||||
covertButtonname() {
|
||||
if (this.$store.getters.roles.indexOf(admin) >= 0 || this.$store.getters.roles.indexOf(superAdmin) >= 0) {
|
||||
if (this.$store.getters.roles.includes(admin) || this.$store.getters.roles.includes(superAdmin)) {
|
||||
return this.$t('scriptRecord.publish');
|
||||
} else {
|
||||
return this.$t('scriptRecord.applyPublish');
|
||||
|
@ -32,7 +32,6 @@ export default {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
fromCode: '',
|
||||
fromName: '',
|
||||
targetIds: '',
|
||||
deviceType: []
|
||||
},
|
||||
@ -44,8 +43,8 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'fromName', label: '源线路', type: 'text', disabled: true },
|
||||
{ prop: 'targetIds', label:'拷贝线路', type: 'select', options: this.targetList, multiple: true },
|
||||
{ prop: 'fromCode', label: '源线路', type: 'select', options: this.originList, change:true, onChange:this.originChange},
|
||||
{ prop: 'targetIds', label:'拷贝线路', type: 'select', options: this.targetList, multiple: true, deviceChange: this.targetChange },
|
||||
{ prop: 'deviceType', label: '操作对象', type: 'select', options: this.deviceTypeList, multiple: true }
|
||||
]
|
||||
};
|
||||
@ -53,7 +52,7 @@ export default {
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
fromName: [
|
||||
fromCode: [
|
||||
{ required: true, message: '请选择拷贝源线路', trigger: 'blur' }
|
||||
],
|
||||
targetIds: [
|
||||
@ -63,19 +62,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(lineCode) {
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
if (lineCode) {
|
||||
this.targetList = [];
|
||||
this.originList = [];
|
||||
this.taskStatusList.forEach(item => {
|
||||
if (item.value != lineCode) {
|
||||
this.targetList.push(item);
|
||||
} else {
|
||||
this.formModel.fromCode = item.value;
|
||||
this.formModel.fromName = item.label;
|
||||
}
|
||||
this.originList.push(item);
|
||||
});
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
@ -93,6 +87,28 @@ export default {
|
||||
handleClose() {
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
originChange(fromCode) {
|
||||
this.formModel.fromCode = fromCode;
|
||||
this.formModel.targetIds = '';
|
||||
this.targetList = this.targetList.map(each=>{
|
||||
if (each.value == fromCode) {
|
||||
each.disabled = true;
|
||||
} else {
|
||||
each.disabled = false;
|
||||
}
|
||||
return each;
|
||||
});
|
||||
},
|
||||
targetChange(targetIds) {
|
||||
this.originList = this.originList.map(each=>{
|
||||
if (targetIds.includes(each.value)) {
|
||||
each.disabled = true;
|
||||
} else {
|
||||
each.disabled = false;
|
||||
}
|
||||
return each;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -126,9 +126,7 @@ export default {
|
||||
{ text: this.$t('global.add'), handler: this.handleAdd },
|
||||
{ text: '复刻', handler: this.handleCopyAll }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
@ -201,8 +199,8 @@ export default {
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const param = row;
|
||||
createCommand(param).then(response => {
|
||||
// const param = row;
|
||||
createCommand(row).then(response => {
|
||||
this.$message.success('复制指令成功!');
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
@ -212,13 +210,12 @@ export default {
|
||||
},
|
||||
// 复制线路到其他线路 操作
|
||||
handleCopyAll() {
|
||||
this.$refs.copyParam.doShow(this.lineCode);
|
||||
this.$refs.copyParam.doShow();
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
convertField(list, status) {
|
||||
console.log(list, typeof list, status);
|
||||
if (list && list.length > 0) { return list.find(each=>{ return status == each.value; }).label; }
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +59,6 @@
|
||||
import { getRealLineConfigList, putRealLineConfig } from '@/api/management/mapline';
|
||||
export default {
|
||||
name: 'Config',
|
||||
components: {
|
||||
// EditConfig
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
@ -146,21 +143,21 @@ export default {
|
||||
let rangeStart = 0;
|
||||
let rangeEnd = 0;
|
||||
let options = [];
|
||||
if (this.booleanList.indexOf(key) >= 0) {
|
||||
if (this.booleanList.includes(key)) {
|
||||
type = 'boolean';
|
||||
} else if (this.selectList.indexOf(key) >= 0) {
|
||||
} else if (this.selectList.includes(key)) {
|
||||
type = 'select';
|
||||
options = this.optionsMap[key];
|
||||
} else if (this.numberList.indexOf(key) >= 0) {
|
||||
} else if (this.numberList.includes(key)) {
|
||||
type = 'number';
|
||||
} else if (this.rangeList.indexOf(key) >= 0) {
|
||||
} else if (this.rangeList.includes(key)) {
|
||||
type = 'range';
|
||||
if (res.data[key]) {
|
||||
const ranges = res.data[key].split('-');
|
||||
rangeStart = ranges[0];
|
||||
rangeEnd = ranges[1];
|
||||
}
|
||||
} else if (this.speedList.indexOf(key) >= 0) {
|
||||
} else if (this.speedList.includes(key)) {
|
||||
type = 'speed';
|
||||
} else {
|
||||
type = 'input';
|
||||
@ -195,13 +192,6 @@ export default {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
},
|
||||
addModel() {
|
||||
this.$refs.addConfig.show();
|
||||
},
|
||||
editModel(item, index) {
|
||||
this.$refs.editConfig.show(item);
|
||||
this.index = index;
|
||||
},
|
||||
save() {
|
||||
const param = {};
|
||||
this.generalData.forEach(item => {
|
||||
|
@ -12,12 +12,6 @@
|
||||
import { addSkinCode, updateSkinCode } from '@/api/management/mapline';
|
||||
export default {
|
||||
name: 'DictionaryEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@ -27,20 +21,21 @@ export default {
|
||||
name: '',
|
||||
origin: { x: 0, y: 0 },
|
||||
scaling: 1
|
||||
}
|
||||
},
|
||||
isAdd:false,
|
||||
title:''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'code', label: this.$t('system.code'), type: 'text', disabled: !isAdd },
|
||||
{ prop: 'code', label: this.$t('system.code'), type: 'text', disabled: !this.isAdd },
|
||||
{ prop: 'name', label: this.$t('system.name'), type: 'text' },
|
||||
{ prop: 'origin', label: '坐标:', type: 'coordinate', children: [
|
||||
{ prop: 'origin.x', firstLevel: 'origin', secondLevel: 'x', label: 'x', type: 'number', labelWidth: '20px'},
|
||||
{ prop: 'origin.y', firstLevel: 'origin', secondLevel: 'y', label: 'y', type: 'number', labelWidth: '20px'}
|
||||
{ prop: 'origin.x', firstLevel: 'origin', secondLevel: 'x', label: 'x', type: 'number', labelWidth: '30px'},
|
||||
{ prop: 'origin.y', firstLevel: 'origin', secondLevel: 'y', label: 'y', type: 'number', labelWidth: '30px'}
|
||||
] },
|
||||
{ prop: 'scaling', label: '缩放比例:', type: 'number', min: 0.4, max: 8, step: 0.2 }
|
||||
]
|
||||
@ -49,6 +44,9 @@ export default {
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' }
|
||||
],
|
||||
@ -65,27 +63,11 @@ export default {
|
||||
{ required: true, message: '请输入缩放比例', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
} else {
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return this.$t('system.createDirectory');
|
||||
} else {
|
||||
return this.$t('system.editDictionary');
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show(row) {
|
||||
this.dialogVisible = true;
|
||||
if (row && row.id) {
|
||||
this.formModel = {
|
||||
id: row.id,
|
||||
@ -94,12 +76,18 @@ export default {
|
||||
origin: row.origin,
|
||||
scaling: row.scaling
|
||||
};
|
||||
this.isAdd = false;
|
||||
this.title = this.$t('system.editDictionary');
|
||||
} else {
|
||||
this.isAdd = true;
|
||||
this.title = this.$t('system.createDirectory');
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
if (this.isAdd === 'ADD') {
|
||||
self.create();
|
||||
} else {
|
||||
self.update();
|
||||
|
@ -1,119 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false" :z-index="3000">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DictionaryEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
configKey: '',
|
||||
configValue: '',
|
||||
boolean: false
|
||||
// description: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'configKey', label: 'key:', type: 'text' }
|
||||
// { prop: 'description', label: '描述:', type: 'text' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const rules = {
|
||||
configKey: [
|
||||
{ required: true, message: '请输入key值', trigger: 'blur' }
|
||||
],
|
||||
configValue: [
|
||||
{ required: true, message: '请输入value值', trigger: 'blur' }
|
||||
]
|
||||
// remarks: [
|
||||
// { required: true, message: '请输入描述', trigger: 'blur' }
|
||||
// ]
|
||||
};
|
||||
return rules;
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '添加配置项';
|
||||
} else {
|
||||
return '修改配置项';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show(row) {
|
||||
this.dialogVisible = true;
|
||||
if (row && row.configKey) {
|
||||
this.formModel = {
|
||||
configKey: row.configKey,
|
||||
configValue: JSON.parse(row.configValue),
|
||||
boolean: row.boolean
|
||||
// description: row.description
|
||||
};
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create();
|
||||
} else {
|
||||
self.update();
|
||||
}
|
||||
});
|
||||
},
|
||||
buildModel(data) {
|
||||
return {
|
||||
configKey: data.configKey,
|
||||
configValue: data.boolean ? JSON.stringify(data.configValue) : data.configValue,
|
||||
boolean: data.boolean
|
||||
};
|
||||
},
|
||||
create() {
|
||||
this.$emit('create', this.buildModel(this.formModel));
|
||||
this.handleClose();
|
||||
},
|
||||
update() {
|
||||
this.$emit('update', this.buildModel(this.formModel));
|
||||
this.handleClose();
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
configKey: '',
|
||||
configValue: ''
|
||||
// description: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
if (done) {
|
||||
done();
|
||||
} else {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<edit ref="create" type="ADD" @reloadTable="reloadTable" />
|
||||
<edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||
<edit ref="edit" @reloadTable="reloadTable" />
|
||||
<config ref="config" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
@ -106,7 +105,8 @@ export default {
|
||||
},
|
||||
// 新增指令
|
||||
handleAdd() {
|
||||
this.$refs.create.show();
|
||||
this.$refs.edit.show();
|
||||
// this.$refs.create.show();
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
||||
|
@ -178,7 +178,7 @@ export default {
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
return data.name.includes(value);
|
||||
},
|
||||
buy() {
|
||||
// this.disabled = true;
|
||||
|
@ -95,7 +95,7 @@ export default {
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
return data.name.includes(value);
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj) {
|
||||
|
Loading…
Reference in New Issue
Block a user