mirror of
https://github.com/TangSengDaoDao/TangSengDaoDaoWeb
synced 2025-06-06 09:08:59 +00:00
fix: fixed many bugs
This commit is contained in:
parent
9de9346720
commit
2dfcce944d
@ -256,12 +256,6 @@ export default class WKApp extends ProviderListener {
|
|||||||
WKApp.loginInfo.load(); // 加载登录信息
|
WKApp.loginInfo.load(); // 加载登录信息
|
||||||
|
|
||||||
const themeMode = StorageService.shared.getItem("theme-mode");
|
const themeMode = StorageService.shared.getItem("theme-mode");
|
||||||
const currentSystemThemeModeIsDark = window.matchMedia(
|
|
||||||
"(prefers-color-scheme: dark)"
|
|
||||||
).matches;
|
|
||||||
if (!themeMode && currentSystemThemeModeIsDark) {
|
|
||||||
WKApp.config.themeMode = ThemeMode.dark;
|
|
||||||
}
|
|
||||||
if (themeMode === "1") {
|
if (themeMode === "1") {
|
||||||
WKApp.config.themeMode = ThemeMode.dark;
|
WKApp.config.themeMode = ThemeMode.dark;
|
||||||
}
|
}
|
||||||
@ -380,16 +374,14 @@ export default class WKApp extends ProviderListener {
|
|||||||
return this.avatarChannel(c);
|
return this.avatarChannel(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
avatarOrg(orgID: string) {
|
avatarOrg(orgID: string){
|
||||||
const baseURl = WKApp.apiClient.config.apiURL;
|
const baseURl = WKApp.apiClient.config.apiURL;
|
||||||
return `${baseURl}organizations/${orgID}/logo`;
|
return `${baseURl}organizations/${orgID}/logo`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 我的用户头像发送改变
|
// 我的用户头像发送改变
|
||||||
myUserAvatarChange() {
|
myUserAvatarChange() {
|
||||||
this.changeChannelAvatarTag(
|
this.changeChannelAvatarTag(new Channel(WKApp.loginInfo.uid||"", ChannelTypePerson));
|
||||||
new Channel(WKApp.loginInfo.uid || "", ChannelTypePerson)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
changeChannelAvatarTag(channel: Channel) {
|
changeChannelAvatarTag(channel: Channel) {
|
||||||
@ -397,17 +389,17 @@ export default class WKApp extends ProviderListener {
|
|||||||
if (channel) {
|
if (channel) {
|
||||||
myAvatarTag = `channelAvatarTag:${channel.channelType}${channel.channelID}`;
|
myAvatarTag = `channelAvatarTag:${channel.channelType}${channel.channelID}`;
|
||||||
}
|
}
|
||||||
console.log("changeChannelAvatarTag0----->");
|
console.log('changeChannelAvatarTag0----->')
|
||||||
const t = new Date().getTime();
|
const t = new Date().getTime();
|
||||||
WKApp.loginInfo.setStorageItem(myAvatarTag, `${t}`);
|
WKApp.loginInfo.setStorageItem(myAvatarTag, `${t}`);
|
||||||
}
|
}
|
||||||
getChannelAvatarTag(channel?: Channel) {
|
getChannelAvatarTag(channel? :Channel) {
|
||||||
let myAvatarTag = "channelAvatarTag";
|
let myAvatarTag = "channelAvatarTag";
|
||||||
if (channel) {
|
if (channel) {
|
||||||
myAvatarTag = `channelAvatarTag:${channel.channelType}${channel.channelID}`;
|
myAvatarTag = `channelAvatarTag:${channel.channelType}${channel.channelID}`;
|
||||||
}
|
}
|
||||||
const tag = WKApp.loginInfo.getStorageItem(myAvatarTag);
|
const tag = WKApp.loginInfo.getStorageItem(myAvatarTag);
|
||||||
if (!tag) {
|
if(!tag) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return tag;
|
return tag;
|
||||||
@ -538,16 +530,13 @@ export default class WKApp extends ProviderListener {
|
|||||||
return friendApplys;
|
return friendApplys;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setFriendApplysUnreadCount() {
|
public setFriendApplysUnreadCount(){
|
||||||
if (WKApp.loginInfo.isLogined()) {
|
if(WKApp.loginInfo.isLogined()){
|
||||||
WKApp.apiClient.get(`/user/reddot/friendApply`).then((res) => {
|
WKApp.apiClient.get(`/user/reddot/friendApply`).then(res=>{
|
||||||
WKApp.mittBus.emit("friend-applys-unread-count", res.count);
|
WKApp.mittBus.emit('friend-applys-unread-count', res.count)
|
||||||
WKApp.loginInfo.setStorageItem(
|
WKApp.loginInfo.setStorageItem(`${WKApp.loginInfo.uid}-friend-applys-unread-count`, res.count);
|
||||||
`${WKApp.loginInfo.uid}-friend-applys-unread-count`,
|
|
||||||
res.count
|
|
||||||
);
|
|
||||||
WKApp.menus.refresh();
|
WKApp.menus.refresh();
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,9 +551,7 @@ export default class WKApp extends ProviderListener {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
if (WKApp.loginInfo.isLogined()) {
|
if (WKApp.loginInfo.isLogined()) {
|
||||||
const num = WKApp.loginInfo.getStorageItem(
|
const num = WKApp.loginInfo.getStorageItem(`${WKApp.loginInfo.uid}-friend-applys-unread-count`)
|
||||||
`${WKApp.loginInfo.uid}-friend-applys-unread-count`
|
|
||||||
);
|
|
||||||
unreadCount = Number(num);
|
unreadCount = Number(num);
|
||||||
}
|
}
|
||||||
return unreadCount;
|
return unreadCount;
|
||||||
@ -590,10 +577,7 @@ export default class WKApp extends ProviderListener {
|
|||||||
// WKApp.endpointManager.invokes(EndpointCategory.friendApplyDataChange);
|
// WKApp.endpointManager.invokes(EndpointCategory.friendApplyDataChange);
|
||||||
// }
|
// }
|
||||||
if (WKApp.loginInfo.isLogined()) {
|
if (WKApp.loginInfo.isLogined()) {
|
||||||
WKApp.loginInfo.setStorageItem(
|
WKApp.loginInfo.setStorageItem(`${WKApp.loginInfo.uid}-friend-applys-unread-count`, '0')
|
||||||
`${WKApp.loginInfo.uid}-friend-applys-unread-count`,
|
|
||||||
"0"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
await WKApp.apiClient.delete(`/user/reddot/friendApply`);
|
await WKApp.apiClient.delete(`/user/reddot/friendApply`);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ export class Conversation extends Component<ConversationProps> implements Conver
|
|||||||
contextMenusContext!: ContextMenusContext
|
contextMenusContext!: ContextMenusContext
|
||||||
avatarMenusContext!: ContextMenusContext // 点击头像弹出的菜单
|
avatarMenusContext!: ContextMenusContext // 点击头像弹出的菜单
|
||||||
_messageInputContext!: MessageInputContext
|
_messageInputContext!: MessageInputContext
|
||||||
scrollTimer?: NodeJS.Timer
|
scrollTimer: number | null = null
|
||||||
updateBrowseToMessageSeqAndReminderDoneing: boolean = false
|
updateBrowseToMessageSeqAndReminderDoneing: boolean = false
|
||||||
private _dragFileCallback?: (file: File) => void
|
private _dragFileCallback?: (file: File) => void
|
||||||
|
|
||||||
@ -249,10 +249,11 @@ export class Conversation extends Component<ConversationProps> implements Conver
|
|||||||
handleScroll(e: any) {
|
handleScroll(e: any) {
|
||||||
if (this.scrollTimer) {
|
if (this.scrollTimer) {
|
||||||
clearTimeout(this.scrollTimer)
|
clearTimeout(this.scrollTimer)
|
||||||
|
this.scrollTimer = null
|
||||||
}
|
}
|
||||||
this.scrollTimer = setTimeout(() => {
|
this.scrollTimer = window.setTimeout(() => {
|
||||||
this.handleScrollEnd()
|
this.handleScrollEnd()
|
||||||
}, 500)
|
}, 500)
|
||||||
this.contextMenusContext.hide()
|
this.contextMenusContext.hide()
|
||||||
const targetScrollTop = e.target.scrollTop;
|
const targetScrollTop = e.target.scrollTop;
|
||||||
const scrollOffsetTop = e.target.scrollHeight - (targetScrollTop + e.target.clientHeight);
|
const scrollOffsetTop = e.target.scrollHeight - (targetScrollTop + e.target.clientHeight);
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import { Checkbox } from "@douyinfe/semi-ui";
|
import { Checkbox } from "@douyinfe/semi-ui/lib/es/checkbox";
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { getPinyin } from "../../Utils/pinYin";
|
import { getPinyin } from "../../Utils/pinYin";
|
||||||
import { toSimplized } from "../../Utils/t2s";
|
import { toSimplized } from "../../Utils/t2s";
|
||||||
|
import "./index.css";
|
||||||
import { IconSearchStroked } from "@douyinfe/semi-icons";
|
import { IconSearchStroked } from "@douyinfe/semi-icons";
|
||||||
import { animateScroll, scroller } from "react-scroll";
|
import { animateScroll, scroller } from "react-scroll";
|
||||||
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
export class IndexTableItem {
|
export class IndexTableItem {
|
||||||
id!: string;
|
id!: string;
|
||||||
name!: string;
|
name!: string;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import "./index.css"
|
import "./index.css"
|
||||||
import { Input } from "@douyinfe/semi-ui";
|
import { Input } from "@douyinfe/semi-ui/lib/es/input";
|
||||||
import { IconSearchStroked } from '@douyinfe/semi-icons';
|
import { IconSearchStroked } from '@douyinfe/semi-icons';
|
||||||
|
|
||||||
export interface SearchProps {
|
export interface SearchProps {
|
||||||
|
@ -3,14 +3,12 @@ import React from "react";
|
|||||||
import { Component } from "react";
|
import { Component } from "react";
|
||||||
import Provider from "../../Service/Provider";
|
import Provider from "../../Service/Provider";
|
||||||
import WKApp from "../../App";
|
import WKApp from "../../App";
|
||||||
|
import "./index.css";
|
||||||
import { SubscribersVM } from "./vm";
|
import { SubscribersVM } from "./vm";
|
||||||
import IndexTable, { IndexTableItem } from "../IndexTable";
|
import IndexTable, { IndexTableItem } from "../IndexTable";
|
||||||
import WKBase, { WKBaseContext } from "../WKBase";
|
import WKBase, { WKBaseContext } from "../WKBase";
|
||||||
import RouteContext, { RouteContextConfig } from "../../Service/Context";
|
import RouteContext, { RouteContextConfig } from "../../Service/Context";
|
||||||
import { SubscriberList } from "./list";
|
import { SubscriberList } from "./list";
|
||||||
import { ChannelSettingRouteData } from "../../Components/ChannelSetting/context";
|
|
||||||
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
export interface SubscribersProps {
|
export interface SubscribersProps {
|
||||||
context: RouteContext<any>;
|
context: RouteContext<any>;
|
||||||
@ -46,10 +44,6 @@ export class Subscribers extends Component<SubscribersProps> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { context, onAdd, onRemove, channel } = this.props;
|
const { context, onAdd, onRemove, channel } = this.props;
|
||||||
const data = context.routeData() as ChannelSettingRouteData;
|
|
||||||
const disableSelectList = data.subscribers.map((subscriber) => {
|
|
||||||
return subscriber.uid;
|
|
||||||
});
|
|
||||||
return (
|
return (
|
||||||
<Provider
|
<Provider
|
||||||
create={() => {
|
create={() => {
|
||||||
@ -86,7 +80,6 @@ export class Subscribers extends Component<SubscribersProps> {
|
|||||||
{vm.showAdd()
|
{vm.showAdd()
|
||||||
? WKApp.endpoints.organizationalTool(
|
? WKApp.endpoints.organizationalTool(
|
||||||
channel,
|
channel,
|
||||||
disableSelectList,
|
|
||||||
<div className="wk-subscribers-item">
|
<div className="wk-subscribers-item">
|
||||||
<img
|
<img
|
||||||
src={require("./assets/icon_add_more_gray.png")}
|
src={require("./assets/icon_add_more_gray.png")}
|
||||||
|
@ -162,15 +162,10 @@ export class EndpointCommon {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
organizationalTool(
|
organizationalTool(channel: Channel, render?: JSX.Element): JSX.Element {
|
||||||
channel: Channel,
|
|
||||||
disableSelectList?: string[],
|
|
||||||
render?: JSX.Element
|
|
||||||
): JSX.Element {
|
|
||||||
return EndpointManager.shared.invoke(EndpointCategory.organizational, {
|
return EndpointManager.shared.invoke(EndpointCategory.organizational, {
|
||||||
channel,
|
channel: channel,
|
||||||
disableSelectList,
|
render: render,
|
||||||
render,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,10 +184,9 @@ export class EndpointCommon {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
organizationalLayer(channel: Channel, disableSelectList?: string[]): void {
|
organizationalLayer(channel: Channel): void {
|
||||||
return EndpointManager.shared.invoke(EndpointCategory.organizationalLayer, {
|
return EndpointManager.shared.invoke(EndpointCategory.organizationalLayer, {
|
||||||
channel,
|
channel: channel,
|
||||||
disableSelectList,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,232 +1,231 @@
|
|||||||
.wk-chat {
|
.wk-chat {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content {
|
.wk-chat-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content-left {
|
.wk-chat-content-left {
|
||||||
width: var(--wk-wdith-conversation-list);
|
width: var(--wk-wdith-conversation-list);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-right: var(--wk-line);
|
border-right: var(--wk-line);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-search {
|
.wk-chat-search {
|
||||||
height: var(--wk-height-chat-search);
|
height: var(--wk-height-chat-search);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px 20px 0px 20px;
|
padding: 0px 20px 0px 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-search-add {
|
.wk-chat-search-add {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
body[theme-mode="dark"] .wk-chat-search-add {
|
body[theme-mode=dark] .wk-chat-search-add {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-title {
|
.wk-chat-title {
|
||||||
width: 250px;
|
width: 250px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
body[theme-mode="dark"] .wk-chat-title {
|
body[theme-mode=dark] .wk-chat-title {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-list {
|
.wk-chat-conversation-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - var(--wk-height-chat-search));
|
height: calc(100% - var(--wk-height-chat-search));
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content-right {
|
.wk-chat-content-right {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 640px) {
|
@media screen and (max-width: 640px) {
|
||||||
.wk-chat-content-right {
|
.wk-chat-content-right {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
transform: translate3d(0, 0, 0);
|
transform: translate3d(0, 0, 0);
|
||||||
transition: transform var(--wk-layer-transition);
|
transition: transform var(--wk-layer-transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content:not(.wk-conversation-open) .wk-chat-content-right {
|
.wk-chat-content:not(.wk-conversation-open) .wk-chat-content-right {
|
||||||
transform: translate3d(100vw, 0, 0);
|
transform: translate3d(100vw, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content-left {
|
.wk-chat-content-left {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-back {
|
.wk-chat-conversation-header-back {
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content-chat {
|
.wk-chat-content-chat {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
transition: width 150ms ease-in-out 0s;
|
transition: width 150ms ease-in-out 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content-right.wk-chat-channelsetting-open .wk-chat-content-chat {
|
.wk-chat-content-right.wk-chat-channelsetting-open .wk-chat-content-chat {
|
||||||
width: calc(100% - var(--wk-wdith-chat-channelsetting));
|
width: calc(100% - var(--wk-wdith-chat-channelsetting));
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation {
|
.wk-chat-conversation {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - var(--wk-height-chat-conversation-header));
|
height: calc(100% - var(--wk-height-chat-conversation-header));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.wk-chat-empty {
|
.wk-chat-empty {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: var(--wk-color-secondary);
|
background-color: var(--wk-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-empty img {
|
.wk-chat-empty img {
|
||||||
height: 340px;
|
height: 340px;
|
||||||
transform: scale(1.14);
|
transform: scale(1.14);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header {
|
.wk-chat-conversation-header {
|
||||||
height: var(--wk-height-chat-conversation-header);
|
height: var(--wk-height-chat-conversation-header);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
box-shadow: 0 1px 1px rgba(114, 114, 114, 0.168627);
|
box-shadow: 0 1px 1px rgba(114,114,114,0.168627);
|
||||||
z-index: 11;
|
z-index: 11;
|
||||||
padding: 0.5rem 0.8125rem 0.5rem 1.5rem;
|
padding: 0.5rem 0.8125rem 0.5rem 1.5rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
body[theme-mode="dark"] .wk-chat-conversation-header {
|
body[theme-mode=dark] .wk-chat-conversation-header {
|
||||||
background-color: var(--wk-color-secondary);
|
background-color: var(--wk-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-left {
|
.wk-chat-conversation-header-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-back {
|
.wk-chat-conversation-header-back {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
display: none;
|
display: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-back-icon {
|
.wk-chat-conversation-header-back-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
/* transform: rotate(-45deg); */
|
/* transform: rotate(-45deg); */
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-back-icon::before,
|
.wk-chat-conversation-header-back-icon::before, .wk-chat-conversation-header-back-icon::after {
|
||||||
.wk-chat-conversation-header-back-icon::after {
|
position: absolute;
|
||||||
position: absolute;
|
left: 0;
|
||||||
left: 0;
|
top: 0;
|
||||||
top: 0;
|
content: "";
|
||||||
content: "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-back-icon::after {
|
.wk-chat-conversation-header-back-icon::after {
|
||||||
transform: rotate(-45deg) scaleX(0.75) translate(0, 0.375rem);
|
transform: rotate(-45deg) scaleX(0.75) translate(0, 0.375rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-back-icon::before {
|
.wk-chat-conversation-header-back-icon::before {
|
||||||
transform: rotate(45deg) scaleX(0.75) translate(0, -0.375rem);
|
transform: rotate(45deg) scaleX(0.75) translate(0, -0.375rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-back-icon,
|
.wk-chat-conversation-header-back-icon, .wk-chat-conversation-header-back-icon::before, .wk-chat-conversation-header-back-icon::after {
|
||||||
.wk-chat-conversation-header-back-icon::before,
|
width: 1.125rem;
|
||||||
.wk-chat-conversation-header-back-icon::after {
|
height: 0.125rem;
|
||||||
width: 1.125rem;
|
border-radius: 0.125rem;
|
||||||
height: 0.125rem;
|
background-color: rgb(112,117,121);
|
||||||
border-radius: 0.125rem;
|
transition: transform var(--wk-slide-transition);
|
||||||
background-color: rgb(112, 117, 121);
|
|
||||||
transition: transform var(--wk-slide-transition);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.wk-chat-conversation-header-channel {
|
.wk-chat-conversation-header-channel {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-channel-avatar img {
|
.wk-chat-conversation-header-channel-avatar img {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border-radius: 40%;
|
border-radius: 40%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-channel-info {
|
.wk-chat-conversation-header-channel-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-channel-info-name {
|
.wk-chat-conversation-header-channel-info-name {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
body[theme-mode="dark"] .wk-chat-conversation-header-channel-info-name {
|
body[theme-mode=dark] .wk-chat-conversation-header-channel-info-name {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-content {
|
.wk-chat-conversation-header-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-right {
|
.wk-chat-conversation-header-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-right div {
|
.wk-chat-conversation-header-right div {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-right div:last-child {
|
.wk-chat-conversation-header-right div:last-child {
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-setting {
|
.wk-chat-conversation-header-setting {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-channelsetting {
|
.wk-chat-channelsetting {
|
||||||
@ -258,73 +257,68 @@ body[theme-mode=dark] .wk-chat-channelsetting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-content-right.wk-chat-channelsetting-open .wk-chat-channelsetting {
|
.wk-chat-content-right.wk-chat-channelsetting-open .wk-chat-channelsetting {
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-list-loading {
|
.wk-chat-conversation-list-loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chatmenuspopover {
|
.wk-chatmenuspopover {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chatmenuspopover ul {
|
.wk-chatmenuspopover ul {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body[theme-mode="dark"] .wk-chat-popover {
|
body[theme-mode=dark] .wk-chat-popover {
|
||||||
background-color: var(--wk-color-secondary);
|
background-color: var(--wk-color-secondary);
|
||||||
color: white;
|
color: white;
|
||||||
--color-popover-bg-default: red;
|
--color-popover-bg-default: red
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chatmenuspopover li {
|
.wk-chatmenuspopover li {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chatmenuspopover li:first-child {
|
.wk-chatmenuspopover li:first-child {
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chatmenuspopover li img {
|
.wk-chatmenuspopover li img {
|
||||||
width: 18px;
|
width: 20px;
|
||||||
height: 18px;
|
height: 20px;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chatmenuspopover-title {
|
.wk-chatmenuspopover-title {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
|
||||||
|
|
||||||
.wk-chatmenuspopover-avatar {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-chat-conversation-header-right-item {
|
.wk-chat-conversation-header-right-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-conversation-header-mask {
|
.wk-conversation-header-mask {
|
||||||
background-color: rgb(0, 0, 0, 0);
|
background-color: rgb(0,0,0,0.0);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wk-conversation-header-mask:hover {
|
.wk-conversation-header-mask:hover {
|
||||||
background-color: rgb(0, 0, 0, 0.1);
|
background-color: rgb(0,0,0,0.1);
|
||||||
}
|
}
|
@ -88,6 +88,8 @@ export default class BaseModule implements IModule {
|
|||||||
return "base";
|
return "base";
|
||||||
}
|
}
|
||||||
init(): void {
|
init(): void {
|
||||||
|
|
||||||
|
|
||||||
APIClient.shared.logoutCallback = () => {
|
APIClient.shared.logoutCallback = () => {
|
||||||
WKApp.shared.logout();
|
WKApp.shared.logout();
|
||||||
};
|
};
|
||||||
@ -227,9 +229,7 @@ export default class BaseModule implements IModule {
|
|||||||
cmdContent.param.from_name
|
cmdContent.param.from_name
|
||||||
);
|
);
|
||||||
} else if (cmdContent.cmd === "groupAvatarUpdate") {
|
} else if (cmdContent.cmd === "groupAvatarUpdate") {
|
||||||
WKApp.shared.changeChannelAvatarTag(
|
WKApp.shared.changeChannelAvatarTag(new Channel(param.group_no, ChannelTypeGroup));
|
||||||
new Channel(param.group_no, ChannelTypeGroup)
|
|
||||||
);
|
|
||||||
// 群头像更新
|
// 群头像更新
|
||||||
WKSDK.shared().channelManager.fetchChannelInfo(
|
WKSDK.shared().channelManager.fetchChannelInfo(
|
||||||
new Channel(param.group_no, ChannelTypeGroup)
|
new Channel(param.group_no, ChannelTypeGroup)
|
||||||
@ -343,11 +343,8 @@ export default class BaseModule implements IModule {
|
|||||||
ConversationAction.update
|
ConversationAction.update
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (cmdContent.cmd === "userAvatarUpdate") {
|
} else if (cmdContent.cmd === "userAvatarUpdate") { // 用户头像更新
|
||||||
// 用户头像更新
|
WKApp.shared.changeChannelAvatarTag(new Channel(param.uid, ChannelTypePerson));
|
||||||
WKApp.shared.changeChannelAvatarTag(
|
|
||||||
new Channel(param.uid, ChannelTypePerson)
|
|
||||||
);
|
|
||||||
WKApp.dataSource.notifyContactsChange();
|
WKApp.dataSource.notifyContactsChange();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -453,16 +450,15 @@ export default class BaseModule implements IModule {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (window.Notification && Notification.permission !== "denied") {
|
if (window.Notification && Notification.permission !== "denied") {
|
||||||
const options = {
|
|
||||||
body: description,
|
|
||||||
icon: WKApp.shared.avatarChannel(message.channel),
|
|
||||||
lang: "zh-CN",
|
|
||||||
tag: "tag",
|
|
||||||
renotify: true,
|
|
||||||
};
|
|
||||||
const notify = new Notification(
|
const notify = new Notification(
|
||||||
channelInfo ? channelInfo.orgData.displayName : "通知",
|
channelInfo ? channelInfo.orgData.displayName : "通知",
|
||||||
options
|
{
|
||||||
|
body: description,
|
||||||
|
icon: WKApp.shared.avatarChannel(message.channel),
|
||||||
|
lang: "zh-CN",
|
||||||
|
tag: "tag",
|
||||||
|
// renotify: true,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
notify.onclick = () => {
|
notify.onclick = () => {
|
||||||
@ -513,7 +509,7 @@ export default class BaseModule implements IModule {
|
|||||||
icon={require("./assets/toolbars/func_screenshot.svg").default}
|
icon={require("./assets/toolbars/func_screenshot.svg").default}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if ((window as any).__POWERED_ELECTRON__) {
|
if ((window as any).__POWERED_ELECTRON__) {
|
||||||
(window as any).ipc.send("screenshots-start", {});
|
(window as any).ipc.send('screenshots-start', {})
|
||||||
} else {
|
} else {
|
||||||
window.open("https://www.snipaste.com");
|
window.open("https://www.snipaste.com");
|
||||||
}
|
}
|
||||||
@ -536,11 +532,10 @@ export default class BaseModule implements IModule {
|
|||||||
const isDark = WKApp.config.themeMode === ThemeMode.dark;
|
const isDark = WKApp.config.themeMode === ThemeMode.dark;
|
||||||
return {
|
return {
|
||||||
title: "发起群聊",
|
title: "发起群聊",
|
||||||
icon: require(`${
|
icon: require(`${isDark
|
||||||
isDark
|
? "./assets/popmenus_startchat_dark.png"
|
||||||
? "./assets/popmenus_startchat_dark.png"
|
: "./assets/popmenus_startchat.png"
|
||||||
: "./assets/popmenus_startchat.png"
|
}`),
|
||||||
}`),
|
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
const channel: any = {
|
const channel: any = {
|
||||||
channelID: localStorage.uid,
|
channelID: localStorage.uid,
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tsdaodao/base": "*",
|
"@tsdaodao/base": "*",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"classnames": "^2.3.1",
|
"classnames": "^2.3.1"
|
||||||
"react-infinite-scroller": "^1.2.6"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,287 +1,246 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Component } from "react";
|
import { Component } from "react";
|
||||||
import {
|
import { Contacts, ContactsChangeListener, ContextMenus, ContextMenusContext, WKApp, WKBase, WKBaseContext, WKNavMainHeader, Search, UserRelation } from "@tsdaodao/base"
|
||||||
Contacts,
|
import "./index.css"
|
||||||
ContactsChangeListener,
|
|
||||||
ContextMenus,
|
|
||||||
ContextMenusContext,
|
|
||||||
WKApp,
|
|
||||||
WKBase,
|
|
||||||
WKBaseContext,
|
|
||||||
WKNavMainHeader,
|
|
||||||
Search,
|
|
||||||
UserRelation,
|
|
||||||
} from "@tsdaodao/base";
|
|
||||||
import "./index.css";
|
|
||||||
import { toSimplized } from "@tsdaodao/base";
|
import { toSimplized } from "@tsdaodao/base";
|
||||||
import { getPinyin } from "@tsdaodao/base";
|
import { getPinyin } from "@tsdaodao/base";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import { Toast } from "@douyinfe/semi-ui";
|
import { Toast } from "@douyinfe/semi-ui";
|
||||||
import {
|
import { Channel, ChannelTypePerson, WKSDK,ChannelInfoListener,ChannelInfo } from "wukongimjssdk";
|
||||||
Channel,
|
|
||||||
ChannelTypePerson,
|
|
||||||
WKSDK,
|
|
||||||
ChannelInfoListener,
|
|
||||||
ChannelInfo,
|
|
||||||
} from "wukongimjssdk";
|
|
||||||
import { ContactsListManager } from "../Service/ContactsListManager";
|
import { ContactsListManager } from "../Service/ContactsListManager";
|
||||||
import { Card } from "@tsdaodao/base/src/Messages/Card";
|
import { Card } from "@tsdaodao/base/src/Messages/Card";
|
||||||
import WKAvatar from "@tsdaodao/base/src/Components/WKAvatar";
|
import WKAvatar from "@tsdaodao/base/src/Components/WKAvatar";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export class ContactsState {
|
export class ContactsState {
|
||||||
indexList: string[] = [];
|
indexList: string[] = []
|
||||||
indexItemMap: Map<string, Contacts[]> = new Map();
|
indexItemMap: Map<string, Contacts[]> = new Map()
|
||||||
keyword?: string;
|
keyword?: string
|
||||||
selectedItem?: Contacts; // 被选中的联系人
|
selectedItem?: Contacts // 被选中的联系人
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class ContactsList extends Component<any, ContactsState> {
|
export default class ContactsList extends Component<any, ContactsState> {
|
||||||
contactsChangeListener!: ContactsChangeListener;
|
contactsChangeListener!: ContactsChangeListener
|
||||||
channelInfoListener!: ChannelInfoListener;
|
channelInfoListener!: ChannelInfoListener
|
||||||
contextMenusContext!: ContextMenusContext;
|
contextMenusContext!: ContextMenusContext
|
||||||
baseContext!: WKBaseContext;
|
baseContext!: WKBaseContext
|
||||||
constructor(props: any) {
|
constructor(props: any) {
|
||||||
super(props);
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
indexList: [],
|
indexList: [],
|
||||||
indexItemMap: new Map(),
|
indexItemMap: new Map()
|
||||||
};
|
|
||||||
}
|
|
||||||
componentDidMount() {
|
|
||||||
this.contactsChangeListener = () => {
|
|
||||||
this.rebuildIndex();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.channelInfoListener = (channelInfo: ChannelInfo) => {
|
|
||||||
if (channelInfo.channel.channelType !== ChannelTypePerson) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//是否包含
|
|
||||||
let exist = false;
|
|
||||||
WKApp.dataSource.contactsList.forEach((v) => {
|
|
||||||
if (v.uid === channelInfo.channel.channelID) {
|
|
||||||
exist = true;
|
|
||||||
v.name = channelInfo.title;
|
|
||||||
v.remark = channelInfo?.orgData.remark;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
if (exist) {
|
|
||||||
this.rebuildIndex();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
WKApp.dataSource.addContactsChangeListener(this.contactsChangeListener);
|
|
||||||
|
|
||||||
this.rebuildIndex();
|
|
||||||
|
|
||||||
WKSDK.shared().channelManager.addListener(this.channelInfoListener);
|
|
||||||
|
|
||||||
ContactsListManager.shared.setRefreshList = () => {
|
|
||||||
this.setState({});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
ContactsListManager.shared.setRefreshList = undefined;
|
|
||||||
WKApp.dataSource.removeContactsChangeListener(this.contactsChangeListener);
|
|
||||||
WKSDK.shared().channelManager.removeListener(this.channelInfoListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
rebuildIndex() {
|
|
||||||
console.log("rebuildIndex---->");
|
|
||||||
this.buildIndex(this.contactsList());
|
|
||||||
}
|
|
||||||
|
|
||||||
contactsList() {
|
|
||||||
const { keyword } = this.state;
|
|
||||||
return WKApp.dataSource.contactsList.filter((v) => {
|
|
||||||
if (v.status === UserRelation.blacklist) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (v.follow !== 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!keyword || keyword === "") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (v.remark && v.remark !== "") {
|
|
||||||
if (v.remark.indexOf(keyword) !== -1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return v.name.indexOf(keyword) !== -1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
buildIndex(contacts: Contacts[]) {
|
|
||||||
const indexItemMap = new Map<string, Contacts[]>();
|
|
||||||
let indexList = [];
|
|
||||||
for (const item of contacts) {
|
|
||||||
let name = item.name;
|
|
||||||
if (item.remark && item.remark !== "") {
|
|
||||||
name = item.remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
let pinyinNick = getPinyin(toSimplized(name)).toUpperCase();
|
|
||||||
let indexName =
|
|
||||||
!pinyinNick || /[^a-z]/i.test(pinyinNick[0]) ? "#" : pinyinNick[0];
|
|
||||||
|
|
||||||
let existItems = indexItemMap.get(indexName);
|
|
||||||
if (!existItems) {
|
|
||||||
existItems = [];
|
|
||||||
indexList.push(indexName);
|
|
||||||
}
|
|
||||||
existItems.push(item);
|
|
||||||
indexItemMap.set(indexName, existItems);
|
|
||||||
}
|
}
|
||||||
indexList = indexList.sort((a, b) => {
|
componentDidMount() {
|
||||||
if (a === "#") {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (b === "#") {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return a.localeCompare(b);
|
|
||||||
});
|
|
||||||
this.setState({
|
|
||||||
indexList: indexList,
|
|
||||||
indexItemMap: indexItemMap,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
_handleContextMenu(item: Contacts, event: React.MouseEvent) {
|
this.contactsChangeListener = () => {
|
||||||
this.contextMenusContext.show(event);
|
this.rebuildIndex()
|
||||||
this.setState({
|
}
|
||||||
selectedItem: item,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
sectionUI(indexName: string) {
|
this.channelInfoListener = (channelInfo:ChannelInfo)=>{
|
||||||
const { indexItemMap } = this.state;
|
if(channelInfo.channel.channelType !== ChannelTypePerson) {
|
||||||
const { canSelect } = this.props;
|
return
|
||||||
const items = indexItemMap.get(indexName);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div key={indexName} className="wk-contacts-section">
|
|
||||||
<div className="wk-contacts-section-list">
|
|
||||||
{items?.map((item, i) => {
|
|
||||||
let name = item.name;
|
|
||||||
if (item.remark && item.remark !== "") {
|
|
||||||
name = item.remark;
|
|
||||||
}
|
}
|
||||||
return (
|
//是否包含
|
||||||
<div
|
let exist = false
|
||||||
key={item.uid}
|
WKApp.dataSource.contactsList.forEach((v)=>{
|
||||||
className={classnames(
|
if(v.uid === channelInfo.channel.channelID) {
|
||||||
"wk-contacts-section-item",
|
exist = true
|
||||||
WKApp.shared.openChannel?.channelType === ChannelTypePerson &&
|
v.name = channelInfo.title
|
||||||
WKApp.shared.openChannel?.channelID === item.uid
|
v.remark = channelInfo?.orgData.remark
|
||||||
? "wk-contacts-section-item-selected"
|
return
|
||||||
: undefined
|
}
|
||||||
)}
|
})
|
||||||
onClick={() => {
|
if(exist) {
|
||||||
const channel = new Channel(item.uid, ChannelTypePerson);
|
this.rebuildIndex()
|
||||||
WKApp.endpoints.showConversation(channel);
|
}
|
||||||
this.setState({});
|
}
|
||||||
}}
|
|
||||||
onContextMenu={(e) => {
|
WKApp.dataSource.addContactsChangeListener(this.contactsChangeListener)
|
||||||
this._handleContextMenu(item, e);
|
|
||||||
}}
|
this.rebuildIndex()
|
||||||
>
|
|
||||||
<div className="wk-contacts-section-item-index">
|
WKSDK.shared().channelManager.addListener(this.channelInfoListener)
|
||||||
{i === 0 ? indexName : ""}
|
|
||||||
</div>
|
ContactsListManager.shared.setRefreshList = () => {
|
||||||
<div className="wk-contacts-section-item-avatar">
|
this.setState({})
|
||||||
<WKAvatar
|
}
|
||||||
channel={new Channel(item.uid, ChannelTypePerson)}
|
}
|
||||||
></WKAvatar>
|
|
||||||
</div>
|
componentWillUnmount() {
|
||||||
<div className="wk-contacts-section-item-name">{name}</div>
|
ContactsListManager.shared.setRefreshList = undefined
|
||||||
</div>
|
WKApp.dataSource.removeContactsChangeListener(this.contactsChangeListener)
|
||||||
);
|
WKSDK.shared().channelManager.removeListener(this.channelInfoListener)
|
||||||
})}
|
}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
rebuildIndex() {
|
||||||
}
|
console.log("rebuildIndex---->")
|
||||||
render() {
|
this.buildIndex(this.contactsList())
|
||||||
const { indexList } = this.state;
|
}
|
||||||
return (
|
|
||||||
<WKBase
|
contactsList() {
|
||||||
onContext={(baseCtx) => {
|
const { keyword } = this.state
|
||||||
this.baseContext = baseCtx;
|
return WKApp.dataSource.contactsList.filter((v) => {
|
||||||
}}
|
if (v.status === UserRelation.blacklist) {
|
||||||
>
|
return false
|
||||||
<div className="wk-contacts">
|
}
|
||||||
<WKNavMainHeader title="联系人"></WKNavMainHeader>
|
if (v.follow !== 1) {
|
||||||
<div className="wk-contacts-content">
|
return false
|
||||||
<div className="wk-contacts-content-header">
|
}
|
||||||
<Search
|
if (!keyword || keyword === "") {
|
||||||
placeholder="搜索"
|
return true
|
||||||
onChange={(v) => {
|
}
|
||||||
this.setState(
|
|
||||||
{
|
if (v.remark && v.remark !== "") {
|
||||||
keyword: v,
|
if (v.remark.indexOf(keyword) !== -1) {
|
||||||
},
|
return true
|
||||||
() => {
|
}
|
||||||
this.rebuildIndex();
|
}
|
||||||
}
|
|
||||||
);
|
return v.name.indexOf(keyword) !== -1
|
||||||
}}
|
})
|
||||||
></Search>
|
}
|
||||||
</div>
|
|
||||||
<div className="wk-contacts-content-fnc">
|
|
||||||
{WKApp.endpoints.contactsHeaders().map((view, i) => {
|
buildIndex(contacts: Contacts[]) {
|
||||||
return <div key={i}>{view}</div>;
|
const indexItemMap = new Map<string, Contacts[]>()
|
||||||
})}
|
let indexList = []
|
||||||
</div>
|
for (const item of contacts) {
|
||||||
<div className="wk-contacts-content-contacts">
|
let name = item.name
|
||||||
{indexList.map((indexName) => {
|
if (item.remark && item.remark !== "") {
|
||||||
return this.sectionUI(indexName);
|
name = item.remark
|
||||||
})}
|
}
|
||||||
</div>
|
|
||||||
</div>
|
let pinyinNick = getPinyin(toSimplized(name)).toUpperCase();
|
||||||
<ContextMenus
|
let indexName = !pinyinNick || /[^a-z]/i.test(pinyinNick[0]) ? "#" : pinyinNick[0];
|
||||||
onContext={(context: ContextMenusContext) => {
|
|
||||||
this.contextMenusContext = context;
|
let existItems = indexItemMap.get(indexName)
|
||||||
}}
|
if (!existItems) {
|
||||||
menus={[
|
existItems = []
|
||||||
{
|
indexList.push(indexName)
|
||||||
title: "查看资料",
|
}
|
||||||
onClick: () => {
|
existItems.push(item)
|
||||||
const { selectedItem } = this.state;
|
indexItemMap.set(indexName, existItems)
|
||||||
this.baseContext.showUserInfo(selectedItem?.uid || "");
|
}
|
||||||
},
|
indexList = indexList.sort((a, b) => {
|
||||||
},
|
if (a === "#") {
|
||||||
{
|
return -1
|
||||||
title: "分享给朋友...",
|
}
|
||||||
onClick: () => {
|
if (b === "#") {
|
||||||
WKApp.shared.baseContext.showConversationSelect(
|
return 1
|
||||||
(channels: Channel[]) => {
|
}
|
||||||
const { selectedItem } = this.state;
|
return a.localeCompare(b)
|
||||||
if (channels && channels.length > 0) {
|
})
|
||||||
for (const channel of channels) {
|
this.setState({
|
||||||
const card = new Card();
|
indexList: indexList,
|
||||||
card.uid = selectedItem?.uid || "";
|
indexItemMap: indexItemMap,
|
||||||
card.name = selectedItem?.name || "";
|
})
|
||||||
card.vercode = selectedItem?.vercode || "";
|
}
|
||||||
WKSDK.shared().chatManager.send(card, channel);
|
|
||||||
|
_handleContextMenu(item: Contacts, event: React.MouseEvent) {
|
||||||
|
this.contextMenusContext.show(event)
|
||||||
|
this.setState({
|
||||||
|
selectedItem: item,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
sectionUI(indexName: string) {
|
||||||
|
const { indexItemMap } = this.state
|
||||||
|
const { canSelect } = this.props
|
||||||
|
const items = indexItemMap.get(indexName)
|
||||||
|
|
||||||
|
return <div key={indexName} className="wk-contacts-section">
|
||||||
|
<div className="wk-contacts-section-list">
|
||||||
|
{
|
||||||
|
items?.map((item, i) => {
|
||||||
|
let name = item.name
|
||||||
|
if (item.remark && item.remark !== "") {
|
||||||
|
name = item.remark
|
||||||
}
|
}
|
||||||
Toast.success("分享成功!");
|
return <div key={item.uid} className={classnames("wk-contacts-section-item", WKApp.shared.openChannel?.channelType === ChannelTypePerson && WKApp.shared.openChannel?.channelID === item.uid ? "wk-contacts-section-item-selected" : undefined)} onClick={() => {
|
||||||
}
|
const channel = new Channel(item.uid, ChannelTypePerson)
|
||||||
},
|
WKApp.endpoints.showConversation(channel)
|
||||||
"分享名片"
|
this.setState({})
|
||||||
);
|
}} onContextMenu={(e) => {
|
||||||
},
|
this._handleContextMenu(item, e)
|
||||||
},
|
}}>
|
||||||
]}
|
<div className="wk-contacts-section-item-index">
|
||||||
/>
|
{i === 0 ? indexName : ""}
|
||||||
|
</div>
|
||||||
|
<div className="wk-contacts-section-item-avatar">
|
||||||
|
<WKAvatar channel={new Channel(item.uid, ChannelTypePerson)}></WKAvatar>
|
||||||
|
</div>
|
||||||
|
<div className="wk-contacts-section-item-name">
|
||||||
|
{name}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</WKBase>
|
|
||||||
);
|
}
|
||||||
}
|
render() {
|
||||||
}
|
const { indexList } = this.state
|
||||||
|
return <WKBase onContext={(baseCtx) => {
|
||||||
|
this.baseContext = baseCtx
|
||||||
|
}}>
|
||||||
|
<div className="wk-contacts">
|
||||||
|
<WKNavMainHeader title="联系人"></WKNavMainHeader>
|
||||||
|
<div className="wk-contacts-content">
|
||||||
|
<div className="wk-contacts-content-header">
|
||||||
|
<Search placeholder="搜索" onChange={(v) => {
|
||||||
|
this.setState({
|
||||||
|
keyword: v
|
||||||
|
}, () => {
|
||||||
|
this.rebuildIndex()
|
||||||
|
})
|
||||||
|
}}></Search>
|
||||||
|
</div>
|
||||||
|
<div className="wk-contacts-content-fnc">
|
||||||
|
{
|
||||||
|
WKApp.endpoints.contactsHeaders().map((view, i) => {
|
||||||
|
return <div key={i}>{view}</div>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div className="wk-contacts-content-contacts">
|
||||||
|
{
|
||||||
|
indexList.map((indexName) => {
|
||||||
|
return this.sectionUI(indexName)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ContextMenus onContext={(context: ContextMenusContext) => {
|
||||||
|
this.contextMenusContext = context
|
||||||
|
}} menus={[{
|
||||||
|
title: "查看资料", onClick: () => {
|
||||||
|
const { selectedItem } = this.state
|
||||||
|
this.baseContext.showUserInfo(selectedItem?.uid || "")
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
title: "分享给朋友...", onClick: () => {
|
||||||
|
WKApp.shared.baseContext.showConversationSelect((channels: Channel[]) => {
|
||||||
|
const { selectedItem } = this.state
|
||||||
|
if (channels && channels.length > 0) {
|
||||||
|
for (const channel of channels) {
|
||||||
|
const card = new Card()
|
||||||
|
card.uid = selectedItem?.uid || ""
|
||||||
|
card.name = selectedItem?.name || ""
|
||||||
|
card.vercode = selectedItem?.vercode||""
|
||||||
|
WKSDK.shared().chatManager.send(card, channel)
|
||||||
|
}
|
||||||
|
Toast.success("分享成功!")
|
||||||
|
}
|
||||||
|
}, "分享名片")
|
||||||
|
}
|
||||||
|
}]} />
|
||||||
|
</div>
|
||||||
|
</WKBase>
|
||||||
|
}
|
||||||
|
}
|
@ -1,98 +1,81 @@
|
|||||||
import { WKApp, WKViewQueueHeader, QRCodeMy, Search } from "@tsdaodao/base";
|
import { WKApp, WKViewQueueHeader, QRCodeMy, Search } from "@tsdaodao/base";
|
||||||
import { WKBase, WKBaseContext } from "@tsdaodao/base";
|
import {WKBase, WKBaseContext } from "@tsdaodao/base";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Component, ReactNode } from "react";
|
import { Component, ReactNode } from "react";
|
||||||
import { Spin, Toast } from "@douyinfe/semi-ui";
|
import { Spin,Toast } from '@douyinfe/semi-ui';
|
||||||
import "./index.css";
|
import "./index.css"
|
||||||
|
|
||||||
export interface FriendAddProps {
|
export interface FriendAddProps {
|
||||||
onBack?: () => void;
|
onBack?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FriendAddState {
|
export class FriendAddState {
|
||||||
spinning!: boolean;
|
spinning!:boolean
|
||||||
keyword?: string;
|
keyword?:string
|
||||||
result?: any;
|
result?:any
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FriendAdd extends Component<FriendAddProps, FriendAddState> {
|
export class FriendAdd extends Component<FriendAddProps,FriendAddState> {
|
||||||
baseContext!: WKBaseContext;
|
baseContext!:WKBaseContext
|
||||||
constructor(props: any) {
|
constructor(props:any) {
|
||||||
super(props);
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
spinning: false,
|
spinning: false,
|
||||||
};
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async searchUser() {
|
|
||||||
const { keyword } = this.state;
|
|
||||||
if (!keyword) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
async searchUser() {
|
||||||
spinning: true,
|
const { keyword } = this.state
|
||||||
});
|
if(!keyword) {
|
||||||
const result = await WKApp.dataSource.commonDataSource
|
return
|
||||||
.searchUser(keyword)
|
}
|
||||||
.catch((err) => {
|
|
||||||
Toast.error(err.msg);
|
this.setState({
|
||||||
});
|
spinning: true,
|
||||||
if (result) {
|
})
|
||||||
this.setState({
|
const result = await WKApp.dataSource.commonDataSource.searchUser(keyword).catch((err)=>{
|
||||||
result: result,
|
Toast.error(err.msg)
|
||||||
spinning: false,
|
})
|
||||||
});
|
if(result) {
|
||||||
if (result.exist !== 1) {
|
this.setState({
|
||||||
Toast.error("用户不存在!");
|
result: result,
|
||||||
} else {
|
spinning: false,
|
||||||
WKApp.shared.baseContext.showUserInfo(
|
})
|
||||||
result.data.uid,
|
if(result.exist !== 1) {
|
||||||
undefined,
|
Toast.error("用户不存在!")
|
||||||
result.data.vercode
|
}else {
|
||||||
);
|
WKApp.shared.baseContext.showUserInfo(result.data.uid,undefined,result.data.vercode)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
render(): ReactNode {
|
|
||||||
const { onBack } = this.props;
|
render(): ReactNode {
|
||||||
const { spinning } = this.state;
|
const { onBack } = this.props
|
||||||
return (
|
const { spinning } = this.state
|
||||||
<WKBase
|
return <WKBase onContext={(ctx)=>{
|
||||||
onContext={(ctx) => {
|
this.baseContext = ctx
|
||||||
this.baseContext = ctx;
|
}}>
|
||||||
}}
|
<div className="wk-friendadd">
|
||||||
>
|
<WKViewQueueHeader title="添加好友" onBack={onBack} />
|
||||||
<div className="wk-friendadd">
|
<div className="wk-friendadd-content">
|
||||||
<WKViewQueueHeader title="添加好友" onBack={onBack} />
|
<Spin spinning={spinning}>
|
||||||
<div className="wk-friendadd-content">
|
<Search placeholder={`${WKApp.config.appName}号/手机号`} onChange={(v)=>{
|
||||||
<Spin spinning={spinning}>
|
this.setState({
|
||||||
<Search
|
keyword: v
|
||||||
placeholder={`${WKApp.config.appName}号/手机号`}
|
})
|
||||||
onChange={(v) => {
|
}} onEnterPress={()=>{
|
||||||
this.setState({
|
this.searchUser()
|
||||||
keyword: v,
|
}}></Search>
|
||||||
});
|
</Spin>
|
||||||
}}
|
<div className="wk-friendadd-content-qrcode">
|
||||||
onEnterPress={() => {
|
我的{WKApp.config.appName}号:{WKApp.loginInfo.shortNo} <img onClick={()=>{
|
||||||
this.searchUser();
|
WKApp.routeLeft.push(<QRCodeMy></QRCodeMy>)
|
||||||
}}
|
}} src={require("./assets/icon_qrcode.png")}></img>
|
||||||
></Search>
|
</div>
|
||||||
</Spin>
|
|
||||||
<div className="wk-friendadd-content-qrcode">
|
|
||||||
我的{WKApp.config.appName}号:{WKApp.loginInfo.shortNo}{" "}
|
|
||||||
<img
|
|
||||||
onClick={() => {
|
|
||||||
WKApp.routeLeft.push(<QRCodeMy></QRCodeMy>);
|
|
||||||
}}
|
|
||||||
src={require("./assets/icon_qrcode.png")}
|
|
||||||
></img>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</WKBase>
|
</WKBase>
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,130 +1,56 @@
|
|||||||
import React from "react";
|
import React, { Component, ReactNode } from "react";
|
||||||
import {
|
import { Button } from '@douyinfe/semi-ui';
|
||||||
FriendApply,
|
import { FriendApplyState, WKApp, WKViewQueueHeader, Provider } from "@tsdaodao/base";
|
||||||
FriendApplyState,
|
|
||||||
WKApp,
|
|
||||||
ContextMenus,
|
|
||||||
ContextMenusContext,
|
|
||||||
WKViewQueueHeader,
|
|
||||||
Provider,
|
|
||||||
} from "@tsdaodao/base";
|
|
||||||
import { Component, ReactNode } from "react";
|
|
||||||
import { Button } from "@douyinfe/semi-ui";
|
|
||||||
import { NewFriendVM } from "./vm";
|
|
||||||
import { FriendAdd } from "../FriendAdd";
|
import { FriendAdd } from "../FriendAdd";
|
||||||
|
import { NewFriendVM } from "./vm";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
export class NewFriendState {
|
export class NewFriend extends Component {
|
||||||
selectedItem?: FriendApply; // 被选中的好友
|
|
||||||
}
|
|
||||||
|
|
||||||
export class NewFriend extends Component<any, NewFriendState> {
|
render(): ReactNode {
|
||||||
contextMenusContext!: ContextMenusContext;
|
return <Provider create={() => {
|
||||||
|
return new NewFriendVM()
|
||||||
|
}} render={(vm: NewFriendVM) => {
|
||||||
|
|
||||||
constructor(props: any) {
|
return <div className="wk-newfriend">
|
||||||
super(props);
|
<WKViewQueueHeader title="新朋友" onBack={() => {
|
||||||
}
|
WKApp.routeLeft.pop()
|
||||||
|
}} action={<div className="wk-viewqueueheader-content-action">
|
||||||
_handleContextMenu(item: FriendApply, event: React.MouseEvent) {
|
<Button size="small" onClick={()=>{
|
||||||
console.log(item);
|
WKApp.routeLeft.push(<FriendAdd onBack={()=>{
|
||||||
this.contextMenusContext.show(event);
|
WKApp.routeLeft.pop()
|
||||||
this.setState({
|
}}></FriendAdd>)
|
||||||
selectedItem: item,
|
}} >添加好友</Button>
|
||||||
});
|
</div>}></WKViewQueueHeader>
|
||||||
}
|
<div className="wk-newfriend-content">
|
||||||
render(): ReactNode {
|
<ul>
|
||||||
return (
|
{
|
||||||
<Provider
|
vm.friendApplys.map((f) => {
|
||||||
create={() => {
|
return <li key={f.to_uid} >
|
||||||
return new NewFriendVM();
|
<div className="wk-newfriend-content-avatar">
|
||||||
}}
|
<img src={WKApp.shared.avatarUser(f.to_uid)}></img>
|
||||||
render={(vm: NewFriendVM) => {
|
</div>
|
||||||
return (
|
<div className="wk-newfriend-content-title">
|
||||||
<div className="wk-newfriend">
|
<div className="wk-newfriend-content-title-name">
|
||||||
<WKViewQueueHeader
|
{f.to_name}
|
||||||
title="新朋友"
|
</div>
|
||||||
onBack={() => {
|
<div className="wk-newfriend-content-title-remark">
|
||||||
WKApp.routeLeft.pop();
|
{f.remark}
|
||||||
}}
|
</div>
|
||||||
action={
|
</div>
|
||||||
<div className="wk-viewqueueheader-content-action">
|
<div className="wk-newfriend-content-action">
|
||||||
<Button
|
<Button loading={vm.currentFriendApply?.to_uid === f.to_uid && vm.sureLoading } disabled={f.status == FriendApplyState.accepted} onClick={()=>{
|
||||||
size="small"
|
vm.friendSure(f)
|
||||||
onClick={() => {
|
}}>{f.status == FriendApplyState.accepted ? "已添加" : "确认"}</Button>
|
||||||
WKApp.routeLeft.push(
|
</div>
|
||||||
<FriendAdd
|
</li>
|
||||||
onBack={() => {
|
})
|
||||||
WKApp.routeLeft.pop();
|
}
|
||||||
}}
|
</ul>
|
||||||
></FriendAdd>
|
</div>
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
添加好友
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
></WKViewQueueHeader>
|
|
||||||
<div className="wk-newfriend-content">
|
|
||||||
<ul>
|
|
||||||
{vm.friendApplys.map((f) => {
|
|
||||||
return (
|
|
||||||
<li
|
|
||||||
key={f.to_uid}
|
|
||||||
onContextMenu={(e) => {
|
|
||||||
this._handleContextMenu(f, e);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="wk-newfriend-content-avatar">
|
|
||||||
<img src={WKApp.shared.avatarUser(f.to_uid)}></img>
|
|
||||||
</div>
|
|
||||||
<div className="wk-newfriend-content-title">
|
|
||||||
<div className="wk-newfriend-content-title-name">
|
|
||||||
{f.to_name}
|
|
||||||
</div>
|
|
||||||
<div className="wk-newfriend-content-title-remark">
|
|
||||||
{f.remark}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="wk-newfriend-content-action">
|
|
||||||
<Button
|
|
||||||
loading={
|
|
||||||
vm.currentFriendApply?.to_uid === f.to_uid &&
|
|
||||||
vm.sureLoading
|
|
||||||
}
|
|
||||||
disabled={f.status == FriendApplyState.accepted}
|
|
||||||
onClick={() => {
|
|
||||||
vm.friendSure(f);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{f.status == FriendApplyState.accepted
|
|
||||||
? "已添加"
|
|
||||||
: "确认"}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<ContextMenus
|
|
||||||
onContext={(context: ContextMenusContext) => {
|
|
||||||
this.contextMenusContext = context;
|
|
||||||
}}
|
|
||||||
menus={[
|
|
||||||
{
|
|
||||||
title: "删除",
|
|
||||||
onClick: () => {
|
|
||||||
const { selectedItem } = this.state;
|
|
||||||
selectedItem && vm.delFriendApply(selectedItem);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
}}>
|
||||||
}}
|
|
||||||
></Provider>
|
</Provider>
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
@ -14,8 +14,6 @@ import {
|
|||||||
import { BasicTreeNodeData } from "@douyinfe/semi-foundation/lib/cjs/tree/foundation";
|
import { BasicTreeNodeData } from "@douyinfe/semi-foundation/lib/cjs/tree/foundation";
|
||||||
import { WKApp, ThemeMode, WKViewQueueHeader } from "@tsdaodao/base";
|
import { WKApp, ThemeMode, WKViewQueueHeader } from "@tsdaodao/base";
|
||||||
import WKAvatar from "@tsdaodao/base/src/Components/WKAvatar";
|
import WKAvatar from "@tsdaodao/base/src/Components/WKAvatar";
|
||||||
import { ContactsStatus } from "@tsdaodao/base/src/Service/DataSource/DataSource";
|
|
||||||
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
interface IPorpsOrganizationalGroupNew {
|
interface IPorpsOrganizationalGroupNew {
|
||||||
@ -23,7 +21,6 @@ interface IPorpsOrganizationalGroupNew {
|
|||||||
channelID: string;
|
channelID: string;
|
||||||
channelType: number;
|
channelType: number;
|
||||||
};
|
};
|
||||||
disableSelectList?: string[];
|
|
||||||
showAdd?: boolean;
|
showAdd?: boolean;
|
||||||
render?: JSX.Element;
|
render?: JSX.Element;
|
||||||
remove?: () => void;
|
remove?: () => void;
|
||||||
@ -188,8 +185,7 @@ export class OrganizationalGroupNew extends Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
OTree.push({
|
OTree.push({
|
||||||
label:
|
label: employeesNum > 0 ? `${item.name}(${employeesNum})` : `${item.name}`,
|
||||||
employeesNum > 0 ? `${item.name}(${employeesNum})` : `${item.name}`,
|
|
||||||
value: item.dept_id,
|
value: item.dept_id,
|
||||||
key: item.short_no,
|
key: item.short_no,
|
||||||
icon: (
|
icon: (
|
||||||
@ -295,14 +291,12 @@ export class OrganizationalGroupNew extends Component<
|
|||||||
|
|
||||||
getFriendData() {
|
getFriendData() {
|
||||||
const setFriendData: any[] = [];
|
const setFriendData: any[] = [];
|
||||||
WKApp.dataSource.contactsList
|
WKApp.dataSource.contactsList.map((item) => {
|
||||||
.filter((c) => c.status !== ContactsStatus.Blacklist)
|
setFriendData.push({
|
||||||
.map((item) => {
|
name: item.name,
|
||||||
setFriendData.push({
|
uid: item.uid,
|
||||||
name: item.remark || item.name,
|
|
||||||
uid: item.uid,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
friendData: [...setFriendData],
|
friendData: [...setFriendData],
|
||||||
friendSearchData: [...setFriendData],
|
friendSearchData: [...setFriendData],
|
||||||
@ -407,18 +401,6 @@ export class OrganizationalGroupNew extends Component<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isDisableItem(id: string) {
|
|
||||||
const { disableSelectList } = this.props;
|
|
||||||
if (disableSelectList && disableSelectList.length > 0) {
|
|
||||||
for (const disableSelect of disableSelectList) {
|
|
||||||
if (disableSelect === id) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
render(): ReactNode {
|
render(): ReactNode {
|
||||||
const isDark = WKApp.config.themeMode === ThemeMode.dark;
|
const isDark = WKApp.config.themeMode === ThemeMode.dark;
|
||||||
const {
|
const {
|
||||||
@ -549,7 +531,6 @@ export class OrganizationalGroupNew extends Component<
|
|||||||
<Checkbox
|
<Checkbox
|
||||||
key={friend.uid}
|
key={friend.uid}
|
||||||
value={friend.uid}
|
value={friend.uid}
|
||||||
disabled={this.isDisableItem(friend.uid)}
|
|
||||||
className="friend-opt-item"
|
className="friend-opt-item"
|
||||||
>
|
>
|
||||||
<WKAvatar
|
<WKAvatar
|
||||||
|
@ -45,7 +45,7 @@ export default class ContactsModule implements IModule {
|
|||||||
WKApp.endpoints.registerContactsHeader("friends.new", (param: any) => {
|
WKApp.endpoints.registerContactsHeader("friends.new", (param: any) => {
|
||||||
return (
|
return (
|
||||||
<IconListItem
|
<IconListItem
|
||||||
badge={WKApp.shared.getFriendApplysUnreadCount()}
|
badge={ WKApp.shared.getFriendApplysUnreadCount() }
|
||||||
title="新朋友"
|
title="新朋友"
|
||||||
icon={require("./assets/friend_new.png")}
|
icon={require("./assets/friend_new.png")}
|
||||||
backgroudColor={"var(--wk-color-secondary)"}
|
backgroudColor={"var(--wk-color-secondary)"}
|
||||||
@ -111,15 +111,8 @@ export default class ContactsModule implements IModule {
|
|||||||
"contacts.organizational.group.add",
|
"contacts.organizational.group.add",
|
||||||
(param) => {
|
(param) => {
|
||||||
const channel = param.channel as any;
|
const channel = param.channel as any;
|
||||||
const disableSelectList = param.disableSelectList as
|
|
||||||
| string[]
|
|
||||||
| undefined;
|
|
||||||
return (
|
return (
|
||||||
<OrganizationalGroupNew
|
<OrganizationalGroupNew channel={channel} render={param.render} />
|
||||||
channel={channel}
|
|
||||||
disableSelectList={disableSelectList}
|
|
||||||
render={param.render}
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -128,9 +121,6 @@ export default class ContactsModule implements IModule {
|
|||||||
"contacts.organizational.layer",
|
"contacts.organizational.layer",
|
||||||
(param) => {
|
(param) => {
|
||||||
const channel = param.channel as any;
|
const channel = param.channel as any;
|
||||||
const disableSelectList = param.disableSelectList as
|
|
||||||
| string[]
|
|
||||||
| undefined;
|
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
const ref: any = React.createRef();
|
const ref: any = React.createRef();
|
||||||
document.body.appendChild(div);
|
document.body.appendChild(div);
|
||||||
@ -145,7 +135,6 @@ export default class ContactsModule implements IModule {
|
|||||||
<OrganizationalGroupNew
|
<OrganizationalGroupNew
|
||||||
ref={ref}
|
ref={ref}
|
||||||
channel={channel}
|
channel={channel}
|
||||||
disableSelectList={disableSelectList}
|
|
||||||
remove={remove}
|
remove={remove}
|
||||||
/>,
|
/>,
|
||||||
div
|
div
|
||||||
@ -155,4 +144,4 @@ export default class ContactsModule implements IModule {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,9 +7,6 @@ import { WKApp, Provider } from "@tsdaodao/base"
|
|||||||
import { LoginStatus, LoginType, LoginVM } from "./login_vm";
|
import { LoginStatus, LoginType, LoginVM } from "./login_vm";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type LoginState = {
|
type LoginState = {
|
||||||
loginStatus: string
|
loginStatus: string
|
||||||
loginUUID: string
|
loginUUID: string
|
||||||
@ -20,6 +17,9 @@ type LoginState = {
|
|||||||
|
|
||||||
class Login extends Component<any, LoginState> {
|
class Login extends Component<any, LoginState> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
return <Provider create={() => {
|
return <Provider create={() => {
|
||||||
@ -29,7 +29,7 @@ class Login extends Component<any, LoginState> {
|
|||||||
<div className="wk-login-content">
|
<div className="wk-login-content">
|
||||||
<div className="wk-login-content-phonelogin" style={{ "display": vm.loginType === LoginType.phone ? "block" : "none" }}>
|
<div className="wk-login-content-phonelogin" style={{ "display": vm.loginType === LoginType.phone ? "block" : "none" }}>
|
||||||
<div className="wk-login-content-logo">
|
<div className="wk-login-content-logo">
|
||||||
<img src={`/logo.png`} alt="logo" />
|
<img src={`${process.env.PUBLIC_URL}/logo.png`} alt="logo" />
|
||||||
</div>
|
</div>
|
||||||
<div className="wk-login-content-slogan">
|
<div className="wk-login-content-slogan">
|
||||||
更愉快的与朋友交流
|
更愉快的与朋友交流
|
||||||
|
Loading…
x
Reference in New Issue
Block a user