pub trait Model {
Show 26 methods
// Required methods
fn table(&mut self) -> &'static str;
fn title(&mut self) -> &'static str;
fn fields(&mut self) -> JsonValue;
fn action(&mut self, name: &str) -> Box<dyn Action>;
// Provided methods
fn version(&mut self) -> &'static str { ... }
fn describe(&mut self) -> &'static str { ... }
fn unique(&mut self) -> Vec<&'static str> { ... }
fn index(&mut self) -> Vec<Vec<&'static str>> { ... }
fn primary_key(&mut self) -> &'static str { ... }
fn json(&mut self) -> Table { ... }
fn create_json_file(&mut self, path: &str) -> bool { ... }
fn table_fields(&mut self) -> JsonValue { ... }
fn tools(&mut self) -> Tools { ... }
fn tables(
&mut self,
_header: JsonValue,
request: JsonValue,
fields: Vec<&str>,
query_fields: Vec<&str>,
filter_fields: Vec<&str>
) -> JsonValue { ... }
fn dicts(
&mut self,
_header: JsonValue,
request: JsonValue,
fields: Vec<&str>,
query_fields: Vec<&str>,
filter_fields: Vec<&str>
) -> JsonValue { ... }
fn columns(&mut self, fields: Vec<&str>) -> JsonValue { ... }
fn query_fields(&mut self, fields: Vec<&str>) -> JsonValue { ... }
fn filter_title(&mut self, fields: Vec<&str>) -> String { ... }
fn btn_data(
&mut self,
title: &str,
action: Box<dyn Action>,
mode: BtnMode,
color: BtnColor,
match_condition: Vec<Vec<&str>>
) -> JsonValue { ... }
fn table_select_fields(&mut self) -> JsonValue { ... }
fn table_select(
&mut self,
request: JsonValue,
fields: Vec<&str>,
filter: Vec<Vec<&str>>
) -> JsonValue { ... }
fn dict_select_fields(&mut self) -> JsonValue { ... }
fn dict_select(
&mut self,
request: JsonValue,
fields: Vec<&str>,
filter: Vec<Vec<&str>>
) -> JsonValue { ... }
fn fields_name_list(&mut self, filter: Vec<&str>) -> Vec<String> { ... }
fn get_menu_list(
&mut self,
mode: &str,
addon: &str,
tags: &str
) -> JsonValue { ... }
fn btn_list(&mut self, mode: &str, addon: &str, model: &str) -> JsonValue { ... }
}Expand description
模型
Required Methods§
Provided Methods§
sourcefn primary_key(&mut self) -> &'static str
fn primary_key(&mut self) -> &'static str
主键
sourcefn create_json_file(&mut self, path: &str) -> bool
fn create_json_file(&mut self, path: &str) -> bool
创建安装文件
sourcefn table_fields(&mut self) -> JsonValue
fn table_fields(&mut self) -> JsonValue
前端搜索字段
sourcefn tables(
&mut self,
_header: JsonValue,
request: JsonValue,
fields: Vec<&str>,
query_fields: Vec<&str>,
filter_fields: Vec<&str>
) -> JsonValue
fn tables( &mut self, _header: JsonValue, request: JsonValue, fields: Vec<&str>, query_fields: Vec<&str>, filter_fields: Vec<&str> ) -> JsonValue
前端-数据表
sourcefn dicts(
&mut self,
_header: JsonValue,
request: JsonValue,
fields: Vec<&str>,
query_fields: Vec<&str>,
filter_fields: Vec<&str>
) -> JsonValue
fn dicts( &mut self, _header: JsonValue, request: JsonValue, fields: Vec<&str>, query_fields: Vec<&str>, filter_fields: Vec<&str> ) -> JsonValue
前端-字典-数据表
sourcefn query_fields(&mut self, fields: Vec<&str>) -> JsonValue
fn query_fields(&mut self, fields: Vec<&str>) -> JsonValue
前端-高级查询条件字段
sourcefn filter_title(&mut self, fields: Vec<&str>) -> String
fn filter_title(&mut self, fields: Vec<&str>) -> String
前端-模糊查询标题
sourcefn btn_data(
&mut self,
title: &str,
action: Box<dyn Action>,
mode: BtnMode,
color: BtnColor,
match_condition: Vec<Vec<&str>>
) -> JsonValue
fn btn_data( &mut self, title: &str, action: Box<dyn Action>, mode: BtnMode, color: BtnColor, match_condition: Vec<Vec<&str>> ) -> JsonValue
前端-按钮数据
sourcefn table_select_fields(&mut self) -> JsonValue
fn table_select_fields(&mut self) -> JsonValue
前端 关联搜索字段
sourcefn table_select(
&mut self,
request: JsonValue,
fields: Vec<&str>,
filter: Vec<Vec<&str>>
) -> JsonValue
fn table_select( &mut self, request: JsonValue, fields: Vec<&str>, filter: Vec<Vec<&str>> ) -> JsonValue
前端-select
sourcefn dict_select_fields(&mut self) -> JsonValue
fn dict_select_fields(&mut self) -> JsonValue
前端 关联字典搜索字段
sourcefn dict_select(
&mut self,
request: JsonValue,
fields: Vec<&str>,
filter: Vec<Vec<&str>>
) -> JsonValue
fn dict_select( &mut self, request: JsonValue, fields: Vec<&str>, filter: Vec<Vec<&str>> ) -> JsonValue
前端-dict-select
获取模块菜单列表