|
|
@ -4,14 +4,16 @@ |
|
|
|
<!-- 日历 --> |
|
|
|
<Calendar @selected-change="onDateChange" :show-back="true" :dot-list="days" ref="calendar" /> |
|
|
|
<!-- 上传 导入wbs --> |
|
|
|
<Upload @show-alert="onShowAlert" /> |
|
|
|
<Upload @success="onUploadSuccess" @error="onUploadError" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 项目列表 --> |
|
|
|
<Projects /> |
|
|
|
|
|
|
|
<!-- 全局提示框 --> |
|
|
|
<u-alert-tips |
|
|
|
<u-top-tips ref="uTips"></u-top-tips> |
|
|
|
|
|
|
|
<!-- <u-alert-tips |
|
|
|
class="top-0 -inset-x-0" |
|
|
|
style="position: fixed !important" |
|
|
|
type="error" |
|
|
@ -20,7 +22,7 @@ |
|
|
|
:show="alert.show" |
|
|
|
:description="alert.description" |
|
|
|
@close="alert.show = false" |
|
|
|
></u-alert-tips> |
|
|
|
></u-alert-tips> --> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
@ -38,11 +40,11 @@ export default { |
|
|
|
{ date: '2020-08-09' }, |
|
|
|
// {date: '2020-08-16'} |
|
|
|
], |
|
|
|
alert: { |
|
|
|
show: false, |
|
|
|
title: '', |
|
|
|
description: '', |
|
|
|
}, |
|
|
|
// alert: { |
|
|
|
// show: false, |
|
|
|
// title: '', |
|
|
|
// description: '', |
|
|
|
// }, |
|
|
|
calendar: null, |
|
|
|
}; |
|
|
|
}, |
|
|
@ -74,7 +76,7 @@ export default { |
|
|
|
const data = await this.$u.api.getProjects(start, end); |
|
|
|
this.setProjects(data); |
|
|
|
} catch (error) { |
|
|
|
console.log('error: ', error); |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -91,11 +93,11 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 收到展示alert的消息 |
|
|
|
onShowAlert(event) { |
|
|
|
this.alert.description = event || '发生了点小意外'; |
|
|
|
this.alert.show = true; |
|
|
|
setTimeout(() => (this.alert.show = false), 10000); |
|
|
|
}, |
|
|
|
// onShowAlert(event) { |
|
|
|
// this.alert.description = event || '发生了点小意外'; |
|
|
|
// this.alert.show = true; |
|
|
|
// setTimeout(() => (this.alert.show = false), 10000); |
|
|
|
// }, |
|
|
|
|
|
|
|
// 监听触摸滑动 切换日历的模式 月/周 |
|
|
|
onMove(event) { |
|
|
@ -108,6 +110,25 @@ export default { |
|
|
|
!this.calendar.weekMode && (this.calendar.weekMode = true); |
|
|
|
} |
|
|
|
prevY = y; |
|
|
|
this.calendar.initDate(); |
|
|
|
}, |
|
|
|
|
|
|
|
// 导入成功 |
|
|
|
onUploadSuccess() { |
|
|
|
this.$refs.uTips.show({ |
|
|
|
title: '导入成功,即将打开新项目', |
|
|
|
type: 'success', |
|
|
|
duration: '3000', |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 导入失败 |
|
|
|
onUploadError(error) { |
|
|
|
this.$refs.uTips.show({ |
|
|
|
title: error || '导入失败', |
|
|
|
type: 'error', |
|
|
|
duration: '6000', |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|