no message

This commit is contained in:
kuaifan 2024-12-03 08:30:56 +08:00
parent df917001d3
commit 4c5c071b21
5 changed files with 14 additions and 11 deletions

View File

@ -47,8 +47,7 @@ class FileController extends AbstractController
{ {
$user = User::auth(); $user = User::auth();
// //
$data = Request::all(); $pid = intval(Request::input('pid'));
$pid = intval($data['pid']);
// //
return Base::retSuccess('success', (new File)->getFileList($user, $pid)); return Base::retSuccess('success', (new File)->getFileList($user, $pid));
} }

View File

@ -111,6 +111,8 @@ class File extends AbstractModel
* 获取文件列表 * 获取文件列表
* @param user $user * @param user $user
* @param int $pid * @param int $pid
* @param string $type
* @param bool $isGetparent
* @return array * @return array
*/ */
public function getFileList($user, int $pid, $type = "all", $isGetparent = true) public function getFileList($user, int $pid, $type = "all", $isGetparent = true)
@ -118,7 +120,7 @@ class File extends AbstractModel
$permission = 1000; $permission = 1000;
$userids = $user->isTemp() ? [$user->userid] : [0, $user->userid]; $userids = $user->isTemp() ? [$user->userid] : [0, $user->userid];
$builder = File::wherePid($pid) $builder = File::wherePid($pid)
->when($type=='dir',function($q){ ->when($type == 'dir', function ($q) {
$q->whereType('folder'); $q->whereType('folder');
}); });
if ($pid > 0) { if ($pid > 0) {
@ -134,7 +136,7 @@ class File extends AbstractModel
// //
if ($pid > 0) { if ($pid > 0) {
// 遍历获取父级 // 遍历获取父级
if($isGetparent){ if ($isGetparent) {
while ($pid > 0) { while ($pid > 0) {
$file = File::whereId($pid)->first(); $file = File::whereId($pid)->first();
if (empty($file)) { if (empty($file)) {
@ -172,8 +174,8 @@ class File extends AbstractModel
->whereIn('file_users.userid', $userids) ->whereIn('file_users.userid', $userids)
->groupBy('files.id') ->groupBy('files.id')
->take(100) ->take(100)
->when($type=='dir',function($q){ ->when($type == 'dir', function ($q) {
$q->where('files.type','folder'); $q->where('files.type', 'folder');
}) })
->get(); ->get();
if ($list->isNotEmpty()) { if ($list->isNotEmpty()) {

View File

@ -351,6 +351,7 @@ function createChildWindow(args) {
browser = preloadWindow; browser = preloadWindow;
preloadWindow = null; preloadWindow = null;
isPreload = true; isPreload = true;
options.title && browser.setTitle(options.title);
options.parent && browser.setParentWindow(options.parent); options.parent && browser.setParentWindow(options.parent);
browser.setSize(options.width, options.height); browser.setSize(options.width, options.height);
browser.setMinimumSize(options.minWidth, options.minHeight); browser.setMinimumSize(options.minWidth, options.minHeight);

View File

@ -530,7 +530,7 @@ export default {
}, },
searchLoading({tabActive, loadDialogs, dialogSearchLoad, contactsLoad}) { searchLoading({tabActive, loadDialogs, dialogSearchLoad, contactsLoad}) {
if (tabActive==='dialog') { if (tabActive === 'dialog') {
return loadDialogs > 0 || dialogSearchLoad > 0 return loadDialogs > 0 || dialogSearchLoad > 0
} else { } else {
return contactsLoad > 0 return contactsLoad > 0
@ -696,7 +696,7 @@ export default {
return return
} }
this.$nextTick(_ => { this.$nextTick(_ => {
$A.scrollToView(this.$refs.navList?.querySelector('.active'), { behavior: "auto", block: "nearest", inline: "nearest" }); $A.scrollToView(this.$refs.navList?.querySelector('.active'), {behavior: "auto", block: "nearest", inline: "nearest"});
}) })
}, },
@ -895,7 +895,7 @@ export default {
}).then(({data}) => { }).then(({data}) => {
const msgIds = []; const msgIds = [];
const lists = []; const lists = [];
this.dialogList.forEach(h=>{ this.dialogList.forEach(h => {
lists.push(h); lists.push(h);
msgIds.push(h.search_msg_id) msgIds.push(h.search_msg_id)
}); });
@ -989,7 +989,7 @@ export default {
formatDraft(value) { formatDraft(value) {
return value?.replace(/<img[^>]*>/gi, `[${$A.L('图片')}]`) return value?.replace(/<img[^>]*>/gi, `[${$A.L('图片')}]`)
.replace(/<[^>]*>/g, '') .replace(/<[^>]*>/g, '')
.replace(/&nbsp;/g, ' ')|| null .replace(/&nbsp;/g, ' ') || null
}, },
formatTodoNum(num) { formatTodoNum(num) {
@ -1004,7 +1004,7 @@ export default {
}, },
showProfessionDesc(dialog_user) { showProfessionDesc(dialog_user) {
if (dialog_user) { if (dialog_user && dialog_user.profession) {
return `[${dialog_user.profession}]` return `[${dialog_user.profession}]`
} }
return '' return ''

View File

@ -877,6 +877,7 @@ body.window-portrait {
margin-right: 4px; margin-right: 4px;
} }
> em { > em {
display: inline-block;
margin-right: 4px; margin-right: 4px;
cursor: pointer; cursor: pointer;
color: #2b85e4; color: #2b85e4;