Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ai_web_page_prod
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
ai_web_page_prod
Commits
8623daee
Commit
8623daee
authored
May 16, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4bb0c461
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
src/components/Admin/AdminPublicPage.vue
+7
-0
src/components/Admin/table.vue
+34
-2
No files found.
src/components/Admin/AdminPublicPage.vue
View file @
8623daee
...
...
@@ -69,6 +69,7 @@
:edit_page=
"form.edit_page"
:checkbox=
"form.checkbox"
@
ChangeList=
"ChangeList"
@
ChoseList=
"ChoseList"
>
<
template
#
title=
"{ row }"
>
<slot
name=
"title"
:row=
"row"
></slot>
...
...
@@ -103,6 +104,8 @@ const store = useStore();
const
filterBoxStatus
=
ref
(
false
);
const
defaultWidth
=
ref
();
const
adminFilter
=
ref
();
// 选中的行
const
SelectedRows
=
ref
([]);
// 重新加载页面
const
onReload
=
()
=>
{
store
.
commit
(
'progress/reload'
);
...
...
@@ -111,6 +114,10 @@ const onReload = () => {
const
onReset
=
()
=>
{
emit
(
'reset'
);
};
// 选中的行
const
ChoseList
=
(
list
:
any
[])
=>
{
SelectedRows
.
value
=
list
;
};
// 筛选盒子是否显示
const
filterChange
=
()
=>
{
...
...
src/components/Admin/table.vue
View file @
8623daee
...
...
@@ -15,7 +15,11 @@
></TCheckbox>
</
template
>
<
template
#
checkbox=
"{ row }"
>
<TCheckbox
v-model=
"row.is_check"
class=
"check-all-box"
></TCheckbox>
<TCheckbox
v-model=
"row.is_check"
class=
"check-all-box"
@
change=
"CheckOne(row)"
></TCheckbox>
</
template
>
<
template
#
title=
"{ row }"
>
<slot
name=
"title"
:row=
"row"
></slot>
...
...
@@ -62,7 +66,7 @@ const props = withDefaults(
checkbox
:
true
,
}
);
// const emit = defineEmits(['Chang
eList']);
const
emit
=
defineEmits
([
'ChangeList'
,
'Chos
eList'
]);
const
router
=
useRouter
();
// 获取本地的page
const
getPage
=
()
=>
{
...
...
@@ -90,6 +94,34 @@ const CheckAll = () => {
tableList
.
list
.
forEach
((
item
:
any
)
=>
{
item
.
is_check
=
is_check_all
.
value
;
});
if
(
is_check_all
.
value
)
{
// 通知父组件
emit
(
'ChoseList'
,
tableList
.
list
);
}
else
{
emit
(
'ChoseList'
,
[]);
}
};
// 选择行
const
CheckOne
=
(
row
:
any
)
=>
{
// 如果全部未选择
const
not_check_list
=
tableList
.
list
.
filter
(
(
item
:
any
)
=>
item
.
is_check
==
false
);
if
(
not_check_list
.
length
===
tableList
.
list
.
length
)
{
emit
(
'ChoseList'
,
[]);
}
else
{
// 找到所有选择项
const
list
=
tableList
.
list
.
filter
((
item
:
any
)
=>
item
.
is_check
==
true
);
emit
(
'ChoseList'
,
list
);
}
// 判断是否全选
const
check_list
=
tableList
.
list
.
filter
(
(
item
:
any
)
=>
item
.
is_check
==
true
);
if
(
check_list
.
length
===
tableList
.
list
.
length
)
{
is_check_all
.
value
=
true
;
}
};
// 打开编辑页面
...
...
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