Commit 1899a49f by 江名洋

feat: 默认日期范围截止至昨日并更新生产数据库配置

1 parent f873b39a
......@@ -12,13 +12,24 @@ APP_PORT=9500
ROOT_PATH=/daw
# ============================================================================
# 数据库 (MySQL)
# 数据库 (MySQL) -- dev
# ============================================================================
DB_HOST=192.168.2.155
DB_PORT=3308
# DB_HOST=192.168.2.155
# DB_PORT=3308
# DB_USER=user_jiangmy
# DB_PASSWORD=PYuxMTB1
# DB_NAME=data_analyze
# ============================================================================
# 数据库 (MySQL) -- prod
# ============================================================================
DB_HOST=192.168.5.77
DB_PORT=3307
DB_USER=user_jiangmy
DB_PASSWORD=PYuxMTB1
DB_NAME=data_analyze
DB_PASSWORD=VMziLJun
DB_NAME=daw
# 源生产数据库 (Source DB)
SOURCE_DB_HOST=192.168.5.23
......
......@@ -399,6 +399,9 @@
const fmt = d => `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')}`;
const now = new Date();
const todayStr = fmt(now);
const yesterday = new Date(now);
yesterday.setDate(yesterday.getDate() - 1);
const yesterdayStr = fmt(yesterday);
const lastMonth26 = new Date(now.getFullYear(), now.getMonth()-1, 26);
const startStr = fmt(lastMonth26);
const firstOfMonth = fmt(new Date(now.getFullYear(), now.getMonth(), 1));
......@@ -407,11 +410,11 @@
const ecoStart = document.getElementById('ecology-start-date');
const ecoEnd = document.getElementById('ecology-end-date');
if (ecoStart && !ecoStart.value) ecoStart.value = startStr;
if (ecoEnd && !ecoEnd.value) ecoEnd.value = todayStr;
if (ecoEnd && !ecoEnd.value) ecoEnd.value = yesterdayStr;
const natStart = document.getElementById('nature-start-date');
const natEnd = document.getElementById('nature-end-date');
if (natStart && !natStart.value) natStart.value = firstOfMonth;
if (natEnd && !natEnd.value) natEnd.value = todayStr;
if (natEnd && !natEnd.value) natEnd.value = yesterdayStr;
// 加载历史批次下拉
loadBatchOptions();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!