Browse Source

优化

master
陈裕财 4 years ago
parent
commit
37c8e87834
  1. 80
      src/views/xm/core/xmMenu/XmEpicFeatures.vue
  2. 366
      src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue
  3. 2
      src/views/xm/core/xmMenu/XmMenuSelect.vue

80
src/views/xm/core/xmMenu/XmEpicFeatures.vue

@ -2,9 +2,9 @@
<section>
<el-row>
<el-col :span="24" class="padding-left">
<el-row v-if="!disabledMng">
<el-row >
<xm-product-select ref="xmProductSelect1" style="display:inline;" v-if="!xmProduct && !xmIteration" :auto-select="false" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClearSelect"></xm-product-select>
<span style="float:right;">
<span style="float:right;" v-if="!disabledMng">
<el-popover style="padding-left:10px;"
placement="top-start"
width="250"
@ -103,25 +103,7 @@
</el-dialog>
<el-drawer title="需求模板" :visible.sync="menuTemplateVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-menu-template-mng :is-select-menu="true" :visible="menuTemplateVisible" @cancel="menuTemplateVisible=false" @selected-menus="onSelectedMenuTemplates"></xm-menu-template-mng>
</el-drawer>
<el-drawer title="需求谈论" :visible.sync=" menuDetailVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-menu-rich-detail :visible="menuDetailVisible" :reload="false" :xm-menu="editForm" ></xm-menu-rich-detail>
</el-drawer>
<el-drawer title="选中任务" :visible.sync="selectTaskVisible" size="80%" append-to-body :close-on-click-modal="false">
<xm-task-list :xm-product="filters.product" :sel-project="selProject" query-scope="planTask" check-scope="task" :is-multi-select="true" @tasks-selected="onSelectedTasks"></xm-task-list>
</el-drawer>
<el-drawer title="查看任务" :visible.sync="taskListForMenuVisible" :with-header="false" size="80%" append-to-body :close-on-click-modal="false">
<xm-task-list-for-menu :xm-product="filters.product" :is-multi-select="true" :menu-id="editForm.menuId"></xm-task-list-for-menu>
</el-drawer>
<el-drawer
append-to-body
title="任务"
:visible.sync="taskMngVisible"
:with-header="false"
size="80%">
<xm-task-mng :sel-project="selProject" :menu-id="editForm.menuId" :menu-name="editForm.menuName"></xm-task-mng>
</el-drawer>
</el-drawer>
<el-drawer title="选择员工" :visible.sync="selectFiltersMmUserVisible" size="60%" append-to-body>
<users-select @confirm="onFiltersMmUserSelected" ref="selectFiltersMmUser"></users-select>
</el-drawer>
@ -132,22 +114,10 @@
<tag-dialog ref="tagDialog" :tagIds="filters.tags?filters.tags.map(i=>i.tagId):[]" :jump="true" @select-confirm="onTagSelected">
</tag-dialog>
<xm-group-dialog ref="xmGroupDialog" :isSelectSingleUser="true" :sel-project="selProject" :xm-product="filters.xmProduct" @user-confirm="onGroupUserSelect">
</xm-group-dialog>
<el-drawer
append-to-body
title="需求选择"
:visible.sync="parentMenuVisible"
size="70%"
:close-on-click-modal="false"
>
<xm-menu-select
:visible="parentMenuVisible"
:is-select-menu="true"
check-scope="1"
@selected="onParentMenuSelected"
:xm-product="filters.product"
></xm-menu-select>
</el-drawer>
</xm-group-dialog>
<el-dialog append-to-body width="60%" top="20px" :visible.sync="parentMenuVisible">
<xm-epic-features-select :xm-product="xmProduct" @select="onParentMenuSelected"></xm-epic-features-select>
</el-dialog>
</section>
</template>
@ -164,21 +134,13 @@
import XmMenuAdd from './XmMenuAdd';//
import XmMenuEdit from './XmMenuEdit';//
import XmMenuMngBatch from './XmMenuMngBatch';//
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
import XmMenuTemplateMng from '../xmMenuTemplate/XmMenuTemplateMng';//
import XmMenuRichDetail from './XmMenuRichDetail';
import XmTaskList from '../xmTask/XmTaskList';
import XmTaskMng from '../xmTask/XmTaskMng';
import XmTaskListForMenu from '../xmTask/XmTaskListForMenu';
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//
import XmMenuWorkload from '@/views/xm/core/components/XmMenuWorkload';//
import XmTableConfig from '@/views/xm/core/components/XmTableConfig';//
import XmGroupDialog from '@/views/xm/core/xmGroup/XmGroupDialog';//
import XmGroupDialog from '@/views/xm/core/xmGroup/XmGroupDialog';//
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import XmMenuSelect from "../xmMenu/XmMenuSelect";
import TagDialog from "@/views/mdp/arc/tag/TagDialog";
import XmEpicFeaturesSelect from "@/views/xm/core/xmMenu/XmEpicFeaturesSelect";
import {sn} from '@/common/js/sequence'
@ -1080,27 +1042,17 @@
Object.assign(this.editForm,params)
},
onAddSubMenu(row){
treeTool.reloadAllChildren(this.$refs.table,this.maps,[this.editForm,row],'pmenuId',this.loadXmMenusLazy)
}
}
},//end methods
components: {
'xm-menu-add':XmMenuAdd,
'xm-menu-edit':XmMenuEdit,
XmProductSelect,
XmMenuTemplateMng,
XmMenuRichDetail,
XmTaskList,
XmTaskMng,
XmTaskListForMenu,
UsersSelect,
XmMenuMngBatch,
TagDialog,
XmMenuSelect,
XmMenuWorkload,
XmTableConfig,
XmGroupDialog,
XmIterationSelect,
XmMenuTemplateMng,
UsersSelect,
TagDialog,
XmGroupDialog, XmEpicFeaturesSelect,
//
},
mounted() {

366
src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue

@ -0,0 +1,366 @@
<template>
<section>
<el-row>
<el-col :span="24" class="padding-left">
<el-row >
<xm-product-select ref="xmProductSelect1" style="display:inline;" v-if="!xmProduct && !xmIteration" :auto-select="false" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClearSelect"></xm-product-select>
</el-row>
<el-row>
<el-table stripe fit border ref="table" :height="maxTableHeight" :data="xmMenusTreeData" current-row-key="menuId" row-key="menuId" :tree-props="{children: 'children'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" @selection-change="selsChange" @row-click="rowClick">
<el-table-column prop="menuName" label="史诗、特性名称" min-width="150" >
<template slot-scope="scope">
<div v-if="scope.row.dclass=='1'" class="icon" style="background-color: rgb(255, 153, 51);">
<i class="el-icon-s-promotion"></i>
</div>
<div v-if="scope.row.dclass=='2'" class="icon" style="background-color: rgb(0, 153, 51);">
<i class="el-icon-s-flag"></i>
</div>
<div v-if="scope.row.dclass=='3'" class="icon" style="background-color: rgb(79, 140, 255);">
<i class="el-icon-document"></i>
</div>
<span>{{scope.row.seqNo}} &nbsp; {{scope.row.menuName}} </span>
</template>
</el-table-column>
<template>
<el-table-column label="操作" width="100" >
<template slot-scope="scope">
<el-button @click="select( scope.row,scope.$index)" title="选择" type="primary"> 选择</el-button>
</template>
</el-table-column>
</template>
</el-table>
</el-row>
</el-col>
</el-row>
<el-pagination layout="total, sizes, prev, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</section>
</template>
<script>
import util from '@/common/js/util';//
import treeTool from '@/common/js/treeTool';//
//import Sticky from '@/components/Sticky' // header
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmMenu, delXmMenu, batchDelXmMenu,batchAddXmMenu,batchEditXmMenu,listXmMenuWithState,listXmMenuWithPlan,batchChangeParentMenu,editXmMenuSomeFields } from '@/api/xm/core/xmMenu';
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
import {sn} from '@/common/js/sequence'
import { mapGetters } from 'vuex'
export default {
props:['selProject','xmIteration','xmProduct','disabledMng'],
computed: {
...mapGetters([
'userInfo','roles'
]),
xmMenusTreeData() {
let xmMenus = JSON.parse(JSON.stringify(this.xmMenus || []));
let xmMenusTreeData = treeTool.translateDataToTree(xmMenus,"pmenuId","menuId");
return xmMenusTreeData;
},
},
watch:{
xmIteration:function(){
this.filters.iterationFilterType="join-curr-iteration"
this.filters.iteration=this.xmIteration
this.getXmMenus()
},
xmProduct:function(){
this.filters.product=this.xmProduct
this.getXmMenus()
},
selProject:function(){
this.getXmMenus();
}
},
data() {
return {
columnsConfig:[/**{label:'',property:'',isShow:true} */],
filters: {
key: '',
product:null,
mmUser:null,
iterationFilterType:'',//joinnot-join''
taskFilterType:'',//joinnot-join''
tags:[],
status:'',
iteration:null,
dlvl:'',
dtype:'',
priority:'',
source:'',
dclasss:['1','2'],
menuId:'',//
productId:'',//
},
xmMenus: [],//
pageInfo:{//
total:0,//0>0
pageSize:20,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
dicts:{
menuStatus:[
{id:"0", name:"初始"},
{id:"1", name:"待评审"},
{id:"2", name:"待设计"},
{id:"3", name:"待开发"},
{id:"4", name:"待SIT"},
{id:"5", name:"待UAT"},
{id:"6", name:"待上线"},
{id:"7", name:"运行中"},
{id:"8", name:"已下线"},
{id:"9", name:"已删除"},
],
dclass:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
//xmMenu
editForm: {
menuId:'',menuName:'',pmenuId:'',productId:'',remark:'',status:'',online:'',demandUrl:'',codeUrl:'',designUrl:'',docUrl:'',helpUrl:'',operDocUrl:'',ntype:'0',childrenCnt:0,sinceVersion:'',proposerId:'',proposerName:'',dlvl:'0',dtype:'0',priority:'0',source:'1'
},
parentMenu:null,
maxTableHeight:300,
productVisible:false,
parentMenuVisible:false,
}
},//end data
methods: {
selectVisible(row,visible){
if(visible){
this.rowClick(row)
}
},
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmMenus();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmMenus();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getXmMenus();
},
searchXmMenus(){
this.pageInfo.count=true;
this.getXmMenus();
},
getParams(params){
if( this.filters.key){
params.key="%"+this.filters.key+"%"
}
if(this.filters.mmUser){
params.mmUserid=this.filters.mmUser.userid;
}
if(this.filters.iterationFilterType){
params.iterationFilterType=this.filters.iterationFilterType
if(params.iterationFilterType==='not-join-any-iteration'){
}else if(params.iterationFilterType==='join-any-iteration'){
}else if(params.iterationFilterType==='not-join-curr-iteration'){
params.filterIterationId=this.filters.iteration.id
}else if(params.iterationFilterType==='join-curr-iteration'){
params.filterIterationId=this.filters.iteration.id
}
params.ntype="0"
}else{
if(this.filters.iteration){
params.iterationId=this.filters.iteration.id
}
}
if(this.xmIteration && this.xmIteration.id){
params.linkIterationId=this.xmIteration.id
}
if(this.filters.taskFilterType){
params.taskFilterType=this.filters.taskFilterType
if(params.taskFilterType==='not-join-curr-project'){
params.projectId=this.selProject.id
}
if(params.taskFilterType==='join-curr-project'){
params.projectId=this.selProject.id
}
params.ntype="0"
}
if(this.selProject && this.selProject.id){
params.linkProjectId=this.selProject.id
}
if(this.filters.product){
params.productId=this.filters.product.id
}
if(this.filters.status){
params.status=this.filters.status
}
if(this.filters.dlvl){
params.dlvl=this.filters.dlvl
}
if(this.filters.dtype){
params.dtype=this.filters.dtype
}
if(this.filters.priority){
params.priority=this.filters.priority
}
if(this.filters.source){
params.source=this.filters.source
}
if( this.dateRanger && this.dateRanger.length==2){
params.ctimeStart=this.dateRanger[0]
params.ctimeEnd=this.dateRanger[1]
}
if(this.filters.tags && this.filters.tags.length>0){
params.tagIdList=this.filters.tags.map(i=>i.tagId)
}
if(this.filters.dclasss){
params.dclasss=this.filters.dclasss
}
if(this.filters.menuId){
params.menuId=this.filters.menuId
}
if(this.filters.productId){
params.productId=this.filters.productId
}
return params;
},
// XmMenu xm_project_menu
getXmMenus() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
//this.xmMenus=[]
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if( this.filters.product && this.filters.product.id){
params.productId=this.filters.product.id
}
params=this.getParams(params);
let callback= (res)=>{
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmMenus = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
this.load.list = false;
}
this.load.list = true;
if(!this.selProject){
listXmMenuWithState(params).then( callback ).catch( err => this.load.list = false );
}else{
listXmMenuWithPlan(params).then( callback ).catch( err => this.load.list = false );
}
},
//xmMenu
selsChange: function (sels) {
this.sels = sels;
},
onProductSelected:function(product){
this.filters.product=product
this.productVisible=false;
this.xmMenus=[]
this.getXmMenus()
},
onProductClearSelect:function(){
this.filters.product=null
this.productVisible=false;
this.xmMenus=[]
this.getXmMenus()
},
select(row){
this.$emit("select",row)
},
calcMenuLabel(dclass){
var params={label:'工作项',icon:'',color:''};
if(dclass==='1'){
params={label:'史诗',icon:'el-icon-s-promotion',color:'rgb(255, 153, 51)'};
}else if(dclass==='2'){
params={label:'特性',icon:'el-icon-s-flag',color:'rgb(0, 153, 51)'};
}else if(dclass==='3'){
params={label:'用户故事',icon:'el-icon-document',color:' rgb(79, 140, 255)'};
}
return params;
},
},//end methods
components: {
XmProductSelect,
//
},
mounted() {
initSimpleDicts("all",['menuStatus','demandSource','demandLvl','demandType','priority','dclass']).then(res=>{
Object.assign(this.dicts,res.data.data)
})
this.filters.product=this.xmProduct
if(this.xmProduct && this.xmProduct.id){
this.productVisible=false;
}
if(this.xmIteration && this.xmIteration.id){
this.filters.iterationFilterType='join-curr-iteration'
this.filters.iteration=this.xmIteration
}
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.getXmMenus();
});
}
}
</script>
<style lang="scss" scoped>
.more-label-font{
text-align:center;
float:left;
padding-top:5px;
}
.align-right{
float: right;
}
</style>
<style lang="scss">
</style>

2
src/views/xm/core/xmMenu/XmMenuSelect.vue

@ -1,6 +1,6 @@
<template>
<section>
<el-row>
<el-row v-if="xmProduct">
<el-col :span="7">
<xm-epic-features class="padding-right" :xm-product="xmProduct" @row-click="onEpicFeaturesRowClick" :disabledMng="true"></xm-epic-features>
</el-col>

Loading…
Cancel
Save