更新插件的前台默认的显示页面,控制器的 bool变量名称更新后可以正常显示。
This commit is contained in:
33
app/admin/controller/partmanage/Index.php
Normal file
33
app/admin/controller/partmanage/Index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace app\admin\controller\partmanage;
|
||||
use app\AdminController;
|
||||
use support\Response;
|
||||
|
||||
/**
|
||||
* 部件管理后台控制器
|
||||
* <!--Partmanage-->
|
||||
*/
|
||||
class Index extends AdminController {
|
||||
|
||||
// 初始化函数
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
/**
|
||||
* TODO...
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化后台首页
|
||||
* @return Response
|
||||
*/
|
||||
public function index(): Response
|
||||
{
|
||||
echo '后台 部件管理 控制器<br/>';
|
||||
return $this->view();
|
||||
}
|
||||
|
||||
}
|
||||
35
app/admin/model/partmanage/Partmanage.php
Normal file
35
app/admin/model/partmanage/Partmanage.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\model\partmanage;
|
||||
|
||||
use think\Model;
|
||||
/**
|
||||
* 部件管理模型类
|
||||
* <!--Partmanage-->
|
||||
* @mixin Model
|
||||
*/
|
||||
class Partmanage extends Model
|
||||
{
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'create_time';
|
||||
protected $updatetime = 'update_time';
|
||||
|
||||
/**
|
||||
* 字段修改器
|
||||
* @param $value
|
||||
* @return int|mixed
|
||||
*/
|
||||
public function setSortAttr($value)
|
||||
{
|
||||
if (is_empty($value)) {
|
||||
return self::max('id') + 1;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
34
app/admin/validate/partmanage/Partmanage.php
Normal file
34
app/admin/validate/partmanage/Partmanage.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\validate\partmanage;
|
||||
|
||||
use think\Validate;
|
||||
/**
|
||||
* 部件管理 验证器
|
||||
* <!--Partmanage-->
|
||||
*/
|
||||
class Partmanage extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
13
app/admin/view/partmanage/index/index.html
Normal file
13
app/admin/view/partmanage/index/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>我是后台首页控制器模板</title>
|
||||
</head>
|
||||
<!--Partmanage-->
|
||||
<body>
|
||||
我是 Partmanage 控制器模板
|
||||
</body>
|
||||
</html>
|
||||
@@ -27,7 +27,7 @@ class Easyflow extends HomeController
|
||||
/**
|
||||
* 鉴权控制器
|
||||
*/
|
||||
public $needLogin = false;
|
||||
public bool $needLogin = false;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
55
app/index/controller/Partmanage.php
Normal file
55
app/index/controller/Partmanage.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
// +----------------------------------------------------------------------
|
||||
// | swiftAdmin 极速开发框架 [基于 WebMan 开发]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2020-2099 http://www.swiftadmin.net
|
||||
// +----------------------------------------------------------------------
|
||||
// | swiftAdmin.net High Speed Development Framework
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: meystack <coolsec@foxmail.com> Apache2
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\index\controller;
|
||||
|
||||
use app\HomeController;
|
||||
use support\Response;
|
||||
|
||||
/**
|
||||
* 首页控制器
|
||||
* <!--Partmanage-->
|
||||
* Class Index
|
||||
* @package app\index\controller
|
||||
*/
|
||||
class Partmanage extends HomeController
|
||||
{
|
||||
|
||||
/**
|
||||
* 鉴权控制器
|
||||
*/
|
||||
public bool $needLogin = false;
|
||||
|
||||
|
||||
/**
|
||||
* 非鉴权方法
|
||||
* @var array
|
||||
*/
|
||||
public $noNeedAuth = ['index', 'home'];
|
||||
|
||||
// 初始化函数
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Partmanage 首页
|
||||
* @return Response
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function index(): Response
|
||||
{
|
||||
return response('Partmanage 前台首页模板');
|
||||
}
|
||||
|
||||
}
|
||||
22
app/index/view/partmanage/index.html
Normal file
22
app/index/view/partmanage/index.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!--Partmanage-->
|
||||
<layout name="layout:layout"/>
|
||||
<!-- 内容主体区域 -->
|
||||
<div id="content">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body"> 示例页面 TODO...</div>
|
||||
<!-- // 创建数据实例 -->
|
||||
<table id="lay-tableList" lay-filter="lay-tableList"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- // 列表工具栏 -->
|
||||
<script type="text/html" id="tableBar">
|
||||
<!-- // TODO-->
|
||||
</script>
|
||||
|
||||
<script>
|
||||
layui.use(['table','jquery'], function () {
|
||||
let $ = layui.jquery;
|
||||
let table = layui.table;
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user