Compare commits

..

4 Commits

Author SHA1 Message Date
Karson feed46823f Merge branch 'develop' of gitee.com:karson/fastadmin into develop 2024-05-16 11:04:04 +08:00
Karson cc4c0ab3ed 优化后台参数传递 2024-05-16 10:58:47 +08:00
Karson ddccd51105 优化表格加载 2024-05-16 10:54:32 +08:00
Karson 6d82e89ff6 优化插件打包 2024-05-16 10:52:23 +08:00
3 changed files with 14 additions and 10 deletions

View File

@ -201,16 +201,20 @@ class Addon extends Command
new \RecursiveDirectoryIterator($addonDir), \RecursiveIteratorIterator::LEAVES_ONLY new \RecursiveDirectoryIterator($addonDir), \RecursiveIteratorIterator::LEAVES_ONLY
); );
$addonDir = str_replace(DS, '/', $addonDir);
$excludeDirRegex = "/\/(\.git|\.svn|\.vscode|\.idea|unpackage)\//i";
foreach ($files as $name => $file) { foreach ($files as $name => $file) {
if (!$file->isDir()) { $filePath = str_replace(DS, '/', $file->getPathname());
$filePath = $file->getRealPath(); if ($file->isDir() || preg_match($excludeDirRegex, $filePath))
$relativePath = str_replace(DS, '/', substr($filePath, strlen($addonDir))); continue;
if (!in_array($file->getFilename(), ['.git', '.DS_Store', 'Thumbs.db'])) { $relativePath = substr($filePath, strlen($addonDir));
$zip->addFile($filePath, $relativePath); if (!in_array($file->getFilename(), ['.DS_Store', 'Thumbs.db'])) {
} $zip->addFile($filePath, $relativePath);
} }
} }
$zip->close(); $zip->close();
$output->info("Package Resource Path:" . $addonFile);
$output->info("Package Successed!"); $output->info("Package Successed!");
break; break;
case 'move': case 'move':

View File

@ -268,13 +268,13 @@ class Backend extends Controller
$op = $this->request->get("op", '', 'trim'); $op = $this->request->get("op", '', 'trim');
$sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id'); $sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id');
$order = $this->request->get("order", "DESC"); $order = $this->request->get("order", "DESC");
$offset = $this->request->get("offset/d", 0); $offset = max(0, $this->request->get("offset/d", 0));
$limit = $this->request->get("limit/d", 0); $limit = max(0, $this->request->get("limit/d", 0));
$limit = $limit ?: 999999; $limit = $limit ?: 999999;
//新增自动计算页码 //新增自动计算页码
$page = $limit ? intval($offset / $limit) + 1 : 1; $page = $limit ? intval($offset / $limit) + 1 : 1;
if ($this->request->has("page")) { if ($this->request->has("page")) {
$page = $this->request->get("page/d", 1); $page = max(0, $this->request->get("page/d", 1));
} }
$this->request->get([config('paginate.var_page') => $page]); $this->request->get([config('paginate.var_page') => $page]);
$filter = (array)json_decode($filter, true); $filter = (array)json_decode($filter, true);

View File

@ -1,4 +1,4 @@
define(['jquery', 'bootstrap'], function ($, undefined) { define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-export', 'bootstrap-table-commonsearch', 'bootstrap-table-template', 'bootstrap-table-jumpto', 'bootstrap-table-fixed-columns'], function ($, undefined) {
var Table = { var Table = {
list: {}, list: {},
// Bootstrap-table 基础配置 // Bootstrap-table 基础配置