福州ISCS显示调整&音频资源管理&ISCS设备管理&ISCS资源管理

This commit is contained in:
joylink_fanyuhong 2022-01-13 16:08:23 +08:00
parent a6a9522cd4
commit b084600199
17 changed files with 1498 additions and 32 deletions

49
src/api/audioResources.js Normal file
View File

@ -0,0 +1,49 @@
import request from '@/utils/request';
// 创建音频资源
export function createAudioResources(data) {
return request({
url: `/api/audioResources`,
method: 'post',
data
});
}
// 查询所有音频资源
export function queryAllAudioResources() {
return request({
url: `/api/audioResources/list`,
method: 'get'
});
}
// 删除音频资源
export function deleteAudioResources(id) {
return request({
url: `/api/audioResources/${id}`,
method: 'delete'
});
}
// 更新音频资源
export function updateAudioResources(id, data) {
return request({
url: `/api/audioResources/${id}`,
method: 'put',
data
});
}
// 分页查询音频资源
export function pagedAudioResources(params) {
return request({
url: `/api/audioResources/paged`,
method: 'get',
params
});
}
// 上传音频文件
export function uploadAudio(file) {
return request({
url: `/api/upload/AUDIO?appId=00001&appSecret=joylink00001`,
method: 'post',
data: file,
upload: true
});
}

View File

@ -49,3 +49,86 @@ export function queryHasIscs(params) {
params
});
}
// iscs设备创建
export function createIscsDevcie(data) {
return request({
url: `/api/iscsDevice`,
method: 'post',
data
});
}
// 查询所有iscs设备
export function queryAllIscsDevice() {
return request({
url: `/api/iscsDevice/all`,
method: 'get'
});
}
// 根据id查询iscs设备
export function queryIscsDevcieById(id) {
return request({
url:
`/api/iscsDevice/${id}`,
method: 'get'
});
}
// 根据mapId获取Iscs设备list
export function queryIscsDeviceListByMapId(mapId) {
return request({
url: `/api/iscsDevice/list/mapId/${mapId}`,
method: 'get'
});
}
// 分页查询ISCS设备
export function pagedIscsDevice(params) {
return request({
url: `/api/iscsDevice/paged`,
method: 'get',
params
});
}
// 删除ISCS设备
export function deleteIscsDevice(id) {
return request({
url: `/api/iscsDevice/${id}`,
method: 'delete'
});
}
// 创建ISCS系统资源
export function createIscsResources(data) {
return request({
url: `/api/systemRes`,
method: 'post',
data
});
}
// 查询所有ISCS系统资源
export function queryAllIscsResources() {
return request({
url: `/api/systemRes/all`,
method: 'get'
});
}
// 根据id查询ISCS系统资源
export function queryIscsResourcesById(id) {
return request({
url: `/api/systemRes/${id}`,
method: 'get'
});
}
// 分页查询ISCS系统资源
export function pagedIscsResources(params) {
return request({
url: `/api/systemRes/paged`,
method: 'get',
params
});
}
// 删除ISCS系统资源
export function deleteIscsResources(id) {
return request({
url: `/api/systemRes/${id}`,
method: 'delete'
});
}

View File

@ -100,5 +100,8 @@ export default {
voiceTraining: 'Voice Training',
mapGroup: 'Map Group',
drawingMange:'Drawing Mange',
projectServer: 'Project Server'
projectServer: 'Project Server',
audioResourcesManage: 'Audio Resources Manage',
iscsDeviceManage: 'ISCS Device Manage',
iscsResourcesManage: 'ISCS Resources Manage'
};

View File

@ -104,5 +104,8 @@ export default {
voiceTraining: '语音训练',
mapGroup: '地图分组',
drawingMange:'图纸管理',
projectServer: '项目域名'
projectServer: '项目域名',
audioResourcesManage: '音频资源管理',
iscsDeviceManage: 'ISCS设备管理',
iscsResourcesManage: 'ISCS资源管理'
};

View File

@ -192,6 +192,9 @@ const UploadPdfList = () => import('@/views/uploadPdf/list');
const ThirdLogin = () => import('@/views/thirdLogin');
const ProjectServer = () => import('@/views/system/serverManage');
const VoiceManage = () => import('@/views/fileManage/voiceManage');
const IscsDeviceManage = () => import('@/views/system/iscsDeviceManage');
const IscsResourcesManage = () => import('@/views/system/iscsResourcesManage');
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth';
@ -1210,6 +1213,20 @@ export const asyncRouter = [
meta: {
i18n: 'router.projectServer'
}
},
{
path: 'iscsDeviceManage',
component: IscsDeviceManage,
meta: {
i18n: 'router.iscsDeviceManage'
}
},
{
path: 'iscsResourcesManage',
component: IscsResourcesManage,
meta: {
i18n: 'router.iscsResourcesManage'
}
}
// {
// path: 'deviceManage',
@ -1255,6 +1272,13 @@ export const asyncRouter = [
meta: {
i18n: 'router.uploadPdf'
}
},
{
path: 'audioResources',
component: VoiceManage,
meta: {
i18n: 'router.audioResourcesManage'
}
}
]
},

View File

@ -25,7 +25,7 @@ export function handlerUrl(data) {
if (process.env.NODE_ENV === 'development') {
// const data = null;
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪
// BASE_API = 'http://192.168.8.172:9200'; // 旭强

View File

@ -29,6 +29,9 @@ service.interceptors.request.use(config => {
if (store.state.user.baseUrl) {
config.baseURL = store.state.user.baseUrl;
}
if (config.upload) {
config.baseURL = urlData.UPLOAD_API;
}
if (config.time) {
config.timeout = config.time; // 让每个请求携带自定义token 请根据实际情况自行修改

View File

@ -0,0 +1,281 @@
<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="60px">
<el-form-item label="名称" prop="name">
<el-input v-model="formModel.name" />
</el-form-item>
<el-form-item label="描述" prop="desc">
<el-input v-model="formModel.desc" />
</el-form-item>
<el-form-item label="url" prop="url">
<el-row>
<el-col :span="20">
<el-input v-model="formModel.url" :disabled="true" style="width: 380px;" />
</el-col>
<el-col :span="4">
<el-button class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" size="mini" type="primary" @click="startRecording()">
<el-progress id="record_progress_bar" type="circle" :show-text="false" :percentage="100/60*seconds" :width="40" :stroke-width="2" status="success" />
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancleRecording()" />
<span class="iconfont icon-yuyin">&#xe62b;</span>
</el-button>
</el-col>
</el-row>
</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 { uploadAudio, createAudioResources, updateAudioResources} from '@/api/audioResources';
import RecordRTC from 'recordrtc';
export default {
name: 'DeviceAdd',
data() {
return {
dialogVisible: false,
formModel: {
id: '',
name: '',
desc: '',
url: ''
},
loading: false,
seconds: 0,
recordSending: false,
recorders: null,
microphone:null
};
},
computed: {
rules() {
const crules = {
name: [
{ required: true, message: '请输入音频资源名称', trigger: 'blur' }
],
desc: [
{ required: true, message: '请输入音频资源描述', trigger: 'blur' }
],
url: [
{ required: true, message: '请录入音频资源', trigger: 'blur' }
]
};
return crules;
},
title() {
return this.formModel.id ? '修改音频资源' : '创建音频资源';
}
},
mounted() {
},
methods: {
show(data) {
if (data) {
this.formModel.id = data.id;
this.formModel.name = data.name;
this.formModel.desc = data.desc;
this.formModel.url = data.url;
}
this.dialogVisible = true;
},
doSave() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.loading = true;
const data = {
id: this.formModel.id,
name: this.formModel.name,
desc: this.formModel.desc,
url: this.formModel.url
};
if (data.id) {
updateAudioResources(data.id, data).then(resp => {
this.$message.success('修改音频资源数据成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
createAudioResources(data).then(resp => {
this.$message.success('创建音频资源数据成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
}
}
});
},
handleClose() {
this.formModel = {
id: '',
name: '',
desc: '',
url: ''
};
this.dialogVisible = false;
this.loading = false;
},
cancleRecording() {
if (this.microphone) {
clearInterval(this.inter);
this.seconds = 0;
this.microphone.stop();
this.microphone = null;
this.recordSending = false;
this.recorders = null;
}
},
startRecording() {
const that = this;
if (!this.recordSending) {
if (!this.recordSending && !this.recorders && !this.microphone) {
const StereoAudioRecorder = RecordRTC.StereoAudioRecorder;
navigator.getUserMedia({ audio: true }, function (stream) {
that.microphone = stream;
that.recorders = new RecordRTC(that.microphone, {
type: 'audio',
recorderType: StereoAudioRecorder,
numberOfAudioChannels: 1,
bitsPerSecond:256000,
desiredSampRate: 16000
});
that.recorders.startRecording();
that.recordSending = true;
that.inter = setInterval(() => {
if (that.seconds < 60) {
that.seconds++;
} else {
clearInterval(that.inter);
that.stopRecording();
}
}, 1000);
}, function (error) {
switch (error.code || error.name) {
case 'PERMISSION_DENIED':
case 'PermissionDeniedError':
that.$message({
showClose: true,
message: '用户拒绝提供信息',
type: 'error'
});
break;
case 'NOT_SUPPORTED_ERROR':
case 'NotSupportedError':
that.$message({
showClose: true,
message: '浏览器不支持硬件设备',
type: 'error'
});
break;
case 'MANDATORY_UNSATISFIED_ERROR':
case 'MandatoryUnsatisfiedError':
that.$message({
showClose: true,
message: '无法发现指定的硬件设备',
type: 'error'
});
break;
default:
that.$message({
showClose: true,
message: '无法打开麦克风',
type: 'error'
});
break;
}
}
);
}
} else {
this.stopRecording(); //
}
},
//
stopRecording() {
const that = this;
this.recorders.stopRecording(function(blobURL) {
clearInterval(that.inter);
that.seconds = 0;
const blob = that.recorders.getBlob();
const fd = new FormData();
fd.append('file', blob);
uploadAudio(fd)
.then((resp) => {
that.formModel.url = resp.data;
})
.catch(error => {
console.log(error);
that.$message.error('语音发送失败: ' + error.message);
});
if (that.microphone) {
that.microphone.stop();
that.microphone = null;
that.recordSending = false;
that.recorders = null;
}
});
}
}
};
</script>
<style lang="scss" scoped>
.chat-box-footer-create{
font-size: 16px;
text-align: center;
color: #fff;
position: relative;
left: 5px;
top: 6px;
line-height: 30px;
cursor: pointer;
width: 40px;
height: 40px;
border-radius: 50%;
background: green;
border: none;
display: flex;
justify-content: center;
align-items: center;
}
.chat-box-footer-send{
background: #F2F2F2;
right: 55px;
cursor: pointer;
.icon-yuyin{
color: #333;
font-size: 24px;
margin: 0;
}
&.active{
.icon-yuyin{
color: green;
}
}
.close_icon{
position: absolute;
top: 8px;
left: 45px;
font-size: 16px;
color: #333;
font-weight: 600;
padding: 3px;
}
}
#record_progress_bar{
width: 40px;
height: 40px;
position: absolute;
left: 0;
top: 0;
border-radius: 50%;
}
</style>

View File

@ -0,0 +1,131 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<add-voice ref="addVoice" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { pagedAudioResources, deleteAudioResources } from '@/api/audioResources';
import AddVoice from './add';
export default {
name: 'DeviceManage',
components: {
AddVoice
},
data() {
return {
examResultList: [],
url: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
reset: true,
queryObject: {
name: {
type: 'text',
label: '名称:'
},
desc: {
type: 'text',
label: '描述'
}
}
},
queryList: {
query: pagedAudioResources,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '名称',
prop: 'name'
},
{
title: '描述',
prop: 'desc'
},
{
title: 'url',
prop: 'url'
},
{
title: '创建时间',
prop: 'createTime',
type: 'tag',
columnValue: (row) => { return this.handleTime(row.createTime); },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '300',
buttons: [
{
name: '编辑',
handleClick: this.editConfig
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.createAudioResources}
]
},
currentModel: {}
};
},
computed: {
},
mounted() {
},
methods: {
createProjectDevice() {
this.$refs.add.show();
},
handleTime(time) {
const timeList = time.split('T');
let newTime = '';
if (timeList.length > 1) {
newTime = timeList[0] + ' ' + timeList[1];
} else {
newTime = time;
}
return newTime;
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除该音频资源数据!', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteAudioResources(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
createAudioResources() {
this.$refs.addVoice.show();
},
editConfig(index, row) {
this.$refs.addVoice.show(row);
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div style="height: 100%; overflow-y: auto;">
<center-home v-if="currentSystem === 'center'" />
<station-home v-else-if="currentSystem === 'local'" />
<center-home v-if="currentSystem === 'center' || stationId === 'controlCenter'" />
<station-home v-else-if="currentSystem === 'local' || stationId" />
</div>
</template>
@ -16,16 +16,19 @@ export default {
},
data() {
return {
currentSystem: ''
currentSystem: '',
stationId: ''
};
},
watch:{
$route() {
this.currentSystem = this.$route.query.currentSystem;
this.stationId = this.$route.query.stationId;
}
},
mounted() {
this.currentSystem = this.$route.query.currentSystem;
this.stationId = this.$route.query.stationId;
}
};
</script>

View File

@ -7,6 +7,13 @@
<fas v-else-if="fasList.includes(mode)" />
<signal-system v-else-if="mode === 'signal'" />
<ticket-or-entrance v-else-if="mode === 'autoTicket'||mode === 'afcTwo02'||mode === 'afcOne02'" />
<broadcast-home v-else-if="mode === 'paMain'" />
<radio-listening-pa v-else-if="mode === 'paMonitor'" />
<time-preview-pa v-else-if="mode === 'paPreview'" />
<pids-emergency v-else-if="mode === 'pidsEmergency'" />
<pids-lcd v-else-if="mode === 'pidsLcd'" />
<pids-main v-else-if="mode === 'pidsMain'" />
<pids-preview v-else-if="mode === 'pidsPreview'" />
</div>
</template>
<script>
@ -17,6 +24,13 @@ import Schedule from './schedule';
import Fas from './fas/index.vue';
import SignalSystem from './signalSystem/index.vue';
import TicketOrEntrance from './ticketOrEntrance/index';
import BroadcastHome from '../config/broadcast/homeScreen';
import RadioListeningPa from '../config/pa/radioListeningPA';
import TimePreviewPa from '../config/pa/timePreviewPA';
import PidsEmergency from '../config/pis/emergencyRelease';
import PidsMain from '../config/pis/mainScreen';
import PidsPreview from '../config/pis/timePreview';
import PidsLcd from '../config/pis/lcdControl';
import { getSimulationInfoNew } from '@/api/simulation';
import { getByGroupStationList } from '@/api/jmap/map';
import { loadRunPlanData } from '@/utils/loaddata';
@ -28,7 +42,14 @@ export default {
Normal,
SignalSystem,
Fas,
TicketOrEntrance
TicketOrEntrance,
BroadcastHome,
RadioListeningPa,
TimePreviewPa,
PidsEmergency,
PidsMain,
PidsPreview,
PidsLcd
},
data() {
return {

View File

@ -282,28 +282,58 @@ export default {
type: 'interface',
disabled: true
}
]}
// communication:{name:'', type:'totalSystem', id: 'communication', active:false, icon:iscs_icon7,
// children:[
// {
// name: '',
// mode: 'pids',
// id: 'pids',
// type: 'interface'
// },
// {
// name: '广',
// mode: 'broadcastingSystem',
// id: 'broadcastingSystem',
// type: 'interface'
// },
]},
communication:{name:'通信', type:'totalSystem', id: 'communication', active:false, icon:iscs_icon7,
children:[
{
name: '乘客信息-主画面',
mode: 'pidsMain',
id: 'pidsMain',
type: 'interface'
},
{
name: '乘客信息-LCD控制屏',
mode: 'pidsLcd',
id: 'pidsLcd',
type: 'interface'
},
{
name: '乘客信息-计时一览',
mode: 'pidsPreview',
id: 'pidsPreview',
type: 'interface'
},
{
name: '乘客信息-紧急发布一览',
mode: 'pidsEmergency',
id: 'pidsEmergency',
type: 'interface'
},
{
name: '广播系统-主画面',
mode: 'paMain',
id: 'paMain',
type: 'interface'
},
{
name: '广播系统-广播监听',
mode: 'paMonitor',
id: 'paMonitor',
type: 'interface'
},
{
name: '广播系统-计时一览',
mode: 'paPreview',
id: 'paPreview',
type: 'interface'
}
// {
// name: '',
// mode: 'cctv',
// id: 'cctv',
// type: 'interface'
// }
// ]}
]}
},
public:{name:'公共设施', type:'totalSystem', id: 'public', active:false, icon:iscs_icon8 },
manage:{name:'管理', type:'totalSystem', id: 'manage', active:false, icon:iscs_icon9 }

View File

@ -0,0 +1,190 @@
<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="code" prop="code">
<el-input v-model="formModel.code" style="width: 200px;" />
</el-form-item>
<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="station">
<el-select v-model="formModel.station" placeholder="请选择">
<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="position">
<el-select v-model="formModel.position" 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 { createIscsDevcie, updateIscsDevice } 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 [];
}
}
},
data() {
return {
dialogVisible: false,
formModel: {
id: '',
code: '',
mapId: '',
station: '',
position: '',
type: ''
},
stationList: [],
loading: false
};
},
computed: {
rules() {
const crules = {
code: [
{ required: true, message: '请输入设备code', trigger: 'blur' }
],
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' }
],
station: [
{ required: true, message: '请选择车站', trigger: 'change' }
],
position: [
{ required: true, message: '请选择设备位置', trigger: 'change' }
],
type: [
{ required: true, message: '请选择设备类型', trigger: 'change' }
]
};
return crules;
},
title() {
return this.formModel.id ? '修改ISCS设备' : '创建ISCS设备';
}
},
mounted() {
},
methods: {
show(data) {
if (data) {
this.formModel.id = data.id;
this.formModel.mapId = data.mapId;
this.formModel.code = data.code;
this.formModel.station = data.station;
this.formModel.position = data.position;
this.formModel.type = data.type;
}
this.dialogVisible = true;
},
mapIdChange(value) {
getStationList(value).then(resp => {
this.stationList = resp.data;
}).catch(() => {
this.$message.error('获取车站列表失败!');
});
},
doSave() {
this.$refs.ruleForm.validate(() => {
this.loading = true;
const data = {
id: this.formModel.id,
mapId: this.formModel.mapId,
code: this.formModel.code,
station: this.formModel.station,
position: this.formModel.position,
type: this.formModel.type
};
if (data.id) {
updateIscsDevice(data.id, data).then(resp => {
this.$message.success('修改ISCS设备数据成功');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
createIscsDevcie(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 = {
id: '',
mapId: '',
code: '',
station: '',
position: '',
type: ''
};
this.dialogVisible = false;
this.loading = false;
}
}
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,216 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<add-device
ref="addDevice"
:map-list="mapList"
:position-list="positionList"
:type-list="typeList"
@reloadTable="reloadTable"
/>
</div>
</template>
<script>
import { pagedIscsDevice, deleteIscsDevice } from '@/api/iscs';
import { getPublishMapListOnline } from '@/api/jmap/map';
import AddDevice from './add';
const positionMap = {
LCD: '站厅',
UP_STAND: '上行站台',
DOWN_STAND: '下行站台',
GATE: '出入口',
OVERPASS1: '天桥1',
OVERPASS2: '天桥2',
PROPERTY: '物业',
LED: 'LED',
ADMINISTRATIVE_AREA: '办公区',
TRANSFER_CHANNEL: '换乘通道'
};
const typeMap = {
AUDIO: '广播',
LED: 'LED',
LCD: 'LCD'
};
const positionList = [
{ label: '站厅', value: 'LCD' },
{ label: '上行站台', value: 'UP_STAND' },
{ label: '下行站台', value: 'DOWN_STAND' },
{ label: '出入口', value: 'GATE' },
{ label: '天桥1', value: 'OVERPASS1' },
{ label: '天桥2', value: 'OVERPASS2' },
{ label: '物业', value: 'PROPERTY' },
{ label: 'LED', value: 'LED' },
{ label: '办公区', value: 'ADMINISTRATIVE_AREA' },
{ label: '换乘通道', value: 'TRANSFER_CHANNEL' }
];
const typeList = [
{ label: '广播', value: 'AUDIO' },
{ label: 'LED', value: 'LED' },
{ label: 'LCD', value: 'LCD' }
];
export default {
name: 'DeviceManage',
components: {
AddDevice
},
data() {
return {
examResultList: [],
mapList: [],
positionList: positionList,
typeList: typeList,
url: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: '地图',
config: {
data: []
}
},
code: {
type: 'text',
label: 'code'
},
position: {
type: 'select',
label: '设备位置',
config: {
data: positionList
}
},
type: {
type: 'select',
label: '设备类型',
config: {
data: typeList
}
}
}
},
queryList: {
query: pagedIscsDevice,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: 'code',
prop: 'code'
},
{
title: '地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => { return this.getMapName(row.mapId); },
tagType: (row) => { return 'success'; }
},
{
title: '车站编号',
prop: 'station'
},
{
title: '设备位置',
prop: 'position',
type: 'tag',
columnValue: (row) => { return positionMap[row.position]; },
tagType: (row) => { return 'success'; }
},
{
title: '设备类型',
prop: 'type',
type: 'tag',
columnValue: (row) => { return typeMap[row.type]; },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '300',
buttons: [
// {
// name: '',
// handleClick: this.editConfig
// },
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.createIscsDevice}
]
},
currentModel: {}
};
},
computed: {
},
mounted() {
getPublishMapListOnline().then(resp => {
this.mapList = resp.data;
const list = [];
this.mapList.forEach(elem => {
list.push({ label: elem.name, value: elem.id });
});
this.queryForm.queryObject.mapId.config.data = list;
}).catch(() => {
this.$message.error('获取地图列表失败!');
});
},
methods: {
createIscsDevice() {
this.$refs.addDevice.show();
},
getMapName(mapId) {
const mapInfo = this.mapList.find(elem => elem.id == mapId);
return mapInfo ? mapInfo.name : '';
},
handleTime(time) {
const timeList = time.split('T');
let newTime = '';
if (timeList.length > 1) {
newTime = timeList[0] + ' ' + timeList[1];
} else {
newTime = time;
}
return newTime;
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除该ISCS设备数据', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteIscsDevice(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
createAudioResources() {
this.$refs.addDevice.show();
},
// editConfig(index, row) {
// this.$refs.addDevice.show(row);
// },
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -0,0 +1,228 @@
<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="请选择">
<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="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-item label="音频资源" prop="resourceIds">
<el-select v-model="formModel.resourceIds" multiple placeholder="请选择">
<el-option
v-for="item in audioResourcesList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</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 { createIscsResources, updateIscsResources } from '@/api/iscs';
import { queryAllAudioResources } from '@/api/audioResources';
export default {
name: 'DeviceAdd',
props: {
mapList: {
type: Array,
default: function () {
return [];
}
},
systemList: {
type: Array,
default: function () {
return [];
}
},
typeList: {
type: Array,
default: function () {
return [];
}
}
},
data() {
return {
dialogVisible: false,
formModel: {
id: '',
mapId: '',
type: '',
system: '',
resourceIds: []
},
audioResourcesList: [],
loading: false
};
},
computed: {
rules() {
const crules = {
mapId: [
{ required: true, message: '请选择地图', trigger: 'change' }
],
system: [
{ required: true, message: '请选择系统', trigger: 'change' }
],
type: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
resourceIds: [
{ required: true, message: '请选择资源', trigger: 'change' }
]
};
return crules;
},
title() {
return this.formModel.id ? '修改ISCS资源' : '创建ISCS资源';
}
},
mounted() {
queryAllAudioResources().then(resp => {
this.audioResourcesList = resp.data;
}).catch(() => {
this.$message.error('获取音频资源列表失败!');
});
},
methods: {
show(data) {
if (data) {
this.formModel.id = data.id;
this.formModel.mapId = data.mapId;
this.formModel.system = data.system;
this.formModel.type = data.type;
this.formModel.resourceIds = data.resourceIds;
}
this.dialogVisible = true;
},
doSave() {
this.$refs.ruleForm.validate(() => {
this.loading = true;
const data = {
id: this.formModel.id,
mapId: this.formModel.mapId,
system: this.formModel.system,
type: this.formModel.type,
resourceIds: this.formModel.resourceIds
};
if (data.id) {
updateIscsResources(data.id, data).then(resp => {
this.$message.success('修改项目域名数据成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
createIscsResources(data).then(resp => {
this.$message.success('创建项目域名数据成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
}
});
},
handleClose() {
this.formModel = {
id: '',
mapId: '',
system: '',
type: '',
resourceIds: []
};
this.dialogVisible = false;
this.loading = false;
}
}
};
</script>
<style lang="scss" scoped>
.chat-box-footer-create{
font-size: 16px;
text-align: center;
color: #fff;
position: relative;
left: 5px;
top: 6px;
line-height: 30px;
cursor: pointer;
width: 40px;
height: 40px;
border-radius: 50%;
background: green;
border: none;
display: flex;
justify-content: center;
align-items: center;
}
.chat-box-footer-send{
background: #F2F2F2;
right: 55px;
cursor: pointer;
.icon-yuyin{
color: #333;
font-size: 24px;
margin: 0;
}
&.active{
.icon-yuyin{
color: green;
}
}
.close_icon{
position: absolute;
top: 8px;
left: 45px;
font-size: 16px;
color: #333;
font-weight: 600;
padding: 3px;
}
}
#record_progress_bar{
width: 40px;
height: 40px;
position: absolute;
left: 0;
top: 0;
border-radius: 50%;
}
</style>

View File

@ -0,0 +1,201 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<add-resources
ref="addResources"
:map-list="mapList"
:system-list="systemList"
:type-list="typeList"
@reloadTable="reloadTable"
/>
</div>
</template>
<script>
import { pagedIscsResources, deleteIscsResources } from '@/api/iscs';
import AddResources from './add';
import { getPublishMapListOnline } from '@/api/jmap/map';
const systemMap = {
PA: '广播系统',
PIS: '乘客信息'
};
const systemList = [
{ value: 'PA', label: '广播信息' },
{ value: 'PIS', label: '乘客信息' }
];
const typeMap = {
RECORDING: '预录',
EMERGENCY_RECORDING: '紧急预录'
};
const typeList = [
{ value: 'RECORDING', label: '预录' },
{ value: 'EMERGENCY_RECORDING', label: '紧急预录' }
];
export default {
name: 'DeviceManage',
components: {
AddResources
},
data() {
return {
examResultList: [],
systemList: systemList,
typeList: typeList,
url: '',
mapList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
reset: true,
queryObject: {
mapId: {
type: 'select',
label: '地图',
config: {
data: []
}
},
system: {
type: 'select',
label: '系统',
config: {
data: systemList
}
},
type: {
type: 'select',
label: '类型',
config: {
data: typeList
}
}
}
},
queryList: {
query: pagedIscsResources,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => { return this.getMapName(row.mapId); },
tagType: (row) => { return 'success'; }
},
{
title: '系统',
prop: 'system',
type: 'tag',
columnValue: (row) => { return systemMap[row.system]; },
tagType: (row) => { return 'success'; }
},
{
title: '类型',
prop: 'type',
type: 'tag',
columnValue: (row) => { return typeMap[row.type]; },
tagType: (row) => { return 'success'; }
},
{
title: '资源',
prop: 'resources',
type: 'tagMore',
columnValue: (row) => { return this.getResources(row.resources); },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '300',
buttons: [
// {
// name: '',
// handleClick: this.editConfig
// },
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.createAudioResources}
]
},
currentModel: {}
};
},
computed: {
},
mounted() {
getPublishMapListOnline().then(resp => {
this.mapList = resp.data;
const list = [];
this.mapList.forEach(elem => {
list.push({ label: elem.name, value: elem.id });
});
this.queryForm.queryObject.mapId.config.data = list;
}).catch(() => {
this.$message.error('获取地图列表失败!');
});
},
methods: {
createProjectDevice() {
this.$refs.addResources.show();
},
getMapName(mapId) {
const mapInfo = this.mapList.find(elem => elem.id == mapId);
return mapInfo ? mapInfo.name : '';
},
handleTime(time) {
const timeList = time.split('T');
let newTime = '';
if (timeList.length > 1) {
newTime = timeList[0] + ' ' + timeList[1];
} else {
newTime = time;
}
return newTime;
},
getResources(resources) {
const array = [];
resources.forEach(elem => {
array.push(elem.name);
});
return array;
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除该ISCS资源数据', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteIscsResources(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
createAudioResources() {
this.$refs.addResources.show();
},
editConfig(index, row) {
this.$refs.addResources.show(row);
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>