diff --git a/src/components/ADempiere/PanelDefinition/index.vue b/src/components/ADempiere/PanelDefinition/index.vue index baed55ee..0f25860e 100644 --- a/src/components/ADempiere/PanelDefinition/index.vue +++ b/src/components/ADempiere/PanelDefinition/index.vue @@ -20,7 +20,7 @@ @@ -31,55 +31,58 @@ export default defineComponent({ name: 'PanelDefinition', props: { + parentUuid: { + type: String, + default: undefined + }, containerUuid: { type: String, required: true }, - panelType: { - type: String, - required: true + panelMetadata: { + type: Object, + required: false } }, setup(props, { root }) { - const panelMetadata = computed(() => { + const storedMetadata = computed(() => { return root.$store.getters.getPanel(props.containerUuid) }) const componentRender = computed(() => { - if (['browser', 'process'].includes(props.panelType)) { - return () => import('@/components/ADempiere/PanelDefinition/StandardPanel') - } - - const panel = () => import('@/components/ADempiere/PanelDefinition/UnsupportedPanel') - /* - switch (this.panelMetadata.panelType) { - case 'PanelMaster': - panel = () => import('@/components/ADempiere/PanelDefinition/FieldBinary') - break - case 'PanelDocument': - panel = () => import('@/components/ADempiere/PanelDefinition/FieldButton') - break - case 'PanelSequence': - panel = () => import('@/components/ADempiere/PanelDefinition/FieldColor') - break - // search - case 'PanelAdvanced': - panel = () => import('@/components/ADempiere/PanelDefinition/PanelAdvanced') - break - // Tree As Menu - case 'PanelTree': - panel = () => import('@/components/ADempiere/PanelDefinition/PanelTree') - break - } - */ - - return panel + return () => import('@/components/ADempiere/PanelDefinition/StandardPanel') }) + /** + * Get the tab object with all its attributes as well as + * the fields it contains + */ + const getPanel = () => { + let panel = storedMetadata.value + if (root.isEmptyValue(panel)) { + // not in store, set with prop + panel = props.panelMetadata + } + if (!root.isEmptyValue(panel) && panel.fieldsList) { + // not regenerate fields + return + } + + // generate fields and set into store + root.$store.dispatch('getFieldsFromTab', { + parentUuid: props.parentUuid, + containerUuid: props.containerUuid, + panelMetadata: panel + }) + } + + getPanel() + return { + // computeds componentRender, - panelMetadata + metadata: storedMetadata } } }) diff --git a/src/components/ADempiere/TabManager/index.vue b/src/components/ADempiere/TabManager/index.vue new file mode 100644 index 00000000..a8250bae --- /dev/null +++ b/src/components/ADempiere/TabManager/index.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/src/router/modules/ADempiere/testRoutes.js b/src/router/modules/ADempiere/testRoutes.js index e6e1d544..071b00e0 100644 --- a/src/router/modules/ADempiere/testRoutes.js +++ b/src/router/modules/ADempiere/testRoutes.js @@ -34,6 +34,24 @@ const testRoutes = [ } ] }, + + { + path: '/test/window/standard', + component: Layout, + hidden: true, + children: [ + { + path: '/test/window/standard', + component: () => import('@/views/ADempiere/Test/Window'), + name: 'Window Test View', + meta: { + title: 'Window Test View', + isIndex: true + } + } + ] + }, + { path: '/test/process/standard', component: Layout, @@ -50,6 +68,7 @@ const testRoutes = [ } ] }, + { path: '/test/smart-browser/standard', component: Layout, diff --git a/src/store/modules/ADempiere/windowDefinition.js b/src/store/modules/ADempiere/windowDefinition.js index bba8829a..eb961a1d 100644 --- a/src/store/modules/ADempiere/windowDefinition.js +++ b/src/store/modules/ADempiere/windowDefinition.js @@ -317,7 +317,9 @@ const window = { let isTabsChildren = false if (!isAdvancedQuery) { const window = getters.getWindow(parentUuid) - isTabsChildren = Boolean(window.tabsListChildren.length) + if (window) { + isTabsChildren = Boolean(window.tabsListChildren.length) + } } if (!isWithUuidField) { diff --git a/src/views/ADempiere/Test/Window/index.vue b/src/views/ADempiere/Test/Window/index.vue new file mode 100644 index 00000000..3e87349f --- /dev/null +++ b/src/views/ADempiere/Test/Window/index.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/views/ADempiere/Test/Window/standardWindow.json b/src/views/ADempiere/Test/Window/standardWindow.json new file mode 100644 index 00000000..d9c01720 --- /dev/null +++ b/src/views/ADempiere/Test/Window/standardWindow.json @@ -0,0 +1,547 @@ +{ + "code": 200, + "result": { + "id": 53178, + "uuid": "a521b2f6-fb40-11e8-a479-7a0060f0aa01", + "name": "Product Group", + "description": "Maintain Product Group", + "help": "The Product Group allows you to define different groups of products.", + "is_active": true, + "is_sales_transaction": true, + "window_type": "M", + "tabs": [ + { + "id": 53513, + "uuid": "a4a2b9ba-fb40-11e8-a479-7a0060f0aa01", + "name": "Product Group", + "description": "Define Product Group", + "help": "The Product Group defines unique groupings of products.", + "table_name": "M_Product_Group", + "sequence": 10, + "tab_level": 0, + "is_active": true, + "is_single_row": true, + "is_advanced_tab": false, + "is_has_tree": false, + "is_info_tab": false, + "is_sort_tab": false, + "is_translation_tab": false, + "is_read_only": false, + "is_insert_record": true, + "is_view": false, + "is_deleteable": true, + "is_document": false, + "is_change_log": false, + "access_level": 3, + "link_column_name": "", + "sort_order_column_name": "", + "sort_yes_no_column_name": "", + "parent_column_name": "", + "display_logic": "", + "commit_warning": "", + "query": "SELECT M_Product_Group.*, (SELECT NVL(AD_Client.Name,'') FROM AD_Client WHERE M_Product_Group.AD_Client_ID=AD_Client.AD_Client_ID) AS \"DisplayColumn_AD_Client_ID\", (SELECT NVL(AD_Org.Name,'') FROM AD_Org WHERE M_Product_Group.AD_Org_ID=AD_Org.AD_Org_ID) AS \"DisplayColumn_AD_Org_ID\", M_Product_Group_Parent_ID_M_Product_Group.Name AS \"DisplayColumn_M_Product_Group_Parent_ID\" FROM M_Product_Group AS M_Product_Group LEFT JOIN M_Product_Group AS M_Product_Group_Parent_ID_M_Product_Group ON(M_Product_Group_Parent_ID_M_Product_Group.M_Product_Group_ID = M_Product_Group.M_Product_Group_Parent_ID)", + "where_clause": "", + "order_by_clause": "", + "parent_tab_uuid": "", + "processes": [], + "fields": [ + { + "id": 64329, + "uuid": "8d8925e8-fb40-11e8-a479-7a0060f0aa01", + "name": "Grupo de Producto", + "description": "Group of a Product", + "help": "Identifies the Group which this product belongs to.", + "sequence": 0, + "column_name": "M_Product_Group_ID", + "element_name": "M_Product_Group_ID", + "is_displayed": false, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": false, + "is_encrypted": false, + "is_same_line": false, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": true, + "is_key": true, + "is_parent": false, + "is_updateable": false, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": false, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 13, + "default_value": "", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 10 + }, + { + "id": 64330, + "uuid": "8d89269c-fb40-11e8-a479-7a0060f0aa01", + "name": "Compañía", + "description": "Compañía para esta instalación", + "help": "Compañía o entidad legal. No se pueden compartir datos entre diferentes compañías.", + "sequence": 10, + "column_name": "AD_Client_ID", + "element_name": "AD_Client_ID", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": false, + "is_encrypted": false, + "is_same_line": false, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": true, + "is_key": false, + "is_parent": false, + "is_updateable": false, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": false, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 19, + "default_value": "@#AD_Client_ID@", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "reference": { + "table_name": "AD_Client", + "key_column_name": "AD_Client.AD_Client_ID", + "display_column_name": "", + "query": "SELECT AD_Client.AD_Client_ID,NULL,NVL(AD_Client.Name,'-1'),AD_Client.IsActive, AD_Client.UUID FROM AD_Client WHERE AD_Client.AD_Client_ID <> 0 ORDER BY 3", + "direct_query": "SELECT AD_Client.AD_Client_ID,NULL,NVL(AD_Client.Name,'-1'),AD_Client.IsActive, AD_Client.UUID FROM AD_Client WHERE AD_Client.AD_Client_ID=?", + "validation_code": "AD_Client.AD_Client_ID <> 0", + "zoom_windows": [ + { + "id": 109, + "uuid": "a521762e-fb40-11e8-a479-7a0060f0aa01", + "name": "Compañía", + "description": "Mantener Compañías", + "is_sales_transaction": true, + "is_active": false + } + ] + }, + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 10 + }, + { + "id": 64331, + "uuid": "8d892750-fb40-11e8-a479-7a0060f0aa01", + "name": "Organización", + "description": "Entidad organizacional dentro de la compañía", + "help": "Una organización es una unidad de la compañía o entidad legal - Ej. Tiendas y departamentos. Es posible compartir datos entre organizaciones.", + "sequence": 20, + "column_name": "AD_Org_ID", + "element_name": "AD_Org_ID", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": false, + "is_encrypted": false, + "is_same_line": true, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": true, + "is_key": false, + "is_parent": false, + "is_updateable": false, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": false, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 19, + "default_value": "@#AD_Org_ID@", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "reference": { + "table_name": "AD_Org", + "key_column_name": "AD_Org.AD_Org_ID", + "display_column_name": "", + "query": "SELECT AD_Org.AD_Org_ID,NULL,NVL(AD_Org.Name,'-1'),AD_Org.IsActive, AD_Org.UUID FROM AD_Org WHERE (AD_Org.IsSummary='N' OR AD_Org.AD_Org_ID=0) ORDER BY 3", + "direct_query": "SELECT AD_Org.AD_Org_ID,NULL,NVL(AD_Org.Name,'-1'),AD_Org.IsActive, AD_Org.UUID FROM AD_Org WHERE AD_Org.AD_Org_ID=?", + "validation_code": "(AD_Org.IsSummary='N' OR AD_Org.AD_Org_ID=0)", + "zoom_windows": [ + { + "id": 110, + "uuid": "a5210fa4-fb40-11e8-a479-7a0060f0aa01", + "name": "Organización", + "description": "Mantener Organizaciones", + "is_sales_transaction": true, + "is_active": false + } + ] + }, + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 10 + }, + { + "id": 64332, + "uuid": "8d892804-fb40-11e8-a479-7a0060f0aa01", + "name": "Código", + "description": "El código para el registro en el formato requerido; debe ser único.", + "help": "Un código le permite a usted un método rápido de encontrar un registro en particular.", + "sequence": 30, + "column_name": "Value", + "element_name": "Value", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": false, + "is_encrypted": false, + "is_same_line": false, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": true, + "is_key": false, + "is_parent": false, + "is_updateable": true, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": true, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 10, + "default_value": "", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 255 + }, + { + "id": 64333, + "uuid": "8d2ef618-fb40-11e8-a479-7a0060f0aa01", + "name": "Nombre", + "description": "Identificador alfanumérico de la entidad.", + "help": "El nombre de una entidad (registro) se usa como una opción de búsqueda predeterminada adicional al código. El nombre es de hasta 60 caracteres de longitud.", + "sequence": 40, + "column_name": "Name", + "element_name": "Name", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": true, + "is_encrypted": false, + "is_same_line": false, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": true, + "is_key": false, + "is_parent": false, + "is_updateable": true, + "is_identifier": true, + "is_allow_logging": true, + "is_selection_column": true, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 1, + "display_logic": "", + "display_type": 10, + "default_value": "", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 60 + }, + { + "id": 64334, + "uuid": "8d2ef6b8-fb40-11e8-a479-7a0060f0aa01", + "name": "Descripción", + "description": "Descripción corta opcional del registro", + "help": "Una descripción esta limitada a 255 caracteres", + "sequence": 50, + "column_name": "Description", + "element_name": "Description", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": true, + "is_encrypted": false, + "is_same_line": false, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": false, + "is_key": false, + "is_parent": false, + "is_updateable": true, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": true, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 10, + "default_value": "", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 255 + }, + { + "id": 64335, + "uuid": "8d8928b8-fb40-11e8-a479-7a0060f0aa01", + "name": "Activo", + "description": "El registro está activo en el sistema", + "help": "Hay dos métodos para que los registros no estén disponibles en el sistema: Uno es eliminar el registro; el otro es desactivarlo. Un registro desactivado no está disponible para selección; pero está disponible para Informes", + "sequence": 70, + "column_name": "IsActive", + "element_name": "IsActive", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": false, + "is_encrypted": false, + "is_same_line": false, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": true, + "is_key": false, + "is_parent": false, + "is_updateable": true, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": false, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 20, + "default_value": "Y", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 1 + }, + { + "id": 64336, + "uuid": "8d2f02a2-fb40-11e8-a479-7a0060f0aa01", + "name": "Predeterminado", + "description": "Valor Predeterminado", + "help": "El cuadro de verificación indica si este registro será usado como un valor predeterminado", + "sequence": 80, + "column_name": "IsDefault", + "element_name": "IsDefault", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": true, + "is_encrypted": false, + "is_same_line": true, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": true, + "is_key": false, + "is_parent": false, + "is_updateable": true, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": false, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 20, + "default_value": "", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 1 + }, + { + "id": 64337, + "uuid": "8d2f039c-fb40-11e8-a479-7a0060f0aa01", + "name": "Grupo de Producto Padre", + "description": "", + "help": "", + "sequence": 90, + "column_name": "M_Product_Group_Parent_ID", + "element_name": "M_Product_Group_Parent_ID", + "is_displayed": true, + "is_displayed_grid": true, + "is_read_only": false, + "is_allow_copy": true, + "is_encrypted": false, + "is_same_line": false, + "is_heading": false, + "is_field_only": false, + "is_quick_entry": false, + "is_mandatory": false, + "is_key": false, + "is_parent": false, + "is_updateable": true, + "is_identifier": false, + "is_allow_logging": true, + "is_selection_column": false, + "is_range": false, + "is_always_updateable": false, + "is_translated": false, + "identifier_sequence": 0, + "display_logic": "", + "display_type": 18, + "default_value": "", + "read_only_logic": "", + "mandatory_logic": "", + "callout": "", + "column_sql": "", + "v_format": "", + "value_min": "", + "value_max": "", + "format_pattern": "", + "reference": { + "table_name": "M_Product_Group", + "key_column_name": "M_Product_Group.M_Product_Group_ID", + "display_column_name": "Name", + "query": "SELECT M_Product_Group.M_Product_Group_ID,NULL,NVL(M_Product_Group.Name,'-1'),M_Product_Group.IsActive, M_Product_Group.UUID FROM M_Product_Group ORDER BY 3", + "direct_query": "SELECT M_Product_Group.M_Product_Group_ID,NULL,NVL(M_Product_Group.Name,'-1'),M_Product_Group.IsActive, M_Product_Group.UUID FROM M_Product_Group WHERE M_Product_Group.M_Product_Group_ID=?", + "validation_code": "", + "zoom_windows": [ + { + "id": 53178, + "uuid": "a521b2f6-fb40-11e8-a479-7a0060f0aa01", + "name": "Product Group", + "description": "Maintain Product Group", + "is_sales_transaction": true, + "is_active": false + } + ] + }, + "is_query_criteria": false, + "is_order_by": false, + "seq_no_grid": 0, + "sort_no": 0, + "is_info_only": false, + "is_active": true, + "default_value_to": "", + "field_length": 10 + } + ] + } + ] + } +} diff --git a/src/views/ADempiere/WindowView/StandardWindow.vue b/src/views/ADempiere/WindowView/StandardWindow.vue index 5803e0a2..ba98ff85 100644 --- a/src/views/ADempiere/WindowView/StandardWindow.vue +++ b/src/views/ADempiere/WindowView/StandardWindow.vue @@ -17,7 +17,7 @@ -->