Browse Source

优化

master
陈裕财 4 years ago
parent
commit
bc98b72ab9
  1. 23
      src/views/xm/core/components/XmIterationSelect.vue
  2. 19
      src/views/xm/core/components/XmProductSelect.vue
  3. 16
      src/views/xm/core/components/XmProjectSelect.vue
  4. 42
      src/views/xm/core/xmQuestion/XmQuestionMng.vue

23
src/views/xm/core/components/XmIterationSelect.vue

@ -59,7 +59,7 @@
<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-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-row>
<el-link title="点击选中迭代" @click="iterationVisible=!iterationVisible" type="warning" slot="reference" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm&&editForm.id?editForm.iterationName:'选择迭代'}}</slot></font></el-link>
<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.iterationName:'选择迭代'}}</slot></font></el-link>
</el-popover> </el-popover>
</section> </section>
</template> </template>
@ -133,6 +133,7 @@
maxTableHeight:300, maxTableHeight:300,
iterationVisible:false, iterationVisible:false,
moreVisible:false, moreVisible:false,
hadInit:false,
/**end 自定义属性请在上面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/
} }
},//end data },//end data
@ -271,7 +272,7 @@
this.searchXmIterations(); this.searchXmIterations();
} }
}else{ }else{
//his.searchXmIterations();
this.searchXmIterations();
} }
}, },
@ -286,15 +287,27 @@
this.iterationVisible=false; this.iterationVisible=false;
this.moreVisible=false; this.moreVisible=false;
this.$emit('clear',null );// @row-click="rowClick" this.$emit('clear',null );// @row-click="rowClick"
},
},
referenceClick(){
if(!this.hadInit){
this.initData();
this.hadInit=true;
}
this.iterationVisible=!this.iterationVisible;
}
},//end methods },//end methods
components: { components: {
// //
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.initData();
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
if(this.autoSelect!==false){
this.initData();
this.hadInit=true;
}
}); });
} }

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

@ -74,7 +74,7 @@
</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-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-row>
<slot name="reference"><el-link title="产品,点击选择、清除选择" @click="productVisible=!productVisible" 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>
<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-popover>
<el-dialog v-if="dialog" append-to-body <el-dialog v-if="dialog" append-to-body
v-model="productVisible"> v-model="productVisible">
@ -215,6 +215,7 @@
pickerOptions: util.pickerOptions('datarange'), pickerOptions: util.pickerOptions('datarange'),
productVisible:false, productVisible:false,
moreVisible:false, moreVisible:false,
hadInit:false,
/**begin 自定义属性请在下面加 请加备注**/ /**begin 自定义属性请在下面加 请加备注**/
/**end 自定义属性请在上面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/
@ -362,8 +363,7 @@
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){
@ -396,6 +396,13 @@
this.searchXmProducts(); this.searchXmProducts();
} }
}, },
referenceClick(){
if(!this.hadInit){
this.initData();
this.hadInit=true;
}
this.productVisible=!this.productVisible;
}
},//end methods },//end methods
components: { components: {
UsersSelect, UsersSelect,
@ -404,7 +411,11 @@
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.initData();
if(this.autoSelect!==false){
this.initData();
this.hadInit=true;
}
}); });
} }
} }

16
src/views/xm/core/components/XmProjectSelect.vue

@ -74,7 +74,7 @@
</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-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-row>
<span slot="reference" @click="projectVisible=!projectVisible">
<span slot="reference" @click="referenceClick">
<slot name="reference"><el-link title="项目,点击选择、清除选择" type="warning" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.name:'选择项目'}}</slot></font></el-link> </slot> <slot name="reference"><el-link title="项目,点击选择、清除选择" type="warning" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.name:'选择项目'}}</slot></font></el-link> </slot>
</span> </span>
</el-popover> </el-popover>
@ -148,6 +148,7 @@
pickerOptions: util.pickerOptions('datarange'), pickerOptions: util.pickerOptions('datarange'),
projectVisible:false, projectVisible:false,
moreVisible:false, moreVisible:false,
hadInit:false,
} }
},//end data },//end data
methods: { methods: {
@ -326,6 +327,14 @@
this.searchXmProjects(); this.searchXmProjects();
} }
}, },
referenceClick(){
if(!this.hadInit){
this.initData();
this.hadInit=true;
}
this.projectVisible=!this.projectVisible;
}
},//end methods },//end methods
components: { components: {
UsersSelect, UsersSelect,
@ -334,7 +343,10 @@
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.initData();
if(this.autoSelect!==false){
this.initData();
this.hadInit=true;
}
}); });
} }
} }

42
src/views/xm/core/xmQuestion/XmQuestionMng.vue

@ -115,16 +115,18 @@
<el-button slot="reference" icon="el-icon-more"></el-button> <el-button slot="reference" icon="el-icon-more"></el-button>
</el-popover> </el-popover>
<span style="float:right;"> <span style="float:right;">
<el-button type="primary" icon="el-icon-plus" @click="showAdd" round> </el-button>
<el-button v-if="filters.selProject && filters.selProject.id" type="primary" icon="el-icon-plus" @click="showAdd" round> </el-button>
<xm-project-select v-else style="display:inline;" :auto-select="false" :link-product-id="xmProduct?xmProduct.id:null" @row-click="showAddAfterProjectSelect" >
<el-button slot="reference" type="primary" icon="el-icon-plus" round> </el-button>
</xm-project-select>
</span> </span>
</el-row> </el-row>
<el-row class="padding-top"> <el-row class="padding-top">
<!--列表 XmQuestion xm_question--> <!--列表 XmQuestion xm_question-->
<el-table ref="table" :height="maxTableHeight" :data="xmQuestions" @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="xmQuestions" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column label="全选" type="selection" min-width="50"></el-table-column>
<el-table-column label="序号" type="index" min-width="50"></el-table-column>
<el-table-column prop="id" label="缺陷编号" width="100" show-overflow-tooltip></el-table-column>
<el-table-column prop="name" label="缺陷名称" min-width="150">
<el-table-column label="全选" type="selection" min-width="50" fixed="left"></el-table-column>
<el-table-column prop="id" label="缺陷编号" width="100" show-overflow-tooltip fixed="left"></el-table-column>
<el-table-column prop="name" label="缺陷名称" min-width="150" show-overflow-tooltip fixed="left">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="vlink" @click="showEdit(scope.row)" :title="scope.row.name"> <span class="vlink" @click="showEdit(scope.row)" :title="scope.row.name">
{{scope.row.name}} {{scope.row.name}}
@ -179,6 +181,26 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectId" label="项目" width="100" show-overflow-tooltip>
<template slot-scope="scope">
<div class="cell-text">
{{scope.row.projectId}}
</div>
<span class="cell-bar">
<xm-project-select style="display:inline;" :auto-select="false" :link-product-id="xmProduct?xmProduct.id:null" @row-click="editXmQuestionSomeFields(scope.row,'projectId',$event)" ></xm-project-select>
</span>
</template>
</el-table-column>
<el-table-column prop="productId" label="产品" width="100" show-overflow-tooltip>
<template slot-scope="scope">
<div class="cell-text">
{{scope.row.productId}}
</div>
<span class="cell-bar">
<xm-product-select style="display:inline;" :auto-select="false" :link-project-id="selProject?selProject.id:null" @row-click="editXmQuestionSomeFields(scope.row,'productId',$event)" ></xm-product-select>
</span>
</template>
</el-table-column>
<el-table-column prop="askUsername" label="创建人" width="100" show-overflow-tooltip> <el-table-column prop="askUsername" label="创建人" width="100" show-overflow-tooltip>
</el-table-column> </el-table-column>
@ -563,6 +585,12 @@
} }
this.addFormVisible = true; this.addFormVisible = true;
}, },
showAddAfterProjectSelect(project){
this.$refs.xmProjectSelect.editForm=project;
this.filters.selProject=project;
this.addFormVisible = true;
this.searchXmQuestions();
},
afterAddSubmit(){ afterAddSubmit(){
this.addFormVisible=false; this.addFormVisible=false;
this.pageInfo.count=true; this.pageInfo.count=true;
@ -1018,6 +1046,10 @@
} }
}else if(fieldName==='workload'){ }else if(fieldName==='workload'){
params={...params,...$event} params={...params,...$event}
}else if(fieldName==='projectId'){
params.projectId=$event.id
}else if(fieldName==='productId'){
params.productId=$event.id
}else{ }else{
params[fieldName]=$event params[fieldName]=$event
} }

Loading…
Cancel
Save