This commit is contained in:
lVAL 2020-10-20 17:22:27 +08:00
commit a1604ed5a2
25 changed files with 668 additions and 1564 deletions

View File

@ -183,3 +183,11 @@ export function setSandboxConfig(id, data) {
data: data
});
}
/** 添加/修改联锁工作站配置 */
export function setIlwConfig(id, data) {
return request({
url: `/api/device/${id}/config/ilw`,
method: 'put',
data: data
});
}

View File

@ -84,5 +84,6 @@ export default {
sceneManage:'Scene manage',
companyManage: 'Company manage',
authorApply: 'Grant application',
AuthorList: 'Authorization code list'
AuthorList: 'Authorization code list',
questionsRuleManage: 'Question rule manage'
};

View File

@ -89,5 +89,6 @@ export default {
sceneManage:'场景列表',
companyManage: '单位管理',
authorApply: '授权申请',
AuthorList: '授权列表'
AuthorList: '授权列表',
questionsRuleManage: '出题规则管理'
};

View File

@ -324,8 +324,8 @@ export default class Switch extends Group {
.when(1000, { stroke: this.style.backgroundColor })
.start();
}
setSwitchFault(split) {
if (this.style.Switch.jointImg.faultStatus && split) { // 宁波线失表状态
setSwitchFault(split, normalPosition, reversePosition) {
if (this.style.Switch.jointImg.faultStatus && split && !reversePosition && !normalPosition ) { // 宁波线失表状态
this.setForkAction(); // 道岔挤岔
} else {
if (this.model.switchFaultCode && split) {
@ -519,7 +519,7 @@ export default class Switch extends Group {
this.setLossAction(); // 失去
}
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
this.setSwitchFault(model.split);
this.setSwitchFault(model.split, model.normalPosition && model.reversePosition);
model.singleLock && this.setMonolock(); // 道岔单锁
model.blockade && this.block(); // 道岔封锁

View File

@ -151,6 +151,7 @@ const RefereeList = () => import('@/views/jsxt/refereeList/index');
const RefereeDisplay = () => import('@/views/jsxt/refereeList/display');
const Approval = () => import('@/views/approval/index');
const CompanyManage = () => import('@/views/system/companyManage/index');
const QuestionsRuleManage = () => import('@/views/system/questionsRuleManage/index');
import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth';
@ -814,6 +815,14 @@ export const asyncRouter = [
i18n: 'router.companyManage'
}
},
{ // 出题规则管理
path: 'questionsRuleManage',
hidden: true,
component: QuestionsRuleManage,
meta: {
i18n: 'router.questionsRuleManage'
}
},
{
// 缓存管理
path: 'cache',

View File

@ -185,7 +185,10 @@ export default {
QuestionTypeList: [
{ label: '选择题', value: 'select' },
{ label: '判断题', value: 'judge' }
{ label: '判断题', value: 'judge' },
{ label: '多选题', value: 'multi'},
{ label: '填空题', value: 'fill'},
{ label: '问答题', value: 'answer'}
],
// 新版的产品类型枚举
prdType:[
@ -238,7 +241,8 @@ export default {
{label: 'PLC网关', value: 'PLC_GATEWAY'},
{label: '端头控制盒', value: 'PSL'},
{label: 'PSC控制柜', value: 'PSC'},
{label: '虚拟电子沙盘', value: 'SANDBOX'}
{label: '虚拟电子沙盘', value: 'SANDBOX'},
{label: '联锁工作站', value: 'ILW'}
]
}
};

View File

@ -36,7 +36,9 @@ export const deviceFaultType = {
{label: '主灯丝熔断故障', value: 'MAIN_FILAMENT_BROKEN'}
],
Switch: [
{label: '失表', value: 'SPLIT'}
{label: '失表', value: 'SPLIT'},
{label: '定位失表', value: 'NORMAL_SPLIT'},
{label: '反位失表', value: 'REVERSE_SPLIT'}
],
StationStand: [
{label: '屏蔽门故障打开', value: 'FAULT_PSD_OPEN'}

View File

@ -2,8 +2,8 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.169:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康

View File

@ -38,7 +38,6 @@ export default {
doInput() {
const node = this.node;
node.model[node.prop] = this.content;
this.$emit('update', node.model);
this.doClose();
}
}

View File

@ -26,6 +26,7 @@ export default {
queryForm: {
reset: true,
labelWidth: '80px',
leftSpan: 17,
queryObject: {
type: {
type: 'select',
@ -63,7 +64,7 @@ export default {
title: '答 案',
prop: 'answer',
type: 'tagMore',
width: '100',
width: '200',
columnValue: (row) => { return this.answerTags(row); },
tagType: (row) => {
return '';
@ -77,7 +78,7 @@ export default {
{
type: 'button',
title: '操 作',
width: '420',
width: '320',
buttons: [
{
name: '编辑',
@ -98,7 +99,8 @@ export default {
],
actions: [
{ text: '添 加', handler: this.doCreate },
{ text: '导 入', fileType: 'file', handler: this.importQuestionBank }
{ text: '导 入', fileType: 'file', handler: this.importQuestionBank },
{ text: '出题规则管理', handler: this.questionsRuleManage}
]
}
};
@ -149,6 +151,17 @@ export default {
answer.push(el.content);
}
break;
case 'multi':
if (el.correct) {
answer.push(this.$asc2chart(i + 65));
}
break;
case 'fill':
answer.push(el.content);
break;
case 'answer':
answer.push(el.content);
break;
}
});
return answer;
@ -161,7 +174,9 @@ export default {
const questionTypeMap = {
'单选': 'select',
'多选': 'multi',
'判断': 'judge'
'判断': 'judge',
'填空': 'fill',
'问答': 'answer'
};
if (file) {
setTimeout(() => {
@ -216,13 +231,23 @@ export default {
topic: dataList[topicIndex][index],
optionList: []
};
param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' });
param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' });
if (dataList[option3Index][index]) {
param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')});
}
if (dataList[option4Index][index]) {
param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')});
if (param.type === 'fill') {
const answer = dataList[answerIndex][index];
const answerList = answer.split('&&');
answerList && answerList.forEach(item => {
param.optionList.push({content: item, correct: true});
});
} else if (param.type === 'answer') {
param.optionList.push({content: dataList[answerIndex][index]});
} else {
param.optionList.push({ content:dataList[option1Index][index] || '正确', correct: dataList[answerIndex][index].includes('A') || dataList[answerIndex][index] == '√' });
param.optionList.push({ content:dataList[option2Index][index] || '错误', correct: dataList[answerIndex][index].includes('B') || dataList[answerIndex][index] == '×' });
if (dataList[option3Index][index]) {
param.optionList.push({content:dataList[option3Index][index], correct: dataList[answerIndex][index].includes('C')});
}
if (dataList[option4Index][index]) {
param.optionList.push({content:dataList[option4Index][index], correct: dataList[answerIndex][index].includes('D')});
}
}
questionList.push(param);
}
@ -250,6 +275,9 @@ export default {
if (!obj.files) return;
const f = obj.files[0];
this.handleImport(f);
},
questionsRuleManage() {
this.$router.push({ path: `/system/questionsRuleManage`});
}
}
};

View File

@ -11,18 +11,37 @@
<el-radio :label="1"> × </el-radio>
</el-radio-group>
</template>
<template v-if="type=='multi'">
<el-checkbox-group v-model="activeList" @change="onChange">
<el-checkbox v-for="(el,i) in optionList" :key="i" :label="i"> 选项-{{ $asc2chart(65+i) }} </el-checkbox>
</el-checkbox-group>
</template>
<template v-if="type==='fill'">
<div v-for="(el, i) in answerList" :key="i" style="margin-bottom: 5px;">
<div>{{ `${i + 1}` }}</div>
<item-rich v-model="el.value" :remove="i>0" @modify="doModify(el)" @remove="doRemove(i)" />
</div>
<el-button class="item__button" type="primary" size="mini" icon="el-icon-plus" @click="doAppend" />
</template>
<template v-if="type==='answer'">
<el-input
v-model="answer"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
placeholder="请输入答案"
@change="onChange"
/>
</template>
</div>
</template>
<script>
import ItemRich from './item-rich';
export default {
components: {
ItemRich
},
props: {
value: {
type: Number,
default: 0
},
optionList: {
type: Array,
required: true
@ -34,18 +53,51 @@ export default {
},
data() {
return {
active: 0
active: 0,
activeList: [],
answer: '',
answerList: [{value: ''}]
};
},
watch: {
value(val) {
this.active = val;
optionList(val) {
if (this.type === 'judge' || this.type === 'select') {
this.active = this.optionList.findIndex(ele => ele.correct);
} else if (this.type === 'multi') {
this.activeList = [];
this.optionList.forEach((el, i) => {
if (el.correct) {
this.activeList.push(i);
}
});
} else if (this.type === 'fill') {
this.answerList = [];
this.optionList.forEach(el => {
this.answerList.push({value: el.content});
});
} else if (this.type === 'answer') {
this.answer = (this.optionList[0] || {content: ''}).content;
}
},
answerList: {
handler(val) {
this.onChange(val);
},
deep: true
}
},
methods: {
onChange(e) {
this.$emit('input', e);
this.$emit('change', e);
},
doAppend() {
this.answerList.push({value: ''});
},
doModify(el) {
this.$emit('modify', {model: el, prop: 'value'});
},
doRemove(index) {
this.answerList.splice(index, 1);
}
}
};

View File

@ -1,6 +1,6 @@
<template>
<div class="option">
<template v-if="type=='select'">
<template v-if="type=='select' || type=='multi'">
<div v-for="(el,i) in optionList" :key="i" class="option__item">
<div> 选项-{{ $asc2chart(65+i) }} </div>
<item-rich v-model="el.content" :remove="remove" @modify="doModify(el)" @remove="doRemove(i)" />

View File

@ -10,11 +10,11 @@
<item-rich v-model="option.topic" @modify="onModify({model: option, prop: 'topic'})" />
</el-form-item>
<template v-if="isCreate">
<el-form-item v-if="option.type != 'judge'" label="选 项" prop="optionList">
<el-form-item v-if="option.type === 'select' || option.type === 'multi'" label="选 项" prop="optionList">
<item-options :option-list="optionList" :type="option.type" :add="isSelect" :remove="remove" @remove="onRemove" @modify="onModify" @append="onAppend" />
</el-form-item>
<el-form-item label="答 案" prop="answer">
<item-answer v-model="option.answer" :option-list="optionList" :type="option.type" @change="onAnswerChnage" />
<item-answer :option-list="optionList" :type="option.type" @change="onAnswerChnage" @modify="onModify" />
</el-form-item>
</template>
</el-form>
@ -73,6 +73,14 @@ export default {
{ content: '√', correct: true },
{ content: '×', correct: false }
];
},
multi: function() {
return [
{ content: '', correct: false},
{ content: '', correct: false },
{ content: '', correct: false },
{ content: '', correct: false }
];
}
};
},
@ -113,7 +121,18 @@ export default {
}
},
onAnswerChnage(answer) {
this.option.optionList.forEach((el, i) => { el.correct = i == answer; });
if (this.option.type === 'judge' || this.option.type === 'select') {
this.option.optionList.forEach((el, i) => { el.correct = i == answer; });
} else if (this.option.type === 'multi') {
this.option.optionList.forEach((el, i) => { el.correct = answer.includes(i); });
} else if (this.option.type === 'fill') {
this.option.optionList = [];
answer.forEach(item => {
this.option.optionList.push({ content: item.value, correct: true });
});
} else if (this.option.type === 'answer') {
this.option.optionList = [{content: answer, correct:true}];
}
},
onModify(node) {
this.$emit('modify', node);

View File

@ -52,7 +52,7 @@ export default {
loadInitData() {
getQuestionInfo(this.questionId).then(resp => {
this.formModel = resp.data;
this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
// this.formModel.answer = this.formModel.optionList.findIndex(ele => ele.correct);
});
},
doBack() {

View File

@ -259,7 +259,7 @@ export default {
},
bgImg() {
const bgImgAll = process.env.VUE_APP_PRO === 'local' || this.$route.query.project == 'heb' ? '' : bgImg;
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX'];
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW'];
const imgMap = {
ISCS_LW: bgIscsImg,
ISCS_CW: bgIscsImg,
@ -267,12 +267,13 @@ export default {
CCTV: bgCctvImg,
VR_PSD: bgPsdImg,
LSW: bgLswImg,
SANDBOX: bgLswImg
SANDBOX: bgLswImg,
ILW: bgLswImg
};
return synchronousLogin.includes(this.$route.query.type) ? imgMap[this.$route.query.type] : bgImgAll;
},
syncLogin() {
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX'];
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW'];
return this.$route.query.type ? synchronousLogin.includes(this.$route.query.type) : false;
},
loadingText() {
@ -282,7 +283,8 @@ export default {
VR_IBP: '检测现地工作站登陆中',
CCTV: '检测教员机登录中',
VR_PSD: '检测教员机登录中',
LSW: '检测教员机登录中'
LSW: '检测教员机登录中',
ILW: '检测教员机登录中'
};
return this.$route.query.type ? textMap[this.$route.query.type] : '';
}
@ -542,6 +544,16 @@ export default {
type: this.$route.query.type
};
this.$router.push({ path: `/jlmap3d/sandbox`, query: sandboxQuery });
} else if (this.$route.query.type === 'ILW') {
const ilwQuery = {
mapid: query.mapId,
group: query.group,
project: getSessionStorage('project'),
token: getToken(),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
};
this.$router.push({ path: `/jointTrainingNew`, query: query });
} else {
this.$router.push({ path: `/jointTrainingNew`, query: query });
}

View File

@ -941,6 +941,7 @@ export default {
this.commonMessageList = [];
this.conversitionStateMap = {};
this.messageList = this.commonMessageList;
this.connectSuccess = false;
this.treeData.forEach(item => {
if (item.children) {
const memberList = Object.values(item.children);

View File

@ -433,6 +433,13 @@ export default {
this.drivingShow = false;
break;
}
if (this.$route.query.type === 'ILW') {
this.$store.dispatch('training/setPrdType', '');
this.$store.dispatch('training/setRoles', 'AUDIENCE');
this.jl3dmaintainershow = false;
this.drivingShow = false;
this.hideIbp();
}
},
/* 竞赛系统倒计时 */
startCounting() {

View File

@ -1,6 +1,6 @@
<template>
<div>
<chat-box :group="group" :user-role="userRole" />
<chat-box v-if="$route.query.type !== 'ILW'" :group="group" :user-role="userRole" />
<!-- 地图没有报错-->
<!-- 地图错误判断 -->
<div v-if="!dataError&&hasOneButton" class="display_top_draft" :style="{top: offset+'px'}">
@ -14,9 +14,9 @@
<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="isAdmin" size="small" @click="otherVrView">VR第三人称视角</el-button> -->
<el-button v-if="isAdmin && !noQrcodeList.includes(project)" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
<el-button v-if="isAdmin" size="small" @click="memberManage">成员管理</el-button>
<el-button v-if="isAdmin && isProject" size="small" @click="handleEquipment">设备管理</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-group>
@ -26,7 +26,7 @@
<el-button v-if="project==='refereeJsxt'" type="success" size="small" @click="refeeEndCompetition">退出</el-button> <!-- 竞赛退出 -->
<el-button v-if="project!=='jsxt' && project!=='refereeJsxt'" type="primary" :loading="backLoading" size="small" @click="back">退出</el-button>
<template v-if="!dataError"> <!-- 地图错误判断 -->
<template v-if="isAdmin && project != 'refereeJsxt'">
<template v-if="isAdmin && project != 'refereeJsxt' && $route.query.type !== 'ILW'">
<el-button type="danger" size="small" @click="end">{{ $t('joinTraining.initialize') }}</el-button>
<!-- 按计划行车 -->
<el-button type="success" :disabled="isDisable" size="small" @click="selectBeginTime">{{ $t('joinTraining.drivingByPlan') }}</el-button>

View File

@ -7,13 +7,13 @@
<el-button-group>
<el-button v-if="userRole=== 'STATION_SUPERVISOR' && !$route.query.projectDevice" size="small" @click="goIbp">IBP盘</el-button>
<el-button v-if="userRole=== 'DISPATCHER' && !$route.query.projectDevice" size="small" @click="goBigScreen">大屏</el-button>
<el-button v-if="running && !dataError" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
<el-button v-if="running && !dataError && $route.query.type !== 'ILW'" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
<template v-if="isAdmin">
<el-button v-if="!running && !dataError" size="small" type="warning" @click="loadRunPlan">
<el-button v-if="!running && !dataError && $route.query.type !== 'ILW'" size="small" type="warning" @click="loadRunPlan">
{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- -->
</template>
</el-button-group>
<el-button v-if="isAdmin && !dataError && !isScreen" size="small" :type="faultMode ? '' : 'primary' " @click="changeOperateMode()">{{ faultMode?' 切换到普通模式':'切换到故障模式' }}</el-button>
<el-button v-if="(isAdmin || $route.query.type === 'ILW') && !dataError && !isScreen" size="small" :type="faultMode ? '' : 'primary' " @click="changeOperateMode()">{{ faultMode?' 切换到普通模式':'切换到故障模式' }}</el-button>
<!-- isCenter && !dataError && !isAdmin 此判断用于以后(目前 暂时不用) -->
<el-button v-if="isShowDirective" size="small" :type="directiveMode ? 'primary' : ''" @click="changeDirectiveMode()">{{ directiveMode? '切换到普通模式':'切换到指令模式' }}</el-button>
</div>

View File

@ -1,70 +1,48 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="60%" :before-close="handleClose" center :close-on-click-modal="false">
<data-form ref="datatop" :form="formTop" :inline="inline" :form-model="formModel" :rules="topRules" />
<el-form v-if="data.type === 'PSL' || data.type === 'PSC'" ref="form" :model="formModel" label-width="220px" :rules="topRules" :inline="inline">
<el-form-item label="关联地图:" prop="mapId">
<el-select v-model="mapId" placeholder="请选择" size="small" style="width: 180px" @change="mapIdChange">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="关联车站:" prop="stationCode">
<el-select v-model="stationCode" placeholder="请选择" size="small" style="width: 180px" @change="stationCodeChange">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="关联站台:" prop="standCode">
<el-select v-model="standCode" placeholder="请选择" size="small" style="width: 180px" @change="standCodeChange">
<el-option
v-for="item in standList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="关联屏蔽门:" prop="psdCode">
<el-select v-model="formModel.psdCode" placeholder="请选择" style="width: 180px" size="small">
<el-option
v-for="item in psdList"
:key="item.code"
:label="item.code"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<el-row :gutter="20">
<el-col :span="data.type !== 'PSC'?12:24">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>输入配置:</span>
</div>
<div style="margin-top: 20px">
<data-form ref="dataleft" :form="formLeft" :form-model="formModel" :rules="leftRules" :inline="data.type === 'PSC'" />
</div>
</el-card>
</el-col>
<el-col v-if="data.type !== 'PSC'" :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>输出配置:</span>
</div>
<div style="margin-top: 20px">
<data-form ref="dataright" :form="formRight" :form-model="formModel" :rules="rightRules" />
</div>
</el-card>
</el-col>
</el-row>
<!--<el-form v-if="data.type === 'PSL' || data.type === 'PSC'" ref="form" :model="formModel" label-width="220px" :rules="topRules" :inline="inline">-->
<!--<el-form-item label="关联地图:" prop="mapId">-->
<!--<el-select v-model="mapId" placeholder="请选择" size="small" style="width: 180px" @change="mapIdChange">-->
<!--<el-option-->
<!--v-for="item in mapList"-->
<!--:key="item.id"-->
<!--:label="item.name"-->
<!--:value="item.id"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--<el-form-item label="关联车站:" prop="stationCode">-->
<!--<el-select v-model="stationCode" placeholder="请选择" size="small" style="width: 180px" @change="stationCodeChange">-->
<!--<el-option-->
<!--v-for="item in stationList"-->
<!--:key="item.code"-->
<!--:label="item.name"-->
<!--:value="item.code"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--<el-form-item label="关联站台:" prop="standCode">-->
<!--<el-select v-model="standCode" placeholder="请选择" size="small" style="width: 180px" @change="standCodeChange">-->
<!--<el-option-->
<!--v-for="item in standList"-->
<!--:key="item.code"-->
<!--:label="item.name"-->
<!--:value="item.code"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--<el-form-item label="关联屏蔽门:" prop="psdCode">-->
<!--<el-select v-model="formModel.psdCode" placeholder="请选择" style="width: 180px" size="small">-->
<!--<el-option-->
<!--v-for="item in psdList"-->
<!--:key="item.code"-->
<!--:label="item.code"-->
<!--:value="item.code"-->
<!--/>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--</el-form>-->
<el-input v-model="jsonConfig" autosize type="textarea" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
@ -91,89 +69,19 @@ export default {
addrName: '',
data: {},
titleMap: { SWITCH: '道岔', PSD:'屏蔽门', SIGNAL: '信号机', PSL:'端头控制盒', PSC: 'PSC控制柜' },
psdLeftValue: [
{label: '输入-是否关门位', value: 'i_c'},
{label: '输入-PSL关门按钮位', value: 'i_dc_b'},
{label: '输入-PSL开门按钮位', value: 'i_do_b'},
{label: '输入-互锁解除钥匙开关位', value: 'i_ir'},
{label: '输入-是否锁闭位', value: 'i_l'},
{label: '输入-PSL允许钥匙开关位', value: 'i_psl'},
{label: '输入-PSL试灯按钮位', value: 'i_ts_b'}
],
psdRightValue: [
{label: '输出-关门位', value: 'o_c'},
{label: '输出-关门信号灯控制位', value: 'o_dc_s'},
{label: '输出-关门且锁闭信号灯控制位', value: 'o_dcl_s'},
{label: '输出-开门信号灯控制位', value: 'o_do_s'},
{label: '输出-互锁解除信号灯控制位', value: 'o_ir_s'},
{label: '输出-锁闭位', value: 'o_l'},
{label: '输出-开门位', value: 'o_o'},
{label: '输出-PSL信号灯控制位', value: 'o_psl_s'}
],
switchValue: [
{label: '网关地址', value: 'addr'},
{label: '定位表示', value: 'rnp'},
{label: '反位表示', value: 'rrp'},
{label: '定位控制', value: 'wnp'},
{label: '反位控制', value: 'wrp'},
{label: '锁闭控制', value: 'wl'}
],
signalLeftValue: [
{label: '输入-故障表示位', value: 'i_f'},
{label: '输入-绿灯表示位', value: 'i_g'},
{label: '输入-黄灯表示位', value: 'i_y'},
{label: '输入-黄红灯表示位', value: 'i_yr'}
],
signalRightValue: [
{label: '输出-故障控制位', value: 'o_f'},
{label: '输出-绿灯控制位', value: 'o_g'},
{label: '输出-红灯控制位', value: 'o_r'},
{label: '输出-黄灯控制位', value: 'o_y'},
{label: '输出-黄红灯控制位', value: 'o_yr'}
],
pslLeftValue: [
{label: '读PSL操作旋钮位', value: 'rpslcz'},
{label: '读关门按钮位', value: 'rgman'},
{label: '读开门按钮位', value: 'rkman'},
{label: '读互锁解除开关位', value: 'rjc'},
{label: '读试灯按钮位', value: 'rsdan'},
{label: '读紧急停车按钮位', value: 'rjtan'}
],
pslRightValue: [
{label: '写全部关门指示灯位', value: 'wqbgbd'},
{label: '写开门到位指示灯位', value: 'wkmdwd'},
{label: '写PSL允许指示灯位', value: 'wpslyxd'},
{label: '写互锁解除指示灯位', value: 'wjcd'},
{label: '写IBP盘操作指示灯位', value: 'wibpczd'},
{label: '写PST操作指示灯位', value: 'wpstczd'}
],
mapId: '',
mapList: [],
stationCode: '',
stationList: [],
standList: [],
standCode: '',
psdList: []
psdList: [],
jsonConfig: ''
};
},
computed: {
formTop() {
return {
labelWidth: '220px',
items: [
{ prop:'addr', label: this.addrName, type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'quantity', label: '位数量:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0 }
]
};
},
topRules() {
return {
addr: [
{ required: true, message: '请填写网关地址', trigger: 'blur' }
],
quantity: [
{ required: true, message: '请填写位数量', trigger: 'blur'}
],
psdCode: [
{ required: true, message: '请选择关联屏蔽门', trigger: 'change'}
]
@ -185,372 +93,40 @@ export default {
},
methods: {
initForm(row) {
var validateDevice = (rule, value, callback) => {
const list = [];
rule.list.forEach(item=> {
if (this.formModel[item.value] && this.formModel[item.value] === value) {
list.push(item.label);
}
});
if (!this.formModel.quantity) {
this.$refs.datatop.validateField('quantity');
}
if (list.length > 1) {
let repeatedValue = '';
list.forEach((item, index) => {
repeatedValue += item;
if (index !== list.length - 1) {
repeatedValue += '与';
}
});
callback(new Error(repeatedValue + '位置重复,请调整!'));
} else if (this.formModel.quantity && value >= this.formModel.quantity) {
callback(new Error('网关位应小于位数量!'));
} else {
callback();
}
};
var validateAddr = (rule, value, callback) => {
if (!value && value !== 0) {
callback(new Error(rule.messageEmpty));
} else if (this.formModel.i_addr === this.formModel.o_addr) {
callback(new Error('输入网关字地址与输出网关字地址不能相同!'));
} else {
callback();
}
};
switch (row.type) {
case 'PSD': {
this.setDeviceConfigFunction = setPsdConfig;
this.formLeft = {
labelWidth: '220px',
items: [
{ prop:'i_addr', label:'输入网关字地址:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'i_c', label: '输入-是否关门位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_dc_b', label: '输入-PSL关门按钮位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_do_b', label: '输入-PSL开门按钮位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_ir', label: '输入-互锁解除钥匙开关位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_l', label: '输入-是否锁闭位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_psl', label: '输入-PSL允许钥匙开关位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_ts_b', label: '输入-PSL试灯按钮位:', type: 'text', rightWidth: '100px', maxlength: 4}
]
};
this.leftRules = {
i_addr: [
{ validator: validateAddr, messageEmpty: '请填写输入网关字地址', trigger: 'blur' }
],
i_c: [
{ validator: validateDevice, messageEmpty: '请填写输入-是否关门位', list: this.psdLeftValue, trigger: 'blur' }
],
i_dc_b: [
{validator: validateDevice, messageEmpty: '请填写输入-PSL关门按钮位', list: this.psdLeftValue, trigger: 'blur' }
],
i_do_b: [
{ validator: validateDevice, messageEmpty: '请填写输入-PSL开门按钮位', list: this.psdLeftValue, trigger: 'blur' }
],
i_ir: [
{ validator: validateDevice, messageEmpty: '请填写输入-互锁解除钥匙开关位', list: this.psdLeftValue, trigger: 'blur' }
],
i_l: [
{ validator: validateDevice, messageEmpty: '请填写输入-是否锁闭位', list: this.psdLeftValue, trigger: 'blur' }
],
i_psl: [
{ validator: validateDevice, messageEmpty: '请填写输入-PSL允许钥匙开关位', list: this.psdLeftValue, trigger: 'blur' }
],
i_ts_b: [
{ validator: validateDevice, messageEmpty: '请填写输入-PSL试灯按钮位', list: this.psdLeftValue, trigger: 'blur' }
]
};
this.formRight = {
labelWidth: '220px',
items: [
{ prop: 'o_addr', label: '输出网关字地址:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'o_c', label: '输出-关门位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_dc_s', label: '输出-关门信号灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_dcl_s', label: '输出-关门且锁闭信号灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_do_s', label: '输出-开门信号灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_ir_s', label: '输出-互锁解除信号灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_l', label: '输出-锁闭位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_o', label: '输出-开门位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_psl_s', label: '输出-PSL信号灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4}
]
};
this.rightRules = {
o_addr: [
{ validator: validateAddr, messageEmpty: '请填写输出网关字地址', trigger: 'blur' }
],
o_c: [
{ validator: validateDevice, messageEmpty: '请填写输出-关门位', list: this.psdRightValue, trigger: 'blur' }
],
o_dc_s: [
{ validator: validateDevice, messageEmpty: '请填写输出-关门信号灯控制位', list: this.psdRightValue, trigger: 'blur' }
],
o_dcl_s: [
{ validator: validateDevice, messageEmpty: '请填写输出-关门且锁闭信号灯控制位', list: this.psdRightValue, trigger: 'blur' }
],
o_do_s: [
{ validator: validateDevice, messageEmpty: '请填写输出-开门信号灯控制位', list: this.psdRightValue, trigger: 'blur' }
],
o_ir_s: [
{ validator: validateDevice, messageEmpty: '请填写输出-互锁解除信号灯控制位', list: this.psdRightValue, trigger: 'blur' }
],
o_l: [
{ validator: validateDevice, messageEmpty: '请填写输出-锁闭位', list: this.psdRightValue, trigger: 'blur' }
],
o_o: [
{ validator: validateDevice, messageEmpty: '请填写输出-开门位', list: this.psdRightValue, trigger: 'blur' }
],
o_psl_s: [
{ validator: validateDevice, messageEmpty: '请填写输出-PSL信号灯控制位', list: this.psdRightValue, trigger: 'blur' }
]
};
break;
}
case 'SIGNAL': {
this.setDeviceConfigFunction = setSignalConfig;
this.formTop.labelWidth = '150px';
this.formLeft = {
labelWidth: '150px',
items: [
{ prop:'i_addr', label:'输入网关字地址:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'i_f', label: '输入-故障表示位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_g', label: '输入-绿灯表示位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_y', label: '输入-黄灯表示位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'i_yr', label: '输入-黄红灯表示位:', type: 'text', rightWidth: '100px', maxlength: 4}
]
};
this.leftRules = {
i_addr: [
{ validator: validateAddr, messageEmpty: '请填写输入网关字地址', trigger: 'blur' }
],
i_f: [
{ validator: validateDevice, messageEmpty: '请填写输入-故障表示位', list: this.signalLeftValue, trigger: 'blur' }
],
i_g: [
{ validator: validateDevice, messageEmpty: '请填写输入-绿灯表示位', list: this.signalLeftValue, trigger: 'blur' }
],
i_y: [
{ validator: validateDevice, messageEmpty: '请填写输入-黄灯表示位', list: this.signalLeftValue, trigger: 'blur' }
],
i_yr: [
{ validator: validateDevice, messageEmpty: '请填写输入-黄红灯表示位', list: this.signalLeftValue, trigger: 'blur'}
]
};
this.formRight = {
labelWidth: '150px',
size: 'mini',
items: [
{ prop: 'o_addr', label: '输出网关字地址:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'o_f', label: '输出-故障控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_g', label: '输出-绿灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_r', label: '输出-红灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_y', label: '输出-黄灯控制位:', type: 'text', rightWidth: '100px', maxlength: 4},
{ prop: 'o_yr', label: '输出-黄红灯控制位', type: 'text', rightWidth: '100px', maxlength: 4}
]
};
this.rightRules = {
o_addr: [
{ validator: validateAddr, messageEmpty: '请填写输出网关字地址', trigger: 'blur' }
],
o_f: [
{ validator: validateDevice, messageEmpty: '请填写输出-故障控制位', list: this.signalRightValue, trigger: 'blur' }
],
o_g: [
{ validator: validateDevice, messageEmpty: '请填写输出-绿灯控制位', list: this.signalRightValue, trigger: 'blur' }
],
o_r: [
{ validator: validateDevice, messageEmpty: '请填写输出-红灯控制位', list: this.signalRightValue, trigger: 'blur' }
],
o_y: [
{ validator: validateDevice, messageEmpty: '请填写输出-黄灯控制位', list: this.signalRightValue, trigger: 'blur' }
],
o_yr: [
{ validator: validateDevice, messageEmpty: '请填写输出-黄红灯控制位', list: this.signalRightValue, trigger: 'blur'}
]
};
break;
}
case 'SWITCH': {
this.setDeviceConfigFunction = setSwitchConfig;
this.addrName = '网关地址:';
this.formTop.labelWidth = '220';
this.formLeft = {
labelWidth: '220px',
items: [
{ prop: 'rnp', label: '定位表示:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rrp', label: '反位表示:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.leftRules = {
rnp: [
{ required: true, message: '请填写-定位表示', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
rrp: [
{ required: true, message: '请填写反位表示', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
]
};
this.formRight = {
labelWidth: '160px',
items: [
{ prop: 'wnp', label: '定位控制:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wrp', label: '反位控制:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wl', label: '锁闭控制:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.rightRules = {
wnp: [
{ required: true, message: '请填写定位控制', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
wrp: [
{ required: true, message: '请填写反位控制', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
],
wl: [
{ required: true, message: '请填写锁闭控制', trigger: 'blur' },
{ validator: validateDevice, list: this.switchValue, trigger: ['blur', 'change'] }
]
};
break;
}
case 'PSL': {
this.setDeviceConfigFunction = setPslConfig;
this.addrName = '网关地址:';
this.formLeft = {
labelWidth: '170px',
items: [
{ prop: 'rpslcz', label: '读PSL操作旋钮位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rgman', label: '读关门按钮位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rkman', label: '读开门按钮位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rjc', label: '读互锁解除开关位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rsdan', label: '读试灯按钮位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'rjtan', label: '读紧急停车按钮位', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.leftRules = {
rpslcz: [
{ required: true, message: '请填写\'读PSL操作旋钮位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
rgman: [
{ required: true, message: '请填写\'读关门按钮位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
rkman: [
{ required: true, message: '请填写\'读开门按钮位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
rjc: [
{ required: true, message: '请填写\'读互锁解除开关位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
rsdan: [
{ required: true, message: '请填写\'读试灯按钮位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
rjtan: [
{ required: true, message: '请填写\'读紧急停车按钮位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
]
};
this.formRight = {
labelWidth: '170px',
items: [
{ prop: 'wqbgbd', label: '写全部关门指示灯位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wkmdwd', label: '写开门到位指示灯位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpslyxd', label: '写PSL允许指示灯位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wjcd', label: '写互锁解除指示灯位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wibpczd', label: '写IBP盘操作指示灯位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpstczd', label: '写PST操作指示灯位:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.rightRules = {
wqbgbd: [
{ required: true, message: '请填写\'写全部关门指示灯位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslRightValue, trigger: ['blur', 'change'] }
],
wkmdwd: [
{ required: true, message: '请填写\'写开门到位指示灯位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslRightValue, trigger: ['blur', 'change'] }
],
wpslyxd: [
{ required: true, message: '请填写\'写PSL允许指示灯位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslRightValue, trigger: ['blur', 'change'] }
],
wjcd: [
{ required: true, message: '请填写\'写互锁解除指示灯位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslRightValue, trigger: ['blur', 'change'] }
],
wibpczd: [
{ required: true, message: '请填写\'写IBP盘操作指示灯位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslRightValue, trigger: ['blur', 'change'] }
],
wpstczd: [
{ required: true, message: '请填写\'写PST操作指示灯位\'', trigger: 'blur' },
{ validator: validateDevice, list: this.pslRightValue, trigger: ['blur', 'change'] }
]
};
break;
}
case 'PSC': {
this.setDeviceConfigFunction = setPscConfig;
this.addrName = '网关位地址:';
this.formLeft = {
labelWidth: '220px',
items: [
{ prop: 'wpslsn', label: 'PSL使能:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpslkm', label: 'PSL开门:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpslgm', label: 'PSL关门:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wpslhsjc', label: 'PSL互锁解除:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wibpsn', label: 'IBP使能:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wibpkm', label: 'IBP开门:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0},
{ prop: 'wibpgm', label: 'IBP关门:', type: 'number', min: 0, max: 20000, step: 1, precisionFlag: true, precision: 0}
]
};
this.leftRules = {
wpslsn: [
{ required: true, message: '请填写PSL使能', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wpslkm: [
{ required: true, message: '请填写PSL开门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wpslgm: [
{ required: true, message: '请填写PSL关门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wpslhsjc: [
{ required: true, message: '请填写PSL互锁解除', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wibpsn: [
{ required: true, message: '请填写IBP使能', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wibpkm: [
{ required: true, message: '请填写IBP开门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
],
wibpgm: [
{ required: true, message: '请填写IBP关门', trigger: 'blur' },
{ validator: validateDevice, list: this.pslLeftValue, trigger: ['blur', 'change'] }
]
};
this.formRight = {};
this.rightRules = {};
break;
}
}
},
initData(row) {
this.jsonConfig = '{}';
getDeviceDetail(row.id).then(resp => {
if (resp.data.config) {
this.formModel = JSON.parse(resp.data.config);
this.jsonConfig = JSON.stringify(JSON.parse(resp.data.config), null, 4);
}
}).catch(()=> {
}).catch((e)=> {
this.$message.error('获取项目设备详情失败!');
});
if (row.type === 'PSL' || row.type === 'PSC') {
@ -579,36 +155,28 @@ export default {
flag = valid;
});
}
this.$refs.datatop.validateForm(() => {
self.$refs.dataleft.validateForm(()=> {
if (this.data.type === 'PSC') {
flag && self.setDeviceConfigFunction(this.data.id, this.formModel).then(response => {
self.$message.success('设置设备网关映射配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
} else {
self.$refs.dataright.validateForm(()=> {
flag && self.setDeviceConfigFunction(this.data.id, this.formModel).then(response => {
self.$message.success('设置设备网关映射配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
}
});
const form = JSON.parse(this.jsonConfig);
// if (this.data.type === 'PSC' || this.data.type === 'PSL') {
// form.psdCode = this.formModel.psdCode;
// flag && self.setDeviceConfigFunction(this.data.id, form).then(response => {
// self.$message.success('');
// self.handleClose();
// self.$emit('reloadTable');
// }).catch(error => {
// self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
// });
// } else {
flag && self.setDeviceConfigFunction(this.data.id, form).then(response => {
self.$message.success('设置设备网关映射配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
// }
},
handleClose() {
this.formModel = {};
this.formLeft = {};
this.formRight = {};
this.leftRules = {};
this.rightRules = {};
this.data = {};
this.mapList = [];
this.stationList = [];
@ -618,9 +186,6 @@ export default {
this.stationCode = '';
this.standCode = '';
this.dialogVisible = false;
this.$refs.datatop.resetForm();
this.$refs.dataleft.resetForm();
this.$refs.dataright && this.$refs.dataright.resetForm();
this.$refs.form && this.$refs.form.resetFields();
},
mapIdChange(mapId) {

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
</template>
<script>
import { getDevicesByType, getDeviceDetail, setLswConfig, setCctvConfig, setVrPsdConfig, setPlcConfig, setSandboxConfig } from '@/api/project';
import { getDevicesByType, getDeviceDetail, setLswConfig, setCctvConfig, setVrPsdConfig, setPlcConfig, setSandboxConfig, setIlwConfig } from '@/api/project';
import { getAllMapOnline, getStationListNeedAttendant, getPsdListByStandCode, getStandListByStationCode } from '@/api/jmap/map';
export default {
@ -108,6 +108,13 @@ export default {
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'}
]
};
} else if (this.data.type === 'ILW') {
form = {
labelWidth: '150px',
items: [
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'}
]
};
}
return form;
}
@ -245,7 +252,20 @@ export default {
deviceCode: this.formData.deviceCode
};
setSandboxConfig(this.data.id, param).then(() => {
self.$message.success('设置电子沙盘配置成员');
self.$message.success('设置电子沙盘配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
} else if (this.data.type === 'ILW') {
this.$refs.dataForm.validateForm(() => {
const param = {
deviceCode: this.formData.deviceCode
};
setIlwConfig(this.data.id, param).then(() => {
self.$message.success('设置联锁工作站配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {

View File

@ -183,7 +183,7 @@ export default {
this.$refs.editConfig.doShow(row);
} else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD' || row.type === 'PSL' || row.type === 'PSC') {
this.$refs.editConfigGateway.doShow(row);
} else if (row.type == 'LSW' || row.type == 'CCTV' || row.type == 'VR_PSD' || row.type === 'PLC_GATEWAY' || row.type === 'SANDBOX') {
} else if (row.type == 'LSW' || row.type == 'CCTV' || row.type == 'VR_PSD' || row.type === 'PLC_GATEWAY' || row.type === 'SANDBOX' || row.type === 'ILW') {
this.$refs.editConfigScreen.doShow(row);
} else if (row.type === 'IBP') {
this.$refs.editConfigIbp.doShow(row);
@ -196,7 +196,7 @@ export default {
},
getPath(index, row) {
let url = '';
url = `${window.location.protocol}//${window.location.host}/login?project=${row.project.toLowerCase()}&projectDevice=${row.code}&type=${row.type}`;
url = `${window.location.protocol}//${window.location.host}/cbtc/login?project=${row.project.toLowerCase()}&projectDevice=${row.code}&type=${row.type}`;
this.url = url;
this.$messageBox();
this.$confirm(`登录路径:${url}`, '登录路径', {

View File

@ -0,0 +1,167 @@
<template>
<el-dialog v-dialogDrag title="添加出题规则" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" 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="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { addQuestionRule, updateQuestionRule } from '@/api/questionsRule';
export default {
name: 'Add',
props: {
companyList: {
type: Array,
required: true
}
},
data() {
return {
dialogVisible: false,
formModel: {
id: '',
companyId: '',
judgeNum: 0,
judgePoint: 0,
selectNum: 0,
selectPoint: 0,
multiNum: 0,
multiPoint: 0,
fillNum: 0,
fillPoint: 0,
answerNum: 0,
answerPoint: 0
},
update: false
};
},
computed:{
form() {
const form = {
labelWidth: '100px',
items: [
{ prop: 'companyId', label: '公司名称', type: 'select', options: this.companyList, optionValue: 'id', optionLabel: 'name' },
{ prop: 'judgeNum', label: '判断题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'judgePoint', label: '判断题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'selectNum', label: '单选题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'selectPoint', label: '单选题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'multiNum', label: '多选题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'multiPoint', label: '多选题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'fillNum', label: '填空题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'fillPoint', label: '填空题分数', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'answerNum', label: '问答题数量', type: 'number', min: 0, max: 99, step: 1 },
{ prop: 'answerPoint', label: '问答题分数', type: 'number', min: 0, max: 99, step: 1 }
]
};
return form;
},
rules() {
const crules = {
companyId: [
{ required: true, message: '请选择单位', trigger: 'change' }
]
};
return crules;
}
},
methods: {
doShow(data) {
this.dialogVisible = true;
this.update = false;
if (data) {
this.update = true;
this.formModel.id = data.id;
this.formModel.companyId = data.companyId;
data.rules.forEach(item => {
if (item.type === 'judge') {
this.formModel.judgeNum = item.num;
this.formModel.judgePoint = item.point;
} else if (item.type === 'select') {
this.formModel.selectNum = item.num;
this.formModel.selectPoint = item.point;
} else if (item.type === 'multi') {
this.formModel.multiNum = item.num;
this.formModel.multiPoint = item.point;
} else if (item.type === 'fill') {
this.formModel.fillNum = item.num;
this.formModel.fillNum = item.point;
} else if (item.type === 'answer') {
this.formModel.answerNum = item.num;
this.formModel.answerPoint = item.point;
}
});
} else {
this.formModel = {
id: '',
companyId: '',
judgeNum: 0,
judgePoint: 0,
selectNum: 0,
selectPoint: 0,
multiNum: 0,
multiPoint: 0,
fillNum: 0,
fillPoint: 0,
answerNum: 0,
answerPoint: 0
};
}
},
handleClose() {
this.dialogVisible = false;
},
doSave() {
this.$refs.dataform.validateForm(() => {
const params = {
id: this.formModel.id,
companyId: this.formModel.companyId,
rules: []
};
if (this.formModel.judgeNum && this.formModel.judgePoint) {
params.rules.push({ type:'judge', num: this.formModel.judgeNum, point: this.formModel.judgePoint });
}
if (this.formModel.selectNum && this.formModel.selectPoint) {
params.rules.push({ type: 'select', num: this.formModel.selectNum, point: this.formModel.selectPoint});
}
if (this.formModel.multiNum && this.formModel.multiPoint) {
params.rules.push({ type: 'multi', num: this.formModel.multiNum, point: this.formModel.multiPoint});
}
if (this.formModel.fillNum && this.formModel.fillPoint) {
params.rules.push({ type: 'fill', num: this.formModel.fillNum, point: this.formModel.fillPoint });
}
if (this.formModel.answerNum && this.formModel.answerPoint) {
params.rules.push({ type: 'answer', num: this.formModel.answerNum, point: this.formModel.point});
}
if (this.update) {
updateQuestionRule(this.formModel.id, params).then(resp => {
this.$message.success('更新出题规则成功!');
this.dialogVisible = false;
this.$emit('reloadTable');
}).catch(e => {
this.$message.error('更新出题规则失败!');
});
} else {
addQuestionRule(params).then(resp => {
this.$message.success('添加出题规则成功!');
this.dialogVisible = false;
this.$emit('reloadTable');
}).catch(e => {
if (e.code == 10010) {
this.$message.error('关联改公司数据已存在!');
} else {
this.$message.error('添加出题规则失败!');
}
});
}
});
}
}
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,177 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-questions-rule ref="editQuestionsRule" :company-list="companyList" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { getQustionRuleListPage, deleteQuestionRule } from '@/api/questionsRule';
import { getCompanyList } from '@/api/company';
import EditQuestionsRule from './add';
export default {
name: 'CompanyManage',
components: {
EditQuestionsRule
},
data() {
return {
companyList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
}
},
queryList: {
query: getQustionRuleListPage,
selectCheckShow: false,
columns: [
{
title: '公司名称',
prop: 'companyId',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.companyId, this.companyList, ['id', 'name']); },
tagType: (row) => { return 'default'; }
},
{
title: '判断题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'judge', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '判断题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'judge', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '单选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'select', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '单选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'select', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '多选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'multi', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '多选题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'multi', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '填空题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'fill', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '填空题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'fill', 'point'); },
tagType: (row) => { return 'success'; }
},
{
title: '问答题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'answer', 'num'); },
tagType: (row) => { return 'success'; }
},
{
title: '问答题数量',
prop: 'rules',
type: 'tag',
columnValue: (row) => { return this.handlerRuleData(row.rules, 'answer', 'point'); },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleUpdate
},
{
name: '删除',
handleClick: this.handleDeleteCompany,
type: 'danger'
}
]
}
],
actions: [
{ text: '添加', btnCode: 'employee_auto', handler: this.handlerAddCompany },
{ text: '返回', btnCode: 'employee_auto', handler: this.handlerBack}
]
},
currentModel: {}
};
},
mounted() {
getCompanyList().then(resp => {
this.companyList = resp.data;
});
},
methods: {
handlerAddCompany() {
this.$refs.editQuestionsRule.doShow();
},
handleDeleteCompany(index, row) {
deleteQuestionRule(row.id).then(resp => {
this.$message.success('删除单位信息成功!');
this.reloadTable();
}).catch(() => {
this.$message.error('删除单位信息失败!');
});
},
handleUpdate(index, row) {
this.$refs.editQuestionsRule.doShow(row);
},
reloadTable() {
this.queryList.reload();
},
handlerBack() {
this.$router.go(-1);
},
handlerRuleData(rules, type, param) {
let value = 0;
rules && rules.forEach(item => {
if (item.type === type) {
value = item[param];
}
});
return value;
}
}
};
</script>
<style scoped>
</style>