Browse Source

优化

master
陈裕财 4 years ago
parent
commit
1ad0a0e4d7
  1. 2
      src/views/myWork/my/index.vue
  2. 244
      src/views/xm/core/components/XmProductSelect.vue
  3. 128
      src/views/xm/core/xmIterationMenu/XmIterationMenuMng.vue
  4. 810
      src/views/xm/core/xmMenu/XmMenuMng.vue

2
src/views/myWork/my/index.vue

@ -14,7 +14,7 @@
<div class="m_left"> <div class="m_left">
<div class="m_left_1"> <div class="m_left_1">
<p>简介</p> <p>简介</p>
<span>唛盟是新一代项目管理平台提供一站式研发作工具帮助企业提升研发效能使用于多种研发工作场景支持多种角色协同管理</span>
<span>唛盟是新一代项目管理平台提供一站式研发作工具帮助企业提升研发效能使用于多种研发工作场景支持多种角色协同管理</span>
</div> </div>
<div class="m_left_2"> <div class="m_left_2">
<img src="../img/l1.png" alt=""> <img src="../img/l1.png" alt="">

244
src/views/xm/core/components/XmProductSelect.vue

@ -1,17 +1,17 @@
<template> <template>
<section>
<section>
<el-popover v-if="!dialog" <el-popover v-if="!dialog"
placement="bottom" placement="bottom"
width="400" width="400"
trigger="manual" trigger="manual"
v-model="productVisible">
<el-row >
v-model="productVisible">
<el-row >
<!--列表 XmProduct 产品表--> <!--列表 XmProduct 产品表-->
<el-table ref="table" :height="maxTableHeight" :data="xmProducts" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> <el-table ref="table" :height="maxTableHeight" :data="xmProducts" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column prop="productName" label="产品名称">
<template slot="header" slot-scope="scope">
产品名称
<el-table-column prop="productName" label="产品名称">
<template slot="header" slot-scope="scope">
产品名称
<span style="float:right;"> <span style="float:right;">
<el-button type="text" @click="clearSelect">清空</el-button>&nbsp;&nbsp; <el-button type="text" @click="clearSelect">清空</el-button>&nbsp;&nbsp;
<el-button type="text" @click="close">关闭</el-button>&nbsp;&nbsp; <el-button type="text" @click="close">关闭</el-button>&nbsp;&nbsp;
@ -21,90 +21,17 @@
width="400" width="400"
v-model="moreVisible" v-model="moreVisible"
trigger="manual" > trigger="manual" >
<el-row>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">产品编号:</font>
<el-input v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts">
</el-input>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">创建时间:</font>
<el-date-picker
v-model="dateRanger"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="完成日期"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00','23:59:59']"
:picker-options="pickerOptions"
></el-date-picker>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">
产品名称:
</font>
<el-input v-model="filters.key" style="width:100%;" placeholder="输入产品名字关键字">
</el-input>
</el-col>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">
产品经理:
</font>
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag>
<el-button v-else @click="selectFiltersPmUser()">选责任人</el-button>
<el-button @click="setFiltersPmUserAsMySelf()">我的</el-button>
</el-col>
<el-row>
<el-col :span="24" style="padding-top:5px;"> <el-col :span="24" style="padding-top:5px;">
<el-button type="text" @click="moreVisible=false" >关闭</el-button><el-button type="primary" @click="searchXmProducts" ></el-button>
<font class="more-label-font">产品编号:</font>
<el-input v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts">
</el-input>
</el-col> </el-col>
</el-row>
<el-button type="text" slot="reference" @click="moreVisible=!moreVisible" style="float:right;">更多条件</el-button>
</el-popover>
</span>
</template>
<template slot-scope="scope">
<font>{{scope.row.productName}}</font>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, 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>
</el-row>
<slot name="reference"><el-link title="产品,点击选择、清除选择" @click="referenceClick" type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.productName:'选择产品'}}</slot></font></el-link> </slot>
</el-popover>
<el-dialog v-if="dialog" append-to-body
v-model="productVisible">
<el-row >
<!--列表 XmProduct 产品表-->
<el-table ref="table" :height="maxTableHeight" :data="xmProducts" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column prop="productName" label="产品名称">
<template slot="header" slot-scope="scope">
产品名称
<span style="float:right;">
<el-button type="text" @click="clearSelect">清空</el-button>&nbsp;&nbsp;
<el-button type="text" @click="close">关闭</el-button>&nbsp;&nbsp;
<el-popover
placement="top-start"
title=""
width="400"
v-model="moreVisible"
trigger="manual" >
<el-row>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">产品编号:</font>
<el-input v-model="filters.id" style="width:100%;" placeholder="输入产品编号" @keyup.enter.native="searchXmProducts">
</el-input>
</el-col>
<el-col :span="24" style="padding-top:5px;"> <el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">创建时间:</font>
<font class="more-label-font">创建时间:</font>
<el-date-picker <el-date-picker
v-model="dateRanger"
v-model="dateRanger"
type="daterange" type="daterange"
align="right" align="right"
unlink-panels unlink-panels
@ -114,40 +41,41 @@
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00','23:59:59']" :default-time="['00:00:00','23:59:59']"
:picker-options="pickerOptions" :picker-options="pickerOptions"
></el-date-picker>
</el-col>
></el-date-picker>
</el-col>
<el-col :span="24" style="padding-top:5px;"> <el-col :span="24" style="padding-top:5px;">
<font class="more-label-font"> <font class="more-label-font">
产品名称: 产品名称:
</font>
<el-input v-model="filters.key" style="width:100%;" placeholder="输入产品名字关键字">
</el-input>
</font>
<el-input v-model="filters.key" style="width:100%;" placeholder="输入产品名字关键字">
</el-input>
</el-col> </el-col>
<el-col :span="24" style="padding-top:5px;"> <el-col :span="24" style="padding-top:5px;">
<font class="more-label-font"> <font class="more-label-font">
产品经理: 产品经理:
</font>
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag>
</font>
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag>
<el-button v-else @click="selectFiltersPmUser()">选责任人</el-button> <el-button v-else @click="selectFiltersPmUser()">选责任人</el-button>
<el-button @click="setFiltersPmUserAsMySelf()">我的</el-button> <el-button @click="setFiltersPmUserAsMySelf()">我的</el-button>
</el-col> </el-col>
<el-col :span="24" style="padding-top:5px;"> <el-col :span="24" style="padding-top:5px;">
<el-button type="text" @click="moreVisible=false" >关闭</el-button><el-button type="primary" @click="searchXmProducts" ></el-button> <el-button type="text" @click="moreVisible=false" >关闭</el-button><el-button type="primary" @click="searchXmProducts" ></el-button>
</el-col> </el-col>
</el-row>
</el-row>
<el-button type="text" slot="reference" @click="moreVisible=!moreVisible" style="float:right;">更多条件</el-button> <el-button type="text" slot="reference" @click="moreVisible=!moreVisible" style="float:right;">更多条件</el-button>
</el-popover>
</el-popover>
</span> </span>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<font>{{scope.row.productName}}</font> <font>{{scope.row.productName}}</font>
</template> </template>
</el-table-column>
</el-table-column>
</el-table> </el-table>
<el-pagination layout="total, 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>
</el-row>
</el-dialog>
<el-pagination layout="total, 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>
</el-row>
<slot name="reference"><el-link title="产品,点击选择、清除选择" @click="referenceClick" type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.productName:'选择产品'}}</slot></font></el-link> </slot>
</el-popover>
</section> </section>
</template> </template>
@ -155,12 +83,12 @@
import util from '@/common/js/util';// import util from '@/common/js/util';//
//import Sticky from '@/components/Sticky' // header //import Sticky from '@/components/Sticky' // header
//import { initSimpleDicts } from '@/api/mdp/meta/item';// //import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmProductWithState } from '@/api/xm/core/xmProduct';
import { mapGetters } from 'vuex'
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import { listXmProductWithState } from '@/api/xm/core/xmProduct';
import { mapGetters } from 'vuex'
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
const map=new Map(); const map=new Map();
export default {
export default {
props:['dialog','linkProjectId','iterationId','autoSelect'], props:['dialog','linkProjectId','iterationId','autoSelect'],
computed: { computed: {
...mapGetters([ ...mapGetters([
@ -171,7 +99,7 @@
iterationId(){ iterationId(){
this.initData(); this.initData();
}, },
linkProjectId(){ linkProjectId(){
this.initData(); this.initData();
} }
@ -182,9 +110,9 @@
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 );
return { return {
filters: { filters: {
key: '',
key: '',
id:'',// id:'',//
pmUser:null,//
pmUser:null,//
}, },
xmProducts: [],// xmProducts: [],//
@ -198,32 +126,32 @@
}, },
load:{ list: false, edit: false, del: false, add: false },//... load:{ list: false, edit: false, del: false, add: false },//...
sels: [],// sels: [],//
dicts:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
dicts:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
//xmProduct //xmProduct
addForm: { addForm: {
id:'',productName:'',branchId:'',remark:'' id:'',productName:'',branchId:'',remark:''
}, },
//xmProduct //xmProduct
editForm: { editForm: {
id:'',productName:'',branchId:'',remark:'' id:'',productName:'',branchId:'',remark:''
},
},
selectFiltersPmUserVisible:false, selectFiltersPmUserVisible:false,
maxTableHeight:300, maxTableHeight:300,
dateRanger: [ ],
dateRanger: [ ],
pickerOptions: util.pickerOptions('datarange'), pickerOptions: util.pickerOptions('datarange'),
productVisible:false, productVisible:false,
moreVisible:false, moreVisible:false,
hadInit:false, hadInit:false,
/**begin 自定义属性请在下面加 请加备注**/ /**begin 自定义属性请在下面加 请加备注**/
/**end 自定义属性请在上面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/
} }
},//end data },//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmProducts(); this.getXmProducts();
}, },
handleCurrentChange(pageNum) { handleCurrentChange(pageNum) {
@ -245,9 +173,9 @@
this.getXmProducts(); this.getXmProducts();
}, },
searchXmProducts(){ searchXmProducts(){
this.pageInfo.count=true;
this.pageInfo.count=true;
this.getXmProducts(); this.getXmProducts();
},
},
// XmProduct // XmProduct
getXmProducts() { getXmProducts() {
let params = { let params = {
@ -258,31 +186,31 @@
}; };
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[]; let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
}
params.orderBy= orderBys.join(",") params.orderBy= orderBys.join(",")
} }
if(this.filters.key!==""){ if(this.filters.key!==""){
params.key="%"+this.filters.key+"%" params.key="%"+this.filters.key+"%"
}
}
if(this.linkProjectId){ if(this.linkProjectId){
params.projectId=this.linkProjectId params.projectId=this.linkProjectId
} }
if(this.iterationId){ if(this.iterationId){
params.iterationId=this.iterationId params.iterationId=this.iterationId
}
}
if(this.filters.id){ if(this.filters.id){
params.id=this.filters.id params.id=this.filters.id
}
}
if(this.filters.pmUser){ if(this.filters.pmUser){
params.pmUserid=this.filters.pmUser.userid params.pmUserid=this.filters.pmUser.userid
} }
this.load.list = true; this.load.list = true;
listXmProductWithState(params).then((res) => { listXmProductWithState(params).then((res) => {
var tips=res.data.tips; var tips=res.data.tips;
if(tips.isOk){
if(tips.isOk){
this.pageInfo.total = res.data.total; this.pageInfo.total = res.data.total;
this.pageInfo.count=false; this.pageInfo.count=false;
this.xmProducts = res.data.data; this.xmProducts = res.data.data;
@ -291,46 +219,46 @@
}else if(this.linkProjectId){ }else if(this.linkProjectId){
map.set(this.linkProjectId,this.xmProducts) map.set(this.linkProjectId,this.xmProducts)
} }
if(this.autoSelect!==false&&this.xmProducts.length>0 && this.productVisible==false){
var row=this.xmProducts[0];
if(this.autoSelect!==false&&this.xmProducts.length>0 && this.productVisible==false){
var row=this.xmProducts[0];
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
this.rowClick(row);
this.rowClick(row);
} }
}else{ }else{
this.$notify({showClose: true, message: tips.msg, type: 'error' }); this.$notify({showClose: true, message: tips.msg, type: 'error' });
}
}
this.load.list = false; this.load.list = false;
}).catch( err => this.load.list = false ); }).catch( err => this.load.list = false );
}, },
//xmProduct //xmProduct
selsChange: function (sels) { selsChange: function (sels) {
this.sels = sels; this.sels = sels;
},
},
rowClick: function(row, event, column){ rowClick: function(row, event, column){
this.editForm=row this.editForm=row
this.$emit('row-click',row, event, column);// @row-click="rowClick" this.$emit('row-click',row, event, column);// @row-click="rowClick"
this.selectedProduct(row)
this.selectedProduct(row)
this.productVisible=false; this.productVisible=false;
this.moreVisible=false; this.moreVisible=false;
}, },
selectedProduct:function(row){ selectedProduct:function(row){
this.editForm=row this.editForm=row
this.$emit('selected',row);
this.$emit('selected',row);
this.productVisible=false; this.productVisible=false;
this.moreVisible=false; this.moreVisible=false;
}, },
/**begin 自定义函数请在下面加**/ /**begin 自定义函数请在下面加**/
clearFiltersPmUser:function(){ clearFiltersPmUser:function(){
this.filters.pmUser=null; this.filters.pmUser=null;
this.searchXmProducts(); this.searchXmProducts();
},
},
selectFiltersPmUser(){ selectFiltersPmUser(){
this.selectFiltersPmUserVisible=true; this.selectFiltersPmUserVisible=true;
}, },
onFiltersPmUserSelected(users){
onFiltersPmUserSelected(users){
if(users && users.length>0){ if(users && users.length>0){
this.filters.pmUser=users[0] this.filters.pmUser=users[0]
}else{ }else{
@ -342,10 +270,10 @@
setFiltersPmUserAsMySelf(){ setFiltersPmUserAsMySelf(){
this.filters.pmUser=this.userInfo; this.filters.pmUser=this.userInfo;
this.searchXmProducts(); this.searchXmProducts();
},
},
tableRowClassName({row, rowIndex}) { tableRowClassName({row, rowIndex}) {
if (row.id == this.editForm.id) {
if (row.id == this.editForm.id) {
return 'success-row'; return 'success-row';
} }
return ''; return '';
@ -362,17 +290,17 @@
this.moreVisible=false; this.moreVisible=false;
this.$emit("close"); this.$emit("close");
}, },
initData(){
initData(){
if(this.iterationId){ if(this.iterationId){
var xmProducts=map.get(this.iterationId); var xmProducts=map.get(this.iterationId);
if(xmProducts){ if(xmProducts){
this.xmProducts=xmProducts; this.xmProducts=xmProducts;
if(this.productVisible==false){ if(this.productVisible==false){
if(this.autoSelect!==false && this.xmProducts.length>0){ if(this.autoSelect!==false && this.xmProducts.length>0){
var row=this.xmProducts[0];
var row=this.xmProducts[0];
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
this.rowClick(row);
this.rowClick(row);
} }
} }
}else{ }else{
@ -381,12 +309,12 @@
}else if(this.linkProjectId){ }else if(this.linkProjectId){
var xmProducts=map.get(this.linkProjectId); var xmProducts=map.get(this.linkProjectId);
if(xmProducts){ if(xmProducts){
this.xmProducts=xmProducts;
this.xmProducts=xmProducts;
if(this.productVisible==false){ if(this.productVisible==false){
if(this.autoSelect!==false && this.xmProducts.length>0){ if(this.autoSelect!==false && this.xmProducts.length>0){
var row=this.xmProducts[0];
var row=this.xmProducts[0];
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
this.rowClick(row);
this.rowClick(row);
} }
} }
}else{ }else{
@ -404,23 +332,23 @@
this.productVisible=!this.productVisible; this.productVisible=!this.productVisible;
} }
},//end methods },//end methods
components: {
components: {
UsersSelect, UsersSelect,
// //
}, },
mounted() {
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
mounted() {
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
if(this.autoSelect!==false){ if(this.autoSelect!==false){
this.initData(); this.initData();
this.hadInit=true; this.hadInit=true;
} }
});
});
} }
} }
</script>
</script>
<style scoped> <style scoped>
@ -430,6 +358,6 @@
padding-top:5px; padding-top:5px;
} }
.align-right{ .align-right{
float: right;
float: right;
} }
</style>
</style>

128
src/views/xm/core/xmIterationMenu/XmIterationMenuMng.vue

@ -1,29 +1,29 @@
<template> <template>
<section class="page-container"> <section class="page-container">
<el-row >
<el-row >
<el-col :span="10"> <el-col :span="10">
<el-row class="padding-left"> <el-row class="padding-left">
<el-input v-model="filters.key" style="width: 60%;" placeholder="模糊查询">
</el-input>
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmIterationMenus" icon="el-icon-search"></el-button>
<span style="float:right;">
<el-button type="danger" @click="batchDel" icon="el-icon-right">批量移出</el-button>
<el-input v-model="filters.key" style="width: 60%;" placeholder="模糊查询">
</el-input>
<el-button v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmIterationMenus" icon="el-icon-search"></el-button>
<span style="float:right;">
<el-button type="primary" @click="batchDel" icon="el-icon-right">批量移出</el-button>
</span> </span>
</el-row> </el-row>
<el-row class="page-main padding-top padding-left"> <el-row class="page-main padding-top padding-left">
<!--列表 XmIterationMenu 迭代定义--> <!--列表 XmIterationMenu 迭代定义-->
<el-table ref="table" :height="maxTableHeight" :data="xmIterationMenusTreeData" row-key="menuId" :tree-props="{children: 'children', hasChildren: 'childrenCnt'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> <el-table ref="table" :height="maxTableHeight" :data="xmIterationMenusTreeData" row-key="menuId" :tree-props="{children: 'children', hasChildren: 'childrenCnt'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" width="45"></el-table-column>
<el-table-column prop="menuName" label="需求名称" min-width="140" >
<el-table-column type="selection" width="45"></el-table-column>
<el-table-column prop="menuName" label="已加入迭代的用户故事" min-width="140" >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.dclass=='1'" class="icon" style="background-color: rgb(255, 153, 51);"> <div v-if="scope.row.dclass=='1'" class="icon" style="background-color: rgb(255, 153, 51);">
<i class="el-icon-s-promotion"></i> <i class="el-icon-s-promotion"></i>
</div>
</div>
<div v-if="scope.row.dclass=='2'" class="icon" style="background-color: rgb(0, 153, 51);"> <div v-if="scope.row.dclass=='2'" class="icon" style="background-color: rgb(0, 153, 51);">
<i class="el-icon-s-flag"></i> <i class="el-icon-s-flag"></i>
</div> </div>
@ -32,21 +32,21 @@
</div> </div>
<span class="vlink" type="primary">{{scope.row.seqNo}} <span class="vlink" type="primary">{{scope.row.seqNo}}
&nbsp;&nbsp;{{scope.row.menuName}} &nbsp;&nbsp;{{scope.row.menuName}}
</span>
</span>
</template> </template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" width="100" fixed="right"> <el-table-column label="操作" width="100" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" @click="handleDel(scope.row,scope.$index)" icon="el-icon-right">移出</el-button> <el-button type="primary" @click="handleDel(scope.row,scope.$index)" icon="el-icon-right">移出</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination layout="total, sizes, prev, pager, 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>
<el-pagination layout="total, sizes, prev, pager, 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>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<xm-menu-select ref="menusSelect" iterationFilterType="not-join-curr-iteration" checkScope="0" :xm-product="{id:xmIteration.productId}" :xm-iteration="xmIteration" :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select> <xm-menu-select ref="menusSelect" iterationFilterType="not-join-curr-iteration" checkScope="0" :xm-product="{id:xmIteration.productId}" :xm-iteration="xmIteration" :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select>
</el-col>
</el-col>
</el-row> </el-row>
</section> </section>
</template> </template>
@ -54,26 +54,26 @@
<script> <script>
import util from '@/common/js/util';// import util from '@/common/js/util';//
import treeTool from '@/common/js/treeTool';// import treeTool from '@/common/js/treeTool';//
import config from '@/common/config';//
import config from '@/common/config';//
import { initSimpleDicts } from '@/api/mdp/meta/item';// import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { listXmIterationMenu, delXmIterationMenu, batchDelXmIterationMenu,batchAddXmIterationMenu } from '@/api/xm/core/xmIterationMenu';
import { listXmIterationMenu, delXmIterationMenu, batchDelXmIterationMenu,batchAddXmIterationMenu } from '@/api/xm/core/xmIterationMenu';
import XmIterationMng from '@/views/xm/core/components/XmIterationSelect';// import XmIterationMng from '@/views/xm/core/components/XmIterationSelect';//
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import xmMenuSelect from '../xmMenu/XmMenuSelect'; import xmMenuSelect from '../xmMenu/XmMenuSelect';
export default {
export default {
props:['xmIteration'], props:['xmIteration'],
computed: { computed: {
...mapGetters([ ...mapGetters([
'userInfo','roles' 'userInfo','roles'
]),
xmIterationMenusTreeData() {
let xmMenus = JSON.parse(JSON.stringify(this.xmIterationMenus || []));
let xmMenusTreeData = treeTool.translateDataToTree(xmMenus,"pmenuId","menuId");
]),
xmIterationMenusTreeData() {
let xmMenus = JSON.parse(JSON.stringify(this.xmIterationMenus || []));
let xmMenusTreeData = treeTool.translateDataToTree(xmMenus,"pmenuId","menuId");
return xmMenusTreeData; return xmMenusTreeData;
},
},
}, },
watch:{ watch:{
'xmIteration':function(xmIteration){ 'xmIteration':function(xmIteration){
@ -98,14 +98,14 @@
sels: [],// sels: [],//
dicts:{ dicts:{
//sex:[], //sex:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmIterationMenu addFormVisible: false,//xmIterationMenu
//xmIterationMenu //xmIterationMenu
addForm: { addForm: {
id:'',iterationId:'',menuId:'',productId:'',ctime:'',relStatus:'' id:'',iterationId:'',menuId:'',productId:'',ctime:'',relStatus:''
}, },
editFormVisible: false,// editFormVisible: false,//
//xmIterationMenu //xmIterationMenu
editForm: { editForm: {
@ -115,13 +115,13 @@
menuVisible:false, menuVisible:false,
maxTableHeight:300, maxTableHeight:300,
/**begin 自定义属性请在下面加 请加备注**/ /**begin 自定义属性请在下面加 请加备注**/
/**end 自定义属性请在上面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/
} }
},//end data },//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmIterationMenus(); this.getXmIterationMenus();
}, },
handleCurrentChange(pageNum) { handleCurrentChange(pageNum) {
@ -143,7 +143,7 @@
this.getXmIterationMenus(); this.getXmIterationMenus();
}, },
searchXmIterationMenus(){ searchXmIterationMenus(){
this.pageInfo.count=true;
this.pageInfo.count=true;
this.getXmIterationMenus(); this.getXmIterationMenus();
}, },
// XmIterationMenu // XmIterationMenu
@ -156,11 +156,11 @@
}; };
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[]; let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
}
params.orderBy= orderBys.join(",") params.orderBy= orderBys.join(",")
}
}
if(this.filters.key){ if(this.filters.key){
params.key='%'+this.filters.key+'%' params.key='%'+this.filters.key+'%'
} }
@ -173,13 +173,13 @@
this.load.list = true; this.load.list = true;
listXmIterationMenu(params).then((res) => { listXmIterationMenu(params).then((res) => {
var tips=res.data.tips; var tips=res.data.tips;
if(tips.isOk){
if(tips.isOk){
this.pageInfo.total = res.data.total; this.pageInfo.total = res.data.total;
this.pageInfo.count=false; this.pageInfo.count=false;
this.xmIterationMenus = res.data.data; this.xmIterationMenus = res.data.data;
}else{ }else{
this.$notify({showClose: true, message: tips.msg, type: 'error' }); this.$notify({showClose: true, message: tips.msg, type: 'error' });
}
}
this.load.list = false; this.load.list = false;
}).catch( err => this.load.list = false ); }).catch( err => this.load.list = false );
}, },
@ -205,36 +205,36 @@
//xmIterationMenu //xmIterationMenu
selsChange: function (sels) { selsChange: function (sels) {
this.sels = sels; this.sels = sels;
},
},
//xmIterationMenu //xmIterationMenu
handleDel: function (row,index) {
handleDel: function (row,index) {
this.$confirm('确认将该需求移出迭代吗?', '提示', { this.$confirm('确认将该需求移出迭代吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => {
}).then(() => {
this.load.del=true; this.load.del=true;
let params = { iterationId:row.iterationId,menuIds: [row.menuId] }; let params = { iterationId:row.iterationId,menuIds: [row.menuId] };
delXmIterationMenu(params).then((res) => { delXmIterationMenu(params).then((res) => {
this.load.del=false; this.load.del=false;
var tips=res.data.tips; var tips=res.data.tips;
if(tips.isOk){
if(tips.isOk){
this.pageInfo.count=true; this.pageInfo.count=true;
this.$refs.menusSelect.reloadChildren([row]); this.$refs.menusSelect.reloadChildren([row]);
this.getXmIterationMenus(); this.getXmIterationMenus();
} }
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false ); }).catch( err => this.load.del=false );
}); });
}, },
//xmIterationMenu //xmIterationMenu
batchDel: function () {
batchDel: function () {
if(this.sels.length<=0){ if(this.sels.length<=0){
this.$notify({showClose: true, message:"请先选择一个或者多个需求", type: 'warning' });
this.$notify({showClose: true, message:"请先选择一个或者多个需求", type: 'warning' });
return ; return ;
} }
this.$confirm('确认将需求移出迭代吗?', '提示', { this.$confirm('确认将需求移出迭代吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => {
}).then(() => {
this.load.del=true; this.load.del=true;
var params={ var params={
iterationId:this.sels[0].iterationId,menuIds:this.sels.map(i=>i.menuId) iterationId:this.sels[0].iterationId,menuIds:this.sels.map(i=>i.menuId)
@ -242,10 +242,10 @@
batchDelXmIterationMenu(params).then((res) => { batchDelXmIterationMenu(params).then((res) => {
this.load.del=false; this.load.del=false;
var tips=res.data.tips; var tips=res.data.tips;
if( tips.isOk ){
if( tips.isOk ){
this.$refs.menusSelect.reloadChildren(this.sels); this.$refs.menusSelect.reloadChildren(this.sels);
this.pageInfo.count=true; this.pageInfo.count=true;
this.getXmIterationMenus();
this.getXmIterationMenus();
} }
this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false ); }).catch( err => this.load.del=false );
@ -253,13 +253,13 @@
}, },
rowClick: function(row, event, column){ rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick" this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
},
onSelectedMenus(menus){ onSelectedMenus(menus){
if(!menus || menus.length==0){ if(!menus || menus.length==0){
this.menuVisible=false this.menuVisible=false
return; return;
}
}
var params={ var params={
menuIds:menus.map(i=>i.menuId), menuIds:menus.map(i=>i.menuId),
iterationId:this.iteration.id iterationId:this.iteration.id
@ -278,32 +278,32 @@
this.iteration=iteration this.iteration=iteration
this.getXmIterationMenus(); this.getXmIterationMenus();
}, },
onIterationClearSelect(){ onIterationClearSelect(){
this.iteration=null; this.iteration=null;
this.getXmIterationMenus(); this.getXmIterationMenus();
} }
/**end 自定义函数请在上面加**/ /**end 自定义函数请在上面加**/
},//end methods },//end methods
components: {
components: {
XmIterationMng, XmIterationMng,
xmMenuSelect, xmMenuSelect,
// //
}, },
mounted() {
mounted() {
if(this.xmIteration){ if(this.xmIteration){
this.iteration=this.xmIteration this.iteration=this.xmIteration
} }
this.$nextTick(() => { this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.getXmIterationMenus(); this.getXmIterationMenus();
});
});
/** /**
initSimpleDicts( "all",["sex","grade"] ).then(res=>{ initSimpleDicts( "all",["sex","grade"] ).then(res=>{
if(res.data.tips.isOk){
if(res.data.tips.isOk){
this.dicts=res.data.data this.dicts=res.data.data
} }
}); });
@ -315,4 +315,4 @@
<style scoped> <style scoped>
</style>
</style>

810
src/views/xm/core/xmMenu/XmMenuMng.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save