diff --git a/src/actions/EmailActions.js b/src/actions/EmailActions.js
index 2635b85..8e7350e 100644
--- a/src/actions/EmailActions.js
+++ b/src/actions/EmailActions.js
@@ -165,15 +165,17 @@ const todoTypes = {
}
/**
* 顾问的邮箱目录
- * @param {object} { opi_sn }
+ * @param {object} { opi_sn, year, by_start_date, by_success, important, if_want_book, if_thinking }
*/
-export const getEmailDirAction = async (params = { opi_sn: '' }) => {
+export const getEmailDirAction = async (params = { opi_sn: '' }, retOrder=false) => {
const defaultParams = { opi_sn: 0, year: dayjs().year(), by_start_date: -1, by_success: -1, important: -1, if_want_book: -1, if_thinking: -1 }
const { errcode, result } = await fetchJSON(`${API_HOST_V3}/email_dir`, { ...defaultParams, ...params })
const mailboxSort = result //.sort(sortBy('MDR_Order'));
let tree = buildTree(mailboxSort, { key: 'VKey', parent: 'VParent', name: 'VName', iconIndex: 'ImageIndex', rootKeys: [1], ignoreKeys: [-227001, -227002] })
tree = tree.filter((ele) => ele.key !== 1)
- return errcode === 0 ? { [`${params.opi_sn}`]: tree } : { [`${params.opi_sn}`]: [] }
+ const retTree = errcode === 0 ? tree : [];
+ const orderList = groupBy(result, row => `${row.IsTrue}`)?.['0'] || [];
+ return retOrder !== false ? orderList : { [`${params.opi_sn}`]: retTree }
};
export const getTodoOrdersAction = async (params) => {
const opi_arr = params.opisn.split(',')
@@ -347,17 +349,13 @@ const updateEmailKeyFun = {
const channel = getEmailChangesChannel()
channel.postMessage(notificationPayload)
// - 当前tab
- // console.log(`[EmailDetail] Emitted internal`, EMAIL_CHANNEL_NAME, notificationPayload);
internalEventEmitter.emit(EMAIL_CHANNEL_NAME, notificationPayload);
},
processed: async (params) => {
const readRow0 = await readIndexDB(params.mai_sn_list[0], 'listrow', 'mailbox')
- console.log('first000', readRow0);
const listKey = readRow0?.data?.listKey || '';
if (listKey) {
- console.log('first', listKey);
const readCache = await readIndexDB(listKey, 'maillist', 'mailbox')
- console.log('222', readCache);
const updatedMailList = readCache.data.filter(mai_sn => !params.mai_sn_list.includes(mai_sn));
writeIndexDB([{ key: listKey, data: updatedMailList }], 'maillist', 'mailbox')
// 通知邮件列表数据更新
@@ -366,7 +364,6 @@ const updateEmailKeyFun = {
const channel = getEmailChangesChannel()
channel.postMessage(notificationPayload)
// - 当前tab
- // console.log(`[EmailDetail] Emitted internal`, EMAIL_CHANNEL_NAME, notificationPayload);
internalEventEmitter.emit(EMAIL_CHANNEL_NAME, notificationPayload);
}
}
diff --git a/src/views/Conversations/Online/Components/EmailBind.jsx b/src/views/Conversations/Online/Components/EmailBind.jsx
index 1a0923f..a2c782a 100644
--- a/src/views/Conversations/Online/Components/EmailBind.jsx
+++ b/src/views/Conversations/Online/Components/EmailBind.jsx
@@ -155,7 +155,7 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, coliID, onB
onCancel={() => {
setOpen(false)
}}
- destroyOnClose>
+ destroyOnHidden>
{/*