Merge branch 'dev_product' of https://git.cloud.tencent.com/joylink/jl-nclient into dev_product

This commit is contained in:
fan 2019-09-30 16:20:51 +08:00
commit 588c886f3b
7 changed files with 97 additions and 33 deletions

View File

@ -193,6 +193,7 @@ export const UrlConfig = {
scriptHome: '/design/script/home'
},
designUser: {
prefix: '/design/userlist/home',
scriptHome: '/design/userlist/script/home',
mapDraw: '/design/userlist/map/draw',
lessonHome: '/design/userlist/lesson/home',

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

@ -166,8 +166,8 @@
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
this.$nextTick(() => {
const mapId = getSessionStorage('demonList') || null;
this.$refs.tree.setCurrentKey(mapId);
// const mapId = getSessionStorage('demonList') || null;
// this.$refs.tree.setCurrentKey(mapId);
this.loading = false;
});
} catch (error) {
@ -176,9 +176,10 @@
}
},
clickEvent(obj, data, ele) {
if (data.parent && data.parent.data){
this.mapId = data.parent.data.id;
this.mapName=data.parent.data.name;
if (obj.type=="map"){
this.mapId = data.data.id;
this.mapName=data.data.name;
this.skinCode=data.data.skinCode;
}
switch(obj.type){
case 'scriptDesign':{
@ -195,7 +196,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

@ -147,7 +147,8 @@ export default {
if (this.editModel.id == this.$route.params.mapId) {
this.$store.dispatch('map/mapClear').then(() => {
_that.$emit('editMap', null);
_that.$router.push({ path: `${UrlConfig.map.draft}/0/draft` });
// _that.$router.push({ path: `${UrlConfig.map.draft}/0/draft` });
_that.$router.push({ path: `${UrlConfig.designUser.prefix}` });
});
}
_that.refresh();

View File

@ -22,10 +22,9 @@
</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
<el-table :data="runPlanList" height="600" stripe
border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<el-table-column prop="name" label="运行图名称" />
@ -33,12 +32,13 @@
<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"/>
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
</el-card>
</template>
<script>
@ -145,11 +145,16 @@
// }
// }
// };
import EditPlanName from './editTool/menus/editPlanName';
import CreateEmptyPlan from './editTool/menus/createEmptyPlan';
import { getRpListByUserMapId} from '@/api/designPlatform';
import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
export default {
name: 'userRunPlanList',
components: {
CreateEmptyPlan,
EditPlanName
// LimitList
},
filters: {
@ -164,7 +169,9 @@ export default {
type: 'add',
// defaultShowKeys: [],
runPlanList: [],
runPlanDict: {}
runPlanDict: {},
isCreate:false,
PlanConvert: {}
// defaultProps: {
// label: 'name'
// }
@ -173,15 +180,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 +214,7 @@ export default {
});
}
else{
debugger;
this.isCreate=true;
getRpListByMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
this.runPlanList.forEach(elem => {
@ -205,18 +226,57 @@ export default {
});
}
},
dispatchOperate(){
this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
},
dispatchDialog(){
this.$refs['createEmptyPlan'].doShow();
},
handleCreate(){
this.$refs['createEmptyPlan'].doShow();
},
handleConfirm(){
handleConfirm(row){
this.loadRunPlanData({
planId: row.id,
skinCode: this.$route.query.skinCode,
planName: row.name
});
},
handleEdit(){
//
handleEdit(row) {
if (row.id && row.name) {
this.$refs.editPlan.doShow({id: row.id, name: row.name});
} else {
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
}
},
handleDelete(){
loadRunPlanData({ refresh, planId, skinCode, planName }) {
if (refresh) {
this.$store.dispatch('runPlan/refresh');
} else {
const query = { skinCode: skinCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
},
//
handleDelete(row) {
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlan(row.id).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
// if (row.id === this.$route.query.planId) {
// const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
// this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
// }
this.refresh();
// this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
}
}
};

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);

View File

@ -88,11 +88,11 @@ export default {
};
this.$emit('dispatchOperate', params);
this.$message.success(this.$t('planMonitor.runGraphNameModifiedSuccessfully'));
this.$message.success(this.$t('tip.runGraphNameModifiedSuccessfully'));
this.$emit('renewal');
this.doClose();
}).catch(() => {
this.$messageBox(this.$t('planMonitor.modifyRunGraphNameFailed'));
this.$messageBox(this.$t('tip.modifyRunGraphNameFailed'));
this.doClose();
});
}