From f2b899bd0be34fbb4a5e2d37d5a5377c81206a1b Mon Sep 17 00:00:00 2001 From: panx <651666084@qq.com> Date: Sat, 17 Aug 2024 22:22:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8F=92=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=89=8D=E5=8F=B0=E9=BB=98=E8=AE=A4=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=8E=A7=E5=88=B6=E5=99=A8=E7=9A=84?= =?UTF-8?q?=20bool=E5=8F=98=E9=87=8F=E5=90=8D=E7=A7=B0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E5=8F=AF=E4=BB=A5=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/partmanage/Index.php | 33 +++++++ app/admin/model/partmanage/Partmanage.php | 35 ++++++++ app/admin/validate/partmanage/Partmanage.php | 34 +++++++ app/admin/view/partmanage/index/index.html | 13 +++ app/index/controller/Easyflow.php | 2 +- app/index/controller/Partmanage.php | 55 ++++++++++++ app/index/view/partmanage/index.html | 22 +++++ .../app/index/controller/Easyflow.php | 2 +- plugin/easyflow/data/menu.html | 4 + plugin/partmanage/Partmanage.php | 55 ++++++++++++ plugin/partmanage/README.md | 29 ++++++ plugin/partmanage/Upgrade.php | 21 +++++ .../app/admin/controller/partmanage/Index.php | 33 +++++++ .../app/admin/model/partmanage/Partmanage.php | 35 ++++++++ .../admin/validate/partmanage/Partmanage.php | 34 +++++++ .../admin/view/partmanage/index/index.html | 13 +++ .../app/index/controller/Partmanage.php | 55 ++++++++++++ .../app/index/view/partmanage/index.html | 22 +++++ plugin/partmanage/config.html | 88 +++++++++++++++++++ plugin/partmanage/config.json | 21 +++++ plugin/partmanage/data/menu.html | 4 + plugin/partmanage/data/menu.php | 47 ++++++++++ plugin/partmanage/function.php | 16 ++++ plugin/partmanage/install.sql | 24 +++++ .../public/static/plugin/partmanage/index.js | 1 + .../system/plugin/partmanage/function.js | 1 + plugin/partmanage/uninstall.sql | 0 public/static/plugin/partmanage/index.js | 1 + .../system/plugin/partmanage/function.js | 1 + 29 files changed, 699 insertions(+), 2 deletions(-) create mode 100644 app/admin/controller/partmanage/Index.php create mode 100644 app/admin/model/partmanage/Partmanage.php create mode 100644 app/admin/validate/partmanage/Partmanage.php create mode 100644 app/admin/view/partmanage/index/index.html create mode 100644 app/index/controller/Partmanage.php create mode 100644 app/index/view/partmanage/index.html create mode 100644 plugin/easyflow/data/menu.html create mode 100644 plugin/partmanage/Partmanage.php create mode 100644 plugin/partmanage/README.md create mode 100644 plugin/partmanage/Upgrade.php create mode 100644 plugin/partmanage/app/admin/controller/partmanage/Index.php create mode 100644 plugin/partmanage/app/admin/model/partmanage/Partmanage.php create mode 100644 plugin/partmanage/app/admin/validate/partmanage/Partmanage.php create mode 100644 plugin/partmanage/app/admin/view/partmanage/index/index.html create mode 100644 plugin/partmanage/app/index/controller/Partmanage.php create mode 100644 plugin/partmanage/app/index/view/partmanage/index.html create mode 100644 plugin/partmanage/config.html create mode 100644 plugin/partmanage/config.json create mode 100644 plugin/partmanage/data/menu.html create mode 100644 plugin/partmanage/data/menu.php create mode 100644 plugin/partmanage/function.php create mode 100644 plugin/partmanage/install.sql create mode 100644 plugin/partmanage/public/static/plugin/partmanage/index.js create mode 100644 plugin/partmanage/public/static/system/plugin/partmanage/function.js create mode 100644 plugin/partmanage/uninstall.sql create mode 100644 public/static/plugin/partmanage/index.js create mode 100644 public/static/system/plugin/partmanage/function.js diff --git a/app/admin/controller/partmanage/Index.php b/app/admin/controller/partmanage/Index.php new file mode 100644 index 0000000..e26688e --- /dev/null +++ b/app/admin/controller/partmanage/Index.php @@ -0,0 +1,33 @@ + + */ +class Index extends AdminController { + + // 初始化函数 + public function __construct() + { + parent::__construct(); + /** + * TODO... + */ + } + + /** + * 初始化后台首页 + * @return Response + */ + public function index(): Response + { + echo '后台 部件管理 控制器
'; + return $this->view(); + } + +} diff --git a/app/admin/model/partmanage/Partmanage.php b/app/admin/model/partmanage/Partmanage.php new file mode 100644 index 0000000..782d7b4 --- /dev/null +++ b/app/admin/model/partmanage/Partmanage.php @@ -0,0 +1,35 @@ + + * @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; + } +} diff --git a/app/admin/validate/partmanage/Partmanage.php b/app/admin/validate/partmanage/Partmanage.php new file mode 100644 index 0000000..c95d77e --- /dev/null +++ b/app/admin/validate/partmanage/Partmanage.php @@ -0,0 +1,34 @@ + + */ +class Partmanage extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/app/admin/view/partmanage/index/index.html b/app/admin/view/partmanage/index/index.html new file mode 100644 index 0000000..03d5a3a --- /dev/null +++ b/app/admin/view/partmanage/index/index.html @@ -0,0 +1,13 @@ + + + + + + +我是后台首页控制器模板 + + + + 我是 Partmanage 控制器模板 + + \ No newline at end of file diff --git a/app/index/controller/Easyflow.php b/app/index/controller/Easyflow.php index 0b05945..9b7ba1d 100644 --- a/app/index/controller/Easyflow.php +++ b/app/index/controller/Easyflow.php @@ -27,7 +27,7 @@ class Easyflow extends HomeController /** * 鉴权控制器 */ - public $needLogin = false; + public bool $needLogin = false; /** diff --git a/app/index/controller/Partmanage.php b/app/index/controller/Partmanage.php new file mode 100644 index 0000000..e52161f --- /dev/null +++ b/app/index/controller/Partmanage.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +namespace app\index\controller; + +use app\HomeController; +use support\Response; + +/** + * 首页控制器 + * + * 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 前台首页模板'); + } + +} diff --git a/app/index/view/partmanage/index.html b/app/index/view/partmanage/index.html new file mode 100644 index 0000000..1ec8440 --- /dev/null +++ b/app/index/view/partmanage/index.html @@ -0,0 +1,22 @@ + + + +
+
+
示例页面 TODO...
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/plugin/easyflow/app/index/controller/Easyflow.php b/plugin/easyflow/app/index/controller/Easyflow.php index 0b05945..9b7ba1d 100644 --- a/plugin/easyflow/app/index/controller/Easyflow.php +++ b/plugin/easyflow/app/index/controller/Easyflow.php @@ -27,7 +27,7 @@ class Easyflow extends HomeController /** * 鉴权控制器 */ - public $needLogin = false; + public bool $needLogin = false; /** diff --git a/plugin/easyflow/data/menu.html b/plugin/easyflow/data/menu.html new file mode 100644 index 0000000..87b8e41 --- /dev/null +++ b/plugin/easyflow/data/menu.html @@ -0,0 +1,4 @@ + +
  • + 简单工作流插件 +
  • \ No newline at end of file diff --git a/plugin/partmanage/Partmanage.php b/plugin/partmanage/Partmanage.php new file mode 100644 index 0000000..70c481a --- /dev/null +++ b/plugin/partmanage/Partmanage.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +* app 文件夹下所有文件将复制到根目录 + +* public 文件夹下所有文件将复制到根目录 + +* Partmanage.php 为插件的核心安装文件,请务必按要求书写代码 +> 请注意钩子函数为public类型,如需非钩子函数可使用protected类型 + +* function.php 为当前插件的函数库文件 + +* config.json 为当前插件的配置信息文件 + +* config.html 为当前配置模板,存在才会出现配置按钮 + +* install.sql 插件的数据库安装文件,不需要可删除!! +* +* uninstall.sql 插件的数据库卸载文件,不需要可删除!! + +* library 该目录下为第三方类库文件,如果你的类库文件存在命名空间问题,可手动修改或自行实现install方法将第三方类库复制到extend文件夹下! + diff --git a/plugin/partmanage/Upgrade.php b/plugin/partmanage/Upgrade.php new file mode 100644 index 0000000..45022ef --- /dev/null +++ b/plugin/partmanage/Upgrade.php @@ -0,0 +1,21 @@ + + */ +class Index extends AdminController { + + // 初始化函数 + public function __construct() + { + parent::__construct(); + /** + * TODO... + */ + } + + /** + * 初始化后台首页 + * @return Response + */ + public function index(): Response + { + echo '后台 部件管理 控制器
    '; + return $this->view(); + } + +} diff --git a/plugin/partmanage/app/admin/model/partmanage/Partmanage.php b/plugin/partmanage/app/admin/model/partmanage/Partmanage.php new file mode 100644 index 0000000..782d7b4 --- /dev/null +++ b/plugin/partmanage/app/admin/model/partmanage/Partmanage.php @@ -0,0 +1,35 @@ + + * @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; + } +} diff --git a/plugin/partmanage/app/admin/validate/partmanage/Partmanage.php b/plugin/partmanage/app/admin/validate/partmanage/Partmanage.php new file mode 100644 index 0000000..c95d77e --- /dev/null +++ b/plugin/partmanage/app/admin/validate/partmanage/Partmanage.php @@ -0,0 +1,34 @@ + + */ +class Partmanage extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/plugin/partmanage/app/admin/view/partmanage/index/index.html b/plugin/partmanage/app/admin/view/partmanage/index/index.html new file mode 100644 index 0000000..03d5a3a --- /dev/null +++ b/plugin/partmanage/app/admin/view/partmanage/index/index.html @@ -0,0 +1,13 @@ + + + + + + +我是后台首页控制器模板 + + + + 我是 Partmanage 控制器模板 + + \ No newline at end of file diff --git a/plugin/partmanage/app/index/controller/Partmanage.php b/plugin/partmanage/app/index/controller/Partmanage.php new file mode 100644 index 0000000..e52161f --- /dev/null +++ b/plugin/partmanage/app/index/controller/Partmanage.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +namespace app\index\controller; + +use app\HomeController; +use support\Response; + +/** + * 首页控制器 + * + * 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 前台首页模板'); + } + +} diff --git a/plugin/partmanage/app/index/view/partmanage/index.html b/plugin/partmanage/app/index/view/partmanage/index.html new file mode 100644 index 0000000..1ec8440 --- /dev/null +++ b/plugin/partmanage/app/index/view/partmanage/index.html @@ -0,0 +1,22 @@ + + + +
    +
    +
    示例页面 TODO...
    + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/plugin/partmanage/config.html b/plugin/partmanage/config.html new file mode 100644 index 0000000..bdd885e --- /dev/null +++ b/plugin/partmanage/config.html @@ -0,0 +1,88 @@ + + + + +
    +
    + +
    配置项提示信息 TODO...
    +
    + +
    + +
    +
    + +
    +
    {:__('伪静态规则')}
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    变量名变量值操作
    +
    + +
    + +
    +
    + + + \ No newline at end of file diff --git a/plugin/partmanage/config.json b/plugin/partmanage/config.json new file mode 100644 index 0000000..4788f63 --- /dev/null +++ b/plugin/partmanage/config.json @@ -0,0 +1,21 @@ +{ + "name": "partmanage", + "title": "部件管理", + "intro": "部件管理", + "icon": "fa-home", + "author": "Panjz", + "home": "\/partmanage\/index", + "version": "1.0.1", + "config": 1, + "menu": 1, + "import": 0, + "rewrite": [], + "extends": { + "title": "部件管理" + }, + "area": [ + "600px", + "650px" + ], + "status": 1 +} \ No newline at end of file diff --git a/plugin/partmanage/data/menu.html b/plugin/partmanage/data/menu.html new file mode 100644 index 0000000..3917219 --- /dev/null +++ b/plugin/partmanage/data/menu.html @@ -0,0 +1,4 @@ + +
  • + 物料管理插件 +
  • \ No newline at end of file diff --git a/plugin/partmanage/data/menu.php b/plugin/partmanage/data/menu.php new file mode 100644 index 0000000..4339ae3 --- /dev/null +++ b/plugin/partmanage/data/menu.php @@ -0,0 +1,47 @@ + [ + 'title' => '部件管理', + 'router' => '/partmanage/Index', + 'icon' => 'fa-home', + 'auth' => 1, + 'type' => 0, + 'children' => [ + 0 => [ + 'title' => '查看', + 'router' => '/partmanage/Index/index', + 'icon' => NULL, + 'auth' => 1, + 'type' => 1, + ], + 1 => [ + 'title' => '添加', + 'router' => '/partmanage/Index/add', + 'icon' => NULL, + 'auth' => 1, + 'type' => 1, + ], + 2 => [ + 'title' => '编辑', + 'router' => '/partmanage/Index/edit', + 'icon' => NULL, + 'auth' => 1, + 'type' => 1, + ], + 3 => [ + 'title' => '删除', + 'router' => '/partmanage/Index/del', + 'icon' => NULL, + 'auth' => 1, + 'type' => 1, + ], + 4 => [ + 'title' => '状态', + 'router' => '/partmanage/Index/status', + 'icon' => NULL, + 'auth' => 1, + 'type' => 1, + ], + ], + ], +]; \ No newline at end of file diff --git a/plugin/partmanage/function.php b/plugin/partmanage/function.php new file mode 100644 index 0000000..1493e11 --- /dev/null +++ b/plugin/partmanage/function.php @@ -0,0 +1,16 @@ +