Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev

This commit is contained in:
wenjiarui 2023-10-12 10:36:26 +08:00
commit 889bc37e09
32 changed files with 169 additions and 166 deletions

View File

@ -6,7 +6,7 @@ export default function render(props) {
const disabled = oakExecuting ||
['uploading'].includes(state) ||
(oakExecutable === false && ['uploaded'].includes(state));
let text = executeText || t('common::action.confirm');
let text = executeText || t('common:submit');
if (oakExecuting) {
text = t('executing', { text });
}

View File

@ -6,7 +6,7 @@ export default function render(props) {
const disabled = oakExecuting ||
['uploading'].includes(state) ||
(oakExecutable !== true && ['uploaded'].includes(state));
let text = executeText || t('common::action.confirm');
let text = executeText || t('common:submit');
if (oakExecuting) {
text = t('executing', { text });
}

View File

@ -10,9 +10,9 @@ export interface EnhancedExtraFile extends ExtraFile {
fileState?: FileState;
percentage?: number;
}
type SourceType = 'album' | 'camera';
export type Theme = 'file' | 'image' | 'image-flow' | 'custom';
type ImgMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | "heightFix" | 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
type SourceType = 'album' | 'camera';
type ImageMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
bucket: string;
removeLater: boolean;
@ -22,7 +22,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
selectCount: number;
sourceType: SourceType[];
mediaType: ('image' | 'video')[];
mode: ImgMode;
mode: ImageMode;
size: number;
showUploadList: boolean;
showUploadProgress: boolean;

View File

@ -97,7 +97,9 @@ export default OakComponent({
},
features: ['extraFile2'],
formData({ data, features }) {
let files = data?.sort((ele1, ele2) => ele1.sort - ele2.sort);
let files = data
?.filter((ele) => !ele.$$deleteAt$$)
.sort((ele1, ele2) => ele1.sort - ele2.sort);
if (this.props.tag1) {
files = files?.filter((ele) => ele?.tag1 === this.props.tag1);
}

View File

@ -9,7 +9,6 @@ export default function render(props: WebComponentProps<EntityDict, 'extraFile',
multiple?: boolean;
draggable?: boolean;
theme?: Theme;
tips?: string;
beforeUpload?: (file: File) => Promise<boolean> | boolean;
style?: Record<string, string>;
className?: string;

View File

@ -48,7 +48,7 @@ const DraggableUploadListItem = ({ originNode, moveRow, file, fileList, }) => {
return (_jsx("div", { ref: ref, className: `ant-upload-draggable-list-item ${isOver ? dropClassName : ""}`, style: { cursor: "move", height: "100%" }, children: originNode }));
};
export default function render(props) {
const { accept = 'image/*', maxNumber = 20, multiple = maxNumber !== 1, draggable = false, theme = 'image', tips, beforeUpload, style, className, directory = false, onPreview, onDownload, children, showUploadList = true, files = [], disableInsert = false, disableDownload = false, disableDelete = false, disablePreview = false, } = props.data;
const { accept = 'image/*', maxNumber = 20, multiple = maxNumber !== 1, draggable = false, theme = 'image', beforeUpload, style, className, directory = false, onPreview, onDownload, children, showUploadList = true, files = [], disableInsert = false, disableDownload = false, disableDelete = false, disablePreview = false, } = props.data;
const { t, updateItem, onRemove, addFileByWeb, checkSort } = props.methods;
const listType = getListType(theme);
const getUploadButton = () => {
@ -146,27 +146,27 @@ export default function render(props) {
updateItem({ sort }, dragRow.id);
}
}, [files]);
return (_jsxs(Space, { direction: "vertical", className: Style['oak-upload'], style: { width: '100%' }, children: [_jsx(DndProvider, { backend: isPc ? HTML5Backend : TouchBackend, children: _jsx(Upload, { className: classNames(Style['oak-upload__upload'], className), style: style, directory: directory, showUploadList: showUploadList
? {
showPreviewIcon: !disablePreview,
showRemoveIcon: !disableDelete,
showDownloadIcon: !disableDownload,
return (_jsx(Space, { direction: "vertical", className: Style['oak-upload'], style: { width: '100%' }, children: _jsx(DndProvider, { backend: isPc ? HTML5Backend : TouchBackend, children: _jsx(Upload, { className: classNames(Style['oak-upload__upload'], className), style: style, directory: directory, showUploadList: showUploadList
? {
showPreviewIcon: !disablePreview,
showRemoveIcon: !disableDelete,
showDownloadIcon: !disableDownload,
}
: false, beforeUpload: async (file) => {
if (typeof beforeUpload === 'function') {
const result = await beforeUpload(file);
if (result) {
return false;
}
: false, beforeUpload: async (file) => {
if (typeof beforeUpload === 'function') {
const result = await beforeUpload(file);
if (result) {
return false;
}
}
return false;
}, multiple: multiple, accept: accept, listType: listType, fileList: transformToUploadFile(), onChange: ({ file, fileList, event }) => {
if (file instanceof File) {
addFileByWeb(file);
}
}, onRemove: onRemove, onPreview: onPreview, onDownload: onDownload, itemRender: (originNode, currentFile, currentFileList) => {
return (_jsx(DraggableUploadListItem, { originNode: originNode, file: currentFile, fileList: currentFileList, moveRow: moveRow }));
}, children: !disableInsert && files.length < maxNumber
? getUploadButton()
: null }) }), tips && (_jsx("small", { className: Style['oak-upload__tips'], children: tips }))] }));
}
return false;
}, multiple: multiple, accept: accept, listType: listType, fileList: transformToUploadFile(), onChange: ({ file, fileList, event }) => {
if (file instanceof File) {
addFileByWeb(file);
}
}, onRemove: onRemove, onPreview: onPreview, onDownload: onDownload, itemRender: (originNode, currentFile, currentFileList) => {
return (_jsx(DraggableUploadListItem, { originNode: originNode, file: currentFile, fileList: currentFileList, moveRow: moveRow }));
}, children: !disableInsert && files.length < maxNumber
? getUploadButton()
: null }) }) }));
}

View File

@ -8,36 +8,29 @@ export default OakComponent({
lifetimes: {
async ready() {
const { applicationId } = this.props;
const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId });
if (result.is_menu_open === 1) {
const { data: wechatMenu } = await this.features.cache.refresh('wechatMenu', {
data: {
id: 1,
applicationId: 1,
wechatPublicTagId: 1,
},
filter: {
applicationId,
wechatPublicTagId: {
$exists: false
}
}
});
if (wechatMenu && wechatMenu[0]) {
this.setState({
menuId: wechatMenu[0].id,
});
}
this.setState({
is_menu_open: true,
// const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId! });
const { data: wechatMenu } = await this.features.cache.refresh('wechatMenu', {
data: {
id: 1,
applicationId: 1,
wechatPublicTagId: 1,
},
filter: {
applicationId,
});
}
else {
wechatPublicTagId: {
$exists: false
}
}
});
if (wechatMenu && wechatMenu[0]) {
this.setState({
is_menu_open: false,
menuId: wechatMenu[0].id,
});
}
this.setState({
is_menu_open: true,
applicationId,
});
}
},
methods: {},

View File

@ -26,14 +26,14 @@ export default function Render(props) {
},
];
if (oakFullpath) {
return (_jsx("div", { children: is_menu_open ? (_jsx("div", { className: Style.tabs, children: isPlatform ? _jsx(WechatMenu, { menuId: menuId ? menuId : undefined, oakPath: '$wechatMenu', applicationId: applicationId, oakAutoUnmount: true, menuType: menuType, tabKey: tabKey }) : _jsx(Tabs, { defaultActiveKey: '1', items: items, onChange: (key) => {
return (_jsx("div", { children: is_menu_open && (_jsx("div", { className: Style.tabs, children: isPlatform ? _jsx(WechatMenu, { menuId: menuId ? menuId : undefined, oakPath: '$wechatMenu', applicationId: applicationId, oakAutoUnmount: true, menuType: menuType, tabKey: tabKey }) : _jsx(Tabs, { defaultActiveKey: '1', items: items, onChange: (key) => {
if (key === '1') {
setMenuType('common');
}
else {
setMenuType('conditional');
}
} }) })) : (_jsx("div", { className: Style.container, children: _jsx("div", { className: Style.warn, children: "\u5C1A\u672A\u5F00\u542F\u83DC\u5355\uFF0C\u8BF7\u5148\u524D\u5F80\u5FAE\u4FE1\u516C\u4F17\u5E73\u53F0\u5F00\u542F\u3002" }) })) }));
} }) })) }));
}
return null;
}

View File

@ -395,6 +395,7 @@ const i18ns = [
"newAdd": "新增",
"add": "添加"
},
"submit": "提交",
"reset": "重置",
"select": "查询",
"expand": "展开",

View File

@ -16,6 +16,7 @@
"newAdd": "新增",
"add": "添加"
},
"submit": "提交",
"reset": "重置",
"select": "查询",
"expand": "展开",

View File

@ -50,12 +50,13 @@ const triggers = [
sorter: [
{
$attr: {
$$createAt$$: 1,
createTime: 1,
},
$direction: 'desc',
},
],
count: 1,
indexFrom: 0,
}, {});
if (sessionMessage && sessionMessage.wechatUserId) {
const [session] = await context.select('session', {

View File

@ -8,7 +8,7 @@ function render(props) {
const disabled = oakExecuting ||
['uploading'].includes(state) ||
(oakExecutable === false && ['uploaded'].includes(state));
let text = executeText || t('common::action.confirm');
let text = executeText || t('common:submit');
if (oakExecuting) {
text = t('executing', { text });
}

View File

@ -8,7 +8,7 @@ function render(props) {
const disabled = oakExecuting ||
['uploading'].includes(state) ||
(oakExecutable !== true && ['uploaded'].includes(state));
let text = executeText || t('common::action.confirm');
let text = executeText || t('common:submit');
if (oakExecuting) {
text = t('executing', { text });
}

View File

@ -10,9 +10,9 @@ export interface EnhancedExtraFile extends ExtraFile {
fileState?: FileState;
percentage?: number;
}
type SourceType = 'album' | 'camera';
export type Theme = 'file' | 'image' | 'image-flow' | 'custom';
type ImgMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | "heightFix" | 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
type SourceType = 'album' | 'camera';
type ImageMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
bucket: string;
removeLater: boolean;
@ -22,7 +22,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
selectCount: number;
sourceType: SourceType[];
mediaType: ('image' | 'video')[];
mode: ImgMode;
mode: ImageMode;
size: number;
showUploadList: boolean;
showUploadProgress: boolean;

View File

@ -99,7 +99,9 @@ exports.default = OakComponent({
},
features: ['extraFile2'],
formData({ data, features }) {
let files = data?.sort((ele1, ele2) => ele1.sort - ele2.sort);
let files = data
?.filter((ele) => !ele.$$deleteAt$$)
.sort((ele1, ele2) => ele1.sort - ele2.sort);
if (this.props.tag1) {
files = files?.filter((ele) => ele?.tag1 === this.props.tag1);
}

View File

@ -9,7 +9,6 @@ export default function render(props: WebComponentProps<EntityDict, 'extraFile',
multiple?: boolean;
draggable?: boolean;
theme?: Theme;
tips?: string;
beforeUpload?: (file: File) => Promise<boolean> | boolean;
style?: Record<string, string>;
className?: string;

View File

@ -51,7 +51,7 @@ const DraggableUploadListItem = ({ originNode, moveRow, file, fileList, }) => {
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: `ant-upload-draggable-list-item ${isOver ? dropClassName : ""}`, style: { cursor: "move", height: "100%" }, children: originNode }));
};
function render(props) {
const { accept = 'image/*', maxNumber = 20, multiple = maxNumber !== 1, draggable = false, theme = 'image', tips, beforeUpload, style, className, directory = false, onPreview, onDownload, children, showUploadList = true, files = [], disableInsert = false, disableDownload = false, disableDelete = false, disablePreview = false, } = props.data;
const { accept = 'image/*', maxNumber = 20, multiple = maxNumber !== 1, draggable = false, theme = 'image', beforeUpload, style, className, directory = false, onPreview, onDownload, children, showUploadList = true, files = [], disableInsert = false, disableDownload = false, disableDelete = false, disablePreview = false, } = props.data;
const { t, updateItem, onRemove, addFileByWeb, checkSort } = props.methods;
const listType = getListType(theme);
const getUploadButton = () => {
@ -149,28 +149,28 @@ function render(props) {
updateItem({ sort }, dragRow.id);
}
}, [files]);
return ((0, jsx_runtime_1.jsxs)(antd_1.Space, { direction: "vertical", className: web_module_less_1.default['oak-upload'], style: { width: '100%' }, children: [(0, jsx_runtime_1.jsx)(react_dnd_1.DndProvider, { backend: utils_1.isPc ? react_dnd_html5_backend_1.HTML5Backend : react_dnd_touch_backend_1.TouchBackend, children: (0, jsx_runtime_1.jsx)(antd_1.Upload, { className: (0, classnames_1.default)(web_module_less_1.default['oak-upload__upload'], className), style: style, directory: directory, showUploadList: showUploadList
? {
showPreviewIcon: !disablePreview,
showRemoveIcon: !disableDelete,
showDownloadIcon: !disableDownload,
return ((0, jsx_runtime_1.jsx)(antd_1.Space, { direction: "vertical", className: web_module_less_1.default['oak-upload'], style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)(react_dnd_1.DndProvider, { backend: utils_1.isPc ? react_dnd_html5_backend_1.HTML5Backend : react_dnd_touch_backend_1.TouchBackend, children: (0, jsx_runtime_1.jsx)(antd_1.Upload, { className: (0, classnames_1.default)(web_module_less_1.default['oak-upload__upload'], className), style: style, directory: directory, showUploadList: showUploadList
? {
showPreviewIcon: !disablePreview,
showRemoveIcon: !disableDelete,
showDownloadIcon: !disableDownload,
}
: false, beforeUpload: async (file) => {
if (typeof beforeUpload === 'function') {
const result = await beforeUpload(file);
if (result) {
return false;
}
: false, beforeUpload: async (file) => {
if (typeof beforeUpload === 'function') {
const result = await beforeUpload(file);
if (result) {
return false;
}
}
return false;
}, multiple: multiple, accept: accept, listType: listType, fileList: transformToUploadFile(), onChange: ({ file, fileList, event }) => {
if (file instanceof File) {
addFileByWeb(file);
}
}, onRemove: onRemove, onPreview: onPreview, onDownload: onDownload, itemRender: (originNode, currentFile, currentFileList) => {
return ((0, jsx_runtime_1.jsx)(DraggableUploadListItem, { originNode: originNode, file: currentFile, fileList: currentFileList, moveRow: moveRow }));
}, children: !disableInsert && files.length < maxNumber
? getUploadButton()
: null }) }), tips && ((0, jsx_runtime_1.jsx)("small", { className: web_module_less_1.default['oak-upload__tips'], children: tips }))] }));
}
return false;
}, multiple: multiple, accept: accept, listType: listType, fileList: transformToUploadFile(), onChange: ({ file, fileList, event }) => {
if (file instanceof File) {
addFileByWeb(file);
}
}, onRemove: onRemove, onPreview: onPreview, onDownload: onDownload, itemRender: (originNode, currentFile, currentFileList) => {
return ((0, jsx_runtime_1.jsx)(DraggableUploadListItem, { originNode: originNode, file: currentFile, fileList: currentFileList, moveRow: moveRow }));
}, children: !disableInsert && files.length < maxNumber
? getUploadButton()
: null }) }) }));
}
exports.default = render;

View File

@ -10,36 +10,29 @@ exports.default = OakComponent({
lifetimes: {
async ready() {
const { applicationId } = this.props;
const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId });
if (result.is_menu_open === 1) {
const { data: wechatMenu } = await this.features.cache.refresh('wechatMenu', {
data: {
id: 1,
applicationId: 1,
wechatPublicTagId: 1,
},
filter: {
applicationId,
wechatPublicTagId: {
$exists: false
}
}
});
if (wechatMenu && wechatMenu[0]) {
this.setState({
menuId: wechatMenu[0].id,
});
}
this.setState({
is_menu_open: true,
// const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId! });
const { data: wechatMenu } = await this.features.cache.refresh('wechatMenu', {
data: {
id: 1,
applicationId: 1,
wechatPublicTagId: 1,
},
filter: {
applicationId,
});
}
else {
wechatPublicTagId: {
$exists: false
}
}
});
if (wechatMenu && wechatMenu[0]) {
this.setState({
is_menu_open: false,
menuId: wechatMenu[0].id,
});
}
this.setState({
is_menu_open: true,
applicationId,
});
}
},
methods: {},

View File

@ -29,14 +29,14 @@ function Render(props) {
},
];
if (oakFullpath) {
return ((0, jsx_runtime_1.jsx)("div", { children: is_menu_open ? ((0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.tabs, children: isPlatform ? (0, jsx_runtime_1.jsx)(menu_1.default, { menuId: menuId ? menuId : undefined, oakPath: '$wechatMenu', applicationId: applicationId, oakAutoUnmount: true, menuType: menuType, tabKey: tabKey }) : (0, jsx_runtime_1.jsx)(antd_1.Tabs, { defaultActiveKey: '1', items: items, onChange: (key) => {
return ((0, jsx_runtime_1.jsx)("div", { children: is_menu_open && ((0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.tabs, children: isPlatform ? (0, jsx_runtime_1.jsx)(menu_1.default, { menuId: menuId ? menuId : undefined, oakPath: '$wechatMenu', applicationId: applicationId, oakAutoUnmount: true, menuType: menuType, tabKey: tabKey }) : (0, jsx_runtime_1.jsx)(antd_1.Tabs, { defaultActiveKey: '1', items: items, onChange: (key) => {
if (key === '1') {
setMenuType('common');
}
else {
setMenuType('conditional');
}
} }) })) : ((0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.container, children: (0, jsx_runtime_1.jsx)("div", { className: web_module_less_1.default.warn, children: "\u5C1A\u672A\u5F00\u542F\u83DC\u5355\uFF0C\u8BF7\u5148\u524D\u5F80\u5FAE\u4FE1\u516C\u4F17\u5E73\u53F0\u5F00\u542F\u3002" }) })) }));
} }) })) }));
}
return null;
}

View File

@ -397,6 +397,7 @@ const i18ns = [
"newAdd": "新增",
"add": "添加"
},
"submit": "提交",
"reset": "重置",
"select": "查询",
"expand": "展开",

View File

@ -16,6 +16,7 @@
"newAdd": "新增",
"add": "添加"
},
"submit": "提交",
"reset": "重置",
"select": "查询",
"expand": "展开",

View File

@ -43,7 +43,7 @@ const triggers = [
aaoe: 1,
},
filter: {
id: sessionId,
sessionId,
aaoe: false,
createTime: {
$gt: Date.now() - (48 * 60 * 60 * 1000 - 5 * 60 * 1000)
@ -52,12 +52,13 @@ const triggers = [
sorter: [
{
$attr: {
$$createAt$$: 1,
createTime: 1,
},
$direction: 'desc',
},
],
count: 1,
indexFrom: 0,
}, {});
if (sessionMessage && sessionMessage.wechatUserId) {
const [session] = await context.select('session', {

View File

@ -42,7 +42,7 @@ export default function render(
oakExecuting ||
['uploading'].includes(state) ||
(oakExecutable !== true && ['uploaded'].includes(state));
let text = executeText || t('common::action.confirm');
let text = executeText || t('common:submit');
if (oakExecuting) {
text = t('executing', { text });
} else if (oakExecutable === false) {

View File

@ -43,7 +43,7 @@ export default function render(
oakExecuting ||
['uploading'].includes(state) ||
(oakExecutable === false && ['uploaded'].includes(state));
let text = executeText || t('common::action.confirm');
let text = executeText || t('common:submit');
if (oakExecuting) {
text = t('executing', { text });
} else if (oakExecutable === false) {

View File

@ -14,11 +14,24 @@ export interface EnhancedExtraFile extends ExtraFile {
fileState?: FileState;
percentage?: number;
};
export type Theme = 'file' | 'image' | 'image-flow' | 'custom';
type SourceType = 'album' | 'camera';
export type Theme = 'file' | 'image' | 'image-flow' | 'custom';
type ImgMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | "heightFix" | 'top' | 'bottom' | 'left'
| 'right' | 'center' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
type ImageMode =
| 'scaleToFill'
| 'aspectFit'
| 'aspectFill'
| 'widthFix'
| 'heightFix'
| 'top'
| 'bottom'
| 'left'
| 'right'
| 'center'
| 'top left'
| 'top right'
| 'bottom left'
| 'bottom right';
export default OakComponent({
entity: 'extraFile',
@ -72,7 +85,7 @@ export default OakComponent({
selectCount: 1, // 每次打开图片时,可选中的数量 小程序独有
sourceType: ['album', 'camera'] as SourceType[], // 小程序独有 chooseMedia
mediaType: ['image'] as ('image' | 'video')[], // 小程序独有 chooseMedia
mode: 'aspectFit' as ImgMode, // 图片显示模式
mode: 'aspectFit' as ImageMode, // 图片显示模式
size: 3, // 每行可显示的个数 小程序独有
showUploadList: true, //web独有
showUploadProgress: false, // web独有
@ -123,7 +136,9 @@ export default OakComponent({
},
features: ['extraFile2'],
formData({ data, features }) {
let files = data?.sort((ele1, ele2) => ele1.sort! - ele2.sort!);
let files = data
?.filter((ele) => !ele.$$deleteAt$$)
.sort((ele1, ele2) => ele1.sort! - ele2.sort!);
if (this.props.tag1) {
files = files?.filter((ele) => ele?.tag1 === this.props.tag1);
}
@ -363,7 +378,7 @@ export default OakComponent({
sourceType: SourceType[];
mediaType: ('image' | 'video')[];
// 图片显示模式
mode: ImgMode;
mode: ImageMode;
// 每行可显示的个数
size: number;
showUploadList: boolean;

View File

@ -80,7 +80,6 @@ export default function render(
multiple?: boolean;
draggable?: boolean;
theme?: Theme;
tips?: string;
beforeUpload?: (file: File) => Promise<boolean> | boolean;
style?: Record<string, string>;
className?: string;
@ -107,7 +106,6 @@ export default function render(
multiple = maxNumber !== 1,
draggable = false,
theme = 'image',
tips,
beforeUpload,
style,
className,
@ -287,10 +285,6 @@ export default function render(
: null}
</Upload>
</DndProvider>
{tips && (
<small className={Style['oak-upload__tips']}>{tips}</small>
)}
</Space>
);
}

View File

@ -113,7 +113,9 @@ export default OakComponent({
this.getUserLastMessage();
// console.log(url);
return {
sessionMessageList,
sessionMessageList: sessionMessageList?.filter(
(ele) => ele.$$createAt$$ !== 1
),
num: sessionMessageList?.length,
sessionMessageType,
};

View File

@ -9,38 +9,32 @@ export default OakComponent({
lifetimes: {
async ready() {
const { applicationId } = this.props;
const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId! });
if (result.is_menu_open === 1) {
const { data: wechatMenu } = await this.features.cache.refresh(
'wechatMenu',
{
data: {
id: 1,
applicationId: 1,
wechatPublicTagId: 1,
},
filter: {
applicationId,
wechatPublicTagId: {
$exists: false
}
// const result = await this.features.wechatMenu.getCurrentMenu({ applicationId: applicationId! });
const { data: wechatMenu } = await this.features.cache.refresh(
'wechatMenu',
{
data: {
id: 1,
applicationId: 1,
wechatPublicTagId: 1,
},
filter: {
applicationId,
wechatPublicTagId: {
$exists: false
}
}
);
if (wechatMenu && wechatMenu[0]) {
this.setState({
menuId: wechatMenu[0].id,
});
}
);
if (wechatMenu && wechatMenu[0]) {
this.setState({
is_menu_open: true,
applicationId,
});
} else {
this.setState({
is_menu_open: false,
menuId: wechatMenu[0].id,
});
}
this.setState({
is_menu_open: true,
applicationId,
});
}
},
methods: {

View File

@ -82,7 +82,7 @@ export default function Render(
return (
<div>
{
is_menu_open ? (
is_menu_open && (
<div className={Style.tabs}>
{
isPlatform ? <WechatMenu
@ -105,11 +105,12 @@ export default function Render(
/>
}
</div>
) : (
<div className={Style.container}>
<div className={Style.warn}></div>
</div>
)
// : (
// <div className={Style.container}>
// <div className={Style.warn}>尚未开启菜单,请先前往微信公众平台开启。</div>
// </div>
// )
}
</div>
)

View File

@ -397,6 +397,7 @@ const i18ns: I18n[] = [
"newAdd": "新增",
"add": "添加"
},
"submit": "提交",
"reset": "重置",
"select": "查询",
"expand": "展开",

View File

@ -16,6 +16,7 @@
"newAdd": "新增",
"add": "添加"
},
"submit": "提交",
"reset": "重置",
"select": "查询",
"expand": "展开",

View File

@ -69,12 +69,13 @@ const triggers: Trigger<EntityDict, 'sessionMessage', BackendRuntimeContext<Enti
sorter: [
{
$attr: {
$$createAt$$: 1,
createTime: 1,
},
$direction: 'desc',
},
],
count: 1,
indexFrom: 0,
},
{}
);