|
|
|
|
@ -309,15 +309,30 @@ |
|
|
|
|
<p style="margin-top: 15px">资源上传中,请稍候...</p> |
|
|
|
|
</div> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<!-- 分享弹窗 - 选择联系人 --> |
|
|
|
|
<CreateGroupDialog |
|
|
|
|
:visible.sync="shareDialogVisible" |
|
|
|
|
title="分享给" |
|
|
|
|
:recent-contacts="recentContacts" |
|
|
|
|
:recent-groups="recentGroups" |
|
|
|
|
:min-select-count="1" |
|
|
|
|
confirm-text="分享" |
|
|
|
|
@create-success="handleShareToContacts" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { listUser, delUser, deptTreeSelect } from "@/api/system/user"; |
|
|
|
|
import { getToken } from "@/utils/auth"; |
|
|
|
|
import CreateGroupDialog from "@/views/message/components/CreateGroupDialog"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "Knowledge", |
|
|
|
|
components: { |
|
|
|
|
CreateGroupDialog |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading: true, |
|
|
|
|
@ -372,6 +387,12 @@ export default { |
|
|
|
|
fileList: [], // 只允许一个 |
|
|
|
|
uploadProgressDialogVisible: false, |
|
|
|
|
uploadPercent: 0, |
|
|
|
|
|
|
|
|
|
// ================== 分享相关 ================== |
|
|
|
|
shareDialogVisible: false, // 分享弹窗 |
|
|
|
|
shareItem: null, // 当前分享的文件 |
|
|
|
|
recentContacts: [], // 最近联系人 |
|
|
|
|
recentGroups: [], // 最近群组 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
@ -387,12 +408,22 @@ export default { |
|
|
|
|
created() { |
|
|
|
|
this.getList(); |
|
|
|
|
this.getDeptTree(); |
|
|
|
|
this.getContactList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
refreshMenu() { |
|
|
|
|
this.deptFilterText = ""; |
|
|
|
|
this.getDeptTree(); |
|
|
|
|
}, |
|
|
|
|
getContactList() { |
|
|
|
|
listUser({ pageNum: 1, pageSize: 100 }).then((res) => { |
|
|
|
|
this.recentContacts = res.rows.map((user) => ({ |
|
|
|
|
id: user.userId, |
|
|
|
|
name: user.nickName || user.userName, |
|
|
|
|
avatar: user.avatar || "", |
|
|
|
|
})); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getDeptTree() { |
|
|
|
|
deptTreeSelect().then((res) => { |
|
|
|
|
this.deptOptions = res.data; |
|
|
|
|
@ -490,8 +521,18 @@ export default { |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleShare() { |
|
|
|
|
this.$modal.msgSuccess("分享链接已复制"); |
|
|
|
|
handleShare(row) { |
|
|
|
|
this.shareItem = row; |
|
|
|
|
this.shareDialogVisible = true; |
|
|
|
|
}, |
|
|
|
|
handleShareToContacts(selectedMembers) { |
|
|
|
|
if (selectedMembers && selectedMembers.length > 0) { |
|
|
|
|
const shareTarget = selectedMembers[0]; |
|
|
|
|
this.$modal.msgSuccess(`已分享给 ${shareTarget.name}`); |
|
|
|
|
console.log("分享文件:", this.shareItem, "给:", shareTarget); |
|
|
|
|
} |
|
|
|
|
this.shareDialogVisible = false; |
|
|
|
|
this.shareItem = null; |
|
|
|
|
}, |
|
|
|
|
handleUpdateFileName(row) { |
|
|
|
|
this.fileNameForm = { ...row }; |
|
|
|
|
|