产品分化 创建运行图调整

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; break;
} }
case 'runPlanDesign': { case 'runPlanDesign': {
this.$router.push({ path: `${UrlConfig.design.runPlan}/${this.mapId}` }); this.$router.push({ path: `${UrlConfig.design.runPlan}/${this.mapId}?skinCode=${this.skinCode}` });
break; break;
} }
} }

View File

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

View File

@ -22,9 +22,8 @@
</div> --> </div> -->
<div class="runPlanHeader"> <div class="runPlanHeader">
<div class="runPlanList">运行图列表</div> <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> </div>
<el-table :data="runPlanList" height="350" stripe <el-table :data="runPlanList" height="350" 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;">
@ -33,12 +32,12 @@
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <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="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" @click="handleEdit(scope.row)" v-if="isCreate">修改名称</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)">删除</el-button> <el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<create-empty-plan ref="createEmptyPlan" :plan-convert="PlanConvert" @dispatchOperate="dispatchOperate" @dispatchDialog="dispatchDialog" @refresh="refresh"/>
</el-card> </el-card>
</template> </template>
<script> <script>
@ -145,11 +144,13 @@
// } // }
// } // }
// }; // };
import CreateEmptyPlan from './editTool/menus/createEmptyPlan';
import { getRpListByUserMapId} from '@/api/designPlatform'; import { getRpListByUserMapId} from '@/api/designPlatform';
import { getRpListByMapId, deleteRunPlan } from '@/api/runplan'; import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
export default { export default {
name: 'userRunPlanList', name: 'userRunPlanList',
components: { components: {
CreateEmptyPlan
// LimitList // LimitList
}, },
filters: { filters: {
@ -164,7 +165,9 @@ export default {
type: 'add', type: 'add',
// defaultShowKeys: [], // defaultShowKeys: [],
runPlanList: [], runPlanList: [],
runPlanDict: {} runPlanDict: {},
isCreate:false,
PlanConvert: {}
// defaultProps: { // defaultProps: {
// label: 'name' // label: 'name'
// } // }
@ -173,15 +176,29 @@ export default {
computed: { computed: {
height() { height() {
return this.$store.state.app.height - 50; 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(){ mounted(){
this.getRunPlanList(); this.getRunPlanList();
}, },
watch: {
'$route' () {
this.getRunPlanList();
}
},
methods:{ methods:{
refresh(){
this.getRunPlanList();
},
getRunPlanList() { getRunPlanList() {
if(/^\/design\/userlist/.test(this.$route.fullPath)){ if(/^\/design\/userlist/.test(this.$route.fullPath)){
debugger; this.isCreate=false;
getRpListByUserMapId(this.$route.params.mapId).then((resp) => { getRpListByUserMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data; this.runPlanList = resp.data;
this.runPlanList.forEach(elem => { this.runPlanList.forEach(elem => {
@ -193,7 +210,7 @@ export default {
}); });
} }
else{ else{
debugger; 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;
this.runPlanList.forEach(elem => { 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(){ handleCreate(){
this.$refs['createEmptyPlan'].doShow();
}, },
handleConfirm(){ handleConfirm(){

View File

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