修改接口:/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查询发布运行图列表 // 根据skinCode查询发布运行图列表
export function queryRunPlanList(skinCode) { export function queryRunPlanList(mapId) {
return request({ return request({
url: `/api/runPlan/template/skin/${skinCode}`, url: `/api/runPlan/template/${mapId}/list`,
method: 'get' method: 'get'
}); });
} }

View File

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

View File

@ -125,7 +125,7 @@ export default {
}, },
methods: { methods: {
async initLoad() { 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) { if (res.code == 200 && res.data.length) {
this.publishMapList = res.data; this.publishMapList = res.data;
} }