feat: permissions
This commit is contained in:
@@ -64,6 +64,10 @@ class FrontTable extends Creator
|
||||
*/
|
||||
protected string $useList = '{useList}';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $tree = '{tree}';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
@@ -91,13 +95,14 @@ class FrontTable extends Creator
|
||||
{
|
||||
// TODO: Implement getContent() method.
|
||||
return Str::of(File::get($this->getTableStub()))->replace([
|
||||
$this->table, $this->search, $this->api, $this->paginate, $this->useList
|
||||
$this->table, $this->search, $this->api, $this->paginate, $this->useList, $this->tree
|
||||
], [
|
||||
$this->getTableContent(),
|
||||
$this->getSearchContent(),
|
||||
$this->apiString,
|
||||
$this->getPaginateStubContent(),
|
||||
$this->getUseList()
|
||||
$this->getUseList(),
|
||||
$this->getTreeProps()
|
||||
])->toString();
|
||||
}
|
||||
|
||||
@@ -230,6 +235,20 @@ HTML;
|
||||
return 'const { data, query, search, reset, loading } = useGetList(api)';
|
||||
}
|
||||
|
||||
/**
|
||||
* get tree props
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTreeProps(): string
|
||||
{
|
||||
if (in_array('parent_id', array_column($this->structures, 'field'))) {
|
||||
return ' row-key="id" default-expand-all :tree-props="{ children: \'children\' }"';
|
||||
}
|
||||
|
||||
return ' ';
|
||||
}
|
||||
|
||||
/**
|
||||
* set structures
|
||||
*
|
||||
|
Reference in New Issue
Block a user