Commit d75ca9dc by 李伟康

style(template): 格式化日报组件模板代码

- 统一了 class 绑定的语法格式
- 修复了多行属性的缩进问题
- 简化了数据函数的写法
- 添加了对 ReportStatus 的监听处理
- 优化了 CSS 类名的格式化
- 调整了样式代码的布局结构
1 parent 3e8d1a31
<template>
<view class="report-content ">
<view :class="['report-component',{'opacity':showNegotiationList},{'show':showReport}]">
<view :class="['report-component', { 'opacity': showNegotiationList }, { 'show': showReport }]">
<template v-if="!isToday || ReportStatus == 1">
<Detail :templateData="templateData" />
</template>
<template v-else>
<Edit
:templateData="templateData"
@showNegotiationList="changeComponent(true)"
@saveReport="saveReport"
@submitReport="submitReport"
:reportDate="currentDate"
:ReportStatus="ReportStatus"
@getSaveBtnStatus="saveBtnStatus = $event"
/>
<Edit :templateData="templateData" @showNegotiationList="changeComponent(true)" @saveReport="saveReport"
@submitReport="submitReport" :reportDate="currentDate" :ReportStatus="ReportStatus"
@getSaveBtnStatus="saveBtnStatus = $event" />
</template>
</view>
<template v-if="showNegotiationList">
<NegotiationList
:currentDate="currentDate"
@back="changeComponent(false)"
/>
<NegotiationList :currentDate="currentDate" @back="changeComponent(false)" />
</template>
</view>
</template>
......@@ -36,7 +27,7 @@ export default {
components: { Detail, Edit, NegotiationList },
mixins: [mixins],
name: 'StoreDailyReport',
data () {
data() {
return {
showNegotiationList: false,
showReport: true
......@@ -48,7 +39,7 @@ export default {
},
watch: {
currentDate: {
handler (val) {
handler(val) {
if (val) {
this.showNegotiationList = false
this.$emit('changeComponent', { title: '', icon: '' })
......@@ -56,13 +47,20 @@ export default {
},
immediate: true,
deep: true
},
ReportStatus: {
handler(val) {
this.saveBtnStatus = val !== 1
},
immediate: true,
deep: true
}
},
mounted () {
mounted() {
},
methods: {
changeComponent (val) {
if(!val) {
changeComponent(val) {
if (!val) {
setTimeout(() => { this.showNegotiationList = false }, 450)
}
......@@ -84,10 +82,12 @@ export default {
position: relative;
transition: all 0.5s ease-in-out;
}
.opacity {
left: -100%;
}
.show{
.show {
left: 0;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!