提交 5be070b1 作者: test

Merge branch 'dev_csd' of https://gitlab.yiring.com/hntq/hntq-v5 into dev_fzm

# API 接口地址 # API 接口地址
VITE_GLOB_API_URL=http://qks.straw.yiring.com:40051/tbm/api VITE_GLOB_API_URL=http://qks.straw.yiring.com:40051/tbm
# API 接口地址前缀 # API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/api VITE_GLOB_API_URL_PREFIX=/api
......
import { otherHttp } from '/@/utils/http/axios'
// import { ContentTypeEnum } from '/@/enums/httpEnum'
enum monitorApi {
getWindList = '/live/wind/getWindList', // 查询大风数据
}
/**
* @description: 查询大风数据
*/
export function getWindList(params) {
return otherHttp.get({
url: monitorApi.getWindList,
params,
})
}
/** /**
* TODO: 色块图例配置,实际上应该和后端的色斑图,进行动态匹配,可以考虑由后端接口返回 * TODO: 色块图例配置,实际上应该和后端的色斑图,进行动态匹配,可以考虑由后端接口返回
*/ */
import { cloneDeep } from 'lodash-es'
/** /**
* 小时气温图例配置 * 小时气温图例配置
...@@ -152,3 +153,62 @@ export const windtableData = [ ...@@ -152,3 +153,62 @@ export const windtableData = [
'15~17级': '0站', '15~17级': '0站',
}, },
] ]
export function buildQueryParams(unBuildParams, config?) {
// const params = unBuildParams
// for (const key in params) {
// if (isRef(params[key])) {
// params[key] = unref(params[key])
// }
// if (isReactive(params[key])) {
// params[key] = toRaw(params[key])
// }
// }
const queryParams = cloneDeep(toRaw(unBuildParams))
if (config?.isSpot) {
delete queryParams.numericalBegin
delete queryParams.numericalEnd
delete queryParams.symbolBegin
delete queryParams.symbolEnd
}
if (config?.isFirstQuery) {
delete queryParams.startTime
delete queryParams.endTime
}
return queryParams
}
export function createSplotLayer(type: String) {
return {
id: `${type}-splot`,
type: 'fill',
source: `${type}-splot`,
paint: {
'fill-color': {
type: 'identity',
property: 'color',
},
'fill-opacity': 1,
},
}
}
export function createTextLayer(type: String) {
return {
id: `${type}-text`,
type: 'symbol',
source: `${type}-text`,
layout: {
'text-field': '{value}',
'text-size': 14,
'text-offset': [0, 1.2],
'icon-image': 'point.normal',
'icon-anchor': 'top',
'icon-size': 0.4,
},
paint: {
'text-color': '#3766fd',
'text-halo-color': '#fff',
'text-halo-width': 1,
},
}
}
...@@ -83,8 +83,8 @@ export const liveModules: NavItemType[] = [ ...@@ -83,8 +83,8 @@ export const liveModules: NavItemType[] = [
* token: V4 版本后端生成的一个长期有效 Token,固定值,必传 * token: V4 版本后端生成的一个长期有效 Token,固定值,必传
* open: true 代表可以从嵌入的页面打开新页面,默认为 false,非必传(注意:打开的子页面也进行了重写适配,一般来说不用担心出现意外情况,但注意进行简单测试) * open: true 代表可以从嵌入的页面打开新页面,默认为 false,非必传(注意:打开的子页面也进行了重写适配,一般来说不用担心出现意外情况,但注意进行简单测试)
*/ */
// url: `https://hntq.zhijietianqi.com/h5/web/monitoringOfLive/new-severe-weather.v3.html?app=5&token=${AppV4Token}`, url: `https://hntq.zhijietianqi.com/h5/web/monitoringOfLive/waterRegimenMap.v3.html?app=5&token=${AppV4Token}`,
url: `http://127.0.0.1:8080/web/monitoringOfLive/waterRegimenMap.v3.html?app=5&open=true&token=${AppV4Token}`, // url: `http://127.0.0.1:8080/web/monitoringOfLive/waterRegimenMap.v3.html?app=5&open=true&token=${AppV4Token}`,
}, },
}, },
{ {
......
...@@ -266,6 +266,19 @@ export const defHttp = createAxios({ ...@@ -266,6 +266,19 @@ export const defHttp = createAxios({
}) })
// other api url // other api url
export const otherHttp = createAxios({
requestOptions: {
apiUrl: API_URL,
urlPrefix: API_URL_PREFIX,
},
})
export const mapHttp = createAxios({
requestOptions: {
apiUrl: '',
urlPrefix: '',
isReturnNativeResponse: true,
},
})
// export const otherHttp = createAxios({ // export const otherHttp = createAxios({
// transform: { // transform: {
// inject: (config: AxiosRequestConfig<any>, options: http.RequestOptions) => { // inject: (config: AxiosRequestConfig<any>, options: http.RequestOptions) => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论