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
ce54ed22
Commit
ce54ed22
authored
Aug 26, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
datagrid
parent
a10adea4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
233 additions
and
228 deletions
+233
-228
dataGrid.vue
components/page/dataGrid.vue
+233
-228
No files found.
components/page/dataGrid.vue
View file @
ce54ed22
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
</Form>
</Form>
</slot>
</slot>
</div>
</div>
<div
class=
"searchBack"
>
<div
class=
"searchBack"
>
<slot
name=
"searchBack"
></slot>
<slot
name=
"searchBack"
></slot>
</div>
</div>
...
@@ -298,62 +299,63 @@ export default {
...
@@ -298,62 +299,63 @@ export default {
this
.
columnsCur
=
curColumns
;
this
.
columnsCur
=
curColumns
;
}
}
}
}
}
});
}
this
.
search
.
pageIndex
=
1
;
this
.
search
.
conditions
=
where
;
this
.
load
();
},
pageChange
(
page
)
{
this
.
search
.
page
=
page
;
this
.
search
.
pageIndex
=
page
;
this
.
load
();
},
pageSizeChange
(
size
)
{
this
.
search
.
pageSize
=
size
;
this
.
search
.
pageIndex
=
1
;
this
.
load
();
},
columnChange
(
item
,
i
)
{
item
.
hide
=
!
item
.
hide
;
this
.
$set
(
this
.
columnsCur
,
item
,
i
);
this
.
saveUserconfig
();
},
},
selectionChange
(
items
)
{
loadUserConfig
()
{
this
.
$emit
(
"on-selection-change"
,
items
);
var
query
=
{
this
.
selectItems
=
items
;
conditions
:
[{
this
.
footerToolbar
=
items
.
length
>
0
;
fieldName
:
"creatorUserId"
,
fieldValue
:
this
.
userId
,
conditionalType
:
"Equal"
,
},
},
onSelect
(
rows
,
row
)
{
{
this
.
$emit
(
"on-change"
,
rows
,
row
);
fieldName
:
"component"
,
fieldValue
:
"Grid"
,
conditionalType
:
"Equal"
,
},
},
allChange
(
items
)
{
{
this
.
$emit
(
"all-change"
,
items
);
fieldName
:
"page"
,
fieldValue
:
window
.
location
.
pathname
,
conditionalType
:
"Equal"
,
},
},
intY
()
{
],
if
(
this
.
$refs
.
table
!=
undefined
)
{
pageSize
:
1
,
this
.
firstY
=
this
.
$refs
.
table
.
$el
.
getBoundingClientRect
().
top
;
};
this
.
$api
.
post
(
`
${
window
.
systemUrl
}
/config/list`
,
query
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
if
(
r
.
result
.
length
==
1
)
{
this
.
userConfig
=
r
.
result
[
0
];
this
.
columnInit
();
}
}
if
(
!
this
.
configLoad
)
{
this
.
easySearch
();
}
this
.
configLoad
=
true
;
}
});
},
},
selectAll
(
status
)
{
saveUserconfig
()
{
this
.
$refs
.
table
.
selectAll
(
status
);
let
url
=
`
${
window
.
systemUrl
}
/config/update`
;
},
var
content
=
[];
//批量取消
this
.
columnsCur
.
map
((
u
)
=>
{
cancelBatch
()
{
content
.
push
({
this
.
footerToolbar
=
false
;
key
:
u
.
key
,
this
.
$refs
.
table
.
selectAll
(
false
);
hide
:
u
.
hide
,
},
});
},
});
computed
:
{
if
(
!
this
.
userConfig
)
{
columnsNow
()
{
url
=
`
${
window
.
systemUrl
}
/config/create`
;
var
cols
=
this
.
columnsCur
.
filter
((
u
)
=>
{
var
data
=
{
if
(
u
.
code
)
{
page
:
window
.
location
.
pathname
,
u
.
render
=
(
h
,
params
)
=>
{
component
:
"Grid"
,
let
values
=
u
.
key
;
key
:
this
.
$u
.
guid
(),
let
type
=
"text"
;
content
:
JSON
.
stringify
(
content
),
if
(
u
.
category
)
{
};
type
=
u
.
category
;
this
.
$api
.
post
(
url
,
data
).
then
((
r
)
=>
{
this
.
loadUserConfig
();
});
}
else
{
this
.
userConfig
.
content
=
JSON
.
stringify
(
content
);
this
.
$api
.
post
(
url
,
this
.
userConfig
);
}
}
},
},
//展开
//展开
...
@@ -442,7 +444,10 @@ computed: {
...
@@ -442,7 +444,10 @@ computed: {
this
.
footerToolbar
=
items
.
length
>
0
;
this
.
footerToolbar
=
items
.
length
>
0
;
},
},
onSelect
(
rows
,
row
)
{
onSelect
(
rows
,
row
)
{
this
.
$emit
(
"on-selection-change"
,
rows
,
row
);
this
.
$emit
(
"on-change"
,
rows
,
row
);
},
allChange
(
items
)
{
this
.
$emit
(
"all-change"
,
items
);
},
},
intY
()
{
intY
()
{
if
(
this
.
$refs
.
table
!=
undefined
)
{
if
(
this
.
$refs
.
table
!=
undefined
)
{
...
@@ -533,7 +538,7 @@ computed: {
...
@@ -533,7 +538,7 @@ computed: {
this
.
columnsCur
=
this
.
$u
.
clone
(
this
.
columns
);
this
.
columnsCur
=
this
.
$u
.
clone
(
this
.
columns
);
},
},
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
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