1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use json::{array, JsonValue};
use crate::{Action, Model, Response};
use crate::test::test::TestTest;
pub struct TestTestTable {
pub model: TestTest,
}
impl Action for TestTestTable {
fn title(&mut self) -> &'static str { "列表" }
fn name(&mut self) -> &'static str { "test.test.table" }
fn token(&mut self) -> bool { true }
fn params(&mut self) -> JsonValue { return self.model.table_fields(); }
fn index(&mut self, header: JsonValue, request: JsonValue) -> Response {
let mut data = self.model.tables(
header.clone(),
request.clone(),
vec!["id", "file"],
vec![],
vec![],
);
data["btn_all"] = array![];
data["btn_ids"] = array![];
data["btn_one"] = array![];
return self.success(data, "成功");
}
}