Compare commits

..

7 Commits

Author SHA1 Message Date
Karson b72b5605e5 Merge branch 'develop' of gitee.com:karson/fastadmin into develop 2024-06-18 16:06:14 +08:00
Karson db8739670c 修复autocomplete选中后未触发验证的问题
修复Table.api.formatter.file无法渲染的问题
2024-06-18 16:05:57 +08:00
Karson e7c96a994b
!410 修复iframe打开窗口时链接内问号重复的问题以及附件选择组件在未添加ID时无法正常响应
Merge pull request !410 from AriFe.Liu/develop
2024-06-18 07:39:11 +00:00
Karson c4499a3266
!414 修复Crud.php删除时抛出table not found异常问题
Merge pull request !414 from 苏小马/develop
2024-06-18 07:34:54 +00:00
苏小马 fb5972dd2c
update application/admin/command/Crud.php.
问题:删除模式时不需要强制读取数据表,如果在删除前已手动删除数据表,将抛出异常“table not found”导致删除失败

修复:增加删除模式判断,如果是删除模式,无需读取数据表

Signed-off-by: 苏小马 <179906767@qq.com>
2022-09-09 03:23:40 +00:00
AriFe.Liu 34e4c6c1e5
修复iframe打开窗口时链接内问号重复的问题
如果在添加菜单时, 在规则或URL中追加了 ? , 则会导致在刷新这个标签页时, 请求链接中使用了两个问号导致参数取出错误, 此处原本追加的?addtabs=1未做判断.

Signed-off-by: AriFe.Liu <88468560@qq.com>
2022-08-13 03:46:36 +00:00
AriFe.Liu bf6c4590ee
修复附件选择组件因没有id导致无法响应事件的bug
该问题曾导致附件选择组件在没有添加ID时造成无法正常响应回调事件
官方文档: https://doc.fastadmin.net/doc/183.html 附件选择 中, 示例及文档均未提及添加了faselect的组件必须添加id
如非bug而有意为之, 请修改官方文档说明, 告知用户添加了faselect的标签必须同时添加ID才能正确处理回调.
2022-06-27 03:27:27 +00:00
4 changed files with 19 additions and 12 deletions

View File

@ -435,16 +435,19 @@ class Crud extends Command
$modelName = $table = stripos($table, $prefix) === 0 ? substr($table, strlen($prefix)) : $table;
$modelTableType = 'table';
$modelTableTypeName = $modelTableName = $modelName;
$modelTableInfo = $dbconnect->query("SHOW TABLE STATUS LIKE '{$modelTableName}'", [], true);
if (!$modelTableInfo) {
$modelTableType = 'name';
$modelTableName = $prefix . $modelName;
$modelTableInfo = null;
if (!$input->getOption('delete')) {
$modelTableInfo = $dbconnect->query("SHOW TABLE STATUS LIKE '{$modelTableName}'", [], true);
if (!$modelTableInfo) {
throw new Exception("table not found");
$modelTableType = 'name';
$modelTableName = $prefix . $modelName;
$modelTableInfo = $dbconnect->query("SHOW TABLE STATUS LIKE '{$modelTableName}'", [], true);
if (!$modelTableInfo) {
throw new Exception("table not found");
}
}
$modelTableInfo = $modelTableInfo[0];
}
$modelTableInfo = $modelTableInfo[0];
$relations = [];
//检查关联表
@ -1081,7 +1084,7 @@ class Crud extends Command
}
//表注释
$tableComment = $modelTableInfo['Comment'];
$tableComment = $modelTableInfo ? $modelTableInfo['Comment'] : '';
$tableComment = mb_substr($tableComment, -1) == '表' ? mb_substr($tableComment, 0, -1) . '管理' : $tableComment;
$modelInit = '';

View File

@ -28,12 +28,12 @@
<div class="content-wrapper tab-content tab-addtabs">
{if $fixedmenu}
<div role="tabpanel" class="tab-pane {:$referermenu?'':'active'}" id="con_{$fixedmenu.id}">
<iframe src="{$fixedmenu.url}?addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
<iframe src="{$fixedmenu.url}{:stripos($fixedmenu.url, '?') !== false ? '&' : '?'}addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
</div>
{/if}
{if $referermenu}
<div role="tabpanel" class="tab-pane active" id="con_{$referermenu.id}">
<iframe src="{$referermenu.url}?addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
<iframe src="{$referermenu.url}{:stripos($referermenu.url, '?') !== false ? '&' : '?'}addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
</div>
{/if}
</div>

View File

@ -265,7 +265,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
var url = $(this).data("url") ? $(this).data("url") : (typeof Backend !== 'undefined' ? "general/attachment/select" : "user/attachment");
parent.Fast.api.open(url + "?element_id=" + $(this).attr("id") + "&multiple=" + multiple + "&mimetype=" + mimetype + "&admin_id=" + admin_id + "&user_id=" + user_id, __('Choose'), {
callback: function (data) {
var button = $("#" + $(that).attr("id"));
var button = $(that);
var maxcount = $(button).data("maxcount");
var input_id = $(button).data("input-id") ? $(button).data("input-id") : "";
maxcount = typeof maxcount !== "undefined" ? maxcount : 0;
@ -510,7 +510,11 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
autocomplete: function (form) {
if ($("[data-role='autocomplete']", form).length > 0) {
require(['autocomplete'], function () {
$("[data-role='autocomplete']").autocomplete();
$("[data-role='autocomplete']").autocomplete({
onSelect: function () {
$(this).trigger('change').trigger('validate');
}
});
});
}
},

View File

@ -753,7 +753,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
return html.join(' ');
},
file: function (value, row, index) {
Table.api.formatter.files.call(this, value, row, index);
return Table.api.formatter.files.call(this, value, row, index);
},
files: function (value, row, index) {
value = value == null || value.length === 0 ? '' : value.toString();