ibp调整
This commit is contained in:
parent
8b05776895
commit
3326f1c917
File diff suppressed because one or more lines are too long
@ -96,7 +96,7 @@ class MouseController extends Eventful {
|
||||
mousemove(e) {
|
||||
if (eventTool.notLeftMouse(e) ||
|
||||
!this._moveOnMouseMove ||
|
||||
!this._dragging
|
||||
!this._dragging || !this.isAllowDragging
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ export default class background extends Group {
|
||||
});
|
||||
this.add(this.imageBg);
|
||||
}).catch((encodingError) => {
|
||||
// Do something with the error.
|
||||
});
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
import deviceType from './constant/deviceType';
|
||||
import {createTransform, createBoundingRect} from './utils/parser';
|
||||
|
||||
class TransformHandle {
|
||||
@ -17,7 +17,7 @@ class TransformHandle {
|
||||
}
|
||||
|
||||
revisibleView(view) {
|
||||
if (this.checkVisible(view)) {
|
||||
if (this.checkVisible(view)||view._type === deviceType.Background) {
|
||||
view.show();
|
||||
} else {
|
||||
view.hide();
|
||||
|
@ -80,13 +80,19 @@ export default {
|
||||
this.ibpDestroy();
|
||||
},
|
||||
methods: {
|
||||
show (deviceCode) {
|
||||
show (deviceCode,ibpPart) {
|
||||
if (!deviceCode) {
|
||||
return;
|
||||
}
|
||||
document.getElementById(this.ibpId).oncontextmenu = function (e) {
|
||||
return false;
|
||||
};
|
||||
let offsetX = 0;
|
||||
if (ibpPart === 'left'){
|
||||
offsetX = 0;
|
||||
}else if (ibpPart === 'right'){
|
||||
offsetX = 1920;
|
||||
}
|
||||
this.ibpDestroy();
|
||||
this.loading = true;
|
||||
const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight});
|
||||
@ -99,7 +105,7 @@ export default {
|
||||
},
|
||||
options: {
|
||||
scaleRate: 1,
|
||||
offsetX: 0,
|
||||
offsetX: offsetX,
|
||||
offsetY: 0
|
||||
},
|
||||
methods: {
|
||||
|
@ -76,7 +76,8 @@ export default {
|
||||
simulationShow: false,
|
||||
drivingShow: false,
|
||||
ibpShow: false,
|
||||
panelShow: true
|
||||
panelShow: true,
|
||||
ibpPart: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -279,6 +280,7 @@ export default {
|
||||
const res = await getUserRoles(this.group);
|
||||
this.userRole = res.data.userRole;
|
||||
this.deviceCode = res.data.deviceCode;
|
||||
this.ibpPart = res.data.ibpPart;
|
||||
return res;
|
||||
},
|
||||
// 仿真系统
|
||||
@ -343,7 +345,7 @@ export default {
|
||||
this.drivingShow = false;
|
||||
this.panelShow = false;
|
||||
this.ibpShow = true;
|
||||
this.$refs.ibpPlate.show(deviceCode);
|
||||
this.$refs.ibpPlate.show(deviceCode,this.ibpPart);
|
||||
},
|
||||
hidepanel() {
|
||||
this.panelShow = false;
|
||||
|
@ -135,22 +135,13 @@
|
||||
@click="handleDelUserForStation(nor, index, stationListForIBP, ibpList)"
|
||||
/>
|
||||
<div style="float: right; margin-right: 15px;">
|
||||
<el-select
|
||||
v-model="nor.deviceCode"
|
||||
:placeholder="$t('global.choose')"
|
||||
size="mini"
|
||||
:disabled="userId != roomInfo.creatorId"
|
||||
@change="handleChangeUser(nor, 'IBP', stationListForIBP, ibpList)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stationListForIBP"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:disabled="item.disabled"
|
||||
style="margin-left: 10px"
|
||||
/>
|
||||
</el-select>
|
||||
<el-cascader
|
||||
v-model="nor.deviceCode"
|
||||
size="mini"
|
||||
:placeholder="$t('global.choose')"
|
||||
:disabled="userId != roomInfo.creatorId"
|
||||
:options="stationListForIBP"
|
||||
@change="handleChangeUser(nor, 'IBP', stationListForIBP, ibpList)"></el-cascader>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@ -284,6 +275,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
testData: ['Station_203_0.07533','left'],
|
||||
userId: '',
|
||||
permissionRest: 0,
|
||||
roomInfo: {
|
||||
@ -337,12 +329,7 @@ export default {
|
||||
},
|
||||
stationListForIBP() {
|
||||
return this.stationList.map(item => {
|
||||
const elem = { code: item.code, name: item.name, disabled: false };
|
||||
this.ibpList.forEach(nor => {
|
||||
if (elem.code == nor.deviceCode) {
|
||||
elem.disabled = true;
|
||||
}
|
||||
});
|
||||
const elem = { value: item.code, label: item.name, children:[{value: 'left', label: '左'}, {value: 'right', label: '右'}] };
|
||||
return elem;
|
||||
});
|
||||
}
|
||||
@ -416,6 +403,9 @@ export default {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
ibpRoleData(nor) {
|
||||
return [nor.deviceCode,nor.ibpPart]
|
||||
},
|
||||
async handleRoomInfo(data) {
|
||||
const param = {
|
||||
creatorId: data.creatorId,
|
||||
@ -523,6 +513,7 @@ export default {
|
||||
this.ibpList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
item.deviceCode = [item.deviceCode,item.ibpPart];
|
||||
this.ibpList.push(item);
|
||||
break;
|
||||
case 'BigScreen':
|
||||
@ -625,6 +616,7 @@ export default {
|
||||
break;
|
||||
case 'IBP':
|
||||
item.select = true;
|
||||
item.deviceCode = [item.deviceCode,item.ibpPart]
|
||||
this.ibpList.push(item);
|
||||
break;
|
||||
case 'BigScreen':
|
||||
@ -795,17 +787,26 @@ export default {
|
||||
});
|
||||
},
|
||||
handleChangeUser(val, role, stationList, list) {
|
||||
let deviceCode = ''
|
||||
if (role === 'IBP'){
|
||||
val.ibpPart = val.deviceCode[1];
|
||||
deviceCode = val.deviceCode[0];
|
||||
}else {
|
||||
val.ibpPart = '';
|
||||
deviceCode = val.deviceCode;
|
||||
}
|
||||
const params = [{
|
||||
id: val.id,
|
||||
nickName: val.nickName,
|
||||
userRole: role,
|
||||
deviceCode: val.deviceCode
|
||||
deviceCode: deviceCode,
|
||||
ibpPart: val.ibpPart
|
||||
}];
|
||||
putUserRoles(params, this.$route.query.group);
|
||||
stationList.forEach(item => {
|
||||
item.disabled = false;
|
||||
list.forEach(nor => {
|
||||
if (item.code == nor.deviceCode) {
|
||||
if (item.code == nor.deviceCode[0]) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user