mirror of https://gitee.com/karson/fastadmin.git
【新增】表格div.pre启用slimScroll美化滚动条
【新增】五等分栅格布局 【优化】上传组件记录extparam参数 【优化】crud生成表单样式调整 【优化】nice-validator样式调整pull/71/head
parent
20a5be0094
commit
8074c83bbf
|
|
@ -454,6 +454,7 @@ class Crud extends Command
|
||||||
//循环所有字段,开始构造视图的HTML和JS信息
|
//循环所有字段,开始构造视图的HTML和JS信息
|
||||||
foreach ($columnList as $k => $v) {
|
foreach ($columnList as $k => $v) {
|
||||||
$field = $v['COLUMN_NAME'];
|
$field = $v['COLUMN_NAME'];
|
||||||
|
$langField = mb_ucfirst($field);
|
||||||
$itemArr = [];
|
$itemArr = [];
|
||||||
// 这里构建Enum和Set类型的列表数据
|
// 这里构建Enum和Set类型的列表数据
|
||||||
if (in_array($v['DATA_TYPE'], ['enum', 'set', 'tinyint'])) {
|
if (in_array($v['DATA_TYPE'], ['enum', 'set', 'tinyint'])) {
|
||||||
|
|
@ -509,6 +510,7 @@ class Crud extends Command
|
||||||
$formEditElement = $this->getReplacedStub('html/select', ['field' => $field, 'fieldName' => $fieldName, 'fieldList' => $this->getFieldListName($field), 'attrStr' => Form::attributes($attrArr), 'selectedValue' => "\$row.{$field}"]);
|
$formEditElement = $this->getReplacedStub('html/select', ['field' => $field, 'fieldName' => $fieldName, 'fieldList' => $this->getFieldListName($field), 'attrStr' => Form::attributes($attrArr), 'selectedValue' => "\$row.{$field}"]);
|
||||||
} else if ($inputType == 'datetime') {
|
} else if ($inputType == 'datetime') {
|
||||||
$cssClassArr[] = 'datetimepicker';
|
$cssClassArr[] = 'datetimepicker';
|
||||||
|
$attrArr['placeholder'] = "{:__('Please select')}{:__('{$langField}')}";
|
||||||
$attrArr['class'] = implode(' ', $cssClassArr);
|
$attrArr['class'] = implode(' ', $cssClassArr);
|
||||||
$format = "YYYY-MM-DD HH:mm:ss";
|
$format = "YYYY-MM-DD HH:mm:ss";
|
||||||
$phpFormat = "Y-m-d H:i:s";
|
$phpFormat = "Y-m-d H:i:s";
|
||||||
|
|
@ -564,6 +566,7 @@ class Crud extends Command
|
||||||
$formEditElement = $this->getReplacedStub('html/' . $inputType, ['field' => $field, 'fieldName' => $fieldName, 'fieldList' => $this->getFieldListName($field), 'attrStr' => Form::attributes($attrArr), 'selectedValue' => "\$row.{$field}"]);
|
$formEditElement = $this->getReplacedStub('html/' . $inputType, ['field' => $field, 'fieldName' => $fieldName, 'fieldList' => $this->getFieldListName($field), 'attrStr' => Form::attributes($attrArr), 'selectedValue' => "\$row.{$field}"]);
|
||||||
} else if ($inputType == 'textarea') {
|
} else if ($inputType == 'textarea') {
|
||||||
$cssClassArr[] = substr($field, -7) == 'content' ? $this->editorClass : '';
|
$cssClassArr[] = substr($field, -7) == 'content' ? $this->editorClass : '';
|
||||||
|
$attrArr['placeholder'] = "{:__('Please input')}{:__('{$langField}')}";
|
||||||
$attrArr['class'] = implode(' ', $cssClassArr);
|
$attrArr['class'] = implode(' ', $cssClassArr);
|
||||||
$attrArr['rows'] = 5;
|
$attrArr['rows'] = 5;
|
||||||
$formAddElement = Form::textarea($fieldName, $defaultValue, $attrArr);
|
$formAddElement = Form::textarea($fieldName, $defaultValue, $attrArr);
|
||||||
|
|
@ -583,17 +586,20 @@ class Crud extends Command
|
||||||
$formEditElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class' => 'control-label']), Form::checkbox($fieldName, $yes, 0, $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);
|
$formEditElement = str_replace('type="checkbox"', 'type="checkbox" {in name="' . "\$row.{$field}" . '" value="' . $yes . '"}checked{/in}', $formEditElement);
|
||||||
} else if ($inputType == 'citypicker') {
|
} else if ($inputType == 'citypicker') {
|
||||||
|
$attrArr['placeholder'] = "{:__('Please select')}{:__('{$langField}')}";
|
||||||
$attrArr['class'] = implode(' ', $cssClassArr);
|
$attrArr['class'] = implode(' ', $cssClassArr);
|
||||||
$attrArr['data-toggle'] = "city-picker";
|
$attrArr['data-toggle'] = "city-picker";
|
||||||
$formAddElement = sprintf("<div class='control-relative'>%s</div>", Form::input('text', $fieldName, $defaultValue, $attrArr));
|
$formAddElement = sprintf("<div class='control-relative'>%s</div>", Form::input('text', $fieldName, $defaultValue, $attrArr));
|
||||||
$formEditElement = sprintf("<div class='control-relative'>%s</div>", Form::input('text', $fieldName, $editValue, $attrArr));
|
$formEditElement = sprintf("<div class='control-relative'>%s</div>", Form::input('text', $fieldName, $editValue, $attrArr));
|
||||||
} else {
|
} else {
|
||||||
|
$attrArr['placeholder'] = "{:__('Please input')}{:__('{$langField}')}";
|
||||||
$search = $replace = '';
|
$search = $replace = '';
|
||||||
//特殊字段为关联搜索
|
//特殊字段为关联搜索
|
||||||
if ($this->isMatchSuffix($field, $this->selectpageSuffix)) {
|
if ($this->isMatchSuffix($field, $this->selectpageSuffix)) {
|
||||||
$inputType = 'text';
|
$inputType = 'text';
|
||||||
$defaultValue = '';
|
$defaultValue = '';
|
||||||
$attrArr['data-rule'] = 'required';
|
$attrArr['data-rule'] = 'required';
|
||||||
|
$attrArr['placeholder'] = "{:__('Please select')}{:__('{$langField}')}";
|
||||||
$cssClassArr[] = 'selectpage';
|
$cssClassArr[] = 'selectpage';
|
||||||
$selectpageController = str_replace('_', '/', substr($field, 0, strripos($field, '_')));
|
$selectpageController = str_replace('_', '/', substr($field, 0, strripos($field, '_')));
|
||||||
$attrArr['data-source'] = $selectpageController . "/index";
|
$attrArr['data-source'] = $selectpageController . "/index";
|
||||||
|
|
@ -1141,8 +1147,8 @@ EOD;
|
||||||
$langField = mb_ucfirst($field);
|
$langField = mb_ucfirst($field);
|
||||||
return <<<EOD
|
return <<<EOD
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="c-{$field}" class="control-label col-xs-12 col-sm-2">{:__('{$langField}')}:</label>
|
<label for="c-{$field}" class="control-label">{:__('{$langField}')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="pp_container">
|
||||||
{$content}
|
{$content}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
<form id="add-form" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
{%addList%}
|
{%addList%}
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer text-center">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<div class="pp_container text-center">
|
||||||
<div class="col-xs-12 col-sm-8">
|
|
||||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
<form id="edit-form" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
{%editList%}
|
{%editList%}
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<div class="pp_container text-center">
|
||||||
<div class="col-xs-12 col-sm-8">
|
|
||||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ class Ajax extends Backend
|
||||||
|
|
||||||
//判断是否已经存在附件
|
//判断是否已经存在附件
|
||||||
$sha1 = $file->hash();
|
$sha1 = $file->hash();
|
||||||
|
$extparam = $this->request->post();
|
||||||
|
|
||||||
$upload = Config::get('upload');
|
$upload = Config::get('upload');
|
||||||
|
|
||||||
|
|
@ -99,7 +100,7 @@ class Ajax extends Backend
|
||||||
$imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth;
|
$imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth;
|
||||||
$imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight;
|
$imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight;
|
||||||
}
|
}
|
||||||
$params = array(
|
$params = [
|
||||||
'filesize' => $fileInfo['size'],
|
'filesize' => $fileInfo['size'],
|
||||||
'imagewidth' => $imagewidth,
|
'imagewidth' => $imagewidth,
|
||||||
'imageheight' => $imageheight,
|
'imageheight' => $imageheight,
|
||||||
|
|
@ -110,13 +111,14 @@ class Ajax extends Backend
|
||||||
'uploadtime' => time(),
|
'uploadtime' => time(),
|
||||||
'storage' => 'local',
|
'storage' => 'local',
|
||||||
'sha1' => $sha1,
|
'sha1' => $sha1,
|
||||||
);
|
'extparam' => json_encode($extparam),
|
||||||
|
];
|
||||||
$attachment = model("attachment");
|
$attachment = model("attachment");
|
||||||
$attachment->data(array_filter($params));
|
$attachment->data(array_filter($params));
|
||||||
$attachment->save();
|
$attachment->save();
|
||||||
\think\Hook::listen("upload_after", $attachment);
|
\think\Hook::listen("upload_after", $attachment);
|
||||||
$this->success(__('Upload successful'), null, [
|
$this->success(__('Upload successful'), null, [
|
||||||
'url' => $uploadDir . $splInfo->getSaveName()
|
'url' => $uploadDir . $splInfo->getSaveName(),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// 上传失败获取错误信息
|
// 上传失败获取错误信息
|
||||||
|
|
@ -178,7 +180,7 @@ class Ajax extends Backend
|
||||||
$sour_value = $weighdata[$sour_id];
|
$sour_value = $weighdata[$sour_id];
|
||||||
//echo "移动的ID:{$sour_id}\n";
|
//echo "移动的ID:{$sour_id}\n";
|
||||||
//echo "替换的ID:{$desc_id}\n";
|
//echo "替换的ID:{$desc_id}\n";
|
||||||
$weighids = array();
|
$weighids = [];
|
||||||
$temp = array_values(array_diff_assoc($ids, $sour));
|
$temp = array_values(array_diff_assoc($ids, $sour));
|
||||||
foreach ($temp as $m => $n) {
|
foreach ($temp as $m => $n) {
|
||||||
if ($n == $sour_id) {
|
if ($n == $sour_id) {
|
||||||
|
|
@ -251,13 +253,10 @@ class Ajax extends Backend
|
||||||
public function area()
|
public function area()
|
||||||
{
|
{
|
||||||
$params = $this->request->get("row/a");
|
$params = $this->request->get("row/a");
|
||||||
if (!empty($params))
|
if (!empty($params)) {
|
||||||
{
|
|
||||||
$province = isset($params['province']) ? $params['province'] : '';
|
$province = isset($params['province']) ? $params['province'] : '';
|
||||||
$city = isset($params['city']) ? $params['city'] : null;
|
$city = isset($params['city']) ? $params['city'] : null;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$province = $this->request->get('province');
|
$province = $this->request->get('province');
|
||||||
$city = $this->request->get('city');
|
$city = $this->request->get('city');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -172,4 +172,6 @@ return [
|
||||||
'Rule tips' => '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过命令行进行生成规则节点',
|
'Rule tips' => '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过命令行进行生成规则节点',
|
||||||
'Test' => '测试',
|
'Test' => '测试',
|
||||||
'All' => '全部',
|
'All' => '全部',
|
||||||
|
'Please input' => '请填写',
|
||||||
|
'Please select' => '请选择',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,14 @@ html.ios-fix body {
|
||||||
table.table-template {
|
table.table-template {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.sp_container .msg-box {
|
.pp_container {
|
||||||
|
border: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.sp_container .msg-box,.pp_container .msg-box {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -811,3 +818,51 @@ form.form-horizontal .control-label {
|
||||||
.wipecache li a {
|
.wipecache li a {
|
||||||
color: #444444!important;
|
color: #444444!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.col-md-1-5 {
|
||||||
|
width: 20% !important;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.col-xs-1-5,.col-sm-1-5,.col-md-1-5,.col-lg-1-5 {
|
||||||
|
min-height: 1px;
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 15px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.col-sm-1-5 {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
.col-md-1-5 {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
.col-lg-1-5 {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div.pre {
|
||||||
|
display: block;
|
||||||
|
padding: 5px;
|
||||||
|
margin: 0 0 5px;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.42857143;
|
||||||
|
word-break: break-all;
|
||||||
|
word-wrap: break-word;
|
||||||
|
color: #333333;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -152,6 +152,11 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (table.find("div.pre").size() > 0) {
|
||||||
|
require(['slimscroll'], function () {
|
||||||
|
$('div.pre').slimScroll({width: '300px', height: '50px'});
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// 处理选中筛选框后按钮的状态统一变更
|
// 处理选中筛选框后按钮的状态统一变更
|
||||||
table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
|
table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
|
||||||
|
|
|
||||||
|
|
@ -147,10 +147,17 @@ html.ios-fix,html.ios-fix body {
|
||||||
table.table-template{
|
table.table-template{
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
.sp_container .msg-box{
|
.pp_container {
|
||||||
position: absolute;
|
border: none;
|
||||||
right: 0;
|
margin: 0;
|
||||||
top: 0;
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.sp_container .msg-box,.pp_container .msg-box {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
}
|
}
|
||||||
.toast-top-right-index{
|
.toast-top-right-index{
|
||||||
top:62px;
|
top:62px;
|
||||||
|
|
@ -852,3 +859,51 @@ form.form-horizontal .control-label {
|
||||||
.wipecache li a {
|
.wipecache li a {
|
||||||
color:#444444!important;
|
color:#444444!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.col-md-1-5 {
|
||||||
|
width: 20% !important;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.col-xs-1-5,.col-sm-1-5,.col-md-1-5,.col-lg-1-5 {
|
||||||
|
min-height: 1px;
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 15px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.col-sm-1-5 {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
.col-md-1-5 {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
.col-lg-1-5 {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div.pre {
|
||||||
|
display: block;
|
||||||
|
padding: 5px;
|
||||||
|
margin: 0 0 5px;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.42857143;
|
||||||
|
word-break: break-all;
|
||||||
|
word-wrap: break-word;
|
||||||
|
color: #333333;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue