diff --git a/.gitignore b/.gitignore index a547bf3..f1be8b6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ pnpm-debug.log* lerna-debug.log* node_modules +solar_dist dist dist-ssr *.local diff --git a/_reportManagement.html b/_reportManagement.html index 4eccc2d..2e12d03 100644 --- a/_reportManagement.html +++ b/_reportManagement.html @@ -1211,38 +1211,61 @@ // } var isElecType = $("li.active [name=reportTypeRadio]").data("type") === "elec"; + var date = $("#elecMonthDate").val(); var url = isElecType ? baseApiUrl + "/" + - reportTypeDict["RElec"]["exportListApiUrl"][tableType] + reportTypeDict["RElec"]["exportListApiUrl"][tableType]+"?Date=" + date : baseApiUrl + "/api/" + reportTypeDict["RElec"]["exportListApiUrl"][tableType]; setLoading(true, "匯出中"); - $.ajax({ - type: "POST", - url: url, - data: - tableType == "compare" - ? JSON.stringify(sent_data) - : JSON.stringify(sent_data[0]), - headers: { - Authorization: "Bearer " + token, - }, - contentType: "application/json; charset=utf-8", - xhrFields: { - responseType: "blob", // to avoid binary data being mangled on charset conversion - }, - success: function (rel, text, xhr) { - if (rel) { - downloadByBlob(xhr, rel); - } - }, - complete: (xhr) => { - setLoading(false); - }, - }); + if (isElecType) { + $.ajax({ + type: "GET", + url: url, + headers: { + Authorization: "Bearer " + token, + }, + contentType: "application/json; charset=utf-8", + xhrFields: { + responseType: "blob", // to avoid binary data being mangled on charset conversion + }, + success: function (rel, text, xhr) { + if (rel) { + downloadByBlob(xhr, rel); + } + }, + complete: (xhr) => { + setLoading(false); + }, + }); + } else { + $.ajax({ + type: "POST", + url: url, + data: + tableType == "compare" + ? JSON.stringify(sent_data) + : JSON.stringify(sent_data[0]), + headers: { + Authorization: "Bearer " + token, + }, + contentType: "application/json; charset=utf-8", + xhrFields: { + responseType: "blob", // to avoid binary data being mangled on charset conversion + }, + success: function (rel, text, xhr) { + if (rel) { + downloadByBlob(xhr, rel); + } + }, + complete: (xhr) => { + setLoading(false); + }, + }); + } } function recalculateArchive() { diff --git a/ibms_solar/.env b/ibms_solar/.env index 2ed0710..ff4366f 100644 --- a/ibms_solar/.env +++ b/ibms_solar/.env @@ -1,2 +1,2 @@ -VITE_API_BASEURL = "http://192.168.0.206:8040" +VITE_API_BASEURL = "http://192.168.35.117:8081" # VITE_API_BASEURL = "https://ibms-mcut-api.production.mjmtech.com.tw" \ No newline at end of file diff --git a/ibms_solar/src/constant/tabList.jsx b/ibms_solar/src/constant/tabList.jsx index ea94baf..79556d2 100644 --- a/ibms_solar/src/constant/tabList.jsx +++ b/ibms_solar/src/constant/tabList.jsx @@ -23,7 +23,7 @@ const EnergyTABS = (siteId) => [ id: "basicInfo", icon: , title: "基本資料", - content: , + content: , }, { id: "monitor", diff --git a/ibms_solar/src/context/SiteContext.jsx b/ibms_solar/src/context/SiteContext.jsx index 089ebc1..a23b3ce 100644 --- a/ibms_solar/src/context/SiteContext.jsx +++ b/ibms_solar/src/context/SiteContext.jsx @@ -4,9 +4,10 @@ const SiteContext = createContext(); export const SiteProvider = ({ children }) => { const [siteId, setSiteId] = useState(null); + const [siteName, setSiteName] = useState(null); return ( - + {children} ); diff --git a/ibms_solar/src/page/Energy.jsx b/ibms_solar/src/page/Energy.jsx index 874fdf7..f407308 100644 --- a/ibms_solar/src/page/Energy.jsx +++ b/ibms_solar/src/page/Energy.jsx @@ -5,7 +5,7 @@ import { EnergyTABS } from "@/constant"; import { FaCheckCircle, FaCloudSunRain } from "react-icons/fa"; const Energy = () => { - const { siteId, setSiteId } = useSite(); + const { siteId, setSiteId, siteName } = useSite(); const navigate = useNavigate(); const [activeTab, setActiveTab] = useState("realtime"); const tabs = EnergyTABS(siteId); @@ -26,10 +26,12 @@ const Energy = () => { 上一頁 - {siteId} + + {siteName ? siteName : siteId} +
- + 0°C
diff --git a/ibms_solar/src/page/Home.jsx b/ibms_solar/src/page/Home.jsx index ec15628..60105b0 100644 --- a/ibms_solar/src/page/Home.jsx +++ b/ibms_solar/src/page/Home.jsx @@ -5,7 +5,7 @@ import { IframeComponent } from "@/components"; const Home = () => { const iframeRef = useRef(null); - const { setSiteId } = useSite(); + const { setSiteId, setSiteName } = useSite(); const navigate = useNavigate(); // 處理加載後的邏輯 @@ -18,6 +18,10 @@ const Home = () => { const id = urlParams.get("siteID"); if (id) { setSiteId(id); + const name = urlParams.get("name"); + if (name) { + setSiteName(decodeURIComponent(name)); + } navigate("/energy"); } else { console.log("找不到 siteId 参数"); diff --git a/index.html b/index.html index 7fb5d27..fffe9ef 100644 --- a/index.html +++ b/index.html @@ -2116,7 +2116,11 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
`; } }); - + strHtml += `` $("#froLisPage").html(strHtml); // $("#homeBtn").YTNavbar("init"); diff --git a/solarEnergyItem.html b/solarEnergyItem.html new file mode 100644 index 0000000..fa40791 --- /dev/null +++ b/solarEnergyItem.html @@ -0,0 +1,814 @@ + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ 查詢 +
+
+
+
+ +
+
+ + + + +
+
+
+
+ +
+
+
+
+ +
+
+
+ 查詢 +
+
+ +
+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+
+
+ +
+
+
+ 查詢 +
+
+ +
+
+
+ +
+
+ +
+
+
+
+ 6 +
+
+
+
+
+ + + \ No newline at end of file