build
This commit is contained in:
parent
2fd4b31f68
commit
49ef53ae59
|
|
@ -1,6 +1,6 @@
|
|||
import { EntityDict } from "../oak-app-domain";
|
||||
import { AppType } from "../oak-app-domain/Application/Schema";
|
||||
import { BackendRuntimeContext } from "../context/BackendRuntimeContext";
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { AppType } from '../oak-app-domain/Application/Schema';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { WechatPublicEventData, WechatMpEventData } from 'oak-external-sdk';
|
||||
export declare function createSession<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
data?: WechatPublicEventData | WechatMpEventData;
|
||||
|
|
|
|||
|
|
@ -3,137 +3,143 @@ import { assert } from 'oak-domain/lib/utils/assert';
|
|||
export async function createSession(params, context) {
|
||||
const { data, type, entity, entityId } = params;
|
||||
const userId = context.getCurrentUserId(true);
|
||||
let session;
|
||||
let sessionMessage$session;
|
||||
switch (type) {
|
||||
case 'web': {
|
||||
const systemId = context.getSystemId();
|
||||
let entity2 = entity;
|
||||
let entityId2 = entityId;
|
||||
if (!entity) {
|
||||
// 默认
|
||||
const [application] = await context.select('application', {
|
||||
const closeRootMode = context.openRootMode();
|
||||
try {
|
||||
let session;
|
||||
let sessionMessage$session;
|
||||
switch (type) {
|
||||
case 'web': {
|
||||
const systemId = context.getSystemId();
|
||||
let entity2 = entity;
|
||||
let entityId2 = entityId;
|
||||
if (!entity) {
|
||||
// 默认
|
||||
const [application] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
systemId: 1,
|
||||
type: 1,
|
||||
},
|
||||
filter: {
|
||||
systemId,
|
||||
type: 'web',
|
||||
},
|
||||
}, {});
|
||||
entity2 = 'application';
|
||||
entityId2 = application?.id;
|
||||
}
|
||||
assert(entity2 && entityId2);
|
||||
const result = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
systemId: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
lmts: 1,
|
||||
},
|
||||
filter: {
|
||||
systemId,
|
||||
type: 'web',
|
||||
entity: entity2,
|
||||
entityId: entityId2,
|
||||
userId,
|
||||
},
|
||||
}, {});
|
||||
entity2 = 'application';
|
||||
entityId2 = application?.id;
|
||||
session = result[0];
|
||||
break;
|
||||
}
|
||||
assert(entity2 && entityId2);
|
||||
const result = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
lmts: 1,
|
||||
},
|
||||
filter: {
|
||||
entity: entity2,
|
||||
entityId: entityId2,
|
||||
userId,
|
||||
},
|
||||
}, {});
|
||||
session = result[0];
|
||||
break;
|
||||
}
|
||||
case 'wechatMp':
|
||||
case 'wechatPublic': {
|
||||
assert(data);
|
||||
assert(entity === 'application' && entityId);
|
||||
const { ToUserName, FromUserName, CreateTime, MsgType,
|
||||
// Event,
|
||||
Content,
|
||||
// EventKey,
|
||||
} = data;
|
||||
const [wechatUser] = await context.select('wechatUser', {
|
||||
data: {
|
||||
id: 1,
|
||||
openId: 1,
|
||||
applicationId: 1,
|
||||
},
|
||||
filter: {
|
||||
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(),
|
||||
action: 'create',
|
||||
case 'wechatMp':
|
||||
case 'wechatPublic': {
|
||||
assert(data);
|
||||
assert(entity === 'application' && entityId);
|
||||
const { ToUserName, FromUserName, CreateTime, MsgType, Content, } = data;
|
||||
const [wechatUser] = await context.select('wechatUser', {
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
applicationId: wechatUser?.applicationId,
|
||||
wechatUserId: wechatUser?.id,
|
||||
createTime: Number(CreateTime) * 1000,
|
||||
type: MsgType,
|
||||
text: Content,
|
||||
aaoe: false,
|
||||
id: 1,
|
||||
openId: 1,
|
||||
applicationId: 1,
|
||||
},
|
||||
filter: {
|
||||
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(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
applicationId: wechatUser?.applicationId,
|
||||
wechatUserId: wechatUser?.id,
|
||||
createTime: Number(CreateTime) * 1000,
|
||||
type: MsgType,
|
||||
text: Content,
|
||||
aaoe: false,
|
||||
},
|
||||
},
|
||||
];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
assert(false, `传入不支持的type: ${type}`);
|
||||
}
|
||||
}
|
||||
if (session) {
|
||||
if (!sessionMessage$session) {
|
||||
closeRootMode();
|
||||
return session.id;
|
||||
}
|
||||
await context.operate('session', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'update',
|
||||
data: {
|
||||
sessionMessage$session,
|
||||
},
|
||||
];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
assert(false, `传入不支持的type: ${type}`);
|
||||
}
|
||||
}
|
||||
if (session) {
|
||||
if (!sessionMessage$session) {
|
||||
filter: {
|
||||
id: session.id,
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
closeRootMode();
|
||||
return session.id;
|
||||
}
|
||||
await context.operate('session', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'update',
|
||||
data: {
|
||||
sessionMessage$session,
|
||||
},
|
||||
filter: {
|
||||
id: session.id,
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
return session.id;
|
||||
else {
|
||||
const sessionId = await generateNewIdAsync();
|
||||
await context.operate('session', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: Object.assign({
|
||||
id: sessionId,
|
||||
entity,
|
||||
entityId,
|
||||
userId,
|
||||
lmts: Date.now(),
|
||||
openId: data?.FromUserName,
|
||||
}, sessionMessage$session && { sessionMessage$session }),
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
closeRootMode();
|
||||
return sessionId;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const sessionId = await generateNewIdAsync();
|
||||
await context.operate('session', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: Object.assign({
|
||||
id: sessionId,
|
||||
entity,
|
||||
entityId,
|
||||
userId,
|
||||
lmts: Date.now(),
|
||||
openId: data?.FromUserName,
|
||||
}, sessionMessage$session && { sessionMessage$session }),
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
return sessionId;
|
||||
catch (e) {
|
||||
closeRootMode();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "session", false, {
|
||||
selectedId: string;
|
||||
onSelect: (id: string) => void;
|
||||
key: string;
|
||||
entityFilter: {};
|
||||
name: undefined;
|
||||
isEntity: boolean;
|
||||
name: string;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,29 @@ export default OakComponent({
|
|||
},
|
||||
},
|
||||
},
|
||||
sessionMessage$session: {
|
||||
$entity: 'sessionMessage',
|
||||
data: {
|
||||
id: 1,
|
||||
text: 1,
|
||||
type: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
createTime: 1,
|
||||
$$createAt$$: 1,
|
||||
aaoe: 1,
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
indexFrom: 0,
|
||||
count: 1,
|
||||
},
|
||||
},
|
||||
isList: false,
|
||||
formData({ data, features }) {
|
||||
|
|
@ -50,10 +73,7 @@ export default OakComponent({
|
|||
});
|
||||
if (session?.sessionMessage$session) {
|
||||
Object.assign(session, {
|
||||
wechatMessages: session?.sessionMessage$session,
|
||||
// unreadLength: session?.sessionMessage$session?.filter(
|
||||
// (ele: any) => ele.isRead === false
|
||||
// )?.length,
|
||||
sessionMessages: session?.sessionMessage$session,
|
||||
});
|
||||
}
|
||||
return session;
|
||||
|
|
@ -63,74 +83,78 @@ export default OakComponent({
|
|||
const { oakId } = this.props;
|
||||
const { session } = this.state;
|
||||
const userId = this.features.token.getUserId(true);
|
||||
const { data: readRemark } = await this.features.cache.refresh('readRemark', {
|
||||
data: {
|
||||
id: 1,
|
||||
sessionId: 1,
|
||||
userId: 1,
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
filter: {
|
||||
session: {
|
||||
id: oakId
|
||||
},
|
||||
userId,
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
count: 1,
|
||||
});
|
||||
const { data: sessionMessage } = await this.features.cache.refresh('sessionMessage', {
|
||||
data: {
|
||||
id: 1,
|
||||
sessionId: 1,
|
||||
userId: 1,
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
filter: {
|
||||
session: {
|
||||
id: oakId
|
||||
},
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
count: 1,
|
||||
});
|
||||
if (readRemark && readRemark?.length > 0) {
|
||||
if (session?.lmst > readRemark && sessionMessage[0]?.userId !== userId) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (sessionMessage[0]?.userId !== userId) {
|
||||
}
|
||||
}
|
||||
// TODO readRemark未实现
|
||||
// const { data: readRemark } = await this.features.cache.refresh(
|
||||
// 'readRemark',
|
||||
// {
|
||||
// data: {
|
||||
// id: 1,
|
||||
// sessionId: 1,
|
||||
// userId: 1,
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// filter: {
|
||||
// sessionId: oakId,
|
||||
// userId,
|
||||
// },
|
||||
// sorter: [
|
||||
// {
|
||||
// $attr: {
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// $direction: 'desc',
|
||||
// },
|
||||
// ],
|
||||
// count: 1,
|
||||
// }
|
||||
// );
|
||||
// const { data: sessionMessage } = await this.features.cache.refresh(
|
||||
// 'sessionMessage',
|
||||
// {
|
||||
// data: {
|
||||
// id: 1,
|
||||
// sessionId: 1,
|
||||
// userId: 1,
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// filter: {
|
||||
// sessionId: oakId,
|
||||
// },
|
||||
// sorter: [
|
||||
// {
|
||||
// $attr: {
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// $direction: 'desc',
|
||||
// },
|
||||
// ],
|
||||
// count: 1,
|
||||
// }
|
||||
// );
|
||||
// if (readRemark && readRemark?.length > 0) {
|
||||
// if (
|
||||
// session?.lmst > readRemark &&
|
||||
// sessionMessage[0]?.userId !== userId
|
||||
// ) {
|
||||
// }
|
||||
// } else {
|
||||
// if (sessionMessage[0]?.userId !== userId) {
|
||||
// }
|
||||
// }
|
||||
},
|
||||
},
|
||||
properties: {
|
||||
selectedId: '',
|
||||
onSelect: (id) => { },
|
||||
key: '',
|
||||
entityFilter: {},
|
||||
name: undefined,
|
||||
isEntity: false,
|
||||
name: '',
|
||||
},
|
||||
methods: {
|
||||
getAvatarUrl() {
|
||||
const { userUrl, entity } = this.state;
|
||||
const { entityFilter } = this.props;
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
if (entityFilter) {
|
||||
const { isEntity } = this.props;
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
if (isEntity) {
|
||||
return userUrl || defaultUrl;
|
||||
}
|
||||
else {
|
||||
|
|
@ -139,12 +163,11 @@ export default OakComponent({
|
|||
},
|
||||
getName() {
|
||||
const { user, entity, openId } = this.state;
|
||||
const { entityFilter } = this.props;
|
||||
if (entityFilter) {
|
||||
const { isEntity } = this.props;
|
||||
if (isEntity) {
|
||||
const userName = user?.name;
|
||||
const userNickname = user?.name || user?.nickname;
|
||||
const userMobile = user?.mobile$user &&
|
||||
user?.mobile$user[0]?.mobile;
|
||||
const userMobile = user?.mobile$user && user?.mobile$user[0]?.mobile;
|
||||
if (userName) {
|
||||
return userName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { EntityDict } from '../../../oak-app-domain';
|
|||
export default function render(props: WebComponentProps<EntityDict, 'session', false, {
|
||||
id: string;
|
||||
unreadLength: number;
|
||||
sessiontMessages: EntityDict['sessionMessage']['Schema'][];
|
||||
sessionMessages: EntityDict['sessionMessage']['Schema'][];
|
||||
userType: string;
|
||||
selectedId: string;
|
||||
onSelect: (id: string) => void;
|
||||
|
|
|
|||
|
|
@ -5,22 +5,22 @@ import classNames from 'classnames';
|
|||
import Style from './web.module.less';
|
||||
export default function render(props) {
|
||||
const { methods, data } = props;
|
||||
const { selectedId, onSelect, userType, id, unreadLength, sessiontMessages = [], name, lmts, } = data;
|
||||
const { selectedId, onSelect, id, unreadLength, sessionMessages = [], name, lmts, } = data;
|
||||
const { t, getName, getAvatarUrl } = methods;
|
||||
const sessiontMessage = sessiontMessages && sessiontMessages[0];
|
||||
const type = sessiontMessage?.type;
|
||||
const text = sessiontMessage?.text;
|
||||
const sessionMessage = sessionMessages && sessionMessages[0];
|
||||
const type = sessionMessage?.type;
|
||||
const text = sessionMessage?.text;
|
||||
const today = dayjs().startOf('day').valueOf();
|
||||
const createAt2 = lmts && dayjs(lmts).startOf('day').valueOf();
|
||||
const lastCreateAt = lmts && dayjs(lmts).startOf('day').valueOf();
|
||||
return (_jsxs("div", { className: classNames(Style.cell, {
|
||||
[Style.cell_selected]: id === selectedId,
|
||||
}), onClick: () => {
|
||||
onSelect(id);
|
||||
}, children: [_jsx(Badge, { dot: id === selectedId ? false : true, count: unreadLength || 0, children: _jsx(Image, { className: Style.avatar, src: getAvatarUrl(), preview: false }) }), _jsxs("div", { className: Style.inner, children: [_jsxs("div", { className: Style.top, children: [_jsx("div", { className: Style.title, children: name || getName() }), _jsx("div", { className: Style.date, children: lmts &&
|
||||
(today === createAt2
|
||||
}, children: [_jsx(Badge, { dot: id !== selectedId, count: unreadLength || 0, children: _jsx(Image, { className: Style.avatar, src: getAvatarUrl(), preview: false }) }), _jsxs("div", { className: Style.inner, children: [_jsxs("div", { className: Style.top, children: [_jsx("div", { className: Style.title, children: name || getName() }), _jsx("div", { className: Style.date, children: lmts &&
|
||||
(today === lastCreateAt
|
||||
? dayjs(lmts).format('HH:mm')
|
||||
: dayjs(lmts).format('YYYY-MM-DD')) })] }), _jsx("div", { className: Style.message, children: type &&
|
||||
(type === 'text'
|
||||
? `${text}`
|
||||
: `[${t(`sessiontMessage:v.type.${type}`)}消息]`) })] })] }));
|
||||
: `[${t(`sessionMessage:v.type.${type}`)}消息]`) })] })] }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,45 +1,4 @@
|
|||
export default OakComponent({
|
||||
// entity: 'session',
|
||||
// projection: {
|
||||
// id: 1,
|
||||
// userId: 1,
|
||||
// entity: 1,
|
||||
// entityId: 1,
|
||||
// lmts: 1,
|
||||
// user: {
|
||||
// id: 1,
|
||||
// name: 1,
|
||||
// nickname: 1,
|
||||
// mobile$user: {
|
||||
// $entity: 'mobile',
|
||||
// data: {
|
||||
// id: 1,
|
||||
// mobile: 1,
|
||||
// userId: 1,
|
||||
// },
|
||||
// },
|
||||
// extraFile$entity: {
|
||||
// $entity: 'extraFile',
|
||||
// data: {
|
||||
// id: 1,
|
||||
// tag1: 1,
|
||||
// origin: 1,
|
||||
// bucket: 1,
|
||||
// objectId: 1,
|
||||
// filename: 1,
|
||||
// extra1: 1,
|
||||
// extension: 1,
|
||||
// type: 1,
|
||||
// entity: 1,
|
||||
// },
|
||||
// filter: {
|
||||
// tag1: {
|
||||
// $in: ['avatar'],
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
isList: false,
|
||||
formData({ data, features }) {
|
||||
const { sessionId } = this.props;
|
||||
|
|
@ -48,25 +7,8 @@ export default OakComponent({
|
|||
}
|
||||
return {};
|
||||
},
|
||||
// filters: [
|
||||
// {
|
||||
// filter() {
|
||||
// const { sessionId } = this.props;
|
||||
// if (sessionId) {
|
||||
// return {
|
||||
// id: sessionId,
|
||||
// };
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
lifetimes: {
|
||||
ready() {
|
||||
const { sessionId } = this.props;
|
||||
// if (sessionId) {
|
||||
// this.getSession(sessionId)
|
||||
// }
|
||||
},
|
||||
ready() { },
|
||||
},
|
||||
listeners: {
|
||||
sessionId(prev, next) {
|
||||
|
|
@ -79,7 +21,7 @@ export default OakComponent({
|
|||
sessionId: '',
|
||||
isEntity: false,
|
||||
entityDisplay: (data) => [],
|
||||
entityProjection: {}, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
entityProjection: null, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
},
|
||||
methods: {
|
||||
getSession(sessionId) {
|
||||
|
|
@ -131,7 +73,7 @@ export default OakComponent({
|
|||
getAvatarUrl() {
|
||||
const { userUrl, entity } = this.state;
|
||||
const { isEntity } = this.props;
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
if (isEntity) {
|
||||
return userUrl || defaultUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
align-items: center;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 20;
|
||||
z-index: 1;
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { Avatar } from 'antd';
|
||||
// import { UserOutlined } from '@ant-design/icons';
|
||||
import Style from './web.module.less';
|
||||
export default function render(props) {
|
||||
const { methods, data } = props;
|
||||
const { nickname, avatarUrl, name } = data;
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
return (_jsxs("div", { className: Style.header, children: [_jsx(Avatar, { shape: "square", className: Style.avatar, src: avatarUrl || defaultUrl }), _jsx("div", { className: Style.nickname, children: nickname || name })] }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
/// <reference types="react" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "session", true, {
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { RowWithActions } from 'oak-frontend-base';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "session", true, {
|
||||
entity: string;
|
||||
entityFilter: any;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: any;
|
||||
sessionId: string;
|
||||
dialog: boolean;
|
||||
|
|
|
|||
|
|
@ -81,14 +81,11 @@ export default OakComponent({
|
|||
entityDisplay &&
|
||||
sessions &&
|
||||
sessions.length > 0) {
|
||||
const sessions1 = entityDisplay(sessions);
|
||||
const newSessions = entityDisplay(sessions);
|
||||
return {
|
||||
sessions: sessions1,
|
||||
sessions: newSessions,
|
||||
};
|
||||
}
|
||||
// const unReadLength = wechatSessions?.filter(
|
||||
// (ele) => ele.isRead
|
||||
// )
|
||||
//排序待框架实现
|
||||
return {
|
||||
sessions: sessions?.sort((a, b) => b.lmts - a.lmts),
|
||||
|
|
@ -131,9 +128,9 @@ export default OakComponent({
|
|||
},
|
||||
properties: {
|
||||
entity: '',
|
||||
entityFilter: undefined,
|
||||
entityFilter: null,
|
||||
entityDisplay: (data) => [],
|
||||
entityProjection: {},
|
||||
entityProjection: null,
|
||||
sessionId: '',
|
||||
dialog: false,
|
||||
onItemClick: null,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
type Session = EntityDict['session']['Schema'];
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'session', true, {
|
||||
sessions: EntityDict['session']['Schema'][];
|
||||
sessions: Partial<Session & {
|
||||
name: string;
|
||||
}>[];
|
||||
selectedSessionId: string;
|
||||
entityFilter: object;
|
||||
}, {
|
||||
setSelectedSessionId: (sessionId: string) => void;
|
||||
navigateToMessage: (sessionId: string) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import Header from '../../../components/session/header';
|
|||
import SessionCell from '../../../components/session/cell';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { sessions, selectedSessionId, oakFullpath, entityFilter, } = data;
|
||||
const { sessions, selectedSessionId, oakFullpath, entityFilter } = data;
|
||||
const { navigateToMessage, setSelectedSessionId } = methods;
|
||||
return (_jsx("div", { className: Style.container, children: _jsxs("div", { className: Style.conversationContainer, children: [_jsx(Header, {}), sessions?.map((session, index) => {
|
||||
return (_jsx(SessionCell, { entityFilter: entityFilter, selectedId: selectedSessionId, name: session?.name, onSelect: (id) => {
|
||||
return (_jsx(SessionCell, { isEntity: entityFilter ? true : false, selectedId: selectedSessionId, name: session?.name, onSelect: (id) => {
|
||||
navigateToMessage(id);
|
||||
}, oakId: session.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${session.id}`
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
type Session = EntityDict['session']['Schema'];
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'session', true, {
|
||||
sessions: any;
|
||||
sessions: Partial<Session & {
|
||||
name: string;
|
||||
}>[];
|
||||
selectedSessionId: string;
|
||||
className: string;
|
||||
dialog: boolean;
|
||||
entityFilter: object;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: object;
|
||||
}, {
|
||||
setSelectedSessionId: (sessionId: string) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import MessageList from '../../sessionMessage/list';
|
||||
import SessionMessageList from '../../sessionMessage/list';
|
||||
import Header from '../../../components/session/header';
|
||||
import SessionCell from '../../../components/session/cell';
|
||||
import classNames from 'classnames';
|
||||
|
|
@ -11,12 +11,10 @@ export default function Render(props) {
|
|||
return (_jsx("div", { className: Style.container, children: _jsxs("div", { className: classNames(Style.bothContainer, className, {
|
||||
[Style.dialogContainer]: dialog,
|
||||
}), children: [_jsxs("div", { className: Style.conversationContainer, children: [_jsx(Header, {}), _jsx("div", { className: Style.inner, children: sessions?.map((session, index) => {
|
||||
return (_jsx(SessionCell, { entityFilter: entityFilter, name: session?.name, selectedId: selectedSessionId, onSelect: (id) => {
|
||||
return (_jsx(SessionCell, { isEntity: entityFilter ? true : false, name: session?.name, selectedId: selectedSessionId, onSelect: (id) => {
|
||||
setSelectedSessionId(id);
|
||||
}, oakId: session.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${session.id}`
|
||||
: '' }, session.id));
|
||||
}) })] }), selectedSessionId && (_jsx(MessageList, { sessionId: selectedSessionId, isEntity: entityFilter ? true : false, oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection, oakPath: oakFullpath
|
||||
? `$$sessionMessage/list`
|
||||
: undefined }))] }) }));
|
||||
}) })] }), selectedSessionId && (_jsx(SessionMessageList, { sessionId: selectedSessionId, isEntity: entityFilter ? true : false, oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection, oakPath: oakFullpath ? `$$sessionMessage/list` : undefined }))] }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,12 +72,10 @@ export default OakComponent({
|
|||
},
|
||||
formData({ data: sessionMessage, features }) {
|
||||
const type = sessionMessage?.type;
|
||||
// const data = wechatMessage?.data;
|
||||
const session = sessionMessage?.session;
|
||||
const newSessionMessage = {
|
||||
type,
|
||||
aaoe: sessionMessage?.aaoe,
|
||||
// data,
|
||||
text: sessionMessage?.text,
|
||||
id: sessionMessage?.id,
|
||||
$$createAt$$: sessionMessage?.$$createAt$$,
|
||||
|
|
@ -85,13 +83,13 @@ export default OakComponent({
|
|||
userId: session?.userId,
|
||||
userMobile: session?.user?.mobile$user &&
|
||||
session?.user?.mobile$user[0]?.mobile,
|
||||
userAvatar: this.features.extraFile.getUrl(session?.user?.extraFile$entity &&
|
||||
userAvatar: features.extraFile2.getUrl(session?.user?.extraFile$entity &&
|
||||
session?.user?.extraFile$entity[0]),
|
||||
};
|
||||
if (type === 'image') {
|
||||
const extraFile$entity = sessionMessage?.extraFile$entity;
|
||||
Object.assign(newSessionMessage, {
|
||||
picUrl: features.extraFile.getUrl(extraFile$entity && extraFile$entity[0]),
|
||||
picUrl: features.extraFile2.getUrl(extraFile$entity && extraFile$entity[0]),
|
||||
});
|
||||
}
|
||||
return newSessionMessage;
|
||||
|
|
@ -101,8 +99,8 @@ export default OakComponent({
|
|||
},
|
||||
methods: {
|
||||
getAvatarUrl(aaoe) {
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
const { companyLogoUrl, userAvatar, parkLogoUrl } = this.state;
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
const { userAvatar } = this.state;
|
||||
if (aaoe) {
|
||||
return defaultUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { RowWithActions } from 'oak-frontend-base';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "sessionMessage", true, {
|
||||
sessionId: string;
|
||||
isEntity: boolean;
|
||||
dialog: boolean;
|
||||
entity: string;
|
||||
entityId: string;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: any;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export default OakComponent({
|
|||
await this.pageScroll('comment');
|
||||
});
|
||||
this.createItem();
|
||||
this.getConversationInfo();
|
||||
this.getSessionInfo();
|
||||
},
|
||||
detached() {
|
||||
if (this.timer) {
|
||||
|
|
@ -80,7 +80,7 @@ export default OakComponent({
|
|||
if (prev.sessionId !== next.sessionId) {
|
||||
if (next.sessionId) {
|
||||
const { sessionMessageId } = this.state;
|
||||
this.getConversationInfo();
|
||||
this.getSessionInfo();
|
||||
// 如果sessionId变了需要重新刷新下
|
||||
this.refresh();
|
||||
this.removeItem(sessionMessageId);
|
||||
|
|
@ -110,7 +110,7 @@ export default OakComponent({
|
|||
entity: '',
|
||||
entityId: '',
|
||||
entityDisplay: (data) => [],
|
||||
entityProjection: {}, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
entityProjection: null, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
|
|
@ -135,7 +135,6 @@ export default OakComponent({
|
|||
data: {
|
||||
content: '',
|
||||
buttonHidden: true,
|
||||
selectedTradeId: '',
|
||||
newSessionId: '',
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -173,20 +172,12 @@ export default OakComponent({
|
|||
},
|
||||
setContent(text) {
|
||||
const { sessionMessageId } = this.state;
|
||||
this.setState({
|
||||
text,
|
||||
});
|
||||
this.updateItem({
|
||||
text,
|
||||
type: 'text',
|
||||
}, sessionMessageId);
|
||||
},
|
||||
setButtonHidden(isHidden) {
|
||||
this.setState({
|
||||
buttonHidden: isHidden,
|
||||
});
|
||||
},
|
||||
async getConversationInfo() {
|
||||
async getSessionInfo() {
|
||||
const { sessionId } = this.props;
|
||||
if (!sessionId) {
|
||||
return;
|
||||
|
|
@ -236,10 +227,6 @@ export default OakComponent({
|
|||
id: sessionId,
|
||||
},
|
||||
});
|
||||
this.setState({
|
||||
entity: session?.entity,
|
||||
entityId: session?.entityId,
|
||||
});
|
||||
},
|
||||
pageScroll(id) {
|
||||
const doc = window.document.getElementById(id);
|
||||
|
|
@ -262,23 +249,16 @@ export default OakComponent({
|
|||
});
|
||||
},
|
||||
async createMessage() {
|
||||
const { text, wechatUserId, newSessionId, sessionMessageId } = this.state;
|
||||
const { text, wechatUserId, sessionMessageId } = this.state;
|
||||
const { sessionId, isEntity } = this.props;
|
||||
const userId = this.features.token.getUserId();
|
||||
const applicationId = this.features.application.getApplicationId();
|
||||
if (!this.state.text) {
|
||||
this.setMessage({
|
||||
type: 'warning',
|
||||
content: '请输入内容',
|
||||
});
|
||||
return;
|
||||
}
|
||||
// this.addItem({
|
||||
// applicationId,
|
||||
// text,
|
||||
// userId,
|
||||
// wechatUserId,
|
||||
// sessionId: sessionId || newSessionId,
|
||||
// sessionId: sessionId,
|
||||
// type: 'text',
|
||||
// createTime: Date.now(),
|
||||
// aaoe: isEntity,
|
||||
|
|
@ -287,9 +267,6 @@ export default OakComponent({
|
|||
createTime: Date.now(),
|
||||
}, sessionMessageId);
|
||||
await this.execute(undefined, false);
|
||||
this.setState({
|
||||
text: '',
|
||||
});
|
||||
this.pageScroll('comment');
|
||||
this.createItem();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -14,15 +14,7 @@
|
|||
flex-direction: column;
|
||||
margin-top: 50px;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bottomSku {
|
||||
width: calc(100% - 16px);
|
||||
// position: fixed;
|
||||
bottom: 176px;
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
height: calc(100% - 50px - 190px);
|
||||
}
|
||||
|
||||
.bottom {
|
||||
|
|
@ -35,7 +27,7 @@
|
|||
bottom: 0;
|
||||
margin: 0px;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
z-index: 1;
|
||||
|
||||
// resize: both;
|
||||
// cursor: nwse-resize;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
interface customFile {
|
||||
name: string;
|
||||
|
|
@ -12,15 +12,11 @@ export default function Render(props: WebComponentProps<EntityDict, 'sessionMess
|
|||
buttonHidden: boolean;
|
||||
sessionId: string;
|
||||
isEntity: boolean;
|
||||
isUser: boolean;
|
||||
employerId: string;
|
||||
sessionMessageType: string;
|
||||
sessionMessageId: string;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: object;
|
||||
isWeChat: boolean;
|
||||
}, {
|
||||
setButtonHidden: (isHidden: boolean) => void;
|
||||
customUpload: (file: customFile) => void;
|
||||
setContent: (text: string) => void;
|
||||
pageScroll: (id: string) => void;
|
||||
|
|
|
|||
|
|
@ -1,57 +1,25 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { Button, Input, Upload } from 'antd';
|
||||
import { PictureOutlined } from '@ant-design/icons';
|
||||
import MessageCell from '../../../components/sessionMessage/cell';
|
||||
import SessionMessageCell from '../../../components/sessionMessage/cell';
|
||||
import MessageUpsert from '../../../components/sessionMessage/upsert';
|
||||
import Header from '../../../components/session/forMessage';
|
||||
import Style from './web.module.less';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { sessionId, isEntity, sessionMessageList, oakFullpath, text, buttonHidden, sessionMessageType, sessionMessageId, entityDisplay, entityProjection, isWeChat, } = data;
|
||||
const { setButtonHidden, customUpload, setContent, pageScroll, createMessage, } = methods;
|
||||
const [bottomHeight, setBottomHeight] = useState(0);
|
||||
const textareaRef = useRef(null);
|
||||
useEffect(() => {
|
||||
if (buttonHidden) {
|
||||
const newBottomHeight = window.document.getElementById('bottom')?.offsetHeight;
|
||||
setBottomHeight(newBottomHeight);
|
||||
}
|
||||
else {
|
||||
setBottomHeight(0);
|
||||
}
|
||||
}, [buttonHidden]);
|
||||
const handleKeyDown = (event) => {
|
||||
if (event.key === "Enter" && !event.shiftKey) {
|
||||
event.preventDefault();
|
||||
createMessage();
|
||||
pageScroll('comment');
|
||||
}
|
||||
};
|
||||
return (_jsxs("div", { className: Style.container, children: [_jsx(Header, { sessionId: sessionId, isEntity: isEntity, oakPath: 'session:header1', oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection }), _jsx("div", { className: Style.inner, style: {
|
||||
marginBottom: bottomHeight ? `${bottomHeight}px` : '168px',
|
||||
}, id: "comment", onClick: () => setButtonHidden(true), children: sessionMessageList
|
||||
const { sessionId, isEntity, sessionMessageList, oakFullpath, text, buttonHidden, sessionMessageId, entityDisplay, entityProjection, isWeChat, } = data;
|
||||
const { customUpload, setContent, pageScroll, createMessage, } = methods;
|
||||
return (_jsxs("div", { className: Style.container, children: [_jsx(Header, { sessionId: sessionId, isEntity: isEntity, oakPath: '$$sessionMessage/list-session/header', oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection }), _jsx("div", { className: Style.inner, id: "comment", children: sessionMessageList
|
||||
?.sort((a, b) => a.$$createAt$$ -
|
||||
b.$$createAt$$)
|
||||
.map((sessionMessage, index) => {
|
||||
return (_jsx(MessageCell, { oakId: sessionMessage.id, oakPath: oakFullpath
|
||||
return (_jsx(SessionMessageCell, { oakId: sessionMessage.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${sessionMessage.id}`
|
||||
: '', isEntity: isEntity }, sessionMessage.id));
|
||||
}) }), _jsxs("div", { className: Style.bottom, id: "bottom", children: [_jsx("div", { className: Style.toolbar, children: isWeChat ? (
|
||||
//微信资源库
|
||||
_jsx(PictureOutlined, { className: Style.icon })) : (_jsx(Upload, { accept: 'image/*', multiple: false, showUploadList: false, customRequest: () => { }, onChange: ({ file }) => {
|
||||
customUpload(file);
|
||||
}, children: _jsx(PictureOutlined, { className: Style.icon }) })) }), _jsxs("div", { className: Style.textareaBox, children: [_jsx(Input.TextArea, { ref: textareaRef, className: Style.textarea, maxLength: 500, placeholder: "Enter \u53D1\u9001\uFF0CShift + Enter\u6362\u884C", rows: 5, onChange: (e) => {
|
||||
setContent(e.target.value);
|
||||
}, onFocus: () => {
|
||||
setButtonHidden(true);
|
||||
},
|
||||
// onPressEnter={(e) => {
|
||||
// e.preventDefault();
|
||||
// createMessage();
|
||||
// pageScroll('comment');
|
||||
// }}
|
||||
onKeyDown: handleKeyDown, value: text }), _jsx("div", { className: Style.btn, children: _jsx(Button, { type: "primary", disabled: !text, onClick: () => {
|
||||
createMessage();
|
||||
pageScroll('comment');
|
||||
}, children: "\u53D1\u9001" }) })] })] })] }));
|
||||
}) }), _jsx("div", { className: Style.bottom, id: "bottom", children: sessionMessageId && (_jsx(MessageUpsert, { isEntity: isEntity, oakId: sessionMessageId, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${sessionMessageId}`
|
||||
: '', oakAutoUnmount: true, send: () => {
|
||||
createMessage();
|
||||
}, setText: (text) => {
|
||||
setContent(text);
|
||||
}, customUpload: (file) => {
|
||||
} }, `MessageUpsert_${sessionMessageId}`)) })] }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
/// <reference types="react" />
|
||||
import { UploadFile } from 'antd/es/upload/interface';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "sessionMessage", true, {
|
||||
sessionId: string;
|
||||
userType: string;
|
||||
dialog: boolean;
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "sessionMessage", false, {
|
||||
isEntity: boolean;
|
||||
customUpload: (file: UploadFile) => void;
|
||||
send: () => void;
|
||||
setText: (text: string) => void;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
export default OakComponent({
|
||||
entity: 'sessionMessage',
|
||||
isList: false,
|
||||
projection: {
|
||||
id: 1,
|
||||
text: 1,
|
||||
type: 1,
|
||||
createTime: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
$$createAt$$: 1,
|
||||
sessionId: 1,
|
||||
session: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
mobile$user: {
|
||||
$entity: 'mobile',
|
||||
data: {
|
||||
id: 1,
|
||||
mobile: 1,
|
||||
},
|
||||
},
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
extension: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: {
|
||||
$in: ['avatar'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
aaoe: 1,
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
tag2: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
extension: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: {
|
||||
$in: ['image'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
formData({ data: sessionMessage, features }) {
|
||||
const type = sessionMessage?.type;
|
||||
const session = sessionMessage?.session;
|
||||
const newSessionMessage = {
|
||||
type,
|
||||
aaoe: sessionMessage?.aaoe,
|
||||
text: sessionMessage?.text,
|
||||
id: sessionMessage?.id,
|
||||
$$createAt$$: sessionMessage?.$$createAt$$,
|
||||
sessionId: sessionMessage?.sessionId,
|
||||
userId: session?.userId,
|
||||
userMobile: session?.user?.mobile$user &&
|
||||
session?.user?.mobile$user[0]?.mobile,
|
||||
userAvatar: this.features.extraFile.getUrl(session?.user?.extraFile$entity &&
|
||||
session?.user?.extraFile$entity[0]),
|
||||
};
|
||||
if (type === 'image') {
|
||||
const extraFile$entity = sessionMessage?.extraFile$entity;
|
||||
Object.assign(newSessionMessage, {
|
||||
picUrl: features.extraFile.getUrl(extraFile$entity && extraFile$entity[0]),
|
||||
});
|
||||
}
|
||||
return newSessionMessage;
|
||||
},
|
||||
properties: {
|
||||
isEntity: false,
|
||||
customUpload: (file) => { },
|
||||
send: () => { },
|
||||
setText: (text) => { },
|
||||
},
|
||||
methods: {
|
||||
setContent(text) {
|
||||
const { setText } = this.props;
|
||||
if (typeof setText === 'function') {
|
||||
setText(text);
|
||||
}
|
||||
},
|
||||
async upload(file) {
|
||||
const { customUpload } = this.props;
|
||||
if (typeof customUpload === 'function') {
|
||||
customUpload(file);
|
||||
}
|
||||
},
|
||||
async sendData() {
|
||||
const { send } = this.props;
|
||||
const { text } = this.state;
|
||||
if (!text) {
|
||||
this.setMessage({
|
||||
type: 'warning',
|
||||
content: this.t('enterContent'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (typeof send === 'function') {
|
||||
send();
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"placeholder": "Enter 发送,Shift + Enter换行",
|
||||
"send": "发送",
|
||||
"enterContent": "请输入内容"
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { UploadFile } from 'antd/es/upload/interface';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'sessionMessage', false, {
|
||||
isEntity: boolean;
|
||||
isUser: boolean;
|
||||
$$createAt$$: number;
|
||||
text: string;
|
||||
type: string;
|
||||
aaoe: boolean;
|
||||
picUrl: string;
|
||||
sessionId: string;
|
||||
oakId: string;
|
||||
isWeChat: string;
|
||||
}, {
|
||||
setContent: (str: string) => void;
|
||||
sendData: () => void;
|
||||
upload: (file: UploadFile) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import { useRef } from 'react';
|
||||
import { Button, Input, Upload } from 'antd';
|
||||
import { PictureOutlined } from '@ant-design/icons';
|
||||
import Style from './web.module.less';
|
||||
export default function render(props) {
|
||||
const { data, methods } = props;
|
||||
const { $$createAt$$, text, type, picUrl, isEntity, aaoe, sessionId, isWeChat, } = data;
|
||||
const { t, setContent, sendData, upload } = methods;
|
||||
const textareaRef = useRef(null);
|
||||
const handleKeyDown = (event) => {
|
||||
if (event.key === 'Enter' && !event.shiftKey) {
|
||||
event.preventDefault();
|
||||
sendData();
|
||||
}
|
||||
};
|
||||
return (_jsxs(_Fragment, { children: [_jsx("div", { className: Style.toolbar, children: _jsx(Upload, { accept: 'image/*', multiple: false, showUploadList: false, customRequest: () => { }, onChange: ({ file }) => {
|
||||
upload(file);
|
||||
}, children: _jsx(PictureOutlined, { className: Style.icon }) }) }), _jsxs("div", { className: Style.textareaBox, children: [_jsx(Input.TextArea, { ref: textareaRef, className: Style.textarea, maxLength: 500, placeholder: t('placeholder'), rows: 5, onChange: (e) => {
|
||||
setContent(e.target.value);
|
||||
}, onFocus: () => { }, onKeyDown: handleKeyDown, value: text }), _jsx("div", { className: Style.btn, children: _jsx(Button, { type: "primary", disabled: !text, onClick: () => {
|
||||
sendData();
|
||||
}, children: t('send') }) })] })] }));
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 30px;
|
||||
|
||||
.icon {
|
||||
margin: 0 6px;
|
||||
font-size: 20px;
|
||||
color: var(--oak-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.textareaBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
padding: 0 10px;
|
||||
|
||||
|
||||
.textarea {
|
||||
border: none;
|
||||
outline: none;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.textarea:focus {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
margin: 5px 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -257,6 +257,18 @@ const i18ns = [
|
|||
"confirmToRemove": "您确定要删除系统吗?"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "7c6300b665cdc65858a529c9d4c46d24",
|
||||
namespace: "oak-general-business-c-sessionMessage-upsert",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/sessionMessage/upsert",
|
||||
data: {
|
||||
"placeholder": "Enter 发送,Shift + Enter换行",
|
||||
"send": "发送",
|
||||
"enterContent": "请输入内容"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "ded171ed67640a148a4a2cc51470cf69",
|
||||
namespace: "oak-general-business-c-system-application",
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ import * as Notification from "../Notification/Schema";
|
|||
import * as SessionMessage from "../SessionMessage/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
import * as WechatMenu from "../WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "../WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as Session from "../Session/Schema";
|
||||
export type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic';
|
||||
export type AppType = 'web' | 'wechatMp' | 'wechatPublic';
|
||||
|
|
@ -93,8 +93,6 @@ export type Schema = EntityShape & {
|
|||
token$application$$aggr?: AggregationResult<Token.Schema>;
|
||||
wechatMenu$application?: Array<WechatMenu.Schema>;
|
||||
wechatMenu$application$$aggr?: AggregationResult<WechatMenu.Schema>;
|
||||
wechatPublicAutoReply$application?: Array<wechatPublicAutoReply.Schema>;
|
||||
wechatPublicAutoReply$application$$aggr?: AggregationResult<wechatPublicAutoReply.Schema>;
|
||||
wechatPublicTag$application?: Array<WechatPublicTag.Schema>;
|
||||
wechatPublicTag$application$$aggr?: AggregationResult<WechatPublicTag.Schema>;
|
||||
wechatPublicTemplate$application?: Array<WechatPublicTemplate.Schema>;
|
||||
|
|
@ -103,6 +101,8 @@ export type Schema = EntityShape & {
|
|||
wechatQrCode$application$$aggr?: AggregationResult<WechatQrCode.Schema>;
|
||||
wechatUser$application?: Array<WechatUser.Schema>;
|
||||
wechatUser$application$$aggr?: AggregationResult<WechatUser.Schema>;
|
||||
wechatPublicAutoReply$application?: Array<wechatPublicAutoReply.Schema>;
|
||||
wechatPublicAutoReply$application$$aggr?: AggregationResult<wechatPublicAutoReply.Schema>;
|
||||
session$entity?: Array<Session.Schema>;
|
||||
session$entity$$aggr?: AggregationResult<Session.Schema>;
|
||||
} & {
|
||||
|
|
@ -125,11 +125,11 @@ type AttrFilter = {
|
|||
sessionMessage$application: SessionMessage.Filter & SubQueryPredicateMetadata;
|
||||
token$application: Token.Filter & SubQueryPredicateMetadata;
|
||||
wechatMenu$application: WechatMenu.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicAutoReply$application: wechatPublicAutoReply.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicTag$application: WechatPublicTag.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicTemplate$application: WechatPublicTemplate.Filter & SubQueryPredicateMetadata;
|
||||
wechatQrCode$application: WechatQrCode.Filter & SubQueryPredicateMetadata;
|
||||
wechatUser$application: WechatUser.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicAutoReply$application: wechatPublicAutoReply.Filter & SubQueryPredicateMetadata;
|
||||
session$entity: Session.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
|
|
@ -177,12 +177,6 @@ export type Projection = {
|
|||
wechatMenu$application$$aggr?: WechatMenu.Aggregation & {
|
||||
$entity: "wechatMenu";
|
||||
};
|
||||
wechatPublicAutoReply$application?: wechatPublicAutoReply.Selection & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicAutoReply$application$$aggr?: wechatPublicAutoReply.Aggregation & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicTag$application?: WechatPublicTag.Selection & {
|
||||
$entity: "wechatPublicTag";
|
||||
};
|
||||
|
|
@ -207,6 +201,12 @@ export type Projection = {
|
|||
wechatUser$application$$aggr?: WechatUser.Aggregation & {
|
||||
$entity: "wechatUser";
|
||||
};
|
||||
wechatPublicAutoReply$application?: wechatPublicAutoReply.Selection & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicAutoReply$application$$aggr?: wechatPublicAutoReply.Aggregation & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
session$entity?: Session.Selection & {
|
||||
$entity: "session";
|
||||
};
|
||||
|
|
@ -265,11 +265,11 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "systemId">> & (
|
|||
sessionMessage$application?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatMenu$application?: OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTemplate$application?: OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
session$entity?: OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">> | OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
|
|
@ -294,11 +294,11 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemId">> & (
|
|||
sessionMessage$application?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatMenu$application?: OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<WechatMenu.RemoveOperation["action"], Omit<WechatMenu.RemoveOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<WechatMenu.RemoveOperation["action"], Omit<WechatMenu.RemoveOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTemplate$application?: OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.RemoveOperation["action"], Omit<WechatPublicTemplate.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.RemoveOperation["action"], Omit<WechatPublicTemplate.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
session$entity?: OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<Session.RemoveOperation["action"], Omit<Session.RemoveOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">> | OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<Session.RemoveOperation["action"], Omit<Session.RemoveOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ import { EntityDef as UserSystem } from "./UserSystem/Schema";
|
|||
import { EntityDef as UserWechatPublicTag } from "./UserWechatPublicTag/Schema";
|
||||
import { EntityDef as WechatLogin } from "./WechatLogin/Schema";
|
||||
import { EntityDef as WechatMenu } from "./WechatMenu/Schema";
|
||||
import { EntityDef as wechatPublicAutoReply } from "./wechatPublicAutoReply/Schema";
|
||||
import { EntityDef as WechatPublicTag } from "./WechatPublicTag/Schema";
|
||||
import { EntityDef as WechatPublicTemplate } from "./WechatPublicTemplate/Schema";
|
||||
import { EntityDef as WechatQrCode } from "./WechatQrCode/Schema";
|
||||
import { EntityDef as WechatUser } from "./WechatUser/Schema";
|
||||
import { EntityDef as wechatPublicAutoReply } from "./wechatPublicAutoReply/Schema";
|
||||
export type EntityDict = {
|
||||
actionAuth: ActionAuth;
|
||||
i18n: I18n;
|
||||
|
|
@ -92,9 +92,9 @@ export type EntityDict = {
|
|||
userWechatPublicTag: UserWechatPublicTag;
|
||||
wechatLogin: WechatLogin;
|
||||
wechatMenu: WechatMenu;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply;
|
||||
wechatPublicTag: WechatPublicTag;
|
||||
wechatPublicTemplate: WechatPublicTemplate;
|
||||
wechatQrCode: WechatQrCode;
|
||||
wechatUser: WechatUser;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@ import * as UserSystem from "../UserSystem/Schema";
|
|||
import * as UserWechatPublicTag from "../UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "../WechatLogin/Schema";
|
||||
import * as WechatMenu from "../WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "../WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
modiId: ForeignKey<"modi">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
modiId: ForeignKey<"modi">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
modi: Modi.Schema;
|
||||
user?: User.Schema;
|
||||
|
|
@ -34,11 +34,11 @@ export type Schema = EntityShape & {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Schema;
|
||||
wechatLogin?: WechatLogin.Schema;
|
||||
wechatMenu?: WechatMenu.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
wechatPublicTag?: WechatPublicTag.Schema;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Schema;
|
||||
wechatQrCode?: WechatQrCode.Schema;
|
||||
wechatUser?: WechatUser.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
|
|
@ -49,7 +49,7 @@ type AttrFilter = {
|
|||
$$updateAt$$: Q_DateValue;
|
||||
modiId: Q_StringValue;
|
||||
modi: Modi.Filter;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string>;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string>;
|
||||
entityId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
userEntityGrant: UserEntityGrant.Filter;
|
||||
|
|
@ -57,11 +57,11 @@ type AttrFilter = {
|
|||
userWechatPublicTag: UserWechatPublicTag.Filter;
|
||||
wechatLogin: WechatLogin.Filter;
|
||||
wechatMenu: WechatMenu.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
wechatPublicTag: WechatPublicTag.Filter;
|
||||
wechatPublicTemplate: WechatPublicTemplate.Filter;
|
||||
wechatQrCode: WechatQrCode.Filter;
|
||||
wechatUser: WechatUser.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
|
|
@ -81,11 +81,11 @@ export type Projection = {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Projection;
|
||||
wechatLogin?: WechatLogin.Projection;
|
||||
wechatMenu?: WechatMenu.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
wechatPublicTag?: WechatPublicTag.Projection;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Projection;
|
||||
wechatQrCode?: WechatQrCode.Projection;
|
||||
wechatUser?: WechatUser.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ModiEntityIdProjection = OneOf<{
|
||||
id: number;
|
||||
|
|
@ -111,9 +111,6 @@ type WechatLoginIdProjection = OneOf<{
|
|||
type WechatMenuIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
|
|
@ -126,6 +123,9 @@ type WechatQrCodeIdProjection = OneOf<{
|
|||
type WechatUserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -154,8 +154,6 @@ export type SortAttr = {
|
|||
wechatLogin: WechatLogin.SortAttr;
|
||||
} | {
|
||||
wechatMenu: WechatMenu.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
wechatPublicTag: WechatPublicTag.SortAttr;
|
||||
} | {
|
||||
|
|
@ -164,6 +162,8 @@ export type SortAttr = {
|
|||
wechatQrCode: WechatQrCode.SortAttr;
|
||||
} | {
|
||||
wechatUser: WechatUser.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -249,17 +249,6 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatMenu";
|
||||
entityId: ForeignKey<"WechatMenu">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
|
|
@ -304,6 +293,17 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
|
|
@ -348,10 +348,6 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
wechatMenu?: WechatMenu.CreateSingleOperation | WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.CreateSingleOperation | WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
|
|
@ -369,8 +365,12 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "wechatPublicAutoReply" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser"> | null;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser" | "wechatPublicAutoReply"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
|
|
@ -389,8 +389,6 @@ export type RemoveOperationData = {} & (({
|
|||
wechatLogin?: WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
} | {
|
||||
wechatMenu?: WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
|
|
@ -399,6 +397,8 @@ export type RemoveOperationData = {} & (({
|
|||
wechatQrCode?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
} | {
|
||||
wechatUser?: WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
|
|
@ -411,11 +411,11 @@ export type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
|
|||
export type UserWechatPublicTagIdSubQuery = Selection<UserWechatPublicTagIdProjection>;
|
||||
export type WechatLoginIdSubQuery = Selection<WechatLoginIdProjection>;
|
||||
export type WechatMenuIdSubQuery = Selection<WechatMenuIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type WechatPublicTagIdSubQuery = Selection<WechatPublicTagIdProjection>;
|
||||
export type WechatPublicTemplateIdSubQuery = Selection<WechatPublicTemplateIdProjection>;
|
||||
export type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
|
||||
export type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export const desc = {
|
|||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicAutoReply", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser"]
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser", "wechatPublicAutoReply"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@ import * as UserSystem from "../UserSystem/Schema";
|
|||
import * as UserWechatPublicTag from "../UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "../WechatLogin/Schema";
|
||||
import * as WechatMenu from "../WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "../WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
operId: ForeignKey<"oper">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
operId: ForeignKey<"oper">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
oper: Oper.Schema;
|
||||
user?: User.Schema;
|
||||
|
|
@ -34,11 +34,11 @@ export type Schema = EntityShape & {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Schema;
|
||||
wechatLogin?: WechatLogin.Schema;
|
||||
wechatMenu?: WechatMenu.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
wechatPublicTag?: WechatPublicTag.Schema;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Schema;
|
||||
wechatQrCode?: WechatQrCode.Schema;
|
||||
wechatUser?: WechatUser.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
|
|
@ -49,7 +49,7 @@ type AttrFilter = {
|
|||
$$updateAt$$: Q_DateValue;
|
||||
operId: Q_StringValue;
|
||||
oper: Oper.Filter;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string>;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string>;
|
||||
entityId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
userEntityGrant: UserEntityGrant.Filter;
|
||||
|
|
@ -57,11 +57,11 @@ type AttrFilter = {
|
|||
userWechatPublicTag: UserWechatPublicTag.Filter;
|
||||
wechatLogin: WechatLogin.Filter;
|
||||
wechatMenu: WechatMenu.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
wechatPublicTag: WechatPublicTag.Filter;
|
||||
wechatPublicTemplate: WechatPublicTemplate.Filter;
|
||||
wechatQrCode: WechatQrCode.Filter;
|
||||
wechatUser: WechatUser.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
|
|
@ -81,11 +81,11 @@ export type Projection = {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Projection;
|
||||
wechatLogin?: WechatLogin.Projection;
|
||||
wechatMenu?: WechatMenu.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
wechatPublicTag?: WechatPublicTag.Projection;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Projection;
|
||||
wechatQrCode?: WechatQrCode.Projection;
|
||||
wechatUser?: WechatUser.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type OperEntityIdProjection = OneOf<{
|
||||
id: number;
|
||||
|
|
@ -111,9 +111,6 @@ type WechatLoginIdProjection = OneOf<{
|
|||
type WechatMenuIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
|
|
@ -126,6 +123,9 @@ type WechatQrCodeIdProjection = OneOf<{
|
|||
type WechatUserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -154,8 +154,6 @@ export type SortAttr = {
|
|||
wechatLogin: WechatLogin.SortAttr;
|
||||
} | {
|
||||
wechatMenu: WechatMenu.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
wechatPublicTag: WechatPublicTag.SortAttr;
|
||||
} | {
|
||||
|
|
@ -164,6 +162,8 @@ export type SortAttr = {
|
|||
wechatQrCode: WechatQrCode.SortAttr;
|
||||
} | {
|
||||
wechatUser: WechatUser.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -246,17 +246,6 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatMenu";
|
||||
entityId: ForeignKey<"WechatMenu">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
|
|
@ -301,6 +290,17 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
|
|
@ -339,10 +339,6 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
wechatMenu?: WechatMenu.CreateSingleOperation | WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.CreateSingleOperation | WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
|
|
@ -360,8 +356,12 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "wechatPublicAutoReply" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser"> | null;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser" | "wechatPublicAutoReply"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
|
|
@ -378,8 +378,6 @@ export type RemoveOperationData = {} & ({
|
|||
wechatLogin?: WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
} | {
|
||||
wechatMenu?: WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
|
|
@ -388,6 +386,8 @@ export type RemoveOperationData = {} & ({
|
|||
wechatQrCode?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
} | {
|
||||
wechatUser?: WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
|
|
@ -400,11 +400,11 @@ export type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
|
|||
export type UserWechatPublicTagIdSubQuery = Selection<UserWechatPublicTagIdProjection>;
|
||||
export type WechatLoginIdSubQuery = Selection<WechatLoginIdProjection>;
|
||||
export type WechatMenuIdSubQuery = Selection<WechatMenuIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type WechatPublicTagIdSubQuery = Selection<WechatPublicTagIdProjection>;
|
||||
export type WechatPublicTemplateIdSubQuery = Selection<WechatPublicTemplateIdProjection>;
|
||||
export type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
|
||||
export type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type OperEntityIdSubQuery = Selection<OperEntityIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export const desc = {
|
|||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicAutoReply", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser"]
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser", "wechatPublicAutoReply"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ import { desc as userSystemDesc } from "./UserSystem/Storage";
|
|||
import { desc as userWechatPublicTagDesc } from "./UserWechatPublicTag/Storage";
|
||||
import { desc as wechatLoginDesc } from "./WechatLogin/Storage";
|
||||
import { desc as wechatMenuDesc } from "./WechatMenu/Storage";
|
||||
import { desc as wechatPublicAutoReplyDesc } from "./wechatPublicAutoReply/Storage";
|
||||
import { desc as wechatPublicTagDesc } from "./WechatPublicTag/Storage";
|
||||
import { desc as wechatPublicTemplateDesc } from "./WechatPublicTemplate/Storage";
|
||||
import { desc as wechatQrCodeDesc } from "./WechatQrCode/Storage";
|
||||
import { desc as wechatUserDesc } from "./WechatUser/Storage";
|
||||
import { desc as wechatPublicAutoReplyDesc } from "./wechatPublicAutoReply/Storage";
|
||||
export const storageSchema = {
|
||||
actionAuth: actionAuthDesc,
|
||||
i18n: i18nDesc,
|
||||
|
|
@ -92,9 +92,9 @@ export const storageSchema = {
|
|||
userWechatPublicTag: userWechatPublicTagDesc,
|
||||
wechatLogin: wechatLoginDesc,
|
||||
wechatMenu: wechatMenuDesc,
|
||||
wechatPublicAutoReply: wechatPublicAutoReplyDesc,
|
||||
wechatPublicTag: wechatPublicTagDesc,
|
||||
wechatPublicTemplate: wechatPublicTemplateDesc,
|
||||
wechatQrCode: wechatQrCodeDesc,
|
||||
wechatUser: wechatUserDesc
|
||||
wechatUser: wechatUserDesc,
|
||||
wechatPublicAutoReply: wechatPublicAutoReplyDesc
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ import * as UserSystem from "./UserSystem/Schema";
|
|||
import * as UserWechatPublicTag from "./UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "./WechatLogin/Schema";
|
||||
import * as WechatMenu from "./WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "./wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "./WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "./WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "./WechatQrCode/Schema";
|
||||
import * as WechatUser from "./WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "./wechatPublicAutoReply/Schema";
|
||||
export type ActionAuthIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ActionAuth.ActionAuthIdSubQuery & {
|
||||
entity: "actionAuth";
|
||||
|
|
@ -189,8 +189,6 @@ export type ApplicationIdSubQuery = {
|
|||
entity: "token";
|
||||
}) | (WechatMenu.ApplicationIdSubQuery & {
|
||||
entity: "wechatMenu";
|
||||
}) | (wechatPublicAutoReply.ApplicationIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | (WechatPublicTag.ApplicationIdSubQuery & {
|
||||
entity: "wechatPublicTag";
|
||||
}) | (WechatPublicTemplate.ApplicationIdSubQuery & {
|
||||
|
|
@ -199,6 +197,8 @@ export type ApplicationIdSubQuery = {
|
|||
entity: "wechatQrCode";
|
||||
}) | (WechatUser.ApplicationIdSubQuery & {
|
||||
entity: "wechatUser";
|
||||
}) | (wechatPublicAutoReply.ApplicationIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | (Session.ApplicationIdSubQuery & {
|
||||
entity: "session";
|
||||
}) | (Application.ApplicationIdSubQuery & {
|
||||
|
|
@ -427,15 +427,6 @@ export type WechatMenuIdSubQuery = {
|
|||
entity: "wechatMenu";
|
||||
}) | any;
|
||||
};
|
||||
export type wechatPublicAutoReplyIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ModiEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "modiEntity";
|
||||
}) | (OperEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "operEntity";
|
||||
}) | (wechatPublicAutoReply.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | any;
|
||||
};
|
||||
export type WechatPublicTagIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (UserWechatPublicTag.WechatPublicTagIdSubQuery & {
|
||||
entity: "userWechatPublicTag";
|
||||
|
|
@ -484,3 +475,12 @@ export type WechatUserIdSubQuery = {
|
|||
entity: "wechatUser";
|
||||
}) | any;
|
||||
};
|
||||
export type wechatPublicAutoReplyIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ModiEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "modiEntity";
|
||||
}) | (OperEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "operEntity";
|
||||
}) | (wechatPublicAutoReply.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | any;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
/// <reference types="react" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
export default OakComponent({
|
||||
isList: false,
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "会话列表",
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'session', false, {}, {}>): import("react/jsx-runtime").JSX.Element;
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import SessionList from '../list';
|
||||
export default function Render(props) {
|
||||
const { data } = props;
|
||||
const { oakFullpath } = data;
|
||||
return (_jsx(SessionList, { oakAutoUnmount: true, oakPath: oakFullpath ? `$$session-byEntity/list` : undefined, entity: "", entityFilter: "" }));
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
/// <reference types="react" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
export default OakComponent({
|
||||
isList: false,
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "会话列表",
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'session', false, {}, {}>): import("react/jsx-runtime").JSX.Element;
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import SessionList from '../list';
|
||||
export default function Render(props) {
|
||||
const { data } = props;
|
||||
const { oakFullpath } = data;
|
||||
return (_jsx(SessionList, { oakAutoUnmount: true, oakPath: oakFullpath ? `$$session-byUser/list` : undefined }));
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
/// <reference types="react" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "session", true, {
|
||||
entity: string;
|
||||
entityFilter: any;
|
||||
entityDisplay: (entity: string, entityId: string) => "";
|
||||
entityProjection: any;
|
||||
sessionId: string;
|
||||
dialog: boolean;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -1,211 +0,0 @@
|
|||
export default OakComponent({
|
||||
entity: 'session',
|
||||
projection: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
nickname: 1,
|
||||
mobile$user: {
|
||||
$entity: 'mobile',
|
||||
data: {
|
||||
id: 1,
|
||||
mobile: 1,
|
||||
userId: 1,
|
||||
},
|
||||
},
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
extension: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: {
|
||||
$in: ['avatar'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
sessionMessage$session: {
|
||||
$entity: 'sessionMessage',
|
||||
data: {
|
||||
id: 1,
|
||||
applicationId: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
text: 1,
|
||||
createTime: 1,
|
||||
type: 1,
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
indexFrom: 0,
|
||||
count: 1,
|
||||
},
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
isList: true,
|
||||
formData: function ({ data: sessions, features, props }) {
|
||||
// const unReadLength = wechatSessions?.filter(
|
||||
// (ele) => ele.isRead
|
||||
// )
|
||||
return {
|
||||
sessions,
|
||||
};
|
||||
},
|
||||
lifetimes: {
|
||||
async attached() {
|
||||
const userId = this.features.token.getUserId(true);
|
||||
if (!userId) {
|
||||
this.redirectTo({
|
||||
url: '/login',
|
||||
backUrl: encodeURIComponent(window.location.href),
|
||||
}, undefined, true);
|
||||
return;
|
||||
}
|
||||
const { sessionId } = this.props;
|
||||
// 父层传入conversationId 默认聊天
|
||||
if (sessionId) {
|
||||
this.setSelectedSessionId(sessionId);
|
||||
}
|
||||
},
|
||||
},
|
||||
data: {
|
||||
unReadLength: 0,
|
||||
selectedSessionId: '',
|
||||
},
|
||||
properties: {
|
||||
entity: '',
|
||||
entityFilter: {},
|
||||
entityDisplay: (entity, entityId) => '',
|
||||
entityProjection: {},
|
||||
sessionId: '',
|
||||
dialog: false,
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
filter() {
|
||||
const { entityFilter, sessionId } = this.props;
|
||||
if (entityFilter) {
|
||||
// 说明来源于entity
|
||||
return {
|
||||
...entityFilter,
|
||||
/* $or: [
|
||||
{
|
||||
userId: {
|
||||
$exists: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
'#id': 'node-1',
|
||||
user: {
|
||||
session$user: {
|
||||
'#sqp': 'not in',
|
||||
'$expr1': {
|
||||
$ne: [
|
||||
{
|
||||
'#refAttr': 'id',
|
||||
},
|
||||
{
|
||||
'#refId': 'node-1',
|
||||
'#refAttr': 'id',
|
||||
}
|
||||
]
|
||||
},
|
||||
$expr2: {
|
||||
$eq: [
|
||||
{
|
||||
'#refAttr': 'userId',
|
||||
'#refId': 'node-1',
|
||||
},
|
||||
{
|
||||
'#refAttr': 'userId',
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
], */
|
||||
};
|
||||
}
|
||||
const userId = this.features.token.getUserId();
|
||||
return {
|
||||
userId,
|
||||
};
|
||||
},
|
||||
'#name': 'propsQuery',
|
||||
},
|
||||
],
|
||||
sorters: [
|
||||
{
|
||||
sorter: {
|
||||
$attr: {
|
||||
$$updateAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
},
|
||||
],
|
||||
methods: {
|
||||
setSelectedSessionId(sessionId) {
|
||||
this.setState({
|
||||
selectedSessionId: sessionId,
|
||||
});
|
||||
},
|
||||
getFilter() {
|
||||
const { entity, sessionId } = this.props;
|
||||
// 当外层upsert传入id时走这里
|
||||
if (sessionId) {
|
||||
return {
|
||||
id: sessionId,
|
||||
};
|
||||
}
|
||||
// bypark,byCompany,byplatform走这里
|
||||
const userId = this.features.token.getUserId();
|
||||
},
|
||||
async clearUnRead() {
|
||||
// =框架支持
|
||||
// const filter = getFilter();
|
||||
// await this.execute({
|
||||
// action: 'update',
|
||||
// data:
|
||||
// this.props.userType === 'employer'
|
||||
// ? {
|
||||
// isEmployerRead: true,
|
||||
// }
|
||||
// : {
|
||||
// isEntityRead: true,
|
||||
// },
|
||||
// filter,
|
||||
// });
|
||||
// await this.refresh();
|
||||
},
|
||||
// mobile独有
|
||||
navigateToMessage(sessionId) {
|
||||
this.navigateTo({
|
||||
url: '/sessionMessage/list',
|
||||
sessionId,
|
||||
}, undefined, true);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "会话列表",
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/** index.wxss **/
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background: var(--oak-bg-color-page);
|
||||
}
|
||||
|
||||
.conversationContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
|
||||
.messageNumberBox {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
|
||||
border-top: 1px solid var(--oak-border-color);
|
||||
border-bottom: 1px solid var(--oak-border-color);
|
||||
|
||||
.messageText {
|
||||
font-size: 16px;
|
||||
color: var(--oak-text-color-primary);
|
||||
}
|
||||
|
||||
.numberText {
|
||||
font-size: 16px;
|
||||
color: var(--oak-text-color-primary);
|
||||
}
|
||||
|
||||
.clearIcon {
|
||||
font-size: 16px;
|
||||
color: var(--oak-text-color-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
"use strict";
|
||||
// import React from 'react';
|
||||
// import Style from './mobile.module.less';
|
||||
// import ConversationHeader from '@project/components/conversation/header';
|
||||
// import ConversationCell from '@project/components/conversation/cell';
|
||||
// import ConversationMessageNumber from '@project/components/conversation/messageNumber';
|
||||
// import { WebComponentProps } from 'oak-frontend-base';
|
||||
// import { EntityDict } from '@oak-app-domain';
|
||||
// export default function Render(
|
||||
// props: WebComponentProps<
|
||||
// EntityDict,
|
||||
// 'conversation',
|
||||
// false,
|
||||
// {
|
||||
// conversations: EntityDict['conversation']['Schema'][];
|
||||
// selectedConversationId: string;
|
||||
// unReadConversation: number;
|
||||
// userType: string;
|
||||
// },
|
||||
// {
|
||||
// clearUnRead: () => void;
|
||||
// setSelectedConversationId: (conversationId: string) => void;
|
||||
// navigateToConversationMessage: (conversationId: string) => void;
|
||||
// }
|
||||
// >
|
||||
// ) {
|
||||
// const { data, methods } = props;
|
||||
// const {
|
||||
// conversations,
|
||||
// selectedConversationId,
|
||||
// oakFullpath,
|
||||
// unReadConversation,
|
||||
// userType,
|
||||
// } = data;
|
||||
// const {
|
||||
// clearUnRead,
|
||||
// setSelectedConversationId,
|
||||
// navigateToConversationMessage,
|
||||
// } = methods;
|
||||
// return (
|
||||
// <div className={Style.container}>
|
||||
// <div className={Style.conversationContainer}>
|
||||
// <ConversationHeader />
|
||||
// <ConversationMessageNumber
|
||||
// number={unReadConversation}
|
||||
// clear={clearUnRead}
|
||||
// />
|
||||
// {conversations?.map((conversation: any, index: number) => {
|
||||
// return (
|
||||
// <ConversationCell
|
||||
// userType={userType}
|
||||
// selectedId={selectedConversationId}
|
||||
// onSelect={(id: string) => {
|
||||
// navigateToConversationMessage(conversation.id);
|
||||
// }}
|
||||
// oakId={conversation.id}
|
||||
// key={conversation.id}
|
||||
// oakPath={
|
||||
// oakFullpath
|
||||
// ? `${oakFullpath}.${conversation.id}`
|
||||
// : ''
|
||||
// }
|
||||
// />
|
||||
// );
|
||||
// })}
|
||||
// </div>
|
||||
// </div>
|
||||
// );
|
||||
// }
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/** index.wxss **/
|
||||
.container {
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bothContainer {
|
||||
margin: 0 auto;
|
||||
margin-top: 5vh;
|
||||
width: 90%;
|
||||
min-width: 600px;
|
||||
height: 80vh;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 11px 20px 0 rgb(0 0 0 / 30%);
|
||||
}
|
||||
|
||||
.dialogContainer {
|
||||
margin-top: unset;
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
}
|
||||
|
||||
.inner {
|
||||
display: flex;
|
||||
overflow: scroll;
|
||||
flex-direction: column;
|
||||
// margin-top: 50px;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.conversationContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 300px;
|
||||
border-right: 1px solid var(--oak-border-color);
|
||||
|
||||
.messageNumberBox {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
|
||||
border-top: 1px solid var(--oak-border-color);
|
||||
border-bottom: 1px solid var(--oak-border-color);
|
||||
|
||||
.messageText {
|
||||
font-size: 16px;
|
||||
color: var(--oak-text-color-primary);
|
||||
}
|
||||
|
||||
.numberText {
|
||||
font-size: 16px;
|
||||
color: var(--oak-text-color-primary);
|
||||
}
|
||||
|
||||
.clearIcon {
|
||||
font-size: 16px;
|
||||
color: var(--oak-text-color-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'session', false, {
|
||||
sessions: EntityDict['session']['Schema'][];
|
||||
selectedSessionId: string;
|
||||
className: string;
|
||||
dialog: boolean;
|
||||
entityFilter: object;
|
||||
}, {
|
||||
setSelectedSessionId: (conversationId: string) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import MessageList from '../../sessionMessage/list';
|
||||
import Header from '../../../components/session/header';
|
||||
import SessionCell from '../../../components/session/cell';
|
||||
import classNames from 'classnames';
|
||||
import Style from './web.module.less';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { sessions, selectedSessionId, oakFullpath,
|
||||
// unReadConversation = 0,
|
||||
entityFilter, dialog = false, className, } = data;
|
||||
const { setSelectedSessionId } = methods;
|
||||
return (_jsx("div", { className: Style.container, children: _jsxs("div", { className: classNames(Style.bothContainer, className, {
|
||||
[Style.dialogContainer]: dialog,
|
||||
}), children: [_jsxs("div", { className: Style.conversationContainer, children: [_jsx(Header, {}), _jsx("div", { className: Style.inner, children: sessions?.map((session, index) => {
|
||||
return (_jsx(SessionCell, { entityFilter: entityFilter, selectedId: selectedSessionId, onSelect: (id) => {
|
||||
setSelectedSessionId(id);
|
||||
}, oakId: session.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${session.id}`
|
||||
: '' }, session.id));
|
||||
}) })] }), selectedSessionId && (_jsx(MessageList, { sessionId: selectedSessionId,
|
||||
// userType={userType || 'employer'}
|
||||
// isCombine={true}
|
||||
oakAutoUnmount: true, oakPath: oakFullpath
|
||||
? `$$session-base/sessionMessage`
|
||||
: undefined }))] }) }));
|
||||
}
|
||||
|
|
@ -1,250 +0,0 @@
|
|||
import { generateNewId } from 'oak-domain/lib/utils/uuid';
|
||||
export default OakComponent({
|
||||
entity: 'sessionMessage',
|
||||
projection: {
|
||||
id: 1,
|
||||
text: 1,
|
||||
type: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
createTime: 1,
|
||||
$$createAt$$: 1,
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
extension: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
},
|
||||
// filter: {
|
||||
// tag1: {
|
||||
// $in: ['image'],
|
||||
// },
|
||||
// },
|
||||
},
|
||||
sessionId: 1,
|
||||
session: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
},
|
||||
},
|
||||
isList: true,
|
||||
lifetimes: {
|
||||
async ready() {
|
||||
const { sessionId } = this.props;
|
||||
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.getConversationInfo();
|
||||
},
|
||||
detached() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
},
|
||||
},
|
||||
listeners: {
|
||||
num(prev, next) {
|
||||
if (prev.num !== next.num) {
|
||||
if (next.num > 0 && next.num <= 20) {
|
||||
this.pageScroll('comment');
|
||||
}
|
||||
}
|
||||
},
|
||||
sessionId(prev, next) {
|
||||
if (this.state.oakFullpath) {
|
||||
if (prev.sessionId !== next.sessionId) {
|
||||
if (next.sessionId) {
|
||||
this.getConversationInfo();
|
||||
// 如果sessionId变了需要重新刷新下
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
formData({ data: sessionMessageList = [], features }) {
|
||||
return {
|
||||
sessionMessageList,
|
||||
num: sessionMessageList?.length,
|
||||
};
|
||||
},
|
||||
properties: {
|
||||
sessionId: '',
|
||||
userType: '',
|
||||
dialog: false,
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
filter() {
|
||||
const { sessionId } = this.props;
|
||||
return {
|
||||
sessionId,
|
||||
type: {
|
||||
$exists: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
sorters: [
|
||||
{
|
||||
sorter: {
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
},
|
||||
],
|
||||
data: {
|
||||
content: '',
|
||||
buttonHidden: true,
|
||||
selectedTradeId: '',
|
||||
newSessionId: '',
|
||||
},
|
||||
methods: {
|
||||
setContent(text) {
|
||||
this.setState({
|
||||
text,
|
||||
});
|
||||
},
|
||||
setSelectedTradeId(tradeId) {
|
||||
this.setState({
|
||||
selectedTradeId: tradeId,
|
||||
});
|
||||
},
|
||||
setButtonHidden(isHidden) {
|
||||
this.setState({
|
||||
buttonHidden: isHidden,
|
||||
});
|
||||
},
|
||||
async getConversationInfo() {
|
||||
const { sessionId } = this.props;
|
||||
if (!sessionId) {
|
||||
return;
|
||||
}
|
||||
const { data: [session], } = await this.features.cache.refresh('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
},
|
||||
filter: {
|
||||
id: sessionId,
|
||||
},
|
||||
});
|
||||
this.setState({
|
||||
entity: session?.entity,
|
||||
entityId: session?.entityId,
|
||||
});
|
||||
},
|
||||
pageScroll(id) {
|
||||
const doc = window.document.getElementById(id);
|
||||
// setTimeout(() => doc.scrollTo(0, 10000), 500);
|
||||
},
|
||||
async createMessage() {
|
||||
const { text, wechatUserId, newSessionId } = this.state;
|
||||
const { sessionId } = this.props;
|
||||
const userId = this.features.token.getUserId();
|
||||
const applicationId = this.features.application.getApplicationId();
|
||||
if (!this.state.text) {
|
||||
this.setMessage({
|
||||
type: 'warning',
|
||||
content: '请输入内容',
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.addItem({
|
||||
applicationId,
|
||||
text,
|
||||
userId,
|
||||
wechatUserId,
|
||||
sessionId: sessionId || newSessionId,
|
||||
type: 'text',
|
||||
createTime: Date.now(),
|
||||
});
|
||||
await this.execute(undefined, false);
|
||||
this.setState({
|
||||
text: '',
|
||||
});
|
||||
},
|
||||
async customUpload(file) {
|
||||
const { sessionId } = this.props;
|
||||
// TS 语法
|
||||
// file 即选中的文件
|
||||
const { name, size, type, originFileObj } = file;
|
||||
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: 'wechatMessage',
|
||||
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;
|
||||
// }
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "消息",
|
||||
"enablePullDownRefresh": false,
|
||||
"usingComponents": {}
|
||||
}
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
/** index.wxss **/
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
background: var(--oak-bg-color-page);
|
||||
|
||||
.inner {
|
||||
display: flex;
|
||||
overflow: scroll;
|
||||
flex-direction: column;
|
||||
margin-top: 50px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background: var(--oak-bg-color-page);
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
margin: 0px;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
|
||||
.textareaBox {
|
||||
border-top: 1px solid var(--oak-border-color);
|
||||
border-bottom: 1px solid var(--oak-border-color);
|
||||
display: flex;
|
||||
// background: var(--oak-bg-color-container);
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
min-height: 45px;
|
||||
|
||||
.plusIcon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.textarea {
|
||||
margin: 5px;
|
||||
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.textarea:focus {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.action {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
margin: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
.button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
margin: 5px;
|
||||
|
||||
.iconBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
|
||||
.icon {
|
||||
font-size: 24px;
|
||||
color: var(--oak-text-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: var(--oak-text-color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.popup_title {
|
||||
height: 50px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 10px;
|
||||
justify-content: center;
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,288 +0,0 @@
|
|||
"use strict";
|
||||
// import React, { useState, useEffect } from 'react';
|
||||
// import { Button, Image, Popup } from 'antd-mobile';
|
||||
// import { Input, Upload, Popover, Tag } from 'antd';
|
||||
// import {
|
||||
// PlusCircleOutlined,
|
||||
// PictureFilled,
|
||||
// BookFilled,
|
||||
// CloseOutlined,
|
||||
// } from '@ant-design/icons';
|
||||
// import ConversationMessageCell from '@project/components/conversationMessage/cell';
|
||||
// import ConversationHeader from '@project/components/conversation/forConversationMessage';
|
||||
// import SendTradeCard from '@project/components/trade/detail/sendCard';
|
||||
// import SendSkuCard from '@project/components/sku/sendSkuCard';
|
||||
// import TradeList from '@project/pages/trade/byConversation/list';
|
||||
// import Style from './mobile.module.less';
|
||||
// import { WebComponentProps } from 'oak-frontend-base';
|
||||
// import { EntityDict } from '@oak-app-domain';
|
||||
// interface CustomFile {
|
||||
// name: string;
|
||||
// size: number;
|
||||
// type: string;
|
||||
// originFileObj: File;
|
||||
// }
|
||||
// export default function Render(
|
||||
// props: WebComponentProps<
|
||||
// EntityDict,
|
||||
// 'conversationMessage',
|
||||
// true,
|
||||
// {
|
||||
// conversationMessageList: EntityDict['conversationMessage']['Schema'][];
|
||||
// content: string;
|
||||
// buttonHidden: boolean;
|
||||
// selectedTradeId: string;
|
||||
// conversationId: string;
|
||||
// userType: string;
|
||||
// isCombine: boolean;
|
||||
// companyId: string;
|
||||
// employerId: string;
|
||||
// tradeId: string;
|
||||
// skuId: string;
|
||||
// },
|
||||
// {
|
||||
// setButtonHidden: (isHidden: boolean) => void;
|
||||
// customUpload: (file: CustomFile) => void;
|
||||
// createTradeMessage: (id: string) => void;
|
||||
// createSkuMessage: (id: string) => void;
|
||||
// setContent: (content: string) => void;
|
||||
// pageScroll: (id: string) => void;
|
||||
// createMessage: () => void;
|
||||
// }
|
||||
// >
|
||||
// ) {
|
||||
// const { data, methods } = props;
|
||||
// const {
|
||||
// oakFullpath,
|
||||
// oakPagination,
|
||||
// oakLoading,
|
||||
// oakExecuting,
|
||||
// conversationId,
|
||||
// userType,
|
||||
// conversationMessageList,
|
||||
// selectedTradeId,
|
||||
// content,
|
||||
// isCombine,
|
||||
// buttonHidden,
|
||||
// companyId,
|
||||
// employerId,
|
||||
// tradeId,
|
||||
// skuId,
|
||||
// } = data;
|
||||
// const {
|
||||
// setButtonHidden,
|
||||
// customUpload,
|
||||
// createTradeMessage,
|
||||
// createSkuMessage,
|
||||
// setContent,
|
||||
// pageScroll,
|
||||
// createMessage,
|
||||
// } = methods;
|
||||
// const { pageSize, total, currentPage } = oakPagination || {};
|
||||
// const [bottomHeight, setBottomHeight] = useState(0);
|
||||
// const [tradeListVisible, setTradeListVisible] = useState(false);
|
||||
// const [sendTdOpen, setSendTdOpen] = useState(true);
|
||||
// const [showCard, setShowCard] = useState(true);
|
||||
// const [showCard1, setShowCard1] = useState(true);
|
||||
// useEffect(() => {
|
||||
// if (buttonHidden) {
|
||||
// const dom = window.document.getElementById('bottom');
|
||||
// const newBottomHeight = dom && dom.offsetHeight || 0;
|
||||
// setBottomHeight(newBottomHeight);
|
||||
// } else {
|
||||
// setBottomHeight(0);
|
||||
// }
|
||||
// }, [buttonHidden]);
|
||||
// return conversationId ? (
|
||||
// <div className={Style.container}>
|
||||
// <ConversationHeader
|
||||
// showBack={!isCombine}
|
||||
// userType={userType}
|
||||
// conversationId={conversationId}
|
||||
// userId={employerId}
|
||||
// />
|
||||
// <div
|
||||
// className={Style.inner}
|
||||
// style={{
|
||||
// marginBottom: bottomHeight ? `${bottomHeight}px` : '45px',
|
||||
// }}
|
||||
// id="comment"
|
||||
// onClick={() => setButtonHidden(true)}
|
||||
// >
|
||||
// {conversationMessageList
|
||||
// ?.sort(
|
||||
// (a, b) =>
|
||||
// (a.$$createAt$$ as number) -
|
||||
// (b.$$createAt$$ as number)
|
||||
// )
|
||||
// .map((conversationMessage, index: number) => {
|
||||
// return (
|
||||
// <ConversationMessageCell
|
||||
// key={conversationMessage.id}
|
||||
// oakId={conversationMessage.id}
|
||||
// oakPath={
|
||||
// oakFullpath
|
||||
// ? `${oakFullpath}.${conversationMessage.id}`
|
||||
// : undefined
|
||||
// }
|
||||
// userType={userType}
|
||||
// />
|
||||
// );
|
||||
// })}
|
||||
// </div>
|
||||
// <div className={Style.bottom} id="bottom">
|
||||
// {tradeId && showCard && (
|
||||
// <SendTradeCard
|
||||
// conversationId={conversationId}
|
||||
// userType={userType}
|
||||
// setShowCard={() => {
|
||||
// setShowCard(false);
|
||||
// }}
|
||||
// setBottomHeight={() => {
|
||||
// setBottomHeight(0);
|
||||
// }}
|
||||
// oakId={tradeId}
|
||||
// oakAutoUnmount={true}
|
||||
// oakPath={
|
||||
// data.oakFullpath
|
||||
// ? `conversationMessage/list/trade/detail/sendCard`
|
||||
// : undefined
|
||||
// }
|
||||
// createTradeMessage={() => {
|
||||
// createTradeMessage(tradeId);
|
||||
// }}
|
||||
// />
|
||||
// )}
|
||||
// {skuId && showCard1 && (
|
||||
// <SendSkuCard
|
||||
// conversationId={conversationId}
|
||||
// userType={userType}
|
||||
// setShowCard1={() => {
|
||||
// setShowCard1(false);
|
||||
// }}
|
||||
// setBottomHeight={() => {
|
||||
// setBottomHeight(0);
|
||||
// }}
|
||||
// oakId={skuId}
|
||||
// oakAutoUnmount={true}
|
||||
// oakPath={
|
||||
// data.oakFullpath
|
||||
// ? `conversationMessage/list/sku/sendSkuCard`
|
||||
// : undefined
|
||||
// }
|
||||
// createSkuMessage={() => {
|
||||
// createSkuMessage(skuId);
|
||||
// }}
|
||||
// />
|
||||
// )}
|
||||
// <div className={Style.textareaBox}>
|
||||
// <Input.TextArea
|
||||
// className={Style.textarea}
|
||||
// rows={1}
|
||||
// onChange={({ target: { value } }) => {
|
||||
// setContent(value);
|
||||
// }}
|
||||
// onFocus={() => {
|
||||
// setButtonHidden(true);
|
||||
// setShowCard(false);
|
||||
// setBottomHeight(0);
|
||||
// }}
|
||||
// value={content}
|
||||
// />
|
||||
// <div className={Style.action}>
|
||||
// {content && (
|
||||
// <Button
|
||||
// color="primary"
|
||||
// fill="solid"
|
||||
// size="middle"
|
||||
// disabled={!content}
|
||||
// onClick={() => {
|
||||
// createMessage();
|
||||
// pageScroll('comment');
|
||||
// }}
|
||||
// style={{ width: '56px', fontSize: '14px' }}
|
||||
// >
|
||||
// 发送
|
||||
// </Button>
|
||||
// )}
|
||||
// {!content && (
|
||||
// <PlusCircleOutlined
|
||||
// className={Style.plusIcon}
|
||||
// onClick={() => {
|
||||
// setButtonHidden(false);
|
||||
// setShowCard(false);
|
||||
// }}
|
||||
// />
|
||||
// )}
|
||||
// </div>
|
||||
// </div>
|
||||
// {!buttonHidden && (
|
||||
// <div className={Style.toolbar}>
|
||||
// <div className={Style.button}>
|
||||
// <Upload
|
||||
// accept={'image/*'}
|
||||
// multiple={false}
|
||||
// showUploadList={false}
|
||||
// onChange={({ file }) => {
|
||||
// customUpload(file as CustomFile);
|
||||
// }}
|
||||
// >
|
||||
// <div className={Style.iconBox}>
|
||||
// <PictureFilled className={Style.icon} />
|
||||
// </div>
|
||||
// </Upload>
|
||||
// <div className={Style.text}>图片</div>
|
||||
// </div>
|
||||
// {['company', 'employer'].includes(userType) && (
|
||||
// <>
|
||||
// <div
|
||||
// className={Style.button}
|
||||
// onClick={() => {
|
||||
// setTradeListVisible(true);
|
||||
// }}
|
||||
// >
|
||||
// <div className={Style.iconBox}>
|
||||
// <BookFilled className={Style.icon} />
|
||||
// </div>
|
||||
// <div className={Style.text}>订单</div>
|
||||
// </div>
|
||||
// <Popup
|
||||
// visible={tradeListVisible}
|
||||
// showCloseButton={true}
|
||||
// onMaskClick={() => {
|
||||
// setTradeListVisible(false);
|
||||
// }}
|
||||
// onClose={() => {
|
||||
// setTradeListVisible(false);
|
||||
// }}
|
||||
// >
|
||||
// <div className={Style.popup_title}>
|
||||
// <span className={Style.title}>
|
||||
// 选择订单
|
||||
// </span>
|
||||
// </div>
|
||||
// <TradeList
|
||||
// companyId={companyId}
|
||||
// userId={employerId}
|
||||
// oakAutoUnmount={true}
|
||||
// oakPath={
|
||||
// oakFullpath
|
||||
// ? '$$conversation-message/trade'
|
||||
// : ''
|
||||
// }
|
||||
// setTradeId={(id: string) => {
|
||||
// setTradeListVisible(false);
|
||||
// createTradeMessage(id);
|
||||
// }}
|
||||
// />
|
||||
// </Popup>
|
||||
// </>
|
||||
// )}
|
||||
// </div>
|
||||
// )}
|
||||
// </div>
|
||||
// </div>
|
||||
// ) : (
|
||||
// <div className={Style.background}></div>
|
||||
// );
|
||||
// }
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/** index.wxss **/
|
||||
.container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
// width: 100%;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
background: var(--oak-bg-color-page);
|
||||
|
||||
.inner {
|
||||
display: flex;
|
||||
overflow: scroll;
|
||||
flex-direction: column;
|
||||
margin-top: 50px;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bottomSku {
|
||||
width: calc(100% - 16px);
|
||||
// position: fixed;
|
||||
bottom: 176px;
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
border-top: 1px solid var(--oak-border-color);
|
||||
background: var(--oak-bg-color-container);
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
margin: 0px;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 30px;
|
||||
|
||||
.icon {
|
||||
margin: 0 6px;
|
||||
font-size: 20px;
|
||||
color: var(--oak-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.textareaBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
padding: 0 10px;
|
||||
|
||||
.textarea {
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.textarea:focus {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
margin: 5px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
interface customFile {
|
||||
name: string;
|
||||
size: number;
|
||||
type: string;
|
||||
originFileObj: File;
|
||||
}
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'sessionMessage', true, {
|
||||
sessionMessageList: EntityDict['sessionMessage']['Schema'][];
|
||||
text: string;
|
||||
buttonHidden: boolean;
|
||||
sessionId: string;
|
||||
userType: string;
|
||||
employerId: string;
|
||||
}, {
|
||||
setButtonHidden: (isHidden: boolean) => void;
|
||||
customUpload: (file: customFile) => void;
|
||||
setContent: (text: string) => void;
|
||||
pageScroll: (id: string) => void;
|
||||
createMessage: () => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Button, Input, Upload } from 'antd';
|
||||
import { PictureOutlined } from '@ant-design/icons';
|
||||
import MessageCell from '../../../components/sessionMessage/cell';
|
||||
// import Header from '../../../components/session/forMessage';
|
||||
import Style from './web.module.less';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { sessionId, userType, sessionMessageList, oakFullpath, text, employerId, buttonHidden, } = data;
|
||||
const { setButtonHidden, customUpload, setContent, pageScroll, createMessage, } = methods;
|
||||
const [bottomHeight, setBottomHeight] = useState(0);
|
||||
useEffect(() => {
|
||||
if (buttonHidden) {
|
||||
const newBottomHeight = window.document.getElementById('bottom')?.offsetHeight;
|
||||
setBottomHeight(newBottomHeight);
|
||||
}
|
||||
else {
|
||||
setBottomHeight(0);
|
||||
}
|
||||
}, [buttonHidden]);
|
||||
return (_jsxs("div", { className: Style.container, children: [_jsx("div", { className: Style.inner, style: {
|
||||
marginBottom: bottomHeight ? `${bottomHeight}px` : '168px',
|
||||
}, id: "comment", onClick: () => setButtonHidden(true), children: sessionMessageList
|
||||
?.sort((a, b) => a.$$createAt$$ -
|
||||
b.$$createAt$$)
|
||||
.map((sessionMessage, index) => {
|
||||
return (_jsx(MessageCell, { oakId: sessionMessage.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${sessionMessage.id}`
|
||||
: '' }, sessionMessage.id));
|
||||
}) }), _jsxs("div", { className: Style.bottom, id: "bottom", children: [_jsx("div", { className: Style.toolbar, children: _jsx(Upload, { accept: 'image/*', multiple: false, showUploadList: false, customRequest: () => { }, onChange: ({ file }) => {
|
||||
customUpload(file);
|
||||
}, children: _jsx(PictureOutlined, { className: Style.icon }) }) }), _jsxs("div", { className: Style.textareaBox, children: [_jsx(Input.TextArea, { className: Style.textarea, rows: 5, onChange: (e) => {
|
||||
setContent(e.target.value);
|
||||
}, onFocus: () => {
|
||||
setButtonHidden(true);
|
||||
}, onPressEnter: (e) => {
|
||||
e.preventDefault();
|
||||
createMessage();
|
||||
pageScroll('comment');
|
||||
}, value: text }), _jsx("div", { className: Style.btn, children: _jsx(Button, { type: "primary", disabled: text ? false : true, onClick: () => {
|
||||
createMessage();
|
||||
pageScroll('comment');
|
||||
}, children: "\u53D1\u9001" }) })] })] })] }));
|
||||
}
|
||||
|
|
@ -9,9 +9,8 @@ const triggers = [
|
|||
when: 'after',
|
||||
fn: async (event, context) => {
|
||||
const { operation: { data }, } = event;
|
||||
const { sessionId, type, text, } = data;
|
||||
const { sessionId } = data;
|
||||
const closeRootMode = context.openRootMode();
|
||||
const messageType = type;
|
||||
try {
|
||||
await context.operate('session', {
|
||||
id: await generateNewIdAsync(),
|
||||
|
|
@ -23,100 +22,6 @@ const triggers = [
|
|||
id: sessionId,
|
||||
},
|
||||
}, {});
|
||||
const [sessionMessage] = await context.select('sessionMessage', {
|
||||
data: {
|
||||
id: 1,
|
||||
sessionId: 1,
|
||||
text: 1,
|
||||
type: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
wechatUser: {
|
||||
id: 1,
|
||||
openId: 1,
|
||||
},
|
||||
applicationId: 1,
|
||||
createTime: 1,
|
||||
$$createAt$$: 1,
|
||||
aaoe: 1,
|
||||
},
|
||||
filter: {
|
||||
sessionId,
|
||||
aaoe: false,
|
||||
createTime: {
|
||||
$gt: Date.now() -
|
||||
(48 * 60 * 60 * 1000 - 5 * 60 * 1000),
|
||||
},
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
createTime: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
count: 1,
|
||||
indexFrom: 0,
|
||||
}, {});
|
||||
if (sessionMessage && sessionMessage.wechatUserId) {
|
||||
const [session] = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
openId: 1,
|
||||
},
|
||||
filter: {
|
||||
id: sessionId,
|
||||
},
|
||||
}, {});
|
||||
const [application] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
config: 1,
|
||||
systemId: 1,
|
||||
},
|
||||
filter: {
|
||||
id: session.entityId,
|
||||
},
|
||||
}, {});
|
||||
const { type, config } = application;
|
||||
assert(type === 'wechatPublic' || type === 'wechatMp');
|
||||
let wechatInstance;
|
||||
if (type === 'wechatMp') {
|
||||
const { appId, appSecret } = config;
|
||||
wechatInstance = WechatSDK.getInstance(appId, type, appSecret);
|
||||
}
|
||||
else {
|
||||
const { appId, appSecret } = config;
|
||||
wechatInstance = WechatSDK.getInstance(appId, type, appSecret);
|
||||
}
|
||||
//微信发送客服消息
|
||||
switch (messageType) {
|
||||
case 'text': {
|
||||
wechatInstance.sendServeMessage({
|
||||
openId: sessionMessage.wechatUser?.openId,
|
||||
type: messageType,
|
||||
content: text,
|
||||
});
|
||||
break;
|
||||
}
|
||||
// case 'image' :{
|
||||
// wechatInstance.sendServeMessage({
|
||||
// openId: sessionMessage.wechatUser?.openId!,
|
||||
// type: messageType,
|
||||
// mediaId: '',
|
||||
// });
|
||||
// break;
|
||||
// }
|
||||
default: {
|
||||
assert(false, `消息类型「${messageType}」尚未支持`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
closeRootMode();
|
||||
|
|
@ -126,5 +31,125 @@ const triggers = [
|
|||
return 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '当创建sessionMessage后,业务提交后再进行推送',
|
||||
entity: 'sessionMessage',
|
||||
action: 'create',
|
||||
when: 'commit',
|
||||
strict: 'takeEasy',
|
||||
fn: async ({ rows }, context) => {
|
||||
const closeRootMode = context.openRootMode();
|
||||
try {
|
||||
for (const row of rows) {
|
||||
const { sessionId, aaoe, type, text } = row;
|
||||
if (aaoe) {
|
||||
const msgType = type;
|
||||
const [sessionMessage] = await context.select('sessionMessage', {
|
||||
data: {
|
||||
id: 1,
|
||||
sessionId: 1,
|
||||
text: 1,
|
||||
type: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
wechatUser: {
|
||||
id: 1,
|
||||
openId: 1,
|
||||
},
|
||||
applicationId: 1,
|
||||
createTime: 1,
|
||||
$$createAt$$: 1,
|
||||
aaoe: 1,
|
||||
},
|
||||
filter: {
|
||||
sessionId,
|
||||
aaoe: false,
|
||||
createTime: {
|
||||
$gt: Date.now() -
|
||||
(48 * 60 * 60 * 1000 -
|
||||
5 * 60 * 1000),
|
||||
},
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
createTime: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
count: 1,
|
||||
indexFrom: 0,
|
||||
}, {});
|
||||
if (sessionMessage && sessionMessage.wechatUserId) {
|
||||
const [session] = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
openId: 1,
|
||||
},
|
||||
filter: {
|
||||
id: sessionId,
|
||||
},
|
||||
}, {});
|
||||
const [application] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
config: 1,
|
||||
systemId: 1,
|
||||
},
|
||||
filter: {
|
||||
id: session.entityId,
|
||||
},
|
||||
}, {});
|
||||
const { type, config } = application;
|
||||
assert(type === 'wechatPublic' || type === 'wechatMp');
|
||||
let wechatInstance;
|
||||
if (type === 'wechatMp') {
|
||||
const { appId, appSecret } = config;
|
||||
wechatInstance = WechatSDK.getInstance(appId, type, appSecret);
|
||||
}
|
||||
else {
|
||||
const { appId, appSecret } = config;
|
||||
wechatInstance = WechatSDK.getInstance(appId, type, appSecret);
|
||||
}
|
||||
//微信发送客服消息
|
||||
switch (msgType) {
|
||||
case 'text': {
|
||||
wechatInstance.sendServeMessage({
|
||||
openId: sessionMessage.wechatUser
|
||||
?.openId,
|
||||
type: msgType,
|
||||
content: text,
|
||||
});
|
||||
break;
|
||||
}
|
||||
// case 'image' :{
|
||||
// wechatInstance.sendServeMessage({
|
||||
// openId: sessionMessage.wechatUser?.openId!,
|
||||
// type: msgType,
|
||||
// mediaId: '',
|
||||
// });
|
||||
// break;
|
||||
// }
|
||||
default: {
|
||||
assert(false, `消息类型「${msgType}」尚未支持`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
closeRootMode();
|
||||
throw err;
|
||||
}
|
||||
closeRootMode();
|
||||
return 0;
|
||||
},
|
||||
},
|
||||
];
|
||||
export default triggers;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { EntityDict } from "../oak-app-domain";
|
||||
import { AppType } from "../oak-app-domain/Application/Schema";
|
||||
import { BackendRuntimeContext } from "../context/BackendRuntimeContext";
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { AppType } from '../oak-app-domain/Application/Schema';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { WechatPublicEventData, WechatMpEventData } from 'oak-external-sdk';
|
||||
export declare function createSession<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
data?: WechatPublicEventData | WechatMpEventData;
|
||||
|
|
|
|||
|
|
@ -6,138 +6,144 @@ const assert_1 = require("oak-domain/lib/utils/assert");
|
|||
async function createSession(params, context) {
|
||||
const { data, type, entity, entityId } = params;
|
||||
const userId = context.getCurrentUserId(true);
|
||||
let session;
|
||||
let sessionMessage$session;
|
||||
switch (type) {
|
||||
case 'web': {
|
||||
const systemId = context.getSystemId();
|
||||
let entity2 = entity;
|
||||
let entityId2 = entityId;
|
||||
if (!entity) {
|
||||
// 默认
|
||||
const [application] = await context.select('application', {
|
||||
const closeRootMode = context.openRootMode();
|
||||
try {
|
||||
let session;
|
||||
let sessionMessage$session;
|
||||
switch (type) {
|
||||
case 'web': {
|
||||
const systemId = context.getSystemId();
|
||||
let entity2 = entity;
|
||||
let entityId2 = entityId;
|
||||
if (!entity) {
|
||||
// 默认
|
||||
const [application] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
systemId: 1,
|
||||
type: 1,
|
||||
},
|
||||
filter: {
|
||||
systemId,
|
||||
type: 'web',
|
||||
},
|
||||
}, {});
|
||||
entity2 = 'application';
|
||||
entityId2 = application?.id;
|
||||
}
|
||||
(0, assert_1.assert)(entity2 && entityId2);
|
||||
const result = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
systemId: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
lmts: 1,
|
||||
},
|
||||
filter: {
|
||||
systemId,
|
||||
type: 'web',
|
||||
entity: entity2,
|
||||
entityId: entityId2,
|
||||
userId,
|
||||
},
|
||||
}, {});
|
||||
entity2 = 'application';
|
||||
entityId2 = application?.id;
|
||||
session = result[0];
|
||||
break;
|
||||
}
|
||||
(0, assert_1.assert)(entity2 && entityId2);
|
||||
const result = await context.select('session', {
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
lmts: 1,
|
||||
},
|
||||
filter: {
|
||||
entity: entity2,
|
||||
entityId: entityId2,
|
||||
userId,
|
||||
},
|
||||
}, {});
|
||||
session = result[0];
|
||||
break;
|
||||
}
|
||||
case 'wechatMp':
|
||||
case 'wechatPublic': {
|
||||
(0, assert_1.assert)(data);
|
||||
(0, assert_1.assert)(entity === 'application' && entityId);
|
||||
const { ToUserName, FromUserName, CreateTime, MsgType,
|
||||
// Event,
|
||||
Content,
|
||||
// EventKey,
|
||||
} = data;
|
||||
const [wechatUser] = await context.select('wechatUser', {
|
||||
data: {
|
||||
id: 1,
|
||||
openId: 1,
|
||||
applicationId: 1,
|
||||
},
|
||||
filter: {
|
||||
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)(),
|
||||
action: 'create',
|
||||
case 'wechatMp':
|
||||
case 'wechatPublic': {
|
||||
(0, assert_1.assert)(data);
|
||||
(0, assert_1.assert)(entity === 'application' && entityId);
|
||||
const { ToUserName, FromUserName, CreateTime, MsgType, Content, } = data;
|
||||
const [wechatUser] = await context.select('wechatUser', {
|
||||
data: {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
applicationId: wechatUser?.applicationId,
|
||||
wechatUserId: wechatUser?.id,
|
||||
createTime: Number(CreateTime) * 1000,
|
||||
type: MsgType,
|
||||
text: Content,
|
||||
aaoe: false,
|
||||
id: 1,
|
||||
openId: 1,
|
||||
applicationId: 1,
|
||||
},
|
||||
filter: {
|
||||
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)(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
applicationId: wechatUser?.applicationId,
|
||||
wechatUserId: wechatUser?.id,
|
||||
createTime: Number(CreateTime) * 1000,
|
||||
type: MsgType,
|
||||
text: Content,
|
||||
aaoe: false,
|
||||
},
|
||||
},
|
||||
];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
(0, assert_1.assert)(false, `传入不支持的type: ${type}`);
|
||||
}
|
||||
}
|
||||
if (session) {
|
||||
if (!sessionMessage$session) {
|
||||
closeRootMode();
|
||||
return session.id;
|
||||
}
|
||||
await context.operate('session', {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
action: 'update',
|
||||
data: {
|
||||
sessionMessage$session,
|
||||
},
|
||||
];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
(0, assert_1.assert)(false, `传入不支持的type: ${type}`);
|
||||
}
|
||||
}
|
||||
if (session) {
|
||||
if (!sessionMessage$session) {
|
||||
filter: {
|
||||
id: session.id,
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
closeRootMode();
|
||||
return session.id;
|
||||
}
|
||||
await context.operate('session', {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
action: 'update',
|
||||
data: {
|
||||
sessionMessage$session,
|
||||
},
|
||||
filter: {
|
||||
id: session.id,
|
||||
},
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
return session.id;
|
||||
else {
|
||||
const sessionId = await (0, uuid_1.generateNewIdAsync)();
|
||||
await context.operate('session', {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
action: 'create',
|
||||
data: Object.assign({
|
||||
id: sessionId,
|
||||
entity,
|
||||
entityId,
|
||||
userId,
|
||||
lmts: Date.now(),
|
||||
openId: data?.FromUserName,
|
||||
}, sessionMessage$session && { sessionMessage$session }),
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
closeRootMode();
|
||||
return sessionId;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const sessionId = await (0, uuid_1.generateNewIdAsync)();
|
||||
await context.operate('session', {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
action: 'create',
|
||||
data: Object.assign({
|
||||
id: sessionId,
|
||||
entity,
|
||||
entityId,
|
||||
userId,
|
||||
lmts: Date.now(),
|
||||
openId: data?.FromUserName,
|
||||
}, sessionMessage$session && { sessionMessage$session }),
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
return sessionId;
|
||||
catch (e) {
|
||||
closeRootMode();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
exports.createSession = createSession;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "session", false, {
|
||||
selectedId: string;
|
||||
onSelect: (id: string) => void;
|
||||
key: string;
|
||||
entityFilter: {};
|
||||
name: undefined;
|
||||
isEntity: boolean;
|
||||
name: string;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,29 @@ exports.default = OakComponent({
|
|||
},
|
||||
},
|
||||
},
|
||||
sessionMessage$session: {
|
||||
$entity: 'sessionMessage',
|
||||
data: {
|
||||
id: 1,
|
||||
text: 1,
|
||||
type: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
createTime: 1,
|
||||
$$createAt$$: 1,
|
||||
aaoe: 1,
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
indexFrom: 0,
|
||||
count: 1,
|
||||
},
|
||||
},
|
||||
isList: false,
|
||||
formData({ data, features }) {
|
||||
|
|
@ -52,10 +75,7 @@ exports.default = OakComponent({
|
|||
});
|
||||
if (session?.sessionMessage$session) {
|
||||
Object.assign(session, {
|
||||
wechatMessages: session?.sessionMessage$session,
|
||||
// unreadLength: session?.sessionMessage$session?.filter(
|
||||
// (ele: any) => ele.isRead === false
|
||||
// )?.length,
|
||||
sessionMessages: session?.sessionMessage$session,
|
||||
});
|
||||
}
|
||||
return session;
|
||||
|
|
@ -65,74 +85,78 @@ exports.default = OakComponent({
|
|||
const { oakId } = this.props;
|
||||
const { session } = this.state;
|
||||
const userId = this.features.token.getUserId(true);
|
||||
const { data: readRemark } = await this.features.cache.refresh('readRemark', {
|
||||
data: {
|
||||
id: 1,
|
||||
sessionId: 1,
|
||||
userId: 1,
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
filter: {
|
||||
session: {
|
||||
id: oakId
|
||||
},
|
||||
userId,
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
count: 1,
|
||||
});
|
||||
const { data: sessionMessage } = await this.features.cache.refresh('sessionMessage', {
|
||||
data: {
|
||||
id: 1,
|
||||
sessionId: 1,
|
||||
userId: 1,
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
filter: {
|
||||
session: {
|
||||
id: oakId
|
||||
},
|
||||
},
|
||||
sorter: [
|
||||
{
|
||||
$attr: {
|
||||
$$createAt$$: 1,
|
||||
},
|
||||
$direction: 'desc',
|
||||
},
|
||||
],
|
||||
count: 1,
|
||||
});
|
||||
if (readRemark && readRemark?.length > 0) {
|
||||
if (session?.lmst > readRemark && sessionMessage[0]?.userId !== userId) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (sessionMessage[0]?.userId !== userId) {
|
||||
}
|
||||
}
|
||||
// TODO readRemark未实现
|
||||
// const { data: readRemark } = await this.features.cache.refresh(
|
||||
// 'readRemark',
|
||||
// {
|
||||
// data: {
|
||||
// id: 1,
|
||||
// sessionId: 1,
|
||||
// userId: 1,
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// filter: {
|
||||
// sessionId: oakId,
|
||||
// userId,
|
||||
// },
|
||||
// sorter: [
|
||||
// {
|
||||
// $attr: {
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// $direction: 'desc',
|
||||
// },
|
||||
// ],
|
||||
// count: 1,
|
||||
// }
|
||||
// );
|
||||
// const { data: sessionMessage } = await this.features.cache.refresh(
|
||||
// 'sessionMessage',
|
||||
// {
|
||||
// data: {
|
||||
// id: 1,
|
||||
// sessionId: 1,
|
||||
// userId: 1,
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// filter: {
|
||||
// sessionId: oakId,
|
||||
// },
|
||||
// sorter: [
|
||||
// {
|
||||
// $attr: {
|
||||
// $$createAt$$: 1,
|
||||
// },
|
||||
// $direction: 'desc',
|
||||
// },
|
||||
// ],
|
||||
// count: 1,
|
||||
// }
|
||||
// );
|
||||
// if (readRemark && readRemark?.length > 0) {
|
||||
// if (
|
||||
// session?.lmst > readRemark &&
|
||||
// sessionMessage[0]?.userId !== userId
|
||||
// ) {
|
||||
// }
|
||||
// } else {
|
||||
// if (sessionMessage[0]?.userId !== userId) {
|
||||
// }
|
||||
// }
|
||||
},
|
||||
},
|
||||
properties: {
|
||||
selectedId: '',
|
||||
onSelect: (id) => { },
|
||||
key: '',
|
||||
entityFilter: {},
|
||||
name: undefined,
|
||||
isEntity: false,
|
||||
name: '',
|
||||
},
|
||||
methods: {
|
||||
getAvatarUrl() {
|
||||
const { userUrl, entity } = this.state;
|
||||
const { entityFilter } = this.props;
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
if (entityFilter) {
|
||||
const { isEntity } = this.props;
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
if (isEntity) {
|
||||
return userUrl || defaultUrl;
|
||||
}
|
||||
else {
|
||||
|
|
@ -141,12 +165,11 @@ exports.default = OakComponent({
|
|||
},
|
||||
getName() {
|
||||
const { user, entity, openId } = this.state;
|
||||
const { entityFilter } = this.props;
|
||||
if (entityFilter) {
|
||||
const { isEntity } = this.props;
|
||||
if (isEntity) {
|
||||
const userName = user?.name;
|
||||
const userNickname = user?.name || user?.nickname;
|
||||
const userMobile = user?.mobile$user &&
|
||||
user?.mobile$user[0]?.mobile;
|
||||
const userMobile = user?.mobile$user && user?.mobile$user[0]?.mobile;
|
||||
if (userName) {
|
||||
return userName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { EntityDict } from '../../../oak-app-domain';
|
|||
export default function render(props: WebComponentProps<EntityDict, 'session', false, {
|
||||
id: string;
|
||||
unreadLength: number;
|
||||
sessiontMessages: EntityDict['sessionMessage']['Schema'][];
|
||||
sessionMessages: EntityDict['sessionMessage']['Schema'][];
|
||||
userType: string;
|
||||
selectedId: string;
|
||||
onSelect: (id: string) => void;
|
||||
|
|
|
|||
|
|
@ -8,23 +8,23 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|||
const web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
function render(props) {
|
||||
const { methods, data } = props;
|
||||
const { selectedId, onSelect, userType, id, unreadLength, sessiontMessages = [], name, lmts, } = data;
|
||||
const { selectedId, onSelect, id, unreadLength, sessionMessages = [], name, lmts, } = data;
|
||||
const { t, getName, getAvatarUrl } = methods;
|
||||
const sessiontMessage = sessiontMessages && sessiontMessages[0];
|
||||
const type = sessiontMessage?.type;
|
||||
const text = sessiontMessage?.text;
|
||||
const sessionMessage = sessionMessages && sessionMessages[0];
|
||||
const type = sessionMessage?.type;
|
||||
const text = sessionMessage?.text;
|
||||
const today = (0, dayjs_1.default)().startOf('day').valueOf();
|
||||
const createAt2 = lmts && (0, dayjs_1.default)(lmts).startOf('day').valueOf();
|
||||
const lastCreateAt = lmts && (0, dayjs_1.default)(lmts).startOf('day').valueOf();
|
||||
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(web_module_less_1.default.cell, {
|
||||
[web_module_less_1.default.cell_selected]: id === selectedId,
|
||||
}), onClick: () => {
|
||||
onSelect(id);
|
||||
}, children: [(0, jsx_runtime_1.jsx)(antd_1.Badge, { dot: id === selectedId ? false : true, count: unreadLength || 0, children: (0, jsx_runtime_1.jsx)(antd_1.Image, { className: web_module_less_1.default.avatar, src: getAvatarUrl(), preview: false }) }), (0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.inner, children: [(0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.top, children: [(0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.title, children: name || getName() }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.date, children: lmts &&
|
||||
(today === createAt2
|
||||
}, children: [(0, jsx_runtime_1.jsx)(antd_1.Badge, { dot: id !== selectedId, count: unreadLength || 0, children: (0, jsx_runtime_1.jsx)(antd_1.Image, { className: web_module_less_1.default.avatar, src: getAvatarUrl(), preview: false }) }), (0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.inner, children: [(0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.top, children: [(0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.title, children: name || getName() }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.date, children: lmts &&
|
||||
(today === lastCreateAt
|
||||
? (0, dayjs_1.default)(lmts).format('HH:mm')
|
||||
: (0, dayjs_1.default)(lmts).format('YYYY-MM-DD')) })] }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.message, children: type &&
|
||||
(type === 'text'
|
||||
? `${text}`
|
||||
: `[${t(`sessiontMessage:v.type.${type}`)}消息]`) })] })] }));
|
||||
: `[${t(`sessionMessage:v.type.${type}`)}消息]`) })] })] }));
|
||||
}
|
||||
exports.default = render;
|
||||
|
|
|
|||
|
|
@ -1,47 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = OakComponent({
|
||||
// entity: 'session',
|
||||
// projection: {
|
||||
// id: 1,
|
||||
// userId: 1,
|
||||
// entity: 1,
|
||||
// entityId: 1,
|
||||
// lmts: 1,
|
||||
// user: {
|
||||
// id: 1,
|
||||
// name: 1,
|
||||
// nickname: 1,
|
||||
// mobile$user: {
|
||||
// $entity: 'mobile',
|
||||
// data: {
|
||||
// id: 1,
|
||||
// mobile: 1,
|
||||
// userId: 1,
|
||||
// },
|
||||
// },
|
||||
// extraFile$entity: {
|
||||
// $entity: 'extraFile',
|
||||
// data: {
|
||||
// id: 1,
|
||||
// tag1: 1,
|
||||
// origin: 1,
|
||||
// bucket: 1,
|
||||
// objectId: 1,
|
||||
// filename: 1,
|
||||
// extra1: 1,
|
||||
// extension: 1,
|
||||
// type: 1,
|
||||
// entity: 1,
|
||||
// },
|
||||
// filter: {
|
||||
// tag1: {
|
||||
// $in: ['avatar'],
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
isList: false,
|
||||
formData({ data, features }) {
|
||||
const { sessionId } = this.props;
|
||||
|
|
@ -50,25 +9,8 @@ exports.default = OakComponent({
|
|||
}
|
||||
return {};
|
||||
},
|
||||
// filters: [
|
||||
// {
|
||||
// filter() {
|
||||
// const { sessionId } = this.props;
|
||||
// if (sessionId) {
|
||||
// return {
|
||||
// id: sessionId,
|
||||
// };
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
lifetimes: {
|
||||
ready() {
|
||||
const { sessionId } = this.props;
|
||||
// if (sessionId) {
|
||||
// this.getSession(sessionId)
|
||||
// }
|
||||
},
|
||||
ready() { },
|
||||
},
|
||||
listeners: {
|
||||
sessionId(prev, next) {
|
||||
|
|
@ -81,7 +23,7 @@ exports.default = OakComponent({
|
|||
sessionId: '',
|
||||
isEntity: false,
|
||||
entityDisplay: (data) => [],
|
||||
entityProjection: {}, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
entityProjection: null, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
},
|
||||
methods: {
|
||||
getSession(sessionId) {
|
||||
|
|
@ -133,7 +75,7 @@ exports.default = OakComponent({
|
|||
getAvatarUrl() {
|
||||
const { userUrl, entity } = this.state;
|
||||
const { isEntity } = this.props;
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
if (isEntity) {
|
||||
return userUrl || defaultUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
align-items: center;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 20;
|
||||
z-index: 1;
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const tslib_1 = require("tslib");
|
||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||
const antd_1 = require("antd");
|
||||
// import { UserOutlined } from '@ant-design/icons';
|
||||
const web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
function render(props) {
|
||||
const { methods, data } = props;
|
||||
const { nickname, avatarUrl, name } = data;
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
return ((0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.header, children: [(0, jsx_runtime_1.jsx)(antd_1.Avatar, { shape: "square", className: web_module_less_1.default.avatar, src: avatarUrl || defaultUrl }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.nickname, children: nickname || name })] }));
|
||||
}
|
||||
exports.default = render;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
/// <reference types="react" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "session", true, {
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { RowWithActions } from 'oak-frontend-base';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "session", true, {
|
||||
entity: string;
|
||||
entityFilter: any;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: any;
|
||||
sessionId: string;
|
||||
dialog: boolean;
|
||||
|
|
|
|||
|
|
@ -83,14 +83,11 @@ exports.default = OakComponent({
|
|||
entityDisplay &&
|
||||
sessions &&
|
||||
sessions.length > 0) {
|
||||
const sessions1 = entityDisplay(sessions);
|
||||
const newSessions = entityDisplay(sessions);
|
||||
return {
|
||||
sessions: sessions1,
|
||||
sessions: newSessions,
|
||||
};
|
||||
}
|
||||
// const unReadLength = wechatSessions?.filter(
|
||||
// (ele) => ele.isRead
|
||||
// )
|
||||
//排序待框架实现
|
||||
return {
|
||||
sessions: sessions?.sort((a, b) => b.lmts - a.lmts),
|
||||
|
|
@ -133,9 +130,9 @@ exports.default = OakComponent({
|
|||
},
|
||||
properties: {
|
||||
entity: '',
|
||||
entityFilter: undefined,
|
||||
entityFilter: null,
|
||||
entityDisplay: (data) => [],
|
||||
entityProjection: {},
|
||||
entityProjection: null,
|
||||
sessionId: '',
|
||||
dialog: false,
|
||||
onItemClick: null,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
type Session = EntityDict['session']['Schema'];
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'session', true, {
|
||||
sessions: EntityDict['session']['Schema'][];
|
||||
sessions: Partial<Session & {
|
||||
name: string;
|
||||
}>[];
|
||||
selectedSessionId: string;
|
||||
entityFilter: object;
|
||||
}, {
|
||||
setSelectedSessionId: (sessionId: string) => void;
|
||||
navigateToMessage: (sessionId: string) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ const header_1 = tslib_1.__importDefault(require("../../../components/session/he
|
|||
const cell_1 = tslib_1.__importDefault(require("../../../components/session/cell"));
|
||||
function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { sessions, selectedSessionId, oakFullpath, entityFilter, } = data;
|
||||
const { sessions, selectedSessionId, oakFullpath, entityFilter } = data;
|
||||
const { navigateToMessage, setSelectedSessionId } = methods;
|
||||
return ((0, jsx_runtime_1.jsx)("div", { className: mobile_module_less_1.default.container, children: (0, jsx_runtime_1.jsxs)("div", { className: mobile_module_less_1.default.conversationContainer, children: [(0, jsx_runtime_1.jsx)(header_1.default, {}), sessions?.map((session, index) => {
|
||||
return ((0, jsx_runtime_1.jsx)(cell_1.default, { entityFilter: entityFilter, selectedId: selectedSessionId, name: session?.name, onSelect: (id) => {
|
||||
return ((0, jsx_runtime_1.jsx)(cell_1.default, { isEntity: entityFilter ? true : false, selectedId: selectedSessionId, name: session?.name, onSelect: (id) => {
|
||||
navigateToMessage(id);
|
||||
}, oakId: session.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${session.id}`
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
type Session = EntityDict['session']['Schema'];
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'session', true, {
|
||||
sessions: any;
|
||||
sessions: Partial<Session & {
|
||||
name: string;
|
||||
}>[];
|
||||
selectedSessionId: string;
|
||||
className: string;
|
||||
dialog: boolean;
|
||||
entityFilter: object;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: object;
|
||||
}, {
|
||||
setSelectedSessionId: (sessionId: string) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -14,13 +14,11 @@ function Render(props) {
|
|||
return ((0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.container, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(web_module_less_1.default.bothContainer, className, {
|
||||
[web_module_less_1.default.dialogContainer]: dialog,
|
||||
}), children: [(0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.conversationContainer, children: [(0, jsx_runtime_1.jsx)(header_1.default, {}), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.inner, children: sessions?.map((session, index) => {
|
||||
return ((0, jsx_runtime_1.jsx)(cell_1.default, { entityFilter: entityFilter, name: session?.name, selectedId: selectedSessionId, onSelect: (id) => {
|
||||
return ((0, jsx_runtime_1.jsx)(cell_1.default, { isEntity: entityFilter ? true : false, name: session?.name, selectedId: selectedSessionId, onSelect: (id) => {
|
||||
setSelectedSessionId(id);
|
||||
}, oakId: session.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${session.id}`
|
||||
: '' }, session.id));
|
||||
}) })] }), selectedSessionId && ((0, jsx_runtime_1.jsx)(list_1.default, { sessionId: selectedSessionId, isEntity: entityFilter ? true : false, oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection, oakPath: oakFullpath
|
||||
? `$$sessionMessage/list`
|
||||
: undefined }))] }) }));
|
||||
}) })] }), selectedSessionId && ((0, jsx_runtime_1.jsx)(list_1.default, { sessionId: selectedSessionId, isEntity: entityFilter ? true : false, oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection, oakPath: oakFullpath ? `$$sessionMessage/list` : undefined }))] }) }));
|
||||
}
|
||||
exports.default = Render;
|
||||
|
|
|
|||
|
|
@ -74,12 +74,10 @@ exports.default = OakComponent({
|
|||
},
|
||||
formData({ data: sessionMessage, features }) {
|
||||
const type = sessionMessage?.type;
|
||||
// const data = wechatMessage?.data;
|
||||
const session = sessionMessage?.session;
|
||||
const newSessionMessage = {
|
||||
type,
|
||||
aaoe: sessionMessage?.aaoe,
|
||||
// data,
|
||||
text: sessionMessage?.text,
|
||||
id: sessionMessage?.id,
|
||||
$$createAt$$: sessionMessage?.$$createAt$$,
|
||||
|
|
@ -87,13 +85,13 @@ exports.default = OakComponent({
|
|||
userId: session?.userId,
|
||||
userMobile: session?.user?.mobile$user &&
|
||||
session?.user?.mobile$user[0]?.mobile,
|
||||
userAvatar: this.features.extraFile.getUrl(session?.user?.extraFile$entity &&
|
||||
userAvatar: features.extraFile2.getUrl(session?.user?.extraFile$entity &&
|
||||
session?.user?.extraFile$entity[0]),
|
||||
};
|
||||
if (type === 'image') {
|
||||
const extraFile$entity = sessionMessage?.extraFile$entity;
|
||||
Object.assign(newSessionMessage, {
|
||||
picUrl: features.extraFile.getUrl(extraFile$entity && extraFile$entity[0]),
|
||||
picUrl: features.extraFile2.getUrl(extraFile$entity && extraFile$entity[0]),
|
||||
});
|
||||
}
|
||||
return newSessionMessage;
|
||||
|
|
@ -103,8 +101,8 @@ exports.default = OakComponent({
|
|||
},
|
||||
methods: {
|
||||
getAvatarUrl(aaoe) {
|
||||
const defaultUrl = 'http://qiniu.gecomebox.com/static/defaultAvatar.png';
|
||||
const { companyLogoUrl, userAvatar, parkLogoUrl } = this.state;
|
||||
const defaultUrl = 'data:image/png;base64,UklGRoICAABXRUJQVlA4IHYCAADwKACdASosASwBPrVarU8nJiUiJJjIEOAWiWlu4XShG/NX+q91/WYL37Uns/lNhNG6y8oBCkjJGSMkZIyRkjJGSMkZIyRkjJGSMkZIyRkjJGR8IMX6z+YtjIoxEY3KVOOQSyXEuJcR/ZAAHyQcUpZRWfL4lxLiXBnkSU0B4NcCHWSK4CBdk6WS4PC/jULN2pAeRlwRqF2xCZ400cTnW2ogZi8OtcthRiMouvr2dYEgJARhbEb+09k94h/a5mFkC7J2To60i1IWmYHR5OLiXEuJcSAK9Xk4C8ve/Uq7iBoiHvSAkBH4KrcZKm3UErOOpxquA3X2PWjC2wI/Dz57QAZ5J2Tsl6p+Eiy4BhYvDwpoChtMjLgEdPjq37JfS+Rm/7niuhE0jzkyk7jDjACsogklFiMtpkZfbolR4QRN7J2TsnZOydk7J2TsnZOydk7J0YAA/v67qQMAOmxdZAbD1n8UzeBoApiFopfRVxPpEh3G4wAp0EwQD6kJbi6xm8OOhiuS4WeYZ8hxC45E4PZfT56WVnzaLLWW1i9XLyz05YJhxQ6iT5aOk5J1rNnENlAzf+i/0WpEd/edFMYu+q2U4pBjLEoLPE0DGVeHtS7zt4vTVCiXBfibW0mgqhbRQhDrr5ctACqSBsx+8f/HDobGN621bjYch19yGQegV6eUMGNu9bVQi+vQdZvTK4d7MtISka7dqmVYfuI3Z6nUBA/Nzg0ApEhQ+CAmDvSRrKCjxbJBYdc+MsQpTv0DdUkoDVa18rZrKyIeUT4pYRFJcnsT+OoAJGGIdRGn6A4NtB3woJnI/x3d+Rgibkn5GcX4oAfaVqkvAAAAAAA=';
|
||||
const { userAvatar } = this.state;
|
||||
if (aaoe) {
|
||||
return defaultUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { RowWithActions } from 'oak-frontend-base';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "sessionMessage", true, {
|
||||
sessionId: string;
|
||||
isEntity: boolean;
|
||||
dialog: boolean;
|
||||
entity: string;
|
||||
entityId: string;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: any;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ exports.default = OakComponent({
|
|||
await this.pageScroll('comment');
|
||||
});
|
||||
this.createItem();
|
||||
this.getConversationInfo();
|
||||
this.getSessionInfo();
|
||||
},
|
||||
detached() {
|
||||
if (this.timer) {
|
||||
|
|
@ -82,7 +82,7 @@ exports.default = OakComponent({
|
|||
if (prev.sessionId !== next.sessionId) {
|
||||
if (next.sessionId) {
|
||||
const { sessionMessageId } = this.state;
|
||||
this.getConversationInfo();
|
||||
this.getSessionInfo();
|
||||
// 如果sessionId变了需要重新刷新下
|
||||
this.refresh();
|
||||
this.removeItem(sessionMessageId);
|
||||
|
|
@ -112,7 +112,7 @@ exports.default = OakComponent({
|
|||
entity: '',
|
||||
entityId: '',
|
||||
entityDisplay: (data) => [],
|
||||
entityProjection: {}, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
entityProjection: null, // user端,指示需要取哪些entity的属性来显示entityDisplay
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
|
|
@ -137,7 +137,6 @@ exports.default = OakComponent({
|
|||
data: {
|
||||
content: '',
|
||||
buttonHidden: true,
|
||||
selectedTradeId: '',
|
||||
newSessionId: '',
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -175,20 +174,12 @@ exports.default = OakComponent({
|
|||
},
|
||||
setContent(text) {
|
||||
const { sessionMessageId } = this.state;
|
||||
this.setState({
|
||||
text,
|
||||
});
|
||||
this.updateItem({
|
||||
text,
|
||||
type: 'text',
|
||||
}, sessionMessageId);
|
||||
},
|
||||
setButtonHidden(isHidden) {
|
||||
this.setState({
|
||||
buttonHidden: isHidden,
|
||||
});
|
||||
},
|
||||
async getConversationInfo() {
|
||||
async getSessionInfo() {
|
||||
const { sessionId } = this.props;
|
||||
if (!sessionId) {
|
||||
return;
|
||||
|
|
@ -238,10 +229,6 @@ exports.default = OakComponent({
|
|||
id: sessionId,
|
||||
},
|
||||
});
|
||||
this.setState({
|
||||
entity: session?.entity,
|
||||
entityId: session?.entityId,
|
||||
});
|
||||
},
|
||||
pageScroll(id) {
|
||||
const doc = window.document.getElementById(id);
|
||||
|
|
@ -264,23 +251,16 @@ exports.default = OakComponent({
|
|||
});
|
||||
},
|
||||
async createMessage() {
|
||||
const { text, wechatUserId, newSessionId, sessionMessageId } = this.state;
|
||||
const { text, wechatUserId, sessionMessageId } = this.state;
|
||||
const { sessionId, isEntity } = this.props;
|
||||
const userId = this.features.token.getUserId();
|
||||
const applicationId = this.features.application.getApplicationId();
|
||||
if (!this.state.text) {
|
||||
this.setMessage({
|
||||
type: 'warning',
|
||||
content: '请输入内容',
|
||||
});
|
||||
return;
|
||||
}
|
||||
// this.addItem({
|
||||
// applicationId,
|
||||
// text,
|
||||
// userId,
|
||||
// wechatUserId,
|
||||
// sessionId: sessionId || newSessionId,
|
||||
// sessionId: sessionId,
|
||||
// type: 'text',
|
||||
// createTime: Date.now(),
|
||||
// aaoe: isEntity,
|
||||
|
|
@ -289,9 +269,6 @@ exports.default = OakComponent({
|
|||
createTime: Date.now(),
|
||||
}, sessionMessageId);
|
||||
await this.execute(undefined, false);
|
||||
this.setState({
|
||||
text: '',
|
||||
});
|
||||
this.pageScroll('comment');
|
||||
this.createItem();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -14,15 +14,7 @@
|
|||
flex-direction: column;
|
||||
margin-top: 50px;
|
||||
overflow-x: hidden;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bottomSku {
|
||||
width: calc(100% - 16px);
|
||||
// position: fixed;
|
||||
bottom: 176px;
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
height: calc(100% - 50px - 190px);
|
||||
}
|
||||
|
||||
.bottom {
|
||||
|
|
@ -35,7 +27,7 @@
|
|||
bottom: 0;
|
||||
margin: 0px;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
z-index: 1;
|
||||
|
||||
// resize: both;
|
||||
// cursor: nwse-resize;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
interface customFile {
|
||||
name: string;
|
||||
|
|
@ -12,15 +12,11 @@ export default function Render(props: WebComponentProps<EntityDict, 'sessionMess
|
|||
buttonHidden: boolean;
|
||||
sessionId: string;
|
||||
isEntity: boolean;
|
||||
isUser: boolean;
|
||||
employerId: string;
|
||||
sessionMessageType: string;
|
||||
sessionMessageId: string;
|
||||
entityDisplay: (data: any) => any[];
|
||||
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
|
||||
entityProjection: object;
|
||||
isWeChat: boolean;
|
||||
}, {
|
||||
setButtonHidden: (isHidden: boolean) => void;
|
||||
customUpload: (file: customFile) => void;
|
||||
setContent: (text: string) => void;
|
||||
pageScroll: (id: string) => void;
|
||||
|
|
|
|||
|
|
@ -2,60 +2,28 @@
|
|||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||
const react_1 = require("react");
|
||||
const antd_1 = require("antd");
|
||||
const icons_1 = require("@ant-design/icons");
|
||||
const cell_1 = tslib_1.__importDefault(require("../../../components/sessionMessage/cell"));
|
||||
const upsert_1 = tslib_1.__importDefault(require("../../../components/sessionMessage/upsert"));
|
||||
const forMessage_1 = tslib_1.__importDefault(require("../../../components/session/forMessage"));
|
||||
const web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { sessionId, isEntity, sessionMessageList, oakFullpath, text, buttonHidden, sessionMessageType, sessionMessageId, entityDisplay, entityProjection, isWeChat, } = data;
|
||||
const { setButtonHidden, customUpload, setContent, pageScroll, createMessage, } = methods;
|
||||
const [bottomHeight, setBottomHeight] = (0, react_1.useState)(0);
|
||||
const textareaRef = (0, react_1.useRef)(null);
|
||||
(0, react_1.useEffect)(() => {
|
||||
if (buttonHidden) {
|
||||
const newBottomHeight = window.document.getElementById('bottom')?.offsetHeight;
|
||||
setBottomHeight(newBottomHeight);
|
||||
}
|
||||
else {
|
||||
setBottomHeight(0);
|
||||
}
|
||||
}, [buttonHidden]);
|
||||
const handleKeyDown = (event) => {
|
||||
if (event.key === "Enter" && !event.shiftKey) {
|
||||
event.preventDefault();
|
||||
createMessage();
|
||||
pageScroll('comment');
|
||||
}
|
||||
};
|
||||
return ((0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.container, children: [(0, jsx_runtime_1.jsx)(forMessage_1.default, { sessionId: sessionId, isEntity: isEntity, oakPath: 'session:header1', oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.inner, style: {
|
||||
marginBottom: bottomHeight ? `${bottomHeight}px` : '168px',
|
||||
}, id: "comment", onClick: () => setButtonHidden(true), children: sessionMessageList
|
||||
const { sessionId, isEntity, sessionMessageList, oakFullpath, text, buttonHidden, sessionMessageId, entityDisplay, entityProjection, isWeChat, } = data;
|
||||
const { customUpload, setContent, pageScroll, createMessage, } = methods;
|
||||
return ((0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.container, children: [(0, jsx_runtime_1.jsx)(forMessage_1.default, { sessionId: sessionId, isEntity: isEntity, oakPath: '$$sessionMessage/list-session/header', oakAutoUnmount: true, entityDisplay: entityDisplay, entityProjection: entityProjection }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.inner, id: "comment", children: sessionMessageList
|
||||
?.sort((a, b) => a.$$createAt$$ -
|
||||
b.$$createAt$$)
|
||||
.map((sessionMessage, index) => {
|
||||
return ((0, jsx_runtime_1.jsx)(cell_1.default, { oakId: sessionMessage.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${sessionMessage.id}`
|
||||
: '', isEntity: isEntity }, sessionMessage.id));
|
||||
}) }), (0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.bottom, id: "bottom", children: [(0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.toolbar, children: isWeChat ? (
|
||||
//微信资源库
|
||||
(0, jsx_runtime_1.jsx)(icons_1.PictureOutlined, { className: web_module_less_1.default.icon })) : ((0, jsx_runtime_1.jsx)(antd_1.Upload, { accept: 'image/*', multiple: false, showUploadList: false, customRequest: () => { }, onChange: ({ file }) => {
|
||||
customUpload(file);
|
||||
}, children: (0, jsx_runtime_1.jsx)(icons_1.PictureOutlined, { className: web_module_less_1.default.icon }) })) }), (0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.textareaBox, children: [(0, jsx_runtime_1.jsx)(antd_1.Input.TextArea, { ref: textareaRef, className: web_module_less_1.default.textarea, maxLength: 500, placeholder: "Enter \u53D1\u9001\uFF0CShift + Enter\u6362\u884C", rows: 5, onChange: (e) => {
|
||||
setContent(e.target.value);
|
||||
}, onFocus: () => {
|
||||
setButtonHidden(true);
|
||||
},
|
||||
// onPressEnter={(e) => {
|
||||
// e.preventDefault();
|
||||
// createMessage();
|
||||
// pageScroll('comment');
|
||||
// }}
|
||||
onKeyDown: handleKeyDown, value: text }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.btn, children: (0, jsx_runtime_1.jsx)(antd_1.Button, { type: "primary", disabled: !text, onClick: () => {
|
||||
createMessage();
|
||||
pageScroll('comment');
|
||||
}, children: "\u53D1\u9001" }) })] })] })] }));
|
||||
}) }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.bottom, id: "bottom", children: sessionMessageId && ((0, jsx_runtime_1.jsx)(upsert_1.default, { isEntity: isEntity, oakId: sessionMessageId, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${sessionMessageId}`
|
||||
: '', oakAutoUnmount: true, send: () => {
|
||||
createMessage();
|
||||
}, setText: (text) => {
|
||||
setContent(text);
|
||||
}, customUpload: (file) => {
|
||||
} }, `MessageUpsert_${sessionMessageId}`)) })] }));
|
||||
}
|
||||
exports.default = Render;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
/// <reference types="react" />
|
||||
import { UploadFile } from 'antd/es/upload/interface';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "sessionMessage", true, {
|
||||
sessionId: string;
|
||||
userType: string;
|
||||
dialog: boolean;
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "sessionMessage", false, {
|
||||
isEntity: boolean;
|
||||
customUpload: (file: UploadFile) => void;
|
||||
send: () => void;
|
||||
setText: (text: string) => void;
|
||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||
export default _default;
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = OakComponent({
|
||||
entity: 'sessionMessage',
|
||||
isList: false,
|
||||
projection: {
|
||||
id: 1,
|
||||
text: 1,
|
||||
type: 1,
|
||||
createTime: 1,
|
||||
userId: 1,
|
||||
wechatUserId: 1,
|
||||
$$createAt$$: 1,
|
||||
sessionId: 1,
|
||||
session: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
userId: 1,
|
||||
user: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
mobile$user: {
|
||||
$entity: 'mobile',
|
||||
data: {
|
||||
id: 1,
|
||||
mobile: 1,
|
||||
},
|
||||
},
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
extension: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: {
|
||||
$in: ['avatar'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
aaoe: 1,
|
||||
extraFile$entity: {
|
||||
$entity: 'extraFile',
|
||||
data: {
|
||||
id: 1,
|
||||
tag1: 1,
|
||||
tag2: 1,
|
||||
origin: 1,
|
||||
bucket: 1,
|
||||
objectId: 1,
|
||||
filename: 1,
|
||||
extra1: 1,
|
||||
extension: 1,
|
||||
type: 1,
|
||||
entity: 1,
|
||||
},
|
||||
filter: {
|
||||
tag1: {
|
||||
$in: ['image'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
formData({ data: sessionMessage, features }) {
|
||||
const type = sessionMessage?.type;
|
||||
const session = sessionMessage?.session;
|
||||
const newSessionMessage = {
|
||||
type,
|
||||
aaoe: sessionMessage?.aaoe,
|
||||
text: sessionMessage?.text,
|
||||
id: sessionMessage?.id,
|
||||
$$createAt$$: sessionMessage?.$$createAt$$,
|
||||
sessionId: sessionMessage?.sessionId,
|
||||
userId: session?.userId,
|
||||
userMobile: session?.user?.mobile$user &&
|
||||
session?.user?.mobile$user[0]?.mobile,
|
||||
userAvatar: this.features.extraFile.getUrl(session?.user?.extraFile$entity &&
|
||||
session?.user?.extraFile$entity[0]),
|
||||
};
|
||||
if (type === 'image') {
|
||||
const extraFile$entity = sessionMessage?.extraFile$entity;
|
||||
Object.assign(newSessionMessage, {
|
||||
picUrl: features.extraFile.getUrl(extraFile$entity && extraFile$entity[0]),
|
||||
});
|
||||
}
|
||||
return newSessionMessage;
|
||||
},
|
||||
properties: {
|
||||
isEntity: false,
|
||||
customUpload: (file) => { },
|
||||
send: () => { },
|
||||
setText: (text) => { },
|
||||
},
|
||||
methods: {
|
||||
setContent(text) {
|
||||
const { setText } = this.props;
|
||||
if (typeof setText === 'function') {
|
||||
setText(text);
|
||||
}
|
||||
},
|
||||
async upload(file) {
|
||||
const { customUpload } = this.props;
|
||||
if (typeof customUpload === 'function') {
|
||||
customUpload(file);
|
||||
}
|
||||
},
|
||||
async sendData() {
|
||||
const { send } = this.props;
|
||||
const { text } = this.state;
|
||||
if (!text) {
|
||||
this.setMessage({
|
||||
type: 'warning',
|
||||
content: this.t('enterContent'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (typeof send === 'function') {
|
||||
send();
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"placeholder": "Enter 发送,Shift + Enter换行",
|
||||
"send": "发送",
|
||||
"enterContent": "请输入内容"
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import { WebComponentProps } from 'oak-frontend-base';
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { UploadFile } from 'antd/es/upload/interface';
|
||||
export default function render(props: WebComponentProps<EntityDict, 'sessionMessage', false, {
|
||||
isEntity: boolean;
|
||||
isUser: boolean;
|
||||
$$createAt$$: number;
|
||||
text: string;
|
||||
type: string;
|
||||
aaoe: boolean;
|
||||
picUrl: string;
|
||||
sessionId: string;
|
||||
oakId: string;
|
||||
isWeChat: string;
|
||||
}, {
|
||||
setContent: (str: string) => void;
|
||||
sendData: () => void;
|
||||
upload: (file: UploadFile) => void;
|
||||
}>): import("react/jsx-runtime").JSX.Element;
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||
const react_1 = require("react");
|
||||
const antd_1 = require("antd");
|
||||
const icons_1 = require("@ant-design/icons");
|
||||
const web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
|
||||
function render(props) {
|
||||
const { data, methods } = props;
|
||||
const { $$createAt$$, text, type, picUrl, isEntity, aaoe, sessionId, isWeChat, } = data;
|
||||
const { t, setContent, sendData, upload } = methods;
|
||||
const textareaRef = (0, react_1.useRef)(null);
|
||||
const handleKeyDown = (event) => {
|
||||
if (event.key === 'Enter' && !event.shiftKey) {
|
||||
event.preventDefault();
|
||||
sendData();
|
||||
}
|
||||
};
|
||||
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.toolbar, children: (0, jsx_runtime_1.jsx)(antd_1.Upload, { accept: 'image/*', multiple: false, showUploadList: false, customRequest: () => { }, onChange: ({ file }) => {
|
||||
upload(file);
|
||||
}, children: (0, jsx_runtime_1.jsx)(icons_1.PictureOutlined, { className: web_module_less_1.default.icon }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: web_module_less_1.default.textareaBox, children: [(0, jsx_runtime_1.jsx)(antd_1.Input.TextArea, { ref: textareaRef, className: web_module_less_1.default.textarea, maxLength: 500, placeholder: t('placeholder'), rows: 5, onChange: (e) => {
|
||||
setContent(e.target.value);
|
||||
}, onFocus: () => { }, onKeyDown: handleKeyDown, value: text }), (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.btn, children: (0, jsx_runtime_1.jsx)(antd_1.Button, { type: "primary", disabled: !text, onClick: () => {
|
||||
sendData();
|
||||
}, children: t('send') }) })] })] }));
|
||||
}
|
||||
exports.default = render;
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 30px;
|
||||
|
||||
.icon {
|
||||
margin: 0 6px;
|
||||
font-size: 20px;
|
||||
color: var(--oak-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.textareaBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
padding: 0 10px;
|
||||
|
||||
|
||||
.textarea {
|
||||
border: none;
|
||||
outline: none;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.textarea:focus {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
margin: 5px 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -259,6 +259,18 @@ const i18ns = [
|
|||
"confirmToRemove": "您确定要删除系统吗?"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "7c6300b665cdc65858a529c9d4c46d24",
|
||||
namespace: "oak-general-business-c-sessionMessage-upsert",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/components/sessionMessage/upsert",
|
||||
data: {
|
||||
"placeholder": "Enter 发送,Shift + Enter换行",
|
||||
"send": "发送",
|
||||
"enterContent": "请输入内容"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "ded171ed67640a148a4a2cc51470cf69",
|
||||
namespace: "oak-general-business-c-system-application",
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ import * as Notification from "../Notification/Schema";
|
|||
import * as SessionMessage from "../SessionMessage/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
import * as WechatMenu from "../WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "../WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as Session from "../Session/Schema";
|
||||
export type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic';
|
||||
export type AppType = 'web' | 'wechatMp' | 'wechatPublic';
|
||||
|
|
@ -93,8 +93,6 @@ export type Schema = EntityShape & {
|
|||
token$application$$aggr?: AggregationResult<Token.Schema>;
|
||||
wechatMenu$application?: Array<WechatMenu.Schema>;
|
||||
wechatMenu$application$$aggr?: AggregationResult<WechatMenu.Schema>;
|
||||
wechatPublicAutoReply$application?: Array<wechatPublicAutoReply.Schema>;
|
||||
wechatPublicAutoReply$application$$aggr?: AggregationResult<wechatPublicAutoReply.Schema>;
|
||||
wechatPublicTag$application?: Array<WechatPublicTag.Schema>;
|
||||
wechatPublicTag$application$$aggr?: AggregationResult<WechatPublicTag.Schema>;
|
||||
wechatPublicTemplate$application?: Array<WechatPublicTemplate.Schema>;
|
||||
|
|
@ -103,6 +101,8 @@ export type Schema = EntityShape & {
|
|||
wechatQrCode$application$$aggr?: AggregationResult<WechatQrCode.Schema>;
|
||||
wechatUser$application?: Array<WechatUser.Schema>;
|
||||
wechatUser$application$$aggr?: AggregationResult<WechatUser.Schema>;
|
||||
wechatPublicAutoReply$application?: Array<wechatPublicAutoReply.Schema>;
|
||||
wechatPublicAutoReply$application$$aggr?: AggregationResult<wechatPublicAutoReply.Schema>;
|
||||
session$entity?: Array<Session.Schema>;
|
||||
session$entity$$aggr?: AggregationResult<Session.Schema>;
|
||||
} & {
|
||||
|
|
@ -125,11 +125,11 @@ type AttrFilter = {
|
|||
sessionMessage$application: SessionMessage.Filter & SubQueryPredicateMetadata;
|
||||
token$application: Token.Filter & SubQueryPredicateMetadata;
|
||||
wechatMenu$application: WechatMenu.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicAutoReply$application: wechatPublicAutoReply.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicTag$application: WechatPublicTag.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicTemplate$application: WechatPublicTemplate.Filter & SubQueryPredicateMetadata;
|
||||
wechatQrCode$application: WechatQrCode.Filter & SubQueryPredicateMetadata;
|
||||
wechatUser$application: WechatUser.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicAutoReply$application: wechatPublicAutoReply.Filter & SubQueryPredicateMetadata;
|
||||
session$entity: Session.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
|
|
@ -177,12 +177,6 @@ export type Projection = {
|
|||
wechatMenu$application$$aggr?: WechatMenu.Aggregation & {
|
||||
$entity: "wechatMenu";
|
||||
};
|
||||
wechatPublicAutoReply$application?: wechatPublicAutoReply.Selection & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicAutoReply$application$$aggr?: wechatPublicAutoReply.Aggregation & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicTag$application?: WechatPublicTag.Selection & {
|
||||
$entity: "wechatPublicTag";
|
||||
};
|
||||
|
|
@ -207,6 +201,12 @@ export type Projection = {
|
|||
wechatUser$application$$aggr?: WechatUser.Aggregation & {
|
||||
$entity: "wechatUser";
|
||||
};
|
||||
wechatPublicAutoReply$application?: wechatPublicAutoReply.Selection & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicAutoReply$application$$aggr?: wechatPublicAutoReply.Aggregation & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
session$entity?: Session.Selection & {
|
||||
$entity: "session";
|
||||
};
|
||||
|
|
@ -265,11 +265,11 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "systemId">> & (
|
|||
sessionMessage$application?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatMenu$application?: OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTemplate$application?: OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
session$entity?: OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">> | OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
|
|
@ -294,11 +294,11 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemId">> & (
|
|||
sessionMessage$application?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatMenu$application?: OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<WechatMenu.RemoveOperation["action"], Omit<WechatMenu.RemoveOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatMenu.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatMenu.UpdateOperation["action"], Omit<WechatMenu.UpdateOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">> | OakOperation<WechatMenu.RemoveOperation["action"], Omit<WechatMenu.RemoveOperationData, "application" | "applicationId">, Omit<WechatMenu.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTemplate$application?: OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.RemoveOperation["action"], Omit<WechatPublicTemplate.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTemplate.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.UpdateOperation["action"], Omit<WechatPublicTemplate.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTemplate.RemoveOperation["action"], Omit<WechatPublicTemplate.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTemplate.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicAutoReply$application?: OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<wechatPublicAutoReply.CreateOperationData, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.UpdateOperation["action"], Omit<wechatPublicAutoReply.UpdateOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">> | OakOperation<wechatPublicAutoReply.RemoveOperation["action"], Omit<wechatPublicAutoReply.RemoveOperationData, "application" | "applicationId">, Omit<wechatPublicAutoReply.Filter, "application" | "applicationId">>>;
|
||||
session$entity?: OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<Session.RemoveOperation["action"], Omit<Session.RemoveOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">> | OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<Session.RemoveOperation["action"], Omit<Session.RemoveOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ import { EntityDef as UserSystem } from "./UserSystem/Schema";
|
|||
import { EntityDef as UserWechatPublicTag } from "./UserWechatPublicTag/Schema";
|
||||
import { EntityDef as WechatLogin } from "./WechatLogin/Schema";
|
||||
import { EntityDef as WechatMenu } from "./WechatMenu/Schema";
|
||||
import { EntityDef as wechatPublicAutoReply } from "./wechatPublicAutoReply/Schema";
|
||||
import { EntityDef as WechatPublicTag } from "./WechatPublicTag/Schema";
|
||||
import { EntityDef as WechatPublicTemplate } from "./WechatPublicTemplate/Schema";
|
||||
import { EntityDef as WechatQrCode } from "./WechatQrCode/Schema";
|
||||
import { EntityDef as WechatUser } from "./WechatUser/Schema";
|
||||
import { EntityDef as wechatPublicAutoReply } from "./wechatPublicAutoReply/Schema";
|
||||
export type EntityDict = {
|
||||
actionAuth: ActionAuth;
|
||||
i18n: I18n;
|
||||
|
|
@ -92,9 +92,9 @@ export type EntityDict = {
|
|||
userWechatPublicTag: UserWechatPublicTag;
|
||||
wechatLogin: WechatLogin;
|
||||
wechatMenu: WechatMenu;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply;
|
||||
wechatPublicTag: WechatPublicTag;
|
||||
wechatPublicTemplate: WechatPublicTemplate;
|
||||
wechatQrCode: WechatQrCode;
|
||||
wechatUser: WechatUser;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@ import * as UserSystem from "../UserSystem/Schema";
|
|||
import * as UserWechatPublicTag from "../UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "../WechatLogin/Schema";
|
||||
import * as WechatMenu from "../WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "../WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
modiId: ForeignKey<"modi">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
modiId: ForeignKey<"modi">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
modi: Modi.Schema;
|
||||
user?: User.Schema;
|
||||
|
|
@ -34,11 +34,11 @@ export type Schema = EntityShape & {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Schema;
|
||||
wechatLogin?: WechatLogin.Schema;
|
||||
wechatMenu?: WechatMenu.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
wechatPublicTag?: WechatPublicTag.Schema;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Schema;
|
||||
wechatQrCode?: WechatQrCode.Schema;
|
||||
wechatUser?: WechatUser.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
|
|
@ -49,7 +49,7 @@ type AttrFilter = {
|
|||
$$updateAt$$: Q_DateValue;
|
||||
modiId: Q_StringValue;
|
||||
modi: Modi.Filter;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string>;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string>;
|
||||
entityId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
userEntityGrant: UserEntityGrant.Filter;
|
||||
|
|
@ -57,11 +57,11 @@ type AttrFilter = {
|
|||
userWechatPublicTag: UserWechatPublicTag.Filter;
|
||||
wechatLogin: WechatLogin.Filter;
|
||||
wechatMenu: WechatMenu.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
wechatPublicTag: WechatPublicTag.Filter;
|
||||
wechatPublicTemplate: WechatPublicTemplate.Filter;
|
||||
wechatQrCode: WechatQrCode.Filter;
|
||||
wechatUser: WechatUser.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
|
|
@ -81,11 +81,11 @@ export type Projection = {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Projection;
|
||||
wechatLogin?: WechatLogin.Projection;
|
||||
wechatMenu?: WechatMenu.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
wechatPublicTag?: WechatPublicTag.Projection;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Projection;
|
||||
wechatQrCode?: WechatQrCode.Projection;
|
||||
wechatUser?: WechatUser.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ModiEntityIdProjection = OneOf<{
|
||||
id: number;
|
||||
|
|
@ -111,9 +111,6 @@ type WechatLoginIdProjection = OneOf<{
|
|||
type WechatMenuIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
|
|
@ -126,6 +123,9 @@ type WechatQrCodeIdProjection = OneOf<{
|
|||
type WechatUserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -154,8 +154,6 @@ export type SortAttr = {
|
|||
wechatLogin: WechatLogin.SortAttr;
|
||||
} | {
|
||||
wechatMenu: WechatMenu.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
wechatPublicTag: WechatPublicTag.SortAttr;
|
||||
} | {
|
||||
|
|
@ -164,6 +162,8 @@ export type SortAttr = {
|
|||
wechatQrCode: WechatQrCode.SortAttr;
|
||||
} | {
|
||||
wechatUser: WechatUser.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -249,17 +249,6 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatMenu";
|
||||
entityId: ForeignKey<"WechatMenu">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
|
|
@ -304,6 +293,17 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
|
|
@ -348,10 +348,6 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
wechatMenu?: WechatMenu.CreateSingleOperation | WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.CreateSingleOperation | WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
|
|
@ -369,8 +365,12 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "wechatPublicAutoReply" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser"> | null;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser" | "wechatPublicAutoReply"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
|
|
@ -389,8 +389,6 @@ export type RemoveOperationData = {} & (({
|
|||
wechatLogin?: WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
} | {
|
||||
wechatMenu?: WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
|
|
@ -399,6 +397,8 @@ export type RemoveOperationData = {} & (({
|
|||
wechatQrCode?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
} | {
|
||||
wechatUser?: WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
|
|
@ -411,11 +411,11 @@ export type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
|
|||
export type UserWechatPublicTagIdSubQuery = Selection<UserWechatPublicTagIdProjection>;
|
||||
export type WechatLoginIdSubQuery = Selection<WechatLoginIdProjection>;
|
||||
export type WechatMenuIdSubQuery = Selection<WechatMenuIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type WechatPublicTagIdSubQuery = Selection<WechatPublicTagIdProjection>;
|
||||
export type WechatPublicTemplateIdSubQuery = Selection<WechatPublicTemplateIdProjection>;
|
||||
export type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
|
||||
export type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ exports.desc = {
|
|||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicAutoReply", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser"]
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser", "wechatPublicAutoReply"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@ import * as UserSystem from "../UserSystem/Schema";
|
|||
import * as UserWechatPublicTag from "../UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "../WechatLogin/Schema";
|
||||
import * as WechatMenu from "../WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "../WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "../wechatPublicAutoReply/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
operId: ForeignKey<"oper">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = EntityShape & {
|
||||
operId: ForeignKey<"oper">;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string;
|
||||
entity: "user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string;
|
||||
entityId: String<64>;
|
||||
oper: Oper.Schema;
|
||||
user?: User.Schema;
|
||||
|
|
@ -34,11 +34,11 @@ export type Schema = EntityShape & {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Schema;
|
||||
wechatLogin?: WechatLogin.Schema;
|
||||
wechatMenu?: WechatMenu.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
wechatPublicTag?: WechatPublicTag.Schema;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Schema;
|
||||
wechatQrCode?: WechatQrCode.Schema;
|
||||
wechatUser?: WechatUser.Schema;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
|
|
@ -49,7 +49,7 @@ type AttrFilter = {
|
|||
$$updateAt$$: Q_DateValue;
|
||||
operId: Q_StringValue;
|
||||
oper: Oper.Filter;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string>;
|
||||
entity: Q_EnumValue<"user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string>;
|
||||
entityId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
userEntityGrant: UserEntityGrant.Filter;
|
||||
|
|
@ -57,11 +57,11 @@ type AttrFilter = {
|
|||
userWechatPublicTag: UserWechatPublicTag.Filter;
|
||||
wechatLogin: WechatLogin.Filter;
|
||||
wechatMenu: WechatMenu.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
wechatPublicTag: WechatPublicTag.Filter;
|
||||
wechatPublicTemplate: WechatPublicTemplate.Filter;
|
||||
wechatQrCode: WechatQrCode.Filter;
|
||||
wechatUser: WechatUser.Filter;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
|
|
@ -81,11 +81,11 @@ export type Projection = {
|
|||
userWechatPublicTag?: UserWechatPublicTag.Projection;
|
||||
wechatLogin?: WechatLogin.Projection;
|
||||
wechatMenu?: WechatMenu.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
wechatPublicTag?: WechatPublicTag.Projection;
|
||||
wechatPublicTemplate?: WechatPublicTemplate.Projection;
|
||||
wechatQrCode?: WechatQrCode.Projection;
|
||||
wechatUser?: WechatUser.Projection;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type OperEntityIdProjection = OneOf<{
|
||||
id: number;
|
||||
|
|
@ -111,9 +111,6 @@ type WechatLoginIdProjection = OneOf<{
|
|||
type WechatMenuIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type WechatPublicTagIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
|
|
@ -126,6 +123,9 @@ type WechatQrCodeIdProjection = OneOf<{
|
|||
type WechatUserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
type wechatPublicAutoReplyIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -154,8 +154,6 @@ export type SortAttr = {
|
|||
wechatLogin: WechatLogin.SortAttr;
|
||||
} | {
|
||||
wechatMenu: WechatMenu.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
wechatPublicTag: WechatPublicTag.SortAttr;
|
||||
} | {
|
||||
|
|
@ -164,6 +162,8 @@ export type SortAttr = {
|
|||
wechatQrCode: WechatQrCode.SortAttr;
|
||||
} | {
|
||||
wechatUser: WechatUser.SortAttr;
|
||||
} | {
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -246,17 +246,6 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatMenu";
|
||||
entityId: ForeignKey<"WechatMenu">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
|
|
@ -301,6 +290,17 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
} | {
|
||||
entity: "wechatUser";
|
||||
entityId: ForeignKey<"WechatUser">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
wechatPublicAutoReply: wechatPublicAutoReply.UpdateOperation;
|
||||
} | {
|
||||
entity: "wechatPublicAutoReply";
|
||||
entityId: ForeignKey<"wechatPublicAutoReply">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
|
|
@ -339,10 +339,6 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
wechatMenu?: WechatMenu.CreateSingleOperation | WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.CreateSingleOperation | WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
entityId?: never;
|
||||
|
|
@ -360,8 +356,12 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicAutoReply" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "wechatPublicAutoReply" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser"> | null;
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.CreateSingleOperation | wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("user" | "userEntityGrant" | "userSystem" | "userWechatPublicTag" | "wechatLogin" | "wechatMenu" | "wechatPublicTag" | "wechatPublicTemplate" | "wechatQrCode" | "wechatUser" | "wechatPublicAutoReply" | string) | null;
|
||||
entityId?: ForeignKey<"User" | "UserEntityGrant" | "UserSystem" | "UserWechatPublicTag" | "WechatLogin" | "WechatMenu" | "WechatPublicTag" | "WechatPublicTemplate" | "WechatQrCode" | "WechatUser" | "wechatPublicAutoReply"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
|
|
@ -378,8 +378,6 @@ export type RemoveOperationData = {} & ({
|
|||
wechatLogin?: WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
||||
} | {
|
||||
wechatMenu?: WechatMenu.UpdateOperation | WechatMenu.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicTag?: WechatPublicTag.UpdateOperation | WechatPublicTag.RemoveOperation;
|
||||
} | {
|
||||
|
|
@ -388,6 +386,8 @@ export type RemoveOperationData = {} & ({
|
|||
wechatQrCode?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation;
|
||||
} | {
|
||||
wechatUser?: WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
} | {
|
||||
wechatPublicAutoReply?: wechatPublicAutoReply.UpdateOperation | wechatPublicAutoReply.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
|
|
@ -400,11 +400,11 @@ export type UserSystemIdSubQuery = Selection<UserSystemIdProjection>;
|
|||
export type UserWechatPublicTagIdSubQuery = Selection<UserWechatPublicTagIdProjection>;
|
||||
export type WechatLoginIdSubQuery = Selection<WechatLoginIdProjection>;
|
||||
export type WechatMenuIdSubQuery = Selection<WechatMenuIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type WechatPublicTagIdSubQuery = Selection<WechatPublicTagIdProjection>;
|
||||
export type WechatPublicTemplateIdSubQuery = Selection<WechatPublicTemplateIdProjection>;
|
||||
export type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
|
||||
export type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
|
||||
export type wechatPublicAutoReplyIdSubQuery = Selection<wechatPublicAutoReplyIdProjection>;
|
||||
export type OperEntityIdSubQuery = Selection<OperEntityIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ exports.desc = {
|
|||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicAutoReply", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser"]
|
||||
ref: ["user", "userEntityGrant", "userSystem", "userWechatPublicTag", "wechatLogin", "wechatMenu", "wechatPublicTag", "wechatPublicTemplate", "wechatQrCode", "wechatUser", "wechatPublicAutoReply"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ const Storage_41 = require("./UserSystem/Storage");
|
|||
const Storage_42 = require("./UserWechatPublicTag/Storage");
|
||||
const Storage_43 = require("./WechatLogin/Storage");
|
||||
const Storage_44 = require("./WechatMenu/Storage");
|
||||
const Storage_45 = require("./wechatPublicAutoReply/Storage");
|
||||
const Storage_46 = require("./WechatPublicTag/Storage");
|
||||
const Storage_47 = require("./WechatPublicTemplate/Storage");
|
||||
const Storage_48 = require("./WechatQrCode/Storage");
|
||||
const Storage_49 = require("./WechatUser/Storage");
|
||||
const Storage_45 = require("./WechatPublicTag/Storage");
|
||||
const Storage_46 = require("./WechatPublicTemplate/Storage");
|
||||
const Storage_47 = require("./WechatQrCode/Storage");
|
||||
const Storage_48 = require("./WechatUser/Storage");
|
||||
const Storage_49 = require("./wechatPublicAutoReply/Storage");
|
||||
exports.storageSchema = {
|
||||
actionAuth: Storage_1.desc,
|
||||
i18n: Storage_2.desc,
|
||||
|
|
@ -95,9 +95,9 @@ exports.storageSchema = {
|
|||
userWechatPublicTag: Storage_42.desc,
|
||||
wechatLogin: Storage_43.desc,
|
||||
wechatMenu: Storage_44.desc,
|
||||
wechatPublicAutoReply: Storage_45.desc,
|
||||
wechatPublicTag: Storage_46.desc,
|
||||
wechatPublicTemplate: Storage_47.desc,
|
||||
wechatQrCode: Storage_48.desc,
|
||||
wechatUser: Storage_49.desc
|
||||
wechatPublicTag: Storage_45.desc,
|
||||
wechatPublicTemplate: Storage_46.desc,
|
||||
wechatQrCode: Storage_47.desc,
|
||||
wechatUser: Storage_48.desc,
|
||||
wechatPublicAutoReply: Storage_49.desc
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ import * as UserSystem from "./UserSystem/Schema";
|
|||
import * as UserWechatPublicTag from "./UserWechatPublicTag/Schema";
|
||||
import * as WechatLogin from "./WechatLogin/Schema";
|
||||
import * as WechatMenu from "./WechatMenu/Schema";
|
||||
import * as wechatPublicAutoReply from "./wechatPublicAutoReply/Schema";
|
||||
import * as WechatPublicTag from "./WechatPublicTag/Schema";
|
||||
import * as WechatPublicTemplate from "./WechatPublicTemplate/Schema";
|
||||
import * as WechatQrCode from "./WechatQrCode/Schema";
|
||||
import * as WechatUser from "./WechatUser/Schema";
|
||||
import * as wechatPublicAutoReply from "./wechatPublicAutoReply/Schema";
|
||||
export type ActionAuthIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ActionAuth.ActionAuthIdSubQuery & {
|
||||
entity: "actionAuth";
|
||||
|
|
@ -189,8 +189,6 @@ export type ApplicationIdSubQuery = {
|
|||
entity: "token";
|
||||
}) | (WechatMenu.ApplicationIdSubQuery & {
|
||||
entity: "wechatMenu";
|
||||
}) | (wechatPublicAutoReply.ApplicationIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | (WechatPublicTag.ApplicationIdSubQuery & {
|
||||
entity: "wechatPublicTag";
|
||||
}) | (WechatPublicTemplate.ApplicationIdSubQuery & {
|
||||
|
|
@ -199,6 +197,8 @@ export type ApplicationIdSubQuery = {
|
|||
entity: "wechatQrCode";
|
||||
}) | (WechatUser.ApplicationIdSubQuery & {
|
||||
entity: "wechatUser";
|
||||
}) | (wechatPublicAutoReply.ApplicationIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | (Session.ApplicationIdSubQuery & {
|
||||
entity: "session";
|
||||
}) | (Application.ApplicationIdSubQuery & {
|
||||
|
|
@ -427,15 +427,6 @@ export type WechatMenuIdSubQuery = {
|
|||
entity: "wechatMenu";
|
||||
}) | any;
|
||||
};
|
||||
export type wechatPublicAutoReplyIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ModiEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "modiEntity";
|
||||
}) | (OperEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "operEntity";
|
||||
}) | (wechatPublicAutoReply.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | any;
|
||||
};
|
||||
export type WechatPublicTagIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (UserWechatPublicTag.WechatPublicTagIdSubQuery & {
|
||||
entity: "userWechatPublicTag";
|
||||
|
|
@ -484,3 +475,12 @@ export type WechatUserIdSubQuery = {
|
|||
entity: "wechatUser";
|
||||
}) | any;
|
||||
};
|
||||
export type wechatPublicAutoReplyIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ModiEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "modiEntity";
|
||||
}) | (OperEntity.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "operEntity";
|
||||
}) | (wechatPublicAutoReply.wechatPublicAutoReplyIdSubQuery & {
|
||||
entity: "wechatPublicAutoReply";
|
||||
}) | any;
|
||||
};
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue