快速入口增加参数projectCode

This commit is contained in:
fan 2020-01-17 14:20:31 +08:00
parent 02a6954ffd
commit 582fc354db
5 changed files with 131 additions and 6 deletions

View File

@ -96,10 +96,11 @@ export function deljointTrainRoom(group) {
}
// 查询有权限房间列表
export function getjointTrainList() {
export function getjointTrainList(params) {
return request({
url: `/api/jointTraining/room/list`,
method: 'get'
method: 'get',
params: params
});
}

View File

@ -5,9 +5,9 @@ export function getBaseUrl() {
// BASE_API = 'https://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://192.168.3.82:9000'; // 杜康
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -40,8 +40,10 @@
<script>
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
import { getSessionStorage } from '@/utils/auth';
import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import { ProjectCode } from '@/scripts/ConstDic';
export default {
name: 'DeomonList',
@ -89,7 +91,8 @@ export default {
this.pageLoading = true;
this.dialogShow = true;
this.loading = false;
const res = await getjointTrainList();
const project = getSessionStorage('project');
const res = await getjointTrainList({projectCode:ProjectCode[project]});
this.trainingList = res.data || [];
this.$nextTick(() => {
var training = this.trainingList[0] || {};

View File

@ -0,0 +1,111 @@
<template>
<div>
<el-form ref="form" :rule="rules" :model="addModel" label-width="100px">
<el-form-item v-if="addModel.code" label="按钮编号" prop="code">
<el-input v-model="addModel.code" />
</el-form-item>
<el-form-item label="宽度" prop="width">
<el-input-number v-model="addModel.width" controls-position="right" />
</el-form-item>
<el-form-item label="高度" prop="height">
<el-input-number v-model="addModel.height" controls-position="right" />
</el-form-item>
<el-form-item label="X轴坐标" prop="x">
<el-input-number v-model="addModel.x" controls-position="right" />
</el-form-item>
<el-form-item label="Y轴坐标" prop="y">
<el-input-number v-model="addModel.y" controls-position="right" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'PlatformScreenDoor',
data() {
return {
addModel:{
code: '',
width: 25,
height: 10,
x: 10,
y: 10
},
rules: {
width:[{ required: true, message:'请输入图形宽度', trigger: 'blur' }],
height:[{ required: true, message:'请输入图形宽度', trigger: 'blur' }],
x: [{ required: true, message: '请输入图形的X轴坐标', trigger: 'blur' }],
y: [{ required: true, message: '请输入图形的Y轴坐标', trigger: 'blur' }]
},
showDeleteButton: false,
buttonText: '立即创建'
};
},
methods: {
onSubmit(form) {
if (!this.addModel.code) {
this.generateCode();
}
this.$refs[form].validate((valid) => {
if (valid) {
const maButtonModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'borderRadius',
width: this.addModel.width,
height: this.addModel.height
};
this.$emit('createDataModel', maButtonModel);
this.initPage();
} else {
return false;
}
});
},
deleteDevice() {
const maButtonModel = {
point: {
x: this.addModel.x,
y: this.addModel.y
},
code: this.addModel.code,
_type: 'borderRadius',
width: this.addModel.width,
height: this.addModel.height
};
this.$emit('deleteDataModel', maButtonModel);
this.initPage();
},
initPage() {
this.isUpdate = false;
this.buttonText = '立即创建';
this.showDeleteButton = false;
this.addModel = {
code: '',
width: 25,
height: 10,
x: 10,
y: 10
};
},
generateCode() {
const mydate = new Date();
this.addModel.code = 'borderRadius_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
}
}
};
</script>
<style scoped>
</style>

View File

@ -26,6 +26,14 @@
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
<el-tab-pane label="圆角边框" name="borderRadius">
<border-radius
ref="borderRadius"
style="width: 90%;"
@createDataModel="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
@ -35,12 +43,14 @@
import {deviceFactory} from '@/iscs/utils/parser';
import PlatformScreenDoor from './platformScreenDoor';
import EndDoor from './endDoor';
import BorderRadius from './borderRadius';
export default {
name: 'IscsOperate',
components: {
PlatformScreenDoor,
EndDoor
EndDoor,
BorderRadius
},
mixins: [
],