Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
8b5b5a78
提交
8b5b5a78
编写于
3月 20, 2019
作者:
yi.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
同上
上级
184e71dd
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
41 行增加
和
13 行删除
+41
-13
followapis.js
src/utils/followup/followapis.js
+29
-6
index.js
src/utils/index.js
+12
-7
未找到文件。
src/utils/followup/followapis.js
浏览文件 @
8b5b5a78
import
fetch
from
'../fetch'
;
import
{
getFollowUpApi
}
from
'@/utils/index'
import
{
getFollowUpApi
,
getBasicDataApi
}
from
'@/utils/index'
import
utils
from
'./followupUtils'
;
...
...
@@ -56,15 +56,38 @@ const reservationManageApi = [
]
/*常量API*/
const
basicDataApi
=
[
{
url
:
'/basic-data/constants/'
,
method
:
'get'
,
params
:
'params'
,
name
:
'getBasicData'
,
description
:
'获取常量'
,
},
]
const
api
=
{};
const
apis
=
[...
planManageApi
,
...
reservationManageApi
];
const
apis
=
[...
planManageApi
,
...
reservationManageApi
,
...
basicDataApi
];
apis
.
forEach
(
item
=>
api
[
item
.
name
]
=
(
params
=
{},
extraConfig
=
{})
=>
{
const
config
=
{
url
:
getFollowUpApi
(
item
.
url
),
method
:
item
.
method
,
};
// const config = {
// url: getFollowUpApi(item.url),
// method: item.method,
// };
let
config
=
{};
if
(
item
.
name
==
'getBasicData'
){
config
=
{
url
:
getBasicDataApi
(
item
.
url
),
method
:
item
.
method
,
};
}
else
{
config
=
{
url
:
getFollowUpApi
(
item
.
url
),
method
:
item
.
method
,
};
}
if
(
extraConfig
.
urlSuffix
)
{
// 需要做URL拼接的情况(比如*.do/2),,,可以根据自己的实际情况进行扩展
config
.
url
=
`
${
config
.
url
}${
extraConfig
.
urlSuffix
}
`
;
...
...
src/utils/index.js
浏览文件 @
8b5b5a78
...
...
@@ -9,7 +9,7 @@ export function setEventByModuleCode(itemData){
if
(
modeCode
===
'M001'
||
modeCode
===
'M002'
||
modeCode
===
'M003'
)
{
paramList
=
''
}
else
if
(
modeCode
===
'M100'
||
modeCode
===
'M300'
)
{
let
urlPara
=
getUrlParmByCode
(
paramList
);
paramList
[
0
]
&&
(
paramList
[
0
].
value
+=
urlPara
);
...
...
@@ -43,7 +43,7 @@ function getUrlParmByCode(paramList) {
}
// 计算高度
export
function
resizeHeight
(
cMinusHeight
=
152
,
iMinuxHeight
=
210
,
refHeightId
=
'sidebarWrapperId'
,
export
function
resizeHeight
(
cMinusHeight
=
152
,
iMinuxHeight
=
210
,
refHeightId
=
'sidebarWrapperId'
,
containerHeightId
=
'appContainerId'
,
innerHeightId
=
'elTableId'
){
if
(
!
p_getElm
(
refHeightId
)
||
!
p_getElm
(
containerHeightId
)
||
!
p_getElm
(
innerHeightId
))
{
// window.onresize = null
...
...
@@ -53,14 +53,14 @@ export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId
p_getElm
(
containerHeightId
).
style
.
height
=
containerHeight
-
cMinusHeight
+
'px'
p_getElm
(
innerHeightId
).
style
.
height
=
containerHeight
-
iMinuxHeight
+
'px'
if
(
p_getElm
(
'elTableIdInner'
)){
p_getElm
(
'elTableIdInner'
).
style
.
height
=
containerHeight
-
iMinuxHeight
+
'px'
p_getElm
(
'elTableIdInner'
).
style
.
height
=
containerHeight
-
iMinuxHeight
+
'px'
}
window
.
onresize
=
function
()
{
containerHeight
=
p_getElm
(
refHeightId
).
getBoundingClientRect
().
height
-
50
p_getElm
(
containerHeightId
).
style
.
height
=
containerHeight
-
cMinusHeight
+
'px'
p_getElm
(
innerHeightId
).
style
.
height
=
containerHeight
-
iMinuxHeight
+
'px'
if
(
p_getElm
(
'elTableIdInner'
))
{
p_getElm
(
'elTableIdInner'
).
style
.
height
=
containerHeight
-
iMinuxHeight
+
'px'
p_getElm
(
'elTableIdInner'
).
style
.
height
=
containerHeight
-
iMinuxHeight
+
'px'
}
}
}
...
...
@@ -87,7 +87,7 @@ export function deepCopy(obj) {
}
/**
*
*
* @param {Array} originData 初始数据
* @param {Boolean} isUp true: 升序 false: 降序
* @param {String} sortField 排序字段,如果没有,则直接排序
...
...
@@ -109,7 +109,7 @@ export function arraySort(originData, isUp = true, sortedField, converFun) {
sourceB
=
0
}
else
{
sourceA
=
converFun
(
sourceA
[
sortedField
])
sourceB
=
converFun
(
sourceB
[
sortedField
])
sourceB
=
converFun
(
sourceB
[
sortedField
])
}
}
// if(!sourceA || !sourceB) {
...
...
@@ -127,7 +127,7 @@ export function arraySort(originData, isUp = true, sortedField, converFun) {
swap
=
sortedData
[
j
]
sortedData
[
j
]
=
sortedData
[
j
+
1
]
sortedData
[
j
+
1
]
=
swap
}
}
}
}
}
...
...
@@ -171,6 +171,11 @@ export function getFollowUpApi(url) {
return
getConfigByEnvType
(
'followUpApiSoSoApi'
)
+
url
//当前使用sosoapi mock数据
}
// 获取常量接口域名地址
export
function
getBasicDataApi
(
url
)
{
return
getConfigByEnvType
(
'basicDataUrl'
)
+
url
}
// 根据不同环境,生成URL
function
getConfigByEnvType
(
urlType
)
{
return
envConfig
[
process
.
env
.
BUILD_ENV
][
urlType
]
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录