Commit 11ecf879 by zhousil

解决冲突

parents 0f1e57c5 b17cc118
......@@ -4,7 +4,77 @@
color: #E84929;
margin-bottom: 10px;
}
.item-title{
}
/deep/.benefits-plan-message {
.plan-title-wrap {
display: flex;
justify-content: space-between;
margin-bottom: 4px;
.total-price {
color: #e84929;
white-space: nowrap;
}
.paid-money{
color: #e84929;
margin: 0 10px;
white-space: nowrap;
}
.plan-status{
white-space: nowrap;
}
.item-title {
max-width: 185px;
color: #373737;
font-size: 14px;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-decoration: underline;
margin-right: 8px;
cursor: pointer;
&:hover{
color: #666;
}
}
}
.product-item {
display: flex;
padding: 16px 0;
&:not(:last-child) {
border-bottom: 1px dashed #ededed;
}
img {
width: 50px;
height: 50px;
margin-right: 10px;
}
.product-detail {
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
.product-name {
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.price-nums{
display: flex;
justify-content: space-between;
}
}
}
}
/deep/.benefits-welfare-message {
.item-title {
font-weight: bold;
margin-bottom: 10px;
text-decoration: underline;
cursor: pointer;
text-decoration: underline;
}
......
......@@ -76,7 +76,12 @@
<span
class="withdraw"
v-if="isMyMessage && canWithdraw && !isWithdrawMessage && !isQuestionAnswerMessage"
v-if="
isMyMessage &&
canWithdraw &&
!isWithdrawMessage &&
!isQuestionAnswerMessage
"
@click="withdraw"
>撤回此消息</span
>
......@@ -194,6 +199,9 @@
@chatStore.Action(ChatStore.ACTION_SET_HANDLED)
private readonly setHandled!: ChatStore.ACTION_SET_HANDLED;
@chatStore.Getter(ChatStore.GETTER_CURRENT_CURRENT_CHAT)
private readonly currentChat!: ChatStore.GETTER_CURRENT_CURRENT_CHAT;
@Prop({ type: Object, default: () => Object.create(null) })
private readonly data!: dto.Message;
......@@ -281,12 +289,22 @@
if (this.chatMembers) {
const t = this.chatMembers.find((i) => i.eid === this.data.eid);
if (t) {
return t.name;
return this.getFilterUsername(t.name);
}
}
return "";
}
private getFilterUsername(name: string) {
if (
this.currentChat && this.currentChat.catalog === "福利宝" &&
this.chatRole === "customer-service"
) {
return `采购顾问 ${name}`;
}
return name;
}
private get avatar() {
const mapping = getUserMapping();
......
......@@ -57,17 +57,17 @@ class ChatCacheDatabaseController {
}
resolve();
};
r.onsuccess = function (e) {
r.onsuccess = function(e) {
that.db = (e.target as any).result;
console.log(`index database init comepleted`);
setupDb();
};
r.onupgradeneeded = function (e) {
r.onupgradeneeded = function(e) {
that.db = (e.target as any).result;
console.log(`upgrade database comepleted`);
setupDb();
};
r.onerror = function (e) {
r.onerror = function(e) {
console.log(`index database init failed, ${e}`);
};
} else {
......@@ -94,17 +94,17 @@ class ChatCacheDatabaseController {
}
setTimeout(() => resolve(), 200);
};
r.onsuccess = function (e) {
r.onsuccess = function(e) {
const db = (e.target as any).result;
that.messageDatabases.set(k, db);
setupDb();
};
r.onupgradeneeded = function (e) {
r.onupgradeneeded = function(e) {
const db = (e.target as any).result;
that.messageDatabases.set(k, db);
setupDb();
};
r.onerror = function (e) {
r.onerror = function(e) {
console.log(
`chat message index database init failed, ${e}`
);
......
......@@ -127,6 +127,15 @@
"xls",
"xlsx",
"pdf",
"zip",
"rar",
"rars",
"7z",
"iso",
"tar",
"cab",
"jar",
"uue",
];
@Component({ components: {} })
......@@ -208,7 +217,7 @@
private allowLoadFile() {
this.acceptType =
limitedFileExtension.map((i) => `.${i}`).join(",") + ",image/*";
limitedFileExtension.map((i) => `.${i}`).join(",") + ",image/*,video/*";
}
private async handlePasteEvent(event: ClipboardEvent) {
......
......@@ -59,7 +59,7 @@ class Chat {
option.avatar !== undefined &&
(this.defaultAvatar = option.avatar);
await this.setupIndexDb();
await this.setupIndexDb(option.orgId());
this.token = async () => option.sdk().global.jwtToken;
tokenManager.save(this.token);
......@@ -83,12 +83,11 @@ class Chat {
});
}
private setupIndexDb() {
private setupIndexDb(orgId: number | string) {
if (this._sdk) {
const s = this._sdk();
return dbController.setup(
s.global.uid + "-" + (s.global.initData.orgId || 0)
);
const key = `${s.global.uid}-${orgId || 0}`
return dbController.setup(key);
}
return Promise.reject();
}
......@@ -96,7 +95,7 @@ class Chat {
public resetup(org: () => string | number) {
this._orgId = org;
xim.onConnected();
return this.setupIndexDb();
return this.setupIndexDb(org());
}
public unSetup() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment