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) { ...@@ -26,10 +26,14 @@ export function recursion(modelName, params, batchFlag) {
return post(`/${modelName}/recursion${batchFlag ? 's' : ''}`, params, true) return post(`/${modelName}/recursion${batchFlag ? 's' : ''}`, params, true)
} }
// 批量删除 // 深度查询
export function findRecursion(modelName, params) { export function findRecursion(modelName, params) {
return post(`/${modelName}/find/recursion`, params) return post(`/${modelName}/find/recursion`, params)
} }
// 查询
export function recursions(modelName, params) {
return post(`/${modelName}/recursions`, params)
}
// 深度查询 // 深度查询
export function getParentData(modelName, id) { export function getParentData(modelName, id) {
return get(`/${modelName}/flat/parent/${id}`) return get(`/${modelName}/flat/parent/${id}`)
...@@ -148,6 +152,7 @@ export default { ...@@ -148,6 +152,7 @@ export default {
apiDownloadFile, apiDownloadFile,
apiUploadFile, apiUploadFile,
deleteByExample, deleteByExample,
findRecursion findRecursion,
recursions
} }
...@@ -21,16 +21,17 @@ export default { ...@@ -21,16 +21,17 @@ export default {
emitMethods: [ emitMethods: [
{ {
methods: 'getData', methods: 'getData',
methodsName: '获取数据1' methodsName: '获取数据'
} }
] ],
layKey: ''
} }
}, },
computed: { computed: {
layConfig() { layConfig() {
return { return {
layKey: '', typeName: this.layKey,
typeName: '' layKey: 'defaultInfo'
} }
} }
}, },
...@@ -45,9 +46,11 @@ export default { ...@@ -45,9 +46,11 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
clickNode() {},
getData(data) { 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 @@ ...@@ -11,19 +11,17 @@
node-key="id" node-key="id"
:data="treeData" :data="treeData"
:props="treeProps" :props="treeProps"
default-expand-all
:check-strictly="true" :check-strictly="true"
:expand-on-click-node="false" :expand-on-click-node="false"
:default-expand-all="false" show-checkbox
:highlight-current="true" :highlight-current="true"
@check-change="handleCheckChange"
> >
<div <div slot-scope="{ node, data }" @click="clickNode(data)">
slot-scope="{ node, data }"
@click="clickNode(node)"
>
<span class="change-text" style="font-size:14px"> <span class="change-text" style="font-size:14px">
{{ data.name }} {{ data.name }}({{ data.number }})
</span> </span>
</div> </div>
</el-tree> </el-tree>
<dee-drawer <dee-drawer
...@@ -62,7 +60,8 @@ export default { ...@@ -62,7 +60,8 @@ export default {
name: '点击事件' name: '点击事件'
} }
], ],
dialogVisible: false dialogVisible: false,
selectionList: []
} }
}, },
computed: { computed: {
...@@ -87,10 +86,16 @@ export default { ...@@ -87,10 +86,16 @@ export default {
}, },
methods: { methods: {
getTreeData() { getTreeData() {
this.treeData = []
const params = { const params = {
'openProps': [{ 'openProps': [
{
'name': 'target' 'name': 'target'
}], },
{
'name': 'source'
}
],
'pageFrom': 1, 'pageFrom': 1,
'pageSize': 999, 'pageSize': 999,
'searchItems': { 'searchItems': {
...@@ -106,17 +111,55 @@ export default { ...@@ -106,17 +111,55 @@ export default {
} }
this.$api.findRecursion('ExtAtlasDrawingLink', params).then(res => { this.$api.findRecursion('ExtAtlasDrawingLink', params).then(res => {
if (res.code === 0) { 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) { clickNode(data) {
this.$emit('clickNode', node) this.$emit('clickNode', data)
}, },
create() { create() {
this.dialogVisible = true this.dialogVisible = true
}, },
handleCheckChange(data, checked) {
if (checked) {
this.selectionList.push(data)
} else {
this.selectionList = this.selectionList.filter(item => item.id !== data.id)
}
},
deleteEvent() { 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() { handleClose() {
this.dialogVisible = false this.dialogVisible = false
...@@ -136,4 +179,7 @@ export default { ...@@ -136,4 +179,7 @@ export default {
.tree{ .tree{
height: calc(100% - 35px); height: calc(100% - 35px);
} }
/deep/.el-checkbox__input.is-disabled .el-checkbox__inner{
display: none
}
</style> </style>
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
} }
this.$api.searchApi('ExtPlanBaseLine', params).then(res => { this.$api.searchApi('ExtPlanBaseLine', params).then(res => {
if (res.code === 0) { 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 => { this.options = res.items.content.map(item => {
return { return {
label: item.name + '(' + item.planDisPlayName + ')', label: item.name + '(' + item.planDisPlayName + ')',
......
...@@ -48,26 +48,20 @@ ...@@ -48,26 +48,20 @@
/> />
</div> </div>
</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> </div>
</template> </template>
<script> <script>
import FilterColumn from './filterColumn' import FilterColumn from './filterColumn'
import { getLayOut } from '@/api/config' import { getLayOut } from '@/api/config'
import { getPlanTreeAndTask } from '@/api/plan'
import baselineSelect from './baselineSelect.vue' import baselineSelect from './baselineSelect.vue'
import { post } from '@/utils/http' import { post } from '@/utils/http'
export default { export default {
name: 'BaselineCompare', name: 'BaselineCompare',
componentName: '基线对比', componentName: '基线对比',
components: { FilterColumn, baselineSelect }, components: { FilterColumn, baselineSelect },
props: { props: {},
selectedData: {
type: Array,
default: () => []
}
},
data() { data() {
return { return {
selectedDataDisplay: [], selectedDataDisplay: [],
...@@ -92,30 +86,12 @@ export default { ...@@ -92,30 +86,12 @@ export default {
showColumns: [], showColumns: [],
baselineData: [], baselineData: [],
leftDefault: '', leftDefault: '',
rightDefault: '' rightDefault: '',
} columnsKeyList: []
},
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()
}
}
} }
}, },
created() { created() {
this.getColumns() this.getColumns()
},
beforeDestroy() {
}, },
mounted() { mounted() {
}, },
...@@ -136,32 +112,28 @@ export default { ...@@ -136,32 +112,28 @@ export default {
}, },
getColumns() { getColumns() {
const params = { const params = {
modelDefName: 'DxTask', modelDefName: this.$route.query.planType,
layoutType: 'baselineCompareTable' layoutType: 'baseCompareTable'
} }
getLayOut(params).then(res => { getLayOut(params).then(res => {
if (res.items && res.items.content) { if (res.items && res.items.content) {
const data = JSON.parse(res.items.content[0].configDetails) const data = JSON.parse(res.items.content[0].configDetails)
this.tableColumns = data.tableObj.tableColumns this.showColumns = data.tableObj.tableColumns
const sortedShowItems = ['serialNo', 'name', 'manager.userName', 'planStartDate', 'planEndDate', 'state', 'milepost'] this.columnsKeyList = this.showColumns.map(x => x.key)
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))
} }
}) })
}, },
set_left_row_style({ row, column, rowIndex, columnIndex }) { set_left_row_style({ row }) {
if (row && row.style) { if (row && row.style) {
return { background: '#81C966' } return { background: '#81C966' }
} }
}, },
set_right_row_style({ row, column, rowIndex, columnIndex }) { set_right_row_style({ row }) {
if (row && row.style) { if (row && row.style) {
return { background: '#F57D7D' } return { background: '#F57D7D' }
} }
}, },
set_cell_style({ row, column, rowIndex, columnIndex }) { set_cell_style({ row }) {
if (row && row.style) return if (row && row.style) return
const keyList = Object.keys(this.changedDataObj) const keyList = Object.keys(this.changedDataObj)
if (keyList.length > 0) { if (keyList.length > 0) {
...@@ -173,32 +145,8 @@ export default { ...@@ -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) { getLeftChoose(id) {
this.leftTableDataOriginal = []
const params = { const params = {
'pageFrom': 1, 'pageFrom': 1,
'pageSize': 9999, 'pageSize': 9999,
...@@ -243,6 +191,7 @@ export default { ...@@ -243,6 +191,7 @@ export default {
}) })
}, },
getRightChoose(id) { getRightChoose(id) {
this.rightTableDataOriginal = []
const params = { const params = {
'pageFrom': 1, 'pageFrom': 1,
'pageSize': 9999, 'pageSize': 9999,
...@@ -286,18 +235,6 @@ export default { ...@@ -286,18 +235,6 @@ export default {
this.copareLeftAndRight(this.leftTableDataOriginal, this.rightTableDataOriginal) 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) { copareLeftAndRight(leftArr, rightArr) {
this.leftTableData = [] this.leftTableData = []
...@@ -305,34 +242,24 @@ export default { ...@@ -305,34 +242,24 @@ export default {
if (leftArr.length === 0 || rightArr.length === 0) { if (leftArr.length === 0 || rightArr.length === 0) {
return return
} }
this.changedDataObj = {}
leftArr.forEach(left => { 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) { if (!findItemInRightArr) {
left.style = { background: '#81C966' } left.style = { background: '#81C966' }
this.leftTableData.push(left) this.leftTableData.push(left)
this.rightTableData.push({}) this.rightTableData.push({})
} else { } else {
// 两边都有 // 两边都有
// console.log('left', left)
this.leftTableData.push(left) this.leftTableData.push(left)
this.rightTableData.push(findItemInRightArr) this.rightTableData.push(findItemInRightArr)
this.changedDataObj[left.dynamicAttrs.baseLineRefId] = [] this.changedDataObj[left.dynamicAttrs.baseLineRefId] = []
// 两边都有,比较字段的差别 // 两边都有,比较字段的差别
Object.keys(left).forEach(leftKey => { Object.keys(left).forEach(leftKey => {
let leftValue = left[leftKey] if (this.columnsKeyList.includes(leftKey) && left[leftKey] !== findItemInRightArr[leftKey]) {
let rightValue = findItemInRightArr[leftKey]
// 责任人字段特殊处理
if (leftKey === 'manager') {
leftValue = left[leftKey].userId
rightValue = findItemInRightArr[leftKey].userId
leftKey = 'manager.userName'
}
if (leftValue !== rightValue) {
this.changedDataObj[left.dynamicAttrs.baseLineRefId].push(leftKey) this.changedDataObj[left.dynamicAttrs.baseLineRefId].push(leftKey)
} }
this.changedDataObj[left.dynamicAttrs.baseLineRefId].push(leftKey)
}) })
} }
}) })
...@@ -345,7 +272,6 @@ export default { ...@@ -345,7 +272,6 @@ export default {
this.rightTableData.push(right) this.rightTableData.push(right)
} }
}) })
// console.log('this.changedDataObj', this.changedDataObj)
}, },
changeColumns(columns) { changeColumns(columns) {
this.showColumns = columns this.showColumns = columns
......
...@@ -330,7 +330,7 @@ export default { ...@@ -330,7 +330,7 @@ export default {
if (['DesignAtlas', 'InstallAtlas'].includes(params.subTypeName)) { if (['DesignAtlas', 'InstallAtlas'].includes(params.subTypeName)) {
this.$router.push({ this.$router.push({
path: `/page/a50df027-6fcf-4b73-aa06-32eebfc004a7`, path: `/page/a50df027-6fcf-4b73-aa06-32eebfc004a7`,
query: { id: params.id } query: { id: params.versionId }
}) })
} else { } else {
this.$router.push({ 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