minor fix

master
huangjinysf 3 months ago
parent 9add61c9e9
commit 7dc2e72cb6

@ -1,7 +1,8 @@
// API配置文件
export const API_CONFIG = {
// API服务器基础地址
BASE_URL: 'http://192.168.110.38:8100',
// BASE_URL: 'http://192.168.110.38:8100',
BASE_URL: 'http://localhost:8100',
// API端点
ENDPOINTS: {

@ -36,17 +36,16 @@
>帕累托分析</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['warehouse:WmsImportResult:edit']"
>修改</el-button>
>项目分析</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
@ -55,7 +54,7 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['warehouse:WmsImportResult:remove']"
>删除</el-button>
>趋势分析</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@ -73,8 +72,8 @@
<el-row class="mb8">
<el-col :span="24">
<!-- 根据currentComponent动态切换组件 -->
<component
:is="currentComponent"
<component
:is="currentComponent"
v-if="currentComponent"
:selected-time-range="queryForm.selectedTimeRange"
:pareto-data="paretoData"
@ -83,7 +82,7 @@
/>
</el-col>
</el-row>
<!-- 消息显示文本框 -->
<el-row>
<el-col :span="24">
@ -150,7 +149,7 @@ function handlePareto() {
//
const endDate = new Date();
const startDate = new Date();
if (queryForm.value.selectedTimeRange === '近1年') {
startDate.setFullYear(endDate.getFullYear() - 1);
} else if (queryForm.value.selectedTimeRange === '近2年') {
@ -158,7 +157,7 @@ function handlePareto() {
} else if (queryForm.value.selectedTimeRange === '近3年') {
startDate.setFullYear(endDate.getFullYear() - 3);
}
// YYYY-MM-DD
const formatDate = (date) => {
const year = date.getFullYear();
@ -166,10 +165,10 @@ function handlePareto() {
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
};
const startDateStr = formatDate(startDate);
const endDateStr = formatDate(endDate);
// console.log(startDateStr, endDateStr);
// API
fetch(`${API_CONFIG.BASE_URL}${API_CONFIG.ENDPOINTS.PARETO_ANALYSIS}?start_date=${startDateStr}&end_date=${endDateStr}`)

Loading…
Cancel
Save