产品分化 创建运行图调整

This commit is contained in:
joylink_cuiweidong 2019-09-30 14:17:20 +08:00
parent 2be7de7527
commit 4fb174f185
4 changed files with 41 additions and 18 deletions

View File

@ -143,7 +143,7 @@
break;
}
case 'runPlanDesign': {
this.$router.push({ path: `${UrlConfig.design.runPlan}/${this.mapId}` });
this.$router.push({ path: `${UrlConfig.design.runPlan}/${this.mapId}?skinCode=${this.skinCode}` });
break;
}
}

View File

@ -195,7 +195,7 @@
break;
}
case 'runPlanDesign': {
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${this.mapId}` })
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${this.mapId}?skinCode=${this.skinCode}` })
break;
}
}

View File

@ -22,9 +22,8 @@
</div> -->
<div class="runPlanHeader">
<div class="runPlanList">运行图列表</div>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan">创建运行图</el-button>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">创建运行图</el-button>
</div>
<el-table :data="runPlanList" height="350" stripe
border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
@ -33,12 +32,12 @@
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" class="button_box" @click="handleConfirm(scope.row)">加载</el-button>
<el-button size="mini" class="button_box" @click="handleEdit(scope.row)">修改名称</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)">删除</el-button>
<el-button size="mini" class="button_box" @click="handleEdit(scope.row)" v-if="isCreate">修改名称</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate">删除</el-button>
</template>
</el-table-column>
</el-table>
<create-empty-plan ref="createEmptyPlan" :plan-convert="PlanConvert" @dispatchOperate="dispatchOperate" @dispatchDialog="dispatchDialog" @refresh="refresh"/>
</el-card>
</template>
<script>
@ -145,11 +144,13 @@
// }
// }
// };
import CreateEmptyPlan from './editTool/menus/createEmptyPlan';
import { getRpListByUserMapId} from '@/api/designPlatform';
import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
export default {
name: 'userRunPlanList',
components: {
CreateEmptyPlan
// LimitList
},
filters: {
@ -164,7 +165,9 @@ export default {
type: 'add',
// defaultShowKeys: [],
runPlanList: [],
runPlanDict: {}
runPlanDict: {},
isCreate:false,
PlanConvert: {}
// defaultProps: {
// label: 'name'
// }
@ -173,15 +176,29 @@ export default {
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
skinCode() {
return this.$route.query.skinCode || '02';
},
},
created(){
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
},
mounted(){
this.getRunPlanList();
},
watch: {
'$route' () {
this.getRunPlanList();
}
},
methods:{
refresh(){
this.getRunPlanList();
},
getRunPlanList() {
if(/^\/design\/userlist/.test(this.$route.fullPath)){
debugger;
this.isCreate=false;
getRpListByUserMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
this.runPlanList.forEach(elem => {
@ -193,7 +210,7 @@ export default {
});
}
else{
debugger;
this.isCreate=true;
getRpListByMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
this.runPlanList.forEach(elem => {
@ -205,9 +222,14 @@ export default {
});
}
},
dispatchOperate(){
this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
},
dispatchDialog(){
this.$refs['createEmptyPlan'].doShow();
},
handleCreate(){
this.$refs['createEmptyPlan'].doShow();
},
handleConfirm(){

View File

@ -12,7 +12,7 @@
>
<div>
<el-tabs v-model="activeTab" type="card">
<el-tab-pane :label="this.$t('planMonitor.normalNew')" name="first">
<!-- <el-tab-pane :label="this.$t('planMonitor.normalNew')" name="first">
<el-row>
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
@ -20,7 +20,7 @@
</el-form-item>
</el-form>
</el-row>
</el-tab-pane>
</el-tab-pane> -->
<el-tab-pane :label="this.$t('planMonitor.createFromTheReleaseRunGraph')" name="second">
<el-row>
<el-form ref="pullForm" :model="pullModel" label-width="140px" size="mini" :rules="pullRules" @submit.native.prevent>
@ -82,7 +82,7 @@ export default {
},
data() {
return {
activeTab: 'first',
activeTab: 'second',
dialogShow: false,
loading: false,
loadingDig: null,
@ -161,7 +161,7 @@ export default {
this.$emit('dispatchOperate', params);
this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully'));
this.jump(resp.data, this.newModel.name);
// this.jump(resp.data, this.newModel.name);
this.doClose();
}).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed')+ this.$t('global.colon') + error.message);
@ -175,7 +175,8 @@ export default {
this.loading = true;
postCreatePlan(this.pullModel).then(resp => {
this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
this.jump(resp.data, this.pullModel.name);
// this.jump(resp.data, this.pullModel.name);
this.$emit('refresh');
this.doClose();
}).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed')+ this.$t('global.colon') + error.message);