From 8517ca258a6b45957c3882974007e165424dc87e Mon Sep 17 00:00:00 2001 From: "LAPTOP-EJ2PF6VA\\genie" Date: Mon, 16 Mar 2026 00:40:10 +0800 Subject: [PATCH] add docs --- readme.txt | 1 + template_mariadb/MasterDetail-InputTable.txt | 831 ++++++++++++++++++ template_mariadb/MasterDetail-Insert.txt | 32 + template_mariadb/QueryChart.txt | 39 + template_mariadb/SingleGridView.txt | 84 ++ .../masterDetail-Detail-Insert.txt | 32 + template_mariadb/masterDetail-Log.txt | 295 +++++++ template_mariadb/masterDetail-New.txt | 572 ++++++++++++ template_mariadb/masterDetail-View.txt | 84 ++ template_mariadb/masterDetail-uuid.txt | 604 +++++++++++++ template_mariadb/masterDetail.txt | 515 +++++++++++ template_mariadb/queryReport.txt | 67 ++ template_mariadb/singleEntry-Insert.txt | 32 + template_mariadb/singleEntry-View.txt | 29 + template_mariadb/singleEntry.txt | 275 ++++++ template_mariadb/singleGrid.txt | 195 ++++ template_mariadb/transfer.txt | 25 + 17 files changed, 3712 insertions(+) create mode 100644 template_mariadb/MasterDetail-InputTable.txt create mode 100644 template_mariadb/MasterDetail-Insert.txt create mode 100644 template_mariadb/QueryChart.txt create mode 100644 template_mariadb/SingleGridView.txt create mode 100644 template_mariadb/masterDetail-Detail-Insert.txt create mode 100644 template_mariadb/masterDetail-Log.txt create mode 100644 template_mariadb/masterDetail-New.txt create mode 100644 template_mariadb/masterDetail-View.txt create mode 100644 template_mariadb/masterDetail-uuid.txt create mode 100644 template_mariadb/masterDetail.txt create mode 100644 template_mariadb/queryReport.txt create mode 100644 template_mariadb/singleEntry-Insert.txt create mode 100644 template_mariadb/singleEntry-View.txt create mode 100644 template_mariadb/singleEntry.txt create mode 100644 template_mariadb/singleGrid.txt create mode 100644 template_mariadb/transfer.txt diff --git a/readme.txt b/readme.txt index 84f8c24..518f1b6 100644 --- a/readme.txt +++ b/readme.txt @@ -121,6 +121,7 @@ zen_create_json_v2 *** final *** + zen_create_json_final + + zen_bpm_define ** 應該是專門處理 bpm code /* diff --git a/template_mariadb/MasterDetail-InputTable.txt b/template_mariadb/MasterDetail-InputTable.txt new file mode 100644 index 0000000..9515885 --- /dev/null +++ b/template_mariadb/MasterDetail-InputTable.txt @@ -0,0 +1,831 @@ +{ + "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": "xl", + "actions": [ + { + "label": "存檔", + "actionType": "submit", + "close": false, + "primary": true, + "type": "button" + } + ], + @insert_default@ + "title": "新增", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Fields_by_add@, + { + "type": "panel", + "//title": "表身明細", + "body": [{ + "type": "input-table", + "name": "details", + "label": false, + "addable": true, + "removable": true, + "needConfirm": false, + "canAccessSuperData": true, + "strictMode": false, + "columns": [ + @Detail_By_add@ + ] + }] + } + ] + } + } + } + ], + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + }, + "syncLocation": false, + "autoGenerateFilter": @is_query_header@, + "perPage": 10, + "headerToolbar": [ + @keyword_search@ + { + "type": "export-excel", + "label": "匯出 Excel", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "10000", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + } + }, + { + "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": [] + } + }, + @ext_button_U@ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "操作", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "dialog": { + "title": "查看", + "size": "lg", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@, + { + "type": "panel", + "title": "表身明細", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@ + ] + } + } + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-pencil", + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@update == null@bpm_edit@", + "drawer": { + "position": "left", + "resizable": true, + "size": "xl", + "title": "編輯", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "body": [ + @Fields_By_Edit@, + { + "type": "panel", + "title": "表身明細", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "quickSaveApi": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "button", + "label": "新增表身", + "actionType": "dialog", + "level": "primary", + "dialog": { + "title": "新增表身", + "body": { + "type": "form", + "name": "sample-edit-form", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Detail_By_add@ + ] + } + } + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_Edit@, + { + "type": "operation", + "label": "操作", + "width": 100, + "buttons": [ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "tooltip": "刪除", + "confirmText": "確定要刪除本筆資料?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } + } + ] + } + } + }, + @ext_button_I@ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "disabledOn": "${ls:@menuid@@delete == null@bpm_edit@", + "tooltip": "刪除", + "confirmText": "確定要刪除本筆資料?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } +}{ + "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": "xl", + "actions": [ + { + "label": "存檔", + "actionType": "submit", + "close": false, + "primary": true, + "type": "button" + } + ], + @insert_default@ + "title": "新增", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Fields_by_add@, + { + "type": "panel", + "//title": "表身明細", + "body": [{ + "type": "input-table", + "name": "details", + "label": false, + "addable": true, + "removable": true, + "needConfirm": false, + "canAccessSuperData": true, + "strictMode": false, + "columns": [ + @Detail_By_add@ + ] + }] + } + ] + } + } + } + ], + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + }, + "syncLocation": false, + "autoGenerateFilter": @is_query_header@, + "perPage": 10, + "headerToolbar": [ + @keyword_search@ + { + "type": "export-excel", + "label": "匯出 Excel", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "10000", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + } + }, + { + "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": [] + } + }, + @ext_button_U@ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "操作", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "dialog": { + "title": "查看", + "size": "lg", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@, + { + "type": "panel", + "title": "表身明細", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@ + ] + } + } + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-pencil", + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@update == null@bpm_edit@", + "drawer": { + "position": "left", + "resizable": true, + "size": "xl", + "title": "編輯", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "body": [ + @Fields_By_Edit@, + { + "type": "panel", + "title": "表身明細", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "quickSaveApi": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "button", + "label": "新增表身", + "actionType": "dialog", + "level": "primary", + "dialog": { + "title": "新增表身", + "body": { + "type": "form", + "name": "sample-edit-form", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Detail_By_add@ + ] + } + } + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_Edit@, + { + "type": "operation", + "label": "操作", + "width": 100, + "buttons": [ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "tooltip": "刪除", + "confirmText": "確定要刪除本筆資料?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } + } + ] + } + } + }, + @ext_button_I@ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "disabledOn": "${ls:@menuid@@delete == null@bpm_edit@", + "tooltip": "刪除", + "confirmText": "確定要刪除本筆資料?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/MasterDetail-Insert.txt b/template_mariadb/MasterDetail-Insert.txt new file mode 100644 index 0000000..18a093c --- /dev/null +++ b/template_mariadb/MasterDetail-Insert.txt @@ -0,0 +1,32 @@ +{ + "title": "", + "type": "page", + "body": [ + { + "type": "form", + "title": "", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + @insert_default@ + "body": [ + @Fields_by_add@ + ] + } + ] +} \ No newline at end of file diff --git a/template_mariadb/QueryChart.txt b/template_mariadb/QueryChart.txt new file mode 100644 index 0000000..8a7255b --- /dev/null +++ b/template_mariadb/QueryChart.txt @@ -0,0 +1,39 @@ +{ + "title": "@functionName@", + "type": "page", + "body": [{ + "type": "form", + "actions": [], + "title": "", + "mode": "inline", + "target": "displayChart", + "autoFocus": false, + "body": [ + { + "type": "fieldSet", + "collapsable": true, + "title": "查詢條件", + "body": [ + @query_filtrs@ + ] + } + ] + }, + { + "type": "chart", + "name": "displayChart", + "className": "m-t", + "height": 500, + "initFetch": false, + "replaceChartOption": true, + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/@sp_name@/0/", + "data": { + @sp_para_filter@ + }, + "dataType": "form" + } + } + ] +} \ No newline at end of file diff --git a/template_mariadb/SingleGridView.txt b/template_mariadb/SingleGridView.txt new file mode 100644 index 0000000..b7ea7cb --- /dev/null +++ b/template_mariadb/SingleGridView.txt @@ -0,0 +1,84 @@ +{ + "title": "@functionName@", + "type": "page", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "name": "dataList", + "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}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@^${ls:query_id}" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "操作", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "tooltip": "查看", + "dialog": { + "title": "查看", + "size": "@formsize@", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@ + ] + } + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/masterDetail-Detail-Insert.txt b/template_mariadb/masterDetail-Detail-Insert.txt new file mode 100644 index 0000000..18a093c --- /dev/null +++ b/template_mariadb/masterDetail-Detail-Insert.txt @@ -0,0 +1,32 @@ +{ + "title": "", + "type": "page", + "body": [ + { + "type": "form", + "title": "", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + @insert_default@ + "body": [ + @Fields_by_add@ + ] + } + ] +} \ No newline at end of file diff --git a/template_mariadb/masterDetail-Log.txt b/template_mariadb/masterDetail-Log.txt new file mode 100644 index 0000000..6397c54 --- /dev/null +++ b/template_mariadb/masterDetail-Log.txt @@ -0,0 +1,295 @@ +{ + "title": "@functionName@", + "type": "page", + @aside_setup@ + "toolbar": [ + { + "type": "button", + "label": "sW", + "icon": "fa fa-plus pull-left", + "primary": true, + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@insert == null}", + "drawer": { + "position": "right", + "resizable": true, + "size": "@formsize_drawer@", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + @insert_default@ + "title": "sW", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Fields_by_add@ + ] + } + } + } + ], + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "name": "dataList", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + }, + "syncLocation": false, + "autoGenerateFilter": @is_query_header@, + "perPage": 10, + "headerToolbar": [ + @keyword_search@ + { + "type": "export-excel", + "label": "ץX Excel", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "10000", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + } + }, + { + "type": "button", + "level": "info", + "tooltip": "d Source", + "icon": "fas fa-bullseye", + "actionType": "drawer", + "drawer": { + "size": "lg", + "resizable": true, + "body": { + "type": "service", + "schemaApi": "get:/pages/zen_codeviewer.json" + }, + "actions": [] + } + }, + @ext_button_U@ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "ާ@", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "dialog": { + "title": "d", + "size": "lg", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@, + { + "type": "panel", + "title": "", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@Sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "˯" + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@ + ] + } + } + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-pencil", + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@update == null@bpm_edit@", + "drawer": { + "position": "left", + "resizable": true, + "size": "@formsize_drawer@", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + "title": "s", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "body": [ + @Fields_By_Edit@ + ] + } + } + }, + @ext_button_I@ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "disabledOn": "${ls:@menuid@@delete == null@bpm_edit@", + "tooltip": "R", + "confirmText": "TwnR?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/masterDetail-New.txt b/template_mariadb/masterDetail-New.txt new file mode 100644 index 0000000..ab0cad6 --- /dev/null +++ b/template_mariadb/masterDetail-New.txt @@ -0,0 +1,572 @@ +{ + "title": "@functionName@", + "type": "page", + @aside_setup@ + "toolbar": [ + { + "type": "button", + "label": "sW", + "icon": "fa fa-plus pull-left", + "primary": true, + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@insert == null}", + "drawer": { + "position": "right", + "resizable": true, + "size": "xl", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + @insert_default@ + "title": "sW", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "form_insert", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Fields_by_add@, + { + "type": "panel", + "//title": "", + "body": [ + { + "type": "input-table", + "name": "details", + "label": false, + "addable": true, + "removable": true, + "needConfirm": false, + "canAccessSuperData": true, + "strictMode": false, + "columns": [ + @Detail_By_Insert@ + ] + } + ] + } + ] + } + } + } + ], + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "name": "dataList", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + }, + "syncLocation": false, + "autoGenerateFilter": @is_query_header@, + "perPage": 10, + "headerToolbar": [ + @keyword_search@ + { + "type": "export-excel", + "label": "ץX Excel", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "10000", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + } + }, + { + "type": "button", + "level": "info", + "tooltip": "d Source", + "icon": "fas fa-bullseye", + "actionType": "drawer", + "drawer": { + "size": "lg", + "resizable": true, + "body": { + "type": "service", + "schemaApi": "get:/pages/zen_codeviewer.json" + }, + "actions": [] + } + }, + @ext_button_U@ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "ާ@", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "dialog": { + "title": "d", + "size": "full", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@, + { + "type": "panel", + "title": "", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@Sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@ + ] + } + } + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-pencil", + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@update == null@bpm_edit@", + "drawer": { + "position": "left", + "resizable": true, + "size": "xl", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + "title": "s", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "form_edit", + "id": "form_edit", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "body": [ + @Fields_By_Edit@, + { + "type": "form", + "title": "", + "actions": [], + "body": { + "type": "crud", + "id": "detail_edit", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@Sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "button", + "label": "sW", + "level": "primary", + "actionType": "drawer", + "drawer": { + "title": "sW", + "position": "right", + "body": { + "type": "form", + "name": "form_detail_insert", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@Sub_pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Detail_By_Insert@ + ], + "onEvent": { + "submitSucc": { + "actions": [ + { + "actionType": "reload", + "componentId": "detail_edit" + }, + { + "actionType": "setValue", + "componentId": "_quantity", + "args": { + "value": "${event.data.items|pick:quantity|sum}" + } + }, + { + "actionType": "setValue", + "componentId": "_totalamount", + "args": { + "value": "${event.data.items|pick:subamount|sum}" + } + }, + { + "actionType": "setValue", + "componentId": "_taxamount", + "args": { + "value": "${event.data.totalamount*0.05|round:0}" + } + }, + { + "actionType": "toast", + "args": { + "timeout": 1000, + "msg": "sW@" + } + } + ] + } + } + } + } + }, + { + "label": "sYXp", + "type": "button", + "align": "right", + "level": "primary", + "onEvent": { + "click": { + "actions": [ + { + "actionType": "setValue", + "componentId": "_bill_quantity", + "args": { + "value": "${event.data.items|pick:quantity|sum}" + } + }, + { + "actionType": "setValue", + "componentId": "_totalamount", + "args": { + "value": "${event.data.items|pick:subamount|sum}" + } + }, + { + "actionType": "setValue", + "componentId": "_taxamount", + "args": { + "value": "${totalamount*0.05|round:0}" + } + } + ] + } + } + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@, + { + "type": "operation", + "label": "ާ@", + "width": 100, + "buttons": [ + { + "type": "button", + "icon": "fa fa-pencil", + "tooltip": "s", + "actionType": "drawer", + "drawer": { + "position": "left", + "resizable": true, + "size": "@formsize_drawer@", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + "title": "s", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "form_detail_edit", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@Sub_pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "body": [ + @Detail_By_Edit@ + ], + "onEvent": { + "submitSucc": { + "actions": [ + { + "actionType": "reload", + "componentId": "detail_edit" + }, + { + "actionType": "setValue", + "componentId": "_quantity", + "args": { + "value": "${event.data.items|pick:quantity|sum}" + } + }, + { + "actionType": "setValue", + "componentId": "_totalamount", + "args": { + "value": "${event.data.items|pick:subamount|sum}" + } + }, + { + "actionType": "setValue", + "componentId": "_taxamount", + "args": { + "value": "${totalamount*0.05|round:0}" + } + }, + { + "actionType": "toast", + "args": { + "timeout": 1000, + "msg": "ק@" + } + } + ] + } + } + } + } + }, + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "tooltip": "R", + "confirmText": "TwnR?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@Sub_pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } + } + ] + } + } + }, + @ext_button_I@ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "disabledOn": "${ls:@menuid@@delete == null@bpm_edit@", + "tooltip": "R", + "confirmText": "TwnR?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/masterDetail-View.txt b/template_mariadb/masterDetail-View.txt new file mode 100644 index 0000000..75714ef --- /dev/null +++ b/template_mariadb/masterDetail-View.txt @@ -0,0 +1,84 @@ +{ + "type": "page", + "title": "單據明細查詢", + "body": [ + { + "type": "form", + "initApi": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/20/", + "data": { + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^" + }, + "dataType": "form" + }, + "actions": [], + "title": "@functionName@明細查詢", + "mode": "horizontal", + "body": [ + @Fields_By_View@, + { + "type": "panel", + "title": "表身明細", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@ + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/template_mariadb/masterDetail-uuid.txt b/template_mariadb/masterDetail-uuid.txt new file mode 100644 index 0000000..737732c --- /dev/null +++ b/template_mariadb/masterDetail-uuid.txt @@ -0,0 +1,604 @@ +{ + "title": "@functionName@", + "type": "page", + @aside_setup@ + "toolbar": [ + { + "type": "button", + "label": "sW", + "icon": "fa fa-plus pull-left", + "primary": true, + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@insert == null}", + "drawer": { + "position": "right", + "resizable": true, + "size": "xl", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + @insert_default@ + "title": "sW", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "form_insert", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(), \n_$_tableName: \"@TableName@\",\n _$_pk: \"@pk@\",\n _$_action: \"C\"}\n}" + }, + "body": [ + @Fields_by_add@, + { + "type": "form", + "title": "", + "actions": [], + "body": { + "type": "crud", + "id": "detail_edit", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName_x@", + "_$_pk": "@sub_pk@", + "_id_": "@TableName:4_6@${ls:userid|substring:0:6}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "button", + "label": "sW", + "level": "primary", + "actionType": "drawer", + "drawer": { + "title": "sW", + "position": "right", + "size": "lg", + "resizable": true, + "body": { + "type": "form", + "name": "form_detail_insert", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@Sub_TableName_x@\",\n _$_pk: \"@sub_pk@\",\n _$_action: \"C\"}\n}" + }, + "body": [ + @Detail_By_Edit_Insert@ + ], + "onEvent": { + "submitSucc": { + "actions": [ + { + "actionType": "reload", + "componentId": "detail_edit" + } + ] + } + } + } + } + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@, + { + "type": "operation", + "label": "ާ@", + "width": 100, + "buttons": [ + { + "type": "button", + "icon": "fa fa-pencil", + "tooltip": "s", + "actionType": "drawer", + "drawer": { + "position": "left", + "resizable": true, + "size": "lg", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + "title": "s", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "form_detail_edit", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@Sub_TableName_x@\",\n _$_pk: \"@sub_pk@\",\n _$_action: \"U\"}\n}" + }, + "body": [ + @Detail_By_Edit@ + ], + "onEvent": { + "submitSucc": { + "actions": [ + { + "actionType": "reload", + "componentId": "detail_edit" + } + ] + } + } + } + } + }, + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "tooltip": "R", + "confirmText": "TwnR?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@Sub_TableName_x@\",\n _$_pk: \"@sub_pk@\",\n _$_action: \"D\"}\n}" + } + } + ] + } + ] + } + } + ] + } + } + } + ], + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "name": "dataList", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form", + "//requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n _$_tableName: \"@TableName@\",\n _$_pk: \"@pk@\",\n _$_action: \"P\",\n _$_query_filter: \"1^10^@pk@^*\"}\n}" + }, + "syncLocation": false, + "autoGenerateFilter": @is_query_header@, + "perPage": 10, + "headerToolbar": [ + @keyword_search@ + { + "type": "export-excel", + "label": "ץX Excel", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "10000", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + } + }, + { + "type": "button", + "level": "info", + "tooltip": "d Source", + "icon": "fas fa-bullseye", + "actionType": "drawer", + "drawer": { + "size": "lg", + "resizable": true, + "body": { + "type": "service", + "schemaApi": "get:/pages/zen_codeviewer.json" + }, + "actions": [] + } + }, + @ext_button_U@ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "ާ@", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "dialog": { + "title": "d", + "size": "full", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@, + { + "type": "panel", + "title": "", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@ + ], + "affixRow": [ + [ + { + "type": "text", + "text": "ƶqXp", + "colSpan": 2 + }, + { + "type": "tpl", + "tpl": "${rows|pick:quantity|sum}" + } + ], + [ + { + "type": "text", + "text": "|Xp", + "colSpan": 2 + }, + { + "type": "tpl", + "tpl": "${rows|pick:subamount|sum}" + } + ], + [ + { + "type": "text", + "text": "|", + "colSpan": 2 + }, + { + "type": "tpl", + "tpl": "${rows|pick:subamount|sum}" + } + ] + ] + } + } + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-pencil", + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@update == null@bpm_edit@", + "drawer": { + "position": "left", + "resizable": true, + "size": "xl", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + "title": "s", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "form_edit", + "id": "form_edit", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@TableName@\",\n _$_pk: \"@pk@\",\n _$_action: \"U\"}\n}" + }, + "body": [ + @Fields_By_Edit@, + { + "type": "form", + "title": "", + "actions": [], + "body": { + "type": "crud", + "id": "detail_edit", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "button", + "label": "sW", + "level": "primary", + "actionType": "drawer", + "drawer": { + "title": "sW", + "position": "right", + "size": "lg", + "resizable": true, + "body": { + "type": "form", + "name": "form_detail_insert", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@Sub_TableName@\",\n _$_pk: \"@sub_pk@\",\n _$_action: \"C\"}\n}" + }, + "body": [ + @Detail_By_Edit_Insert@ + ] + } + } + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@, + { + "type": "operation", + "label": "ާ@", + "width": 100, + "buttons": [ + { + "type": "button", + "icon": "fa fa-pencil", + "tooltip": "s", + "actionType": "drawer", + "drawer": { + "position": "left", + "resizable": true, + "size": "lg", + "actions": [{ + "label": "s", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "", + "actionType": "cancel", + "type": "button" + } + ], + "title": "s", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "form_detail_edit", + @init_api_org@ + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@Sub_TableName@\",\n _$_pk: \"@sub_pk@\",\n _$_action: \"U\"}\n}" + }, + "body": [ + @Detail_By_Edit@ + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "tooltip": "R", + "confirmText": "TwnR?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@Sub_TableName@\",\n _$_pk: \"@sub_pk@\",\n _$_action: \"D\"}\n}" + } + } + ] + } + ] + } + } + ] + } + } + }, + @ext_button_I@ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "disabledOn": "${ls:@menuid@@delete == null@bpm_edit@", + "tooltip": "R", + "confirmText": "TwnR?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/2/", + "dataType": "form", + "requestAdaptor": "return {\n ...api,\n data: {\n ...api.data,\n token: local_get_token(),\n _$_tableName: \"@TableName@\",\n _$_pk: \"@pk@\",\n _$_action: \"D\"}\n}" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/masterDetail.txt b/template_mariadb/masterDetail.txt new file mode 100644 index 0000000..0e915ce --- /dev/null +++ b/template_mariadb/masterDetail.txt @@ -0,0 +1,515 @@ +{ + "title": "@functionName@", + "type": "page", + @aside_setup@ + "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@", + "actions": [{ + "label": "存檔", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "取消", + "actionType": "cancel", + "type": "button" + } + ], + @insert_default@ + "title": "新增", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "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@, + { + "type": "panel", + "title": "表身明細", + "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": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "quickSaveApi": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/3/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "button", + "label": "新增表身", + "actionType": "dialog", + "level": "primary", + "dialog": { + "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": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Detail_By_add@ + ] + } + } + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_add@ + ] + } + } + ] + } + } + } + ], + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "name": "dataList", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + @aside_filter@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "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}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@" + }, + "dataType": "form" + } + }, + { + "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": [] + } + }, + @ext_button_U@ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "操作", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "dialog": { + "title": "查看", + "size": "lg", + "actions": [], + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@, + { + "type": "panel", + "title": "表身明細", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_View@ + ] + } + } + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-pencil", + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@update == null@bpm_edit@", + "drawer": { + "position": "left", + "resizable": true, + "size": "@formsize_drawer@", + "actions": [{ + "label": "存檔", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "取消", + "actionType": "cancel", + "type": "button" + } + ], + "title": "編輯", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "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": "U" + }, + "dataType": "form" + }, + "body": [ + @Fields_By_Edit@, + { + "type": "panel", + "title": "表身明細", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v3/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@,@seqno@^@detail_fields@^^^@pk@" + }, + "dataType": "form" + }, + "quickSaveApi": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/3/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "U" + }, + "dataType": "form" + }, + "syncLocation": false, + "perPage": 10, + "headerToolbar": [ + { + "type": "search-box", + "name": "keywords", + "align": "left", + "placeholder": "全文檢索" + }, + { + "type": "button", + "label": "新增表身", + "actionType": "dialog", + "level": "primary", + "dialog": { + "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": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "C" + }, + "dataType": "form" + }, + "body": [ + @Detail_By_add@ + ] + } + } + }, + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Detail_By_Edit@, + { + "type": "operation", + "label": "操作", + "width": 100, + "buttons": [ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "tooltip": "刪除", + "confirmText": "確定要刪除本筆資料?", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/2/", + "data": { + "&": "$$", + "token": "${ls:token}", + "_$_tableName": "@Sub_TableName@", + "_$_pk": "@sub_pk@", + "_$_action": "D" + }, + "dataType": "form" + } + } + ] + } + ] + } + } + ] + } + } + }, + @ext_button_I@ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "disabledOn": "${ls:@menuid@@delete == null@bpm_edit@", + "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" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/queryReport.txt b/template_mariadb/queryReport.txt new file mode 100644 index 0000000..820819d --- /dev/null +++ b/template_mariadb/queryReport.txt @@ -0,0 +1,67 @@ +{ + "title": "@functionName@", + "type": "page", + "body": { + "type": "crud", + "tableClassName": "myGridHeader_a", + "columnsTogglable": true, + "loadDataOnce": true, + "//title": "Ӹ", + "@zero_filter@filter": { + "title": "", + "submitText": "", + "body": [ + { + "type": "fieldSet", + "collapsable": true, + "title": "d߱", + "body": [ + @query_filtrs@ + ] + } + ] + }, + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/@sp_name@/@sp_type@/", + "data": { + @sp_para_filter@ + }, + "dataType": "form" + }, + "headerToolbar": [ + { + "type": "export-excel", + "label": "ץX Excel", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/@sp_name@/@sp_type@/", + "data": { + @sp_para_filter@ + }, + "dataType": "form" + } + }, + { + "type": "tpl", + "tpl": "@ ${count} " + }, + @ext_button_U@ + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "combineNum": @col_combine_Num@, + "combineFromIndex": 0, + "columns": [ + @query_fields@ + @ext_button_I@ + ] + } +} \ No newline at end of file diff --git a/template_mariadb/singleEntry-Insert.txt b/template_mariadb/singleEntry-Insert.txt new file mode 100644 index 0000000..88e6cb3 --- /dev/null +++ b/template_mariadb/singleEntry-Insert.txt @@ -0,0 +1,32 @@ +{ + "title": "", + "type": "page", + "body": [ + { + "type": "form", + "title": "", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "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" + }, + @insert_default@ + "body": [ + @Fields_by_add@ + ] + } + ] +} \ No newline at end of file diff --git a/template_mariadb/singleEntry-View.txt b/template_mariadb/singleEntry-View.txt new file mode 100644 index 0000000..9a3adc3 --- /dev/null +++ b/template_mariadb/singleEntry-View.txt @@ -0,0 +1,29 @@ +{ + "type": "page", + "title": "@functionName@查詢", + "body": [ + { + "type": "form", + "title": "", + "initApi": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api_v2/20/", + "data": { + "token": "${ls:token}", + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_id_": "${@pk@}", + "_field_": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^" + }, + "dataType": "form" + }, + "actions": [], + "mode": "horizontal", + "body": [ + @Fields_By_View@ + ] + } + ] +} \ No newline at end of file diff --git a/template_mariadb/singleEntry.txt b/template_mariadb/singleEntry.txt new file mode 100644 index 0000000..36730ca --- /dev/null +++ b/template_mariadb/singleEntry.txt @@ -0,0 +1,275 @@ +{ + "title": "@functionName@", + "type": "page", + @aside_setup@ + "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@", + "actions": [{ + "label": "存檔", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "取消", + "actionType": "cancel", + "type": "button" + } + ], + @insert_default@ + "title": "新增", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "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", + "name": "dataList", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/3/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "${perPage}", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@Filters@^${ls:query_id}" + }, + "dataType": "form" + }, + "syncLocation": false, + "autoGenerateFilter": @is_query_header@, + "perPage": 10, + "headerToolbar": [ + @keyword_search@ + { + "type": "export-excel", + "label": "匯出 Excel", + "api": { + "method": "post", + "url": "${ls:base_ip}/xapi/v2/${ls:base_db}/orm_api/2/", + "data": { + "token": "${ls:token}", + "page": "${page}", + "perPage": "10000", + "keywords": "${keywords}", + @aside_filter@ + @query_type_data@ + "_$_tableName": "@TableName@", + "_$_pk": "@pk@", + "_$_action": "P", + "_$_query_filter": "1^10^@pk@^*^^@menuid@^@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": [] + } + }, + @ext_button_U@ + { + "type": "columns-toggler", + "align": "right" + }, + { + "type": "drag-toggler", + "align": "right" + }, + { + "type": "pagination", + "align": "right" + } + ], + "footerToolbar": [ + "statistics", + "switch-per-page", + "pagination" + ], + "columns": [ + @Fields_By_GridView@ + { + "type": "operation", + "label": "操作", + "width": @op-width@, + "buttons": [ + { + "type": "button", + "icon": "fa fa-eye", + "actionType": "dialog", + "tooltip": "查看", + "dialog": { + "title": "查看", + "size": "@formsize@", + "actions": [], + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + @init_api_org@ + "body": [ + @Fields_By_View@ + ] + } + } + }, + { + "type": "button", + "icon": "fa fa-pencil", + "tooltip": "編輯", + "actionType": "drawer", + "disabledOn": "${ls:@menuid@@update == null@bpm_edit@", + "drawer": { + "position": "right", + "resizable": true, + "size": "@formsize_drawer@", + "actions": [{ + "label": "存檔", + "actionType": "submit", + "primary": true, + "type": "button" + }, + { + "label": "取消", + "actionType": "cancel", + "type": "button" + } + ], + "title": "編輯", + "body": { + "type": "form", + "mode": "horizontal", + "horizontal": { + "leftFixed": true + }, + "name": "sample-edit-form", + @init_api_org@ + "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": "U" + }, + "dataType": "form" + }, + "body": [ + @Fields_By_Edit@ + ] + } + } + }, + @ext_button_I@ + { + "type": "button", + "icon": "fa fa-times text-danger", + "actionType": "ajax", + "disabledOn": "${ls:@menuid@@delete == null@bpm_edit@", + "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" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/singleGrid.txt b/template_mariadb/singleGrid.txt new file mode 100644 index 0000000..91c8114 --- /dev/null +++ b/template_mariadb/singleGrid.txt @@ -0,0 +1,195 @@ +{ + "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" + } + } + ] + } + ] + } +} \ No newline at end of file diff --git a/template_mariadb/transfer.txt b/template_mariadb/transfer.txt new file mode 100644 index 0000000..a981953 --- /dev/null +++ b/template_mariadb/transfer.txt @@ -0,0 +1,25 @@ +{ + "type": "page", + "body": { + "type": "form", + "initApi": { + "method": "post", + "url": "http://1.34.126.29:5050/xapi/v2/zenBusiness/get_orgStructure/9/", + "dataType": "form" + }, + "api": { + "method": "post", + "url": "http://1.34.126.29:5050/xapi/v2/zenBusiness/orm_api/3/", + "dataType": "form" + }, + "body": [ + { + "label": "´H", + "type": "transfer", + "name": "org_users", + "selectMode": "tree", + "source": "${config}" + } + ] + } +} \ No newline at end of file