Browse Source

Merge remote-tracking branch 'origin/qin_25'

qin_26
herenshan112 3 months ago
parent
commit
116af4a7a3
  1. 29
      src/components/DesignForm/app/index.vue
  2. 30
      src/components/DesignForm/tableListPage/index.vue

29
src/components/DesignForm/app/index.vue

@ -1807,14 +1807,14 @@ const readerColumnSun = (column: any) => {
};
//shuju
const tableChildren = (field:string,dataList:any) => {
console.log("表头label长度-1->", field);
console.log("表头label长度-2->", dataList);
// console.log("label-1->", field);
// console.log("label-2->", dataList);
// console.log("label-->", isObject(dataList));
let jieguo = ""
if(Array.isArray(dataList)){
dataList.forEach((item:any,key:string) => {
console.log("表头label长度-item--->",field, item);
if(isObject(item)){
for (let key in item) {
@ -1822,7 +1822,12 @@ const tableChildren = (field:string,dataList:any) => {
if (field == key){
// console.log("label-->", item[key]);
// return item[key]
jieguo = item[key]
if(jieguo!=""){
jieguo = jieguo+"<div style='width: 100%;height: 1px;border-bottom: 1px solid #EBEEF5; margin: 8px 0;'></div>"+item[key]
}else{
jieguo = item[key]
}
}
}
}
@ -2066,7 +2071,7 @@ const isObject = (obj) => {
</div>
</el-col>
<el-col v-if="viewType == 1" :span="24">
<el-col v-if="viewType == 1" :span="24" class="tableTdClass">
<el-table
v-bind="data.tableProps"
ref="table"
@ -2248,11 +2253,12 @@ const isObject = (obj) => {
align="center"
>
<template #default="scope">
<template v-if="item.pattern == 'table'" v-for="sunItem in item.children">
<el-table-column v-if="sunItem.fieldClass == ''" :prop="sunItem.field" :label="sunItem.label" header-align="center" align="center" :min-width="readerColumnSun(sunItem)">
<template #default="scopeChilder">
{{ sunItem.fieldClass }}
{{ tableChildren(sunItem.field,scopeChilder.row[item.field]) }}
<div v-html="tableChildren(sunItem.field,scopeChilder.row[item.field])"></div>
</template>
</el-table-column>
</template>
@ -2602,6 +2608,7 @@ const isObject = (obj) => {
.operatLeft {
padding-bottom: 2px;
}
}
.group {
width: auto;
@ -2656,4 +2663,12 @@ th {
padding: 8px;
vertical-align: middle; /* 设置文字上下居中 */
}
.tableTdClass{
:deep .cell{
padding: 0;
}
:deep .el-table--default .cell{
padding: 0;
}
}
</style>

30
src/components/DesignForm/tableListPage/index.vue

@ -1680,7 +1680,11 @@ const tableChildren = (field:string,dataList:any) => {
if (field == key){
// console.log("label-->", item[key]);
// return item[key]
jieguo = item[key]
if(jieguo!=""){
jieguo = jieguo+"<div style='width: 100%;height: 1px;border-bottom: 1px solid #EBEEF5; margin: 8px 0;'></div>"+item[key]
}else{
jieguo = item[key]
}
}
}
}
@ -1916,7 +1920,7 @@ const isObject = (obj) => {
</div>
</div>
</el-col>
<el-col v-if="viewType == 1" :span="24">
<el-col v-if="viewType == 1" :span="24" class="tableTdClass">
<el-table
v-bind="data.tableProps"
ref="table"
@ -2097,12 +2101,14 @@ const isObject = (obj) => {
align="center"
>
<template #default="scope">
<el-table-column v-if="item.pattern == 'table'" v-for="sunItem in item.children" :prop="sunItem.field" :label="sunItem.label" header-align="center"
align="center" :min-width="readerColumnSun(sunItem)" >
<template #default="scopeChilder">
{{ tableChildren(sunItem.field,scopeChilder.row[item.field]) }}
</template>
</el-table-column>
<template v-if="item.pattern == 'table'" v-for="sunItem in item.children">
<el-table-column v-if="sunItem.fieldClass == ''" :prop="sunItem.field" :label="sunItem.label" header-align="center" align="center" :min-width="readerColumnSun(sunItem)">
<template #default="scopeChilder">
<div v-html="tableChildren(sunItem.field,scopeChilder.row[item.field])"></div>
</template>
</el-table-column>
</template>
</template>
</el-table-column>
<el-table-column
@ -2539,4 +2545,12 @@ th {
padding: 8px;
vertical-align: middle; /* 设置文字上下居中 */
}
.tableTdClass{
:deep .cell{
padding: 0;
}
:deep .el-table--default .cell{
padding: 0;
}
}
</style>

Loading…
Cancel
Save