代码调整
This commit is contained in:
parent
afa5a9aeab
commit
fb0d06a491
@ -135,6 +135,7 @@ const SimulationPlatform = () => import('@/views/trainingPlatform/simulation');
|
||||
|
||||
const PublishMap = () => import('@/views/publish/publishMap/index');
|
||||
const SubsystemManage = () => import('@/views/publish/publishMap/subsystem');
|
||||
const IscsDataManage = () => import('@/views/publish/publishMap/iscsDataManage');
|
||||
const PublishMapDetail = () => import('@/views/publish/publishMap/list'); // 发布历史
|
||||
const PublishLesson = () => import('@/views/publish/publishLesson/index');
|
||||
const RunPlanTemplate = () => import('@/views/publish/runPlanTemplate/index');
|
||||
@ -1942,6 +1943,11 @@ export const asyncRouter = [
|
||||
path: 'PublishMapDetail',
|
||||
component: PublishMapDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'iscsData',
|
||||
component: IscsDataManage,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -317,3 +317,57 @@ export const trainTypeList = [
|
||||
{name:'回送出入厂客车底列车', code:'BACK_FACTORY_PASSENGER_TRAIN' },
|
||||
{name:'因故折返旅客列车', code:'FAULT_TRUE_BACK_PASSENGER_TRAIN' }
|
||||
];
|
||||
export const iscsPositionMap = {
|
||||
LCD: '站厅',
|
||||
UP_STAND: '上行站台',
|
||||
DOWN_STAND: '下行站台',
|
||||
GATE: '出入口',
|
||||
OVERPASS1: '天桥1',
|
||||
OVERPASS2: '天桥2',
|
||||
PROPERTY: '物业',
|
||||
LED: 'LED',
|
||||
ADMINISTRATIVE_AREA: '办公区',
|
||||
TRANSFER_CHANNEL: '换乘通道'
|
||||
};
|
||||
export const iscsTypeMap = {
|
||||
AUDIO: '广播',
|
||||
LED: 'LED',
|
||||
LCD: 'LCD'
|
||||
};
|
||||
export const iscsPositionList = [
|
||||
{ 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' }
|
||||
];
|
||||
export const iscsTypeList = [
|
||||
{ label: '广播', value: 'AUDIO' },
|
||||
{ label: 'LED', value: 'LED' },
|
||||
{ label: 'LCD', value: 'LCD' }
|
||||
];
|
||||
export const iscsSystemMap = {
|
||||
PA: '广播系统',
|
||||
PIS: '乘客信息'
|
||||
};
|
||||
export const iscsSystemList = [
|
||||
{ value: 'PA', label: '广播信息' },
|
||||
{ value: 'PIS', label: '乘客信息' }
|
||||
];
|
||||
export const iscsResourcesTypeMap = {
|
||||
RECORDING: '预录',
|
||||
EMERGENCY_RECORDING: '紧急预录',
|
||||
BGM: '背景音乐',
|
||||
ATS: 'ATS预录'
|
||||
};
|
||||
export const iscsResourcesTypeList = [
|
||||
{ value: 'RECORDING', label: '预录' },
|
||||
{ value: 'EMERGENCY_RECORDING', label: '紧急预录' },
|
||||
{ value: 'BGM', label: '背景音乐' },
|
||||
{ value: 'ATS', label: 'ATS预录' }
|
||||
];
|
||||
|
216
src/views/publish/publishMap/addIscsDevice.vue
Normal file
216
src/views/publish/publishMap/addIscsDevice.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<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="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" 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 [];
|
||||
}
|
||||
},
|
||||
systemList: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
code: '',
|
||||
system: '',
|
||||
mapId: '',
|
||||
station: '',
|
||||
position: '',
|
||||
type: ''
|
||||
},
|
||||
stationList: [],
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
code: [
|
||||
{ required: true, message: '请输入设备code', trigger: 'blur' }
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: '请选择地图', trigger: 'change' }
|
||||
],
|
||||
system: [
|
||||
{ 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.system = data.system;
|
||||
this.formModel.code = data.code;
|
||||
this.formModel.station = data.station;
|
||||
this.formModel.position = data.position;
|
||||
this.formModel.type = data.type;
|
||||
}
|
||||
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 = {
|
||||
id: this.formModel.id,
|
||||
mapId: this.formModel.mapId,
|
||||
system: this.formModel.system,
|
||||
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: '',
|
||||
system: '',
|
||||
code: '',
|
||||
station: '',
|
||||
position: '',
|
||||
type: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
231
src/views/publish/publishMap/addIscsResources.vue
Normal file
231
src/views/publish/publishMap/addIscsResources.vue
Normal file
@ -0,0 +1,231 @@
|
||||
<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;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
});
|
||||
},
|
||||
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('修改ISCS资源数据成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
createIscsResources(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: '',
|
||||
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>
|
217
src/views/publish/publishMap/addVoice.vue
Normal file
217
src/views/publish/publishMap/addVoice.vue
Normal file
@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="580px" :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="18">
|
||||
<el-input v-model="formModel.url" :disabled="true" style="width: 340px;" />
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-upload
|
||||
ref="replaceUploader"
|
||||
v-model="newChapter.title"
|
||||
:file-list="replaceList"
|
||||
class="avatar-uploader"
|
||||
action="https://joylink.club/jlfile/api/upload/AUDIO?appId=00001&appSecret=joylink00001"
|
||||
:limit="1"
|
||||
:show-file-list="true"
|
||||
:on-remove="handleRemove"
|
||||
:on-success="handleReplaceAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</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 { createAudioResources, updateAudioResources} from '@/api/audioResources';
|
||||
export default {
|
||||
name: 'DeviceAdd',
|
||||
data() {
|
||||
return {
|
||||
replaceList: [],
|
||||
newChapter: { title: '' },
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
desc: '',
|
||||
url: ''
|
||||
},
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
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: {
|
||||
handleReplaceAvatarSuccess(response, file, fileList) {
|
||||
if (response.code == '200') {
|
||||
this.formModel.url = response.data;
|
||||
} else {
|
||||
this.$message.error('音频上传失败!');
|
||||
}
|
||||
},
|
||||
handleRemove() {
|
||||
this.formModel.url = '';
|
||||
},
|
||||
/**
|
||||
*上传文件限制--只能上传mp3格式的文件
|
||||
*/
|
||||
beforeAvatarUpload(file) {
|
||||
var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1);
|
||||
const extension = testmsg === 'mp3' || testmsg === 'wav';
|
||||
if (!extension) {
|
||||
this.$message({
|
||||
message:'上传文件只能是mp3格式!',
|
||||
type:'error'
|
||||
});
|
||||
}
|
||||
return extension;
|
||||
},
|
||||
|
||||
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();
|
||||
});
|
||||
}
|
||||
},
|
||||
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.$refs.ruleForm.resetFields();
|
||||
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>
|
178
src/views/publish/publishMap/batchAddIscsDevice.vue
Normal file
178
src/views/publish/publishMap/batchAddIscsDevice.vue
Normal 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 + '-' + this.formModel.system + '-' + 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>
|
148
src/views/publish/publishMap/generateVoice.vue
Normal file
148
src/views/publish/publishMap/generateVoice.vue
Normal file
@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="580px" :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>
|
||||
|
||||
<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 { generateAudio } from '@/api/audioResources';
|
||||
export default {
|
||||
name: 'Generate',
|
||||
data() {
|
||||
return {
|
||||
replaceList: [],
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
desc: ''
|
||||
},
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入音频资源名称', trigger: 'blur' }
|
||||
],
|
||||
desc: [
|
||||
{ required: true, message: '请输入音频资源描述', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '生成音频资源';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
handleRemove() {
|
||||
this.formModel.url = '';
|
||||
},
|
||||
|
||||
show() {
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
});
|
||||
},
|
||||
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
|
||||
};
|
||||
generateAudio(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: ''
|
||||
};
|
||||
this.$refs.ruleForm.resetFields();
|
||||
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>
|
@ -191,6 +191,10 @@ export default {
|
||||
name: '子系统管理',
|
||||
handleClick: this.subsystemManage,
|
||||
type: 'default'
|
||||
},
|
||||
{
|
||||
name: 'ISCS数据管理',
|
||||
handleClick: this.iscsDataManager
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -474,6 +478,9 @@ export default {
|
||||
subsystemManage(index, row) {
|
||||
this.$router.push({path:'/systemManagement/lineDataManage/subsystem', query: {mapId: row.id, lineCode: row.lineCode}});
|
||||
},
|
||||
iscsDataManager(index, row) {
|
||||
this.$router.push({path:'/systemManagement/lineDataManage/iscsData', query: {mapId: row.id, lineCode: row.lineCode}});
|
||||
},
|
||||
permissionCommit() {
|
||||
getPermissionQuickly(this.mapId, this.permissionNum).then(resp => {
|
||||
this.dialogVisible = false;
|
||||
|
425
src/views/publish/publishMap/iscsDataManage.vue
Normal file
425
src/views/publish/publishMap/iscsDataManage.vue
Normal file
@ -0,0 +1,425 @@
|
||||
<template>
|
||||
<div style="padding: 5px;">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="iscs系统设备" name="iscsDevice">
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="deviceQueryForm" :query-list="deviceQueryList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="iscs系统资源" name="iscsResource">
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="resourceQueryForm" :query-list="resourceQueryList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="音频资源管理" name="voiceResource">
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="voiceQueryForm" :query-list="voiceQueryList" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<add-resources
|
||||
ref="addResources"
|
||||
:map-list="mapList"
|
||||
:system-list="iscsSystemList"
|
||||
:type-list="iscsResourcesTypeList"
|
||||
@reloadTable="resourceReloadTable"
|
||||
/>
|
||||
<add-iscs-device
|
||||
ref="addDevice"
|
||||
:map-list="mapList"
|
||||
:position-list="iscsPositionList"
|
||||
:type-list="iscsTypeList"
|
||||
:system-list="iscsSystemList"
|
||||
@reloadTable="deviceReloadTable"
|
||||
/>
|
||||
<batch-add-iscs-device
|
||||
ref="batchAdd"
|
||||
:map-list="mapList"
|
||||
:position-list="iscsPositionList"
|
||||
:type-list="iscsTypeList"
|
||||
:system-list="iscsSystemList"
|
||||
@reloadTable="deviceReloadTable"
|
||||
/>
|
||||
<add-voice ref="addVoice" @reloadTable="voiceReloadTable" />
|
||||
<generate-voice ref="generateVoice" @reloadTable="voiceReloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { iscsPositionMap, iscsTypeMap, iscsPositionList, iscsTypeList, iscsSystemMap, iscsSystemList, iscsResourcesTypeMap, iscsResourcesTypeList } from '@/scripts/ConstDic';
|
||||
import { pagedIscsDevice, deleteIscsDevice, pagedIscsResources, deleteIscsResources } from '@/api/iscs';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import AddResources from './addIscsResources';
|
||||
import AddIscsDevice from './addIscsDevice';
|
||||
import BatchAddIscsDevice from './batchAddIscsDevice';
|
||||
import { pagedAudioResources, deleteAudioResources } from '@/api/audioResources';
|
||||
import AddVoice from './addVoice';
|
||||
import GenerateVoice from './generateVoice';
|
||||
export default {
|
||||
name: 'IscsDataManage',
|
||||
components: {
|
||||
AddResources,
|
||||
AddIscsDevice,
|
||||
BatchAddIscsDevice,
|
||||
AddVoice,
|
||||
GenerateVoice
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mapList: [],
|
||||
activeName: 'iscsDevice',
|
||||
iscsPositionList: iscsPositionList,
|
||||
iscsTypeList: iscsTypeList,
|
||||
iscsSystemList: iscsSystemList,
|
||||
iscsResourcesTypeList: iscsResourcesTypeList,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
deviceQueryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: '地图',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
code: {
|
||||
type: 'text',
|
||||
label: 'code'
|
||||
},
|
||||
system: {
|
||||
type: 'select',
|
||||
label: '系统',
|
||||
config: {
|
||||
data: iscsSystemList
|
||||
}
|
||||
},
|
||||
position: {
|
||||
type: 'select',
|
||||
label: '设备位置',
|
||||
config: {
|
||||
data: iscsPositionList
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '设备类型',
|
||||
config: {
|
||||
data: iscsTypeList
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
deviceQueryList: {
|
||||
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: 'system',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return iscsSystemMap[row.system]; },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '设备位置',
|
||||
prop: 'position',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return iscsPositionMap[row.position]; },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return iscsTypeMap[row.type]; },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '300',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handleDeleteDevice,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.add'), handler: this.createIscsDevice},
|
||||
{ text: '批量创建', handler: this.batchCrateIscsDevice }
|
||||
]
|
||||
},
|
||||
resourceQueryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: '地图',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
system: {
|
||||
type: 'select',
|
||||
label: '系统',
|
||||
config: {
|
||||
data: iscsSystemList
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '类型',
|
||||
config: {
|
||||
data: iscsResourcesTypeList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
resourceQueryList: {
|
||||
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 iscsSystemMap[row.system]; },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return iscsResourcesTypeMap[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.handleDeleteResources,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.add'), handler: this.createAudioResources}
|
||||
]
|
||||
},
|
||||
voiceQueryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名称:'
|
||||
},
|
||||
desc: {
|
||||
type: 'text',
|
||||
label: '描述'
|
||||
}
|
||||
}
|
||||
},
|
||||
voiceQueryList: {
|
||||
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.editVoiceConfig
|
||||
},
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handleDeleteVoice,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.add'), handler: this.createAudioResources},
|
||||
{ text: '生成', handler: this.generateAudioResources }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapListOnline().then(resp => {
|
||||
this.mapList = resp.data;
|
||||
const list = [];
|
||||
this.mapList.forEach(elem => {
|
||||
list.push({ label: elem.name, value: elem.id });
|
||||
});
|
||||
this.deviceQueryForm.queryObject.mapId.config.data = list;
|
||||
}).catch(() => {
|
||||
this.$message.error('获取地图列表失败!');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 删除
|
||||
handleDeleteDevice(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.deviceReloadTable();
|
||||
}).catch(() => {
|
||||
this.deviceReloadTable();
|
||||
this.$messageBox(this.$t('error.deleteFailed'));
|
||||
});
|
||||
});
|
||||
},
|
||||
getMapName(mapId) {
|
||||
const mapInfo = this.mapList.find(elem => elem.id == mapId);
|
||||
return mapInfo ? mapInfo.name : '';
|
||||
},
|
||||
getResources(resources) {
|
||||
const array = [];
|
||||
resources.forEach(elem => {
|
||||
array.push(elem.name);
|
||||
});
|
||||
return array;
|
||||
},
|
||||
createIscsDevice() {
|
||||
this.$refs.addDevice.show();
|
||||
},
|
||||
batchCrateIscsDevice() {
|
||||
this.$refs.batchAdd.show();
|
||||
},
|
||||
handleDeleteResources(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.resourceReloadTable();
|
||||
}).catch(() => {
|
||||
this.resourceReloadTable();
|
||||
this.$messageBox(this.$t('error.deleteFailed'));
|
||||
});
|
||||
});
|
||||
},
|
||||
createAudioResources() {
|
||||
this.$refs.addResources.show();
|
||||
},
|
||||
editConfig(index, row) {
|
||||
this.$refs.addResources.show(row);
|
||||
},
|
||||
resourceReloadTable() {
|
||||
this.resourceQueryList.reload();
|
||||
},
|
||||
deviceReloadTable() {
|
||||
this.deviceQueryList.reload();
|
||||
},
|
||||
voiceReloadTable() {
|
||||
this.voiceQueryList.reload();
|
||||
},
|
||||
handleTime(time) {
|
||||
const timeList = time.split('T');
|
||||
let newTime = '';
|
||||
if (timeList.length > 1) {
|
||||
newTime = timeList[0] + ' ' + timeList[1];
|
||||
} else {
|
||||
newTime = time;
|
||||
}
|
||||
return newTime;
|
||||
},
|
||||
// 删除
|
||||
handleDeleteVoice(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.voiceReloadTable();
|
||||
}).catch(() => {
|
||||
this.voiceReloadTable();
|
||||
this.$messageBox(this.$t('error.deleteFailed'));
|
||||
});
|
||||
});
|
||||
},
|
||||
editVoiceConfig(index, row) {
|
||||
this.$refs.addVoice.show(row);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user