Commit fc60aaee authored by wangdanlei's avatar wangdanlei

任务中心图纸图册

parent 94a1feb8
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -26,10 +26,14 @@ export function recursion(modelName, params, batchFlag) {
return post(`/${modelName}/recursion${batchFlag ? 's' : ''}`, params, true)
}
// 批量删除
// 深度查询
export function findRecursion(modelName, params) {
return post(`/${modelName}/find/recursion`, params)
}
// 查询
export function recursions(modelName, params) {
return post(`/${modelName}/recursions`, params)
}
// 深度查询
export function getParentData(modelName, id) {
return get(`/${modelName}/flat/parent/${id}`)
......@@ -148,6 +152,7 @@ export default {
apiDownloadFile,
apiUploadFile,
deleteByExample,
findRecursion
findRecursion,
recursions
}
......@@ -21,16 +21,17 @@ export default {
emitMethods: [
{
methods: 'getData',
methodsName: '获取数据1'
methodsName: '获取数据'
}
]
],
layKey: ''
}
},
computed: {
layConfig() {
return {
layKey: '',
typeName: ''
typeName: this.layKey,
layKey: 'defaultInfo'
}
}
},
......@@ -45,9 +46,11 @@ export default {
mounted() {
},
methods: {
clickNode() {},
getData(data) {
console.log(111, data)
this.layKey = ['InstallAtlas', 'DesignAtlas'].includes(data.subTypeName) ? data.subTypeName : 'DesignDrawings'
this.basicData = {
id: data.id
}
}
}
}
......
......@@ -11,19 +11,17 @@
node-key="id"
:data="treeData"
:props="treeProps"
default-expand-all
:check-strictly="true"
:expand-on-click-node="false"
:default-expand-all="false"
show-checkbox
:highlight-current="true"
@check-change="handleCheckChange"
>
<div
slot-scope="{ node, data }"
@click="clickNode(node)"
>
<div slot-scope="{ node, data }" @click="clickNode(data)">
<span class="change-text" style="font-size:14px">
{{ data.name }}
{{ data.name }}({{ data.number }})
</span>
</div>
</el-tree>
<dee-drawer
......@@ -62,7 +60,8 @@ export default {
name: '点击事件'
}
],
dialogVisible: false
dialogVisible: false,
selectionList: []
}
},
computed: {
......@@ -87,10 +86,16 @@ export default {
},
methods: {
getTreeData() {
this.treeData = []
const params = {
'openProps': [{
'openProps': [
{
'name': 'target'
}],
},
{
'name': 'source'
}
],
'pageFrom': 1,
'pageSize': 999,
'searchItems': {
......@@ -106,17 +111,55 @@ export default {
}
this.$api.findRecursion('ExtAtlasDrawingLink', params).then(res => {
if (res.code === 0) {
let topNode = {}
const childrenList = []
if (res.items.content && res.items.content.length) {
topNode = res.items.content[0].source
topNode.disabled = true
res.items.content.forEach(item => {
item.target.linkId = item.id
childrenList.push(item.target)
})
topNode.children = childrenList
this.treeData.push(topNode)
}
}
})
},
clickNode(node) {
this.$emit('clickNode', node)
clickNode(data) {
this.$emit('clickNode', data)
},
create() {
this.dialogVisible = true
},
handleCheckChange(data, checked) {
if (checked) {
this.selectionList.push(data)
} else {
this.selectionList = this.selectionList.filter(item => item.id !== data.id)
}
},
deleteEvent() {
if (this.selectionList.length) {
const params = this.selectionList.map(item => {
return {
operator: 'REMOVE',
id: item.linkId
}
})
this.$utils.showConfirm(
`你是否确定删除选中的数据`,
'提示',
'warning',
'确定',
'取消',
() => {
this.$api.recursions('ExtAtlasDrawingLink', params).then(res => {
this.$utils.showMessageSuccess('删除成功')
this.getTreeData()
})
})
}
},
handleClose() {
this.dialogVisible = false
......@@ -136,4 +179,7 @@ export default {
.tree{
height: calc(100% - 35px);
}
/deep/.el-checkbox__input.is-disabled .el-checkbox__inner{
display: none
}
</style>
......@@ -64,6 +64,7 @@ export default {
}
this.$api.searchApi('ExtPlanBaseLine', params).then(res => {
if (res.code === 0) {
res.items.content = res.items.content.filter(x => x.planType === this.$route.query.planType)
this.options = res.items.content.map(item => {
return {
label: item.name + '(' + item.planDisPlayName + ')',
......
......@@ -48,26 +48,20 @@
/>
</div>
</div>
<filter-column :dialog-visible="dialogVisible" :table-columns="tableColumns" @changeColumns="changeColumns" @handleClose="handleClose" />
<filter-column :dialog-visible="dialogVisible" :table-columns="showColumns" @changeColumns="changeColumns" @handleClose="handleClose" />
</div>
</template>
<script>
import FilterColumn from './filterColumn'
import { getLayOut } from '@/api/config'
import { getPlanTreeAndTask } from '@/api/plan'
import baselineSelect from './baselineSelect.vue'
import { post } from '@/utils/http'
export default {
name: 'BaselineCompare',
componentName: '基线对比',
components: { FilterColumn, baselineSelect },
props: {
selectedData: {
type: Array,
default: () => []
}
},
props: {},
data() {
return {
selectedDataDisplay: [],
......@@ -92,30 +86,12 @@ export default {
showColumns: [],
baselineData: [],
leftDefault: '',
rightDefault: ''
}
},
computed: {
},
watch: {
selectedData: {
deep: true,
immediate: true,
handler: function(val) {
if (val && val.length) {
this.selectedDataDisplay = JSON.parse(JSON.stringify(val))
this.selectedDataDisplay = this.sortBaselineArr(this.selectedDataDisplay)
this.getTableData()
}
}
rightDefault: '',
columnsKeyList: []
}
},
created() {
this.getColumns()
},
beforeDestroy() {
},
mounted() {
},
......@@ -136,32 +112,28 @@ export default {
},
getColumns() {
const params = {
modelDefName: 'DxTask',
layoutType: 'baselineCompareTable'
modelDefName: this.$route.query.planType,
layoutType: 'baseCompareTable'
}
getLayOut(params).then(res => {
if (res.items && res.items.content) {
const data = JSON.parse(res.items.content[0].configDetails)
this.tableColumns = data.tableObj.tableColumns
const sortedShowItems = ['serialNo', 'name', 'manager.userName', 'planStartDate', 'planEndDate', 'state', 'milepost']
localStorage.setItem('sortColumnName_tblCmp_DxPlan_baselineCompareTable', JSON.stringify(sortedShowItems))
const uncheckItems = ['actualStartDate', 'actualEndDate']
localStorage.setItem('unCheckedColumnName_tblCmp_DxPlan_baselineCompareTable', JSON.stringify(uncheckItems))
this.showColumns = this.tableColumns.filter(r => sortedShowItems.includes(r.key))
this.showColumns = data.tableObj.tableColumns
this.columnsKeyList = this.showColumns.map(x => x.key)
}
})
},
set_left_row_style({ row, column, rowIndex, columnIndex }) {
set_left_row_style({ row }) {
if (row && row.style) {
return { background: '#81C966' }
}
},
set_right_row_style({ row, column, rowIndex, columnIndex }) {
set_right_row_style({ row }) {
if (row && row.style) {
return { background: '#F57D7D' }
}
},
set_cell_style({ row, column, rowIndex, columnIndex }) {
set_cell_style({ row }) {
if (row && row.style) return
const keyList = Object.keys(this.changedDataObj)
if (keyList.length > 0) {
......@@ -173,32 +145,8 @@ export default {
}
}
},
getTableData() {
var tarId = this.selectedDataDisplay[0].sourceId
var tarName = '原计划'
var tarIsOrigPlan = true
if (this.selectedDataDisplay.length > 1) {
tarId = this.selectedDataDisplay[1].targetId
tarName = this.selectedDataDisplay[1].name
tarIsOrigPlan = false
}
getPlanTreeAndTask(tarId).then(res => {
this.targetForm = {
planName: this.selectedDataDisplay[0].source.name,
name: tarName
}
const leftArr = this.handleDateFormat(res.items)
this.getOriginalData(leftArr, tarIsOrigPlan)
})
},
handleDateFormat(data) {
data.forEach(item => {
item.planStartDate = item.planStartDate.slice(0, 10)
item.planEndDate = item.planEndDate.slice(0, 10)
})
return data
},
getLeftChoose(id) {
this.leftTableDataOriginal = []
const params = {
'pageFrom': 1,
'pageSize': 9999,
......@@ -243,6 +191,7 @@ export default {
})
},
getRightChoose(id) {
this.rightTableDataOriginal = []
const params = {
'pageFrom': 1,
'pageSize': 9999,
......@@ -286,18 +235,6 @@ export default {
this.copareLeftAndRight(this.leftTableDataOriginal, this.rightTableDataOriginal)
})
},
// 查询原始基线相关的任务
getOriginalData(leftArr, tarIsOrigPlan) {
const origId = this.selectedDataDisplay[0].targetId
getPlanTreeAndTask(origId).then(res => {
this.originalForm = {
planName: this.selectedDataDisplay[0].source.name,
name: this.selectedDataDisplay[0].name
}
const rightArr = this.handleDateFormat(res.items)
this.copareLeftAndRight(leftArr, rightArr, tarIsOrigPlan)
})
},
// 对比左右两侧基线
copareLeftAndRight(leftArr, rightArr) {
this.leftTableData = []
......@@ -305,34 +242,24 @@ export default {
if (leftArr.length === 0 || rightArr.length === 0) {
return
}
this.changedDataObj = {}
leftArr.forEach(left => {
var leftId = left.dynamicAttrs.baseLineRefId
// 左有右无
const findItemInRightArr = rightArr.find(x => x.dynamicAttrs.baseLineRefId === leftId)
const findItemInRightArr = rightArr.find(x => x.dynamicAttrs.baseLineRefId === left.dynamicAttrs.baseLineRefId)
if (!findItemInRightArr) {
left.style = { background: '#81C966' }
this.leftTableData.push(left)
this.rightTableData.push({})
} else {
// 两边都有
// console.log('left', left)
this.leftTableData.push(left)
this.rightTableData.push(findItemInRightArr)
this.changedDataObj[left.dynamicAttrs.baseLineRefId] = []
// 两边都有,比较字段的差别
Object.keys(left).forEach(leftKey => {
let leftValue = left[leftKey]
let rightValue = findItemInRightArr[leftKey]
// 责任人字段特殊处理
if (leftKey === 'manager') {
leftValue = left[leftKey].userId
rightValue = findItemInRightArr[leftKey].userId
leftKey = 'manager.userName'
}
if (leftValue !== rightValue) {
if (this.columnsKeyList.includes(leftKey) && left[leftKey] !== findItemInRightArr[leftKey]) {
this.changedDataObj[left.dynamicAttrs.baseLineRefId].push(leftKey)
}
this.changedDataObj[left.dynamicAttrs.baseLineRefId].push(leftKey)
})
}
})
......@@ -345,7 +272,6 @@ export default {
this.rightTableData.push(right)
}
})
// console.log('this.changedDataObj', this.changedDataObj)
},
changeColumns(columns) {
this.showColumns = columns
......
......@@ -330,7 +330,7 @@ export default {
if (['DesignAtlas', 'InstallAtlas'].includes(params.subTypeName)) {
this.$router.push({
path: `/page/a50df027-6fcf-4b73-aa06-32eebfc004a7`,
query: { id: params.id }
query: { id: params.versionId }
})
} else {
this.$router.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment