修改接口:/api/runPlan/template/skin/{mapId} 改为 /api/runPlan/template/{mapId}/list

This commit is contained in:
fan 2019-10-30 17:21:32 +08:00
parent 0f778f94c6
commit 36c33ed416
5 changed files with 439 additions and 437 deletions

View File

@ -53,9 +53,9 @@ export function queryRunPlan(planId) {
}
// 根据skinCode查询发布运行图列表
export function queryRunPlanList(skinCode) {
export function queryRunPlanList(mapId) {
return request({
url: `/api/runPlan/template/skin/${skinCode}`,
url: `/api/runPlan/template/${mapId}/list`,
method: 'get'
});
}

View File

@ -2,23 +2,27 @@
<el-card :style="{height: height+'px'}" style="overflow-y:scroll;padding-bottom:20px;">
<div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<div class="runPlanList">{{ $t('planMonitor.openRunPlan.runPlanList') }}</div>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">{{$t('planMonitor.createRunningDiagram')}}</el-button>
<el-button v-if="isCreate" size="small" type="primary" class="createRunPlan" @click="handleCreate">{{ $t('planMonitor.createRunningDiagram') }}</el-button>
</div>
<el-table :data="runPlanList" height="500" stripe
<el-table
:data="runPlanList"
height="500"
stripe
border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;"
>
<el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" />
<el-table-column :label="this.$t('global.status')" v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))">
<el-table-column v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))" :label="this.$t('global.status')">
<template slot-scope="scope">
<el-tag>{{ handlerStatus(scope.row) }}</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))"
prop="explanation"
show-overflow-tooltip
v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))"
:label="this.$t('planMonitor.explanation')">
</el-table-column>
:label="this.$t('planMonitor.explanation')"
/>
<el-table-column :label="this.$t('planMonitor.creationDate')">
<template slot-scope="scope">
<el-tag type="success">{{ handleTime(scope.row.createTime) }}</el-tag>
@ -26,12 +30,12 @@
</el-table-column>
<el-table-column :label="this.$t('global.operate')" width="400">
<template slot-scope="scope">
<el-button size="mini" class="button_box" type="success" @click="handleConfirm(scope.row)" v-if="scope.row.status !=='1'">{{$t('planMonitor.load')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handleEdit(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('planMonitor.modifyName')}}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('global.delete')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)" v-if="isCreate && scope.row.status ==='0'">{{hasRelease?$t('global.release'):$t('planMonitor.applyRelease')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)" v-if="scope.row.status === '1'">{{$t('planMonitor.preview')}}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)" v-if="scope.row.status === '1'" >{{$t('planMonitor.revoke')}}</el-button>
<el-button v-if="scope.row.status !=='1'" size="mini" class="button_box" type="success" @click="handleConfirm(scope.row)">{{ $t('planMonitor.load') }}</el-button>
<el-button v-if="isCreate && scope.row.status !=='1'" size="mini" class="button_box" type="primary" @click="handleEdit(scope.row)">{{ $t('planMonitor.modifyName') }}</el-button>
<el-button v-if="isCreate && scope.row.status !=='1'" size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)">{{ $t('global.delete') }}</el-button>
<el-button v-if="isCreate && scope.row.status ==='0'" size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)">{{ hasRelease?$t('global.release'):$t('planMonitor.applyRelease') }}</el-button>
<el-button v-if="scope.row.status === '1'" size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)">{{ $t('planMonitor.preview') }}</el-button>
<el-button v-if="scope.row.status === '1'" size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)">{{ $t('planMonitor.revoke') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -48,7 +52,7 @@ import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
export default {
name: 'userRunPlanList',
name: 'UserRunPlanList',
components: {
CreateEmptyPlan,
EditPlanName
@ -86,17 +90,17 @@ export default {
this.$store.state.user.roles.includes('05');
}
},
watch: {
'$route' () {
this.getRunPlanList();
}
},
created() {
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
},
mounted() {
this.getRunPlanList();
},
watch: {
'$route' () {
this.getRunPlanList();
}
},
methods:{
refresh() {
this.getRunPlanList();
@ -113,8 +117,7 @@ export default {
}).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
});
}
else{
} else {
this.isCreate = true;
getRpListByMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
@ -158,8 +161,7 @@ export default {
const query = { skinCode: skinCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };
if (/^\/design\/userlist/.test(this.$route.fullPath)) {
this.$router.push({ path: `${UrlConfig.plan.usertool}`, query: query });
}
else{
} else {
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
}
@ -197,7 +199,7 @@ export default {
}).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail'));
this.refresh();
})
});
} else {
releaseOrCancelRunPlan(row.id, '1').then(resp => {
this.$message.success(this.$t('tip.applyRunPlanSuccess'));
@ -205,7 +207,7 @@ export default {
}).catch(() => {
this.$messageBox(this.$t('tip.applyRunPlanFail'));
this.refresh();
})
});
}
});
},
@ -219,10 +221,10 @@ export default {
this.$message.success(this.$t('tip.cancelRunPlanSuccess'));
this.refresh();
}).catch(() => {
this.$messageBox(this.$t('tip.cancelRunPlanFail'))
this.$messageBox(this.$t('tip.cancelRunPlanFail'));
this.refresh();
})
})
});
});
},
handlerStatus(row) {
let lessonStatus = '';
@ -243,7 +245,7 @@ export default {
return lessonStatus;
},
handleTime(time) {
return time.replace("T"," ");
return time.replace('T', ' ');
},
handlePreview(row) {
previewRunPlan(row.id).then(resp => {

View File

@ -125,7 +125,7 @@ export default {
},
methods: {
async initLoad() {
const res = await queryRunPlanList(this.$route.query.skinCode);
const res = await queryRunPlanList(this.$route.params.mapId);
if (res.code == 200 && res.data.length) {
this.publishMapList = res.data;
}