Commit c0805081 by 李伟康

fix(dailyNewspaper): 解决日报模板数据显示问题

- 添加了模板数据的控制台日志输出用于调试
- 修复了协商详情组件中子元素为空时的显示逻辑
- 在数据格式化方法中添加了try-catch异常处理
- 调整了页面样式布局,修复了高度计算和定位问题
- 注释掉了不必要的绝对定位样式配置
1 parent e9d4229f
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<view <view
class="list-box" class="list-box"
:key="index" :key="index"
v-if="item.children && item.children.length"
> >
<view class="list-title">{{ item.label }}</view> <view class="list-title">{{ item.label }}</view>
<Table <Table
...@@ -69,6 +70,7 @@ export default { ...@@ -69,6 +70,7 @@ export default {
return value != null && value !== undefined && value !== '' ? value : '-' return value != null && value !== undefined && value !== '' ? value : '-'
}, },
formatData (data) { formatData (data) {
try {
let list = utils.deepClone(data) let list = utils.deepClone(data)
list.map(item => { list.map(item => {
let columns = [], let columns = [],
...@@ -96,6 +98,9 @@ export default { ...@@ -96,6 +98,9 @@ export default {
}) })
this.list = list this.list = list
this.loadComplete = true this.loadComplete = true
} catch (error) {
console.log(error)
}
} }
} }
} }
...@@ -103,22 +108,25 @@ export default { ...@@ -103,22 +108,25 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.daily-report { .daily-report {
height: 100%; height: calc(100% - #{toRpx(96)});
position: relative; position: relative;
overflow-y: auto;
margin: 48rpx;
border-radius: 32rpx;
.common-title { .common-title {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
} }
.list-box { .list-box {
position: absolute; // position: absolute;
width: calc(100% - #{toRpx(96)}); // width: calc(100% - #{toRpx(96)});
height: calc(100% - #{toRpx(80)}); // height: calc(100% - #{toRpx(80)});
border-radius: 32rpx; //
background: #fff; background: #fff;
top: 48rpx; // top: 48rpx;
left: 50%; // left: 50%;
transform: translateX(-50%); // transform: translateX(-50%);
padding: 0 0 32rpx 32rpx; padding: 0 0 32rpx 32rpx;
overflow-x: auto; overflow-x: auto;
.list-title { .list-title {
......
...@@ -390,6 +390,7 @@ export default { ...@@ -390,6 +390,7 @@ export default {
} else e.children = [] } else e.children = []
}) })
this.templateData = templateData this.templateData = templateData
console.log(templateData)
} }
else { else {
if (nowDate == currentDate) this.getDailyTemplate() if (nowDate == currentDate) this.getDailyTemplate()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!