Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
7cdd772c
Commit
7cdd772c
authored
Mar 26, 2024
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8a7112f6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
21 deletions
+89
-21
index.vue
dsk-operate-ui/src/components/CustomTable/index.vue
+18
-4
index.vue
...projectCostLedger/detail/components/CostSummary/index.vue
+69
-15
index.vue
...projectCostLedger/detail/components/FeedSummary/index.vue
+1
-1
index.vue
...ojectCostLedger/detail/components/FieldExpenses/index.vue
+1
-1
No files found.
dsk-operate-ui/src/components/CustomTable/index.vue
View file @
7cdd772c
...
...
@@ -5,9 +5,9 @@
<div
class=
"custom-table-item"
>
<el-table
v-if=
"tableDataTotal>0"
class=
"custom-table"
v-loading=
"comTableLoading"
:data=
"tableData"
element-loading-text=
"加载中"
ref=
"customTableRef"
border
fit
highlight-current-row
:default-sort=
"defaultSort?defaultSort:
{}" @sort-change="sortChange"
@selection-change="selectionChange"
:cell-class-name="cellClassName" :cell-style="cellStyle" :row-class-name="rowClassNam
e"
:row-
style="rowStyle" :row-key="rowKey" :lazy="lazy" :load="loadFn" :tree-props="treeOptions" :height="height" :maxHeight="comMaxHeight
"
v-sticky-header="stickyHeader">
@selection-change="selectionChange"
@expand-change="expandChange" :cell-class-name="cellClassName" :cell-style="cellStyl
e"
:row-
class-name="rowClassName" :row-style="rowStyle" :row-key="rowKey" :lazy="lazy" :load="loadFn" :tree-props="treeOptions
"
:default-expand-all="defaultExpandAll" :indent="indent" :height="height" :maxHeight="comMaxHeight"
v-sticky-header="stickyHeader">
<!-- 列二次封装 -->
<template
v-for=
"(item,index) of formColum"
>
...
...
@@ -87,6 +87,20 @@ export default {
type
:
Object
,
default
:
()
=>
({})
},
// 树形结构默认展开行
defaultExpandAll
:
{
type
:
Boolean
,
default
:
false
},
// 树形结构展示事件
expandChange
:
{
type
:
Function
,
default
:
()
=>
{
}
},
indent
:
{
type
:
Number
,
default
:
16
},
// 吸顶偏移量
stickyHeader
:
{
type
:
Object
,
...
...
@@ -443,7 +457,7 @@ export default {
padding-right
:
12px
;
padding-left
:
12px
;
line-height
:
21px
;
font-size
:
1
4
px
;
font-size
:
1
2
px
;
font-weight
:
400
;
}
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/CostSummary/index.vue
View file @
7cdd772c
...
...
@@ -33,10 +33,10 @@
<!-- 数据列表部分 -->
<div
class=
"project-feedsummary-list-container"
>
<dsk-skeleton
v-if=
"tableLoading"
></dsk-skeleton>
<
!-- 非实体工程材料列表 --
>
<el-form
:model=
"dataForm"
ref=
"feedSummaryForm"
:show-message=
"false"
v-else-if=
"!tableLoading"
class=
"feed-summary-form"
>
<custom-table
:tableData=
"dataForm.tableDataList"
:formColum=
"formColum"
:max-height=
"true"
:row-key=
"rowKey"
:lazy=
"true
"
:
load-fn=
"tableLazyLoad"
:tree-options=
"treeOptions"
:tableDataTotal=
"total"
:
paging=
"false"
:cell-class-name=
"cellClassName"
>
<
el-form
:model=
"dataForm"
ref=
"costSummaryForm"
:show-message=
"false"
v-else-if=
"!tableLoading"
class=
"feed-summary-form"
>
<custom-table
ref=
"costSummaryTable"
:tableData=
"dataForm.tableDataList"
:formColum=
"formColum"
:max-height=
"true"
:row-key=
"rowKey"
:lazy=
"true"
:load-fn=
"tableLazyLoad"
:tree-options=
"treeOptions"
:default-expand-all=
"true"
:indent=
"8"
:tableDataTotal=
"total
"
:paging=
"false"
:cell-class-name=
"cellClassName"
>
</custom-table>
</el-form>
</div>
...
...
@@ -125,8 +125,8 @@ export default {
total
:
0
,
// 列表表头
formColum
:
[
{
label
:
'序号'
,
prop
:
"number"
,
w
idth
:
"53"
,
uid
:
v4
()
},
{
label
:
'名称'
,
prop
:
"cbName"
,
width
:
"303"
,
uid
:
v4
()
},
{
label
:
'序号'
,
prop
:
"number"
,
minW
idth
:
"53"
,
uid
:
v4
()
},
{
label
:
'名称'
,
prop
:
"cbName"
,
width
:
"303"
,
uid
:
v4
()
,
showOverflowTooltip
:
true
},
],
monthList
:
[],
rowKey
:
"id"
,
...
...
@@ -171,10 +171,14 @@ export default {
methods
:
{
cellClassName
({
row
,
column
,
rowIndex
,
columnIndex
})
{
// console.log(column);
if
(
columnIndex
==
0
)
{
return
"number-index-td"
;
}
else
{
const
{
property
}
=
column
;
if
(
editPropNames
.
includes
(
property
))
{
return
`can-edit-column-
${
property
}
`
;
}
}
return
""
;
},
getNowMonth
()
{
...
...
@@ -338,32 +342,73 @@ export default {
const
list
=
await
getCostSummaryListApi
(
params
);
if
(
list
.
code
==
200
&&
list
.
data
instanceof
Array
)
{
let
_temp
=
list
.
data
;
const
_mapList
=
new
Map
();
// 如果有长度循环处理字段
if
(
_temp
.
length
)
{
_temp
=
_temp
.
map
(
item
=>
{
if
(
!
item
.
hasChildren
)
{
item
.
hasChildren
=
false
;
}
else
{
// 有children
item
.
hasChildren
=
true
;
};
// 储存将子级储存到map 主动调用展开菜单
_mapList
.
set
(
item
.
id
,
item
.
children
?
cloneDeep
(
item
.
children
)
:
[]);
delete
item
.
children
;
return
item
;
});
}
console
.
log
(
_temp
);
this
.
$set
(
this
.
dataForm
,
"tableDataList"
,
cloneDeep
(
_temp
));
this
.
originTableDataList
=
cloneDeep
(
_temp
);
this
.
total
=
_temp
.
length
;
this
.
tableLoading
=
false
;
await
this
.
$nextTick
();
const
tableIns
=
this
.
$refs
[
"costSummaryTable"
].
$refs
[
"customTableRef"
];
if
(
tableIns
)
{
_mapList
.
forEach
((
child
,
id
)
=>
{
child
=
child
.
map
(
item
=>
{
item
.
hasChildren
=
item
.
hasChildren
?
true
:
false
;
return
item
;
});
// 打开一级菜单
this
.
customResolve
(
id
,
child
,
tableIns
);
});
}
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
finally
{
this
.
tableLoading
=
false
;
console
.
log
(
error
);
}
},
// 模拟 resolve 懒加载
customResolve
(
id
,
child
,
tableIns
,
level
=
1
)
{
let
children
=
child
;
let
newKey
=
id
;
let
treeNodeMap
=
tableIns
.
store
.
states
.
lazyTreeNodeMap
;
let
treeData
=
tableIns
.
store
.
states
.
treeData
;
//treeData 添加父子关系和状态
let
childrenids
=
Array
.
from
(
children
).
map
(
item
=>
item
.
id
);
let
metaInfo
=
{
children
:
childrenids
,
display
:
true
,
expanded
:
true
,
//这里设置展开
lazy
:
true
,
level
,
loaded
:
true
,
loading
:
false
};
this
.
$set
(
treeData
,
newKey
,
metaInfo
);
//lazyTreeNodeMap中 添加数据
this
.
$set
(
treeNodeMap
,
newKey
,
children
);
console
.
log
(
treeData
);
},
async
getCostSummaryListLazy
(
params
=
{})
{
try
{
const
list
=
await
getCostSummaryListApi
(
params
);
if
(
list
.
code
==
200
&&
list
.
data
instanceof
Array
)
{
let
_temp
=
list
.
data
;
let
_temp
=
list
.
data
?.
length
?
list
.
data
[
0
]
:
{};
_temp
=
_temp
.
children
?.
length
?
_temp
.
children
:
[];
// 如果有长度循环处理字段
if
(
_temp
.
length
)
{
_temp
=
_temp
.
map
(
item
=>
{
...
...
@@ -384,6 +429,7 @@ export default {
// 列表懒加载
async
tableLazyLoad
(
row
,
treeNode
,
resolve
)
{
try
{
console
.
log
(
treeNode
);
const
{
id
}
=
row
;
const
{
cbType
,
expenseDate
}
=
this
.
createRequestConditions
();
const
params
=
{
...
...
@@ -392,8 +438,7 @@ export default {
};
expenseDate
?
params
[
"expenseDate"
]
=
expenseDate
:
null
;
const
_lazyResult
=
await
this
.
getCostSummaryListLazy
(
params
);
resolve
([]);
resolve
(
_lazyResult
?
_lazyResult
:
null
);
}
catch
(
error
)
{
}
...
...
@@ -571,7 +616,7 @@ export default {
}
::v-deep
.custom-table-list-com-ins
{
.table-item
{
.
custom-
table-item
{
.el-table
{
th
{
height
:
40px
;
...
...
@@ -580,6 +625,15 @@ export default {
font-size
:
14px
;
font-weight
:
350
;
}
.number-index-td
{
.cell
{
display
:
flex
;
align-items
:
center
;
.el-table__expand-icon
{
margin-right
:
5px
;
}
}
}
.inner-edit-input-item
{
margin-bottom
:
0px
;
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/index.vue
View file @
7cdd772c
...
...
@@ -851,7 +851,7 @@ export default {
}
::v-deep
.custom-table-list-com-ins
{
.table-item
{
.
custom-
table-item
{
.el-table
{
th
{
height
:
40px
;
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/FieldExpenses/index.vue
View file @
7cdd772c
...
...
@@ -467,7 +467,7 @@ export default {
}
::v-deep
.custom-table-list-com-ins
{
.table-item
{
.
custom-
table-item
{
.el-table
{
th
{
height
:
40px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment