Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-manage-ui
Commits
2b2c2195
Commit
2b2c2195
authored
May 06, 2023
by
白舜
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化改进“能力推荐管理”
parent
9f57ca73
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
6 deletions
+32
-6
src/components/ability-card.vue
src/components/ability-card.vue
+4
-0
src/components/ability-list.vue
src/components/ability-list.vue
+17
-1
src/page/main/home-config/recommend/edit/index.vue
src/page/main/home-config/recommend/edit/index.vue
+11
-5
No files found.
src/components/ability-card.vue
View file @
2b2c2195
...
@@ -130,6 +130,10 @@ const move = (type) => {
...
@@ -130,6 +130,10 @@ const move = (type) => {
};
};
emit
(
"
move
"
,
temp
);
emit
(
"
move
"
,
temp
);
};
};
defineExpose
({
checked
})
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/components/ability-list.vue
View file @
2b2c2195
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<template
v-if=
"props.list.length > 0"
>
<template
v-if=
"props.list.length > 0"
>
<div
v-for=
"(item, i) in props.list"
:key=
"'card' + i"
class=
"item"
>
<div
v-for=
"(item, i) in props.list"
:key=
"'card' + i"
class=
"item"
>
<ability-card
<ability-card
ref=
"itemRefs"
:item=
"item"
:item=
"item"
@
change-selected-list=
"changeSelectedList"
@
change-selected-list=
"changeSelectedList"
:flag=
"props.flag"
:flag=
"props.flag"
...
@@ -22,7 +23,9 @@
...
@@ -22,7 +23,9 @@
</template>
</template>
<
script
setup
>
<
script
setup
>
import
{
onMounted
,
ref
}
from
"
vue
"
;
import
abilityCard
from
"
./ability-card.vue
"
;
import
abilityCard
from
"
./ability-card.vue
"
;
const
itemRefs
=
ref
([]);
const
props
=
defineProps
({
const
props
=
defineProps
({
list
:
{
list
:
{
type
:
Array
,
type
:
Array
,
...
@@ -35,7 +38,7 @@ const props = defineProps({
...
@@ -35,7 +38,7 @@ const props = defineProps({
loading
:
{
loading
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
,
}
}
,
});
});
const
emit
=
defineEmits
([
"
changeSelectedList
"
,
"
openBox
"
,
"
deleteItem
"
,
"
move
"
]);
const
emit
=
defineEmits
([
"
changeSelectedList
"
,
"
openBox
"
,
"
deleteItem
"
,
"
move
"
]);
const
changeSelectedList
=
(
item
,
checked
)
=>
{
const
changeSelectedList
=
(
item
,
checked
)
=>
{
...
@@ -50,6 +53,19 @@ const deleteItem = (item) => {
...
@@ -50,6 +53,19 @@ const deleteItem = (item) => {
const
move
=
(
temp
)
=>
{
const
move
=
(
temp
)
=>
{
emit
(
"
move
"
,
temp
);
emit
(
"
move
"
,
temp
);
};
};
// const setRef = (el, index) => {
// itemRefs.value.push(el)
// }
onMounted
(()
=>
{
console
.
log
(
itemRefs
);
})
defineExpose
({
list
:
props
.
list
,
itemRefs
});
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/page/main/home-config/recommend/edit/index.vue
View file @
2b2c2195
...
@@ -102,13 +102,16 @@
...
@@ -102,13 +102,16 @@
</div>
</div>
<div>
<div>
<span>
已选择
</span>
<span>
已选择
</span>
<span
class=
"num"
>
({{ toBeAddedItemList.length }}/9)
</span>
<span
class=
"num"
>
({{ selectedItemList.length + toBeAddedItemList.length }}/9)
</span
>
<span>
项
</span>
<span>
项
</span>
<span
class=
"can_click_text"
@
click=
"clearSelection"
>
清空
</span>
<span
class=
"can_click_text"
@
click=
"clearSelection"
>
清空
</span>
</div>
</div>
</div>
</div>
<div
class=
"user_table bg-scroll"
>
<div
class=
"user_table bg-scroll"
>
<ability-list
<ability-list
ref=
"abilityListRef"
:list=
"list"
:list=
"list"
:loading=
"abilityLoading"
:loading=
"abilityLoading"
:flag=
"false"
:flag=
"false"
...
@@ -146,6 +149,7 @@ import abilityList from "@/components/ability-list.vue";
...
@@ -146,6 +149,7 @@ import abilityList from "@/components/ability-list.vue";
const
router
=
useRouter
();
const
router
=
useRouter
();
const
route
=
useRoute
();
const
route
=
useRoute
();
const
typeFormRef
=
ref
(
null
);
const
typeFormRef
=
ref
(
null
);
const
abilityListRef
=
ref
(
null
);
const
state
=
reactive
({
const
state
=
reactive
({
formData
:
{
formData
:
{
business_type_id
:
""
,
business_type_id
:
""
,
...
@@ -322,7 +326,9 @@ const changeCollation = (val) => {
...
@@ -322,7 +326,9 @@ const changeCollation = (val) => {
const
clearSelection
=
()
=>
{
const
clearSelection
=
()
=>
{
state
.
toBeAddedItemList
=
[];
state
.
toBeAddedItemList
=
[];
state
.
list
=
[];
abilityListRef
.
value
.
itemRefs
.
forEach
((
item
)
=>
{
item
.
checked
=
false
;
});
};
};
const
searchAction
=
()
=>
{
const
searchAction
=
()
=>
{
changePage
(
1
);
changePage
(
1
);
...
@@ -368,7 +374,8 @@ const submit = () => {
...
@@ -368,7 +374,8 @@ const submit = () => {
const
cancelSelectDialog
=
()
=>
{
const
cancelSelectDialog
=
()
=>
{
state
.
selectDialog
=
false
;
state
.
selectDialog
=
false
;
clearSelection
();
state
.
toBeAddedItemList
=
[];
state
.
list
=
[];
};
};
const
confirm
=
()
=>
{
const
confirm
=
()
=>
{
...
@@ -391,8 +398,7 @@ const confirm = () => {
...
@@ -391,8 +398,7 @@ const confirm = () => {
state
.
selectedItemList
.
push
(...
_newItemList
);
state
.
selectedItemList
.
push
(...
_newItemList
);
state
.
toBeAddedItemList
.
length
=
0
;
state
.
toBeAddedItemList
.
length
=
0
;
moveAbleChanging
();
moveAbleChanging
();
clearSelection
();
cancelSelectDialog
();
state
.
selectDialog
=
false
;
};
};
const
submitFormData
=
(
data
)
=>
{
const
submitFormData
=
(
data
)
=>
{
...
...
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