Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.CadastralSystem
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
880db755
authored
2020-10-26 15:10:26 +0800
by
杨威
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
定义全局数据过滤方法
1 parent
b299b5bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
src/libs/fliter.js
src/main.js
src/libs/fliter.js
0 → 100644
View file @
880db75
import
Vue
from
"vue"
;
//定义key-value过滤方法
function
createFilter
(
filterName
,
dataArray
)
{
return
Vue
.
filter
(
filterName
,
function
(
val
)
{
let
label
=
""
;
let
arr
=
dataArray
;
arr
.
forEach
((
item
)
=>
{
if
(
item
.
value
==
val
)
{
return
(
label
=
item
.
label
);
}
});
return
label
;
});
}
//时间格式过滤
Vue
.
filter
(
"timeFilter"
,
function
(
timeStr
)
{
if
(
timeStr
)
{
return
timeStr
.
substring
(
0
,
10
);
}
});
//数据类型过滤
let
bdcLxArray
=
[
{
label
:
"宗地"
,
value
:
"zd"
,
},
{
label
:
"自然幢"
,
value
:
"zrz"
,
},
];
createFilter
(
"bdcLxFilter"
,
bdcLxArray
);
\ No newline at end of file
src/main.js
View file @
880db75
...
...
@@ -13,6 +13,7 @@ import 'quill/dist/quill.snow.css'
import
'quill/dist/quill.bubble.css'
// 将富文本编译器 注册为全局组件
Vue
.
use
(
VueQuillEditor
)
import
"./libs/fliter"
;
//引入全局过滤器
// 让IE11支持Vue-router跳转功能
if
(
'-ms-scroll-limit'
in
document
.
documentElement
.
style
&&
...
...
Please
register
or
sign in
to post a comment