Browse Source

优化

master
陈裕财 4 years ago
parent
commit
f59a53b1c6
  1. 1
      package.json
  2. 61
      src/components/Guider/Index.js
  3. 187
      src/components/Guider/guiderData.js
  4. 50
      src/views/xm/XmOverview.vue
  5. 43
      src/views/xm/core/xmProduct/XmProductMng.vue
  6. 77
      src/views/xm/core/xmProject/XmProjectMng.vue

1
package.json

@ -20,6 +20,7 @@
"codemirror": "5.32.0",
"dayjs": "^1.8.29",
"decimal.js": "^10.2.0",
"driver.js": "^0.9.8",
"dropzone": "5.2.0",
"echarts": "3.8.5",
"element-ui": "^2.13.0",

61
src/components/Guider/Index.js

@ -0,0 +1,61 @@
import Driver from 'driver.js';
import 'driver.js/dist/driver.min.css';
import guiderData from './guiderData'
var driver = new Driver({
className: 'driver-popover',
doneBtnText: '知道了', // 结束按钮的文字
allowClose: false, // 是否可以通过点击遮罩层关闭指引
stageBackground: '#ffffff', // 突出显示元素的背景颜色
nextBtnText: '下一步', // 下一步按钮的文字
prevBtnText: '上一步', // 上一步按钮的文字
closeBtnText: '关闭', // 关闭按钮的文字
keyboardControl: false, // 是否允许键盘操控
xCloseButton: true, // 将关闭按钮作为X放在弹出
onReset: (Element) => {
},
});
export default {
initDriver:function(guiderName){
var driver = new Driver({
className: 'driver-popover',
doneBtnText: '知道了', // 结束按钮的文字
allowClose: false, // 是否可以通过点击遮罩层关闭指引
stageBackground: '#ffffff', // 突出显示元素的背景颜色
nextBtnText: '下一步', // 下一步按钮的文字
prevBtnText: '上一步', // 上一步按钮的文字
closeBtnText: '永远关闭', // 关闭按钮的文字
keyboardControl: false, // 是否允许键盘操控
xCloseButton: true, // 将关闭按钮作为X放在弹出
onReset: (e) => {
var event= window.event;
if(event){
var target=event.target;
if(target && target.className=='driver-close-btn'){
localStorage.setItem("guider-"+guiderName,"1");
}
}
}
});
return driver;
},
startBySteps: function(steps) {
driver.defineSteps(steps);
driver.start();
},
startByName: function(guiderName,forceDisplayWhileClosed) {
var localExists=localStorage.getItem('guider-'+guiderName)
if(localExists=='1' && !forceDisplayWhileClosed){
return;
}
var driver2=this.initDriver(guiderName);
var steps=guiderData.getSteps(guiderName);
driver2.defineSteps(steps);
driver2.start();
},
}

187
src/components/Guider/guiderData.js

@ -0,0 +1,187 @@
var xmHomePage=[
{
element: '#XmProductAllMng',
popover: {
title: ' ',
description: '这里可以创建新产品,支持手工、复制现有项目、复制模板三种模式快速一键创建项目',
position: 'left'
}
},
{
element: '#XmMenuMng',
popover: {
title: ' ',
description: '这里可以进行需求管理,包括需求设计、需求迭代、需求细化、需求变更等。',
position: 'left'
},
padding: 5,
},
{
element: '#XmProjectAllMng',
popover: {
title: ' ',
description: '这里可以进行项目管理、计划管理、任务管理,可以通过复制项目模板、复制现有项目快速创建项目。',
position: 'left',
},
padding: 5,
},
{
element: '#XmMyTaskCenter',
popover: {
title: ' ',
description: '这里可以进行任务管理,包括填报任务进度、分配任务执行人、工作量填报等',
position: 'left',
},
padding: 5,
},
{
element: '#XmProjectGroupAllMng',
popover: {
title: ' ',
description: '这里可以快速创建项目、产品团队、快速管理团队成员。',
position: 'left',
},
padding: 5,
} ,
{
element: '#XmQuestionMng',
popover: {
title: ' ',
description: '这里可以进行测试管理、测试设计、测试执行等。',
position: 'left',
},
padding: 5,
} ,
{
element: '#TaskListAssigneeToMe',
popover: {
title: ' ',
description: '关于审批的所有事项,都可以从这里一站式管理。',
position: 'left',
},
padding: 5,
}
];
var xmProductMng=[
{
element: '#guider-one',
popover: {
title: ' ',
description: '这里可以创建新产品,支持手工、复制现有产品、复制模板三种模式快速一键创建产品',
position: 'bottom'
}
},
{
element: '#guider-two',
popover: {
title: ' ',
description: '这里可以选择更多的查询条件,或者更多的操作。',
position: 'bottom'
},
padding: 5,
},
{
element: '#guider-three',
popover: {
title: ' ',
description: '这里可以跳转到产品视图,查看更多信息、做产品相关的各种操作。',
position: 'top',
},
padding: 5,
},
{
element: '#guider-four',
popover: {
title: ' ',
description: '这里可以统计产品的总体进度、工作量等所有统计数据。',
position: 'left',
},
padding: 5,
},
{
element: '#guider-five',
popover: {
title: ' ',
description: '这里可以将产品快速复制为新的共享模板、新的产品,达到快速创建产品的效果。',
position: 'left',
},
padding: 5,
}
];
var xmProjectMng=[
{
element: '#prj-plus-btn',
popover: {
title: ' ',
description: '这里可以创建新项目,支持手工、复制现有项目、复制模板三种模式快速一键创建项目',
position: 'bottom'
}
},
{
element: '#prj-more-btn',
popover: {
title: ' ',
description: '这里可以选择更多的查询条件,或者更多的操作。',
position: 'bottom'
},
padding: 5,
},
{
element: '#prj-copy-btn',
popover: {
title: ' ',
description: '这里可以通过复制快速创建项目(同步复制项目计划、项目任务、项目团队及成员)',
position: 'right',
},
padding: 5,
},
{
element: '#prj-del-btn',
popover: {
title: ' ',
description: '这里可以把项目放入回收站(支持从回收站恢复)',
position: 'right',
},
padding: 5,
},
{
element: '#prj-calc-btn',
popover: {
title: ' ',
description: '这里可以把项目的所有统计数据更新为最新的汇总数据(包括进度、任务数、需求数、工作量等)',
position: 'right',
},
padding: 5,
},
{
element: '#prj-view-box',
popover: {
title: ' ',
description: '点击这个区域可以跳转到项目视图(可以管理项目计划、项目任务、项目变更、项目迭代、项目缺陷等)',
position: 'right',
},
padding: 5,
}
];
export default {
//请在下面添加数据
steps:{
xmHomePage,
xmProductMng,
xmProjectMng,
},
getSteps:function(guiderName){
if(this.steps[guiderName]){
return this.steps[guiderName]
}else{
return []
}
}
}

50
src/views/xm/XmOverview.vue

@ -131,53 +131,47 @@
</div>
<div class="menu">
<div class="menu-content">
<div class="quick-menu" @click="gotolink('/xm/core/xmProject/XmProjectAllMng')">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-project.png" />
</div>
<div class="quick-menu-text">项目管理</div>
</div>
<div class="quick-menu" @click="gotolink('/xm/core/xmProduct/XmProductAllMng')">
<div class="quick-menu" @click="gotolink('/xm/core/xmProduct/XmProductAllMng')" id="XmProductAllMng">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-attendance.png" />
</div>
<div class="quick-menu-text">产品管理</div>
</div>
<div class="quick-menu" @click="gotolink('/xm/core/xmMenu/XmMenuMng')">
<div class="quick-menu" @click="gotolink('/xm/core/xmMenu/XmMenuMng')" id="XmMenuMng">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-contract.png" />
</div>
<div class="quick-menu-text">需求管理</div>
</div>
<div class="quick-menu" @click="gotolink('/xm/core/xmQuestion/XmQuestionMng')">
<div class="quick-menu" @click="gotolink('/xm/core/xmProject/XmProjectAllMng')" id="XmProjectAllMng">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-fake.png" />
<img src="../../assets/image/platform/module-project.png" />
</div>
<div class="quick-menu-text">缺陷管理</div>
<div class="quick-menu-text">项目管理</div>
</div>
<div class="quick-menu" @click="gotolink('/xm/core/xmProjectGroup/XmProjectGroupAllMng')">
<div class="quick-menu" @click="gotolink('/xm/core/xmTask/XmMyTaskCenter')" id="XmMyTaskCenter">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-code.png" />
</div>
<div class="quick-menu-text">开发任务</div>
</div>
<div class="quick-menu" @click="gotolink('/xm/core/xmProjectGroup/XmProjectGroupAllMng')" id="XmProjectGroupAllMng">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-organization.png" />
</div>
<div class="quick-menu-text">团队管理</div>
</div>
<div class="quick-menu" @click="gotolink('/mdp/workflow/ru/task/TaskListAssigneeToMe')">
<div class="quick-menu" @click="gotolink('/xm/core/xmQuestion/XmQuestionMng')" id="XmQuestionMng">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-task.png" />
<img src="../../assets/image/platform/module-fake.png" />
</div>
<div class="quick-menu-text">待审事项</div>
<div class="quick-menu-text">缺陷管理</div>
</div>
<div class="quick-menu" @click="gotolink('/xm/core/xmTask/XmMyTaskCenter')">
<div class="quick-menu" @click="gotolink('/mdp/workflow/ru/task/TaskListAssigneeToMe')" id="TaskListAssigneeToMe">
<div class="quick-menu-icon-outer">
<img src="../../assets/image/platform/module-code.png" />
<img src="../../assets/image/platform/module-task.png" />
</div>
<div class="quick-menu-text">开发任务</div>
<div class="quick-menu-text">待审事项</div>
</div>
</div>
</div>
@ -343,6 +337,8 @@ import util from "@/common/js/util"; // 全局公共库
import { mapGetters } from "vuex";
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listXmBranchState,loadProjectStateToXmBranchState } from '@/api/xm/core/xmBranchState';
import Guider from '@/components/Guider/Index.js';
export default {
computed: {
...mapGetters(["userInfo"]),
@ -810,11 +806,17 @@ export default {
gotolink(link) {
this.$router.replace(link);
},
/**end 自定义函数请在上面加**/
guiderStart(forceDisplayWhileClosed) { //
Guider.startByName('xmHomePage',forceDisplayWhileClosed);
},
},
mounted() {
this.$nextTick(() => {
this.maxTableHeight=util.calcTableMaxHeight(this.$refs.table.$el)
this.guiderStart();
});
this.drawAllBar();
this.drawTaskByDate();

43
src/views/xm/core/xmProduct/XmProductMng.vue

@ -5,7 +5,7 @@
<xm-product-tpl-mng @copy="searchXmProducts" ref="xmProductTplMngRef" show-type="simple"></xm-product-tpl-mng>
</el-col>
<el-col :span="templateVisible?18:24" class="padding-top padding-left border">
<el-row>
<el-row >
<el-row>
<el-select v-model="filters.queryScope" placeholder="产品查询范围">
<el-option :label="userInfo.branchName+'机构下所有的产品'" value="branchId"></el-option>
@ -30,7 +30,7 @@
</el-col>
<el-col :span="24" style="padding-top:5px;">
<el-badge value="进阶">
<el-button type="primary" icon="el-icon-plus">通过产品-复制一键创建新的产品</el-button>
<el-button type="primary" icon="el-icon-plus" >通过产品-复制一键创建新的产品</el-button>
</el-badge>
</el-col>
<el-col :span="24" style="padding-top:5px;">
@ -39,7 +39,7 @@
</el-badge>
</el-col>
</el-row>
<el-button type="primary" slot="reference" icon="el-icon-plus" v-if="!xmIteration">产品</el-button>
<el-button type="primary" slot="reference" icon="el-icon-plus" v-if="!xmIteration" id="guider-one" >产品</el-button>
</el-popover>
<el-popover
placement="top-start"
@ -105,10 +105,12 @@
</font>
</el-col>
<el-col :span="24" style="padding-top:10px;">
<el-button type="primary" @click="searchXmProducts" >查询</el-button><el-button type="text" @click="templateVisible=!templateVisible" >{{templateVisible?"":""}}</el-button>
<el-button type="primary" @click="searchXmProducts" >查询</el-button>
<el-button type="text" @click="templateVisible=!templateVisible" >{{templateVisible?"隐藏模板":"显示模板"}}</el-button>
<el-button type="text" @click="guiderStart(true)" icon="el-icon-help">新手导航</el-button>
</el-col>
</el-row>
<el-button slot="reference" icon="el-icon-more"></el-button>
<el-button slot="reference" icon="el-icon-more" id="guider-two"></el-button>
</el-popover>
</el-row>
<el-row class="page-main " v-show="showType">
@ -153,9 +155,9 @@
<el-table-column type="index" width="60">
</el-table-column>
<el-table-column prop="productName" label="产品名称" min-width="200" sortable>
<template slot-scope="scope">
<el-link type="primary" @click="intoInfo(scope.row)">{{scope.row.productName}}</el-link>
<el-table-column prop="productName" label="产品名称" min-width="200" sortable >
<template slot-scope="scope" >
<el-link id="guider-three" type="primary" @click="intoInfo(scope.row)">{{scope.row.productName}}</el-link>
</template>
</el-table-column>
<el-table-column prop="pstatus" label="状态" width="100" sortable :formatter="formatPstatus">
@ -164,7 +166,7 @@
<template slot-scope="scope">
<font ><el-tag :type="scope.row.finishRate>=100?'success':'warning'">{{scope.row.finishRate}}%</el-tag>
<el-tooltip content="点击统计进度,由任务汇总"><el-button type="text" icon="el-icon-video-play" @click.stop="loadTasksToXmProductState( scope.row)"></el-button></el-tooltip>
<el-tooltip content="点击统计进度,由任务汇总"><el-button id="guider-four" type="text" icon="el-icon-video-play" @click.stop="loadTasksToXmProductState( scope.row)"></el-button></el-tooltip>
</font>
</template>
@ -182,7 +184,7 @@
<el-table-column label="操作" width="350" fixed="right">
<template slot-scope="scope">
<el-button type="text" title="通过复制创建新的产品" @click="onCopyToBtnClick(scope.row)" :disabled="load.add" v-loading="load.add">复制</el-button>
<el-button id="guider-five" type="text" title="通过复制创建新的产品" @click="onCopyToBtnClick(scope.row)" :disabled="load.add" v-loading="load.add">复制</el-button>
<el-button type="text" @click="showProductState(scope.row)" icon="el-icon-s-data">报告</el-button>
<el-button type="text" @click="toIterationList(scope.row)" icon="el-icon-document">迭代</el-button>
<el-button type="text" @click="toProjectList(scope.row)" icon="el-icon-document">项目</el-button>
@ -280,7 +282,9 @@
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import XmProjectList from '../xmProject/XmProjectList.vue';
import XmIterationSelect from '../xmIteration/XmIterationSelect.vue';
import XmProductSelect from './XmProductSelect.vue';
import XmProductSelect from './XmProductSelect.vue';
import Guider from '@/components/Guider/Index.js';
export default {
props:['selProject','xmIteration'],
@ -350,8 +354,6 @@ import XmProductSelect from './XmProductSelect.vue';
},
copyToVisible:false,
templateVisible:false,
/**begin 自定义属性请在下面加 请加备注**/
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
@ -401,7 +403,7 @@ import XmProductSelect from './XmProductSelect.vue';
}).catch( err => this.load.edit=false );
},
// XmProduct
getXmProducts() {
getXmProducts(callBack) {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
@ -454,6 +456,11 @@ import XmProductSelect from './XmProductSelect.vue';
}else{
this.$notify({showClose: true, message: tips.msg, type: 'error' });
}
if(callBack){
this.$nextTick(()=>{
callBack();
})
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
@ -669,7 +676,9 @@ import XmProductSelect from './XmProductSelect.vue';
})
},
/**end 自定义函数请在上面加**/
guiderStart(forceDisplayWhileClosed) { //
Guider.startByName('xmProductMng',forceDisplayWhileClosed);
},
},//end methods
components: {
'xm-product-add':XmProductAdd,
@ -692,9 +701,9 @@ import XmProductSelect from './XmProductSelect.vue';
});
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.getXmProducts();
this.getXmProducts(this.guiderStart);
});
}
},
}
</script>

77
src/views/xm/core/xmProject/XmProjectMng.vue

@ -32,6 +32,30 @@
<el-input v-model="filters.key" style="width:15%;" placeholder="项目名称模糊查询" clearable>
</el-input>
<el-button type="primary" icon="el-icon-search" @click="searchXmProjects">查询</el-button>
<el-popover style="padding-left:10px;"
placement="top-start"
width="450"
trigger="click" >
<el-row>
<el-col :span="24" style="padding-top:5px;">
<el-badge value="都适用">
<el-button @click="showAdd" icon="el-icon-plus">直接添加新项目</el-button>
</el-badge>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<el-badge value="进阶">
<el-button type="primary" icon="el-icon-plus">通过产品-复制一键创建新的项目</el-button>
</el-badge>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<el-badge value="新手">
<el-button type="warning" @click="templateVisible=!templateVisible" icon="el-icon-plus">通过模板-复制一键创建新的项目</el-button>
</el-badge>
</el-col>
</el-row>
<el-button id="prj-plus-btn" type="primary" slot="reference" icon="el-icon-plus">项目</el-button>
</el-popover>
<el-popover
placement="top-start"
title="更多查询条件或操作"
@ -66,46 +90,23 @@
<el-col :span="24" style="padding-top:5px;">
<el-button type="primary" icon="el-icon-search" @click="searchXmProjects">查询</el-button>
<el-button type="text" @click="templateVisible=!templateVisible">{{templateVisible?'隐藏模板':'显示模板'}}</el-button>
<el-button type="text" @click="guiderStart(true)" icon="el-icon-help">新手导航</el-button>
</el-col>
</el-row>
<el-button slot="reference" icon="el-icon-more"></el-button>
</el-popover>
<el-popover style="padding-left:10px;"
placement="top-start"
width="450"
trigger="click" >
<el-row>
<el-col :span="24" style="padding-top:5px;">
<el-badge value="都适用">
<el-button @click="showAdd" icon="el-icon-plus">直接添加新项目</el-button>
</el-badge>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<el-badge value="进阶">
<el-button type="primary" icon="el-icon-plus">通过产品-复制一键创建新的项目</el-button>
</el-badge>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<el-badge value="新手">
<el-button type="warning" @click="templateVisible=!templateVisible" icon="el-icon-plus">通过模板-复制一键创建新的项目</el-button>
</el-badge>
</el-col>
</el-row>
<el-button type="primary" slot="reference" icon="el-icon-plus">项目</el-button>
<el-button slot="reference" icon="el-icon-more" id="prj-more-btn"></el-button>
</el-popover>
</el-menu>
</el-row>
<el-row class="page-main">
<!--列表 XmProject xm_project-->
<el-row v-show="showType" v-loading="load.list" :style="{overflowX:'hidden',height:maxTableHeight+'px'}" ref="table1">
<el-col v-cloak v-for="(p,i) in ScreenData" :key="i" :xl="8" :lg="8" :md="8" :sm="12">
<el-card @click.native="intoInfo(p,i)" class="project-card" shadow="always">
<el-card @click.native="intoInfo(p,i)" class="project-card" shadow="always" id="prj-view-box">
<div class="project-name" title="这是项目名称">{{p.name}}</div>
<div class="project-id"><span title="项目代号">{{p.code}} </span><font title="项目状态" :color="p.status=='7'?'green':'blue'">{{formatProjectStatus(p.status)}}</font>
<el-link type="danger" style="font-size:14px;float:right;margin-left:2px;" title="删除项目" @click.stop="handleDel(p)" v-loading="load.add">删除</el-link>
<el-link type="primary" style="font-size:14px;float:right;margin-left:2px;" title="通过复制快速创建新项目" @click.stop="onCopyToBtnClick(p)" v-loading="load.add">复制</el-link>
<el-link type="warning" style="font-size:14px;float:right;margin-left:2px;" title="统计项目的工作量、进度、需求、bugs等数据" @click.stop="loadTasksToXmProjectState(p)" v-loading="load.add">统计</el-link>
<el-link id="prj-del-btn" type="danger" style="font-size:14px;float:right;margin-left:2px;" title="删除项目" @click.stop="handleDel(p)" v-loading="load.add">删除</el-link>
<el-link id="prj-copy-btn" type="primary" style="font-size:14px;float:right;margin-left:2px;" title="通过复制快速创建新项目" @click.stop="onCopyToBtnClick(p)" v-loading="load.add">复制</el-link>
<el-link id="prj-calc-btn" type="warning" style="font-size:14px;float:right;margin-left:2px;" title="统计项目的工作量、进度、需求、bugs等数据" @click.stop="loadTasksToXmProjectState(p)" v-loading="load.add">统计</el-link>
</div>
<div class="project-info">
@ -322,6 +323,7 @@
}
import Guider from '@/components/Guider/Index.js';
export default {
props:['dataScope'],
@ -428,7 +430,7 @@
this.getXmProjects();
},
// XmProject xm_project
getXmProjects() {
getXmProjects(callBack) {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
@ -472,6 +474,11 @@
}else{
this.$notify({showClose: true, message: tips.msg, type: 'error' });
}
if(callBack){
this.$nextTick(()=>{
callBack();
})
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
@ -824,7 +831,11 @@
}
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.edit=false );
}
},
guiderStart(forceDisplayWhileClosed) { //
Guider.startByName('xmProjectMng',forceDisplayWhileClosed);
},
/**end 自定义函数请在上面加**/
},//end methods
@ -854,7 +865,7 @@
});
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table1.$el);
this.showInfo = false;
this.getXmProjects();
this.getXmProjects(this.guiderStart);
});
},
}

Loading…
Cancel
Save