|
|
@@ -174,151 +174,150 @@ Ext.define('school.view.interaction.timetable.Detail', {
|
|
|
text: 'id',
|
|
|
dataIndex: 'id',
|
|
|
hidden: true
|
|
|
- }, {
|
|
|
- text: '时间段',
|
|
|
- xtype: 'widgetcolumn',
|
|
|
- width: 200,
|
|
|
- padding: 0,
|
|
|
- hidden: true,
|
|
|
- tdCls: 'x-period-column',
|
|
|
- getBindField: function(c) {
|
|
|
- return ['startTime', 'endTime']
|
|
|
- },
|
|
|
- widget: {
|
|
|
- xtype: 'container',
|
|
|
- style: {
|
|
|
- textAlign: 'center'
|
|
|
- },
|
|
|
- items: [{
|
|
|
- xtype: 'button',
|
|
|
- bind: {
|
|
|
- text: '{record._timeText1}',
|
|
|
- },
|
|
|
- style: {
|
|
|
- margin: '5px',
|
|
|
- height: '22px',
|
|
|
- width: '74px',
|
|
|
- padding: 0
|
|
|
- },
|
|
|
- handler: function(btn) {
|
|
|
- let record = btn.ownerCt.$widgetRecord;
|
|
|
- let store = record.store;
|
|
|
- let idx = record.get('lessons') - 2;
|
|
|
- let preRecord, preDate;
|
|
|
+ // }, {
|
|
|
+ // text: '时间段',
|
|
|
+ // xtype: 'widgetcolumn',
|
|
|
+ // width: 200,
|
|
|
+ // padding: 0,
|
|
|
+ // tdCls: 'x-period-column',
|
|
|
+ // getBindField: function(c) {
|
|
|
+ // return ['startTime', 'endTime']
|
|
|
+ // },
|
|
|
+ // widget: {
|
|
|
+ // xtype: 'container',
|
|
|
+ // style: {
|
|
|
+ // textAlign: 'center'
|
|
|
+ // },
|
|
|
+ // items: [{
|
|
|
+ // xtype: 'button',
|
|
|
+ // bind: {
|
|
|
+ // text: '{record._timeText1}',
|
|
|
+ // },
|
|
|
+ // style: {
|
|
|
+ // margin: '5px',
|
|
|
+ // height: '22px',
|
|
|
+ // width: '74px',
|
|
|
+ // padding: 0
|
|
|
+ // },
|
|
|
+ // handler: function(btn) {
|
|
|
+ // let record = btn.ownerCt.$widgetRecord;
|
|
|
+ // let store = record.store;
|
|
|
+ // let idx = record.get('lessons') - 2;
|
|
|
+ // let preRecord, preDate;
|
|
|
|
|
|
- if(idx > -1) {
|
|
|
- preRecord = store.getAt(idx);
|
|
|
- preDate = preRecord.get('_time2');
|
|
|
+ // if(idx > -1) {
|
|
|
+ // preRecord = store.getAt(idx);
|
|
|
+ // preDate = preRecord.get('_time2');
|
|
|
|
|
|
- if(!!preDate && Ext.Date.format(preDate, 'H:i') != '00:00' && Ext.Date.add(preDate, Ext.Date.MINUTE, me.BREAK_TIME) <= Ext.Date.parse(Ext.Date.format(preDate, 'Y-m-d') + ' 22:00:00', 'Y-m-d H:i:s')) {
|
|
|
- record.set('startTime', Ext.Date.format(Ext.Date.add(preDate, Ext.Date.MINUTE, me.BREAK_TIME), 'H:i:s'));
|
|
|
- }
|
|
|
- }
|
|
|
+ // if(!!preDate && Ext.Date.format(preDate, 'H:i') != '00:00' && Ext.Date.add(preDate, Ext.Date.MINUTE, me.BREAK_TIME) <= Ext.Date.parse(Ext.Date.format(preDate, 'Y-m-d') + ' 22:00:00', 'Y-m-d H:i:s')) {
|
|
|
+ // record.set('startTime', Ext.Date.format(Ext.Date.add(preDate, Ext.Date.MINUTE, me.BREAK_TIME), 'H:i:s'));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- me.currentRecord = record;
|
|
|
- },
|
|
|
- menu: {
|
|
|
- xtype: 'menu',
|
|
|
- plain: true,
|
|
|
- items: [{
|
|
|
- xtype: 'timepicker',
|
|
|
- maxHeight: 300,
|
|
|
- increment: 5,
|
|
|
- format: 'H:i',
|
|
|
- minValue: me.START_TIME,
|
|
|
- maxValue: me.END_TIME,
|
|
|
- listeners: {
|
|
|
- select: function(model, record, index, eOpts) {
|
|
|
- me.onSelectPeriod0(this, this.up(), record);
|
|
|
- },
|
|
|
- }
|
|
|
- }],
|
|
|
- listeners: {
|
|
|
- beforeshow: function(th, eOpts) {
|
|
|
- let record = th.ownerCmp.ownerCt.$widgetRecord
|
|
|
- let picker = th.down('timepicker');
|
|
|
- let store = th.ownerCmp.ownerCt.$widgetRecord.store;
|
|
|
- let idx = record.get('lessons') - 2;
|
|
|
- let preRecord, preDate, minValue;
|
|
|
+ // me.currentRecord = record;
|
|
|
+ // },
|
|
|
+ // menu: {
|
|
|
+ // xtype: 'menu',
|
|
|
+ // plain: true,
|
|
|
+ // items: [{
|
|
|
+ // xtype: 'timepicker',
|
|
|
+ // maxHeight: 300,
|
|
|
+ // increment: 5,
|
|
|
+ // format: 'H:i',
|
|
|
+ // minValue: me.START_TIME,
|
|
|
+ // maxValue: me.END_TIME,
|
|
|
+ // listeners: {
|
|
|
+ // select: function(model, record, index, eOpts) {
|
|
|
+ // me.onSelectPeriod0(this, this.up(), record);
|
|
|
+ // },
|
|
|
+ // }
|
|
|
+ // }],
|
|
|
+ // listeners: {
|
|
|
+ // beforeshow: function(th, eOpts) {
|
|
|
+ // let record = th.ownerCmp.ownerCt.$widgetRecord
|
|
|
+ // let picker = th.down('timepicker');
|
|
|
+ // let store = th.ownerCmp.ownerCt.$widgetRecord.store;
|
|
|
+ // let idx = record.get('lessons') - 2;
|
|
|
+ // let preRecord, preDate, minValue;
|
|
|
|
|
|
- me.currentRecord = record;
|
|
|
+ // me.currentRecord = record;
|
|
|
|
|
|
- if(idx > -1) {
|
|
|
- preRecord = store.getAt(idx);
|
|
|
- preDate = preRecord.get('_time2');
|
|
|
- if(Ext.Date.format(preDate, 'H:i') == '00:00') {
|
|
|
- school.util.BaseUtil.showErrorToast('请先完成上一课时设置');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(Ext.Date.add(preDate, Ext.Date.MINUTE, me.BREAK_TIME) >= Ext.Date.parse(Ext.Date.format(preDate, 'Y-m-d') + ' 22:00:00', 'Y-m-d H:i:s')) {
|
|
|
- school.util.BaseUtil.showErrorToast('可用课程时间不足(08:00~22:00)');
|
|
|
- }
|
|
|
- minValue = Ext.Date.add(preDate, Ext.Date.MINUTE, me.MIN_BREAK_TIME);
|
|
|
- }else {
|
|
|
- minValue = Ext.Date.parse('08:00', 'H:i');
|
|
|
- }
|
|
|
+ // if(idx > -1) {
|
|
|
+ // preRecord = store.getAt(idx);
|
|
|
+ // preDate = preRecord.get('_time2');
|
|
|
+ // if(Ext.Date.format(preDate, 'H:i') == '00:00') {
|
|
|
+ // school.util.BaseUtil.showErrorToast('请先完成上一课时设置');
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // if(Ext.Date.add(preDate, Ext.Date.MINUTE, me.BREAK_TIME) >= Ext.Date.parse(Ext.Date.format(preDate, 'Y-m-d') + ' 22:00:00', 'Y-m-d H:i:s')) {
|
|
|
+ // school.util.BaseUtil.showErrorToast('可用课程时间不足(08:00~22:00)');
|
|
|
+ // }
|
|
|
+ // minValue = Ext.Date.add(preDate, Ext.Date.MINUTE, me.MIN_BREAK_TIME);
|
|
|
+ // }else {
|
|
|
+ // minValue = Ext.Date.parse('08:00', 'H:i');
|
|
|
+ // }
|
|
|
|
|
|
- picker.setMinValue(minValue)
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- }, {
|
|
|
- xtype: 'button',
|
|
|
- bind: {
|
|
|
- text: '{record._timeText2}',
|
|
|
- },
|
|
|
- style: {
|
|
|
- margin: '5px',
|
|
|
- height: '22px',
|
|
|
- width: '74px',
|
|
|
- padding: 0
|
|
|
- },
|
|
|
- handler: function(btn) {
|
|
|
- let record = btn.ownerCt.$widgetRecord;
|
|
|
- let startDate = record.get('_time1');
|
|
|
+ // picker.setMinValue(minValue)
|
|
|
+ // },
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // }, {
|
|
|
+ // xtype: 'button',
|
|
|
+ // bind: {
|
|
|
+ // text: '{record._timeText2}',
|
|
|
+ // },
|
|
|
+ // style: {
|
|
|
+ // margin: '5px',
|
|
|
+ // height: '22px',
|
|
|
+ // width: '74px',
|
|
|
+ // padding: 0
|
|
|
+ // },
|
|
|
+ // handler: function(btn) {
|
|
|
+ // let record = btn.ownerCt.$widgetRecord;
|
|
|
+ // let startDate = record.get('_time1');
|
|
|
|
|
|
- if(Ext.Date.format(startDate, 'H:i') != '00:00' && Ext.Date.add(startDate, Ext.Date.MINUTE, me.CLASS_TIME) <= Ext.Date.parse(Ext.Date.format(startDate, 'Y-m-d') + ' 22:00:00', 'Y-m-d H:i:s')) {
|
|
|
- record.set('endTime', Ext.Date.format(Ext.Date.add(startDate, Ext.Date.MINUTE, me.CLASS_TIME), 'H:i:s'));
|
|
|
- }
|
|
|
+ // if(Ext.Date.format(startDate, 'H:i') != '00:00' && Ext.Date.add(startDate, Ext.Date.MINUTE, me.CLASS_TIME) <= Ext.Date.parse(Ext.Date.format(startDate, 'Y-m-d') + ' 22:00:00', 'Y-m-d H:i:s')) {
|
|
|
+ // record.set('endTime', Ext.Date.format(Ext.Date.add(startDate, Ext.Date.MINUTE, me.CLASS_TIME), 'H:i:s'));
|
|
|
+ // }
|
|
|
|
|
|
- me.currentRecord = record;
|
|
|
- },
|
|
|
- menu: {
|
|
|
- xtype: 'menu',
|
|
|
- plain: true,
|
|
|
- items: [{
|
|
|
- xtype: 'timepicker',
|
|
|
- maxHeight: 300,
|
|
|
- increment: 5,
|
|
|
- format: 'H:i',
|
|
|
- minValue: me.START_TIME,
|
|
|
- maxValue: me.END_TIME,
|
|
|
- listeners: {
|
|
|
- select: function(model, record, index, eOpts) {
|
|
|
- me.onSelectPeriod1(this, this.up(), record);
|
|
|
- },
|
|
|
- }
|
|
|
- }],
|
|
|
- listeners: {
|
|
|
- beforeshow: function(th, eOpts) {
|
|
|
- let record = th.ownerCmp.ownerCt.$widgetRecord;
|
|
|
- let picker = th.down('timepicker');
|
|
|
+ // me.currentRecord = record;
|
|
|
+ // },
|
|
|
+ // menu: {
|
|
|
+ // xtype: 'menu',
|
|
|
+ // plain: true,
|
|
|
+ // items: [{
|
|
|
+ // xtype: 'timepicker',
|
|
|
+ // maxHeight: 300,
|
|
|
+ // increment: 5,
|
|
|
+ // format: 'H:i',
|
|
|
+ // minValue: me.START_TIME,
|
|
|
+ // maxValue: me.END_TIME,
|
|
|
+ // listeners: {
|
|
|
+ // select: function(model, record, index, eOpts) {
|
|
|
+ // me.onSelectPeriod1(this, this.up(), record);
|
|
|
+ // },
|
|
|
+ // }
|
|
|
+ // }],
|
|
|
+ // listeners: {
|
|
|
+ // beforeshow: function(th, eOpts) {
|
|
|
+ // let record = th.ownerCmp.ownerCt.$widgetRecord;
|
|
|
+ // let picker = th.down('timepicker');
|
|
|
|
|
|
- if(Ext.Date.format(record.get('_time1'), 'H:i') == '00:00') {
|
|
|
- school.util.BaseUtil.showErrorToast('请先设置开始时间');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // if(Ext.Date.format(record.get('_time1'), 'H:i') == '00:00') {
|
|
|
+ // school.util.BaseUtil.showErrorToast('请先设置开始时间');
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
|
|
|
- let startDate = record.get('_time1') || Ext.Date.parse('08:00', 'H:i');
|
|
|
- let minValue = Ext.Date.add(startDate, Ext.Date.MINUTE, me.MIN_MIN_WHILE);
|
|
|
- me.currentRecord = record;
|
|
|
+ // let startDate = record.get('_time1') || Ext.Date.parse('08:00', 'H:i');
|
|
|
+ // let minValue = Ext.Date.add(startDate, Ext.Date.MINUTE, me.MIN_MIN_WHILE);
|
|
|
+ // me.currentRecord = record;
|
|
|
|
|
|
- picker.setMinValue(minValue)
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- }]
|
|
|
- }
|
|
|
+ // picker.setMinValue(minValue)
|
|
|
+ // },
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // }]
|
|
|
+ // }
|
|
|
}, {
|
|
|
text: '星期一',
|
|
|
dataIndex: 'mon',
|
|
|
@@ -354,11 +353,6 @@ Ext.define('school.view.interaction.timetable.Detail', {
|
|
|
// toolBtns: [{
|
|
|
// xtype: 'button',
|
|
|
// text: '发布',
|
|
|
- // hidden: true,
|
|
|
- // bind: {
|
|
|
- // text: '{status == 1 ? "反启用" : "启用"}',
|
|
|
- // hidden: '{!id}'
|
|
|
- // },
|
|
|
// handler: 'onPublish'
|
|
|
// }]
|
|
|
});
|