Skip to content

Commit

Permalink
Merge branch 'develop' into feature/business-partner-field
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Feb 9, 2024
2 parents 66d96bc + ecba283 commit 6d99f25
Show file tree
Hide file tree
Showing 24 changed files with 644 additions and 316 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"core-js": "3.31.0",
"driver.js": "0.9.8",
"dropzone": "5.9.3",
"echarts": "5.3.2",
"echarts": "5.4.3",
"element-ui": "2.15.14",
"file-saver": "2.0.5",
"fuse.js": "6.6.2",
Expand Down
38 changes: 37 additions & 1 deletion src/api/ADempiere/file-management/resource-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { config } from '@/utils/ADempiere/config'
// Get Instance for connection
import { request } from '@/utils/ADempiere/request'

Expand All @@ -27,6 +27,42 @@ import {
// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'

/**
* Presigned Url
* @param {string} file_name
*/
export function requestPresignedUrl({
fileName
}) {
return request({
url: `${config.adempiere.resource.url}/presigned-url/${fileName}`,
method: 'get',
isWithoutAuthorization: true,
params: {
file_name: fileName
}
})
}

/**
* Upload File
* @param {string} url
*/

export function requestUploadFile({
url,
file
}) {
return request({
url: `${url}`,
method: 'put',
isWithoutAuthorization: true,
body: {
file
}
})
}

/**
* Set resource reference
* @param {number} resourceId
Expand Down
6 changes: 3 additions & 3 deletions src/api/ADempiere/security/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ export function loginAuthentication({
state
}) {
return request({
url: '/user/open-id/login',
url: '/security/login-open-id',
method: 'post',
data: {
code,
state
code_parameter: code,
state_parameter: state
}
})
.then(response => {
Expand Down
3 changes: 3 additions & 0 deletions src/components/ADempiere/Dashboard/charts/AreaChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ export default {
axisPointer: {
type: 'cross'
},
textStyle: {
color: '#999'
},
padding: [5, 10]
},
yAxis: {
Expand Down
8 changes: 7 additions & 1 deletion src/components/ADempiere/Dashboard/charts/BarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
-->

<template>
<div :class="className" :style="{height:height,width:width}" />
<div
:class="className"
:style="{height:height,width:width}"
/>
</template>

<script>
Expand Down Expand Up @@ -166,6 +169,9 @@ export default {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
textStyle: {
color: '#999'
}
},
toolbox: {
Expand Down
5 changes: 4 additions & 1 deletion src/components/ADempiere/Dashboard/charts/CustomerChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ export default {
axisPointer: {
type: 'cross'
},
padding: [5, 10]
padding: [5, 10],
textStyle: {
color: '#999'
}
},
yAxis: {
axisTick: {
Expand Down
144 changes: 89 additions & 55 deletions src/components/ADempiere/Dashboard/charts/Gauge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->
<template>
<div :class="className" :style="{height:height,width:width}" />
<div
:class="className"
:style="{height:height,width:width}"
/>
</template>

<script>
Expand All @@ -33,7 +36,12 @@ import { getContextAttributes } from '@/utils/ADempiere/contextUtils/contextAttr
const animationDuration = 2800

export default {
mixins: [resize],
name: 'GaugeChart',

mixins: [
resize
],

props: {
className: {
type: String,
Expand All @@ -56,11 +64,13 @@ export default {
required: true
}
},

data() {
return {
chart: null
}
},

watch: {
chartData: {
deep: true,
Expand All @@ -69,12 +79,14 @@ export default {
}
}
},

mounted() {
this.unsubscribe = this.subscribeChanges()
this.$nextTick(() => {
this.initChart()
})
},

beforeDestroy() {
this.unsubscribe()
if (!this.chart) {
Expand All @@ -83,6 +95,7 @@ export default {
this.chart.dispose()
this.chart = null
},

methods: {
subscribeChanges() {
return this.$store.subscribe((mutation, state) => {
Expand Down Expand Up @@ -128,61 +141,82 @@ export default {
console.warn(`Error getting Metrics: ${error.message}. Code: ${error.code}.`)
})
},
castValueData(listValue) {
if (this.isEmptyValue(listValue)) return 0
return listValue
.map(setValue => Number(setValue.value))
.filter(listValues => !isNaN(listValues))
.reduce((partialSum, currentvalue) => partialSum + currentvalue)
},
loadChartMetrics(metrics) {
const xAxisValues = []
let seriesToShow = []
const seriesToShow = []
if (!this.isEmptyValue(metrics.series)) {
seriesToShow = metrics.series.map(serie => {
return {
name: serie.name,
animationDuration,
type: 'gauge',
min: 0,
max: metrics.measureTarget,
splitNumber: 15,
radius: '100%',
data: [{
value: serie.data_set.map(set => set.value).reduce((partialSum, a) => partialSum + a, 0),
name: metrics.name
}],
axisLine: {
lineStyle: {
color: metrics.colorSchemas.filter(colorSchema => colorSchema.percent > 0).map(colorSchema => {
return [
colorSchema.percent / 100,
colorSchema.color
]
}),
width: 5,
shadowColor: '#fff',
shadowBlur: 10
}
},
splitLine: {
length: 25,
lineStyle: {
width: 3,
color: 'inherit',
shadowColor: 'auto',
shadowBlur: 10
}
},
pointer: {
shadowColor: 'auto',
shadowBlur: 5
},
detail: {
ackgroundColor: 'auto',
borderColor: 'inherit',
offsetCenter: [0, '50%'],
fontWeight: 'bolder',
fontSize: 20,
fontStyle: 'italic',
color: 'inherit',
shadowColor: 'auto',
shadowBlur: 10
// TODO: Consider color scheme `color_schemas`
seriesToShow.push({
animationDuration,
type: 'gauge',
min: 0,
max: metrics.measureTarget,
splitNumber: 5,
width: '5px',
radius: '100%',
progress: {
show: true,
width: 5
},
axisLine: {
lineStyle: {
width: 15,
color: [
[0.3, '#67e0e3'],
[0.7, '#37a2da'],
[1, '#fd666d']
]
}
}
},
axisTick: {
show: true
},
splitLine: {
length: 15,
lineStyle: {
width: 2,
color: '#999'
}
},
axisLabel: {
distance: 15,
color: '#999',
fontSize: 20
},
anchor: {
show: true,
showAbove: true,
size: 25,
itemStyle: {
borderWidth: 10
}
},
title: {
show: true,
offsetCenter: [0, '65%']
},
detail: {
valueAnimation: true,
fontSize: 26,
offsetCenter: [0, '85%'],
formatter: `{value}`
},
pointer: {
itemStyle: {
color: 'auto'
}
},
data: [{
value: metrics.measureActual, // this.castValueData(serie.data_set),
name: metrics.xAxisLabel || metrics.name
}]
})
}
this.chart.setOption({
Expand All @@ -191,10 +225,10 @@ export default {
feature: {
dataView: xAxisValues,
saveAsImage: {
pixelRatio: 2
pixelRatio: 20
},
mark: {
show: true
show: false
},
restore: {
show: true
Expand Down
3 changes: 3 additions & 0 deletions src/components/ADempiere/Dashboard/charts/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ export default {
labelTextColor: '#5eff00',
bodyColor: '#5eff00'
},
textStyle: {
color: '#999'
},
// color: '#ff0000',
// textColor: '#ff0000',
// padding: [5, 10]
Expand Down
5 changes: 4 additions & 1 deletion src/components/ADempiere/Dashboard/charts/PieChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ export default {
tooltip: {
backgroundColor: '#FFF',
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
formatter: '{a} <br/>{b} : {c} ({d}%)',
textStyle: {
color: '#999'
}
},
toolbox: {
// y: 'bottom',
Expand Down
3 changes: 3 additions & 0 deletions src/components/ADempiere/Dashboard/charts/RaddarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export default {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
textStyle: {
color: '#999'
}
},
toolbox: {
Expand Down
5 changes: 4 additions & 1 deletion src/components/ADempiere/Dashboard/charts/Scatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ export default {
axisPointer: {
type: 'cross'
},
padding: [5, 10]
padding: [5, 10],
textStyle: {
color: '#999'
}
},
yAxis: {
axisTick: {
Expand Down
3 changes: 3 additions & 0 deletions src/components/ADempiere/Dashboard/charts/WaterfallChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export default {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
textStyle: {
color: '#999'
}
},
grid: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ADempiere/Dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<template>
<el-card
v-if="!UNSUPPORTED_DASHBOARDS.includes(metadata.fileName)"
style="height: auto;"
:body-style="{ padding: '5px;'}"
style="height: auto;padding: 0px !important"
:body-style="{ padding: '0px' }"
>
<div class="clearfix">
<el-row :gutter="2">
Expand Down
Loading

0 comments on commit 6d99f25

Please sign in to comment.