Browse Source

添加底板时间、天气、远近交互。添加接口数据对接。按钮组添加子组

linqilong 6 tháng trước cách đây
mục cha
commit
680c7ff680

+ 900 - 0
src/api/gx.ts

@@ -0,0 +1,900 @@
+import request from "@/utils/request";
+
+const gxToken = 'test'
+
+/**
+ * 水质自动站多站最新数据
+ */
+export function getWaterQualityLatest(data: any) {
+  data.accessToken = gxToken
+  return request({
+    url: '/gx_api/gx/awq/waterQuality/latest',
+    method: 'get',
+    params: data,
+    timeout: 1000 * 60
+  })
+  // return Promise.resolve([
+  //   {
+  //     "stcd": "63304700",
+  //     "stnm": "太师桥",
+  //     "title": "太师桥",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.4941",
+  //     "lttd": "30.762836",
+  //     "shuxing": "基本站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.24",
+  //     "q": "73.791",
+  //     "drp": "0",
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63304650",
+  //     "stnm": "思源",
+  //     "title": "思源",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.522088",
+  //     "lttd": "30.841321",
+  //     "shuxing": "基本站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.15",
+  //     "q": "15.308",
+  //     "drp": "0",
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "70112100",
+  //     "stnm": "罗桐埠 ",
+  //     "title": "罗桐埠 ",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "119.254444",
+  //     "lttd": "29.476389",
+  //     "shuxing": "基本站",
+  //     "xzqh": "浙江杭州",
+  //     "z": "23.14",
+  //     "q": "0",
+  //     "drp": "0",
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "70111400",
+  //     "stnm": "街口",
+  //     "title": "街口",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "118.71691",
+  //     "lttd": "29.72391",
+  //     "shuxing": "基本站",
+  //     "xzqh": "浙江杭州",
+  //     "z": "102.43",
+  //     "q": "0",
+  //     "drp": "0",
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63301700",
+  //     "stnm": "北虹大桥",
+  //     "title": "北虹大桥",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.709747",
+  //     "lttd": "30.885936",
+  //     "shuxing": "基本站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.049",
+  //     "q": "26.255",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63304730",
+  //     "stnm": "文桥",
+  //     "title": "文桥",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.465831",
+  //     "lttd": "30.800258",
+  //     "shuxing": "预警站",
+  //     "xzqh": "浙江湖州",
+  //     "z": "3.21",
+  //     "q": "7.77",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63305451",
+  //     "stnm": "圣塘桥",
+  //     "title": "圣塘桥",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.589144",
+  //     "lttd": "30.838792",
+  //     "shuxing": "预警站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.13",
+  //     "q": "-40.204",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63205690",
+  //     "stnm": "太平桥",
+  //     "title": "太平桥",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.702609",
+  //     "lttd": "30.886256",
+  //     "shuxing": "预警站",
+  //     "xzqh": "江苏苏州",
+  //     "z": "3.05",
+  //     "q": "18.11",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63205680",
+  //     "stnm": "双林桥 ",
+  //     "title": "双林桥 ",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.705375",
+  //     "lttd": "30.922552",
+  //     "shuxing": "预警站",
+  //     "xzqh": "江苏苏州",
+  //     "z": "3.05",
+  //     "q": "-1.666",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63205670",
+  //     "stnm": "章湾圩公路桥",
+  //     "title": "章湾圩公路桥",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.756256",
+  //     "lttd": "30.978642",
+  //     "shuxing": "预警站",
+  //     "xzqh": "江苏苏州",
+  //     "z": "3.04",
+  //     "q": "-9.445",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63313001",
+  //     "stnm": "梅台港桥",
+  //     "title": "梅台港桥",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.774598",
+  //     "lttd": "30.99626",
+  //     "shuxing": "预警站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.11",
+  //     "q": "-66.298",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63312411",
+  //     "stnm": "陶庄枢纽",
+  //     "title": "陶庄枢纽",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.829083",
+  //     "lttd": "31.002328",
+  //     "shuxing": "预警站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.09",
+  //     "q": "-116.508",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63312340",
+  //     "stnm": "大舜枢纽",
+  //     "title": "大舜枢纽",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.906514",
+  //     "lttd": "31.017386",
+  //     "shuxing": "预警站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.16",
+  //     "q": "-36.413",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "63312300",
+  //     "stnm": "丁栅闸",
+  //     "title": "丁栅闸",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "120.9528",
+  //     "lttd": "31.018267",
+  //     "shuxing": "预警站",
+  //     "xzqh": "浙江嘉兴",
+  //     "z": "3.22",
+  //     "q": "-3.014",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "71501010",
+  //     "stnm": "托溪水文站",
+  //     "title": "托溪水文站",
+  //     "tm": "2024-10-30 14:00:00",
+  //     "lgtd": "119.354764",
+  //     "lttd": "27.491128",
+  //     "shuxing": null,
+  //     "xzqh": "福建宁德",
+  //     "z": "1.58",
+  //     "q": "2",
+  //     "drp": "0",
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   },
+  //   {
+  //     "stcd": "71111530",
+  //     "stnm": "马蹄岙电站",
+  //     "title": "马蹄岙电站",
+  //     "tm": "2024-10-28 00:00:00",
+  //     "lgtd": "118.91861",
+  //     "lttd": "27.61917",
+  //     "shuxing": null,
+  //     "xzqh": null,
+  //     "z": null,
+  //     "q": "12.69",
+  //     "drp": null,
+  //     "dyp": null,
+  //     "stjl": null,
+  //     "xsa": null,
+  //     "xsavv": null,
+  //     "xsmxv": null,
+  //     "flwchrcd": null,
+  //     "wptn": null,
+  //     "msqmt": null,
+  //     "msamt": null,
+  //     "msvmt": null,
+  //     "grz": null,
+  //     "wrz": null,
+  //     "avz": null,
+  //     "avq": null,
+  //     "maxz": null,
+  //     "minz": null,
+  //     "maxq": null,
+  //     "minq": null,
+  //     "maxztm": null,
+  //     "minztm": null,
+  //     "maxqtm": null,
+  //     "minqtm": null,
+  //     "day": null,
+  //     "mnth": null,
+  //     "ohmaxr": null,
+  //     "ohbgtm": null,
+  //     "twhmaxr": null,
+  //     "shmaxr": null,
+  //     "shbgtm": null,
+  //     "twemaxr": null,
+  //     "twbgtm": null,
+  //     "odbgtm": null,
+  //     "tedmaxr": null,
+  //     "tedbgtm": null,
+  //     "odmaxr": null,
+  //     "mydavz": null,
+  //     "mydavq": null,
+  //     "swz": null
+  //   }
+  // ])
+}
+
+/**
+ * 水质自动站单站历史水质数据(分页)
+ */
+export function getWaterQualityListOfPageByStcd(data: any) {
+  data.accessToken = gxToken
+  return request({
+    url: '/gx_api/gx/awq/waterQuality/listOfPageByStcd',
+    method: 'get',
+    params: data,
+    timeout: 1000 * 60
+  })
+}
+
+/**
+ * 水位流量多站最新数据
+ */
+export function getWaterLevelAndFlowLatest(data: any) {
+  data.accessToken = gxToken
+  return request({
+    url: '/gx_api/gx/sq/waterLevelAndFlow/latest',
+    method: 'get',
+    params: data,
+    timeout: 1000 * 60
+  })
+}
+
+/**
+ * 水位流量单站历史数据(分页)
+ */
+export function getWaterLevelAndFlowListOfPageByStcd(data: any) {
+  data.accessToken = gxToken
+  return request({
+    url: '/gx_api/gx/sq/waterLevelAndFlow/listOfPageByStcd',
+    method: 'get',
+    params: data,
+    timeout: 1000 * 60
+  })
+}
+
+/**
+ * 雨量多站最新数据
+ */
+export function getRainfallLatest(data: any) {
+  data.accessToken = gxToken
+  return request({
+    url: '/gx_api/gx/yq/rainfall/latest',
+    method: 'get',
+    params: data,
+    timeout: 1000 * 60
+  })
+}
+
+/**
+ * 雨量单站历史数据(分页)
+ */
+export function getRainfallListOfPageByStcd(data: any) {
+  data.accessToken = gxToken
+  return request({
+    url: '/gx_api/gx/yq/rainfall/listOfPageByStcd',
+    method: 'get',
+    params: data,
+    timeout: 1000 * 60
+  })
+}
+

+ 24 - 0
src/api/weather.ts

@@ -0,0 +1,24 @@
+import request from "@/utils/request";
+
+/**
+ * 水质自动站多站最新数据
+ */
+export async function getWeather() {
+  const jiaxinWeather = await request({
+    url: '/nmc_api/rest/weather?stationid=pxfeS',
+    method: 'get'
+  }).then(res => res.data.real.weather)
+  const huangshanWeather = await request({
+    url: '/nmc_api/rest/weather?stationid=dFIpc',
+    method: 'get'
+  }).then(res => res.data.real.weather)
+  const ningdeWeather = await request({
+    url: '/nmc_api/rest/weather?stationid=uKfig',
+    method: 'get'
+  }).then(res => res.data.real.weather)
+  return Promise.resolve([
+    {city: '嘉兴市', weather: `${jiaxinWeather.info} ${jiaxinWeather.temperature}℃`},
+    {city: '黄山市', weather: `${huangshanWeather.info} ${huangshanWeather.temperature}℃`},
+    {city: '宁德市', weather: `${ningdeWeather.info} ${ningdeWeather.temperature}℃`},
+  ])
+}

+ 46 - 32
src/components/Chart.vue

@@ -15,53 +15,67 @@ async function loadChart(option) {
     chart = echarts.init(chartRef.value);
   }
   chart.setOption(option, true);
+  setTimeout(() => chart.resize(), 1000)
 }
 
 function reloadChart() {
-  if (chart) {
-    chart.resize();
-  }
+  const checkAndResize = () => {
+    if (chart) {
+      chart.resize();
+    } else {
+      setTimeout(checkAndResize, 1000);
+    }
+  };
+  checkAndResize();
 }
 
 /* 轮播 */
 function carousel(timeout = 5000, yAxisChange = false) {
-  if (!chart) {
-    return
-  }
+  const checkAndCarousel = () => {
+    if (chart) {
+      // 获取legend的data
+      const legendData = chart.getOption().legend[0].data
+      // 首次总是从0开始的
+      let i = 0
+      // 开始轮播
+      timer = setInterval(() => {
+        // 激活
+        chart.dispatchAction({
+          type: 'legendToggleSelect',
+          name: legendData[++i % legendData.length]
+        })
+      }, 10000)
 
-  // 获取legend的data
-  const legendData = chart.getOption().legend[0].data
-  // 首次总是从0开始的
-  let i = 0
-  // 开始轮播
-  timer = setInterval(() => {
-    // 激活
-    chart.dispatchAction({
-      type: 'legendToggleSelect',
-      name: legendData[++i % legendData.length]
-    })
-  }, 10000)
+      if (yAxisChange) {
+        chart.on('legendselectchanged', function (params) {
+          let selected = undefined;
+          for (let key in params.selected) {
+            if (params.selected[key] === true) {
+              selected = key;
+              break
+            }
+          }
 
-  if (yAxisChange) {
-    chart.on('legendselectchanged', function (params) {
-      let selected = undefined;
-      for (let key in params.selected) {
-        if (params.selected[key] === true) {
-          selected = key;
-          break
-        }
+          let field = waterQualitys.find(i => i.label === selected)
+          if (field) {
+            chart.setOption({yAxis: {name: field.unit,}});
+          }
+        });
       }
-
-      let field = waterQualitys.find(i => i.label === selected)
-      if (field) {
-        chart.setOption({yAxis: {name: field.unit,}});
-      }
-    });
+    } else {
+      setTimeout(checkAndCarousel, 1000);
+    }
   }
+  checkAndCarousel();
 }
 
 onMounted(() => chartRef.value?.addEventListener("resize", reloadChart))
 onUnmounted(() => {
+  if (timer) {
+    clearInterval(timer)
+    timer = null
+  }
+
   chartRef.value?.removeEventListener("resize", reloadChart)
   if (chart && chart.dispose) {
     chart.dispose();

+ 0 - 1
src/components/UePlayer.vue

@@ -43,7 +43,6 @@ function emitUIInteraction(data) {
   if (!stream) {
     return
   }
-  console.log('-- 发送命令', JSON.stringify(data))
   stream.emitUIInteraction(data)
 }
 

+ 42 - 15
src/layout/components/Navbar.vue

@@ -1,8 +1,10 @@
 <script lang="ts" setup>
-import { computed, onMounted, ref, watch } from 'vue'
-import { jumpPage } from '@/utils'
-import { useRoute, useRouter } from 'vue-router'
-import { formatd } from '@/utils/ruoyi'
+import {computed, onMounted, onUnmounted, ref, watch} from 'vue'
+import {jumpPage} from '@/utils'
+import {useRoute, useRouter} from 'vue-router'
+import {formatd} from '@/utils/ruoyi'
+import {Setting} from "@/utils/tdInstruction";
+import {getWeather} from "@/api/weather";
 
 const route = useRoute()
 const router = useRouter()
@@ -12,21 +14,24 @@ let navbarTitleImage = ref(new URL('@/assets/images/layout/header-title3.png', i
 let menuLeftImage = ref(new URL('@/assets/images/layout/menu-left.png', import.meta.url).href)
 let menuRightImage = ref(new URL('@/assets/images/layout/menu-right.png', import.meta.url).href)
 const navbarBackgroundStyle = computed(() => {
-  return { 'background-image': `url(${navbarBackgroundImage})` }
+  return {'background-image': `url(${navbarBackgroundImage})`}
 })
 const showMenu = computed(() => route.path !== '/index')
 let leftMenu = [
-  { name: '总&nbsp;&nbsp;览', path: '/index', type: 'left', style: {} },
-  { name: '监测感知', path: '/situational/63304700', type: 'left', style: {} }
+  {name: '总&nbsp;&nbsp;览', path: '/index', type: 'left', style: {}},
+  {name: '监测感知', path: '/situational/63304700', type: 'left', style: {}}
 ]
 let rightMenu = [
-  { name: '智慧运维', path: '/intelloper/63304700', type: 'right', style: {} },
-  { name: '业务管理', path: '/index', type: 'right', style: {} }
+  {name: '智慧运维', path: '/intelloper/63304700', type: 'right', style: {}},
+  {name: '业务管理', path: '/index', type: 'right', style: {}}
 ]
 const date = ref('')
 const time = ref('')
+let tm = null
 const weather = ref('')
 const location = ref('')
+let weatherIndex = 0
+let weatherInterval = null
 
 function titleChange(path) {
   switch (path) {
@@ -42,25 +47,47 @@ function getDateTime() {
   const datetime = formatd(new Date(), 'yyyy-MM-dd hh:mm:ss')
   date.value = datetime.split(' ')[0]
   time.value = datetime.split(' ')[1]
+
+  if (tm !== time.value.substring(0, 5)) {
+    tm = time.value.substring(0, 5)
+    Setting.setTime(tm)
+  }
+
 }
 
-function getWeather() {
-  location.value = '嘉兴市'
-  weather.value = '晴 23℃'
+function getWeathers() {
+  getWeather().then(res => {
+    weatherInterval = setInterval(() => {
+      location.value = res[weatherIndex].city
+      weather.value = res[weatherIndex].weather
+      Setting.setWeather(res[weatherIndex].weather.split(' ')[0])
+
+      if (res.length - 1 === weatherIndex) {
+        weatherIndex = 0
+      } else {
+        weatherIndex++
+      }
+    }, 3000)
+  })
 }
 
-setInterval(getDateTime, 1000)
+const timeInterval = setInterval(getDateTime, 1000)
 watch(() => route.path, path => titleChange(path))
 
 onMounted(() => {
   titleChange(route.path)
-  getWeather()
+  getWeathers()
+})
+onUnmounted(() => {
+  clearInterval(timeInterval)
+  clearInterval(weatherInterval)
 })
+
 </script>
 
 <template>
   <div :style="navbarBackgroundStyle" class="navbar">
-    <img :src="navbarTitleImage" alt="" @click="jumpPage('/')" />
+    <img :src="navbarTitleImage" alt="" @click="jumpPage('/')"/>
     <div v-if="showMenu" class="menu-list">
       <div class="left-menu-list">
         <div v-for="item in  leftMenu" :key="item.name"

+ 2 - 0
src/utils/request.ts

@@ -17,6 +17,8 @@ service.interceptors.request.use(
   (config: any) => {
     if (
       !config.url.startsWith("/tbazmw_api") &&
+      !config.url.startsWith("/gx_api") &&
+      !config.url.startsWith("/nmc_api") &&
       !validURL(config.url)
     ) {
       config.url = process.env.BASE_API + config.url;

+ 1 - 1
src/utils/ruoyi.ts

@@ -49,7 +49,7 @@ export function parseTime(time: any, pattern: string) {
   return time_str;
 }
 
-export function formatd(date: Date, fmt: string): string {
+export function formatd(date: Date, fmt: string = 'yyyy-MM-dd'): string {
   const o: { [key: string]: number } = {
     "M+": date.getMonth() + 1, // 月份
     "d+": date.getDate(), // 日

+ 181 - 1
src/utils/station.ts

@@ -1,9 +1,11 @@
-export default [
+export const stations = [
   {
     stcd: '63304700',
     stnm: '太师桥',
     lgtd: '120.4941',
     lttd: '30.762836',
+    wrz: 4.19,
+    grz: 4.29,
     isExternalAddress: false,
     path: '',
     sttp: '水文站',
@@ -15,6 +17,8 @@ export default [
     stnm: '思源',
     lgtd: '120.522088',
     lttd: '30.841321',
+    wrz: 4.19,
+    grz: 4.29,
     isExternalAddress: false,
     path: '',
     sttp: '',
@@ -44,3 +48,179 @@ export default [
     img: ''
   },
 ]
+
+export const stationList = [
+  {
+    "stcd": "63304700",
+    "stnm": "太师桥",
+    "lgtd": "120.4941",
+    "lttd": "30.762836",
+    "wrz": 4.19,
+    "grz": 4.29,
+    "shuxing": "基本站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63304730",
+    "stnm": "文桥",
+    "lgtd": "120.465831",
+    "lttd": "30.800258",
+    "shuxing": "预警站",
+    "xzqh": "浙江湖州"
+  },
+  {
+    "stcd": "63205680",
+    "stnm": "双林桥",
+    "lgtd": "120.705375",
+    "lttd": "30.922552",
+    "shuxing": "预警站",
+    "xzqh": "江苏苏州"
+  },
+  {
+    "stcd": "63304650",
+    "stnm": "思源",
+    "lgtd": "120.522088",
+    "lttd": "30.841321",
+    "shuxing": "基本站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63205690",
+    "stnm": "太平桥",
+    "lgtd": "120.702609",
+    "lttd": "30.886256",
+    "shuxing": "预警站",
+    "xzqh": "江苏苏州"
+  },
+]
+
+export const stationMap2 = [
+  {
+    "stcd": "63304700",
+    "stnm": "太师桥",
+    "lgtd": "120.4941",
+    "lttd": "30.762836",
+    "wrz": 4.19,
+    "grz": 4.29,
+    "shuxing": "基本站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63304650",
+    "stnm": "思源",
+    "lgtd": "120.522088",
+    "lttd": "30.841321",
+    "shuxing": "基本站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "70112100",
+    "stnm": "罗桐埠",
+    "lgtd": "119.254444",
+    "lttd": "29.476389",
+    "shuxing": "基本站",
+    "xzqh": "浙江杭州"
+  },
+  {
+    "stcd": "70111400",
+    "stnm": "街口",
+    "lgtd": "118.71691",
+    "lttd": "29.72391",
+    "shuxing": "基本站",
+    "xzqh": "浙江杭州"
+  },
+  {
+    "stcd": "63301700",
+    "stnm": "北虹大桥",
+    "lgtd": "120.709747",
+    "lttd": "30.885936",
+    "shuxing": "基本站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63304730",
+    "stnm": "文桥",
+    "lgtd": "120.465831",
+    "lttd": "30.800258",
+    "shuxing": "预警站",
+    "xzqh": "浙江湖州"
+  },
+  {
+    "stcd": "63305451",
+    "stnm": "圣塘桥",
+    "lgtd": "120.589144",
+    "lttd": "30.838792",
+    "shuxing": "预警站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63205690",
+    "stnm": "太平桥",
+    "lgtd": "120.702609",
+    "lttd": "30.886256",
+    "shuxing": "预警站",
+    "xzqh": "江苏苏州"
+  },
+  {
+    "stcd": "63205680",
+    "stnm": "双林桥",
+    "lgtd": "120.705375",
+    "lttd": "30.922552",
+    "shuxing": "预警站",
+    "xzqh": "江苏苏州"
+  },
+  {
+    "stcd": "63205670",
+    "stnm": "章湾圩公路桥",
+    "lgtd": "120.756256",
+    "lttd": "30.978642",
+    "shuxing": "预警站",
+    "xzqh": "江苏苏州"
+  },
+  {
+    "stcd": "63313001",
+    "stnm": "梅台港桥",
+    "lgtd": "120.774598",
+    "lttd": "30.99626",
+    "shuxing": "预警站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63312411",
+    "stnm": "陶庄枢纽",
+    "lgtd": "120.829083",
+    "lttd": "31.002328",
+    "shuxing": "预警站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63312340",
+    "stnm": "大舜枢纽",
+    "lgtd": "120.906514",
+    "lttd": "31.017386",
+    "shuxing": "预警站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "63312300",
+    "stnm": "丁栅闸",
+    "lgtd": "120.9528",
+    "lttd": "31.018267",
+    "shuxing": "预警站",
+    "xzqh": "浙江嘉兴"
+  },
+  {
+    "stcd": "71501010",
+    "stnm": "托溪水文站",
+    "lgtd": "119.354764",
+    "lttd": "27.491128",
+    "shuxing": null,
+    "xzqh": "福建宁德"
+  },
+  {
+    "stcd": "71111530",
+    "stnm": "马蹄岙电站",
+    "lgtd": "118.91861",
+    "lttd": "27.61917"
+  }
+]

+ 5 - 0
src/utils/tdInstruction/index.ts

@@ -0,0 +1,5 @@
+import * as Setting from "./setting";
+import * as View from "./view";
+import * as Layer from "./layer";
+
+export {Setting, Layer, View};

+ 29 - 0
src/utils/tdInstruction/layer.ts

@@ -0,0 +1,29 @@
+const blueColor = "0,0.958507,1,1";
+const redColor = "0.583333,0.037082,0,1";
+const yellowColor = "0,0.583333,0.021181,1";
+
+
+/**
+ * 降雨颜色
+ * @param {*} val
+ * @returns
+ */
+export function getColorByWaterQuality(val: number) {
+  if (!val) {
+    return "1,1,1";
+  }
+  switch (val) {
+    case 1:
+      return "0,0.894330,1,1";
+    case 2:
+      return "0.362375,1,0.276435,1";
+    case 3:
+      return "0,0.583333,0.021181,1";
+    case 4:
+      return "0.583333,0.037082,0,1";
+    case 5:
+      return "0,0.583333,0.021181,1";
+    default:
+      return "";
+  }
+}

+ 72 - 0
src/utils/tdInstruction/setting.ts

@@ -0,0 +1,72 @@
+import Bus from "@/utils/bus";
+
+/**
+ * 设置分辨率
+ * @param {x, y} d
+ */
+export function setResolution(d: any) {
+  let data = "null";
+  if (d) {
+    data = `${d.x}x${d.y}`;
+  }
+
+  let descriptor = {
+    Category: "GetSize",
+    Data: data,
+  };
+  Bus.emit('emitUIInteraction', descriptor)
+  console.log("-- 设置分辨率", JSON.stringify(descriptor));
+}
+
+/**
+ * 设置时间
+ * @param time 时间
+ */
+export function setTime(time: string) {
+  let descriptor = {
+    "command": "SetTime",
+    "data": {
+      "time": time
+    }
+  }
+  Bus.emit('emitUIInteraction', descriptor)
+  console.log("-- 设置时间", JSON.stringify(descriptor));
+}
+
+const weatherMap = new Map()
+weatherMap.set("晴", "Sunny")
+weatherMap.set("多云", "Cloudy")
+weatherMap.set("部分多云", "PartlyCloudy")
+weatherMap.set("阴天", "Overcast")
+weatherMap.set("小雨", "LightRain")
+weatherMap.set("中雨", "ModerateRain")
+weatherMap.set("大雨", "HeavyRain")
+weatherMap.set("小雪", "LightSnow")
+weatherMap.set("中雪", "ModerateSnow")
+weatherMap.set("大雪", "HeavySnow")
+weatherMap.set("大雾", "Foggy")
+weatherMap.set("沙尘", "Sand")
+weatherMap.set("霾", "Haze")
+
+/**
+ * 设置天气
+ * Sunny、Cloudy、PartlyCloudy、Overcast、LightRain、ModerateRain、HeavyRain、LightSnow、ModerateSnow、HeavySnow、Foggy、Sand、Haze
+ * 晴、多云、部分多云、阴天、小雨、中雨、大雨、小雪、中雪、大雪、大雾、沙尘、霾
+ * @param weather 天气
+ */
+export function setWeather(weather = "晴") {
+  let wr = "Sunny"
+  if (weatherMap.has(weather)) {
+    wr = weatherMap.get(weather) || "Sunny"
+  }
+
+  let descriptor = {
+    "command": "SetWeather",
+    "data": {
+      "weather": wr
+    }
+  }
+  Bus.emit('emitUIInteraction', descriptor)
+  console.log("-- 设置天气", JSON.stringify(descriptor));
+}
+

+ 16 - 0
src/utils/tdInstruction/view.ts

@@ -0,0 +1,16 @@
+import Bus from "@/utils/bus";
+
+/**
+ * 测站远近跳转
+ * @param {*} type 远、近
+ */
+export function changeView(type = "远") {
+  let descriptor = {
+    "command": "SetView",
+    "data": {
+      "tag": type
+    }
+  };
+  Bus.emit('emitUIInteraction', descriptor)
+  console.log("-- 测站远近视角切换", JSON.stringify(descriptor));
+}

+ 1 - 4
src/views/Detail.vue

@@ -3,10 +3,7 @@ import {onMounted, reactive, ref} from "vue";
 import {useRoute} from 'vue-router';
 import RightFrame from "@/components/RightFrame.vue";
 import Card01 from "@/components/card/Card01.vue";
-import stations from "@/utils/station";
-import StripeTable from "@/components/StripeTable.vue";
-import ColorTag from "@/components/tag/ColorTag.vue";
-import ImageTag from "@/components/tag/ImageTag.vue";
+import {stations} from "@/utils/station";
 
 const route = useRoute()
 let dibaImage = ref(new URL('@/assets/images/dike.png', import.meta.url).href)

+ 2 - 2
src/views/Home.vue

@@ -7,8 +7,8 @@ import Chart from '@/components/chart.vue'
 import StripeTable from '@/components/StripeTable.vue'
 import { getRStLLMaxDate } from '@/api/home'
 import bus from '@/utils/bus'
-import stations from '@/utils/station'
-import { jumpPage } from '@/utils'
+import {stations} from '@/utils/station'
+import {jumpPage} from '@/utils'
 import { copyObj } from '@/utils/ruoyi'
 
 const zmwjianjie = new URL('@/assets/images/zmw_jieshao.jpg', import.meta.url).href

+ 1 - 1
src/views/IntellOper.vue

@@ -3,7 +3,7 @@ import { onMounted, reactive, ref } from 'vue'
 import { useRoute } from 'vue-router'
 import RightFrame from '@/components/RightFrame.vue'
 import Card01 from '@/components/card/Card01.vue'
-import stations from '@/utils/station'
+import {stations} from '@/utils/station'
 import StripeTable from '@/components/StripeTable.vue'
 import ColorTag from '@/components/tag/ColorTag.vue'
 import ImageTag from '@/components/tag/ImageTag.vue'

+ 252 - 130
src/views/Situational.vue

@@ -1,41 +1,73 @@
 <script lang="ts" setup>
-import { onMounted, reactive, ref } from 'vue'
-import { useRoute } from 'vue-router'
+import {onMounted, reactive, ref} from 'vue'
+import {useRoute} from 'vue-router'
 import RightFrame from '@/components/RightFrame.vue'
 import Card01 from '@/components/card/Card01.vue'
-import stations from '@/utils/station'
-import StripeTable from '@/components/StripeTable.vue'
+import {stationList, stations} from '@/utils/station'
 import ColorTag from '@/components/tag/ColorTag.vue'
-import ImageTag from '@/components/tag/ImageTag.vue'
 import Chart from '@/components/Chart.vue'
 import DataTag from '@/components/tag/DataTag.vue'
+import {
+  getRainfallListOfPageByStcd,
+  getWaterLevelAndFlowLatest,
+  getWaterLevelAndFlowListOfPageByStcd,
+  getWaterQualityLatest,
+  getWaterQualityListOfPageByStcd
+} from "@/api/gx";
+import {formatd} from "@/utils/ruoyi";
+import {filterWaterQualitys} from "@/utils/unit";
+import {Setting, View} from "@/utils/tdInstruction";
 
 const route = useRoute()
-let dibaImage = (new URL('@/assets/images/dike.png', import.meta.url).href)
-const jiankong = new URL('@/assets/images/tmp/jiankong.png', import.meta.url).href
+const dibaImage = (new URL('@/assets/images/dike.png', import.meta.url).href)
+const homeSrc = ref(new URL('@/assets/images/home.png', import.meta.url).href)
+const weatherSrc = ref(new URL('@/assets/images/weather.png', import.meta.url).href)
+const flagSrc = ref(new URL('@/assets/images/flag.png', import.meta.url).href)
+const walkSrc = ref(new URL('@/assets/images/walk.png', import.meta.url).href)
+const cultureSrc = ref(new URL('@/assets/images/culture.png', import.meta.url).href)
 
+const left2Ref = ref(null)
+const left3Ref = ref(null)
+const right1Ref = ref(null)
+const right3Ref = ref(null)
+const wqData = ref({d1: '6', d2: '22.3', d3: '5', d4: '20', d5: '6', d6: '22.3', d7: '5', d8: '20'})
+const station = ref(getStation(route.params.stcd))
+const wlData = reactive({
+  ss: '0',
+  zg: '0',
+  zd: '0',
+  bz: station.value.grz ? station.value.grz + '' : '0',
+  jj: station.value.wrz ? station.value.wrz + '' : '0'
+})
 
 function getStation(stcd) {
   return stations.find(item => item.stcd === stcd)
 }
 
-function reloadRight1() {
+async function reloadLeft2() {
+  const sevenDayAgo = new Date(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
+  const flowData = await getWaterLevelAndFlowListOfPageByStcd({
+    stcd: route.params.stcd,
+    startTime: formatd(sevenDayAgo),
+    endTime: formatd(new Date())
+  }).then(res => {
+    return res.rows
+  })
   const option = {
     // backgroundColor: "#0B2D55",
     tooltip: {
-      axisPointer: {
-        type: 'cross'
-      }
+      trigger: 'axis',
     },
     grid: {
       top: '14%',
       left: '2%',
       right: '4%',
-      bottom: '5%',
+      bottom: '2%',
       containLabel: true
     },
     xAxis: [{
       type: 'category',
+      boundaryGap: false,
       axisLine: { // 坐标轴轴线相关设置。数学上的x轴
         show: true,
         lineStyle: {
@@ -45,18 +77,17 @@ function reloadRight1() {
       axisLabel: { // 坐标轴刻度标签的相关设置
         color: '#02cacf'
       },
-      axisTick: { show: false },
-      data: ['10-31', '11-1', '11-2', '11-3', '11-4']
+      axisTick: {show: false},
+      data: flowData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
     }],
     yAxis: [{
-      name: 'mm',
+      name: 'm³/s',
       nameTextStyle: {
         color: '#02cacf'
       },
-      min: value => (value.min - 1).toFixed(0),
-      max: value => (value.max + 1).toFixed(0),
+      min: value => (value.min - 10).toFixed(0),
+      max: value => (value.max + 10).toFixed(0),
       axisLabel: {
-        margin: 20,
         color: '#02cacf'
       },
       splitLine: {
@@ -70,26 +101,37 @@ function reloadRight1() {
       }
     }],
     series: [{
-      name: '雨量',
-      type: 'bar',
-      itemStyle: {
+      name: '流量',
+      type: 'line',
+      areaStyle: {},
+      smooth: true, //是否平滑曲线显示
+      lineStyle: {
         color: '#3deaff'
       },
-      shading: 'color',
-      data: [5, 2, 0.5, 12, 22.6]
+      // barWidth: 18,
+      // label: {
+      //   show: true,
+      //   position: 'top'
+      // },
+      data: flowData.map(item => item.q)
     }
     ]
   }
-  right1Ref.value.loadChart(option)
+  left2Ref.value.loadChart(option)
 }
 
-function reloadRight3() {
+async function reloadLeft3() {
+  const stcds = stationList.map(s => s.stcd).join(',')
+  const waterData = await getWaterLevelAndFlowLatest({stcds}).then(res => res.data)
+  const seriesData = stationList.map(s => {
+    const data = waterData.find(d => d.stcd === s.stcd)
+    return data ? data.z : 0
+  })
+
   const option = {
     // backgroundColor: "#0B2D55",
     tooltip: {
-      axisPointer: {
-        type: 'cross'
-      }
+      trigger: 'axis',
     },
     grid: {
       top: '14%',
@@ -100,7 +142,6 @@ function reloadRight3() {
     },
     xAxis: [{
       type: 'category',
-      boundaryGap: false,
       axisLine: { // 坐标轴轴线相关设置。数学上的x轴
         show: true,
         lineStyle: {
@@ -110,11 +151,11 @@ function reloadRight3() {
       axisLabel: { // 坐标轴刻度标签的相关设置
         color: '#02cacf'
       },
-      axisTick: { show: false },
+      axisTick: {show: false},
       data: ['太师桥', '文桥', '双林桥', '思源', '太平桥']
     }],
     yAxis: [{
-      name: '',
+      name: 'm',
       nameTextStyle: {
         color: '#02cacf'
       },
@@ -135,37 +176,46 @@ function reloadRight3() {
       }
     }],
     series: [{
-      name: '水质分析',
-      type: 'line',
-      smooth: true, //是否平滑曲线显示
-      lineStyle: {
+      name: '水位',
+      type: 'bar',
+      itemStyle: {
         color: '#3deaff'
       },
-      data: [23.1, 22.7, 22.9, 23, 22.6]
-    }
-    ]
+      barWidth: 18,
+      label: {
+        show: true,
+        position: 'top'
+      },
+      data: seriesData
+    }]
   }
-  right3Ref.value.loadChart(option)
+  left3Ref.value.loadChart(option)
 }
 
-function reloadLeft2() {
+async function reloadRight1() {
+  const sevenDayAgo = new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
+  const rainfallData = await getRainfallListOfPageByStcd({
+    stcd: route.params.stcd,
+    startTime: formatd(sevenDayAgo),
+    endTime: formatd(new Date())
+  }).then(res => {
+    return res.rows
+  })
+
   const option = {
     // backgroundColor: "#0B2D55",
     tooltip: {
-      axisPointer: {
-        type: 'cross'
-      }
+      trigger: 'axis',
     },
     grid: {
       top: '14%',
       left: '2%',
-      right: '7%',
-      bottom: '5%',
+      right: '4%',
+      bottom: '0%',
       containLabel: true
     },
     xAxis: [{
       type: 'category',
-      boundaryGap: false,
       axisLine: { // 坐标轴轴线相关设置。数学上的x轴
         show: true,
         lineStyle: {
@@ -175,18 +225,18 @@ function reloadLeft2() {
       axisLabel: { // 坐标轴刻度标签的相关设置
         color: '#02cacf'
       },
-      axisTick: { show: false },
-      data: ['11-5 9:00', '11-5 9:05', '11-5 9:10', '11-5 9:15', '11-5 9:20', '11-5 9:25', '11-5 9:30']
+      axisTick: {show: false},
+      data: rainfallData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
     }],
     yAxis: [{
-      name: 'm³/s',
+      name: 'mm',
       nameTextStyle: {
         color: '#02cacf'
       },
-      min: value => (2 * value.max - value.min).toFixed(0),
-      max: value => (2 * value.min - value.max).toFixed(0),
+      min: value => (value.min).toFixed(0),
+      max: value => (value.max).toFixed(0),
       axisLabel: {
-        margin: 10,
+        margin: 20,
         color: '#02cacf'
       },
       splitLine: {
@@ -200,42 +250,57 @@ function reloadLeft2() {
       }
     }],
     series: [{
-      name: '流量',
-      type: 'line',
-      areaStyle: {},
-      smooth: true, //是否平滑曲线显示
-      lineStyle: {
+      name: '雨量',
+      type: 'bar',
+      itemStyle: {
         color: '#3deaff'
       },
-      barWidth: 18,
-      label: {
-        show: true,
-        position: 'top'
-      },
-      data: [101, 127, 139, 123, 123, 118, 116]
+      shading: 'color',
+      data: rainfallData.map(item => item.drp)
     }
     ]
   }
-  left2Ref.value.loadChart(option)
+  right1Ref.value.loadChart(option)
 }
 
-function reloadLeft3() {
+async function reloadRight3() {
+  const sevenDayAgo = new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
+  const list = await getWaterQualityListOfPageByStcd({
+    stcd: route.params.stcd,
+    startTime: formatd(sevenDayAgo),
+    endTime: formatd(new Date())
+  }).then(res => res.rows)
+
+  // 1. 获取参数列表
+  const params = filterWaterQualitys(['WT', 'PH', 'COND', 'TURB', 'REDOX', 'CODMN', 'TN', 'NH3N', 'TP', 'DOX'])
   const option = {
-    // backgroundColor: "#0B2D55",
+    animationDuration: 3000,
+    legend: {
+      type: 'scroll',
+      pageIconColor: '#fff',
+      pageTextStyle: {
+        color: '#fff',
+      },
+      textStyle: {
+        color: '#fff'
+      },
+      icon: "stack",
+      selectedMode: "single",
+      data: params.map(i => i.label),
+    },
     tooltip: {
-      axisPointer: {
-        type: 'cross'
-      }
+      trigger: 'axis',
     },
     grid: {
-      top: '14%',
-      left: '2%',
+      top: '25%',
+      left: '4%',
       right: '4%',
-      bottom: '5%',
+      bottom: '0%',
       containLabel: true
     },
     xAxis: [{
       type: 'category',
+      boundaryGap: false,
       axisLine: { // 坐标轴轴线相关设置。数学上的x轴
         show: true,
         lineStyle: {
@@ -245,18 +310,17 @@ function reloadLeft3() {
       axisLabel: { // 坐标轴刻度标签的相关设置
         color: '#02cacf'
       },
-      axisTick: { show: false },
-      data: ['太师桥', '文桥', '双林桥', '思源', '太平桥']
+      axisTick: {show: false},
+      data: list.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')
     }],
     yAxis: [{
-      name: 'm',
+      name: '',
       nameTextStyle: {
         color: '#02cacf'
       },
       min: value => (value.min - 1).toFixed(0),
       max: value => (value.max + 1).toFixed(0),
       axisLabel: {
-        margin: 20,
         color: '#02cacf'
       },
       splitLine: {
@@ -269,64 +333,63 @@ function reloadLeft3() {
         show: true
       }
     }],
-    series: [{
-      name: '水位',
-      type: 'bar',
-      itemStyle: {
-        color: '#3deaff'
-      },
-      barWidth: 18,
-      label: {
-        show: true,
-        position: 'top'
-      },
-      data: [2.1, 2.7, 3.9, 2.3, 2.3]
-    }
-    ]
+    series: params.map(i => {
+      return {
+        name: i.label,
+        data: list.map(e => e[i.key.toLowerCase()]),
+        type: "line",
+        smooth: true, //是否平滑曲线显示
+        // lineStyle: {
+        //   color: '#3deaff'
+        // },
+      }
+    }),
   }
-  left3Ref.value.loadChart(option)
+  right3Ref.value.loadChart(option)
+  right3Ref.value.carousel(1000, true)
 }
 
-const station = ref(getStation(route.params.stcd))
-const introduces = ref(station.value.detail?.split('\n'))
-const introduceImg = new URL(station.value.img, import.meta.url).href
-
-const deviceInfoColumns = [
-  { label: '设备名称', prop: 'name' },
-  { label: '设备位置', prop: 'loc', width: '110' },
-  { label: '设备状态', prop: 'status', width: '110' }
-]
-
-const deviceInfoData = [
-  { name: '总磷分析仪', loc: '100米', status: '正常' },
-  { name: '总氮分析仪', loc: '100米', status: '正常' },
-  { name: '水位计', loc: '100米', status: '正常' },
-  { name: '氢氮分析仪', loc: '100米', status: '正常' }
-]
-
-const wqData = ref([])
-const wlData = reactive({ ss: '3.80', zg: '4.65', zd: '4.65', bz: '4.65', jj: '4.65' })
-const right1Ref = ref(null)
-const right3Ref = ref(null)
-const left2Ref = ref(null)
-const left3Ref = ref(null)
+/**
+ * 获取实时水位数据
+ */
+function getCharacteristicLevel() {
+  getWaterLevelAndFlowLatest({stcds: route.params.stcd}).then(res => {
+    const data = res.data[0]
+    wlData.ss = data.z + ''
+  })
+}
 
-const homeSrc = ref(new URL('@/assets/images/home.png', import.meta.url).href)
-const weatherSrc = ref(new URL('@/assets/images/weather.png', import.meta.url).href)
-const flagSrc = ref(new URL('@/assets/images/flag.png', import.meta.url).href)
-const walkSrc = ref(new URL('@/assets/images/walk.png', import.meta.url).href)
-const cultureSrc = ref(new URL('@/assets/images/culture.png', import.meta.url).href)
+/**
+ * 获取最新水质数据
+ */
+function getLatestWaterQuality() {
+  getWaterQualityLatest({stcds: route.params.stcd}).then(res => {
+    const data = res.data[0]
+    wqData.value = {
+      d1: data.ph,
+      d2: data.dox,
+      d3: data.chla,
+      d4: data.turb,
+      d5: data.wt,
+      d6: data.cond,
+      d7: data.tn,
+      d8: data.tp
+    }
+  })
+}
 
 onMounted(() => {
-  wqData.value = { d1: '6', d2: '22.3', d3: '5', d4: '20', d5: '6', d6: '22.3', d7: '5', d8: '20' }
   reloadRight1()
   reloadRight3()
   reloadLeft2()
   reloadLeft3()
 
+  // 获取实时水位
+  getCharacteristicLevel()
+  // 获取最新水质数据
+  getLatestWaterQuality()
 })
 </script>
-
 <template>
   <right-frame>
     <template #leftModule>
@@ -334,13 +397,13 @@ onMounted(() => {
         <el-row :gutter="10" justify="space-around" style="height: 100%;">
           <el-col :span="16" style="height: 66%;margin-bottom: 1%;position: relative;">
             <div class="difang-water-level">
-              <span class="difang-water-level-value">3.8m</span>
+              <span class="difang-water-level-value">{{ wlData.ss }}m</span>
             </div>
-            <img :src="dibaImage" alt="" class="difang-image" />
+            <img :src="dibaImage" alt="" class="difang-image"/>
           </el-col>
           <el-col :span="8"
                   style="height: 66%;margin-bottom: 1%;display: flex;flex-direction: column;justify-content: space-between;">
-            <color-tag :value="wlData.jj" label="实时水位" style="height: 48%;" unit="m"></color-tag>
+            <color-tag :value="wlData.ss" label="实时水位" style="height: 48%;" unit="m"></color-tag>
             <color-tag :value="wlData.zg" label="历史最高水位" style="height: 48%;" unit="m"></color-tag>
           </el-col>
           <el-col :span="8" style="height: 33%;">
@@ -381,12 +444,28 @@ onMounted(() => {
       </card01>
     </template>
     <template #btnGroup>
-      <div style="display: flex;flex-direction: column;">
-        <div><img :src="homeSrc"></div>
-        <div><img :src="weatherSrc"></div>
-        <div><img :src="flagSrc"></div>
-        <div><img :src="walkSrc"></div>
-        <div><img :src="cultureSrc"></div>
+      <div class="right-btn-container">
+        <div class="right-btn-item"><img :src="homeSrc"></div>
+        <div class="right-btn-item">
+          <img :src="weatherSrc">
+          <div class="right-btn-option-list">
+            <div class="right-btn-option" @click="Setting.setWeather('晴')">晴</div>
+            <div class="right-btn-option" @click="Setting.setWeather('多云')">多云</div>
+            <div class="right-btn-option" @click="Setting.setWeather('阴天')">阴天</div>
+            <div class="right-btn-option" @click="Setting.setWeather('小雨')">小雨</div>
+            <div class="right-btn-option" @click="Setting.setWeather('中雨')">中雨</div>
+            <div class="right-btn-option" @click="Setting.setWeather('大雨')">大雨</div>
+          </div>
+        </div>
+        <div class="right-btn-item"><img :src="flagSrc"></div>
+        <div class="right-btn-item">
+          <img :src="walkSrc">
+          <div class="right-btn-option-list">
+            <div class="right-btn-option" @click="View.changeView('远')">远</div>
+            <div class="right-btn-option" @click="View.changeView('近')">近</div>
+          </div>
+        </div>
+        <div class="right-btn-item"><img :src="cultureSrc"></div>
       </div>
     </template>
   </right-frame>
@@ -416,4 +495,47 @@ onMounted(() => {
   width: 100%;
   height: 100%;
 }
+
+.right-btn-container {
+  display: flex;
+  flex-direction: column;
+
+  .right-btn-item {
+    cursor: pointer;
+    position: relative;
+
+    &:hover, &.active {
+
+      img {
+        background-color: rgba(16, 136, 215, 0.6);
+        border-radius: 8px;
+      }
+
+      > .right-btn-option-list {
+        display: block;
+      }
+
+    }
+
+    .right-btn-option-list {
+      display: none;
+      position: absolute;
+      top: 0;
+      right: 1.8rem;
+      width: 140px;
+      padding: 0 20px;
+    }
+
+    .right-btn-option {
+      padding: 10px;
+      margin-bottom: 10px;
+      border-radius: 4px;
+      background-color: #394139;
+      text-align: center;
+      color: #fff;
+      box-sizing: border-box;
+    }
+
+  }
+}
 </style>

+ 1 - 1
src/views/Station.vue

@@ -3,7 +3,7 @@ import {onMounted, reactive, ref} from "vue";
 import {useRoute} from 'vue-router';
 import RightFrame from "@/components/RightFrame.vue";
 import Card01 from "@/components/card/Card01.vue";
-import stations from "@/utils/station";
+import {stations} from "@/utils/station";
 import StripeTable from "@/components/StripeTable.vue";
 import ColorTag from "@/components/tag/ColorTag.vue";
 import ImageTag from "@/components/tag/ImageTag.vue";

+ 12 - 0
vite.config.ts

@@ -26,6 +26,18 @@ export default defineConfig({
         changeOrigin: true,
         rewrite: path => path.replace(/^\/tbazmw_api/, '')
       },
+      '/gx_api': {
+        // 共享平台
+        target: 'http://10.8.4.136:8881/api/sz/tba-gx/',
+        changeOrigin: true,
+        rewrite: path => path.replace(/^\/gx_api/, '')
+      },
+      '/nmc_api': {
+        // 共享平台
+        target: 'http://www.nmc.cn/',
+        changeOrigin: true,
+        rewrite: path => path.replace(/^\/nmc_api/, '')
+      },
     }
   },
   plugins: [