feat: permissions

This commit is contained in:
JaguarJack
2022-12-07 19:28:57 +08:00
parent a1d9468a91
commit 8c537e6656
45 changed files with 1030 additions and 372 deletions

View File

@@ -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
*