知识库-添加分享-功能

main
ysn 6 days ago
parent d50ba717ae
commit 2ab0f794cb
  1. 45
      src/views/knowledge/index.vue

@ -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 };

Loading…
Cancel
Save