| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- Ext.define('school.view.viewport.ViewportModel', {
- extend: 'Ext.app.ViewModel',
- alias: 'viewmodel.viewport',
- data: {
- account: null
- },
- formulas: {
- company: function (get) {
- var account = get('account');
- return account && account.companies.find(function (c) {
- return c.id == account.companyId;
- });
- },
- avatarUrl: function (get) {
- var account = get('account');
- return (account && account.avatarUrl) || 'resources/images/default/user-icon.png'
- }
- },
- stores: {
- grade: {
- type: 'tree',
- // model: 'school.model.Grade',
- fields: [{
- name: 'text'
- }],
- root: {
- text: '全年级',
- type: 'school',
- expanded: true
- },
- data: [{
- id: 'g1',
- text: '一年级',
- // grade_id: '1',
- // grade_name: '一年级',
- // grade_status: '1',
- // grade_remarks: 'beizhu',
- // grade_adress: '值dadada dad',
- // school_id: '1',
- type: 'grade',
- children: [{
- id: 'c11',
- text: '一年级1班',
- type: 'class',
- leaf: true
- }, {
- id: 'c12',
- text: '一年级2班',
- type: 'class',
- leaf: true
- }, {
- id: 'c13',
- text: '一年级3班',
- type: 'class',
- leaf: true
- }, {
- id: 'c14',
- text: '一年级4班',
- type: 'class',
- leaf: true
- }, {
- id: 'c15',
- text: '一年级5班',
- type: 'class',
- leaf: true
- }]
- }, {
- id: 'g2',
- text: '二年级',
- type: 'grade',
- children: [{
- id: 'c21',
- text: '二年级1班',
- type: 'class',
- leaf: true
- }, {
- id: 'c22',
- text: '二年级2班',
- type: 'class',
- leaf: true
- }, {
- id: 'c23',
- text: '二年级3班',
- type: 'class',
- leaf: true
- }, {
- id: 'c24',
- text: '二年级4班',
- type: 'class',
- leaf: true
- }]
- }, {
- id: 'g3',
- text: '三年级',
- type: 'grade',
- children: [{
- id: 'c31',
- text: '三年级1班',
- type: 'class',
- leaf: true
- }, {
- id: 'c32',
- text: '三年级2班',
- type: 'class',
- leaf: true
- }, {
- id: 'c33',
- text: '三年级3班',
- type: 'class',
- leaf: true
- }, {
- id: 'c34',
- text: '三年级4班',
- type: 'class',
- leaf: true
- }, {
- id: 'c35',
- text: '三年级5班',
- type: 'class',
- leaf: true
- }, {
- id: 'c36',
- text: '三年级6班',
- type: 'class',
- leaf: true
- }]
- }, {
- id: 'g4',
- text: '四年级',
- type: 'grade',
- children: [{
- id: 'c41',
- text: '四年级1班',
- type: 'class',
- leaf: true
- }, {
- id: 'c42',
- text: '四年级2班',
- type: 'class',
- leaf: true
- }, {
- id: 'c43',
- text: '四年级3班',
- type: 'class',
- leaf: true
- }, {
- id: 'c44',
- text: '四年级4班',
- type: 'class',
- leaf: true
- }, {
- id: 'c45',
- text: '四年级5班',
- type: 'class',
- leaf: true
- }, {
- id: 'c46',
- text: '四年级6班',
- type: 'class',
- leaf: true
- }]
- }, {
- id: 'g5',
- text: '五年级',
- type: 'grade',
- children: [{
- id: 'c51',
- text: '五年级1班',
- type: 'class',
- leaf: true
- }, {
- id: 'c52',
- text: '五年级2班',
- type: 'class',
- leaf: true
- }, {
- id: 'c53',
- text: '五年级3班',
- type: 'class',
- leaf: true
- }, {
- id: 'c54',
- text: '五年级4班',
- type: 'class',
- leaf: true
- }, {
- id: 'c55',
- text: '五年级5班',
- type: 'class',
- leaf: true
- }, {
- id: 'c56',
- text: '五年级6班',
- type: 'class',
- leaf: true
- }]
- }, {
- id: 'g6',
- text: '六年级',
- type: 'grade',
- children: [{
- id: 'c61',
- text: '六年级1班',
- type: 'class',
- leaf: true
- }, {
- id: 'c62',
- text: '六年级2班',
- type: 'class',
- leaf: true
- }, {
- id: 'c63',
- text: '六年级3班',
- type: 'class',
- leaf: true
- }, {
- id: 'c64',
- text: '六年级4班',
- type: 'class',
- leaf: true
- }, {
- id: 'c65',
- text: '六年级5班',
- type: 'class',
- leaf: true
- }, {
- id: 'c66',
- text: '六年级6班',
- type: 'class',
- leaf: true
- }, {
- id: 'c6y1',
- text: '六年级扬帆班',
- type: 'class',
- leaf: true
- }]
- }, {
- id: 'gn',
- text: '新的年级',
- type: 'grade',
- children: []
- }]
- }
- }
- });
|