|
...
|
...
|
@@ -2,8 +2,12 @@ |
|
|
|
|
|
|
|
namespace App\Http\Controllers\Bside;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Exceptions\BsideGlobalException;
|
|
|
|
use App\Models\Template\AHeadFoot;
|
|
|
|
use App\Models\Template\BCustom;
|
|
|
|
use App\Models\Template\BHeadFoot;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 自定义 页面
|
|
...
|
...
|
@@ -28,6 +32,10 @@ class TemplateController extends BaseController |
|
|
|
|
|
|
|
$data = BHeadFoot::_get($this->user['project_id']);
|
|
|
|
|
|
|
|
// todo::这里要进行html的替换
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->success([
|
|
|
|
'header' => $data[BHeadFoot::TYPE_HEADER]??'',
|
|
|
|
'footer' => $data[BHeadFoot::TYPE_FOOTER]??'',
|
|
...
|
...
|
@@ -41,7 +49,7 @@ class TemplateController extends BaseController |
|
|
|
* @time 2023/5/4 16:19
|
|
|
|
*/
|
|
|
|
public function edit_html(){
|
|
|
|
$data = BHeadFoot::_getEditHtml($this->user['project_id']);
|
|
|
|
$data = BHeadFoot::_get($this->user['project_id']);
|
|
|
|
|
|
|
|
if(!$data){
|
|
|
|
$data = AHeadFoot::_bDefault();
|
|
...
|
...
|
@@ -53,6 +61,32 @@ class TemplateController extends BaseController |
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保存
|
|
|
|
* @author:dc
|
|
|
|
* @time 2023/5/4 17:42
|
|
|
|
*/
|
|
|
|
public function edit_save(){
|
|
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
|
|
|
|
try {
|
|
|
|
BHeadFoot::_save($this->user['project_id'],BHeadFoot::TYPE_HEADER,'');
|
|
|
|
|
|
|
|
BHeadFoot::_save($this->user['project_id'],BHeadFoot::TYPE_HEADER,'');
|
|
|
|
}catch (\Throwable $e){
|
|
|
|
DB::rollBack();
|
|
|
|
|
|
|
|
throw new BsideGlobalException('B01024','保存失败');
|
|
|
|
}
|
|
|
|
|
|
|
|
DB::commit();
|
|
|
|
|
|
|
|
|
|
|
|
$this->success([]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取系统的模板
|
|
...
|
...
|
@@ -81,4 +115,38 @@ class TemplateController extends BaseController |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 自定义 列表
|
|
|
|
* @author:dc
|
|
|
|
* @time 2023/5/4 17:13
|
|
|
|
*/
|
|
|
|
public function custom(){
|
|
|
|
|
|
|
|
$data = BCustom::_all($this->user['project_id']);
|
|
|
|
|
|
|
|
|
|
|
|
return $this->success($data->toArray());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function custom_create(){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function custom_edit($id){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function custom_delete($id){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|