Browse Source

优化

master
陈裕财 4 years ago
parent
commit
7e26336361
  1. 43
      src/views/xm/core/xmMenu/XmEpicFeatures.vue
  2. 6
      src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue
  3. 12
      src/views/xm/core/xmTask/XmPhase.vue
  4. 6
      src/views/xm/core/xmTask/XmPhaseSelect.vue
  5. 19
      src/views/xm/core/xmTask/XmTaskEdit.vue

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

@ -74,12 +74,9 @@
</span> </span>
<div class="tool-bar" v-if="!disabledMng"> <div class="tool-bar" v-if="!disabledMng">
<span class="u-btn"> <span class="u-btn">
<el-tooltip v-if=" scope.row.dclass==='1' " :content=" '新建特性'">
<el-button @click="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus" title="新建" circle plain size="mini"> </el-button>
</el-tooltip>
<el-button @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" title="编辑" circle plain size="mini"> </el-button>
<el-button v-if=" scope.row.dclass==='1' " @click.stop="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus" title="新建特性" circle plain size="mini"> </el-button>
<el-button @click.stop="showEdit( scope.row,scope.$index)" icon="el-icon-edit" title="编辑" circle plain size="mini"> </el-button>
</span> </span>
</div> </div>
</template> </template>
@ -103,7 +100,7 @@
</el-row> </el-row>
<!--编辑 XmMenu xm_project_menu界面--> <!--编辑 XmMenu xm_project_menu界面-->
<el-dialog :title="'编辑'+(editForm.dclass=='1'?'史诗':'特性')" :visible.sync="editFormVisible" width="80%" top="20px" append-to-body :close-on-click-modal="false" >
<el-dialog :title="'编辑'+(editForm&&editForm.dclass=='1'?'史诗':'特性')" :visible.sync="editFormVisible" width="80%" top="20px" append-to-body :close-on-click-modal="false" >
<xm-menu-edit :xm-menu="editForm" :sel-project="selProject" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit" @add-sub-menu="onAddSubMenu" @edit-fields="onEditSomeFields"></xm-menu-edit> <xm-menu-edit :xm-menu="editForm" :sel-project="selProject" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit" @add-sub-menu="onAddSubMenu" @edit-fields="onEditSomeFields"></xm-menu-edit>
</el-dialog> </el-dialog>
@ -273,8 +270,11 @@
},//end data },//end data
methods: { methods: {
selectVisible(row,visible){ selectVisible(row,visible){
if(visible){
this.rowClick(row)
if(visible==true){
this.$refs.table.setCurrentRow(row);
this.editForm = row;
this.editFormBak=Object.assign({},row)
this.$emit('row-click',row,);// @row-click="rowClick"
} }
}, },
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
@ -448,12 +448,16 @@
// XmMenu xm_project_menu // XmMenu xm_project_menu
showEdit: function ( row,index ) { showEdit: function ( row,index ) {
this.$refs.table.setCurrentRow(row)
if(this.editForm && row.menuId!=this.editForm.menuId){
this.$refs.table.setCurrentRow(row);
this.$emit("row-click",row)
}
this.editForm =row this.editForm =row
this.editFormVisible = true; this.editFormVisible = true;
}, },
// XmMenu xm_project_menu // XmMenu xm_project_menu
showAdd: function (dclass) {
;
showAdd: function (dclass) {
Object.assign(this.addForm,this.addFormInit) Object.assign(this.addForm,this.addFormInit)
if(this.filters.product && this.filters.product.id){ if(this.filters.product && this.filters.product.id){
this.parentMenu=null; this.parentMenu=null;
@ -478,12 +482,17 @@
//this.addForm=Object.assign({}, this.editForm); //this.addForm=Object.assign({}, this.editForm);
}, },
showSubAdd:function(row){ showSubAdd:function(row){
this.$refs.table.setCurrentRow(row)
if(this.editForm && row.menuId!=this.editForm.menuId){
this.$refs.table.setCurrentRow(row);
this.$emit("row-click",row)
}
this.addForm={...this.addFormInit} this.addForm={...this.addFormInit}
this.editForm=row this.editForm=row
this.parentMenu=row this.parentMenu=row
this.expandRowKeysCpd.push(row.pmenuId); this.expandRowKeysCpd.push(row.pmenuId);
this.addForm.productId=row.productId
this.addForm.productId=row.productId
if(this.filters.product && row.productId==this.filters.product.id){ if(this.filters.product && row.productId==this.filters.product.id){
this.addForm.productName=this.filters.product.productName this.addForm.productName=this.filters.product.productName
}else{ }else{
@ -590,8 +599,14 @@
}, },
rowClick: function(row, event, column){ rowClick: function(row, event, column){
if(this.editForm && row.menuId===this.editForm.menuId){
this.editForm=null;
this.$emit('row-click',null)
this.$refs.table.setCurrentRow();
return;
}
this.editForm=row this.editForm=row
this.editFormBak=Object.assign({},row)
this.editFormBak=Object.assign({},row)
this.$emit('row-click',row, event, column);// @row-click="rowClick" this.$emit('row-click',row, event, column);// @row-click="rowClick"
}, },
handleExport() { handleExport() {

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

@ -329,6 +329,12 @@
}, },
rowClick: function(row, event, column){ rowClick: function(row, event, column){
if(this.editForm && row.menuId===this.editForm.menuId){
this.editForm=null;
this.$emit('row-click',null)
this.$refs.table.setCurrentRow();
return;
}
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"
}, },

12
src/views/xm/core/xmTask/XmPhase.vue

@ -635,12 +635,13 @@ export default {
}, },
// XmTask xm_task // XmTask xm_task
showEdit: function (row, index) { showEdit: function (row, index) {
this.editFormVisible = true;
if(this.editForm && row.id!=this.editForm.id){ if(this.editForm && row.id!=this.editForm.id){
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
this.$emit("row-click",row) this.$emit("row-click",row)
} }
this.editForm=row this.editForm=row
this.editFormVisible = true;
}, },
showTaskTemplate: function (row) { showTaskTemplate: function (row) {
if(!this.checkCanAdd(row)){ if(!this.checkCanAdd(row)){
@ -788,11 +789,10 @@ export default {
.catch((err) => (this.load.del = false)); .catch((err) => (this.load.del = false));
}); });
}, },
rowClick: function (row,column) {
if(this.editForm && row.id===this.editForm.id && column.label!='状态'){
this.editForm=null;
rowClick: function (row,column) {
if(this.editForm && row.id===this.editForm.id){
this.$emit('row-click',null) this.$emit('row-click',null)
this.editForm=null
this.$refs.table.setCurrentRow(); this.$refs.table.setCurrentRow();
return; return;
} }
@ -1161,7 +1161,7 @@ export default {
}); });
}) })
}, },
initData(){
initData(){
if (this.selProject) { if (this.selProject) {
this.filters.selProject = this.selProject; this.filters.selProject = this.selProject;
} }

6
src/views/xm/core/xmTask/XmPhaseSelect.vue

@ -346,6 +346,12 @@ export default {
}, },
rowClick: function (row) { rowClick: function (row) {
if(this.editForm && row.menuId===this.editForm.menuId){
this.editForm=null;
this.$emit('row-click',null)
this.$refs.table.setCurrentRow();
return;
}
this.editForm = row; this.editForm = row;
this.editFormBak=Object.assign({},row) this.editFormBak=Object.assign({},row)
this.$emit('row-click',row,);// @row-click="rowClick" this.$emit('row-click',row,);// @row-click="rowClick"

19
src/views/xm/core/xmTask/XmTaskEdit.vue

@ -157,16 +157,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'子工作项('+subWorkItemNum+')'" name="4" v-if="editForm.ntype==='1'">
<xm-sub-work-item v-if="activateTabPaneName=='4'" :parent-xm-task="editForm" @sub-work-item-num="setSubWorkItemNum" @add-sub-task="onAddSubTask"></xm-sub-work-item>
</el-tab-pane>
<el-tab-pane label="缺陷" name="41" v-if="editForm.ntype!='1'">
<xm-question-for-task v-if="activateTabPaneName=='41'" :xm-task="editForm" :sel-project="xmProject"></xm-question-for-task>
</el-tab-pane>
<el-tab-pane label="执行人" name="42" v-if="editForm.ntype!='1'">
<xm-task-execuser-for-task v-if="activateTabPaneName=='42'" :xm-task="editForm" ></xm-task-execuser-for-task>
</el-tab-pane>
<el-tab-pane label="工时" name="5"> <el-tab-pane label="工时" name="5">
<xm-task-workload-record v-if="activateTabPaneName=='5'" :xm-task="editForm" ></xm-task-workload-record> <xm-task-workload-record v-if="activateTabPaneName=='5'" :xm-task="editForm" ></xm-task-workload-record>
</el-tab-pane> </el-tab-pane>
@ -184,6 +175,16 @@
</el-form-item> </el-form-item>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'子工作项('+subWorkItemNum+')'" name="4" v-if="editForm.ntype==='1'">
<xm-sub-work-item v-if="activateTabPaneName=='4'" :parent-xm-task="editForm" @sub-work-item-num="setSubWorkItemNum" @add-sub-task="onAddSubTask"></xm-sub-work-item>
</el-tab-pane>
<el-tab-pane label="缺陷" name="41" v-if="editForm.ntype!='1'">
<xm-question-for-task v-if="activateTabPaneName=='41'" :xm-task="editForm" :sel-project="xmProject"></xm-question-for-task>
</el-tab-pane>
<el-tab-pane label="执行人" name="42" v-if="editForm.ntype!='1'">
<xm-task-execuser-for-task v-if="activateTabPaneName=='42'" :xm-task="editForm" ></xm-task-execuser-for-task>
</el-tab-pane>
<el-tab-pane label="结算信息" name="7" v-if="editForm.ntype!='1'"> <el-tab-pane label="结算信息" name="7" v-if="editForm.ntype!='1'">
<el-form-item label="" prop="taskClass"> <el-form-item label="" prop="taskClass">
<el-checkbox v-model="editForm.taskClass" true-label="1" false-label="0" @change="editXmTaskSomeFields(editForm,'taskClass',$event)">是否需要结算</el-checkbox> <el-checkbox v-model="editForm.taskClass" true-label="1" false-label="0" @change="editXmTaskSomeFields(editForm,'taskClass',$event)">是否需要结算</el-checkbox>

Loading…
Cancel
Save