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

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 QCode from '@/assets/erCode.jpg';
import md5 from 'js-md5'; import md5 from 'js-md5';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
// getLoginWmurl, checkLoginStatus, getLoginInfo, import { getToken } from '@/utils/auth';
import { getOrgList, selectOrgnization } from '@/api/login'; // getLoginWmurl, checkLoginStatus,
import { getOrgList, selectOrgnization, getLoginInfo } from '@/api/login';
import { createSimulation } from '@/api/simulation';
export default { export default {
name:'NormalLogin', name:'NormalLogin',
props: { props: {
@ -97,12 +99,6 @@ export default {
return false; return false;
} }
} }
// syncLogin:{
// type: Boolean,
// default: () => {
// return false;
// }
// }
}, },
data() { data() {
const validateName = (rule, value, callback) => { 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: { watch: {
'project': function(val) { 'project': function(val) {
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) { if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
@ -217,10 +221,48 @@ export default {
handleLoginSucessRoute() { handleLoginSucessRoute() {
this.loading = false; this.loading = false;
this.tipsMsg = ''; this.tipsMsg = '';
// path: '/trainingPlatform', let path = '';
const path = '/simulation/simulationIndex'; if (this.projectDevice) {
// if() const params = {
this.$router.push({ path: path }); 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() { handleLogin() {

View File

@ -65,6 +65,20 @@
<el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock"> <el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock">
<el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" /> <el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" />
</el-form-item> </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> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
@ -73,7 +87,9 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {queryMapListByUser} from '@/api/jmap/map';
import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig'; import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig';
import { queryMapFunctionList } from '@/api/trainingPlatform';
export default { export default {
name:'FrontProjectConfig', name:'FrontProjectConfig',
data() { data() {
@ -82,6 +98,8 @@ export default {
loginProLogoImg:'', loginProLogoImg:'',
row:null, row:null,
loading: false, loading: false,
mapList:[],
functionList:[],
formModel:{ formModel:{
loginProtitle:'', // loginProtitle:'', //
loginOrgTitle:'', // loginOrgTitle:'', //
@ -105,7 +123,11 @@ export default {
judgeRoute:'', // judgeRoute:'', //
baseApiUrl:'', // api baseApiUrl:'', // api
baseSite:'', // baseSite:'', //
ossUrl:'' // oss ossUrl:'', // oss
containDevice:false, //
deviceRelatedMap:'', //
deviceRelatedFunction:'' //
} }
}; };
@ -132,6 +154,14 @@ export default {
return '修改前端配置'; return '修改前端配置';
} }
}, },
created() {
queryMapListByUser().then(resp => {
this.mapList = resp.data;
}).catch(e => {
this.loading = false;
this.$message.error('获取地图列表失败!');
});
},
methods:{ methods:{
doShow(row) { doShow(row) {
this.dialogVisible = true; this.dialogVisible = true;
@ -266,6 +296,14 @@ export default {
// directoryMINIO // directoryMINIO
// fileName // fileName
// method // method
},
getRelatedFunctionList(mapId) {
queryMapFunctionList({mapId: mapId}).then(resp => {
this.functionList = resp.data;
console.log(resp);
}).catch(() => {
this.$message.error('获取地图功能列表失败!');
});
} }
} }
}; };