Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Set Icons to (SVG) based on Table Name (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsiosanchez authored Sep 8, 2023
1 parent e830e5a commit f127f41
Showing 1 changed file with 7 additions and 199 deletions.
206 changes: 7 additions & 199 deletions components/ADempiere/Form/VFileImport/selectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ import {
} from '@/api/ADempiere/form/VFileImport.js'

// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere'
import {
isEmptyValue,
setIconsTableName
} from '@/utils/ADempiere'

export default defineComponent({
name: 'selectTable',
Expand Down Expand Up @@ -203,7 +206,9 @@ export default defineComponent({
return listTables.map(tables => {
return {
...tables,
icon: iconTable(tables)
icon: setIconsTableName({
tableName: tables.table_name
})
}
})
})
Expand Down Expand Up @@ -369,202 +374,6 @@ export default defineComponent({
return 'custom-card'
}

function iconTable(table) {
let icon = {
type: 'svg',
class: 'search'
}
switch (table.table_name) {
case 'I_Payment':
icon = {
type: 'svg',
class: 'payments'
}
break
case 'I_Invoice':
icon = {
type: 'i',
class: 'el-icon-office-building'
}
break
case 'I_BankStatement':
icon = {
type: 'svg',
class: 'account-balance'
}
break
case 'I_InOutLineConfirm':
icon = {
type: 'svg',
class: 'local-shipping'
}
break
case 'I_Inventory':
icon = {
type: 'svg',
class: 'inventory'
}
break
case 'I_Order':
icon = {
type: 'svg',
class: 'clipboard'
}
break
case 'I_Conversion_Rate':
icon = {
type: 'svg',
class: 'conversion'
}
break
case 'I_Product':
icon = {
type: 'svg',
class: 'product'
}
break
case 'M_Product':
icon = {
type: 'svg',
class: 'product'
}
break
case 'I_BPartner':
icon = {
type: 'i',
class: 'el-icon-user-solid'
}
break
case 'I_ElementValue':
icon = {
type: 'i',
class: 'el-icon-wallet'
}
break
case 'I_ReportLine':
icon = {
type: 'i',
class: 'el-icon-notebook-2'
}
break
case 'I_GLJournal':
icon = {
type: 'svg',
class: 'balance'
}
break
case 'I_FAJournal':
icon = {
type: 'svg',
class: 'accounting-note'
}
break
case 'I_Asset':
icon = {
type: 'i',
class: 'el-icon-coin'
}
break
case 'I_Movement':
icon = {
type: 'i',
class: 'el-icon-truck'
}
break
case 'I_ProductPlanning':
icon = {
type: 'svg',
class: 'product'
}
break
case 'I_PriceList':
icon = {
type: 'svg',
class: 'price_list'
}
break
case 'I_HR_Movement':
icon = {
type: 'svg',
class: 'import-movement'
}
break
case 'I_Product_BOM':
icon = {
type: 'svg',
class: 'product'
}
break
case 'I_FixedAsset':
icon = {
type: 'i',
class: 'el-icon-coin'
}
break
case 'I_HR_Attribute':
icon = {
type: 'svg',
class: 'atributo'
}
break
case 'I_Product_ASI':
icon = {
type: 'svg',
class: 'product-attribute'
}
break
case 'I_Workflow':
icon = {
type: 'svg',
class: 'workflow'
}
break
case 'I_SalesHistory':
icon = {
type: 'i',
class: 'el-icon-shopping-cart-full'
}
break
case 'I_Budget':
icon = {
type: 'svg',
class: 'budget'
}
break
case 'I_HR_Employee':
icon = {
type: 'svg',
class: 'employee'
}
break
case 'I_Project':
icon = {
type: 'svg',
class: 'project'
}
break
case 'I_Forecast':
icon = {
type: 'svg',
class: 'forecast'
}
break
case 'I_HR_AttendanceRecord':
icon = {
type: 'svg',
class: 'attendance-record'
}
break
case 'I_FM_Agreement':
icon = {
type: 'svg',
class: 'agreement'
}
break
}
return icon
}

function infoImportFormats(id) {
if (isEmptyValue(id)) return
store.dispatch('importFormats', {
Expand Down Expand Up @@ -619,7 +428,6 @@ export default defineComponent({
currrentCharsets,
optionsImportFormats,
isActiveTable,
iconTable,
selectTabla,
remoteSearchCharsets,
remoteSearchImportFormats,
Expand Down

0 comments on commit f127f41

Please sign in to comment.