¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2024-06-22 18:18:22 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-06-22 18:52:18 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/layout/components/exportDialog.vue |
| | | --> |
| | | <template> |
| | | <el-button type="primary" @click="openimport">导åº</el-button> |
| | | <scDialog v-model="visible" style="width: 400px;"> |
| | | <el-radio-group v-model="statisticalMethod" class="ml-4"> |
| | | <el-radio label="SHIFT">æç次</el-radio> |
| | | <el-radio label="DAY">ææ¥</el-radio> |
| | | <el-radio label="WEEK">æå¨</el-radio> |
| | | <el-radio label="MONTH">ææ</el-radio> |
| | | </el-radio-group> |
| | | <template #footer> |
| | | <el-button type="primary" @click="save">ç¡®å®</el-button> |
| | | </template> |
| | | </scDialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | export default { |
| | | props: { |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | statisticalMethod: 'SHIFT' |
| | | } |
| | | }, |
| | | methods: { |
| | | openimport() { |
| | | this.visible = true |
| | | }, |
| | | save() { |
| | | this.visible = false |
| | | this.$emit('export', this.statisticalMethod) |
| | | }, |
| | | format(start, end, statisticalMethod) { |
| | | if (['WEEK', 'MONTH'].includes(this.statisticalMethod)) { |
| | | return { |
| | | start: moment(start).startOf(statisticalMethod.toLowerCase()).format('YYYY-MM-DD'), |
| | | end: moment(end).endOf(statisticalMethod.toLowerCase()).format('YYYY-MM-DD') |
| | | } |
| | | } else { |
| | | return { |
| | | start, |
| | | end |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |