|
|
@@ -69,6 +69,10 @@ export default defineComponent({
|
|
|
type: String,
|
|
|
default: 'top',
|
|
|
},
|
|
|
+ friends: {
|
|
|
+ type: Array as PropType<number[]>,
|
|
|
+ default: [],
|
|
|
+ },
|
|
|
},
|
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
@@ -83,7 +87,8 @@ export default defineComponent({
|
|
|
if (res) {
|
|
|
myFriends.value = [];
|
|
|
res.forEach((el) => {
|
|
|
- myFriends.value.push({ ...el, checked: false });
|
|
|
+ const checked = props.friends.includes(el.frienduserid) ? true : false;
|
|
|
+ myFriends.value.push({ ...el, checked });
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
@@ -101,7 +106,7 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
function submit() {
|
|
|
- const result: string[] = [];
|
|
|
+ const result: number[] = [];
|
|
|
myFriends.value.forEach((el) => {
|
|
|
if (el.checked) {
|
|
|
result.push(el.frienduserid);
|