知识库-添加分享-功能

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

@ -309,15 +309,30 @@
<p style="margin-top: 15px">资源上传中请稍候...</p> <p style="margin-top: 15px">资源上传中请稍候...</p>
</div> </div>
</el-dialog> </el-dialog>
<!-- 分享弹窗 - 选择联系人 -->
<CreateGroupDialog
:visible.sync="shareDialogVisible"
title="分享给"
:recent-contacts="recentContacts"
:recent-groups="recentGroups"
:min-select-count="1"
confirm-text="分享"
@create-success="handleShareToContacts"
/>
</div> </div>
</template> </template>
<script> <script>
import { listUser, delUser, deptTreeSelect } from "@/api/system/user"; import { listUser, delUser, deptTreeSelect } from "@/api/system/user";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import CreateGroupDialog from "@/views/message/components/CreateGroupDialog";
export default { export default {
name: "Knowledge", name: "Knowledge",
components: {
CreateGroupDialog
},
data() { data() {
return { return {
loading: true, loading: true,
@ -372,6 +387,12 @@ export default {
fileList: [], // fileList: [], //
uploadProgressDialogVisible: false, uploadProgressDialogVisible: false,
uploadPercent: 0, uploadPercent: 0,
// ================== ==================
shareDialogVisible: false, //
shareItem: null, //
recentContacts: [], //
recentGroups: [], //
}; };
}, },
computed: { computed: {
@ -387,12 +408,22 @@ export default {
created() { created() {
this.getList(); this.getList();
this.getDeptTree(); this.getDeptTree();
this.getContactList();
}, },
methods: { methods: {
refreshMenu() { refreshMenu() {
this.deptFilterText = ""; this.deptFilterText = "";
this.getDeptTree(); 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() { getDeptTree() {
deptTreeSelect().then((res) => { deptTreeSelect().then((res) => {
this.deptOptions = res.data; this.deptOptions = res.data;
@ -490,8 +521,18 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
handleShare() { handleShare(row) {
this.$modal.msgSuccess("分享链接已复制"); 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) { handleUpdateFileName(row) {
this.fileNameForm = { ...row }; this.fileNameForm = { ...row };

Loading…
Cancel
Save