minor fix

master
huangjinysf 3 months ago
parent 9add61c9e9
commit 7dc2e72cb6

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

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

Loading…
Cancel
Save