'$scope', '$timeout', '$compile', '$sanitize', 'model', 'route', function ($scope, $timeout, $compile, $sanitize, model, route) {
$scope.state = {
selectAll: false,
filterUnread: false,
searching: false,
current: undefined,
newItem: undefined,
draftError: false,
dragFolder: undefined,
emptyMessage: lang.translate('folder.empty'),
searchFailed: false,
draftSaveDate: null,
mailLimit: 5000,
recipientLimit: ui.breakpoints.checkMaxWidth("fatMobile") ? 5 : 10
};
$scope.defaultAvatar = "img/illustrations/unknown-avatar.svg?thumbnail=100x100";
$scope.conversation = Conversation.instance;
$scope.ccCciShow = false;
route({
readMail: async function (params) {
Conversation.instance.folders.openFolder('inbox');
template.open('page', 'folders');
$scope.readMail(new Mail(params.mailId));
await Conversation.instance.sync();
await Conversation.instance.folders.draft.countTotal();
$scope.constructNewItem();
$scope.$apply();
},
writeMail: async function (params) {
Conversation.instance.folders.openFolder('inbox');
await Conversation.instance.sync();
template.open('page', 'folders');
template.open('main', 'mail-actions/write-mail');
$scope.constructNewItem();
if (_.isString(params.id)) {
if (!params.type || params.type === 'User') {
let user = new User(params.id);
await user.findData();
$scope.addUser(user);
}
else if (params.type === 'Group') {
let group = new User(params.id);
await group.findGroupData();
$scope.addUser(group);
}
else if (params.type === 'Favorite') {
await $scope.state.newItem.addFavorite(params.id);
}
} else if (params.id !== undefined) {
for (let i = 0; i < params.id.length; i++) {
let user = new User(params.id[i]);
await user.findData();
$scope.addUser(user);
}
}
$scope.$apply();
},
inbox: async () => {
template.open('page', 'folders');
await Conversation.instance.folders.openFolder('inbox');
await Conversation.instance.sync();
await Conversation.instance.folders.draft.countTotal();
$scope.constructNewItem()
$scope.$apply();
}
});
$scope.lang = lang;
$scope.notify = notify;
$scope.folders = Conversation.instance.folders;
$scope.userFolders = Conversation.instance.userFolders;
$scope.users = { list: Conversation.instance.users, search: '', found: [], foundCC: [] };
template.open('main', 'folders-templates/inbox');
template.open('toaster', 'folders-templates/toaster');
$scope.formatFileType = Document.role;
$scope.sending = false;
/**
* WORKSPACE
*/
$scope.copyProps = {
i18: {
title: "conversation.copy.title",
actionTitle: "conversation.copy.action",
actionProcessing: "conversation.copy.processing",
actionFinished: "conversation.copy.finished",
info: "conversation.copy.info"
},
sources: [],
onCancel() {
$scope.copyLightbox.show = false;
},
onSubmitSuccess(dest, count: number) {
if (count > 1) {
notify.info('conversation.notify.copyToWorkspace.plural');
} else {
notify.info('conversation.notify.copyToWorkspace');
}
//.........这里部分代码省略.........
请发表评论