Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
47b9c631
Commit
47b9c631
authored
Sep 23, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataGrid
parent
7e16e1e1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
809 additions
and
824 deletions
+809
-824
dataGrid.vue
components/page/dataGrid.vue
+809
-824
No files found.
components/page/dataGrid.vue
View file @
47b9c631
<
template
>
<
template
>
<div
class=
"table-content"
>
<div
class=
"table-content"
>
<div
class=
"table-tools"
v-if=
"tool"
>
<div
class=
"table-tools"
v-if=
"tool"
>
<div
class=
"table-search"
>
<div
class=
"table-search"
>
<slot
name=
"easySearch"
v-if=
"easy"
>
<slot
name=
"easySearch"
v-if=
"easy"
>
<Form
inline
>
<Form
inline
>
<FormItem>
<FormItem>
<Input
<Input
search
enter-button
:placeholder=
"placeholder"
@
on-search=
"easySearch"
v-width=
"300"
v-model=
"keys"
/>
search
enter-button
:placeholder=
"placeholder"
@
on-search=
"easySearch"
v-width=
"300"
v-model=
"keys"
/>
</FormItem>
</FormItem>
<FormItem>
<FormItem>
<Button
v-if=
"high"
@
click=
"modalSearch=true"
type=
"text"
>
<Button
v-if=
"high"
@
click=
"modalSearch=true"
type=
"text"
>
...
@@ -42,40 +35,11 @@
...
@@ -42,40 +35,11 @@
</slot>
</slot>
</Col>
</Col>
</Row>
</Row>
<Table
<Table
v-else
:border=
"border"
:columns=
"columnsNow"
:data=
"list"
:height=
"tableHeight"
:draggable=
"draggable"
ref=
"table"
class=
"tableCommon"
@
on-expand=
"expand"
@
on-drag-drop=
"onDragDrop"
@
on-selection-change=
"selectionChange"
@
on-select=
"onSelect"
@
on-select-all=
"allChange"
:row-key=
"rowKey"
stripe
></Table>
v-else
:border=
"border"
:columns=
"columnsNow"
:data=
"list"
:height=
"tableHeight"
:draggable=
"draggable"
ref=
"table"
class=
"tableCommon"
@
on-expand=
"expand"
@
on-drag-drop=
"onDragDrop"
@
on-selection-change=
"selectionChange"
@
on-select=
"onSelect"
@
on-select-all=
"allChange"
:row-key=
"rowKey"
stripe
></Table>
</div>
</div>
<div
class=
"table-footer"
>
<div
class=
"table-footer"
>
<slot
name=
"footer"
></slot>
<slot
name=
"footer"
></slot>
<Page
<Page
v-if=
"page"
:total=
"search.total"
:current=
"search.page"
class=
"fr"
show-total
size=
"small"
show-elevator
show-sizer
:page-size=
"search.pageSize"
:page-size-opts=
"pageSizeOpts"
@
on-change=
"pageChange"
@
on-page-size-change=
"pageSizeChange"
/>
v-if=
"page"
:total=
"search.total"
:current=
"search.page"
class=
"fr"
show-total
size=
"small"
show-elevator
show-sizer
:page-size=
"search.pageSize"
:page-size-opts=
"pageSizeOpts"
@
on-change=
"pageChange"
@
on-page-size-change=
"pageSizeChange"
/>
</div>
</div>
<Modal
v-if=
"high"
v-model=
"modalSearch"
title=
"高级搜索"
draggable
width=
"800"
ref=
"search"
>
<Modal
v-if=
"high"
v-model=
"modalSearch"
title=
"高级搜索"
draggable
width=
"800"
ref=
"search"
>
<slot
name=
"searchForm"
></slot>
<slot
name=
"searchForm"
></slot>
...
@@ -84,14 +48,7 @@
...
@@ -84,14 +48,7 @@
<Button
@
click=
"complexSearch"
type=
"primary"
style=
"margin-left:10px;"
>
查询
</Button>
<Button
@
click=
"complexSearch"
type=
"primary"
style=
"margin-left:10px;"
>
查询
</Button>
</div>
</div>
</Modal>
</Modal>
<Drawer
<Drawer
title=
"列设置"
v-if=
"set"
v-model=
"config"
:scrollable=
"true"
placement=
"left"
:mask=
"false"
>
title=
"列设置"
v-if=
"set"
v-model=
"config"
:scrollable=
"true"
placement=
"left"
:mask=
"false"
>
<div
slot=
"header"
>
<div
slot=
"header"
>
列设置
列设置
<a
@
click=
"undoConfig"
class=
"ml50"
>
<a
@
click=
"undoConfig"
class=
"ml50"
>
...
@@ -99,11 +56,7 @@
...
@@ -99,11 +56,7 @@
</a>
</a>
</div>
</div>
<ul
class=
"table-columns"
>
<ul
class=
"table-columns"
>
<li
<li
v-for=
"(li,index) in columnsCur"
:key=
"index"
v-dragging=
"
{ item: li, list: columnsCur, group: 'li' }">
v-for=
"(li,index) in columnsCur"
:key=
"index"
v-dragging=
"
{ item: li, list: columnsCur, group: 'li' }"
>
<label
@
click=
"columnChange(li,index)"
:class=
"
{dis:li.hide}">
<label
@
click=
"columnChange(li,index)"
:class=
"
{dis:li.hide}">
<Icon
:type=
"li.hide?'md-eye-off':'md-eye'"
size=
"16"
class=
"mr10"
/>
<Icon
:type=
"li.hide?'md-eye-off':'md-eye'"
size=
"16"
class=
"mr10"
/>
<span>
{{
li
.
title
}}
</span>
<span>
{{
li
.
title
}}
</span>
...
@@ -118,7 +71,7 @@
...
@@ -118,7 +71,7 @@
<slot
name=
"batch"
></slot>
<slot
name=
"batch"
></slot>
<Button
@
click=
"cancelBatch"
>
取消
</Button>
<Button
@
click=
"cancelBatch"
>
取消
</Button>
</FooterToolbar>
</FooterToolbar>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -363,8 +316,7 @@ export default {
...
@@ -363,8 +316,7 @@ export default {
},
},
loadUserConfig
()
{
loadUserConfig
()
{
var
query
=
{
var
query
=
{
conditions
:
[
conditions
:
[{
{
fieldName
:
"creatorUserId"
,
fieldName
:
"creatorUserId"
,
fieldValue
:
this
.
userId
,
fieldValue
:
this
.
userId
,
conditionalType
:
"Equal"
,
conditionalType
:
"Equal"
,
...
@@ -604,11 +556,42 @@ export default {
...
@@ -604,11 +556,42 @@ export default {
});
});
list
.
forEach
((
e
)
=>
{
list
.
forEach
((
e
)
=>
{
//给导出数据增加数据字典对应的name
//给导出数据增加数据字典对应的name
tempCol
.
forEach
((
ele
)
=>
{
// tempCol.forEach((ele) => {
e
[
ele
.
key
]
=
this
.
$u
.
dirName
(
// e[ele.key] = this.$u.dirName(
this
.
$store
.
getters
.
dictionaryByKey
(
ele
.
code
),
// this.$store.getters.dictionaryByKey(ele.code),
e
[
ele
.
key
]
// e[ele.key]
// );
// });
tempCol
.
forEach
((
elem
)
=>
{
if
(
e
[
elem
.
key
]
&&
e
[
elem
.
key
]
!=
""
&&
e
[
elem
.
key
]
!=
null
)
{
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let
codeArr
=
[]
let
keyValue
=
e
[
elem
.
key
]
if
(
keyValue
.
length
>
0
&&
(
keyValue
.
indexOf
(
','
)
>
-
1
||
keyValue
.
indexOf
(
','
)
>
-
1
))
{
//如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if
(
keyValue
.
indexOf
(
','
)
>
-
1
)
{
codeArr
=
keyValue
.
split
(
','
)
}
if
(
keyValue
.
indexOf
>
-
1
)
{
codeArr
=
keyValue
.
split
(
','
)
}
}
if
(
codeArr
.
length
<=
1
)
{
//对应的数据包含一个数据字典项
e
[
elem
.
key
]
=
this
.
$u
.
dirName
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
e
[
elem
.
key
]
);
);
}
else
{
//对应的数据包含多个数据字典项
let
codeInfo
=
''
codeArr
.
forEach
(
el
=>
{
codeInfo
=
codeInfo
+
this
.
$u
.
dirName
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
el
)
+
","
;
})
e
[
elem
.
key
]
=
codeInfo
.
substr
(
0
,
codeInfo
.
length
-
1
)
}
}
});
});
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
tempCol1
.
forEach
((
elcol1
)
=>
{
tempCol1
.
forEach
((
elcol1
)
=>
{
...
@@ -793,6 +776,7 @@ export default {
...
@@ -793,6 +776,7 @@ export default {
<
style
lang=
"less"
>
<
style
lang=
"less"
>
@import "../../assets/css/custom.less";
@import "../../assets/css/custom.less";
.table-content {
.table-content {
position: relative;
position: relative;
height: 100%;
height: 100%;
...
@@ -831,6 +815,7 @@ export default {
...
@@ -831,6 +815,7 @@ export default {
display: flex;
display: flex;
line-height: 50px;
line-height: 50px;
background: @right-header-bg;
background: @right-header-bg;
.table-search {
.table-search {
flex-grow: 1;
flex-grow: 1;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment