Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
a9f70b43
提交
a9f70b43
编写于
1月 17, 2019
作者:
杨广俊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决排序乱的问题
上级
a2bd55d6
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
8 行删除
+31
-8
index.js
src/utils/index.js
+2
-2
index.vue
src/views/teachers/index.vue
+29
-6
未找到文件。
src/utils/index.js
浏览文件 @
a9f70b43
...
@@ -92,7 +92,7 @@ export function getWebPageUrl(url) {
...
@@ -92,7 +92,7 @@ export function getWebPageUrl(url) {
}
}
// 根据不同环境,生成URL
// 根据不同环境,生成URL
function
getConfigByEnvType
(
url
)
{
function
getConfigByEnvType
(
url
Type
)
{
return
envConfig
[
process
.
env
.
BUILD_ENV
][
url
]
return
envConfig
[
process
.
env
.
BUILD_ENV
][
url
Type
]
}
}
src/views/teachers/index.vue
浏览文件 @
a9f70b43
...
@@ -61,6 +61,7 @@ export default {
...
@@ -61,6 +61,7 @@ export default {
return
{
return
{
showSelectedPage
:
true
,
showSelectedPage
:
true
,
parmDataDoctList
:
[],
parmDataDoctList
:
[],
oldParmDataDoctList
:
[],
selectedTypeIndex
:
1
,
selectedTypeIndex
:
1
,
prevent
:
true
,
prevent
:
true
,
isShowBackTop
:
false
,
isShowBackTop
:
false
,
...
@@ -159,19 +160,39 @@ export default {
...
@@ -159,19 +160,39 @@ export default {
// 排序
// 排序
orderAction
(
orderName
,
isSortUp
)
{
orderAction
(
orderName
,
isSortUp
)
{
let
orderType
=
isSortUp
?
-
1
:
1
let
orderType
=
isSortUp
?
-
1
:
1
let
orderData
=
this
.
p
armDataDoctList
.
slice
()
let
orderData
=
this
.
oldP
armDataDoctList
.
slice
()
// let orderData = parmDataDoctList
// let orderData = parmDataDoctList
orderData
.
sort
((
a
,
b
)
=>
{
orderData
.
sort
((
a
,
b
)
=>
{
if
(
orderName
===
'doctorFirstNameChar'
)
{
if
(
orderName
===
'doctorFirstNameChar'
)
{
return
(
a
[
orderName
].
charCodeAt
(
0
)
-
b
[
orderName
].
charCodeAt
(
0
))
*
orderType
if
(
a
[
orderName
].
charCodeAt
(
0
)
>
b
[
orderName
].
charCodeAt
(
0
))
{
return
1
*
orderType
}
else
if
(
a
[
orderName
].
charCodeAt
(
0
)
<
b
[
orderName
].
charCodeAt
(
0
))
{
return
-
1
*
orderType
}
else
{
return
0
}
}
else
if
(
orderName
===
'newTime'
)
{
}
else
if
(
orderName
===
'newTime'
)
{
if
(
isSortUp
)
{
if
((
new
Date
(
a
[
orderName
]).
getTime
())
/
1000
>
(
new
Date
(
b
[
orderName
]).
getTime
())
/
1000
)
{
return
((
new
Date
(
a
[
orderName
]).
getTime
())
/
1000
>
(
new
Date
(
b
[
orderName
]).
getTime
())
/
1000
)
?
1
:
-
1
return
1
*
orderType
}
else
if
(
(
new
Date
(
a
[
orderName
]).
getTime
())
/
1000
<
(
new
Date
(
b
[
orderName
]).
getTime
())
/
1000
)
{
return
-
1
*
orderType
}
else
{
}
else
{
return
((
new
Date
(
a
[
orderName
]).
getTime
())
/
1000
<
(
new
Date
(
b
[
orderName
]).
getTime
())
/
1000
)
?
1
:
-
1
return
0
}
}
// if(isSortUp) {
// return ((new Date(a[orderName]).getTime())/1000 > (new Date(b[orderName]).getTime())/1000) ? 1 : -1
// } else {
// return ((new Date(a[orderName]).getTime())/1000
<
(
new
Date
(
b
[
orderName
]).
getTime
())
/
1000
)
?
1
:
-
1
// }
}
else
{
}
else
{
return
(
a
[
orderName
]
-
b
[
orderName
])
*
orderType
if
(
a
[
orderName
]
>
b
[
orderName
])
{
return
1
*
orderType
}
else
if
(
a
[
orderName
]
<
b
[
orderName
])
{
return
-
1
*
orderType
}
else
{
return
0
}
}
}
})
})
this
.
parmDataDoctList
=
orderData
this
.
parmDataDoctList
=
orderData
...
@@ -180,6 +201,7 @@ export default {
...
@@ -180,6 +201,7 @@ export default {
// 选择器组件回调
// 选择器组件回调
selectedLecturerList
(
paramList
,
selectedTitle
,
selectedLevelName
,
selectedDepartName
)
{
selectedLecturerList
(
paramList
,
selectedTitle
,
selectedLevelName
,
selectedDepartName
)
{
this
.
parmDataDoctList
=
paramList
this
.
parmDataDoctList
=
paramList
this
.
oldParmDataDoctList
=
paramList
this
.
orderAction
(
'doctorFirstNameChar'
,
true
)
this
.
orderAction
(
'doctorFirstNameChar'
,
true
)
this
.
$refs
.
lecturerOrderRef
.
reset
()
this
.
$refs
.
lecturerOrderRef
.
reset
()
this
.
selectedTitleTitle
=
selectedTitle
this
.
selectedTitleTitle
=
selectedTitle
...
@@ -244,6 +266,7 @@ export default {
...
@@ -244,6 +266,7 @@ export default {
this
.
GET
(
'contents/courseDoctor/v1/getAllTeacher'
,
para
).
then
(
res
=>
{
this
.
GET
(
'contents/courseDoctor/v1/getAllTeacher'
,
para
).
then
(
res
=>
{
if
(
res
.
code
==
'000000'
){
if
(
res
.
code
==
'000000'
){
_this
.
parmDataDoctList
=
res
.
data
&&
res
.
data
.
list
||
[]
_this
.
parmDataDoctList
=
res
.
data
&&
res
.
data
.
list
||
[]
_this
.
oldParmDataDoctList
=
res
.
data
&&
res
.
data
.
list
||
[]
_this
.
orderAction
(
'doctorFirstNameChar'
,
true
)
_this
.
orderAction
(
'doctorFirstNameChar'
,
true
)
}
}
})
})
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录