调整本地项目快速入口
This commit is contained in:
parent
046cfe8318
commit
7df417424e
@ -20,7 +20,6 @@
|
||||
:props="defaultProps"
|
||||
:filter-node-method="filterNode"
|
||||
:style="{height: height+'px'}"
|
||||
@node-click="clickEvent"
|
||||
>
|
||||
<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>
|
||||
@ -37,14 +36,13 @@
|
||||
slot="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>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getjointTrainList, getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat';
|
||||
import { getjointTrainListNew, putJointTrainingSimulationEntranceNew, getjointTrainingNew } from '@/api/jointTraining';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
@ -60,8 +58,6 @@ export default {
|
||||
label: 'roomName'
|
||||
},
|
||||
group: '',
|
||||
state: '',
|
||||
mapId: '',
|
||||
loading: false,
|
||||
pageLoading: false
|
||||
};
|
||||
@ -85,11 +81,6 @@ export default {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
},
|
||||
clickEvent(obj, node, data) {
|
||||
this.state = obj.state;
|
||||
this.group = obj.group;
|
||||
this.mapId = obj.mapId;
|
||||
},
|
||||
async doShow() {
|
||||
try {
|
||||
this.pageLoading = true;
|
||||
@ -97,15 +88,6 @@ export default {
|
||||
this.loading = false;
|
||||
const resp = await getjointTrainListNew();
|
||||
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) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
@ -117,15 +99,15 @@ export default {
|
||||
},
|
||||
async handleJoinRoom(data) {
|
||||
try {
|
||||
const rest = await getPublishMapInfo(this.mapId);
|
||||
const rest = await getPublishMapInfo(data.mapId);
|
||||
await getjointTrainingNew(data.group);
|
||||
if (data.state == '02') {
|
||||
launchFullscreen();
|
||||
const query = { lineCode: rest.data.lineCode, mapId: this.mapId, group: this.group, drawWay: true };
|
||||
await putJointTrainingSimulationEntranceNew(this.group);
|
||||
const query = { lineCode: rest.data.lineCode, mapId: data.mapId, group: data.group, drawWay: true };
|
||||
await putJointTrainingSimulationEntranceNew(data.group);
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
} 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 });
|
||||
}
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user