app/assets/javascripts/task-manager/extjs/app/view/plan/Form.js in task-manager-0.1.4 vs app/assets/javascripts/task-manager/extjs/app/view/plan/Form.js in task-manager-0.1.5

- old
+ new

@@ -1,13 +1,9 @@ Ext.define('TM.view.plan.Form', { extend: 'Ext.form.Panel', xtype: 'plan_form', - //requires: [ - //'Ext.ux.TreeCombo', - //], - defaultPlanType: 'yearly', defaultBeginToRemind: 0, defaults: { xtype: 'fieldset', @@ -27,50 +23,51 @@ margin: '10 0', width: 510 }, items: [{ - fieldLabel: '计划名称', + fieldLabel: '名称', name: 'name', allowBlank: false }, { xtype: 'assignee_treecombo', - fieldLabel: '计划执行人', + fieldLabel: '执行人', name: 'assignables_attributes', store: Ext.getStore('TM.store.Assignees').toTreeStore() }, { - fieldLabel: '计划类型', + fieldLabel: '类型', name: 'plan_type', store: 'TM.store.Types', editable: false, valueField: 'value', xtype: 'combo', - blankText: '请选择计划类型!', + blankText: '请选择类型!', allowBlank: false }, { fieldLabel: '横向指标', + emptyText: '请用逗号分割指标项', name: 'data.x' }, { fieldLabel: '纵向指标', + emptyText: '请用逗号分割指标项', name: 'data.y' }, { fieldLabel: '生效时间', xtype: 'datefield', editable: false, anchor: '100%', format: 'Y/m/d', name: 'enabled_at' }, { - fieldLabel: '完成前几天提醒', - emptyText: '计划完成前多少天开始提醒,此处为倒计时。', + fieldLabel: '提前几天提醒', name: 'begin_to_remind' }, { fieldLabel: '是否自动完成', xtype: 'checkbox', name: 'autocompletable' }, { - fieldLabel: '超时回调', + fieldLabel: '逾期处理', xtype: 'callback_checkboxcombo', editable: false, name: 'callables_attributes', store: 'TM.store.Callbacks', multiSelect: true, @@ -78,11 +75,11 @@ valueField: 'id' }] }, { xtype: 'fieldset', itemId: 'deadline', - title: '计划完成截至时限', + title: '截止时间', layout: { type: 'table', columns: 2 }, defaults: { @@ -140,10 +137,12 @@ ['x', 'y'].forEach(function(name) { values.data[name] = this.query('textfield[name="data.' + name + '"]')[0].getValue(); delete values['data.' + name]; }, this); + values.begin_to_remind = values.begin_to_remind * 24 * 60; + return values; }, loadRecord: function(record) { this.callParent(arguments); @@ -156,10 +155,12 @@ ['x', 'y'].forEach(function(name) { this.query('textfield[name="data.' + name + '"]')[0].setValue(record.get('data')[name]); }, this); + this.query('textfield[name="begin_to_remind"]')[0].setValue(record.get('begin_to_remind') / (24 * 60)); + this.checkSelectedAssignees(record.get('assignees')); this.checkSelectedCallbacks(record.get('callbacks')); }, // @protected @@ -208,10 +209,9 @@ assignee_type: node.raw.record.get('class_name') }); } }, this); - //console.log(values); this.getAssigneesTreeCombo().setValue(values); }, //@private onPlanTypeChange: function(combo, newValue) {