# Conflicts:
#	src/views/system/deviceManage/editConfig.vue
This commit is contained in:
joylink_cuiweidong 2020-07-07 18:26:56 +08:00
commit f4f5173ea3
6 changed files with 126 additions and 30 deletions

View File

@ -99,6 +99,22 @@ export function getDevicesByType(type) {
method: 'get'
});
}
/** 添加/修改车站综合监控配置 */
export function setIscsLwConfig(id, data) {
return request({
url: `/api/device/${id}/config/iscslw`,
method: 'put',
data: data
});
}
/** 添加/修改中心综合监控配置 */
export function setIscsCwConfig(id, data) {
return request({
url: `/api/device/${id}/config/iscscw`,
method: 'put',
data: data
});
}
/** 添加/修改大屏工作站配置 */
export function setLswConfig(id, data) {

View File

@ -50,8 +50,8 @@ function getRouteInfo(to) {
} else {
const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : '';
loginPath = whitePage || loginPage;
if (to.query.projectDevice && to.query.ibpDevice) {
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&ibpDevice=${to.query.ibpDevice}`;
if (to.query.projectDevice && to.query.type) {
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`;
} else if (to.query.projectDevice) {
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}`;
}

View File

@ -16,7 +16,7 @@
</div>
</div>
<div class="select-box">
<el-select v-model="currentSystem" placeholder="请选择" size="mini" @change="changeCurrentSystem">
<el-select v-if="!projectDevice" v-model="currentSystem" placeholder="请选择" size="mini" @change="changeCurrentSystem">
<el-option
v-for="item in systemList"
:key="item.value"
@ -25,13 +25,14 @@
/>
</el-select>
</div>
<div class="back-box" @click="back">返回主页面</div>
<div class="back-box" @click="back">{{ projectDevice? '退出': '返回主页面' }}</div>
</div>
</template>
<script>
import { getByGroupStationList } from '@/api/jmap/map';
import merge from 'webpack-merge';
import { getSessionStorage } from '@/utils/auth';
export default {
data() {
return {
@ -271,6 +272,9 @@ export default {
computed: {
group() {
return this.$route.query.group;
},
projectDevice() {
return getSessionStorage('projectDevice');
}
},
async created () {
@ -300,6 +304,11 @@ export default {
});
}
});
if (this.projectDevice && this.projectDevice.type === 'ISCS_LW') {
this.currentSystem = 'local';
} else if (this.projectDevice && this.projectDevice.type === 'ISCS_CW') {
this.currentSystem = 'center';
}
},
methods: {
show(item) {
@ -315,24 +324,42 @@ export default {
this.selectChildIndex = 0;
if (item.children.length) {
this.type = item.children[0].type;
this.$router.push({ path: `/displayIscs/system/config/${item.children[0].type}`, query: {currentSystem:this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group } });
const query = {currentSystem:this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group };
if (this.projectDevice) {
query.projectDevice = this.$route.query.projectDevice;
}
this.$router.push({ path: `/displayIscs/system/config/${item.children[0].type}`, query: query });
}
}
},
selectChildren(item, index) { //
this.selectChildIndex = index;
this.type = item.type;
this.$router.push({ path: `/displayIscs/system/config/${item.type}`, query: {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group } });
const query = {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group };
if (this.projectDevice) {
query.projectDevice = this.$route.query.projectDevice;
}
this.$router.push({ path: `/displayIscs/system/config/${item.type}`, query: query });
},
selectStation(item, index) { //
this.selectStationIndex = index;
if (!this.type) {
this.type = this.$route.params.mode;
}
this.$router.push({ path: `/displayIscs/system/config/${this.type}`, query: {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group } });
const query = {currentSystem: this.currentSystem, stationName: this.stationList[this.selectStationIndex].name, stationId: this.stationList[this.selectStationIndex].id, group: this.group };
if (this.projectDevice) {
query.projectDevice = this.$route.query.projectDevice;
}
this.$router.push({ path: `/displayIscs/system/config/${this.type}`, query: query });
},
back() {
this.$router.push({ path: `/trainingPlatform` });
if (this.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
} else {
this.$router.push({ path: `/trainingPlatform` });
}
},
changeCurrentSystem() {
this.$router.push({

View File

@ -1,27 +1,27 @@
<template>
<div
v-loading="ibpDevice && !loadingCode"
v-loading="syncLogin && !loadingCode"
class="login-container"
:style="{'background-image': 'url('+bgImg+')'}"
element-loading-spinner="el-icon-loading"
element-loading-text="检测主工作站登录中"
element-loading-background="rgba(0, 0, 0, 0)"
>
<el-button v-if="ibpDevice && loadingCode" type="text" style="font-size: 24px;font-weight: bold;" @click="loginRefresh">主工作站未登录,点击重新检测</el-button>
<div v-if="loginTitle && !ibpDevice" :class="$route.query.project=='hyd'?'text-box':'left-logo-box'">
<el-button v-if="syncLogin && loadingCode" type="text" style="font-size: 24px;font-weight: bold;" @click="loginRefresh">主工作站未登录,点击重新检测</el-button>
<div v-if="loginTitle && !syncLogin" :class="$route.query.project=='hyd'?'text-box':'left-logo-box'">
<img class="logo" :src="logoImg" :style="{width: logoWidth}">
<span>{{ loginTitle==='空串'?'':loginTitle }}</span>
</div>
<div v-if="isProject && !ibpDevice" class="text-box">
<div v-if="isProject && !syncLogin" class="text-box">
<img v-if="!loginTitle" class="logo" :src="logoImg" style="width: 80px">
<span>{{ title }}</span>
</div>
<div v-if="!ibpDevice" class="language_box">
<div v-if="!syncLogin" class="language_box">
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
</el-tooltip>
</div>
<div v-if="!ibpDevice" class="content-box" :style="$route.query.project=='hyd'?'width: 450px;':''">
<div v-if="!syncLogin" class="content-box" :style="$route.query.project=='hyd'?'width: 450px;':''">
<div v-if="$route.query.project!='hyd'" class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
@ -176,6 +176,7 @@ export default {
language: '中文',
versionBaseNoShow: VersionBaseNoShow,
mainBodyNoShow: MainBodyNoShow
};
},
computed: {
@ -210,10 +211,16 @@ export default {
},
bgImg() {
const bgImgAll = this.$route.query.project == 'hyd' ? '' : bgImg;
return this.$route.query.ibpDevice ? bgIbpImg : bgImgAll;
const synchronousLogin = ['IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW'];
return synchronousLogin.includes(this.$route.query.type) ? bgIbpImg : bgImgAll;
},
ibpDevice() {
return this.$route.query.ibpDevice;
syncLogin() {
const synchronousLogin = ['IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW'];
if (this.$route.query.type) {
return synchronousLogin.includes(this.$route.query.type);
} else {
return false;
}
}
},
created() {
@ -240,7 +247,7 @@ export default {
},
mounted() {
document.title = loginInfo[this.project].browserTitle || loginInfo[this.project].title;
if (this.ibpDevice || this.$route.query.project != 'hyd') {
if (this.syncLogin || this.$route.query.project != 'hyd') {
this.loginRefresh();
}
},
@ -395,8 +402,8 @@ export default {
getLoginInfo(getToken()).then(res => {
getSimulationInfoNew(res.data.group).then(resp => {
const query = { group: res.data.group, drawWay: true, mapId: resp.data.map.id, lineCode:resp.data.map.lineCode, projectDevice: this.$route.query.projectDevice };
if (this.$route.query.ibpDevice) {
query.ibpDevice = true;
if (this.syncLogin) {
query.type = this.$route.query.type;
}
console.log(res.data);
setSessionStorage('projectDevice', JSON.stringify(res.data.deviceVO));

View File

@ -44,6 +44,18 @@
</el-select>
</el-form-item>
</el-form>
<el-form v-show="data.type === 'ISCS_LW' || data.type === 'ISCS_CW'" ref="formIscs" :model="formIscs" label-width="100px" :rules="rulesIscs">
<el-form-item :label="data.type === 'ISCS_LW'?'现地工作站:': '行调工作站'" prop="deviceCode">
<el-select v-model="formIscs.deviceCode" placeholder="请选择" size="small">
<el-option
v-for="item in lwList"
:key="item.code"
:label="item.code"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
<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>
@ -52,7 +64,7 @@
</template>
<script>
import { getDeviceDetail, setIbpConfig, setLwConfig, getDevicesByType } from '@/api/project';
import { getDeviceDetail, setIbpConfig, setLwConfig, getDevicesByType, setIscsLwConfig, setIscsCwConfig } from '@/api/project';
import { getAllMapOnline, getStationListNeedAttendant } from '@/api/jmap/map';
export default {
@ -77,6 +89,9 @@ export default {
mapId: '',
stationCode: ''
},
formIscs: {
deviceCode: ''
},
rulesIbp: {
part: [
{ required: true, message: '请选择显示位置', trigger: 'change' }
@ -90,6 +105,11 @@ export default {
{ required: true, message: '请选择关联车站', trigger: 'change'}
]
},
rulesIscs: {
deviceCode: [
{ required: true, message: '请选择关联设备', trigger: 'change'}
]
},
partList: [{label: '左', value: 'LEFT'}, {label: '右', value: 'RIGHT'}, {label: '全部', value: 'WHOLE'}],
stationList: []
};
@ -106,6 +126,8 @@ export default {
this.formIbp = JSON.parse(resp.data.config);
} else if (resp.data.config && resp.data.type === 'LW') {
this.formLw = JSON.parse(resp.data.config);
} else if (resp.data.config && (resp.data.type === 'ISCS_LW' || resp.data.type === 'ISCS_CW')) {
this.formIscs = JSON.parse(resp.data.config);
}
}).catch(()=> {
this.$message.error('获取项目设备详情失败!');
@ -117,7 +139,7 @@ export default {
this.data = row;
this.mapList = [];
this.stationList = [];
if (this.data.type === 'IBP') {
if (this.data.type === 'IBP' || this.data.type === 'ISCS_LW') {
getDevicesByType('LW').then(res => {
if (res.data && res.data.length) {
this.lwList = res.data;
@ -125,6 +147,14 @@ export default {
}).catch(() => {
this.$message.error('获取设备列表失败!');
});
} else if (this.data.type === 'ISCS_CW') {
getDevicesByType('CW').then(res => {
if (res.data && res.data.length) {
this.lwList = res.data;
}
}).catch(() => {
this.$message.error('获取设备列表失败!');
});
} else {
getAllMapOnline().then(res => {
if (res.data && res.data.length) {
@ -161,13 +191,35 @@ export default {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
} else if (this.data.type === 'ISCS_LW') {
this.$refs.formIscs.validate(() => {
setIscsLwConfig(this.data.id, this.formIscs).then(response => {
self.$message.success('设置现地综合监控配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
} else if (this.data.type === 'ISCS_CW') {
this.$refs.formIscs.validate(() => {
setIscsCwConfig(this.data.id, this.formIscs).then(response => {
self.$message.success('设置中心综合监控配置成功');
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
});
});
}
},
handleClose() {
this.dialogVisible = false;
this.data = {};
this.lwList = [];
this.$refs.formIbp.resetFields();
this.$refs.formLw.resetFields();
this.$refs.formIscs.resetFields();
},
mapIdChange(mapId) {
if (mapId) {

View File

@ -175,7 +175,7 @@ export default {
});
},
editConfig(index, row) {
if (row.type === 'LW' || row.type === 'IBP') {
if (row.type === 'LW' || row.type === 'IBP' || row.type === 'ISCS_LW' || row.type === 'ISCS_CW') {
this.$refs.editConfig.doShow(row);
} else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD') {
this.$refs.editConfigGateway.doShow(row);
@ -190,13 +190,7 @@ export default {
},
getPath(index, row) {
let url = '';
if (row.type === 'IBP') {
url = `${window.location.protocol}//${window.location.host}/login?project=${this.projectCode.toLowerCase()}&projectDevice=${row.code}&ibpDevice=true`;
} else if (row.type == 'LSW') {
url = `${window.location.protocol}//${window.location.host}/login?project=${this.projectCode.toLowerCase()}&projectDevice=${row.code}&type=${row.type}&ibpDevice=true`;
} else {
url = `${window.location.protocol}//${window.location.host}/login?project=${this.projectCode.toLowerCase()}&projectDevice=${row.code}`;
}
url = `${window.location.protocol}//${window.location.host}/login?project=${this.projectCode.toLowerCase()}&projectDevice=${row.code}&type=${row.type}`;
this.url = url;
this.$messageBox();
this.$confirm(`登录路径:${url}`, '登录路径', {