<view class="box">
<view class="name">计划开工时间</view>
<view class="val"><uni-dateformat :date="detail.estimateTime" format="yyyy-MM-dd" ></uni-dateformat></view>
</view>
<view class="box">
<view class="name">计划竣工时间</view>
<view class="val"><uni-dateformat :date="detail.completionTime" format="yyyy-MM-dd" /></view>
</view>
<view class="main">
<title-line title="创优目标" bgcolor="rgba(94, 197, 252, 0.7)" />
<view class="ques-box">
<view class="label">质量创优等级</view>
<view class="right">{{ level[detail.qualityExcellenceLevel] || '--' }}</view>
</view>
<view class="ques-box">
<view class="label">安全创优等级</view>
<view class="right">{{ level[detail.safetyExcellenceLevel] || '--' }}</view>
</view>
</view>
title-line.vue
<template>
<view class="title-line">
<view class="title-box">
<view class="txt">{{title}}</view>
<view class="txt-bg" v-show="showBg" :style="{background: bgcolor}"></view>
</view>
<view class="right">
<slot name="right"></slot>
</view>
</view>
</template>
<script>
export default {
name:"title-line",
props: {
title: { default: '今日在场' },
bgcolor: { default: 'rgba(12, 224, 122, 0.22)' },
showBg: { default: true }
},
data() {
return {
};
}
}
</script>
1 个回复
小杏 (作者)
找到原因了,是我前面有一个参数处理的时候没有判断空值的情况