mirror of https://gitee.com/karson/fastadmin.git
Compare commits
5 Commits
56253711b7
...
32329947a3
| Author | SHA1 | Date |
|---|---|---|
|
|
32329947a3 | |
|
|
1ed0a1395c | |
|
|
8941680ab4 | |
|
|
0c85045e7d | |
|
|
31a42a5481 |
|
|
@ -1005,7 +1005,7 @@ EOD;
|
|||
}
|
||||
|
||||
//过滤text类型字段
|
||||
if ($v['DATA_TYPE'] != 'text' && $inputType != 'fieldlist') {
|
||||
if (!preg_match("/text$/i", $v['DATA_TYPE']) && $inputType != 'fieldlist') {
|
||||
//主键
|
||||
if ($v['COLUMN_KEY'] == 'PRI' && !$priDefined) {
|
||||
$priDefined = true;
|
||||
|
|
@ -1070,7 +1070,7 @@ EOD;
|
|||
}
|
||||
|
||||
//过滤text类型字段
|
||||
if ($v['DATA_TYPE'] != 'text') {
|
||||
if (!preg_match("/text$/i", $v['DATA_TYPE'])) {
|
||||
//构造JS列信息
|
||||
$javascriptList[] = $this->getJsColumn($relationField, $v['DATA_TYPE'], '', [], $v);
|
||||
}
|
||||
|
|
@ -1646,11 +1646,11 @@ EOD;
|
|||
$inputType = "datetimerange";
|
||||
}
|
||||
// 指定后缀结尾JSON配置
|
||||
if ($this->isMatchSuffix($fieldsName, $this->jsonSuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'text')) {
|
||||
if ($this->isMatchSuffix($fieldsName, $this->jsonSuffix) && ($v['DATA_TYPE'] == 'varchar' || preg_match("/text$/i", $v['DATA_TYPE']))) {
|
||||
$inputType = "fieldlist";
|
||||
}
|
||||
// 指定后缀结尾标签配置
|
||||
if ($this->isMatchSuffix($fieldsName, $this->tagSuffix) && ($v['DATA_TYPE'] == 'varchar' || $v['DATA_TYPE'] == 'text')) {
|
||||
if ($this->isMatchSuffix($fieldsName, $this->tagSuffix) && ($v['DATA_TYPE'] == 'varchar' || preg_match("/text$/i", $v['DATA_TYPE']))) {
|
||||
$inputType = "tagsinput";
|
||||
}
|
||||
return $inputType;
|
||||
|
|
@ -1734,7 +1734,22 @@ EOD;
|
|||
{
|
||||
$lang = mb_ucfirst($field);
|
||||
$formatter = '';
|
||||
foreach ($this->fieldFormatterSuffix as $k => $v) {
|
||||
$fieldFormatterSuffix = $this->fieldFormatterSuffix;
|
||||
foreach (['switch', 'image', 'file', 'tag', 'intDate'] as $index => $item) {
|
||||
$property = $item . (in_array($item, ['image', 'file']) ? 'Field' : 'Suffix');
|
||||
if (!isset($this->$property) || !$this->isMatchSuffix($field, $this->$property)) {
|
||||
continue;
|
||||
}
|
||||
if ($item == 'intDate') {
|
||||
$fieldFormatterSuffix[$field] = ['type' => ['int', 'bigint', 'timestamp'], 'name' => 'datetime'];
|
||||
} else if (in_array($item, ['image', 'file'])) {
|
||||
$fieldFormatterSuffix[$field] = $this->fieldFormatterSuffix[$item . (preg_match("/s$/i", $field) ? 's' : '')];
|
||||
} else {
|
||||
$fieldFormatterSuffix[$field] = $this->fieldFormatterSuffix[$item];
|
||||
}
|
||||
break;
|
||||
}
|
||||
foreach ($fieldFormatterSuffix as $k => $v) {
|
||||
if (preg_match("/{$k}$/i", $field)) {
|
||||
if (is_array($v)) {
|
||||
if (in_array($datatype, $v['type'])) {
|
||||
|
|
@ -1765,7 +1780,13 @@ EOD;
|
|||
}
|
||||
|
||||
// 文件、图片、权重等字段默认不加入搜索栏,字符串类型默认LIKE
|
||||
$noSearchFiles = ['file$', 'files$', 'image$', 'images$', '^weigh$'];
|
||||
$noSearchFiles = ['file$', 'files$', 'image$', 'images$', '^' . $this->sortField . '$'];
|
||||
$noSearchFiles = array_merge($noSearchFiles, array_map(function ($item) {
|
||||
return $item . '$';
|
||||
}, $this->imageField), array_map(function ($item) {
|
||||
return $item . '$';
|
||||
}, $this->fileField));
|
||||
|
||||
if (preg_match("/" . implode('|', $noSearchFiles) . "/i", $field)) {
|
||||
$html .= ", operate: false";
|
||||
} elseif (in_array($datatype, ['varchar'])) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use think\addons\Service;
|
|||
use think\Cache;
|
||||
use think\Config;
|
||||
use think\Db;
|
||||
use think\Exception;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* 插件管理
|
||||
|
|
@ -38,7 +38,8 @@ class Addon extends Backend
|
|||
$addons = get_addon_list();
|
||||
foreach ($addons as $k => &$v) {
|
||||
$config = get_addon_config($v['name']);
|
||||
$v['config'] = $config ? 1 : 0;
|
||||
$showConfig = $v['config'] ?? true;
|
||||
$v['config'] = $showConfig && $config ? 1 : 0;
|
||||
$v['url'] = str_replace($this->request->server('SCRIPT_NAME'), '', $v['url']);
|
||||
}
|
||||
$this->assignconfig(['addons' => $addons, 'api_url' => config('fastadmin.api_url'), 'faversion' => config('fastadmin.version'), 'domain' => request()->host(true)]);
|
||||
|
|
@ -444,7 +445,7 @@ class Addon extends Backend
|
|||
$json = [];
|
||||
try {
|
||||
$json = Service::addons($params);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
$rows = $json['rows'] ?? [];
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ return [
|
|||
'frontend' => 'zh-cn',
|
||||
],
|
||||
'fixedpage' => 'dashboard',
|
||||
'agreement' => '协议内容',
|
||||
'categorytype' => [
|
||||
'default' => 'Default',
|
||||
'page' => 'Page',
|
||||
|
|
|
|||
|
|
@ -400,6 +400,7 @@ class User extends Frontend
|
|||
public function agreement()
|
||||
{
|
||||
$this->view->assign('title', __('User agreement'));
|
||||
$this->view->assign('content', xss_clean(config('site.agreement')));
|
||||
return $this->view->fetch();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<div id="content-container" class="container">
|
||||
<div class="user-section agreement-section">
|
||||
<h2>用户协议</h2>
|
||||
<h2>{$title}</h2>
|
||||
<div class="agreement-content">
|
||||
<p>用户协议内容</p>
|
||||
<p>{:$content}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
|
|||
api: {
|
||||
formatter: {
|
||||
title: function (value, row, index) {
|
||||
var caret = row.haschild == 1 || row.ismenu == 1 ? '<i class="fa fa-caret-right"></i>' : '';
|
||||
var caret = row.haschild == 1 ? '<i class="fa fa-caret-right"></i>' : '';
|
||||
|
||||
value = !row.ismenu || row.status == 'hidden' ? "<span class='text-muted'>" + value + "</span>" : value;
|
||||
return '<a href="javascript:;" data-id="' + row.id + '" data-pid="' + row.pid + '" class="'
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
formatter: {
|
||||
title: function (value, row, index) {
|
||||
value = value.toString().replace(/(&|&)nbsp;/g, ' ');
|
||||
var caret = row.haschild == 1 || row.ismenu == 1 ? '<i class="fa fa-caret-right"></i>' : '';
|
||||
var caret = row.haschild == 1 ? '<i class="fa fa-caret-right"></i>' : '';
|
||||
value = value.indexOf(" ") > -1 ? value.replace(/(.*) /, "$1" + caret) : caret + value;
|
||||
|
||||
value = !row.ismenu || row.status == 'hidden' ? "<span class='text-muted'>" + value + "</span>" : value;
|
||||
|
|
|
|||
Loading…
Reference in New Issue