项目前端配置 添加 关联地图 设备功能

This commit is contained in:
joylink_cuiweidong 2022-11-23 14:56:59 +08:00
parent 08dbe1c7b4
commit 879719ed4b
2 changed files with 93 additions and 13 deletions

View File

@ -80,8 +80,10 @@
import QCode from '@/assets/erCode.jpg';
import md5 from 'js-md5';
import Cookies from 'js-cookie';
// getLoginWmurl, checkLoginStatus, getLoginInfo,
import { getOrgList, selectOrgnization } from '@/api/login';
import { getToken } from '@/utils/auth';
// getLoginWmurl, checkLoginStatus,
import { getOrgList, selectOrgnization, getLoginInfo } from '@/api/login';
import { createSimulation } from '@/api/simulation';
export default {
name:'NormalLogin',
props: {
@ -97,12 +99,6 @@ export default {
return false;
}
}
// syncLogin:{
// type: Boolean,
// default: () => {
// return false;
// }
// }
},
data() {
const validateName = (rule, value, callback) => {
@ -139,6 +135,14 @@ export default {
}
};
},
computed:{
type() {
return this.$route.query.type;
},
projectDevice() {
return this.$route.query.projectDevice;
}
},
watch: {
'project': function(val) {
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
@ -217,10 +221,48 @@ export default {
handleLoginSucessRoute() {
this.loading = false;
this.tipsMsg = '';
// path: '/trainingPlatform',
const path = '/simulation/simulationIndex';
// if()
this.$router.push({ path: path });
let path = '';
if (this.projectDevice) {
const params = {
projectDevice:this.$route.query.projectDevice,
type: this.$route.query.type
};
this.judgeOtherPage(params);
} else {
path = '/simulation/simulationIndex';
this.$router.push({ path: path });
}
},
judgeOtherPage(params) {
// itemMap: {DEFAULT_MEMBER: '1'}type: "METRO"
getLoginInfo(getToken()).then(res => {
debugger;
createSimulation().then(resp => {
let query = {
group: res.data.group,
mapId: resp.data.map.id,
lineCode: resp.data.map.lineCode,
project: this.project
};
query = Object.assign(query, params);
this.$router.push({ path: `/display/demon`, query: query });
});
// lineCode: resp.data.map.lineCode,
// group: res.data.group,
// prdType: resp.data.prodType,
// mapId: resp.data.map.id,
// goodsId: '',
// try: '0',
// project: this.project
// const query = {
// group: resp.data.group,
// mapId: resp.data.map.id,
// lineCode: resp.data.map.lineCode,
// projectDevice: this.$route.query.projectDevice,
// type: this.$route.query.type
// };
// path = '';
});
},
//
handleLogin() {

View File

@ -65,6 +65,20 @@
<el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock">
<el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" />
</el-form-item>
<el-form-item label="是否包含设备:" prop="containDevice" class="inlineBlock">
<el-switch v-model="formModel.containDevice" />
</el-form-item>
<el-form-item v-if="formModel.containDevice" label="设备关联地图:" prop="deviceRelatedMap" class="inlineBlock" style="margin-left:170px">
<el-select v-model="formModel.deviceRelatedMap" filterable placeholder="请选择" size="small" style="width: 210px;" @change="getRelatedFunctionList">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item v-if="formModel.containDevice" label="设备关联功能:" prop="deviceRelatedFunction">
<el-select v-model="formModel.deviceRelatedFunction" filterable placeholder="请选择" size="small" style="width: 210px;">
<el-option v-for="item in functionList" :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>
@ -73,7 +87,9 @@
</el-dialog>
</template>
<script>
import {queryMapListByUser} from '@/api/jmap/map';
import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig';
import { queryMapFunctionList } from '@/api/trainingPlatform';
export default {
name:'FrontProjectConfig',
data() {
@ -82,6 +98,8 @@ export default {
loginProLogoImg:'',
row:null,
loading: false,
mapList:[],
functionList:[],
formModel:{
loginProtitle:'', //
loginOrgTitle:'', //
@ -105,7 +123,11 @@ export default {
judgeRoute:'', //
baseApiUrl:'', // api
baseSite:'', //
ossUrl:'' // oss
ossUrl:'', // oss
containDevice:false, //
deviceRelatedMap:'', //
deviceRelatedFunction:'' //
}
};
@ -132,6 +154,14 @@ export default {
return '修改前端配置';
}
},
created() {
queryMapListByUser().then(resp => {
this.mapList = resp.data;
}).catch(e => {
this.loading = false;
this.$message.error('获取地图列表失败!');
});
},
methods:{
doShow(row) {
this.dialogVisible = true;
@ -266,6 +296,14 @@ export default {
// directoryMINIO
// fileName
// method
},
getRelatedFunctionList(mapId) {
queryMapFunctionList({mapId: mapId}).then(resp => {
this.functionList = resp.data;
console.log(resp);
}).catch(() => {
this.$message.error('获取地图功能列表失败!');
});
}
}
};