|
@@ -285,10 +285,12 @@ JS
|
|
|
->limit(config('admin.upload.oss_image.limit'))
|
|
|
->accept(config('admin.upload.oss_image.accept'))
|
|
|
->maxSize(config('admin.upload.oss_image.max_size'))
|
|
|
- ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ymd"))
|
|
|
+ ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ym"))
|
|
|
->saving(function ($images) use ($form) {
|
|
|
return json_encode($images);
|
|
|
});
|
|
|
+ })->tab(admin_trans_label('text_detail'), function (Form $form) {
|
|
|
+ $form->editor('text_detail',admin_trans_label('text_detail'));
|
|
|
})->tab(admin_trans_label('en_detail'), function (Form $form) {
|
|
|
$form->multipleImage('en_detail')
|
|
|
->retainable()//禁止删OSS图
|
|
@@ -299,7 +301,7 @@ JS
|
|
|
->limit(config('admin.upload.oss_image.limit'))
|
|
|
->accept(config('admin.upload.oss_image.accept'))
|
|
|
->maxSize(config('admin.upload.oss_image.max_size'))
|
|
|
- ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ymd"))
|
|
|
+ ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ym"))
|
|
|
->saving(function ($images) use ($form) {
|
|
|
return json_encode($images);
|
|
|
});
|
|
@@ -313,7 +315,7 @@ JS
|
|
|
->limit(config('admin.upload.oss_image.limit'))
|
|
|
->accept(config('admin.upload.oss_image.accept'))
|
|
|
->maxSize(config('admin.upload.oss_image.max_size'))
|
|
|
- ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ymd"))
|
|
|
+ ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ym"))
|
|
|
->saving(function ($images) use ($form) {
|
|
|
return json_encode($images);
|
|
|
});
|
|
@@ -343,7 +345,7 @@ JS
|
|
|
->downloadable()
|
|
|
->accept(config('admin.upload.oss_video.accept'))
|
|
|
->maxSize(config('admin.upload.oss_video.max_size'))
|
|
|
- ->dir(config("admin.upload.directory.video").'/uploads/'.date("Ymd"))
|
|
|
+ ->dir(config("admin.upload.directory.video").'/uploads/'.date("Ym"))
|
|
|
->chunkSize(1024)
|
|
|
->required();
|
|
|
})->useTable()
|
|
@@ -368,7 +370,7 @@ JS
|
|
|
->limit(config('admin.upload.oss_image.limit'))
|
|
|
->accept(config('admin.upload.oss_image.accept'))
|
|
|
->maxSize(config('admin.upload.oss_image.max_size'))
|
|
|
- ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ymd"))
|
|
|
+ ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ym"))
|
|
|
->saving(function ($images) use ($form) {
|
|
|
return json_encode($images);
|
|
|
});
|
|
@@ -382,7 +384,7 @@ JS
|
|
|
->limit(config('admin.upload.oss_image.limit'))
|
|
|
->accept(config('admin.upload.oss_image.accept'))
|
|
|
->maxSize(config('admin.upload.oss_image.max_size'))
|
|
|
- ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ymd"))
|
|
|
+ ->dir(config("admin.upload.directory.image").'/uploads/'.date("Ym"))
|
|
|
->saving(function ($images) use ($form) {
|
|
|
return json_encode($images);
|
|
|
});
|
|
@@ -398,7 +400,7 @@ JS
|
|
|
->downloadable()
|
|
|
->accept(config('admin.upload.oss_pdf.accept'))
|
|
|
->maxSize(config('admin.upload.oss_pdf.max_size'))
|
|
|
- ->dir(config("admin.upload.directory.pdf").'/uploads/'.date("Ymd"))
|
|
|
+ ->dir(config("admin.upload.directory.pdf").'/uploads/'.date("Ym"))
|
|
|
->chunkSize(1024)
|
|
|
->required();
|
|
|
})->useTable()
|
|
@@ -442,7 +444,7 @@ JS
|
|
|
{
|
|
|
$disk = $this->disk('oss');
|
|
|
$newName = uniqueCode("video_cover_").$imgType;
|
|
|
- $dir = config("admin.upload.directory.image").'/uploads/'.date("Ymd").'/'.$newName;
|
|
|
+ $dir = config("admin.upload.directory.image").'/uploads/'.date("Ym").'/'.$newName;
|
|
|
$contents = file_get_contents($file);
|
|
|
if (!$contents) {
|
|
|
return ['status'=>false,'msg'=>'图片上传失败,请检查PHP配置'];
|
|
@@ -453,6 +455,13 @@ JS
|
|
|
|
|
|
private function formAddJS() {
|
|
|
$folderTabs = SiteAlbumFolder::getAllFolderTabs();
|
|
|
+ $album_tabs = config('dictionary.album_tabs');
|
|
|
+
|
|
|
+ foreach ($folderTabs as $key => $value) {
|
|
|
+ foreach ($value as $k => $v) {
|
|
|
+ $folderTabs[$key][$k] = admin_trans_label($album_tabs[$v]);
|
|
|
+ }
|
|
|
+ }
|
|
|
$folderTabs = json_encode($folderTabs);
|
|
|
//以下JS作用:1.点击列表时,把folder_id参数传递给表单 2.切换文件夹时,显示隐藏相应的tab
|
|
|
Admin::script(
|
|
@@ -490,7 +499,8 @@ function showHideTabs(fid) {
|
|
|
const folderIdValue = fid;
|
|
|
// 获取当前 folderIdValue 对应的标签索引
|
|
|
const tabIndexes = folderTabs[folderIdValue];
|
|
|
- //console.log(tabIndexes);
|
|
|
+
|
|
|
+ console.log(tabIndexes);
|
|
|
|
|
|
if (tabIndexes) {
|
|
|
// 处理上方的 <li>,限定在 .nav-tabs 内
|
|
@@ -500,8 +510,19 @@ function showHideTabs(fid) {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- tabIndexes.forEach(function(index) {
|
|
|
- $('.nav-tabs .nav-item:eq(' + (Number(index) + 1) + ')').show(); // 使用字符串拼接
|
|
|
+
|
|
|
+
|
|
|
+ $('.nav-tabs .nav-item').each(function() {
|
|
|
+ const navItem = $(this);
|
|
|
+ const navLink = navItem.find('.nav-link');
|
|
|
+
|
|
|
+ // 获取清理后的导航文本(包含处理空格和特殊字符)
|
|
|
+ const tabText = navLink.clone().children().remove().end().text().trim();
|
|
|
+
|
|
|
+ // 逻辑判断与显示控制
|
|
|
+ if (tabIndexes.includes(tabText)) {
|
|
|
+ navItem.show(); // 显式设置显示
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
}
|