|
|
@ -1,21 +1,16 @@ |
|
|
<template> |
|
|
<template> |
|
|
<section> |
|
|
<section> |
|
|
<el-row class="app-container" v-if="simple!==true"> |
|
|
|
|
|
|
|
|
<el-row class="app-container" v-show="batchEditVisible==false"> |
|
|
|
|
|
|
|
|
<el-button v-if="batchEditVisible==false" type="primary" @click="showAdd" v-loading="load.add" icon="el-icon-plus">添加计划</el-button> |
|
|
|
|
|
<el-button v-if="batchEditVisible==false" type="primary" @click="showPhaseTemplate" v-loading="load.add" icon="el-icon-plus">由模板导入计划</el-button> |
|
|
|
|
|
<el-button v-if="batchEditVisible==false" type="primary" @click="showMenu" v-loading="load.add" icon="el-icon-plus">由故事批量创建</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="showAdd" v-loading="load.add" icon="el-icon-plus">添加计划</el-button> |
|
|
|
|
|
<el-button type="primary" @click="showPhaseTemplate" v-loading="load.add" icon="el-icon-plus">由模板导入计划</el-button> |
|
|
|
|
|
<el-button type="primary" @click="showMenu" v-loading="load.add" icon="el-icon-plus">由故事批量创建</el-button> |
|
|
|
|
|
|
|
|
<el-button v-if="batchEditVisible==false" type="warning" @click="loadTasksToXmProjectPhase(sels)" v-loading="load.edit" icon="el-icon-s-data">由任务汇总实际数据</el-button> |
|
|
|
|
|
<el-button type="success" v-if="batchEditVisible==false" @click="batchEditVisible=true" v-loading="load.edit" icon="el-icon-edit">批量修改</el-button> |
|
|
|
|
|
<el-button v-if="batchEditVisible==true" type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete">批量删除</el-button> |
|
|
|
|
|
<el-button type="warning" v-if="batchEditVisible==true" @click="saveBatchEdit" v-loading="load.edit" icon="el-icon-finished">批量保存</el-button> |
|
|
|
|
|
|
|
|
|
|
|
<el-button v-if=" batchEditVisible==true" type="success" @click="handlePopover(null,'add')" icon="el-icon-plus"></el-button> |
|
|
|
|
|
<el-button v-if="batchEditVisible==true" @click="noBatchEdit" v-loading="load.edit" icon="el-icon-back">返回</el-button> |
|
|
|
|
|
|
|
|
<el-button type="warning" @click="loadTasksToXmProjectPhase(sels)" v-loading="load.edit" icon="el-icon-s-data">由任务汇总实际数据</el-button> |
|
|
|
|
|
<el-button type="success" @click="batchEditVisible=true" v-loading="load.edit" icon="el-icon-edit">批量修改</el-button> |
|
|
|
|
|
|
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-row class="app-container" v-if="simple!==true"> |
|
|
|
|
|
|
|
|
<el-row class="app-container" v-show="batchEditVisible==false"> |
|
|
<span style="margin-left:10px;font-size:14px;">项目总预算:</span><el-tag type='success'> {{toFixed(selProject.planTotalCost/10000,2)}}万,剩{{toFixed(phaseBudgetData.surplusPlanCostAt/10000,2)}}万</el-tag> |
|
|
<span style="margin-left:10px;font-size:14px;">项目总预算:</span><el-tag type='success'> {{toFixed(selProject.planTotalCost/10000,2)}}万,剩{{toFixed(phaseBudgetData.surplusPlanCostAt/10000,2)}}万</el-tag> |
|
|
<span style="margin-left:10px;font-size:14px;">非人力总预算:</span><el-tag :type="phaseBudgetData.surplusPlanNouserAt>0?'warning':'danger'">{{toFixed(selProject.planNouserAt/10000,2)}}万,剩{{toFixed(phaseBudgetData.surplusPlanNouserAt/10000,2)}}万</el-tag> |
|
|
<span style="margin-left:10px;font-size:14px;">非人力总预算:</span><el-tag :type="phaseBudgetData.surplusPlanNouserAt>0?'warning':'danger'">{{toFixed(selProject.planNouserAt/10000,2)}}万,剩{{toFixed(phaseBudgetData.surplusPlanNouserAt/10000,2)}}万</el-tag> |
|
|
<span style="margin-left:10px;font-size:14px;">内部人力总预算:</span><el-tag :type="phaseBudgetData.surplusPlanInnerUserAt>0?'warning':'danger'">{{toFixed(selProject.planInnerUserAt/10000,2)}}万,剩{{toFixed(phaseBudgetData.surplusPlanInnerUserAt/10000,2)}}万</el-tag> |
|
|
<span style="margin-left:10px;font-size:14px;">内部人力总预算:</span><el-tag :type="phaseBudgetData.surplusPlanInnerUserAt>0?'warning':'danger'">{{toFixed(selProject.planInnerUserAt/10000,2)}}万,剩{{toFixed(phaseBudgetData.surplusPlanInnerUserAt/10000,2)}}万</el-tag> |
|
|
@ -30,20 +25,9 @@ |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-table max-height="650" ref="selectPhaseTable" v-show="simple==true" :data="projectPhaseTreeData" :show-summary="false" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|
|
|
|
|
<el-table-column prop="phaseName" label="阶段名称" min-width="160" > |
|
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
|
<div>阶段名称 <el-tag size="mini" v-if="editForm.id" closable @close="clearSelectPhase()">{{editForm.seqNo}} {{editForm.phaseName}}</el-tag></div> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{scope.row.seqNo}} {{scope.row.phaseName}} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<el-pagination v-show="simple==true" layout="total, 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 class="app-container" v-show="simple!=true"> |
|
|
|
|
|
|
|
|
<el-row class="app-container" v-show="batchEditVisible==false"> |
|
|
<!--列表 XmProjectPhase xm_project_phase--> |
|
|
<!--列表 XmProjectPhase xm_project_phase--> |
|
|
<el-table max-height="650" v-show="!gstcVisible && batchEditVisible==false && simple!==true" default-expand-all :data="projectPhaseTreeData" :summary-method="getSummariesForNoBatchEdit" :show-summary="true" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|
|
|
|
|
|
|
|
<el-table max-height="650" v-show="!gstcVisible " default-expand-all :data="projectPhaseTreeData" :summary-method="getSummariesForNoBatchEdit" :show-summary="true" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|
|
<el-table-column sortable type="selection" width="40"></el-table-column> |
|
|
<el-table-column sortable type="selection" width="40"></el-table-column> |
|
|
<el-table-column prop="phaseName" label="阶段名称" min-width="160" > |
|
|
<el-table-column prop="phaseName" label="阶段名称" min-width="160" > |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
@ -118,110 +102,8 @@ |
|
|
</el-table> |
|
|
</el-table> |
|
|
<xm-gantt v-if="gstcVisible && batchEditVisible==false" :tree-data="projectPhaseTreeData" :project-phase="selProject" :columns="ganrrColumns" :useRealTime="false"></xm-gantt> |
|
|
<xm-gantt v-if="gstcVisible && batchEditVisible==false" :tree-data="projectPhaseTreeData" :project-phase="selProject" :columns="ganrrColumns" :useRealTime="false"></xm-gantt> |
|
|
|
|
|
|
|
|
<!--列表 XmProjectPhase xm_project_phase--> |
|
|
|
|
|
<el-table v-show="batchEditVisible==true" class="drag-table" default-expand-all :summary-method="getSummariesForBatchEdit" :data="projectPhaseTreeData" :show-summary="true" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @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="50"></el-table-column> |
|
|
|
|
|
<el-table-column prop="seqNo" label="序号" width="150"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<div style="display:flex;width:100%;"> |
|
|
|
|
|
<el-popover |
|
|
|
|
|
placement="top" |
|
|
|
|
|
width="400" |
|
|
|
|
|
trigger="click"> |
|
|
|
|
|
<div style="text-align: center; margin: 0"> |
|
|
|
|
|
<div :ref="'phase_'+scope.$index" :data-phase-id="scope.row.id"></div> |
|
|
|
|
|
<el-button type="primary" size="mini" @click="handlePopover(scope.row,'highestPmenuId')">成为顶级节点</el-button> |
|
|
|
|
|
<el-button type="danger" size="mini" @click="handlePopover(scope.row,'delete')">删除当前行</el-button> |
|
|
|
|
|
<el-button type="success" size="mini" @click="handlePopover(scope.row,'addSub')">增加子行</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-button slot="reference" :type="scope.row.opType?'success':'plain'" size="mini" icon="el-icon-edit" circle></el-button> |
|
|
|
|
|
</el-popover> |
|
|
|
|
|
<el-input style="width:100%;" v-model="scope.row.seqNo" @change="fieldChange(scope.row,'seqNo')"></el-input> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="phaseName" label="阶段名称" width="200" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input v-model="scope.row.phaseName" @change="fieldChange(scope.row,'phaseName')"></el-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="beginDate" label="起始时间" width="200" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<div> |
|
|
|
|
|
<el-date-picker style="width:100%;" |
|
|
|
|
|
v-model="scope.row.beginDate" |
|
|
|
|
|
align="right" |
|
|
|
|
|
type="date" |
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
|
format="yyyy-MM-dd" |
|
|
|
|
|
placeholder="选择日期" |
|
|
|
|
|
:picker-options="pickerOptions" @change="fieldChange(scope.row,'beginDate')"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
<br/> |
|
|
|
|
|
<el-date-picker style="width:100%;" |
|
|
|
|
|
v-model="scope.row.endDate" |
|
|
|
|
|
align="right" |
|
|
|
|
|
type="date" |
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
|
format="yyyy-MM-dd" |
|
|
|
|
|
placeholder="选择日期" |
|
|
|
|
|
:picker-options="pickerOptions" @change="fieldChange(scope.row,'endDate')"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="phaseBudgetHours" label="预计工作量及成本" min-width="300" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col :span="4"> |
|
|
|
|
|
工期.小时:<br/> |
|
|
|
|
|
<el-input style="width:90%;" v-model="scope.row.phaseBudgetHours" :precision="2" step="8" type="number" @change="fieldChange(scope.row,'phaseBudgetHours')"></el-input> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="20"> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
内购 |
|
|
|
|
|
<el-input style="width:80px;" v-model="scope.row.phaseBudgetInnerUserCnt" :precision="2" step="1" type="number" @change="fieldChange(scope.row,'phaseBudgetInnerUserCnt')"></el-input>人, |
|
|
|
|
|
|
|
|
|
|
|
共{{(scope.row.phaseBudgetInnerUserCnt*scope.row.phaseBudgetHours).toFixed(0)}}人时, |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-input style="width:80px;" v-model="scope.row.phaseBudgetInnerUserPrice" :precision="2" step="10" type="number" @change="fieldChange(scope.row,'phaseBudgetInnerUserPrice')"></el-input>元/人时, |
|
|
|
|
|
|
|
|
|
|
|
共{{(scope.row.phaseBudgetInnerUserCnt*scope.row.phaseBudgetHours*scope.row.phaseBudgetInnerUserPrice).toFixed(0)}}元 |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
外购 |
|
|
|
|
|
<el-input style="width:80px;" v-model="scope.row.phaseBudgetOutUserCnt" :precision="2" step="1" type="number" @change="fieldChange(scope.row,'phaseBudgetOutUserCnt')"></el-input>人, |
|
|
|
|
|
共{{(scope.row.phaseBudgetOutUserCnt*scope.row.phaseBudgetHours).toFixed(0)}}人时, |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-input style="width:80px" v-model="scope.row.phaseBudgetOutUserPrice" :precision="2" step="10" type="number" @change="fieldChange(scope.row,'phaseBudgetOutUserPrice')"></el-input>元/人时, |
|
|
|
|
|
|
|
|
|
|
|
共{{(scope.row.phaseBudgetOutUserCnt*scope.row.phaseBudgetHours*scope.row.phaseBudgetOutUserPrice).toFixed(0)}}元 |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="预算合计" width="120" > |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{(scope.row.phaseBudgetInnerUserAt+scope.row.phaseBudgetOutUserAt+scope.row.phaseBudgetNouserAt).toFixed(0)}}元 |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="remark" label="备注" min-width="100" > |
|
|
|
|
|
<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 v-if="gstcVisible"> |
|
|
<el-row v-if="gstcVisible"> |
|
|
<el-pagination v-if="simple!=true" layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[1,2,10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
|
|
|
|
|
<el-pagination v-else layout="total, 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="[1,2,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> |
|
|
|
|
|
|
|
|
<!--编辑 XmProjectPhase xm_project_phase界面--> |
|
|
<!--编辑 XmProjectPhase xm_project_phase界面--> |
|
|
@ -245,6 +127,9 @@ |
|
|
<xm-menu-select :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select> |
|
|
<xm-menu-select :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
<el-row v-if="batchEditVisible==true"> |
|
|
|
|
|
<xm-project-phase-batch :sel-project="selProject" @back="batchEditBack"></xm-project-phase-batch> |
|
|
|
|
|
</el-row> |
|
|
</section> |
|
|
</section> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -261,6 +146,7 @@ |
|
|
|
|
|
|
|
|
import {sn} from '@/common/js/sequence' |
|
|
import {sn} from '@/common/js/sequence' |
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from 'vuex' |
|
|
|
|
|
import XmProjectPhaseBatch from './XmProjectPhaseBatch.vue'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
computed: { |
|
|
computed: { |
|
|
@ -280,9 +166,6 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const projectPhaseTreeData = this.translateDataToTree(xmProjectPhases); |
|
|
const projectPhaseTreeData = this.translateDataToTree(xmProjectPhases); |
|
|
if (this.batchEditVisible) { |
|
|
|
|
|
this.rowDrop(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return projectPhaseTreeData; |
|
|
return projectPhaseTreeData; |
|
|
}, |
|
|
}, |
|
|
@ -350,7 +233,7 @@ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
props:['selProject','simple'], |
|
|
|
|
|
|
|
|
props:['selProject'], |
|
|
watch:{ |
|
|
watch:{ |
|
|
selProject:function(selProject,old){ |
|
|
selProject:function(selProject,old){ |
|
|
console.log('this.selProject==', selProject); |
|
|
console.log('this.selProject==', selProject); |
|
|
@ -1181,147 +1064,6 @@ |
|
|
this.editForm=row |
|
|
this.editForm=row |
|
|
this.xmRecordVisible=true |
|
|
this.xmRecordVisible=true |
|
|
}, |
|
|
}, |
|
|
// 行拖拽 |
|
|
|
|
|
rowDrop() { |
|
|
|
|
|
const _this = this |
|
|
|
|
|
// 被拖动的元素的索引 |
|
|
|
|
|
let dragged = null; |
|
|
|
|
|
// 被拖动的元素的索引 |
|
|
|
|
|
let draggedIndex = -1; |
|
|
|
|
|
|
|
|
|
|
|
// 目标元素 |
|
|
|
|
|
let target = document.querySelector('.drag-table .el-table__body-wrapper .el-table__body tbody'); |
|
|
|
|
|
|
|
|
|
|
|
let rows = 0;//行数 |
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
rows = target.childElementCount |
|
|
|
|
|
for (let i = 0; i < target.childElementCount; i++) { |
|
|
|
|
|
const child = target.children[i] |
|
|
|
|
|
child.draggable = true |
|
|
|
|
|
// child.style.cursor = 'copy' |
|
|
|
|
|
child.ondragstart = function(e){ |
|
|
|
|
|
console.log('开始--ondragstart--e==', e); |
|
|
|
|
|
|
|
|
|
|
|
dragged = e.path[0] |
|
|
|
|
|
draggedIndex = e.path[0].rowIndex |
|
|
|
|
|
console.log('child'+i+'开始拖拽'+draggedIndex); |
|
|
|
|
|
_this.cellMouseIndex = -1 |
|
|
|
|
|
dragged.style.cursor = 'grabbing' |
|
|
|
|
|
} |
|
|
|
|
|
child.ondragend = function(){ |
|
|
|
|
|
console.log('child'+i+'拖拽结束'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
},0) |
|
|
|
|
|
|
|
|
|
|
|
// 被拖动的元素正在那个容器里 |
|
|
|
|
|
let dragIndex = -1 |
|
|
|
|
|
|
|
|
|
|
|
target.ondragenter = function(e){ |
|
|
|
|
|
clearTimeout(loop) |
|
|
|
|
|
|
|
|
|
|
|
// 由于被拖动的元素 经过tbody中的每一元素都会触发该事件, 但是我们只需要它正在那一行上就行了 |
|
|
|
|
|
if(e.path[0].nodeName === 'TD'){ |
|
|
|
|
|
// throughRow 表示被拖动的元素正在哪一行上 |
|
|
|
|
|
const throughRow = e.path.find(path => { |
|
|
|
|
|
if(path.className.split(' ').includes('el-table__row')){ |
|
|
|
|
|
return path |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(dragIndex !== throughRow.rowIndex){ |
|
|
|
|
|
if(dragIndex > -1){ |
|
|
|
|
|
// 清除上次进入的容器的状态 |
|
|
|
|
|
const last = target.children[dragIndex]; |
|
|
|
|
|
clearClass(last) |
|
|
|
|
|
} |
|
|
|
|
|
// console.log('拖动进入目标元素'+selectRow.rowIndex); |
|
|
|
|
|
// 不是自己或未文件夹时才改变状态 |
|
|
|
|
|
if(draggedIndex !== throughRow.rowIndex ){ |
|
|
|
|
|
// 改变本次进入的容器的状态 |
|
|
|
|
|
dragged.style.cursor = 'copy' |
|
|
|
|
|
throughRow.style.height = 60+'px' |
|
|
|
|
|
throughRow.style.backgroundColor = '#e9fdcf' |
|
|
|
|
|
} |
|
|
|
|
|
dragIndex = throughRow.rowIndex |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
leaveIndex = -1 |
|
|
|
|
|
} |
|
|
|
|
|
target.ondragover = function(e){ |
|
|
|
|
|
// console.log('目标元素中拖拽...'); |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
leaveIndex = -1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let loop = null |
|
|
|
|
|
let leaveIndex = -1 // 是否拖出了整个table, -1表示还在table内 |
|
|
|
|
|
|
|
|
|
|
|
target.ondragleave = function(e){ |
|
|
|
|
|
console.log('ondragleave--e==', e); |
|
|
|
|
|
|
|
|
|
|
|
clearTimeout(loop) |
|
|
|
|
|
|
|
|
|
|
|
if(e.path[0].nodeName){ |
|
|
|
|
|
const throughRow = e.path.find(path => { |
|
|
|
|
|
if(path.className.split(' ').includes('el-table__row')){ |
|
|
|
|
|
return path; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(throughRow && dragIndex !== throughRow.rowIndex){ |
|
|
|
|
|
// console.log('拖动离开目标元素'+selectRow.rowIndex); |
|
|
|
|
|
// selectRow.style.height = 'unset' |
|
|
|
|
|
// selectRow.style.backgroundColor = '#fff' |
|
|
|
|
|
// dragIndex = selectRow.rowIndex |
|
|
|
|
|
} |
|
|
|
|
|
if(throughRow.rowIndex === 0 || throughRow.rowIndex === rows-1){ |
|
|
|
|
|
// 离开第一行或最后一行 |
|
|
|
|
|
leaveIndex = throughRow.rowIndex |
|
|
|
|
|
loop = setTimeout(function () { |
|
|
|
|
|
if(leaveIndex > -1){ |
|
|
|
|
|
console.log("离开了",leaveIndex) |
|
|
|
|
|
const leave = target.children[leaveIndex]; |
|
|
|
|
|
clearClass(leave) |
|
|
|
|
|
dragIndex = -1 |
|
|
|
|
|
} |
|
|
|
|
|
},100) |
|
|
|
|
|
}`` |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
target.ondrop = function(){ |
|
|
|
|
|
console.log('ondrop--放下了'+draggedIndex); |
|
|
|
|
|
// 清除上次进入的容器的状态 |
|
|
|
|
|
const last = target.children[dragIndex]; |
|
|
|
|
|
clearClass(last) |
|
|
|
|
|
dragged.style.cursor = 'default' |
|
|
|
|
|
|
|
|
|
|
|
console.log('ondrop--draggedIndex==', draggedIndex); |
|
|
|
|
|
console.log('ondrop--dragIndex==', dragIndex); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const form = _this.projectPhaseTreeData[draggedIndex]; |
|
|
|
|
|
const to = _this.projectPhaseTreeData[dragIndex]; |
|
|
|
|
|
|
|
|
|
|
|
const startId = _this.$refs['phase_'+draggedIndex].dataset.phaseId; |
|
|
|
|
|
const endId = _this.$refs['phase_'+dragIndex].dataset.phaseId; |
|
|
|
|
|
console.log(`startId:${startId}--endId:${endId}`); |
|
|
|
|
|
|
|
|
|
|
|
if (startId !== endId) { |
|
|
|
|
|
_this.changePmenuId(startId, endId) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let clearClass = function (node) { |
|
|
|
|
|
if(node){ |
|
|
|
|
|
node.style.height = 'unset' |
|
|
|
|
|
node.style.backgroundColor = '#fff' |
|
|
|
|
|
} |
|
|
|
|
|
dragged.style.cursor = 'grabbing' |
|
|
|
|
|
} |
|
|
|
|
|
// if(last && form.menuId !== to.menuId && to.isFolder){ |
|
|
|
|
|
// // 移动文件/文件夹 |
|
|
|
|
|
// _this.copyOrMoveApi('move', form.menuId, to.menuId) |
|
|
|
|
|
// } |
|
|
|
|
|
}, |
|
|
|
|
|
// 判断前后两个数据是否存在同一回路里面 |
|
|
// 判断前后两个数据是否存在同一回路里面 |
|
|
// dict 为字典;sId拖拽到menuId; ePmeuId 是放置位置的祖先 menuId; |
|
|
// dict 为字典;sId拖拽到menuId; ePmeuId 是放置位置的祖先 menuId; |
|
|
judgePmenuId(dict, sId, ePmeuId) { |
|
|
judgePmenuId(dict, sId, ePmeuId) { |
|
|
@ -1476,13 +1218,21 @@ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
batchEditBack:function(reload){ |
|
|
|
|
|
if(reload){ |
|
|
|
|
|
this.batchEditVisible=false; |
|
|
|
|
|
this.searchXmProjectPhases(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.batchEditVisible=false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
},//end methods |
|
|
},//end methods |
|
|
components: { |
|
|
components: { |
|
|
'xm-project-phase-add':XmProjectPhaseAdd, |
|
|
'xm-project-phase-add':XmProjectPhaseAdd, |
|
|
'xm-project-phase-edit':XmProjectPhaseEdit, |
|
|
'xm-project-phase-edit':XmProjectPhaseEdit, |
|
|
|
|
|
|
|
|
XmProjectPhaseTemplateMng,xmMenuSelect,XmGantt |
|
|
|
|
|
|
|
|
XmProjectPhaseTemplateMng,xmMenuSelect,XmGantt,XmProjectPhaseBatch |
|
|
//在下面添加其它组件 |
|
|
//在下面添加其它组件 |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
@ -1499,12 +1249,6 @@ |
|
|
this.options=res.data.data; |
|
|
this.options=res.data.data; |
|
|
}) |
|
|
}) |
|
|
}); |
|
|
}); |
|
|
// 阻止默认行为 |
|
|
|
|
|
document.body.ondrop = function (event) { |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
event.stopPropagation(); |
|
|
|
|
|
}; |
|
|
|
|
|
this.rowDrop(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|