fastui 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.md +53 -0
- data/Rakefile +40 -0
- data/app/assets/images/fastui/application/application.png +0 -0
- data/app/assets/images/fastui/application/application_add.png +0 -0
- data/app/assets/images/fastui/application/application_cascade.png +0 -0
- data/app/assets/images/fastui/application/application_delete.png +0 -0
- data/app/assets/images/fastui/application/application_double.png +0 -0
- data/app/assets/images/fastui/application/application_edit.png +0 -0
- data/app/assets/images/fastui/application/application_error.png +0 -0
- data/app/assets/images/fastui/application/application_form.png +0 -0
- data/app/assets/images/fastui/application/application_form_add.png +0 -0
- data/app/assets/images/fastui/application/application_form_delete.png +0 -0
- data/app/assets/images/fastui/application/application_form_edit.png +0 -0
- data/app/assets/images/fastui/application/application_form_magnify.png +0 -0
- data/app/assets/images/fastui/application/application_get.png +0 -0
- data/app/assets/images/fastui/application/application_go.png +0 -0
- data/app/assets/images/fastui/application/application_home.png +0 -0
- data/app/assets/images/fastui/application/application_key.png +0 -0
- data/app/assets/images/fastui/application/application_lightning.png +0 -0
- data/app/assets/images/fastui/application/application_link.png +0 -0
- data/app/assets/images/fastui/application/application_osx.png +0 -0
- data/app/assets/images/fastui/application/application_osx_terminal.png +0 -0
- data/app/assets/images/fastui/application/application_put.png +0 -0
- data/app/assets/images/fastui/application/application_side_boxes.png +0 -0
- data/app/assets/images/fastui/application/application_side_contract.png +0 -0
- data/app/assets/images/fastui/application/application_side_expand.png +0 -0
- data/app/assets/images/fastui/application/application_side_list.png +0 -0
- data/app/assets/images/fastui/application/application_side_tree.png +0 -0
- data/app/assets/images/fastui/application/application_split.png +0 -0
- data/app/assets/images/fastui/application/application_tile_horizontal.png +0 -0
- data/app/assets/images/fastui/application/application_tile_vertical.png +0 -0
- data/app/assets/images/fastui/application/application_view_columns.png +0 -0
- data/app/assets/images/fastui/application/application_view_detail.png +0 -0
- data/app/assets/images/fastui/application/application_view_gallery.png +0 -0
- data/app/assets/images/fastui/application/application_view_icons.png +0 -0
- data/app/assets/images/fastui/application/application_view_list.png +0 -0
- data/app/assets/images/fastui/application/application_view_tile.png +0 -0
- data/app/assets/images/fastui/application/application_xp.png +0 -0
- data/app/assets/images/fastui/application/application_xp_terminal.png +0 -0
- data/app/assets/images/fastui/arrow/accept.png +0 -0
- data/app/assets/images/fastui/arrow/add.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_branch.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_divide.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_down.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_in.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_inout.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_join.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_left.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_merge.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_out.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_redo.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_refresh.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_refresh_small.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_rotate_anticlockwise.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_rotate_clockwise.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_switch.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_turn_left.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_turn_right.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_undo.png +0 -0
- data/app/assets/images/fastui/arrow/arrow_up.png +0 -0
- data/app/assets/images/fastui/arrow/cross.png +0 -0
- data/app/assets/images/fastui/cross.png +0 -0
- data/app/assets/images/fastui/key_go.png +0 -0
- data/app/assets/images/fastui/list1211.png +0 -0
- data/app/assets/images/fastui/loading.gif +0 -0
- data/app/assets/images/fastui/lock.png +0 -0
- data/app/assets/images/fastui/locked.png +0 -0
- data/app/assets/images/fastui/table/help.png +0 -0
- data/app/assets/images/fastui/table/table.png +0 -0
- data/app/assets/images/fastui/table/table_add.png +0 -0
- data/app/assets/images/fastui/table/table_delete.png +0 -0
- data/app/assets/images/fastui/table/table_edit.png +0 -0
- data/app/assets/images/fastui/table/table_save.png +0 -0
- data/app/assets/images/fastui/upload.png +0 -0
- data/app/assets/javascripts/fastui/app/Ctx.js +33 -0
- data/app/assets/javascripts/fastui/app/Env.js +38 -0
- data/app/assets/javascripts/fastui/app/Evaluator.js +6 -0
- data/app/assets/javascripts/fastui/app/inflection.js +656 -0
- data/app/assets/javascripts/fastui/app/store/MListMgr.js +34 -0
- data/app/assets/javascripts/fastui/app/store/MWindowMgr.js +27 -0
- data/app/assets/javascripts/fastui/app/view/FormFactory.js +11 -0
- data/app/assets/javascripts/fastui/app/view/Rest.js +40 -0
- data/app/assets/javascripts/fastui/app/view/VCommentForm.js +53 -0
- data/app/assets/javascripts/fastui/app/view/VCriteria.js +25 -0
- data/app/assets/javascripts/fastui/app/view/VCustomForm.js +34 -0
- data/app/assets/javascripts/fastui/app/view/VCustomTab.js +266 -0
- data/app/assets/javascripts/fastui/app/view/VForm.js +117 -0
- data/app/assets/javascripts/fastui/app/view/VGrid.js +172 -0
- data/app/assets/javascripts/fastui/app/view/VHelpWindow.js +21 -0
- data/app/assets/javascripts/fastui/app/view/VLoginForm.js +101 -0
- data/app/assets/javascripts/fastui/app/view/VLoginWindow.js +73 -0
- data/app/assets/javascripts/fastui/app/view/VMenu.js +75 -0
- data/app/assets/javascripts/fastui/app/view/VSearchWindow.js +102 -0
- data/app/assets/javascripts/fastui/app/view/VTab.js +293 -0
- data/app/assets/javascripts/fastui/app/view/VToolbar.js +23 -0
- data/app/assets/javascripts/fastui/app/view/VTreeGrid.js +158 -0
- data/app/assets/javascripts/fastui/app/view/VVWindow.js +72 -0
- data/app/assets/javascripts/fastui/app/view/VWindow.js +52 -0
- data/app/assets/javascripts/fastui/app/view/Viewport.js +54 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VCheckBox.js +19 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VCheckboxGroup.js +19 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VDate.js +19 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VFieldFactory.js +77 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VFile.js +22 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VHtmlEditor.js +19 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VLongComboBox.js +19 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VLookup.js +45 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js +46 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VNumber.js +18 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VSexSelect.js +30 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VSingleChoice.js +35 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VText.js +17 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VTextArea.js +19 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VTree.js +17 -0
- data/app/assets/javascripts/fastui/app/view/vfield/VYesOrNo.js +30 -0
- data/app/assets/javascripts/fastui/application.js +18 -0
- data/app/assets/javascripts/fastui/data/mwindows.json +7 -0
- data/app/assets/javascripts/fastui/data/updateMWindows.json +4 -0
- data/app/assets/javascripts/fastui/extjs4/locale/ext-lang-zh_CN.js +304 -0
- data/app/assets/javascripts/fastui/fastui.js +23 -0
- data/app/assets/stylesheets/fastui/admin.css +95 -0
- data/app/assets/stylesheets/fastui/application.css +14 -0
- data/app/controllers/fastui/admin_controller.rb +9 -0
- data/app/controllers/fastui/application_controller.rb +19 -0
- data/app/controllers/fastui/m_list_items_controller.rb +64 -0
- data/app/controllers/fastui/m_lists_controller.rb +58 -0
- data/app/controllers/fastui/m_menu_items_controller.rb +69 -0
- data/app/controllers/fastui/m_menus_controller.rb +58 -0
- data/app/controllers/fastui/m_orgs_controller.rb +62 -0
- data/app/controllers/fastui/m_people_controller.rb +89 -0
- data/app/controllers/fastui/m_roles_controller.rb +61 -0
- data/app/controllers/fastui/m_views_controller.rb +18 -0
- data/app/controllers/fastui/sessions_controller.rb +42 -0
- data/app/helpers/fastui/admin_helper.rb +4 -0
- data/app/helpers/fastui/application_helper.rb +4 -0
- data/app/models/fastui/acl.rb +21 -0
- data/app/models/fastui/ctx.rb +15 -0
- data/app/models/fastui/env.rb +16 -0
- data/app/models/fastui/m_acl_entry.rb +5 -0
- data/app/models/fastui/m_list.rb +6 -0
- data/app/models/fastui/m_list_item.rb +8 -0
- data/app/models/fastui/m_menu.rb +10 -0
- data/app/models/fastui/m_menu_item.rb +11 -0
- data/app/models/fastui/m_object.rb +41 -0
- data/app/models/fastui/m_org.rb +16 -0
- data/app/models/fastui/m_person.rb +21 -0
- data/app/models/fastui/m_relationship.rb +9 -0
- data/app/models/fastui/m_role.rb +11 -0
- data/app/models/fastui/user_authenticator.rb +18 -0
- data/app/views/fastui/admin/index.html.erb +2 -0
- data/app/views/layouts/fastui/application.html.erb +22 -0
- data/config/routes.rb +19 -0
- data/db/migrate/20121017013727_create_fastui_m_menu_items.rb +28 -0
- data/db/migrate/20121017014112_create_fastui_m_menus.rb +20 -0
- data/db/migrate/20121017024943_create_fastui_m_orgs.rb +26 -0
- data/db/migrate/20121017025014_create_fastui_m_people.rb +24 -0
- data/db/migrate/20121204021053_create_fastui_m_roles.rb +22 -0
- data/db/migrate/20121204061207_create_fastui_m_relationships.rb +25 -0
- data/db/migrate/20121211062955_create_fastui_m_lists.rb +23 -0
- data/db/migrate/20121211074436_create_fastui_m_list_items.rb +21 -0
- data/db/migrate/20121217020606_create_fastui_m_acl_entries.rb +22 -0
- data/lib/fastui/engine.rb +8 -0
- data/lib/fastui/m_model.rb +26 -0
- data/lib/fastui/tab.rb +26 -0
- data/lib/fastui/version.rb +3 -0
- data/lib/fastui/view.rb +32 -0
- data/lib/fastui/window.rb +43 -0
- data/lib/fastui.rb +8 -0
- data/lib/generators/fastui/USAGE +21 -0
- data/lib/generators/fastui/install_generator.rb +31 -0
- data/lib/generators/fastui/templates/fastui_config.erb +77 -0
- data/lib/tasks/create_sys_data.rake +11 -0
- data/lib/tasks/fastui_tasks.rake +707 -0
- data/lib/tasks/loading_data.rake +28 -0
- metadata +276 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
class CreateFastuiMOrgs < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :fastui_m_orgs do |t|
|
4
|
+
t.string :title, :limit => 60, :null => false
|
5
|
+
t.string :print_text,:default => '',:limit => 60
|
6
|
+
t.string :name,:default => '', :limit => 60
|
7
|
+
t.string :type
|
8
|
+
|
9
|
+
t.integer :parent_id
|
10
|
+
t.integer :lft
|
11
|
+
t.integer :rgt
|
12
|
+
t.integer :depth # this is optional.
|
13
|
+
|
14
|
+
t.string :entity_kind, :default => 'app' #:sys,:app
|
15
|
+
t.integer :seq, :default => 0
|
16
|
+
t.boolean :is_active, :default => true
|
17
|
+
t.string :note , :default => ''
|
18
|
+
t.string :help, :default => ''
|
19
|
+
t.integer :createdbyorg_id, :default => 0
|
20
|
+
t.integer :createdby_id, :default => 0
|
21
|
+
t.integer :updatedby_id, :default => 0
|
22
|
+
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class CreateFastuiMPeople < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :fastui_m_people do |t|
|
4
|
+
t.string :title, :limit => 60, :null => false
|
5
|
+
t.string :print_text,:default => '',:limit => 60
|
6
|
+
t.string :name,:default => '',:limit => 60
|
7
|
+
t.string :username,:default => '',:limit => 60
|
8
|
+
t.string :password_digest
|
9
|
+
t.string :access_level, :default => 'org',:limit => 60
|
10
|
+
t.string :type
|
11
|
+
|
12
|
+
t.string :entity_kind, :default => 'app' #:sys,:app
|
13
|
+
t.integer :seq, :default => 0
|
14
|
+
t.boolean :is_active, :default => true
|
15
|
+
t.string :note , :default => ''
|
16
|
+
t.string :help, :default => ''
|
17
|
+
t.integer :createdbyorg_id, :default => 0
|
18
|
+
t.integer :createdby_id, :default => 0
|
19
|
+
t.integer :updatedby_id, :default => 0
|
20
|
+
|
21
|
+
t.timestamps
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateFastuiMRoles < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :fastui_m_roles do |t|
|
4
|
+
t.string :title, :limit => 60, :null => false
|
5
|
+
t.string :print_text,:default => '',:limit => 60
|
6
|
+
t.string :name, :default => '', :limit => 60 # 系统标识
|
7
|
+
t.string :access_level , :default => 'org' #:system,:org,:dept
|
8
|
+
t.string :type
|
9
|
+
|
10
|
+
t.string :entity_kind, :default => 'app' #:sys,:app
|
11
|
+
t.integer :seq, :default => 0
|
12
|
+
t.boolean :is_active, :default => true
|
13
|
+
t.string :note, :default => ''
|
14
|
+
t.string :help, :default => ''
|
15
|
+
t.integer :createdbyorg_id, :default => 0
|
16
|
+
t.integer :createdby_id, :default => 0
|
17
|
+
t.integer :updatedby_id, :default => 0
|
18
|
+
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateFastuiMRelationships < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :fastui_m_relationships do |t|
|
4
|
+
t.references :m_person
|
5
|
+
t.references :m_org
|
6
|
+
t.references :m_role
|
7
|
+
|
8
|
+
t.string :title, :limit => 60
|
9
|
+
t.string :print_text,:default => '',:limit => 60
|
10
|
+
t.string :name, :default => '', :limit => 60 #
|
11
|
+
t.string :type
|
12
|
+
|
13
|
+
t.string :entity_kind, :default => 'app' #:sys,:app
|
14
|
+
t.integer :seq, :default => 0
|
15
|
+
t.boolean :is_active, :default => true
|
16
|
+
t.string :note, :default => ''
|
17
|
+
t.string :help, :default => ''
|
18
|
+
t.integer :createdbyorg_id, :default => 0
|
19
|
+
t.integer :createdby_id, :default => 0
|
20
|
+
t.integer :updatedby_id, :default => 0
|
21
|
+
|
22
|
+
t.timestamps
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class CreateFastuiMLists < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :fastui_m_lists do |t|
|
4
|
+
t.string :title, :limit => 60, :null => false
|
5
|
+
t.string :print_text,:default => '',:limit => 60
|
6
|
+
t.string :name, :default => '', :limit => 60 #系统编码
|
7
|
+
t.string :filter, :default => ''
|
8
|
+
t.string :access_level , :default => 'org' #:system,:org,:dept
|
9
|
+
t.string :type
|
10
|
+
|
11
|
+
t.string :entity_kind, :default => 'app' #:sys,:app
|
12
|
+
t.integer :seq, :default => 0
|
13
|
+
t.boolean :is_active, :default => true
|
14
|
+
t.string :note, :default => ''
|
15
|
+
t.string :help, :default => ''
|
16
|
+
t.integer :createdbyorg_id, :default => 0
|
17
|
+
t.integer :createdby_id, :default => 0
|
18
|
+
t.integer :updatedby_id, :default => 0
|
19
|
+
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateFastuiMListItems < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :fastui_m_list_items do |t|
|
4
|
+
t.references :m_list
|
5
|
+
t.string :title, :limit => 60, :null => false
|
6
|
+
t.string :print_text,:default => '',:limit => 60
|
7
|
+
t.string :name,:default => '', :limit => 60
|
8
|
+
|
9
|
+
t.string :entity_kind, :default => 'app' #:sys,:app
|
10
|
+
t.integer :seq, :default => 0
|
11
|
+
t.boolean :is_active, :default => true
|
12
|
+
t.string :note , :default => ''
|
13
|
+
t.string :help, :default => ''
|
14
|
+
t.integer :createdbyorg_id, :default => 0
|
15
|
+
t.integer :createdby_id, :default => 0
|
16
|
+
t.integer :updatedby_id, :default => 0
|
17
|
+
|
18
|
+
t.timestamps
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateFastuiMAclEntries < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :fastui_m_acl_entries do |t|
|
4
|
+
t.string :aco_type, :limit =>60, :default => ''
|
5
|
+
t.integer :aco_id, :default => 0
|
6
|
+
t.string :aro_type, :limit =>60, :default => ''
|
7
|
+
t.integer :aro_id, :default => 0
|
8
|
+
t.string :permit, :limit =>60, :default => '' #allow deny
|
9
|
+
|
10
|
+
t.string :access_level , :default => '' #:system,:org,:dept
|
11
|
+
t.string :entity_kind, :default => '' #:sys,:app
|
12
|
+
t.integer :seq, :default => 0
|
13
|
+
t.boolean :actived, :default => true
|
14
|
+
t.integer :createdbyorg_id, :default => 0
|
15
|
+
t.integer :createdby_id, :default => 0
|
16
|
+
t.integer :updatedby_id, :default => 0
|
17
|
+
t.string :help, :default => ''
|
18
|
+
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Fastui
|
4
|
+
class MModel
|
5
|
+
|
6
|
+
def initialize(model)
|
7
|
+
@model = model
|
8
|
+
end
|
9
|
+
|
10
|
+
def name
|
11
|
+
@model.to_s
|
12
|
+
end
|
13
|
+
|
14
|
+
def columns
|
15
|
+
@model.columns
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.all
|
19
|
+
@@models ||= ::ActiveRecord::Base.subclasses.map {|ar| MModel.new(ar)}
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.find(class_name)
|
23
|
+
all.detect {|m| m.class.to_s == class_name.to_s }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/fastui/tab.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Fastui
|
4
|
+
class Tab
|
5
|
+
|
6
|
+
@tabs ||= {}
|
7
|
+
class << self
|
8
|
+
attr_accessor :tabs
|
9
|
+
def find(name)
|
10
|
+
@tabs[name.to_s]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_accessor :name, :title, :entity, :readonly, :included_tab, :grid_kind, :form_kind, :members
|
15
|
+
|
16
|
+
#:opts => {members:[{:member => :title, :title => '标题' },:note,:m_tabs]}
|
17
|
+
def initialize(name,opts = {})
|
18
|
+
self.name = name
|
19
|
+
opts.each_pair do |k,v|
|
20
|
+
self.send "#{k}=", v
|
21
|
+
end
|
22
|
+
self.class.tabs[name.to_s] = self
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
data/lib/fastui/view.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'singleton'
|
3
|
+
module Fastui
|
4
|
+
class View
|
5
|
+
include Singleton
|
6
|
+
attr_accessor :version, :project, :copyright
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@project = 'Fastui Rapid Development Framework'
|
10
|
+
@version = 'version 0.1.0 built on ExtJS 4.2.0'
|
11
|
+
@copyright = 'Copyright 2007-2013 ChunTeng Co., Ltd.'
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def win(name, opts = {}, &block)
|
16
|
+
Fastui::Window.new(name, opts, &block)
|
17
|
+
end
|
18
|
+
|
19
|
+
def tab(name, tab)
|
20
|
+
Fastui::Tab.new(name, tab)
|
21
|
+
end
|
22
|
+
|
23
|
+
def config(&block)
|
24
|
+
block.call(self) if block_given?
|
25
|
+
end
|
26
|
+
|
27
|
+
def find_window(name)
|
28
|
+
Fastui::Window.find(name) || {}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Fastui
|
4
|
+
class Window
|
5
|
+
|
6
|
+
@windows ||= {}
|
7
|
+
class << self
|
8
|
+
attr_accessor :windows
|
9
|
+
def find(name)
|
10
|
+
@windows[name.to_s]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_accessor :name, :title, :window_kind, :tabs
|
15
|
+
|
16
|
+
#:opts => {:name => 'm_window', tabs:[:m_window,:m_tab,:m_field]}
|
17
|
+
def initialize(name, opts = {}, &block)
|
18
|
+
self.name = name
|
19
|
+
opts.each_pair do |k,v|
|
20
|
+
self.send "#{k}=", v
|
21
|
+
end
|
22
|
+
self.tabs = self.tabs || []
|
23
|
+
block.call(self) if block_given?
|
24
|
+
self.wrap_tab
|
25
|
+
self.class.windows[name.to_s] = self
|
26
|
+
end
|
27
|
+
|
28
|
+
def wrap_tab
|
29
|
+
self.tabs.each_index do |i|
|
30
|
+
tab = self.tabs[i]
|
31
|
+
unless tab.kind_of?(Fastui::Tab)
|
32
|
+
raise "not fond #{tab} ui." unless Fastui::Tab.find(tab)
|
33
|
+
self.tabs[i] = Fastui::Tab.find(tab)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def tab(name, opts = {})
|
39
|
+
self.tabs << (opts.blank? ? name : Fastui::Tab.new(name,opts))
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
data/lib/fastui.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Description:
|
2
|
+
The Fastui Engine has been correctly installed in your Rails application.
|
3
|
+
|
4
|
+
1. Edit the main config files:
|
5
|
+
- config/initializers/fastui_config.rb
|
6
|
+
- config/database.yml
|
7
|
+
- config/routes.rb
|
8
|
+
|
9
|
+
2. Launch the server:
|
10
|
+
> bundle exec rails s
|
11
|
+
|
12
|
+
3. Open your browser:
|
13
|
+
> open localhost:8080
|
14
|
+
|
15
|
+
4. Follow the installation wizard steps
|
16
|
+
|
17
|
+
5. Enjoy !
|
18
|
+
|
19
|
+
Example:
|
20
|
+
./script/generate generator fastui:install
|
21
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
module Fastui
|
3
|
+
class InstallGenerator < ::Rails::Generators::Base
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
|
6
|
+
desc "Fastui installation generator"
|
7
|
+
|
8
|
+
def copy_config_file
|
9
|
+
template "fastui_config.erb", "config/initializers/fastui_config.rb"
|
10
|
+
end
|
11
|
+
|
12
|
+
def copy_migrations
|
13
|
+
rake("fastui:install:migrations")
|
14
|
+
end
|
15
|
+
|
16
|
+
def insert_engine_routes
|
17
|
+
route %(
|
18
|
+
mount Fastui::Engine => '/fastui'
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
def remove_index_html
|
23
|
+
remove_file 'public/index.html'
|
24
|
+
end
|
25
|
+
|
26
|
+
def show_readme
|
27
|
+
readme '../USAGE'
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
Fastui::View.instance.config do |conf|
|
3
|
+
|
4
|
+
#conf.project = 'Fastui Rapid Development Framework1111'
|
5
|
+
#conf.version = 'version 0.1.0 built on ExtJS 4.2.0'
|
6
|
+
#conf.copyright = 'Copyright 2007-2013 ChunTeng Co., Ltd.'
|
7
|
+
|
8
|
+
default = [
|
9
|
+
{name: 'entity_kind', title: '实体种类', datatype: 'VSingleChoice'},
|
10
|
+
{name: 'seq', title: '排序', datatype: 'VNumber'},
|
11
|
+
{name: 'is_active', title: '是否激活', datatype: 'VYesOrNo'},
|
12
|
+
{name: 'note', title: '备注', datatype: 'VTextArea'},
|
13
|
+
{name: 'help', title: '帮助', datatype: 'VTextArea', display: 'form'},
|
14
|
+
{name: 'createdbyorg_id', title: '创建组织', datatype: 'VLookup', ref: {entity: 'Fastui::MOrg'}, display: 'grid'},
|
15
|
+
{name: 'createdby_id', title: '创建人', datatype: 'VLookup', ref: {entity: 'Fastui::MPerson'}, display: 'grid'},
|
16
|
+
{name: 'updatedby_id', title: '更新人', datatype: 'VLookup', ref: {entity: 'Fastui::MPerson'}, display: 'grid'}
|
17
|
+
]
|
18
|
+
|
19
|
+
conf.win :m_menu, title: '菜单', window_kind: 'maintain' do |w|
|
20
|
+
w.tab :m_menu, title: '菜单', entity: 'Fastui::MMenu', readonly: true, members: [
|
21
|
+
{name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
|
22
|
+
{name: 'title', title: '标题', datatype: 'VText'},
|
23
|
+
{name: 'print_text', title: '打印文本', datatype: 'VText'},
|
24
|
+
{name: 'name', title: '标识', datatype: 'VText'}
|
25
|
+
] + default
|
26
|
+
w.tab :m_menu_item, title: '菜单项', entity: 'Fastui::MMenuItem', included_tab: 'm_menu', members: [
|
27
|
+
{name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
|
28
|
+
{name: 'title', title: '标题', datatype: 'VText'},
|
29
|
+
{name: 'print_text', title: '打印文本', datatype: 'VText'},
|
30
|
+
{name: 'name', title: '标识', datatype: 'VText'},
|
31
|
+
{name: 'm_menu_id', title: '对应菜单', datatype: 'VLookup', ref: {entity: 'Fastui::MMenu'}, default_logic: "{id:${m_menu_id},title:'${m_menu_title}'}"},
|
32
|
+
{name: 'window', title: '对应窗口', datatype: 'VText'}
|
33
|
+
] + default
|
34
|
+
end
|
35
|
+
|
36
|
+
conf.win :m_org, title: '组织', window_kind: 'maintain' do |w|
|
37
|
+
w.tab :m_org, title: '组织', entity: 'Fastui::MOrg', grid_kind: 'VTreeGrid', members: [
|
38
|
+
{name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
|
39
|
+
{name: 'title', title: '名称', datatype: 'VTree'},
|
40
|
+
{name: 'print_text', title: '打印文本', datatype: 'VText'},
|
41
|
+
{name: 'name', title: '标识', datatype: 'VText'},
|
42
|
+
{name: 'parent_id', title: '上级组织', datatype: 'VLookup', ref: {entity: 'Fastui::MOrg'}}
|
43
|
+
] + default
|
44
|
+
end
|
45
|
+
|
46
|
+
conf.win :m_person, title: '人员', window_kind: 'maintain' do |w|
|
47
|
+
w.tab :m_person, title: '人员', entity: 'Fastui::MPerson', members: [
|
48
|
+
{name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
|
49
|
+
{name: 'title', title: '标题', datatype: 'VText'},
|
50
|
+
{name: 'print_text', title: '打印文本', datatype: 'VText'},
|
51
|
+
{name: 'name', title: '标识', datatype: 'VText'},
|
52
|
+
{name: 'access_level', title: '访问级别', datatype: 'VSingleChoice'}
|
53
|
+
] + default
|
54
|
+
w.tab :m_role, title: '角色', entity: 'Fastui::MRole', included_tab: 'm_person', members: [
|
55
|
+
{name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
|
56
|
+
{name: 'title', title: '标题', datatype: 'VText'},
|
57
|
+
{name: 'print_text', title: '打印文本', datatype: 'VText'},
|
58
|
+
{name: 'name', title: '标识', datatype: 'VText'}
|
59
|
+
] + default
|
60
|
+
end
|
61
|
+
|
62
|
+
conf.win :m_list, title: '数据字典', window_kind: 'maintain' do |w|
|
63
|
+
w.tab :m_list, title: '枚举', entity: 'Fastui::MList', members: [
|
64
|
+
{name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
|
65
|
+
{name: 'title', title: '标题', datatype: 'VText'},
|
66
|
+
{name: 'print_text', title: '打印文本', datatype: 'VText'},
|
67
|
+
{name: 'name', title: '标识', datatype: 'VText'}
|
68
|
+
] + default
|
69
|
+
w.tab :m_list_item, title: '枚举项', entity: 'Fastui::MListItem', included_tab: 'm_list', members: [
|
70
|
+
{name: 'id', title: 'ID', datatype: 'VNumber', readonly: true},
|
71
|
+
{name: 'title', title: '标题', datatype: 'VText'},
|
72
|
+
{name: 'print_text', title: '打印文本', datatype: 'VText'},
|
73
|
+
{name: 'name', title: '标识', datatype: 'VText'}
|
74
|
+
] + default
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#desc "Explaining what the task does"
|
3
|
+
namespace :fastui do
|
4
|
+
desc "create system_data include all task"
|
5
|
+
task :create_sys_data => :environment do
|
6
|
+
Rake::Task["db:drop"].invoke
|
7
|
+
Rake::Task["db:create"].invoke
|
8
|
+
Rake::Task["db:migrate"].invoke
|
9
|
+
Rake::Task["app:fastui:system_data"].invoke
|
10
|
+
end
|
11
|
+
end
|