diff --git a/config/dev.env.js b/config/dev.env.js index 1a0b9c7..f9fae85 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -17,8 +17,6 @@ module.exports = merge(prodEnv, { // VUE_APP_API_URL: '"http://10.10.150.237/"' VUE_APP_BASE_API: '"/api"', - /** 仅参航科学家报表;与生产一致直连 https(服务端 CORS 已放开,避免本地代理 404) */ - VUE_APP_UNIT_MEMBER_REPORT_BASE: '"https://weixin.bdsmart.cn/ds1"', // VUE_APP_BASE_APIURL: '"http://ds2.hzzxq.com/api2"', VUE_APP_BASE_APIURL: '"http://test.gopmas.com/ds"', VUE_APP_FULL_API: '"http://10.10.151.5:5555"', diff --git a/config/index.js b/config/index.js index a184996..38f603c 100644 --- a/config/index.js +++ b/config/index.js @@ -11,12 +11,12 @@ module.exports = { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', - proxyTable: { - /** - * 参航科学家接口单独转发到 weixin(须写在通用 /api 之前,避免被旧后端吞掉)。 - * 与 unitMember 使用 /ds1-report-proxy 或 /api 时的兜底一致。 - */ - '/api/report/unit/member.htm': { + /** + * 使用数组保证匹配顺序:必须先于通配 `/api`,否则 unit 会落到 gopmas 导致 404。 + */ + proxyTable: [ + { + context: '/api/report/unit/member.htm', target: 'https://weixin.bdsmart.cn', changeOrigin: true, secure: true, @@ -24,30 +24,43 @@ module.exports = { '^/api': '/ds1' } }, - '/api': { - // target: 'http://120.48.105.88', // 线上 - // target: 'http://10.0.90.70', // 测试环境 - // target: 'http://1.95.42.191:8080', // 测试环境 - // target: 'http://ds2.hzzxq.com/api2', // 测试环境 - target: 'http://test.gopmas.com/ds', // 测试环境 - changeOrigin: true, // 是否跨域 - secure: false, // 是否使用https + { + context: '/api/report/unit/total.htm', + target: 'https://weixin.bdsmart.cn', + changeOrigin: true, + secure: true, pathRewrite: { - '^/api': '' // 线上 - // '^/service': '/service' //线上 + '^/api': '/ds1' } }, - '/geoserver': { - // target: 'http://120.48.105.88', // 线上 - target: 'http://124.222.8.13:9801', // 测试环境 - changeOrigin: true, // 是否跨域 - secure: false, // 是否使用https + { + context: '/api/report/ship/total.htm', + target: 'https://weixin.bdsmart.cn', + changeOrigin: true, + secure: true, pathRewrite: { - '^/geoserver': '/geoserver' // 线上 - // '^/service': '/service' //线上 + '^/api': '/ds1' + } + }, + { + context: '/api', + target: 'http://test.gopmas.com/ds', // 测试环境 + changeOrigin: true, + secure: false, + pathRewrite: { + '^/api': '' + } + }, + { + context: '/geoserver', + target: 'http://124.222.8.13:9801', // 测试环境 + changeOrigin: true, + secure: false, + pathRewrite: { + '^/geoserver': '/geoserver' } } - }, + ], // Various Dev Server settings host: 'localhost', // can be overwritten by process.env.HOST diff --git a/config/prod.env.js b/config/prod.env.js index 6d17b34..d718604 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -16,8 +16,6 @@ module.exports = { // VUE_APP_BASE_API: '"/api"', // VUE_APP_BASE_APIURL: '"http://ds.hzzxq.com/api"', VUE_APP_BASE_API: '"./"', - /** 仅参航科学家报表 report/unit/member.htm 使用,与全局 VUE_APP_BASE_API 解耦 */ - VUE_APP_UNIT_MEMBER_REPORT_BASE: '"https://weixin.bdsmart.cn/ds1"', VUE_APP_BASE_APIURL: '"./"', VUE_APP_FULL_API: '"http://10.10.151.3:5555"', VUE_APP_BASE_API_FRONT: '"http://10.10.150.128:8080/satellitePub/pub/index.html"', diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..21ab048 Binary files /dev/null and b/dist.zip differ diff --git a/src/api/statistics.js b/src/api/statistics.js index 25df2a6..0a404b4 100644 --- a/src/api/statistics.js +++ b/src/api/statistics.js @@ -10,6 +10,20 @@ export function reportList(data) { }) } +/** + * 按平台类型查询平台名称列表(统计页 banner 下拉)。 + * 对应 `GET /report/platform/name.htm?platform_type=...` + * @param {string} [platformType='水下自主式无人潜器'] 与后端 platform_type 一致 + * @returns {Promise} + */ +export function platformNameList(platformType = '水下自主式无人潜器') { + return request({ + url: '/report/platform/name.htm', + method: 'get', + params: { platform_type: platformType } + }) +} + // 科考船汇总统计属性 export function shipTotal(data) { return request({ @@ -166,47 +180,31 @@ export function platformRov(data) { }) } -/** - * ds1 报表独立域名(参航科学家/单位汇总等),与全局 VUE_APP_BASE_API 解耦。 - * @returns {string} - */ -function getDs1ReportBase() { - return ( - process.env.VUE_APP_UNIT_MEMBER_REPORT_BASE || - 'https://weixin.bdsmart.cn/ds1' - ) -} - /** * 单位维度参航科学家明细(按科学家汇总)。 + * 路径与其它报表一致:`/report/unit/member.htm`,随 `VUE_APP_BASE_API`(生产 `./`)解析。 * @param {Object} data 请求体,需包含 unit(单位标识) * @returns {Promise} */ export function unitMember(data) { return request({ - baseURL: getDs1ReportBase(), url: '/report/unit/member.htm', method: 'post', type: 'application/x-www-form-urlencoded', - /** 跨域且服务端返回 Access-Control-Allow-Origin: * 时不可带 cookie,否则浏览器会拦截 */ - withCredentials: false, data }) } /** * 单位维度汇总统计(按单位一行,含航次、天数、人数、深潜等)。 - * 与 unitMember 共用 ds1 baseURL。 * @param {Object} [data] 可选 unit 等筛选参数;空对象表示全部单位 * @returns {Promise} */ export function unitTotal(data = {}) { return request({ - baseURL: getDs1ReportBase(), url: '/report/unit/total.htm', method: 'post', type: 'application/x-www-form-urlencoded', - withCredentials: false, data }) } diff --git a/src/views/dataSearch.vue b/src/views/dataSearch.vue index 8d5231e..a97ac8b 100644 --- a/src/views/dataSearch.vue +++ b/src/views/dataSearch.vue @@ -32,7 +32,7 @@

{{ item.dataset_name }} {{ item.file_total }}

+ class="mileage sample-file-total">{{ item.file_total }}

{{ item.create_time }}