iscs调整

This commit is contained in:
joylink_fanyuhong 2022-01-17 14:19:03 +08:00
parent 02a499a26c
commit e8fb8abcf2
5 changed files with 233 additions and 11 deletions

View File

@ -109,6 +109,14 @@ export function queryIscsDeviceCod(params) {
params
});
}
// 批量创建ISCS设备
export function batchCreateIscsDevcie(data) {
return request({
url: `/api/iscsDevice/create/batch`,
method: 'post',
data
});
}
// 创建ISCS系统资源
export function createIscsResources(data) {
return request({

View File

@ -40,7 +40,7 @@
</template>
<script>
import { uploadAudio, createAudioResources, updateAudioResources} from '@/api/audioResources';
import { createAudioResources, updateAudioResources} from '@/api/audioResources';
export default {
name: 'DeviceAdd',
data() {
@ -105,16 +105,17 @@ export default {
},
show(data) {
this.dialogVisible = true;
if (data) {
this.formModel.id = data.id;
this.formModel.name = data.name;
this.formModel.desc = data.desc;
this.formModel.url = data.url;
} else {
this.$nextTick(() => {
this.$refs.ruleForm.resetFields();
});
}
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs.ruleForm.resetFields();
});
},
doSave() {
this.$refs.ruleForm.validate((valid) => {
@ -155,6 +156,7 @@ export default {
desc: '',
url: ''
};
this.$refs.ruleForm.resetFields();
this.dialogVisible = false;
this.loading = false;
}

View File

@ -106,6 +106,7 @@ export default {
{name: '出入口', title: '全出入口', key: 'passageway', type: 'checkBox', active: false, position: 'GATE'},
{name: '换乘通道', title: '全换乘通道', key: 'channel', type: '', active: false, position: 'TRANSFER_CHANNEL'}
],
verticalIndexList: ['LCD', 'UP_STAND', 'DOWN_STAND', 'ADMINISTRATIVE_AREA', 'GATE', 'TRANSFER_CHANNEL'],
musicIcon: MusicIcon,
selectedAreaList: [],
stationList: [],
@ -170,10 +171,29 @@ export default {
audio.pause();
},
releaseBroadcast(voice) {
this.voiceUrl = this.$store.state.user.resourcesUrl + voice.url;
const audio = document.getElementById('voice');
audio.src = this.voiceUrl;
audio.play();
const operate = {
operation: '',
cmdType: 'ISCS_PA_Play',
over: true,
params: {
resourceId: voice.id,
iscsDeviceCodes: []
}
};
this.selectedAreaList.forEach(item => {
});
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.voiceUrl = this.$store.state.user.resourcesUrl + voice.url;
const audio = document.getElementById('voice');
audio.src = this.voiceUrl;
audio.play();
}
}).catch(() => {
this.$message.error('发布广播失败!');
});
},
clickArea(i, j) {
if (this.selectedAreaList.includes(i + '-' + j)) {

View File

@ -0,0 +1,178 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
<el-form-item label="地图" prop="mapId">
<el-select v-model="formModel.mapId" placeholder="请选择" @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="system">
<el-select v-model="formModel.system" placeholder="请选择">
<el-option
v-for="item in systemList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备位置" prop="position">
<el-select v-model="formModel.position" multiple placeholder="请选择">
<el-option
v-for="item in positionList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="type">
<el-select v-model="formModel.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { batchCreateIscsDevcie } from '@/api/iscs';
import { getStationList } from '@/api/runplan';
export default {
name: 'DeviceAdd',
props: {
mapList: {
type: Array,
default: function () {
return [];
}
},
positionList: {
type: Array,
default: function () {
return [];
}
},
typeList: {
type: Array,
default: function () {
return [];
}
},
systemList: {
type: Array,
default: function () {
return [];
}
}
},
data() {
return {
dialogVisible: false,
formModel: {
system: '',
mapId: '',
position: [],
type: ''
},
stationList: [],
loading: false
};
},
computed: {
rules() {
const crules = {
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' }
],
system: [
{ required: true, message: '请选择系统', trigger: 'change' }
],
position: [
{ required: true, message: '请选择设备位置', trigger: 'change' }
],
type: [
{ required: true, message: '请选择设备类型', trigger: 'change' }
]
};
return crules;
},
title() {
return '批量创建ISCS设备';
}
},
mounted() {
},
methods: {
show() {
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs.ruleForm.resetFields();
});
},
mapIdChange(value) {
getStationList(value).then(resp => {
this.stationList = resp.data;
}).catch(() => {
this.$message.error('获取车站列表失败!');
});
},
doSave() {
this.$refs.ruleForm.validate(() => {
this.loading = true;
const data = [];
this.stationList.forEach(station => {
if (!station.depot) {
this.formModel.position.forEach(item => {
data.push({
mapId: this.formModel.mapId,
system: this.formModel.system,
station: station.code,
code: station.code + item,
position: item,
type: this.formModel.type
});
});
}
});
batchCreateIscsDevcie(data).then(resp => {
this.$message.success('批量创建ISCS设备数据成功');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
});
},
handleClose() {
this.formModel = {
mapId: '',
system: '',
position: '',
type: ''
};
this.dialogVisible = false;
this.loading = false;
}
}
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -9,6 +9,14 @@
:system-list="systemList"
@reloadTable="reloadTable"
/>
<batch-add
ref="batchAdd"
:map-list="mapList"
:position-list="positionList"
:type-list="typeList"
:system-list="systemList"
@reloadTable="reloadTable"
/>
</div>
</template>
@ -16,6 +24,7 @@
import { pagedIscsDevice, deleteIscsDevice } from '@/api/iscs';
import { getPublishMapListOnline } from '@/api/jmap/map';
import AddDevice from './add';
import BatchAdd from './batchAdd';
const positionMap = {
LCD: '站厅',
UP_STAND: '上行站台',
@ -61,7 +70,8 @@ const systemList = [
export default {
name: 'DeviceManage',
components: {
AddDevice
AddDevice,
BatchAdd
},
data() {
return {
@ -172,7 +182,8 @@ export default {
}
],
actions: [
{ text: this.$t('global.add'), handler: this.createIscsDevice}
{ text: this.$t('global.add'), handler: this.createIscsDevice},
{ text: '批量创建', handler: this.batchCrateIscsDevice }
]
},
currentModel: {}
@ -196,6 +207,9 @@ export default {
createIscsDevice() {
this.$refs.addDevice.show();
},
batchCrateIscsDevice() {
this.$refs.batchAdd.show();
},
getMapName(mapId) {
const mapInfo = this.mapList.find(elem => elem.id == mapId);
return mapInfo ? mapInfo.name : '';