Browse Source

优化

master
陈裕财 3 years ago
parent
commit
16ad8ea121
  1. 330
      src/views/xm/core/xmProduct/XmProductOverviewComplex.vue
  2. 157
      src/views/xm/core/xmProduct/top-nav.vue
  3. 3
      src/views/xm/core/xmProject/XmProjectOverviewComplex.vue
  4. 31
      src/views/xm/core/xmProject/top-nav.vue

330
src/views/xm/core/xmProduct/XmProductOverviewComplex.vue

@ -1,6 +1,195 @@
<template>
<section class="padding-left padding-right">
<el-menu mode="horizontal" :default-active="showPanelName" @select="onMenuToolBarSelect">
<el-row ref="pageBody">
<el-col
:span="4"
class="padding border"
:style="{ maxHeight: maxTableHeight + 'px', overflowY: 'auto' }"
>
<h4 class="padding-bottom">常用功能导航</h4>
<el-steps
:active="calcProductPstatusStep"
finish-status="success"
direction="vertical"
>
<el-step
v-for="(i, index) in dicts['xmProductPstatus']"
:title="i.name"
:key="index"
>
<el-row slot="description">
<el-row v-if="i.id == '0'"
><!--打开-->
<span v-if="xmProduct.pstatus == i.id">
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productMenu')"
>需求管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="linkProject()"
>关联项目</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="
editXmProductSomeFields(xmProduct, 'pstatus', '1')
"
>设为研发中</el-button
>
</span>
<span v-if="xmProduct.pstatus != i.id">
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productMenu')"
>需求管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="linkProject()"
>关联项目</el-button
>
</span>
</el-row>
<el-row v-else-if="i.id == '1'"
><!--研发中-->
<span v-if="xmProduct.pstatus == i.id">
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productIteration')"
>迭代管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productQuestion')"
>缺陷管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productProjectLink')"
>项目管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productReport')"
>效能分析</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="
editXmProductSomeFields(xmProduct, 'pstatus', '2')
"
>设为已完成</el-button
>
</span>
<span v-if="xmProduct.pstatus != i.id">
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productIteration')"
>迭代管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productQuestion')"
>缺陷管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productProjectLink')"
>项目管理</el-button
>
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="jumpTo('productReport')"
>效能分析</el-button
>
</span>
</el-row>
<el-row v-else-if="i.id == '2'"
><!--已完成-->
<span v-if="xmProduct.pstatus == i.id">
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="
editXmProductSomeFields(xmProduct, 'pstatus', '3')
"
>设为已关闭</el-button
>
</span>
<span v-if="xmProduct.pstatus != i.id">
</span>
</el-row>
<el-row v-else-if="i.id == '3'"
><!--已关闭-->
<span v-if="xmProduct.pstatus == i.id">
<el-button
class="step-btn"
type="warning"
size="mini"
plain
@click="
editXmProductSomeFields(xmProduct, 'pstatus', '0')
"
>重新打开</el-button
>
</span>
<span v-if="xmProduct.pstatus != i.id">
</span>
</el-row>
</el-row>
</el-step>
</el-steps>
</el-col>
<el-col :span="20">
<el-menu mode="horizontal" :default-active="showPanelName" @select="onMenuToolBarSelect">
<el-menu-item index="overview">
<span slot="title">产品概览</span>
</el-menu-item>
@ -27,8 +216,8 @@
<span slot="title">历史审批流</span>
</el-menu-item>
</el-menu>
<xm-product-overview v-if="showPanelName=='overview'" :xm-product="xmProduct"></xm-product-overview>
</el-menu>
<xm-product-overview v-if="showPanelName=='overview'" :xm-product="xmProduct"></xm-product-overview>
<xm-product-edit v-if="showPanelName=='detail'" :xm-product="xmProduct"></xm-product-edit>
<xm-iteration-link-for-product v-if="showPanelName=='iterationProductLink'" :xm-product="xmProduct"></xm-iteration-link-for-product>
<xm-product-project-link-mng v-if="showPanelName=='productProjectLink'" :xm-product="xmProduct"></xm-product-project-link-mng>
@ -44,8 +233,10 @@
<font color="blue" style="font-size:10px;">将从项目任务汇总进度预算工作量实际工作量预算金额实际金额等数据到需求统计表</font>
</el-row>
</div>
<task-mng v-if="showPanelName === 'currFlow' " ref="currFlow" :biz-parent-pkid="xmProduct.id" > </task-mng>
<procinst-mng v-if="showPanelName === 'hisFlow' " ref="hisFlow" isAll="true" :biz-parent-pkid="xmProduct.id"></procinst-mng>
<task-mng v-if="showPanelName === 'currFlow' " ref="currFlow" :biz-parent-pkid="xmProduct.id" > </task-mng>
<procinst-mng v-if="showPanelName === 'hisFlow' " ref="hisFlow" isAll="true" :biz-parent-pkid="xmProduct.id"></procinst-mng>
</el-col>
</el-row>
</section>
</template>
@ -61,21 +252,50 @@ import { listXmProductWithState } from '@/api/xm/core/xmProduct';
import { loadTasksToXmMenuState} from '@/api/xm/core/xmMenuState';
import TaskMng from '@/views/mdp/workflow/ru/task/TaskMng';
import ProcinstMng from '@/views//mdp/workflow/hi/procinst/ProcinstMng';
import { initDicts,editXmProductSomeFields } from "@/api/xm/core/xmProduct";
export default {
components: { XmProductOverview, XmProductEdit, XmProductProjectLinkMng,TaskMng,ProcinstMng,},
computed: {
...mapGetters(["userInfo","xmProduct"]),
calcProductPstatusStep() {
if (this.dicts["xmProductPstatus"] && this.xmProduct) {
var index = this.dicts["xmProductPstatus"].findIndex((i) => {
if (i.id == this.xmProduct.pstatus) {
return true;
} else {
return false;
}
});
return index + 1;
} else {
return 0;
}
},
},
watch:{
},
data() {
return {
dicts:{xmProductPstatus:[]},
maxTableHeight:500,
showPanelName:'overview',
load:{calcProduct:false,calcMenu:false}
};
},
methods:{
jumpTo(name){
this.$router.push({
name:name,
query:{
productId:this.xmProduct.id
}
})
},
loadTasksToXmProductState: function () {
this.load.calcProduct=true;
@ -115,11 +335,92 @@ export default {
},
onMenuToolBarSelect(menuIndex){
this.showPanelName=menuIndex;
}
},
showCurrFlow() {
this.showPanelName = "currFlow";
},
showHisFlow() {
this.showPanelName = "hisFlow";
},
showDetail() {
this.showPanelName = "detail";
},
showProjectGaiSuan() {
this.showPanelName = "detail";
this.$nextTick(() => {
this.$refs[
"projectEdit"
].currTabPane = "4";
});
},
showProjectShouYi() {
this.showPanelName = "detail";
this.$nextTick(() => {
this.$refs[
"projectEdit"
].currTabPane = "5";
});
},
linkProject() {
this.showPanelName = "productProjectLink";
},
createProduct() {
this.infotype = "产品";
this.$nextTick(() => {
this.addProductVisible = true;
});
},
editXmProductSomeFields(row,fieldName,$event){
var that=this;
var func=(params)=>{
editXmProductSomeFields(params).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.$emit('edit-fields',params)
Object.assign(row,params)
this.xmProductBak=Object.assign({},row)
}else{
Object.assign(this.xmProduct,this.xmProductBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
})
}
var params={ids:[row.id]};
params[fieldName]=$event
if(fieldName=='description'){
this.$refs.xmProduct.validateField('description',err=>{
if(err){
this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'})
return;
}else{
func(params)
}
})
}else if(fieldName=='name'){
this.$refs.xmProduct.validateField('name',err=>{
if(err){
this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'})
return;
}else{
func(params)
}
})
}else{
func(params)
}
},
},
mounted() {
initDicts(this)
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.pageBody.$el);
});
},
@ -128,4 +429,21 @@ export default {
<style scoped lang="scss">
.menus {
.el-menu-item {
padding-left: 0px !important;
}
}
/* 超过宽度则用...代替 */
.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.step-btn {
margin-left: 0px;
margin-bottom: 5px;
}
</style>

157
src/views/xm/core/xmProduct/top-nav.vue

@ -47,7 +47,7 @@
</span>
</el-menu-item>
<el-menu-item :index="'/xm/core/product/project?productId='+xmProduct.id">
<span slot="title"><i class="el-icon-s-opportunity"></i>项目</span>
<span slot="title"><i class="el-icon-odometer"></i>项目</span>
</el-menu-item>
<el-menu-item label="需求" :index="'/xm/core/product/menu?productId='+xmProduct.id" class="hidden-md-and-down">
<span slot="title"><i class="el-icon-document"></i>需求</span>
@ -120,139 +120,19 @@
<el-menu-item index="/helpCenter">
<span slot="title"><i class="el-icon-date"></i>客服</span>
</el-menu-item>
<el-menu-item index="回到项目列表页" @click.native="goBack">
<el-menu-item index="/xm/core/xmProduct/XmProductMng" >
<span slot="title"
><i class="el-icon-back"></i>回到项目列表页</span
><i class="el-icon-back"></i>回到产品列表页</span
>
</el-menu-item>
<el-menu-item index="首页" @click.native="goHome">
<el-menu-item index="/">
<span slot="title"
><i class="el-icon-s-home"></i>首页</span
>
</el-menu-item>
</el-submenu>
</el-menu>
</el-row>
<!--
<el-row ref="pageBody">
<el-col :span="infotype=='项目概览'?20:24">
<xm-product-overview-complex
v-if="infotype == '项目概览'"
:sel-product="xmProduct"
@submit="afterEditSubmit"
@edit-fields="onEditFields"
ref="项目概览"
></xm-product-overview-complex>
<xm-product-for-link-complex
v-if="infotype == '产品'"
ref="xmProductComplex"
:sel-product="xmProduct"
></xm-product-for-link-complex>
<xm-iteration-for-link-complex
v-if="infotype == '迭代'"
ref="xmIterationMng"
:sel-product="xmProduct"
></xm-iteration-for-link-complex>
<xm-menu-mng
v-if="infotype == '需求'"
:sel-product="xmProduct"
></xm-menu-mng>
<xm-task-mng
v-if="infotype == '任务'"
ref="xmTaskMng"
:sel-product="xmProduct"
ptype="0"
queryScope="task"
key="task"
></xm-task-mng>
<xm-question
v-if="infotype == '缺陷'"
:qtype="'1'"
:sel-product="xmProduct"
ref="xmQuestion"
></xm-question>
<xm-group-mng
v-if="infotype == '团队'"
:sel-product="xmProduct"
></xm-group-mng>
<xm-file-mng
v-if="infotype == '文档'"
:sel-product="xmProduct"
></xm-file-mng>
<xm-plan
v-if="infotype == '计划'"
ref="productPlan"
ptype="0"
queryScope="planTask"
:sel-product="xmProduct"
key="productPlan"
></xm-plan>
<xm-test-case-exec-mng
v-if="infotype == '测试计划'"
:visible="infotype == '测试计划'"
:sel-product="xmProduct"
ref="xmQuestion"
></xm-test-case-exec-mng>
<xm-budget
v-if="infotype == '预算'"
:sel-product="xmProduct"
></xm-budget>
<xm-cost v-if="infotype == '费用'" :sel-product="xmProduct"></xm-cost>
<xm-product-kpi
v-if="infotype == '考核'"
:sel-product="xmProduct"
></xm-product-kpi>
<xm-record
v-if="infotype == '日志'"
:visible="infotype == '日志'"
:sel-product="xmProduct"
></xm-record>
<xm-contract
v-if="infotype == '合同管理'"
:sel-product="xmProduct"
></xm-contract>
<xm-env-list
v-if="infotype == '环境清单'"
:sel-product="xmProduct"
></xm-env-list>
<xm-question
v-if="infotype == '风险'"
:qtype="'2'"
:sel-product="xmProduct"
ref="xmRisk"
></xm-question>
<el-drawer
title="选中团队成员"
:visible.sync="groupUserVisible"
size="50%"
append-to-body
:close-on-click-modal="false"
>
<xm-group-select
:sel-product="xmProduct"
:visible="groupUserVisible"
is-select-multi-user="1"
@user-confirm="onUserSelected"
></xm-group-select>
</el-drawer>
<xm-report
v-if="infotype == '效能'"
:xm-product="xmProduct"
></xm-report>
<xm-workload-set-day-list
v-if="infotype == '每日工时'"
:xm-product="xmProduct"
></xm-workload-set-day-list>
<xm-workload-set-month-list
v-if="infotype == '每月工时'"
:xm-product="xmProduct"
></xm-workload-set-month-list>
</el-col>
</el-row>
-->
</el-row>
</section>
</template>
@ -298,32 +178,7 @@ export default {
methods: {
setInfotype(infotype) {
this.infotype = infotype;
},
/**
* 防止禁用弹框 _self模式
* @param {} url
*/
newWin(url) {
var id='toOpenWindow'
var a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('target', '_self');
a.setAttribute('id', id);
//
if(!document.getElementById(id)) document.body.appendChild(a);
a.click();
},
toForum(){
this.newWin('https://www.maimengcloud.com/#/communityForum');
},
goBack() {
this.$router.push({
path:'/xm/core/xmProduct/XmProductMng'
})
},
goHome(){
this.$router.push({path:'/'})
},
},
}, //end methods
components: {

3
src/views/xm/core/xmProject/XmProjectOverviewComplex.vue

@ -311,8 +311,9 @@ export default {
mounted() {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.pageBody.$el);
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.pageBody.$el);
});
},

31
src/views/xm/core/xmProject/top-nav.vue

@ -117,12 +117,12 @@
<el-menu-item index="/helpCenter">
<span slot="title"><i class="el-icon-date"></i>客服</span>
</el-menu-item>
<el-menu-item index="回到项目列表页" @click.native="goBack">
<el-menu-item index="/xm/core/xmProject/XmProjectMng">
<span slot="title"
><i class="el-icon-back"></i>回到项目列表页</span
>
</el-menu-item>
<el-menu-item index="首页" @click.native="goHome">
<el-menu-item index="/">
<span slot="title"
><i class="el-icon-s-home"></i>首页</span
>
@ -296,32 +296,7 @@ export default {
methods: {
setInfotype(infotype) {
this.infotype = infotype;
},
/**
* 防止禁用弹框 _self模式
* @param {} url
*/
newWin(url) {
var id='toOpenWindow'
var a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('target', '_self');
a.setAttribute('id', id);
//
if(!document.getElementById(id)) document.body.appendChild(a);
a.click();
},
toForum(){
this.newWin('https://www.maimengcloud.com/#/communityForum');
},
goBack() {
this.$router.push({
path:'/xm/core/xmProject/XmProjectMng'
})
},
goHome(){
this.$router.push({path:'/'})
},
},
}, //end methods
components: {

Loading…
Cancel
Save