删除接口:/api/runPlan/draft/station/{skinCode}/bySkin

This commit is contained in:
fan 2019-10-30 16:50:35 +08:00
parent 375773cceb
commit 4918c78204
11 changed files with 1506 additions and 1519 deletions

View File

@ -95,14 +95,6 @@ export function dragSortLessonChapter(data) {
}); });
} }
/** 根据lessonId获取课程名称*/
export function getLessonNameByMapIdAndLessonId(model) {
return request({
url: `/api/lessonDraft/${model.mapId}/${model.lessonId}`,
method: 'get'
});
}
export function getLessonDrftList(params) { export function getLessonDrftList(params) {
return request({ return request({
url: `/api/lessonDraft`, url: `/api/lessonDraft`,

View File

@ -41,16 +41,6 @@ export function getStationList(mapId) {
}); });
} }
/**
* 通过皮肤获取运行图车站列表
*/
export function getStationListBySkinCode(skinCode) {
return request({
url: `/api/runPlan/draft/station/${skinCode}/bySkin`,
method: 'get'
});
}
/** /**
* 创建运行图 * 创建运行图
*/ */

View File

@ -19,7 +19,7 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
@ -118,9 +118,10 @@ export default {
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
if (skinCode) { if (mapId) {
getStationListBySkinCode(skinCode).then(response => { getStationList(mapId).then(response => {
const stations = response.data; const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {

View File

@ -19,7 +19,7 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
@ -119,9 +119,10 @@ export default {
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
if (skinCode) { if (mapId) {
getStationListBySkinCode(skinCode).then(response => { getStationList(mapId).then(response => {
const stations = response.data; const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {

View File

@ -19,7 +19,7 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
@ -118,9 +118,10 @@ export default {
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
if (skinCode) { if (mapId) {
getStationListBySkinCode(skinCode).then(response => { getStationList(mapId).then(response => {
const stations = response.data; const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {

View File

@ -19,7 +19,7 @@
<script> <script>
import { runPlanTemplateList } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
@ -118,9 +118,10 @@ export default {
}, },
loadRunData() { loadRunData() {
const skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
if (skinCode) { if (mapId) {
getStationListBySkinCode(skinCode).then(response => { getStationList(mapId).then(response => {
const stations = response.data; const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {

View File

@ -6,23 +6,23 @@
<el-button-group> <el-button-group>
<!-- viewRunQuest --> <!-- viewRunQuest -->
<el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{$t('display.schema.selectRoles')}}</el-button> <el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{ $t('display.schema.selectRoles') }}</el-button>
<el-button v-if="isDemon && !isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{$t('display.schema.loadScript')}}</el-button> <el-button v-if="isDemon && !isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('display.schema.previewRunDiagram')}}</el-button> <el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{$t('display.schema.loadRunDiagram')}}</el-button> <el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('display.schema.faultSetting')}}</el-button> <el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{ $t('display.schema.faultSetting') }}</el-button>
</el-button-group> </el-button-group>
<el-radio-group v-if="!isPlan" v-model="mode" size="small" @change="changeOperateMode(mode)"> <el-radio-group v-if="!isPlan" v-model="mode" size="small" @change="changeOperateMode(mode)">
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{$t('display.schema.normalOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('display.schema.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{$t('display.schema.faultOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('display.schema.faultOperation') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinCode, queryRunPlan } from '@/api/runplan'; import { getStationList, queryRunPlan } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData } from '@/api/simulation';
import {getRpDetailByUserMapId} from '@/api/designPlatform'; import {getRpDetailByUserMapId} from '@/api/designPlatform';
@ -68,7 +68,7 @@ export default {
isDemon() { isDemon() {
return this.$route.params.mode === 'demon'; return this.$route.params.mode === 'demon';
}, },
isDesignPlatform(){ isDesignPlatform() {
return this.$route.fullPath.includes('design/display/demon'); return this.$route.fullPath.includes('design/display/demon');
} }
}, },
@ -86,18 +86,19 @@ export default {
} }
}, },
async mounted() { async mounted() {
console.log(this.$route.query, '=====');
await this.loadRunData(this.$route.query); await this.loadRunData(this.$route.query);
}, },
methods: { methods: {
loadRunData(opt) { loadRunData(opt) {
this.$store.dispatch('runPlan/clear').then(() => { this.$store.dispatch('runPlan/clear').then(() => {
if (opt && opt.skinCode) { if (opt && opt.mapId) {
this.viewDisabled = true; this.viewDisabled = true;
getStationListBySkinCode(opt.skinCode).then(response => { getStationList(opt.mapId).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => { this.$store.dispatch('runPlan/setStations', response.data).then(() => {
if (this.$route.params.mode == 'plan') { if (this.$route.params.mode == 'plan') {
// debugger; // debugger;
if(this.$route.query.from=="user"){ if (this.$route.query.from == 'user') {
// //
getRpDetailByUserMapId(this.$route.query.planId).then(resp => { getRpDetailByUserMapId(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', resp.data);
@ -106,7 +107,7 @@ export default {
this.$store.dispatch('runPlan/setPlanData', []); this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail')); this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}); });
}else{ } else {
// //
queryRunPlan(this.$route.query.planId).then(resp => { queryRunPlan(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', resp.data);
@ -117,7 +118,6 @@ export default {
}); });
} }
} else { } else {
getEveryDayRunPlanData(this.group).then(resp => { getEveryDayRunPlanData(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', resp.data);
@ -156,7 +156,7 @@ export default {
viewRunQuest() { viewRunQuest() {
this.$emit('runQuestLoadShow'); this.$emit('runQuestLoadShow');
}, },
viewScriptRoles(){ viewScriptRoles() {
this.$emit('runAddRolesLoadShow'); this.$emit('runAddRolesLoadShow');
}, },
switchMode(swch) { switchMode(swch) {

View File

@ -12,14 +12,14 @@
<el-button-group> <el-button-group>
<template> <template>
<el-button v-if="runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('joinTraining.runGraphPreview')}}</el-button> <el-button v-if="runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
</template> </template>
<template v-if="userRole == 'Admin'"> <template v-if="userRole == 'Admin'">
<el-button v-if="!runing" size="small" type="warning" :disabled="viewDisabled" @click="loadRunPlan"> <el-button v-if="!runing" size="small" type="warning" :disabled="viewDisabled" @click="loadRunPlan">
{{$t('joinTraining.runGraphLoading')}}</el-button> {{ $t('joinTraining.runGraphLoading') }}</el-button>
</template> </template>
<template v-if="userRole == 'Instructor' || userRole == 'Admin'"> <template v-if="userRole == 'Instructor' || userRole == 'Admin'">
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('joinTraining.faultSetting')}}</el-button> <el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{ $t('joinTraining.faultSetting') }}</el-button>
</template> </template>
</el-button-group> </el-button-group>
@ -29,15 +29,15 @@
size="small" size="small"
@change="changeOperateMode(mode)" @change="changeOperateMode(mode)"
> >
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{$t('joinTraining.normalOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('joinTraining.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{$t('joinTraining.faultOperation')}}</el-radio-button> <el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('joinTraining.faultOperation') }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic'; import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData } from '@/api/simulation';
export default { export default {
@ -97,14 +97,15 @@ export default {
}, },
async mounted() { async mounted() {
this.userId = this.$store.state.user.id; this.userId = this.$store.state.user.id;
console.log(this.$route.query);
await this.loadRunData(this.$route.query); await this.loadRunData(this.$route.query);
}, },
methods: { methods: {
loadRunData(opt) { loadRunData(opt) {
this.$store.dispatch('runPlan/clear').then(resp => { this.$store.dispatch('runPlan/clear').then(resp => {
if (opt && opt.skinCode) { if (opt && opt.mapId) {
this.viewDisabled = true; this.viewDisabled = true;
getStationListBySkinCode(opt.skinCode).then(response => { getStationList(opt.mapId).then(response => {
const stations = response.data; const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.group).then(resp => { getEveryDayRunPlanData(this.group).then(resp => {

View File

@ -11,7 +11,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getStationListBySkinCode, queryRunPlan, queryRunPlanTemplate, queryRunPlanDaily } from '@/api/runplan'; import { getStationList, queryRunPlan, queryRunPlanTemplate, queryRunPlanDaily } from '@/api/runplan';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
@ -179,9 +179,9 @@ export default {
this.PlanConvert = this.$theme.loadPlanConvert(opt.skinCode); this.PlanConvert = this.$theme.loadPlanConvert(opt.skinCode);
this.$store.dispatch('runPlan/clear').then(resp => { this.$store.dispatch('runPlan/clear').then(resp => {
this.loadInitChart().then(() => { this.loadInitChart().then(() => {
if (opt.skinCode && opt.planId) { if (opt.mapId && opt.planId) {
this.myChart && this.myChart.showLoading(); this.myChart && this.myChart.showLoading();
getStationListBySkinCode(opt.skinCode).then(response => { getStationList(opt.mapId).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => { this.$store.dispatch('runPlan/setStations', response.data).then(() => {
let queryFunc = null; let queryFunc = null;
const params = opt.planId; const params = opt.planId;

View File

@ -25,7 +25,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { getStationListBySkinCode, queryRunPlan } from '@/api/runplan'; import { getStationList, queryRunPlan } from '@/api/runplan';
import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform'; import {getRpDetailByUserMapId, getUserMapDetailByMapId} from '@/api/designPlatform';
import { loadMapDataById } from '@/utils/loaddata'; import { loadMapDataById } from '@/utils/loaddata';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
@ -372,7 +372,7 @@ export default {
this.loadInitChart().then(() => { this.loadInitChart().then(() => {
if (this.$route.query.mapId) { if (this.$route.query.mapId) {
loadMapDataById(this.$route.query.mapId); loadMapDataById(this.$route.query.mapId);
getStationListBySkinCode(this.$route.query.skinCode).then(resp => { getStationList(this.$route.query.mapId).then(resp => {
this.$store.dispatch('runPlan/setStations', resp.data).then(() => { this.$store.dispatch('runPlan/setStations', resp.data).then(() => {
this.loadInitData(); this.loadInitData();
if (this.planId) { if (this.planId) {

View File

@ -177,7 +177,7 @@ export default {
}, },
// //
handleView(index, row) { handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinCode: row.skinCode, planId: row.id } }); this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinCode: row.skinCode, planId: row.id, mapId: row.mapId } });
}, },
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();