| | |
| | | <!-- |
| | | * @Date: 2024-04-09 20:19:46 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-29 23:01:13 |
| | | * @LastEditTime: 2024-05-03 00:11:11 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/Shiftsystem.vue |
| | | --> |
| | | <template> |
| | |
| | | </el-row> |
| | | </el-main> |
| | | </el-container> |
| | | <Dialog ref="dialog" :option="{ types, status, group }"></Dialog> |
| | | <Dialog ref="dialog" :option="{ types, status, group }" :detail="detail" @success="success"></Dialog> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | |
| | | dayCharts() { |
| | | // if (!this?.info?.shiftDetailVOList?.length) return |
| | | // let yData = this.info.shiftDetailVOList.map(item => { |
| | | // return item.indexName |
| | | // }) |
| | | // let series = this.info.shiftDetailVOList.map(item => { |
| | | // let base = moment().format('YYYY-MM-DD') + ' 00:00:00' |
| | | // return [item.indexName, moment(base).add(item.shiftStartTime, 'm').unix(), moment(base).add(item.shiftEndTime, 'm').unix()] |
| | | // // return { |
| | | // // name: item.indexName, |
| | | // // type: 'bar', |
| | | // // data: [moment(base).add(item.shiftStartTime, 'm').format('YYYY-MM-DD HH:mm:ss').unix(), moment(base).add(item.shiftEndTime, 'm').format('YYYY-MM-DD HH:mm:ss').unix()], |
| | | // // label: { |
| | | // // show: true |
| | | // // } |
| | | // // } |
| | | // }) |
| | | // console.log(series) |
| | | |
| | | let { data = [], categories = [], startTime, end } = this.getData1() |
| | | console.log('>>>>>>', data) |
| | | return { |
| | | title: { |
| | | text: '班制概览' |
| | |
| | | info: { |
| | | code: '' |
| | | }, |
| | | detail: { |
| | | |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.init() |
| | | }, |
| | | methods: { |
| | | success() { |
| | | this.$refs.table.reload(this.params) |
| | | }, |
| | | init() { |
| | | this.$HTTP.get('/api/blade-system/param/detail?paramKey=system.shift.max').then(res => { |
| | | if (res.code === 200) { |
| | | this.detail = res.data |
| | | } |
| | | }) |
| | | }, |
| | | getData1() { |
| | | if (!this?.info?.shiftDetailVOList?.length) return { data: [], categories: [], startTime: 0 } |
| | | let categories = this.info.shiftDetailVOList.map(item => { |
| | |
| | | }) |
| | | let startTime = moment(moment().format('YYYY-MM-DD') + ' 00:00:00').add(base, 'm').unix() |
| | | let end = moment.unix(startTime).add(24, 'h').unix() |
| | | console.log(moment.unix(startTime).format('YYYY-MM-DD HH:mm:ss'), 'startTIme', moment.unix(end).format('YYYY-MM-DD HH:mm:ss')) |
| | | let data = []; |
| | | var types = [ |
| | | { name: 1, color: '#7b9ce1' }, |
| | |
| | | }) |
| | | }, |
| | | table_add() { |
| | | this.$refs.dialog.open() |
| | | this.$refs.dialog.open('add', { |
| | | |
| | | }) |
| | | }, |
| | | table_edit() { |
| | | this.$refs.dialog.open() |
| | | this.$refs.dialog.open('edit', this.info) |
| | | }, |
| | | del() { |
| | | this.$confirm(`确定删除数据?`, '', { |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$HTTP.delete(`/api/blade-cps/shift/${this.info.id}`).then(res => { |
| | | if (res.code === 200) { |
| | | this.$refs.table.reload(this.params) |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | |
| | | } |
| | | }, |