AutoTemp.README.md 2.7 KB

autoTemp

url

    list:       list.html?template=tempDemo1

    show:       item.html?template=tempDemo1&mode=show&id=12
    update:     item.html?template=tempDemo1&mode=update&id=12
    disable:    item.html?template=tempDemo1&mode=disable&id=12
    insert:
                item.html?template=tempDemo1&mode=insert
                item.html?template=tempDemo1&mode=insert&pid=12   (tree)

demo:
    http://localhost:4570/autoTemp/Scripts/autoTemp/list.html?template=demo_list
    http://localhost:4570/autoTemp/Scripts/autoTemp/list.html?apiRoute=/autoTemp/data/demo_list/{action}

    http://localhost:4570/autoTemp/Scripts/autoTemp/list.html?dataProvider=LocalStorageProvider
    http://localhost:4570/autoTemp/Scripts/autoTemp/list.html?dataProvider=LocalStorageProvider&tree=false

可通过修改数据库字段的注释或者数据模型实体的注释来配置字段控件属性。如:



[[AutoTemp: {...} ]] 
[[AutoTemp_Field:Ignore]]     
[[AutoTemp_Field: {...} ]]   


// Example:



/// [[AutoTemp: {
///     "permit": {"delete":false},
///     "idField": "id",
///     "pidField": "pid",
///     "treeField": 'title',
///     "rootPidValue": 0 ,
/// 
///     "listConfig": {
///         "title": "autoTemp-demo",
///         "listButtons": [
///             {
///                 "title": "执行js",
///                 "jsHandler": "(sender,rows)=>{ sender.progressStart(sender.title); setTimeout(sender.progressStop,5000); }" // sender: { ...button,  progressStart,progressStop }
///             }
///         ],
///         "rowButtons": [
///             {
///                 "title": "查看id",
///                 "jsHandler": "(sender,id,row)=>{ sender.progressStart(sender.title); setTimeout(sender.progressStop,5000); }" // sender: { ...button,  progressStart,progressStop }
///             }
///         ]
///     }
/// } ]]


/// [[AutoTemp: { "permit": {"delete":false}   } ]]

/// [[AutoTemp_Field: {
///     "visible":false,
///     "list_config": {"width":250},
///     "ig_attr": {"ig_class":"TextArea", "ig_param":{"height":250} }
/// } ]]

/// [[AutoTemp_Field:Ignore]] 
/// [[AutoTemp_Field: {   "visible":false  } ]]
/// [[AutoTemp_Field: {   "editable":false  } ]]
/// [[AutoTemp_Field: { "list_config": {"width":100}   } ]]
 
/// <span title='数据库连接字符串'>连接字符串</span>
/// [[AutoTemp_Field:{   "ig_attr": {"ig_class":"TextArea"} } ]]

注释:

1.值中若出现中括号,可用以下转义。 [ \x5B --- 左中括号
] \x5D --- 右中括号

2.xml转义符号 < <

&gt;    

& &
' '
" "
空格