Trait df_plugin::Model

source ·
pub trait Model {
Show 20 methods // Required methods fn table(&mut self) -> String; fn title(&mut self) -> String; fn fields(&mut self) -> JsonValue; fn action(&mut self, name: &str) -> Box<dyn Action>; // Provided methods fn version(&mut self) -> String { ... } fn unique(&mut self) -> Vec<String> { ... } fn index(&mut self) -> Vec<Vec<String>> { ... } fn primary_key(&mut self) -> String { ... } fn auto(&mut self) -> bool { ... } fn json(&mut self) -> ModelTable { ... } fn create_json_file(&mut self, path: &str) -> bool { ... } fn table_fields(&mut self) -> JsonValue { ... } fn tables(
&mut self,
request: JsonValue,
tools: Tools,
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 btn_path_data(
&mut self,
title: &str,
path: &str,
color: BtnColor,
match_condition: Vec<Vec<&str>>
) -> JsonValue { ... } fn table_select_fields(&mut self) -> JsonValue { ... } fn table_select(
&mut self,
tools: Tools,
request: JsonValue,
fields: Vec<&str>,
filter: Vec<Vec<&str>>
) -> JsonValue { ... }
}
Expand description

模型

Required Methods§

source

fn table(&mut self) -> String

数据库表名称

source

fn title(&mut self) -> String

模型名称

source

fn fields(&mut self) -> JsonValue

字段列表

source

fn action(&mut self, name: &str) -> Box<dyn Action>

模型动作

Provided Methods§

source

fn version(&mut self) -> String

版本号

source

fn unique(&mut self) -> Vec<String>

数据库唯一约束

source

fn index(&mut self) -> Vec<Vec<String>>

查询索引

source

fn primary_key(&mut self) -> String

主键

source

fn auto(&mut self) -> bool

自动ID值

source

fn json(&mut self) -> ModelTable

创建安装json

source

fn create_json_file(&mut self, path: &str) -> bool

创建安装文件

source

fn table_fields(&mut self) -> JsonValue

前端搜索字段

source

fn tables(
&mut self,
request: JsonValue,
tools: Tools,
fields: Vec<&str>,
query_fields: Vec<&str>,
filter_fields: Vec<&str>
) -> JsonValue

前端-数据表

source

fn columns(&mut self, fields: Vec<&str>) -> JsonValue

前端-列数据

source

fn query_fields(&mut self, fields: Vec<&str>) -> JsonValue

前端-高级查询条件字段

source

fn filter_title(&mut self, fields: Vec<&str>) -> String

前端-模糊查询标题

source

fn btn_data(
&mut self,
title: &str,
action: Box<dyn Action>,
mode: BtnMode,
color: BtnColor,
match_condition: Vec<Vec<&str>>
) -> JsonValue

前端-按钮数据

source

fn btn_path_data(
&mut self,
title: &str,
path: &str,
color: BtnColor,
match_condition: Vec<Vec<&str>>
) -> JsonValue

前端-按钮-指定页面

source

fn table_select_fields(&mut self) -> JsonValue

前端 关联搜索字段

source

fn table_select(
&mut self,
tools: Tools,
request: JsonValue,
fields: Vec<&str>,
filter: Vec<Vec<&str>>
) -> JsonValue

前端-select

Implementors§