Browse Source

优化

master
陈裕财 4 years ago
parent
commit
20b4137f2e
  1. 14
      src/views/xm/core/xmIterationMenu/XmIterationMenuMng.vue
  2. 2
      src/views/xm/core/xmMenu/XmEpicFeatures.vue
  3. 2
      src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue
  4. 14
      src/views/xm/core/xmMenu/XmMenuMng.vue
  5. 295
      src/views/xm/core/xmMenu/XmMenuMngBatch.vue
  6. 9
      src/views/xm/core/xmMenu/XmMenuSelect.vue

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

@ -38,6 +38,11 @@
<span class="vlink" type="primary">{{scope.row.seqNo}}
&nbsp;&nbsp;{{scope.row.menuName}}
</span>
<div class="tool-bar">
<span class="u-btn">
<el-button @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" title="编辑" circle plain size="mini"> </el-button>
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="finishRate" label="进度" width="100" show-overflow-tooltip sortable>
@ -65,6 +70,10 @@
<el-dialog :visible.sync="menuVisible" width="80%" top="20px" append-to-body title="选择用户故事加入迭代">
<xm-menu-select ref="menusSelect" style="margin-top:-30px;" iterationFilterType="not-join-curr-iteration" checkScope="3" :xm-product="xmIteration?{id:xmIteration.productId}:null" :xm-iteration="xmIteration" :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select>
</el-dialog>
<!--编辑 XmMenu xm_project_menu界面-->
<el-dialog title="编辑故事" :visible.sync="editFormVisible" :with-header="false" width="90%" top="20px" append-to-body :close-on-click-modal="false" >
<xm-menu-edit :xm-menu="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit" @edit-fields="onEditSomeFields"></xm-menu-edit>
</el-dialog>
</section>
</template>
@ -77,6 +86,7 @@
import XmIterationMng from '@/views/xm/core/components/XmIterationSelect';//
import { mapGetters } from 'vuex'
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import xmMenuEdit from '../xmMenu/xmMenuEdit';
import XmEpicFeaturesSelect from '../xmMenu/XmEpicFeaturesSelect'
export default {
@ -308,6 +318,9 @@
onIterationClearSelect(){
this.iteration=null;
this.getXmIterationMenus();
},
onEditSomeFields(row){
Object.assign(this.editForm,row)
}
/**end 自定义函数请在上面加**/
@ -316,6 +329,7 @@
XmIterationMng,
xmMenuSelect,
XmEpicFeaturesSelect,
xmMenuEdit
//
},
mounted() {

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

@ -226,7 +226,7 @@
xmMenus: [],//
pageInfo:{//
total:0,//0>0
pageSize:20,//
pageSize:50,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']

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

@ -114,7 +114,7 @@
xmMenus: [],//
pageInfo:{//
total:0,//0>0
pageSize:20,//
pageSize:50,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']

14
src/views/xm/core/xmMenu/XmMenuMng.vue

@ -187,7 +187,7 @@
</span>
</el-row>
<el-row>
<el-table element-loading-text="努力加载中" element-loading-spinner="el-icon-loading" :cell-style="cellStyleCalc" :expand-row-keys="expandRowKeysCpd" :header-cell-style="cellStyleCalc" :row-style="{height:'60px'}" 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 element-loading-text="努力加载中" element-loading-spinner="el-icon-loading" :cell-style="cellStyleCalc" :expand-row-keys="expandRowKeysCpd" :header-cell-style="cellStyleCalc" :row-style="{height:'60px'}" stripe fit border ref="table" :height="maxTableHeight" :data="xmMenusTreeData" current-row-key="menuId" row-key="menuId" @sort-change="sortChange" highlight-current-row v-loading="load.list" @selection-change="selsChange" @row-click="rowClick">
<el-table-column sortable type="selection" width="40"></el-table-column>
<el-table-column prop="menuName" label="故事名称" min-width="300" fixed="left">
@ -412,8 +412,7 @@
import { batchDelXmIterationMenu,batchAddXmIterationMenu } from '@/api/xm/core/xmIterationMenu';
import XmMenuAdd from './XmMenuAdd';//
import XmMenuEdit from './XmMenuEdit';//
import XmMenuMngBatch from './XmMenuMngBatch';//
import XmMenuEdit from './XmMenuEdit';//
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
import XmMenuTemplateMng from '../xmMenuTemplate/XmMenuTemplateMng';//
import XmMenuRichDetail from './XmMenuRichDetail';
@ -440,10 +439,8 @@
'userInfo','roles'
]),
xmMenusTreeData() {
let xmMenus = JSON.parse(JSON.stringify(this.xmMenus || []));
let xmMenusTreeData = treeTool.translateDataToTree(xmMenus,"pmenuId","menuId");
return xmMenusTreeData;
xmMenusTreeData() {
return this.xmMenus;
},
},
watch:{
@ -1330,8 +1327,7 @@
XmTaskList,
XmTaskMng,
XmTaskListForMenu,
UsersSelect,
XmMenuMngBatch,
UsersSelect,
TagDialog,
XmEpicFeaturesSelect,
XmMenuWorkload,

295
src/views/xm/core/xmMenu/XmMenuMngBatch.vue

@ -1,295 +0,0 @@
<template>
<section class="page-container padding border">
<el-row>
<el-row >
<el-button type="warning" @click="batchSaveMenu" icon="el-icon-finished">保存</el-button>
<el-button @click="noBatchEdit" icon="el-icon-back">返回</el-button>
</el-row>
<el-row style="padding-top:12px;">
<el-table ref="table" :indent="16" lazy :load="loadXmMenusLazy" :height="maxTableHeight" :data="xmMenusTreeData" class="drag-table" row-key="menuId" :tree-props="{children: 'children', hasChildren: 'childrenCnt'}" 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="seqNo" label="序号" width="200" fixed="left">
<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>
<el-input style="width:70%;" v-model="scope.row.seqNo" @change="fieldChange(scope.row,'seqNo')"></el-input>
</template>
</el-table-column>
<el-table-column prop="menuName" label="需求名称" min-width="140" show-overflow-tooltip fixed="left">
<template slot-scope="scope">
<el-input v-model="scope.row.menuName" @change="fieldChange(scope.row,'menuName')"></el-input>
</template>
</el-table-column>
<el-table-column prop="mmUsername" label="跟进人" min-width="100" >
<template slot="header">
<el-button type="text" icon="el-icon-user" title="批量修改跟进人" @click="showBatchMmUserSelectVisible">批量修改</el-button>
</template>
<template slot-scope="scope">
<el-tag v-if="scope.row.mmUserid" @click="selectUser(scope.row)" closable @close="clearPmUser(scope.row)">{{scope.row.mmUsername}}</el-tag>
<el-button v-else type="text" @click="selectUser(scope.row)">选人</el-button>
</template>
</el-table-column>
<el-table-column label="需求属性" width="500" >
<template slot-scope="scope">
<el-select v-model="scope.row.dtype" title="需求类型" clearable placeholder="需求类型" @change="fieldChange(scope.row,'dtype')">
<el-option v-for="i in dicts.demandType" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
<el-select v-model="scope.row.source" title="需求来源" placeholder="需求来源" clearable @change="fieldChange(scope.row,'dtype')">
<el-option v-for="i in dicts.demandSource" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
<el-select v-model="scope.row.dlvl" title="需求层次" placeholder="需求层次" clearable class="hidden-md-and-down" @change="fieldChange(scope.row,'dtype')">
<el-option v-for="i in dicts.demandLvl" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
<el-select v-model="scope.row.priority" title="优先级" placeholder="优先级" clearable @change="fieldChange(scope.row,'dtype')">
<el-option v-for="i in dicts.priority" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="remark" label="描述" min-width="140" show-overflow-tooltip>
<template slot-scope="scope">
<el-input v-model="scope.row.remark" type="textarea" @change="fieldChange(scope.row,'remark')"></el-input>
</template>
</el-table-column>
</el-table>
</el-row>
<el-drawer title="选择员工" :visible.sync="userSelectVisible" size="60%" append-to-body>
<users-select @confirm="onUserSelected" ref="usersSelect"></users-select>
</el-drawer>
<el-drawer title="选择员工" :visible.sync="batchMmUserSelectVisible" size="60%" append-to-body>
<users-select @confirm="onBatchMmUserSelectConfirm" ref="batchMmUserSelect"></users-select>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import treeTool from '@/common/js/treeTool';//
import { initSimpleDicts } from '@/api/mdp/meta/item';//
import { batchEditXmMenu,listXmMenuWithState } from '@/api/xm/core/xmMenu';
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import { mapGetters } from 'vuex'
export default {
props:['product','xmMenus','dicts'],
computed: {
...mapGetters([
'userInfo','roles'
]),
xmMenusTreeData() {
let xmMenus = JSON.parse(JSON.stringify(this.xmMenus || []));
const xmMenusTreeData = treeTool.translateDataToTree(xmMenus,"pmenuId","menuId");
return xmMenusTreeData;
},
},
watch:{
product(product){
this.filters.product=product
}
},
data() {
return {
filters: {
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
options2:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
//xmMenu
addForm: {
menuId:'',menuName:'',pmenuId:'',productId:'',remark:'',status:'',online:'',demandUrl:'',codeUrl:'',designUrl:'',docUrl:'',helpUrl:'',operDocUrl:''
},
//xmMenu
editForm: {
menuId:'',menuName:'',pmenuId:'',productId:'',remark:'',status:'',online:'',demandUrl:'',codeUrl:'',designUrl:'',docUrl:'',helpUrl:'',operDocUrl:''
},
valueChangeRows:[],
userSelectVisible:false,
batchMmUserSelectVisible:false,
maxTableHeight:300,
pickerOptions: util.getPickerOptions('datarange'),
maps:new Map(),
}
},//end data
methods: {
//xmMenu
selsChange: function (sels) {
this.sels = sels;
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
noBatchEdit(){
this.batchEditVisible=false;
this.valueChangeRows=[];
this.$emit('no-batch-edit')
},
batchSaveMenu(){
if(this.valueChangeRows.length==0){
this.$notify.success("没有数据被修改");
return
}
batchEditXmMenu(this.valueChangeRows).then(res=>{
var tips=res.data.tips;
if(tips.isOk){
this.valueChangeRows=[]
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
});
},
fieldChange:function(row,fieldName,nextReplace){
console.log('fieldChange--row==', row);
if(nextReplace){
row.nextReplace=nextReplace
}
if(row.opType){
var index=this.valueChangeRows.findIndex(i=>i.menuId==row.menuId);
if(index>=0){
this.valueChangeRows.splice(index,1);
this.valueChangeRows.push(row)
}else{
this.valueChangeRows.push(row)
}
}else{
var oneRow=this.valueChangeRows.find(i=>i.menuId==row.menuId);
if( oneRow ){
if(oneRow.nextReplace){
var index=this.valueChangeRows.findIndex(i=>i.menuId==row.menuId);
this.valueChangeRows.splice(index,1);
this.valueChangeRows.push(row)
}else{
return;
}
}else{
this.valueChangeRows.push(row)
}
}
},
selectUser(row){
this.editForm=row
this.userSelectVisible=true;
},
onUserSelected(users){
if(users && users.length>0){
this.editForm.mmUserid=users[0].userid
this.editForm.mmUsername=users[0].username
this.fieldChange(this.editForm,"mmUsername");
}
this.userSelectVisible=false
},
clearPmUser:function(row){
this.editForm=row
row.mmUserid=''
row.mmUsername=''
this.fieldChange(row,"mmUsername");
},
loadXmMenusLazy(tree, treeNode, resolve) {
this.maps.set(tree.menuId, { tree, treeNode, resolve }) //
var params={pmenuId:tree.menuId}
params.isTop=""
this.load.list = true;
var func=listXmMenuWithState
func(params).then(res=>{
this.load.list = false
var tips = res.data.tips;
if(tips.isOk){
resolve(res.data.data)
}else{
resolve([])
}
}).catch( err => this.load.list = false );
},
//
showBatchMmUserSelectVisible() {
if(!this.sels||this.sels.length==0){
this.$notify({position:'bottom-left',showClose:true,message:'请先选中一条或多条数据',type:'warning'})
return;
}else{
this.batchMmUserSelectVisible=true;
}
},
//
onBatchMmUserSelectConfirm(users) {
var user={};
if (users && users.length > 0) {
user=users[0]
}
this.batchMmUserSelectVisible=false;
this.sels.forEach(i=>{
i.mmUserid=user.userid;
i.mmUsername=user.username;
this.fieldChange(i,"mmUserid")
})
},
},//end methods
components: {
UsersSelect,
},
mounted() {
this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
});
}
}
</script>
<style lang="scss" scoped>
.more-label-font{
text-align:center;
float:left;
padding-top:5px;
}
.el-table {
box-sizing: border-box;
/deep/ .cell {
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
word-break: break-all;
line-height: 23px;
padding-right: 10px;
display: flex;
}
}
</style>

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

@ -139,7 +139,7 @@
<el-button style="float:right;" type="primary" v-if="multi" v-on:click="multiSelectedConfirm">确认</el-button>
</el-row>
<el-row v-if="filters.product && filters.product.id" ref="table">
<el-table element-loading-text="努力加载中" element-loading-spinner="el-icon-loading" class="menu-table" :height="maxTableHeight" :data="xmMenusTreeData" row-key="menuId" :tree-props="{children: 'children'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table element-loading-text="努力加载中" element-loading-spinner="el-icon-loading" class="menu-table" :height="maxTableHeight" :data="xmMenusTreeData" row-key="menuId" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column v-if="multi" type="selection" width="50"></el-table-column>
<el-table-column prop="menuName" label="需求名称" min-width="140" >
@ -218,10 +218,9 @@ import XmEpicFeatures from './XmEpicFeaturesSelect.vue';
'userInfo','roles'
]),
xmMenusTreeData(){
var xmMenus=JSON.parse(JSON.stringify(this.xmMenus))
return treeTool.translateDataToTree(xmMenus,"pmenuId","menuId");
},
xmMenusTreeData(){
return this.xmMenus
},
},
watch:{
visible:function(visible){

Loading…
Cancel
Save