Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ModStart
ModStartCMS
提交
a855d466
ModStartCMS
项目概览
ModStart
/
ModStartCMS
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ModStartCMS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a855d466
编写于
12月 11, 2021
作者:
ModStart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
develop
上级
146ccaa6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
1 deletion
+44
-1
vendor/modstart/modstart/src/Field/AbstractField.php
vendor/modstart/modstart/src/Field/AbstractField.php
+7
-0
vendor/modstart/modstart/src/Grid/Concerns/HasItemOperate.php
...or/modstart/modstart/src/Grid/Concerns/HasItemOperate.php
+33
-0
vendor/modstart/modstart/src/Grid/Grid.php
vendor/modstart/modstart/src/Grid/Grid.php
+3
-0
vendor/modstart/modstart/src/Widget/TextLink.php
vendor/modstart/modstart/src/Widget/TextLink.php
+1
-1
未找到文件。
vendor/modstart/modstart/src/Field/AbstractField.php
浏览文件 @
a855d466
...
...
@@ -61,6 +61,7 @@ use ModStart\Support\Concern\HasFluentAttribute;
*
* @method AbstractField|mixed isLayoutField($vlaue = null)
* @method AbstractField|mixed isCustomField($vlaue = null)
* @method AbstractField|mixed gridFixed($vlaue = null)
*
* >>>>>> 数据流转换流程 >>>>>>
*
...
...
@@ -159,6 +160,7 @@ class AbstractField implements Renderable
'hookRendering'
,
'isLayoutField'
,
'isCustomField'
,
'gridFixed'
,
];
/**
* 字段渲染模式,默认为 add,请查看 @see FieldRenderMode
...
...
@@ -202,6 +204,11 @@ class AbstractField implements Renderable
* @var bool
*/
protected
$isCustomField
=
false
;
/**
* 数据表示模式下浮动布局
* @var null|left|right
*/
private
$gridFixed
=
null
;
public
static
function
getAssets
()
{
...
...
vendor/modstart/modstart/src/Grid/Concerns/HasItemOperate.php
浏览文件 @
a855d466
...
...
@@ -25,6 +25,12 @@ trait HasItemOperate
*/
private
$hookItemOperateRendering
;
/**
* 操作列初始化时回调
* @var \Closure
*/
private
$hookItemOperateFieldBuild
;
private
function
setupItemOperate
()
{
$this
->
itemOperate
=
new
ItemOperate
(
$this
);
...
...
@@ -42,6 +48,9 @@ trait HasItemOperate
}
return
$this
->
itemOperate
->
render
();
});
if
(
$this
->
hookItemOperateFieldBuild
)
{
call_user_func
(
$this
->
hookItemOperateFieldBuild
,
$field
);
}
$this
->
pushField
(
$field
);
}
}
...
...
@@ -67,4 +76,28 @@ trait HasItemOperate
$this
->
hookItemOperateRendering
=
$callback
;
return
$this
;
}
/**
* @param null $callback = function(AbstractField $field){ }
* @return $this|\Closure
*/
public
function
hookItemOperateFieldBuild
(
$callback
=
null
)
{
if
(
null
===
$callback
)
{
return
$this
->
hookItemOperateFieldBuild
;
}
$this
->
hookItemOperateFieldBuild
=
$callback
;
return
$this
;
}
/**
* 操作栏浮动
* @param $fixed string left|right
*/
public
function
operateFixed
(
$fixed
)
{
$this
->
hookItemOperateFieldBuild
(
function
(
AbstractField
$field
)
use
(
$fixed
)
{
$field
->
gridFixed
(
$fixed
);
});
}
}
vendor/modstart/modstart/src/Grid/Grid.php
浏览文件 @
a855d466
...
...
@@ -430,6 +430,9 @@ class Grid
}
else
{
$record
[
'withAuto'
]
=
true
;
}
if
(
$field
->
gridFixed
())
{
$record
[
'fixed'
]
=
$field
->
gridFixed
();
}
$head
[]
=
$record
;
}
return
Response
::
jsonSuccessData
([
...
...
vendor/modstart/modstart/src/Widget/TextLink.php
浏览文件 @
a855d466
...
...
@@ -50,7 +50,7 @@ class TextLink extends AbstractWidget
if
(
$this
->
disabled
)
{
return
'<a href="javascript:;" class="ub-text-link ub-text-muted">'
.
$this
->
text
.
'</a>'
;
}
else
{
return
'<a href="'
.
$this
->
link
.
'" class="ub-text-link ub-text-'
.
$this
->
type
.
'" '
.
$this
->
attr
.
'>'
.
$this
->
text
.
'</a>'
;
return
'<a href="'
.
$this
->
link
.
'" class="ub-text-link ub-text-'
.
(
$this
->
type
==
'primary'
?
'link'
:
$this
->
type
)
.
'" '
.
$this
->
attr
.
'>'
.
$this
->
text
.
'</a>'
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录