mirror of https://gitee.com/karson/fastadmin.git
Merge remote-tracking branch 'karson/master'
# Conflicts: # bower.json # public/assets/css/backend.css # public/assets/js/require-form.jspull/71/head
commit
05219af9f8
|
|
@ -606,11 +606,9 @@ class Crud extends Command
|
|||
if (!$itemArr) {
|
||||
$itemArr = [$yes => 'Yes', $no => 'No'];
|
||||
}
|
||||
$formAddElement = $formEditElement = Form::hidden($fieldName, $no, array_merge(['checked' => ''], $attrArr));
|
||||
$attrArr['id'] = $fieldName . "-switch";
|
||||
$formAddElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class' => 'control-label']), Form::checkbox($fieldName, $yes, $defaultValue === $yes, $attrArr));
|
||||
$formEditElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class' => 'control-label']), Form::checkbox($fieldName, $yes, 0, $attrArr));
|
||||
$formEditElement = str_replace('type="checkbox"', 'type="checkbox" {in name="' . "\$row.{$field}" . '" value="' . $yes . '"}checked{/in}', $formEditElement);
|
||||
$stateNoClass = 'fa-flip-horizontal text-gray';
|
||||
$formAddElement = $this->getReplacedStub('html/' . $inputType, ['field' => $field, 'fieldName' => $fieldName, 'fieldYes' => $yes, 'fieldNo' => $no, 'attrStr' => Form::attributes($attrArr), 'fieldValue' => $defaultValue, 'fieldSwitchClass' => $defaultValue == $no ? $stateNoClass : '']);
|
||||
$formEditElement = $this->getReplacedStub('html/' . $inputType, ['field' => $field, 'fieldName' => $fieldName, 'fieldYes' => $yes, 'fieldNo' => $no, 'attrStr' => Form::attributes($attrArr), 'fieldValue' => "{\$row.{$field}}", 'fieldSwitchClass' => "{eq name=\"\$row.{$field}\" value=\"{$no}\"}fa-flip-horizontal text-gray{/eq}"]);
|
||||
} else if ($inputType == 'citypicker') {
|
||||
$attrArr['placeholder'] = "{:__('Please select')}{:__('{$langField}')}";
|
||||
$attrArr['class'] = implode(' ', $cssClassArr);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ return [
|
|||
'Flag' => '标志',
|
||||
'Drag to sort' => '拖动进行排序',
|
||||
'Redirect now' => '立即跳转',
|
||||
'Key' => '键',
|
||||
'Value' => '值',
|
||||
'Common search' => '普通搜索',
|
||||
'Search %s' => '搜索 %s',
|
||||
'View %s' => '查看 %s',
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace app\common\behavior;
|
|||
|
||||
use think\Config;
|
||||
use think\Lang;
|
||||
use think\Loader;
|
||||
|
||||
class Common
|
||||
{
|
||||
|
|
@ -57,6 +58,8 @@ class Common
|
|||
{
|
||||
\think\Cookie::set('think_var', $request->get('lang'));
|
||||
}
|
||||
// Form别名
|
||||
class_alias('fast\\Form', 'Form');
|
||||
}
|
||||
|
||||
public function addonBegin(&$request)
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ return [
|
|||
//自动检测更新
|
||||
'checkupdate' => false,
|
||||
//版本号
|
||||
'version' => '1.0.0.20180618_beta',
|
||||
'version' => '1.0.0.20180630_beta',
|
||||
//API接口地址
|
||||
'api_url' => 'https://api.fastadmin.net',
|
||||
],
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
"bootstrap-table": "~1.11.0",
|
||||
"layer": "^3.0",
|
||||
"jstree": "~3.3.2",
|
||||
"moment": "^2.20.1",
|
||||
"moment": "~2.15.2",
|
||||
"plupload": "~2.2.0",
|
||||
"toastr": "~2.1.3",
|
||||
"jcrop": "~2.0.4",
|
||||
|
|
@ -33,9 +33,7 @@
|
|||
"fastadmin-dragsort": "~1.0.0",
|
||||
"fastadmin-addtabs": "~1.0.0",
|
||||
"fastadmin-selectpage": "~1.0.0",
|
||||
"fastadmin-layer": "~3.1.2",
|
||||
"bootstrap-slider": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"jspdf": "1.1.239 || 1.3.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1372
extend/fast/Form.php
1372
extend/fast/Form.php
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,7 @@
|
|||
@import url("../css/iconfont.css");
|
||||
@import url("../libs/font-awesome/css/font-awesome.min.css");
|
||||
@import url("../libs/toastr/toastr.min.css");
|
||||
@import url("../libs/layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/fastadmin-layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css");
|
||||
@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css");
|
||||
@import url("../libs/bootstrap-daterangepicker/daterangepicker.css");
|
||||
|
|
@ -106,10 +106,6 @@ html.ios-fix body {
|
|||
margin-bottom: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
/* 包裹在layer外层 */
|
||||
.layer-footer {
|
||||
display: none;
|
||||
}
|
||||
table.table-template {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
@ -173,6 +169,9 @@ table.table-template {
|
|||
.is-dialog #main {
|
||||
background: #fff;
|
||||
}
|
||||
.is-dialog .layer-footer {
|
||||
display: none;
|
||||
}
|
||||
form.form-horizontal .control-label {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
|
@ -872,13 +871,13 @@ table.table-nowrap thead > tr > th {
|
|||
}
|
||||
.layui-layer-fast-msg {
|
||||
min-width: 100px;
|
||||
border-radius: 2px;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
color: #fff;
|
||||
}
|
||||
.layui-layer-fast-msg .layui-layer-content {
|
||||
padding: 12px 25px;
|
||||
text-align: center;
|
||||
.layui-layer-fast-tab .layui-layer-title .layui-this {
|
||||
color: #333;
|
||||
}
|
||||
.layui-layer-fast-tab .layui-layer-content .layui-layer-tabmain {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.n-bootstrap .input-group > .n-right {
|
||||
position: absolute;
|
||||
|
|
@ -1044,4 +1043,13 @@ div.pre {
|
|||
#add-form .panel-body,#edit-form .panel-body{
|
||||
padding-bottom:0;
|
||||
}
|
||||
|
||||
/*修正开关关闭下的颜色值*/
|
||||
.btn-switcher.disabled {
|
||||
opacity: .6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.btn-switcher .text-gray {
|
||||
color: #d2d6de !important;
|
||||
}
|
||||
/*# sourceMappingURL=../css/backend.css.map */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -3,7 +3,7 @@
|
|||
@import url("../css/iconfont.css");
|
||||
@import url("../libs/font-awesome/css/font-awesome.min.css");
|
||||
@import url("../libs/toastr/toastr.min.css");
|
||||
@import url("../libs/layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/fastadmin-layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/bootstrap-daterangepicker/daterangepicker.css");
|
||||
@import url("../libs/nice-validator/dist/jquery.validator.css");
|
||||
html,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -179,14 +179,15 @@
|
|||
if (obj.size() == 0)
|
||||
return true;
|
||||
var vObjCol = ColumnsForSearch[i];
|
||||
var process = !that.options.searchFormTemplate && vObjCol && typeof vObjCol.process == 'function' ? vObjCol.process : null;
|
||||
if (obj.size() > 1) {
|
||||
if (/BETWEEN$/.test(sym)) {
|
||||
var value_begin = $.trim($("[name='" + name + "']:first", that.$commonsearch).val()),
|
||||
value_end = $.trim($("[name='" + name + "']:last", that.$commonsearch).val());
|
||||
if (value_begin.length || value_end.length) {
|
||||
if (typeof vObjCol.process === 'function') {
|
||||
value_begin = vObjCol.process(value_begin, 'begin');
|
||||
value_end = vObjCol.process(value_end, 'end');
|
||||
if (process) {
|
||||
value_begin = process(value_begin, 'begin');
|
||||
value_end = process(value_end, 'end');
|
||||
}
|
||||
value = value_begin + ',' + value_end;
|
||||
} else {
|
||||
|
|
@ -198,10 +199,10 @@
|
|||
}
|
||||
} else {
|
||||
value = $("[name='" + name + "']:checked", that.$commonsearch).val();
|
||||
value = (vObjCol && typeof vObjCol.process === 'function') ? vObjCol.process(value) : value;
|
||||
value = process ? process(value) : value;
|
||||
}
|
||||
} else {
|
||||
value = (vObjCol && typeof vObjCol.process === 'function') ? vObjCol.process(obj.val()) : obj.val();
|
||||
value = process ? process(obj.val()) : obj.val();
|
||||
}
|
||||
if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ require.config({
|
|||
'plupload': '../libs/plupload/js/plupload.min',
|
||||
'toastr': '../libs/toastr/toastr',
|
||||
'jstree': '../libs/jstree/dist/jstree.min',
|
||||
'layer': '../libs/layer/dist/layer',
|
||||
'layer': '../libs/fastadmin-layer/dist/layer',
|
||||
'cookie': '../libs/jquery.cookie/jquery.cookie',
|
||||
'cxselect': '../libs/fastadmin-cxselect/js/jquery.cxselect',
|
||||
'template': '../libs/art-template/dist/template-native',
|
||||
|
|
@ -111,7 +111,7 @@ require.config({
|
|||
deps: ['../libs/plupload/js/moxie.min'],
|
||||
exports: "plupload"
|
||||
},
|
||||
// 'layer': ['css!../libs/layer/dist/theme/default/layer.css'],
|
||||
// 'layer': ['css!../libs/fastadmin-layer/dist/theme/default/layer.css'],
|
||||
// 'validator-core': ['css!../libs/nice-validator/dist/jquery.validator.css'],
|
||||
'validator-lang': ['validator-core'],
|
||||
// 'selectpage': ['css!../libs/fastadmin-selectpage/selectpage.css'],
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -422,7 +422,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
|||
ranges: ranges,
|
||||
};
|
||||
var origincallback = function (start, end) {
|
||||
$(this.element).val(start.format(options.locale.format) + " - " + end.format(options.locale.format));
|
||||
$(this.element).val(start.format(this.locale.format) + " - " + end.format(this.locale.format));
|
||||
$(this.element).trigger('blur');
|
||||
};
|
||||
$(".datetimerange", form).each(function () {
|
||||
|
|
@ -577,6 +577,28 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
|||
});
|
||||
}
|
||||
},
|
||||
switcher: function (form) {
|
||||
form.on("click", "[data-toggle='switcher']", function () {
|
||||
if ($(this).hasClass("disabled")) {
|
||||
return false;
|
||||
}
|
||||
var input = $(this).prev("input");
|
||||
input = $(this).data("input-id") ? $("#" + $(this).data("input-id")) : input;
|
||||
if (input.size() > 0) {
|
||||
var yes = $(this).data("yes");
|
||||
var no = $(this).data("no");
|
||||
if (input.val() == yes) {
|
||||
input.val(no);
|
||||
$("i", this).addClass("fa-flip-horizontal text-gray");
|
||||
} else {
|
||||
input.val(yes);
|
||||
$("i", this).removeClass("fa-flip-horizontal text-gray");
|
||||
}
|
||||
input.trigger('change');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
},
|
||||
bindevent: function (form) {
|
||||
|
||||
},
|
||||
|
|
@ -693,6 +715,8 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
|||
events.fieldlist(form);
|
||||
|
||||
events.slider(form);
|
||||
|
||||
events.switcher(form);
|
||||
},
|
||||
custom: {}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ require.config({
|
|||
'plupload': '../libs/plupload/js/plupload.min',
|
||||
'toastr': '../libs/toastr/toastr',
|
||||
'jstree': '../libs/jstree/dist/jstree.min',
|
||||
'layer': '../libs/layer/dist/layer',
|
||||
'layer': '../libs/fastadmin-layer/dist/layer',
|
||||
'cookie': '../libs/jquery.cookie/jquery.cookie',
|
||||
'cxselect': '../libs/fastadmin-cxselect/js/jquery.cxselect',
|
||||
'template': '../libs/art-template/dist/template-native',
|
||||
|
|
@ -110,7 +110,7 @@ require.config({
|
|||
deps: ['../libs/plupload/js/moxie.min'],
|
||||
exports: "plupload"
|
||||
},
|
||||
// 'layer': ['css!../libs/layer/dist/theme/default/layer.css'],
|
||||
// 'layer': ['css!../libs/fastadmin-layer/dist/theme/default/layer.css'],
|
||||
// 'validator-core': ['css!../libs/nice-validator/dist/jquery.validator.css'],
|
||||
'validator-lang': ['validator-core'],
|
||||
// 'selectpage': ['css!../libs/fastadmin-selectpage/selectpage.css'],
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -9,7 +9,7 @@
|
|||
@import url("../css/iconfont.css");
|
||||
@import url("../libs/font-awesome/css/font-awesome.min.css");
|
||||
@import url("../libs/toastr/toastr.min.css");
|
||||
@import url("../libs/layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/fastadmin-layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css");
|
||||
@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css");
|
||||
@import url("../libs/bootstrap-daterangepicker/daterangepicker.css");
|
||||
|
|
@ -134,11 +134,6 @@ html.ios-fix, html.ios-fix body {
|
|||
padding: 10px;
|
||||
}
|
||||
|
||||
/* 包裹在layer外层 */
|
||||
.layer-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.table-template {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
@ -207,6 +202,9 @@ table.table-template {
|
|||
#main {
|
||||
background: #fff;
|
||||
}
|
||||
.layer-footer {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
form.form-horizontal .control-label {
|
||||
|
|
@ -556,7 +554,7 @@ form.form-horizontal .control-label {
|
|||
margin-top: 0;
|
||||
}
|
||||
.treeview-menu > li > a {
|
||||
font-size:inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -964,12 +962,18 @@ table.table-nowrap {
|
|||
|
||||
.layui-layer-fast-msg {
|
||||
min-width: 100px;
|
||||
border-radius: 2px;
|
||||
background-color: rgba(0, 0, 0, .6);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.layui-layer-fast-tab {
|
||||
.layui-layer-title {
|
||||
.layui-this {
|
||||
color:#333;
|
||||
}
|
||||
}
|
||||
.layui-layer-content {
|
||||
padding: 12px 25px;
|
||||
text-align: center;
|
||||
.layui-layer-tabmain {
|
||||
margin:0;padding:0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1115,4 +1119,15 @@ table.table-nowrap {
|
|||
|
||||
.wipecache li a {
|
||||
color: #444444 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/*修正开关关闭下的颜色值*/
|
||||
.btn-switcher {
|
||||
&.disabled {
|
||||
opacity: .6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.text-gray {
|
||||
color: #d2d6de !important;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@import url("../css/iconfont.css");
|
||||
@import url("../libs/font-awesome/css/font-awesome.min.css");
|
||||
@import url("../libs/toastr/toastr.min.css");
|
||||
@import url("../libs/layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/fastadmin-layer/dist/theme/default/layer.css");
|
||||
@import url("../libs/bootstrap-daterangepicker/daterangepicker.css");
|
||||
@import url("../libs/nice-validator/dist/jquery.validator.css");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue