调整配置项
This commit is contained in:
parent
e0eb8f30dc
commit
6b0d31dbbc
@ -99,3 +99,21 @@ export function getDevicesByType(type) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加/修改大屏工作站配置 */
|
||||
export function setLswConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/lsw`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 添加/修改CCTV工作站配置 */
|
||||
export function setCctvConfig(id, data) {
|
||||
return request({
|
||||
url: `/api/device/${id}/config/cctv`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb',
|
||||
export const CaseHideProjectList = ['hyd', 'designhyd']; // 案例展示隐藏的项目
|
||||
export const VersionBaseNoShow = ['hyd', 'designhyd']; // 登录页右下角版本开发基于不展示
|
||||
export const MainBodyNoShow = ['hyd', 'designhyd', 'jyd', 'designjyd', 'tky', 'designtky']; // 登录页右下角主体不展示
|
||||
export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'jsxt', 'refereeJsxt', 'jyd', 'designjyd', 'tky', 'designtky'];// 需要在公共路由中生成登录页面的项目&登录页样式
|
||||
export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目&登录页样式
|
||||
export const goOtherPlatformMenu = { // 导航栏快速切换平台
|
||||
login: '/design/login',
|
||||
design: '/login',
|
||||
|
@ -2,9 +2,9 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
|
@ -27,6 +27,7 @@ import { EventBus } from '@/scripts/event-bus';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'MapPreview',
|
||||
@ -90,6 +91,12 @@ export default {
|
||||
if (this.$route.path.includes('design/bigScreen')) {
|
||||
this.disPlay = false;
|
||||
}
|
||||
if (this.$route.query.projectDevice) {
|
||||
this.disPlay = false;
|
||||
const data = JSON.parse(JSON.parse(getSessionStorage('projectDevice')).config);
|
||||
console.log(data, data.quadrant);
|
||||
this.changeSplit(data.quadrant);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadData() { // 加载地图数据
|
||||
|
@ -398,7 +398,14 @@ export default {
|
||||
if (this.$route.query.ibpDevice) {
|
||||
query.ibpDevice = true;
|
||||
}
|
||||
console.log(res.data);
|
||||
setSessionStorage('projectDevice', JSON.stringify(res.data.deviceVO));
|
||||
if (this.$route.query.type == 'LSW') {
|
||||
console.log('进入', `/bigSplitScreen/${resp.data.map.id}`);
|
||||
this.$router.push({ path: `/bigSplitScreen/${resp.data.map.id}`, query: query });
|
||||
} else {
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (!this.$route.path.includes('jsxt/login') && !this.$route.path.includes('refereeJsxt/login')) {
|
||||
|
@ -349,9 +349,9 @@ export default {
|
||||
}
|
||||
},
|
||||
async initDeviceVo() {
|
||||
getLoginInfo(getToken()).then(resp => {
|
||||
this.$store.dispatch('SetProjecteDevice', resp.data.deviceVO);
|
||||
});
|
||||
// getLoginInfo(getToken()).then(resp => {
|
||||
// this.$store.dispatch('SetProjecteDevice', resp.data.deviceVO);
|
||||
// });
|
||||
},
|
||||
initMemberUserInfo() {
|
||||
getSimulationMemberList(this.$route.query.group).then(resp => {
|
||||
|
132
src/views/system/deviceManage/editConfigScreen.vue
Normal file
132
src/views/system/deviceManage/editConfigScreen.vue
Normal file
@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="formData" label-width="100px" :rules="rules">
|
||||
<el-form-item label="教员机:" prop="deviceCode">
|
||||
<el-select v-model="formData.deviceCode" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.code"
|
||||
:label="item.code"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="data.type === 'LSW'" label="屏目配置:" prop="quadrant" size="small">
|
||||
<el-select v-model="formData.quadrant" placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in screenList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</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>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDevicesByType, getDeviceDetail, setLswConfig, setCctvConfig } from '@/api/project';
|
||||
|
||||
export default {
|
||||
name: 'EditConfig',
|
||||
props: {
|
||||
// type: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
data: {},
|
||||
screenList: [
|
||||
{ label: '第一屏', value: 1 },
|
||||
{ label: '第二屏', value: 2 },
|
||||
{ label: '第三屏', value: 3 },
|
||||
{ label: '第四屏', value: 4 }
|
||||
],
|
||||
deviceList: [],
|
||||
formData: {
|
||||
quadrant: '',
|
||||
deviceCode: ''
|
||||
},
|
||||
rules: {
|
||||
quadrant: [
|
||||
{ required: true, message: '请选择显示屏幕', trigger: 'change' }
|
||||
],
|
||||
deviceCode: [
|
||||
{ required: true, message: '请选择教员机', trigger: 'change'}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '编辑设备配置';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initData(row) {
|
||||
getDevicesByType('IM').then(resp => {
|
||||
this.deviceList = resp.data;
|
||||
}).catch(()=> {
|
||||
this.$message.error('获取项目设备详情失败!');
|
||||
});
|
||||
},
|
||||
doShow(row) {
|
||||
this.initData(row);
|
||||
this.dialogVisible = true;
|
||||
this.data = row;
|
||||
getDeviceDetail(this.data.id).then(res => {
|
||||
const data = res.data.config ? JSON.parse(res.data.config) : {};
|
||||
this.formData = {
|
||||
quadrant: data.quadrant,
|
||||
deviceCode: data.deviceCode
|
||||
};
|
||||
});
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
if (this.data.type == 'LSW') {
|
||||
this.$refs.form.validate(() => {
|
||||
const param = {
|
||||
deviceCode: this.formData.deviceCode,
|
||||
quadrant: this.formData.quadrant
|
||||
};
|
||||
setLswConfig(this.data.id, param).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 == 'CCTV') {
|
||||
this.$refs.form.validate(() => {
|
||||
const param = {
|
||||
deviceCode: this.formData.deviceCode
|
||||
};
|
||||
setCctvConfig(this.data.id, param).then(response => {
|
||||
self.$message.success('设置CCTV工作站配置成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error(this.$t('tip.modifyTheFailure') + error.message);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.data = {};
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -4,6 +4,7 @@
|
||||
<device-add ref="add" :project-code="projectCode" @reloadTable="reloadTable" />
|
||||
<edit-config-gateway ref="editConfigGateway" @reloadTable="reloadTable" />
|
||||
<edit-config ref="editConfig" @reloadTable="reloadTable" />
|
||||
<edit-config-screen ref="editConfigScreen" @reloadTable="reloadTable" />
|
||||
<input id="device-manage-url" v-model="url" style="opacity: 0;">
|
||||
</div>
|
||||
</template>
|
||||
@ -13,6 +14,7 @@ import { getProjectDeviceList, deleteProjectDevice } from '@/api/project';
|
||||
import DeviceAdd from './add';
|
||||
import EditConfigGateway from './editConfigGateway';
|
||||
import EditConfig from './editConfig';
|
||||
import EditConfigScreen from './editConfigScreen';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
export default {
|
||||
@ -20,7 +22,8 @@ export default {
|
||||
components: {
|
||||
DeviceAdd,
|
||||
EditConfigGateway,
|
||||
EditConfig
|
||||
EditConfig,
|
||||
EditConfigScreen
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -176,6 +179,8 @@ export default {
|
||||
this.$refs.editConfig.doShow(row);
|
||||
} else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD') {
|
||||
this.$refs.editConfigGateway.doShow(row);
|
||||
} else if (row.type == 'LSW' || row.type == 'CCTV') {
|
||||
this.$refs.editConfigScreen.doShow(row);
|
||||
} else {
|
||||
this.$messageBox('暂无配置内容');
|
||||
}
|
||||
@ -187,6 +192,8 @@ export default {
|
||||
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}`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user