Compare commits

..

No commits in common. "1a660364af6c3e047abf96e2c522a0eb0a42a860" and "7a4d05bbd951b9eb7c37361c3c36ee28a3c70a01" have entirely different histories.

20 changed files with 70 additions and 32570 deletions

View File

@ -931,6 +931,7 @@ class Crud extends Command
}
}
} catch (\Exception $e) {
}
if (!$selectpageField) {
foreach ($this->fieldSelectpageMap as $m => $n) {
@ -992,7 +993,7 @@ class Crud extends Command
}
if (!$fields || in_array($field, explode(',', $fields))) {
//构造JS列信息
$javascriptList[] = $this->getJsColumn($field, $v['DATA_TYPE'], $inputType && in_array($inputType, ['select', 'checkbox', 'radio']) ? '_text' : '', $itemArr, $v);
$javascriptList[] = $this->getJsColumn($field, $v['DATA_TYPE'], $inputType && in_array($inputType, ['select', 'checkbox', 'radio']) ? '_text' : '', $itemArr);
}
if ($this->headingFilterField && $this->headingFilterField == $field && $itemArr) {
$headingHtml = $this->getReplacedStub('html/heading-html', ['field' => $field, 'fieldName' => Loader::parseName($field, 1, false)]);
@ -1047,7 +1048,7 @@ class Crud extends Command
//过滤text类型字段
if ($v['DATA_TYPE'] != 'text') {
//构造JS列信息
$javascriptList[] = $this->getJsColumn($relationField, $v['DATA_TYPE'], '', [], $v);
$javascriptList[] = $this->getJsColumn($relationField, $v['DATA_TYPE']);
}
}
}
@ -1698,10 +1699,9 @@ EOD;
* @param string $datatype
* @param string $extend
* @param array $itemArr
* @param array $fieldConfig
* @return string
*/
protected function getJsColumn($field, $datatype = '', $extend = '', $itemArr = [], $fieldConfig)
protected function getJsColumn($field, $datatype = '', $extend = '', $itemArr = [])
{
$lang = mb_ucfirst($field);
$formatter = '';
@ -1739,7 +1739,7 @@ EOD;
$noSearchFiles = ['file$', 'files$', 'image$', 'images$', '^weigh$'];
if (preg_match("/" . implode('|', $noSearchFiles) . "/i", $field)) {
$html .= ", operate: false";
} elseif (in_array($datatype, ['varchar'])) {
} else if (in_array($datatype, ['varchar'])) {
$html .= ", operate: 'LIKE'";
}
@ -1751,10 +1751,6 @@ EOD;
if (in_array($datatype, ['set'])) {
$html .= ", operate:'FIND_IN_SET'";
}
if (isset($fieldConfig['CHARACTER_MAXIMUM_LENGTH']) && $fieldConfig['CHARACTER_MAXIMUM_LENGTH'] >= 255 && in_array($datatype, ['varchar']) && !$formatter) {
$formatter = 'content';
$html .= ", table: table, class: 'autocontent'";
}
if (in_array($formatter, ['image', 'images'])) {
$html .= ", events: Table.api.events.image";
}

View File

@ -5,6 +5,7 @@
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -5,6 +5,7 @@
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -423,7 +423,7 @@ CREATE TABLE `fa_test` (
-- Records of fa_test
-- ----------------------------
BEGIN;
INSERT INTO `fa_test` VALUES (1, 1, 1, 12, '12,13', '互联网,计算机', 'monday', 'hot,index', 'male', 'music,reading', '我是一篇测试文章', '<p>我是测试内容</p>', '/assets/img/avatar.png', '/assets/img/avatar.png,/assets/img/qrcode.png', '/assets/img/avatar.png', '关键字', '我是一篇测试文章描述,内容过多时将自动隐藏', '广西壮族自治区/百色市/平果县', '{\"a\":\"1\",\"b\":\"2\"}', '[{\"title\":\"标题一\",\"intro\":\"介绍一\",\"author\":\"小明\",\"age\":\"21\"}]', 0.00, 0, '2020-10-01 00:00:00 - 2021-10-31 23:59:59', '2017-07-10', '2017-07-10 18:24:45', 2017, '18:24:45', 1491635035, 1491635035, 1491635035, NULL, 0, 1, 'normal', '1');
INSERT INTO `fa_test` VALUES (1, 1, 1, 12, '12,13', '互联网,计算机', 'monday', 'hot,index', 'male', 'music,reading', '我是一篇测试文章', '<p>我是测试内容</p>', '/assets/img/avatar.png', '/assets/img/avatar.png,/assets/img/qrcode.png', '/assets/img/avatar.png', '关键字', '描述', '广西壮族自治区/百色市/平果县', '{\"a\":\"1\",\"b\":\"2\"}', '[{\"title\":\"标题一\",\"intro\":\"介绍一\",\"author\":\"小明\",\"age\":\"21\"}]', 0.00, 0, '2020-10-01 00:00:00 - 2021-10-31 23:59:59', '2017-07-10', '2017-07-10 18:24:45', 2017, '18:24:45', 1491635035, 1491635035, 1491635035, NULL, 0, 1, 'normal', '1');
COMMIT;
-- ----------------------------

View File

@ -39,7 +39,7 @@ if (!function_exists('build_radios')) {
$selected = is_null($selected) ? key($list) : $selected;
$selected = is_array($selected) ? $selected : explode(',', $selected);
foreach ($list as $k => $v) {
$html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::radio($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"]));
$html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::radio($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"]));
}
return '<div class="radio">' . implode(' ', $html) . '</div>';
}
@ -60,7 +60,7 @@ if (!function_exists('build_checkboxs')) {
$selected = is_null($selected) ? [] : $selected;
$selected = is_array($selected) ? $selected : explode(',', $selected);
foreach ($list as $k => $v) {
$html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::checkbox($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"]));
$html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::checkbox($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"]));
}
return '<div class="checkbox">' . implode(' ', $html) . '</div>';
}

View File

@ -14,6 +14,7 @@ return [
'Refresh addon cache' => '刷新插件缓存',
'Userinfo' => '会员信息',
'Reload authorization' => '刷新授权',
'Online store' => '在线商店',
'Local addon' => '本地插件',
'Conflict tips' => '此插件中发现和现有系统中部分文件发现冲突!以下文件将会被影响,请备份好相关文件后再继续操作',
'Pay tips' => '扫码支付后如果仍然无法安装,请不要重复支付,请稍后再重试安装!',
@ -23,7 +24,8 @@ return [
'Upgrade tips' => '确认升级<b>《%s》</b><p class="text-danger">1、请务必做好代码和数据库备份备份备份<br>2、升级后如出现冗余数据请根据需要移除即可!<br>3、不建议在生产环境升级请在本地完成升级测试</p>如有重要数据请备份后再操作!',
'Offline installed tips' => '安装成功!清除浏览器缓存和框架缓存后生效!',
'Online installed tips' => '安装成功!清除浏览器缓存和框架缓存后生效!',
'Please login and try to install' => '请登录FastAdmin后再进行本地安装',
'Not login tips' => '你当前未登录FastAdmin请登录后操作',
'Please login and try to install' => '请登录FastAdmin后再进行离线安装',
'Not installed tips' => '请安装后再访问插件前台页面!',
'Not enabled tips' => '插件已经禁用,请启用后再访问插件前台页面!',
'New version tips' => '发现新版本:%s 点击查看更新日志',
@ -76,6 +78,7 @@ return [
'Enable' => '启用',
'Your username or email' => '你的手机号、用户名或邮箱',
'Your password' => '你的密码',
'Login FastAdmin' => '登录',
'Login' => '登录',
'Logout' => '退出登录',
'Register' => '注册账号',

View File

@ -147,7 +147,7 @@ class Upload
$size = $matches ? $matches[1] : $this->config['maxsize'];
$type = $matches ? strtolower($matches[2]) : 'b';
$typeDict = ['b' => 0, 'k' => 1, 'kb' => 1, 'm' => 2, 'mb' => 2, 'gb' => 3, 'g' => 3];
$size = $size * pow(1024, $typeDict[$type] ?? 0);
$size = (int)($size * pow(1024, $typeDict[$type] ?? 0));
if ($this->fileInfo['size'] > $size) {
throw new UploadException(__(
'File is too big (%sMiB), Max filesize: %sMiB.',

View File

@ -1 +0,0 @@
页面未找到

View File

@ -42,7 +42,7 @@ return [
// 默认时区
'default_timezone' => 'PRC',
// 是否开启多语言
'lang_switch_on' => false,
'lang_switch_on' => true,
// 默认全局过滤方法 用逗号分隔多个
'default_filter' => '',
// 默认语言
@ -151,11 +151,6 @@ return [
// +----------------------------------------------------------------------
// 异常页面的模板文件
'exception_tmpl' => APP_PATH . 'common' . DS . 'view' . DS . 'tpl' . DS . 'think_exception.tpl',
// 自定义错误码模板
'http_exception_template' => [
// 定义404错误的模板渲染
// 404 => APP_PATH . 'common/view/tpl/404.tpl',
],
// 错误显示信息,非调试模式有效
'error_message' => '你所浏览的页面暂时无法访问',
// 显示错误信息

View File

@ -870,7 +870,7 @@ EOD;
$checked = is_array($checked) ? $checked : explode(',', $checked);
foreach ($list as $k => $v) {
$options['id'] = "{$name}-{$k}";
$html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::checkbox("{$name}[{$k}]", $k, in_array($k, $checked), $options));
$html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::checkbox("{$name}[{$k}]", $k, in_array($k, $checked), $options));
}
return '<div class="checkbox">' . implode(' ', $html) . '</div>';
}
@ -913,7 +913,7 @@ EOD;
$checked = is_array($checked) ? $checked : explode(',', $checked);
foreach ($list as $k => $v) {
$options['id'] = "{$name}-{$k}";
$html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::radio($name, $k, in_array($k, $checked), $options));
$html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::radio($name, $k, in_array($k, $checked), $options));
}
return '<div class="radio">' . implode(' ', $html) . '</div>';
}
@ -1002,8 +1002,8 @@ EOD;
{
$domname = str_replace(['[', ']', '.'], '', $name);
$options = [
'id' => "faupload-{$domname}",
'class' => "btn btn-danger faupload",
'id' => "plupload-{$domname}",
'class' => "btn btn-danger plupload",
'data-input-id' => "c-{$domname}",
];
$upload = $uploadAttr === false ? false : true;
@ -1023,7 +1023,7 @@ EOD;
}
$chooseBtn = $choose ? $this->button('<i class="fa fa-list"></i> ' . __('Choose'), array_merge($options, $chooseAttr)) : '';
$previewAttrHtml = $this->attributes($previewAttr);
$previewArea = $preview ? '<ul class="row list-inline faupload-preview" id="p-' . $domname . '" ' . $previewAttrHtml . '></ul>' : '';
$previewArea = $preview ? '<ul class="row list-inline plupload-preview" id="p-' . $domname . '" ' . $previewAttrHtml . '></ul>' : '';
$input = $this->text($name, $value, array_merge(['size' => 50, 'id' => "c-{$domname}"], $inputAttr));
$html = <<<EOD
<div class="input-group">

View File

@ -297,7 +297,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
Fast.api.ajax({
url: Config.api_url + '/user/logintpl',
type: 'post',
loading: false,
data: {
version: Config.faversion,
sid: Controller.api.sid()
@ -307,7 +306,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
content: Template.render(tpldata, {}),
zIndex: 99,
area: area,
title: __('Login'),
title: __('Login FastAdmin'),
resize: false,
btn: [__('Login')],
yes: function (index, layero) {
@ -609,8 +608,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
var uid = userinfo ? userinfo.id : 0;
if (parseInt(uid) === 0) {
$(".btn-userinfo").trigger("click", name, version);
return false;
return Layer.alert(__('Not login tips'), {
title: __('Warning'),
btn: [__('Login now')],
yes: function (index, layero) {
$(".btn-userinfo").trigger("click", name, version);
},
btn2: function () {
install(name, version, false);
}
});
}
install(name, version, false);
});

View File

@ -6,7 +6,7 @@ require.config({
main: 'moment'
}],
//在打包压缩时将会把include中的模块合并到主文件中
include: ['css', 'layer', 'toastr', 'fast', 'backend', 'backend-init', 'table', 'form', 'dragsort', 'addtabs', 'selectpage', 'bootstrap-daterangepicker'],
include: ['css', 'layer', 'toastr', 'fast', 'backend', 'backend-init', 'table', 'form', 'dragsort', 'addtabs', 'selectpage'],
paths: {
'lang': "empty:",
'form': 'require-form',
@ -63,7 +63,7 @@ require.config({
exports: '$.fn.bootstrapTable.defaults'
},
'bootstrap-table-export': {
deps: ['bootstrap-table'],
deps: ['bootstrap-table', 'tableexport'],
exports: '$.fn.bootstrapTable.defaults'
},
'bootstrap-table-fixed-columns': {

File diff suppressed because one or more lines are too long

View File

@ -128,11 +128,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
});
$(form).on("reset", function () {
setTimeout(function () {
$(".selectpage", form).each(function () {
var selectpage = $(this).data("selectPageObject");
selectpage.elem.hidden.val($(this).val());
$(this).selectPageRefresh();
});
$('.selectpage', form).selectPageClear();
}, 1);
});
}
@ -365,12 +361,6 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
return obj;
};
var fieldlist = $(".fieldlist", form);
//表单重置
form.on("reset", function () {
setTimeout(function () {
fieldlist.trigger("fa.event.refreshfieldlist");
});
});
//监听文本框改变事件
$(document).on('change keyup changed', ".fieldlist input,.fieldlist textarea,.fieldlist select", function () {
var container = $(this).closest(".fieldlist");
@ -488,11 +478,6 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
if ($("[data-role='tagsinput']", form).length > 0) {
require(['tagsinput', 'autocomplete'], function () {
$("[data-role='tagsinput']").tagsinput();
form.on("reset", function () {
setTimeout(function () {
$("[data-role='tagsinput']").tagsinput('reset');
}, 0);
});
});
}
},
@ -520,7 +505,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
'==': function(a, b) { return a == b; },
'!=': function(a, b) { return a != b; },
'in': function(a, b) { return b.split(/\,/).indexOf(a) > -1; },
'regex': function (a, b) {
'regex': function(a, b) {
var regParts = b.match(/^\/(.*?)\/([gim]*)$/);
var regexp = regParts ? new RegExp(regParts[1], regParts[2]) : new RegExp(b);
return regexp.test(a);

View File

@ -62,7 +62,7 @@ require.config({
exports: '$.fn.bootstrapTable.defaults'
},
'bootstrap-table-export': {
deps: ['bootstrap-table'],
deps: ['bootstrap-table', 'tableexport'],
exports: '$.fn.bootstrapTable.defaults'
},
'bootstrap-table-fixed-columns': {

File diff suppressed because one or more lines are too long

View File

@ -332,16 +332,6 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
}
$(Table.config.disabledbtn, toolbar).toggleClass('disabled', !options.selectedIds.length);
});
// 提交通用搜索时判断是否和Tabs筛选一致
table.on('common-search.bs.table', function (e, setting, query) {
var tabs = $('.panel-heading [data-field]', table.closest(".panel-intro"));
var field = tabs.data("field");
var value = $("li.active > a", tabs).data("value");
if (query.filter && typeof query.filter[field] !== 'undefined' && query.filter[field] != value) {
$("li", tabs).removeClass("active");
$("li > a[data-value='" + query.filter[field] + "']", tabs).parent().addClass("active");
}
});
// 绑定TAB事件
$('.panel-heading [data-field] a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) {
var field = $(this).closest("[data-field]").data("field");

View File

@ -398,11 +398,6 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined,
});
}
if (input_id) {
$("#" + input_id).closest("form").on("reset", function () {
setTimeout($.proxy(function () {
$("#" + input_id, this).trigger("change");
}, this), 0);
});
//粘贴上传、拖拽上传
$("body").on('paste drop', "#" + input_id, function (event) {
var originEvent = event.originalEvent;

File diff suppressed because one or more lines are too long

View File

@ -273,15 +273,6 @@
});
},
/**
* reset the items
*/
reset: function () {
var val = this.$element.val();
this.removeAll();
this.add(val);
},
/**
* Returns the items added as tags
*/