session
This commit is contained in:
parent
a8aad2a51a
commit
ae09b099b7
|
|
@ -82,7 +82,8 @@ export async function createSession(params, context) {
|
|||
}
|
||||
case 'wechatMp':
|
||||
case 'wechatPublic': {
|
||||
assert(data, '');
|
||||
assert(data);
|
||||
assert(entity === 'application');
|
||||
const { ToUserName, FromUserName, CreateTime, MsgType,
|
||||
// Event,
|
||||
Content,
|
||||
|
|
@ -98,6 +99,22 @@ export async function createSession(params, context) {
|
|||
openId: FromUserName,
|
||||
}
|
||||
}, {});
|
||||
const result = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
lmts: 1,
|
||||
openId: 1,
|
||||
},
|
||||
filter: {
|
||||
entity: entity,
|
||||
entityId: entityId,
|
||||
openId: FromUserName,
|
||||
}
|
||||
}, {});
|
||||
session = result[0];
|
||||
sessionMessage$session = [
|
||||
{
|
||||
id: await generateNewIdAsync(),
|
||||
|
|
@ -105,8 +122,7 @@ export async function createSession(params, context) {
|
|||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
applicationId: wechatUser?.applicationId,
|
||||
// sessionId: session[0]?.id,
|
||||
wechatUser: wechatUser?.id,
|
||||
wechatUserId: wechatUser?.id,
|
||||
createTime: CreateTime,
|
||||
type: MsgType,
|
||||
text: Content,
|
||||
|
|
@ -148,6 +164,7 @@ export async function createSession(params, context) {
|
|||
entityId,
|
||||
userId,
|
||||
lmts: Date.now(),
|
||||
openId: data?.FromUserName,
|
||||
}, sessionMessage$session && { sessionMessage$session }),
|
||||
}, {
|
||||
dontCollect: true,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export default OakComponent({
|
|||
entity: 1,
|
||||
entityId: 1,
|
||||
lmts: 1,
|
||||
openId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
|
|
@ -137,7 +138,7 @@ export default OakComponent({
|
|||
}
|
||||
},
|
||||
getName() {
|
||||
const { user, entity } = this.state;
|
||||
const { user, entity, openId } = this.state;
|
||||
const { entityFilter } = this.props;
|
||||
if (entityFilter) {
|
||||
const userName = user?.name;
|
||||
|
|
@ -150,6 +151,9 @@ export default OakComponent({
|
|||
if (userMobile) {
|
||||
return '用户' + userMobile;
|
||||
}
|
||||
if (openId) {
|
||||
return '微信用户' + openId;
|
||||
}
|
||||
return userNickname;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export default OakComponent({
|
|||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
openId: 1,
|
||||
userId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
|
|
|
|||
|
|
@ -258,43 +258,36 @@ export default OakComponent({
|
|||
const extension = name.substring(name.lastIndexOf('.') + 1);
|
||||
const filename = name.substring(0, name.lastIndexOf('.'));
|
||||
const extraFile = {
|
||||
extra1: originFileObj,
|
||||
origin: 'qiniu',
|
||||
type: 'image',
|
||||
tag1: 'image',
|
||||
objectId: generateNewId(),
|
||||
filename,
|
||||
fileType: type,
|
||||
size,
|
||||
extension,
|
||||
entity: 'sessionMessage',
|
||||
bucket: '',
|
||||
id: generateNewId(),
|
||||
};
|
||||
// try {
|
||||
// // 自己实现上传,并得到图片 url alt href
|
||||
// const { url, bucket } = await this.features.extraFile.upload(
|
||||
// extraFile
|
||||
// );
|
||||
// extraFile.bucket = bucket;
|
||||
// extraFile.extra1 = null;
|
||||
// const userId = this.features.token.getUserId();
|
||||
// this.addItem({
|
||||
// id: generateNewId(),
|
||||
// sessionId,
|
||||
// type: 'image',
|
||||
// extraFile$entity: [
|
||||
// {
|
||||
// id: generateNewId(),
|
||||
// action: 'create',
|
||||
// data: extraFile,
|
||||
// },
|
||||
// ],
|
||||
// } as EntityDict['sessionMessage']['CreateSingle']['data']);
|
||||
// await this.execute(undefined, false);
|
||||
// } catch (err) {
|
||||
// throw err;
|
||||
// }
|
||||
try {
|
||||
await this.features.extraFile.upload(extraFile, originFileObj);
|
||||
const userId = this.features.token.getUserId();
|
||||
this.addItem({
|
||||
id: generateNewId(),
|
||||
sessionId,
|
||||
type: 'image',
|
||||
extraFile$entity: [
|
||||
{
|
||||
id: generateNewId(),
|
||||
action: 'create',
|
||||
data: extraFile,
|
||||
},
|
||||
],
|
||||
});
|
||||
await this.execute(undefined, false);
|
||||
}
|
||||
catch (err) {
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ async function createSession(params, context) {
|
|||
}
|
||||
case 'wechatMp':
|
||||
case 'wechatPublic': {
|
||||
(0, assert_1.default)(data, '');
|
||||
(0, assert_1.default)(data);
|
||||
(0, assert_1.default)(entity === 'application');
|
||||
const { ToUserName, FromUserName, CreateTime, MsgType,
|
||||
// Event,
|
||||
Content,
|
||||
|
|
@ -102,6 +103,22 @@ async function createSession(params, context) {
|
|||
openId: FromUserName,
|
||||
}
|
||||
}, {});
|
||||
const result = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
lmts: 1,
|
||||
openId: 1,
|
||||
},
|
||||
filter: {
|
||||
entity: entity,
|
||||
entityId: entityId,
|
||||
openId: FromUserName,
|
||||
}
|
||||
}, {});
|
||||
session = result[0];
|
||||
sessionMessage$session = [
|
||||
{
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
|
|
@ -109,8 +126,7 @@ async function createSession(params, context) {
|
|||
data: {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
applicationId: wechatUser?.applicationId,
|
||||
// sessionId: session[0]?.id,
|
||||
wechatUser: wechatUser?.id,
|
||||
wechatUserId: wechatUser?.id,
|
||||
createTime: CreateTime,
|
||||
type: MsgType,
|
||||
text: Content,
|
||||
|
|
@ -152,6 +168,7 @@ async function createSession(params, context) {
|
|||
entityId,
|
||||
userId,
|
||||
lmts: Date.now(),
|
||||
openId: data?.FromUserName,
|
||||
}, sessionMessage$session && { sessionMessage$session }),
|
||||
}, {
|
||||
dontCollect: true,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ exports.default = OakComponent({
|
|||
entity: 1,
|
||||
entityId: 1,
|
||||
lmts: 1,
|
||||
openId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
|
|
@ -139,7 +140,7 @@ exports.default = OakComponent({
|
|||
}
|
||||
},
|
||||
getName() {
|
||||
const { user, entity } = this.state;
|
||||
const { user, entity, openId } = this.state;
|
||||
const { entityFilter } = this.props;
|
||||
if (entityFilter) {
|
||||
const userName = user?.name;
|
||||
|
|
@ -152,6 +153,9 @@ exports.default = OakComponent({
|
|||
if (userMobile) {
|
||||
return '用户' + userMobile;
|
||||
}
|
||||
if (openId) {
|
||||
return '微信用户' + openId;
|
||||
}
|
||||
return userNickname;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ exports.default = OakComponent({
|
|||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
openId: 1,
|
||||
userId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
|
|
|
|||
|
|
@ -260,43 +260,36 @@ exports.default = OakComponent({
|
|||
const extension = name.substring(name.lastIndexOf('.') + 1);
|
||||
const filename = name.substring(0, name.lastIndexOf('.'));
|
||||
const extraFile = {
|
||||
extra1: originFileObj,
|
||||
origin: 'qiniu',
|
||||
type: 'image',
|
||||
tag1: 'image',
|
||||
objectId: (0, uuid_1.generateNewId)(),
|
||||
filename,
|
||||
fileType: type,
|
||||
size,
|
||||
extension,
|
||||
entity: 'sessionMessage',
|
||||
bucket: '',
|
||||
id: (0, uuid_1.generateNewId)(),
|
||||
};
|
||||
// try {
|
||||
// // 自己实现上传,并得到图片 url alt href
|
||||
// const { url, bucket } = await this.features.extraFile.upload(
|
||||
// extraFile
|
||||
// );
|
||||
// extraFile.bucket = bucket;
|
||||
// extraFile.extra1 = null;
|
||||
// const userId = this.features.token.getUserId();
|
||||
// this.addItem({
|
||||
// id: generateNewId(),
|
||||
// sessionId,
|
||||
// type: 'image',
|
||||
// extraFile$entity: [
|
||||
// {
|
||||
// id: generateNewId(),
|
||||
// action: 'create',
|
||||
// data: extraFile,
|
||||
// },
|
||||
// ],
|
||||
// } as EntityDict['sessionMessage']['CreateSingle']['data']);
|
||||
// await this.execute(undefined, false);
|
||||
// } catch (err) {
|
||||
// throw err;
|
||||
// }
|
||||
try {
|
||||
await this.features.extraFile.upload(extraFile, originFileObj);
|
||||
const userId = this.features.token.getUserId();
|
||||
this.addItem({
|
||||
id: (0, uuid_1.generateNewId)(),
|
||||
sessionId,
|
||||
type: 'image',
|
||||
extraFile$entity: [
|
||||
{
|
||||
id: (0, uuid_1.generateNewId)(),
|
||||
action: 'create',
|
||||
data: extraFile,
|
||||
},
|
||||
],
|
||||
});
|
||||
await this.execute(undefined, false);
|
||||
}
|
||||
catch (err) {
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ export async function createSession<
|
|||
}
|
||||
case 'wechatMp':
|
||||
case 'wechatPublic': {
|
||||
assert(data, '')
|
||||
assert(data);
|
||||
assert(entity === 'application');
|
||||
const {
|
||||
ToUserName,
|
||||
FromUserName,
|
||||
|
|
@ -122,6 +123,22 @@ export async function createSession<
|
|||
openId: FromUserName,
|
||||
}
|
||||
}, {});
|
||||
const result = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
lmts: 1,
|
||||
openId: 1,
|
||||
},
|
||||
filter: {
|
||||
entity: entity,
|
||||
entityId: entityId,
|
||||
openId: FromUserName,
|
||||
}
|
||||
}, {});
|
||||
session = result[0]
|
||||
sessionMessage$session = [
|
||||
{
|
||||
id: await generateNewIdAsync(),
|
||||
|
|
@ -129,8 +146,7 @@ export async function createSession<
|
|||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
applicationId: wechatUser?.applicationId,
|
||||
// sessionId: session[0]?.id,
|
||||
wechatUser: wechatUser?.id,
|
||||
wechatUserId: wechatUser?.id,
|
||||
createTime: CreateTime,
|
||||
type: MsgType,
|
||||
text: Content,
|
||||
|
|
@ -166,6 +182,7 @@ export async function createSession<
|
|||
return session.id
|
||||
}
|
||||
else {
|
||||
|
||||
await context.operate('session', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
|
|
@ -175,6 +192,7 @@ export async function createSession<
|
|||
entityId,
|
||||
userId,
|
||||
lmts: Date.now(),
|
||||
openId: data?.FromUserName,
|
||||
}, sessionMessage$session && { sessionMessage$session }),
|
||||
}, {
|
||||
dontCollect: true,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export default OakComponent({
|
|||
entity: 1,
|
||||
entityId: 1,
|
||||
lmts: 1,
|
||||
openId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
|
|
@ -149,7 +150,7 @@ export default OakComponent({
|
|||
}
|
||||
},
|
||||
getName() {
|
||||
const { user, entity } = this.state;
|
||||
const { user, entity, openId } = this.state;
|
||||
const { entityFilter } = this.props;
|
||||
|
||||
if (entityFilter) {
|
||||
|
|
@ -164,6 +165,9 @@ export default OakComponent({
|
|||
if (userMobile) {
|
||||
return '用户' + userMobile;
|
||||
}
|
||||
if (openId) {
|
||||
return '微信用户' + openId;
|
||||
}
|
||||
|
||||
|
||||
return userNickname;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export default OakComponent({
|
|||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
openId: 1,
|
||||
userId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { generateNewId } from 'oak-domain/lib/utils/uuid';
|
||||
import { DATA_SUBSCRIBER_KEYS } from '../../../config/constants'
|
||||
import { DATA_SUBSCRIBER_KEYS } from '../../../config/constants';
|
||||
import { getConfig } from '../../../utils/getContextConfig';
|
||||
import { QiniuCosConfig } from '../../../types/Config';
|
||||
export default OakComponent({
|
||||
entity: 'sessionMessage',
|
||||
projection: {
|
||||
|
|
@ -44,6 +46,7 @@ export default OakComponent({
|
|||
lifetimes: {
|
||||
async ready() {
|
||||
const { sessionId } = this.props;
|
||||
|
||||
await this.subData([
|
||||
{
|
||||
entity: 'sessionMessage',
|
||||
|
|
@ -55,31 +58,8 @@ export default OakComponent({
|
|||
],
|
||||
async () => { await this.pageScroll('comment') }
|
||||
)
|
||||
// const userId = this.features.token.getUserId(true);
|
||||
// const applicationId = this.features.application.getApplicationId();
|
||||
// if (!sessionId) {
|
||||
// const entity = 'application';
|
||||
// const entityId = applicationId;
|
||||
// const type = 'web';
|
||||
// const { result: newSessionId } = await this.features.cache.exec('createSession', { type, entity, entityId });
|
||||
// this.setState({
|
||||
// newSessionId,
|
||||
// })
|
||||
// }
|
||||
// if (!userId) {
|
||||
// this.redirectTo(
|
||||
// {
|
||||
// url: '/login',
|
||||
// backUrl: encodeURIComponent(window.location.href),
|
||||
// },
|
||||
// undefined,
|
||||
// true
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// (this as any).timer = setInterval(() => {
|
||||
// this.refresh();
|
||||
// }, 2000);
|
||||
|
||||
this.createItem();
|
||||
this.getConversationInfo();
|
||||
},
|
||||
detached() {
|
||||
|
|
@ -103,21 +83,33 @@ export default OakComponent({
|
|||
|
||||
sessionId(prev, next) {
|
||||
if (this.state.oakFullpath) {
|
||||
|
||||
if (prev.sessionId !== next.sessionId) {
|
||||
if (next.sessionId) {
|
||||
const { sessionMessageId } = this.state;
|
||||
this.getConversationInfo();
|
||||
|
||||
// 如果sessionId变了需要重新刷新下
|
||||
this.refresh();
|
||||
this.removeItem(sessionMessageId);
|
||||
this.setState({
|
||||
text: '',
|
||||
});
|
||||
this.createItem();
|
||||
this.pageScroll('comment');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
formData({ data: sessionMessageList = [], features }) {
|
||||
const sessionMessageType = sessionMessageList?.find(
|
||||
(ele) => ele.$$createAt$$ === 1
|
||||
)?.type;
|
||||
return {
|
||||
sessionMessageList,
|
||||
num: sessionMessageList?.length,
|
||||
sessionMessageType,
|
||||
};
|
||||
},
|
||||
properties: {
|
||||
|
|
@ -134,9 +126,6 @@ export default OakComponent({
|
|||
const { sessionId } = this.props;
|
||||
return {
|
||||
sessionId,
|
||||
// type: {
|
||||
// $exists: true,
|
||||
// },
|
||||
};
|
||||
},
|
||||
},
|
||||
|
|
@ -159,9 +148,17 @@ export default OakComponent({
|
|||
},
|
||||
methods: {
|
||||
setContent(text: string) {
|
||||
const { sessionMessageId } = this.state;
|
||||
|
||||
console.log(sessionMessageId, text)
|
||||
|
||||
this.setState({
|
||||
text,
|
||||
});
|
||||
this.updateItem({
|
||||
text,
|
||||
type: 'text',
|
||||
}, sessionMessageId)
|
||||
},
|
||||
setButtonHidden(isHidden: boolean) {
|
||||
this.setState({
|
||||
|
|
@ -230,8 +227,25 @@ export default OakComponent({
|
|||
setTimeout(() => doc.scrollTo(0, 10000), 500);
|
||||
},
|
||||
|
||||
async createItem() {
|
||||
const { text, wechatUserId } = this.state;
|
||||
const { sessionId, isEntity } = this.props;
|
||||
const userId = this.features.token.getUserId();
|
||||
const applicationId = this.features.application.getApplicationId();
|
||||
const sessionMessageId = this.addItem({
|
||||
applicationId,
|
||||
userId,
|
||||
wechatUserId,
|
||||
sessionId: sessionId,
|
||||
aaoe: isEntity,
|
||||
})
|
||||
this.setState({
|
||||
sessionMessageId,
|
||||
})
|
||||
},
|
||||
|
||||
async createMessage() {
|
||||
const { text, wechatUserId, newSessionId } = this.state;
|
||||
const { text, wechatUserId, newSessionId, sessionMessageId } = this.state;
|
||||
const { sessionId, isEntity } = this.props;
|
||||
const userId = this.features.token.getUserId();
|
||||
const applicationId = this.features.application.getApplicationId();
|
||||
|
|
@ -242,21 +256,25 @@ export default OakComponent({
|
|||
});
|
||||
return;
|
||||
}
|
||||
this.addItem({
|
||||
applicationId,
|
||||
text,
|
||||
userId,
|
||||
wechatUserId,
|
||||
sessionId: sessionId || newSessionId,
|
||||
type: 'text',
|
||||
// this.addItem({
|
||||
// applicationId,
|
||||
// text,
|
||||
// userId,
|
||||
// wechatUserId,
|
||||
// sessionId: sessionId || newSessionId,
|
||||
// type: 'text',
|
||||
// createTime: Date.now(),
|
||||
// aaoe: isEntity,
|
||||
// } as EntityDict['sessionMessage']['CreateSingle']['data']);
|
||||
this.updateItem({
|
||||
createTime: Date.now(),
|
||||
aaoe: isEntity,
|
||||
} as EntityDict['sessionMessage']['CreateSingle']['data']);
|
||||
}, sessionMessageId)
|
||||
await this.execute(undefined, false);
|
||||
this.setState({
|
||||
text: '',
|
||||
});
|
||||
this.pageScroll('comment');
|
||||
this.createItem();
|
||||
},
|
||||
|
||||
|
||||
|
|
@ -266,53 +284,64 @@ export default OakComponent({
|
|||
type: string;
|
||||
originFileObj: File;
|
||||
}) {
|
||||
const { sessionId } = this.props;
|
||||
const { sessionId, isEntity } = this.props;
|
||||
|
||||
// TS 语法
|
||||
// file 即选中的文件
|
||||
const { name, size, type, originFileObj } = file;
|
||||
|
||||
const applicationId = this.features.application.getApplicationId();
|
||||
const extension = name.substring(name.lastIndexOf('.') + 1);
|
||||
const filename = name.substring(0, name.lastIndexOf('.'));
|
||||
let bucket2 = '';
|
||||
if (!bucket2) {
|
||||
const context = this.features.cache.begin();
|
||||
const { config } = getConfig(context, 'Cos', 'qiniu');
|
||||
this.features.cache.commit();
|
||||
|
||||
const { defaultBucket } = config as QiniuCosConfig;
|
||||
bucket2 = defaultBucket!;
|
||||
}
|
||||
const extraFile = {
|
||||
extra1: originFileObj as any,
|
||||
applicationId,
|
||||
bucket: bucket2,
|
||||
origin: 'qiniu',
|
||||
type: 'image',
|
||||
tag1: 'image',
|
||||
objectId: generateNewId(),
|
||||
filename,
|
||||
fileType: type,
|
||||
size,
|
||||
extension,
|
||||
entity: 'sessionMessage',
|
||||
bucket: '',
|
||||
id: generateNewId(),
|
||||
} as EntityDict['extraFile']['CreateSingle']['data'];
|
||||
|
||||
// try {
|
||||
// // 自己实现上传,并得到图片 url alt href
|
||||
// const { url, bucket } = await this.features.extraFile.upload(
|
||||
// extraFile
|
||||
try {
|
||||
// await this.features.extraFile.upload(
|
||||
// extraFile,
|
||||
// originFileObj
|
||||
// );
|
||||
// extraFile.bucket = bucket;
|
||||
// extraFile.extra1 = null;
|
||||
// const userId = this.features.token.getUserId();
|
||||
// this.addItem({
|
||||
// id: generateNewId(),
|
||||
// sessionId,
|
||||
// type: 'image',
|
||||
// extraFile$entity: [
|
||||
// {
|
||||
// id: generateNewId(),
|
||||
// action: 'create',
|
||||
// data: extraFile,
|
||||
// },
|
||||
// ],
|
||||
// } as EntityDict['sessionMessage']['CreateSingle']['data']);
|
||||
// await this.execute(undefined, false);
|
||||
// } catch (err) {
|
||||
// throw err;
|
||||
// }
|
||||
const userId = this.features.token.getUserId();
|
||||
this.addItem({
|
||||
id: generateNewId(),
|
||||
applicationId,
|
||||
sessionId,
|
||||
createTime: Date.now(),
|
||||
aaoe: isEntity,
|
||||
type: 'image',
|
||||
extraFile$entity: [
|
||||
{
|
||||
id: generateNewId(),
|
||||
action: 'create',
|
||||
data: extraFile,
|
||||
},
|
||||
],
|
||||
} as EntityDict['sessionMessage']['CreateSingle']['data']);
|
||||
this.features.extraFile2.addLocalFile(extraFile?.id, originFileObj);
|
||||
|
||||
await this.execute(undefined, false);
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import Header from '../../../components/session/forMessage';
|
|||
import Style from './web.module.less';
|
||||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import ExtraFileUpload from "@oak-general-business/components/extraFile/upload";
|
||||
interface customFile {
|
||||
name: string;
|
||||
size: number;
|
||||
|
|
@ -27,6 +28,7 @@ export default function Render(
|
|||
isEntity: boolean;
|
||||
isUser: boolean;
|
||||
employerId: string;
|
||||
sessionMessageType: string;
|
||||
},
|
||||
{
|
||||
setButtonHidden: (isHidden: boolean) => void;
|
||||
|
|
@ -45,8 +47,8 @@ export default function Render(
|
|||
sessionMessageList,
|
||||
oakFullpath,
|
||||
text,
|
||||
employerId,
|
||||
buttonHidden,
|
||||
sessionMessageType,
|
||||
} = data;
|
||||
const {
|
||||
setButtonHidden,
|
||||
|
|
@ -101,6 +103,7 @@ export default function Render(
|
|||
pageScroll('comment');
|
||||
}
|
||||
};
|
||||
console.log(sessionMessageType);
|
||||
return (
|
||||
<div className={Style.container}>
|
||||
<Header
|
||||
|
|
@ -146,18 +149,35 @@ export default function Render(
|
|||
|
||||
<div className={Style.bottom} id="bottom">
|
||||
<div className={Style.toolbar}>
|
||||
<Upload
|
||||
<ExtraFileUpload
|
||||
oakPath={
|
||||
data.oakFullpath
|
||||
? `${data.oakFullpath}.extraFile$entity`
|
||||
: undefined
|
||||
}
|
||||
showUploadList={false}
|
||||
type="image"
|
||||
origin="qiniu"
|
||||
tag1="image"
|
||||
maxNumber={1}
|
||||
entity="sessionMessage"
|
||||
accept="image/*"
|
||||
>
|
||||
<PictureOutlined className={Style.icon} />
|
||||
</ExtraFileUpload>
|
||||
{/* <Upload
|
||||
accept={'image/*'}
|
||||
multiple={false}
|
||||
showUploadList={false}
|
||||
customRequest={() => { }}
|
||||
onChange={({ file }) => {
|
||||
customUpload(file as customFile);
|
||||
}}
|
||||
// customRequest={() => { }}
|
||||
// onChange={({ file }) => {
|
||||
// customUpload(file as customFile);
|
||||
// }}
|
||||
>
|
||||
<PictureOutlined className={Style.icon} />
|
||||
</Upload>
|
||||
</Upload> */}
|
||||
</div>
|
||||
|
||||
<div className={Style.textareaBox}>
|
||||
<Input.TextArea
|
||||
ref={textareaRef}
|
||||
|
|
|
|||
Loading…
Reference in New Issue