调整本地项目快速入口

This commit is contained in:
fan 2020-04-01 09:07:42 +08:00
parent 046cfe8318
commit 7df417424e

View File

@ -20,7 +20,6 @@
:props="defaultProps" :props="defaultProps"
:filter-node-method="filterNode" :filter-node-method="filterNode"
:style="{height: height+'px'}" :style="{height: height+'px'}"
@node-click="clickEvent"
> >
<div slot-scope="{ node, data }" class="list-elem custom-tree-node"> <div slot-scope="{ node, data }" class="list-elem custom-tree-node">
<span v-if="data.state=='01'">{{ '['+data.mapName+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickName)) }}</span> <span v-if="data.state=='01'">{{ '['+data.mapName+']'+($t('global.trainingNotStart').replace('{name}', data.creator.nickName)) }}</span>
@ -37,14 +36,13 @@
slot="footer" slot="footer"
class="dialog-footer" class="dialog-footer"
> >
<el-button v-loading="loading" type="primary" :disabled="!group" @click="handleJoin">{{ $t('global.joinNewRoom') }}</el-button> <el-button v-loading="loading" type="primary" @click="handleJoin">{{ $t('global.joinNewRoom') }}</el-button>
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button> <el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining'; import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen'; import { launchFullscreen } from '@/utils/screen';
@ -60,8 +58,6 @@ export default {
label: 'roomName' label: 'roomName'
}, },
group: '', group: '',
state: '',
mapId: '',
loading: false, loading: false,
pageLoading: false pageLoading: false
}; };
@ -85,11 +81,6 @@ export default {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
clickEvent(obj, node, data) {
this.state = obj.state;
this.group = obj.group;
this.mapId = obj.mapId;
},
async doShow() { async doShow() {
try { try {
this.pageLoading = true; this.pageLoading = true;
@ -97,15 +88,6 @@ export default {
this.loading = false; this.loading = false;
const resp = await getjointTrainListNew(); const resp = await getjointTrainListNew();
this.trainingList = resp.data || []; this.trainingList = resp.data || [];
this.$nextTick(() => {
var training = this.trainingList[0] || {};
if (training) {
this.state = training.state;
this.group = training.group;
this.mapId = training.mapId;
this.$refs.tree.setCurrentKey(this.group);
}
});
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} finally { } finally {
@ -117,15 +99,15 @@ export default {
}, },
async handleJoinRoom(data) { async handleJoinRoom(data) {
try { try {
const rest = await getPublishMapInfo(this.mapId); const rest = await getPublishMapInfo(data.mapId);
await getjointTrainingNew(data.group); await getjointTrainingNew(data.group);
if (data.state == '02') { if (data.state == '02') {
launchFullscreen(); launchFullscreen();
const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: true }; const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: true };
await putJointTrainingSimulationEntranceNew(this.group); await putJointTrainingSimulationEntranceNew(data.group);
this.$router.push({ path: `/jointTrainingNew`, query: query }); this.$router.push({ path: `/jointTrainingNew`, query: query });
} else if (data.state == '01') { } else if (data.state == '01') {
const query = { group: this.group, drawWay: true }; const query = { group: data.group, drawWay: true };
this.$router.push({ path: `/trainroom`, query: query }); this.$router.push({ path: `/trainroom`, query: query });
} }
} catch (e) { } catch (e) {