Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
371f63fa
提交
371f63fa
编写于
12月 21, 2018
作者:
杨广俊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test1
上级
d64e61e7
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
30 行增加
和
27 行删除
+30
-27
index.js
src/utils/index.js
+30
-27
未找到文件。
src/utils/index.js
浏览文件 @
371f63fa
/**
* Created by Anndy Yang on 18/03/18.
*/
Date
.
prototype
.
format
=
function
(
fmt
)
{
var
o
=
{
'M+'
:
this
.
getMonth
()
+
1
,
// 月份
...
...
@@ -54,6 +55,8 @@ export function parseTime(time, cFormat) {
return
time_str
}
export
function
formatTime
(
time
,
option
)
{
time
=
+
time
*
1000
const
d
=
new
Date
(
time
)
...
...
@@ -125,7 +128,7 @@ export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId
containerHeightId
=
'appContainerId'
,
innerHeightId
=
'elTableId'
){
if
(
!
p_getElm
(
refHeightId
)
||
!
p_getElm
(
containerHeightId
)
||
!
p_getElm
(
innerHeightId
))
{
// window.onresize = null
logger
.
warn
(
'No certain dom id!!!'
);
console
.
warn
(
'No certain dom id!!!'
);
}
let
containerHeight
=
p_getElm
(
refHeightId
).
getBoundingClientRect
().
height
-
50
p_getElm
(
containerHeightId
).
style
.
height
=
containerHeight
-
cMinusHeight
+
'px'
...
...
@@ -212,6 +215,20 @@ function getUrlParmByCode(paramList) {
return
''
}
export
function
deepCopy
(
obj
)
{
var
result
=
Array
.
isArray
(
obj
)
?
[]
:
{};
for
(
var
key
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
key
))
{
if
(
typeof
obj
[
key
]
===
'object'
)
{
result
[
key
]
=
deepCopy
(
obj
[
key
]);
//递归复制
}
else
{
result
[
key
]
=
obj
[
key
];
}
}
}
return
result
;
}
export
function
pageJumpUrl
(){
let
url
=
{
pageListUrl
:
'https://test1-contents.yunqueyi.com/content_list'
,
...
...
@@ -221,56 +238,42 @@ export function pageJumpUrl(){
return
url
;
}
/*
oriData : 原数据
sortField : 排序字段
orderType : 排序类型 1.升序 -1.降序
*/
export
function
sortParmData
(
oriData
,
sortField
,
orderType
)
{
if
(
orderType
!==
1
&&
orderType
!==
-
1
)
orderType
=
1
oriData
.
sort
(
(
a
,
b
)
=>
{
return
(
a
[
sortField
]
-
b
[
sortField
])
*
orderType
})
return
oriData
}
//跳转个人评价页面
export
function
jumpEvaluatPage
(){
return
evaluatPageUrl
}
// dev地址
// const baseUrl = 'http://192.168.140.14:10201/'
const
baseUrl
=
'http://10.177.10.149:8080/'
// const baseUrl = 'http://192.168.140.14:10201/'
// const baseUrl = 'https://dev-sc.yunqueyi.com/'
const
baseUrl
=
'https://dev-sc.yunqueyi.com/'
const
apiUrl
=
'https://dev-api.yunqueyi.com/'
const
evaluatPageUrl
=
'https://dev-phome.yunqueyi.com/gpr/#/home'
export
const
jumpWebPageUrl
=
'https://dev-phome.yunqueyi.com/appl/#/'
// // test1地址
// const baseUrl =
'https://test1-sc.yunqueyi.com/'
// const baseUrl = 'https://test1-sc.yunqueyi.com/'
// const apiUrl = 'https://test1-api.yunqueyi.com/'
// const evaluatPageUrl = 'http://10.177.10.225:9001/#/home' || 'https://test1-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://test1-phome.yunqueyi.com/appl/#/'
// const evaluatPageUrl = 'https://test1-phome.yunqueyi.com/gpr/#/home'
// const baseUrl = 'https://uat-sc.yunqueyi.com/'
// // uat地址
// const baseUrl = 'https://uat-sc.yunqueyi.com/'
// const apiUrl = 'https://uat-api.yunqueyi.com/'
// const evaluatPageUrl = 'https://uat-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://uat-phome.yunqueyi.com/appl/#/'
// // pro地址
// const baseUrl =
'https://sc.yunqueyi.com/'
// const baseUrl = 'https://sc.yunqueyi.com/'
// const apiUrl = 'https://api.yunqueyi.com/'
// const evaluatPageUrl = 'https://phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://phome.yunqueyi.com/appl/#/'
//
获取BaseUrl
//
为每个URL添加应用校验密钥
export
function
getBaseUrl
(
url
,
str
)
{
return
baseUrl
+
url
}
export
function
getApiUrl
(
url
)
{
return
apiUrl
+
url
}
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录