195 lines
4.3 KiB
Plaintext
195 lines
4.3 KiB
Plaintext
{
|
|
"title": "@functionName@",
|
|
"type": "page",
|
|
"toolbar": [
|
|
{
|
|
"type": "button",
|
|
"label": "新增",
|
|
"icon": "fa fa-plus pull-left",
|
|
"primary": true,
|
|
"actionType": "drawer",
|
|
"disabledOn": "${ls:@menuid@@insert == null}",
|
|
"drawer": {
|
|
"position": "right",
|
|
"resizable": true,
|
|
"size": "@formsize_drawer@",
|
|
@insert_default@
|
|
"title": "新增",
|
|
"body": {
|
|
"type": "form",
|
|
"name": "sample-edit-form",
|
|
"api": {
|
|
"method": "post",
|
|
"url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/2/",
|
|
"data": {
|
|
"&": "$$",
|
|
"token": "${ls:token}",
|
|
"_$_tableName": "@TableName@",
|
|
"_$_pk": "@pk@",
|
|
"_$_action": "C"
|
|
},
|
|
"dataType": "form"
|
|
},
|
|
"body": [
|
|
@Fields_by_add@
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"body": {
|
|
"type": "crud",
|
|
"tableClassName": "myGridHeader_a",
|
|
"api": {
|
|
"method": "post",
|
|
"url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/3/",
|
|
"data": {
|
|
"token": "${ls:token}",
|
|
"page": "${page}",
|
|
"perPage": "${perPage}",
|
|
"keywords": "${keywords}",
|
|
"_$_tableName": "@TableName@",
|
|
"_$_pk": "@pk@",
|
|
"_$_action": "P",
|
|
"_$_query_filter": "1^10^@pk@^*^^^@Filters@^${ls:query_id}"
|
|
},
|
|
"dataType": "form"
|
|
},
|
|
"quickSaveApi": {
|
|
"method": "post",
|
|
"url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/2/",
|
|
"data": {
|
|
"&": "$$",
|
|
"token": "${ls:token}",
|
|
"_$_tableName": "@TableName@",
|
|
"_$_pk": "@pk@",
|
|
"_$_action": "U"
|
|
},
|
|
"dataType": "form"
|
|
},
|
|
"syncLocation": false,
|
|
"perPage": 10,
|
|
"headerToolbar": [
|
|
{
|
|
"type": "search-box",
|
|
"name": "keywords",
|
|
"align": "left",
|
|
"placeholder": "全文檢索"
|
|
},
|
|
{
|
|
"type": "export-excel",
|
|
"label": "匯出 Excel",
|
|
"api": {
|
|
"method": "post",
|
|
"url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/2/",
|
|
"data": {
|
|
"token": "${ls:token}",
|
|
"page": "${page}",
|
|
"perPage": "10000",
|
|
"keywords": "${keywords}",
|
|
"_$_tableName": "@TableName@",
|
|
"_$_pk": "@pk@",
|
|
"_$_action": "P",
|
|
"_$_query_filter": "1^10^@pk@^*^^^@Filters@"
|
|
},
|
|
"dataType": "form"
|
|
}
|
|
},
|
|
{
|
|
"type": "button",
|
|
"label": "Excel 匯入",
|
|
"icon": "fa fa-database",
|
|
"actionType": "dialog",
|
|
"dialog": {
|
|
"size": "md",
|
|
"body": {
|
|
"type": "form",
|
|
"title": "Excel 匯入",
|
|
"api": {
|
|
"method": "post",
|
|
"url": "${ls:base_ip}/xapi/v2/${ls:base_db}/sys_excel_import/2/",
|
|
"data": {
|
|
"token": "${ls:token}",
|
|
"db_name": "${ls:base_db}",
|
|
"table_name": "@TableName@",
|
|
"pk": "@pk@",
|
|
"excel": "${excel}"
|
|
},
|
|
"dataType": "form"
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "input-excel",
|
|
"name": "excel",
|
|
"label": "上傳 Excel"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "button",
|
|
"level": "info",
|
|
"tooltip": "查看 Source",
|
|
"icon": "fas fa-bullseye",
|
|
"actionType": "drawer",
|
|
"drawer": {
|
|
"size": "lg",
|
|
"resizable": true,
|
|
"body": {
|
|
"type": "service",
|
|
"schemaApi": "get:/pages/zen_codeviewer.json"
|
|
},
|
|
"actions": []
|
|
}
|
|
},
|
|
{
|
|
"type": "columns-toggler",
|
|
"align": "right"
|
|
},
|
|
{
|
|
"type": "drag-toggler",
|
|
"align": "right"
|
|
},
|
|
{
|
|
"type": "pagination",
|
|
"align": "right"
|
|
}
|
|
],
|
|
"footerToolbar": [
|
|
"statistics",
|
|
"switch-per-page",
|
|
"pagination"
|
|
],
|
|
"columns": [
|
|
@Fields_By_GridView_Edit@
|
|
{
|
|
"type": "operation",
|
|
"label": "操作",
|
|
"width": @op-width@,
|
|
"buttons": [
|
|
{
|
|
"type": "button",
|
|
"icon": "fa fa-times text-danger",
|
|
"actionType": "ajax",
|
|
"disabledOn": "${ls:@menuid@@delete == null}",
|
|
"tooltip": "刪除",
|
|
"confirmText": "確定要刪除本筆資料?",
|
|
"api": {
|
|
"method": "post",
|
|
"url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/2/",
|
|
"data": {
|
|
"&": "$$",
|
|
"token": "${ls:token}",
|
|
"_$_tableName": "@TableName@",
|
|
"_$_pk": "@pk@",
|
|
"_$_action": "D"
|
|
},
|
|
"dataType": "form"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
} |