diff --git a/app/admin/controller/PdmFootprint.php b/app/admin/controller/PdmFootprint.php new file mode 100644 index 0000000..08d7773 --- /dev/null +++ b/app/admin/controller/PdmFootprint.php @@ -0,0 +1,165 @@ + + * Class PdmFootprint + * @package app\admin\controller + */ +class PdmFootprint extends AdminController +{ + /** + * PdmFootprint模型对象 + * @var \app\admin\model\PdmFootprint + */ + + public function __construct() + { + parent::__construct(); + $this->model = new PdmFootprintModel; + } + + /** + * 默认生成的方法为index/add/edit/del/status 五个方法 + * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码 + */ + + /** + * 获取资源列表 + * return Response + */ + public function index(): Response + { + if (request()->isAjax()) { + list($count, $list) = PdmFootprint::dataList(request()->all()); + // $rules = list_to_tree($list,'id','pid','children',0); + $lists = list_to_tree($list,'id','pid','children',0); + + return $this->success('获取成功', '/',$lists, $count); + // return $this->success('获取成功', '/'); + } + + return view('/pdm_footprint/index'); + } + + /** + * 获取资源列表 + * @param array $params + * @return array + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public static function dataList(array $params): array + { + $where = array(); + if (!empty($params['footprint'])) { + $where[] = ['footprint','like','%'.$params['footprint'].'%']; + } + if (!empty($params['content'])) { + $where[] = ['content','like','%'.$params['content'].'%']; + } + $model = new PdmFootprintModel(); + // $model = $this->model; + $count = $model->where($where)->count(); + // $list = $model->where($where)->order('sort asc')->select()->toArray(); + $list = $model->where($where)->order('sort asc')->select(); + foreach($list as $key => $value){ + // throw new \Exception(json_encode($value)); + // throw new \Exception(json_encode($list[$key]->admin['nickname'])); + $list[$key]['creator'] =__($list[$key]->admin['nickname']); + } + + return [$count, $list->toArray()]; + } + + /** + * 添加节点数据 + * @return Response + */ + public function add(): Response + { + if (request()->isPost()) { + $post = \request()->post(); + // validate(\app\common\validate\system\AdminRules::class . '.add')->check($post); + $userid = get_admin_id(); + $post['creatorid'] = $userid ; + + if ($this->model->create($post)) { + return $this->success('添加FootPrint成功!'); + } + } + + $data = $this->getTableFields(); + $data['pid'] = input('pid', 0); + // $data['auth'] = 1; + // $data['type'] = 1; + + list($count, $list) = PdmFootprint::dataList(request()->all()); + return view('/pdm_footprint/add', [ + 'data' => $data, + 'rules' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE), + ]); + } + + /** + * 编辑节点数据 + * @return Response + * @throws DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException + */ + public function edit(): Response + { + $id = input('id', 0); + $data = $this->model->find($id); + if (request()->isPost()) { + $post = \request()->post(); + // validate(\app\common\validate\system\AdminRules::class . '.edit')->check($post); + if ($this->model->update($post)) { + return $this->success('更新FootPrint成功!'); + } + } + + list($count, $list) = PdmFootprint::dataList(request()->all()); + return view('/pdm_footprint/add', [ + 'data' => $data, + 'rules' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE), + ]); + } + + /** + * 删除节点数据 + * @return Response + * @throws DbException + */ + public function del(): Response + { + $id = input('id'); + if (!empty($id)) { + // 查询子节点 + if ($this->model->where('pid',$id)->count()) { + return $this->error('当前分类存在子项!'); + } + + // 删除单个 + if ($this->model::destroy($id)) { + return $this->success('删除FootPrint成功!'); + } + } + + return $this->error('删除失败,请检查您的参数!'); + } + + + + +} diff --git a/app/admin/controller/PdmMfgName.php b/app/admin/controller/PdmMfgName.php index 9b871f3..16180ff 100644 --- a/app/admin/controller/PdmMfgName.php +++ b/app/admin/controller/PdmMfgName.php @@ -4,7 +4,7 @@ namespace app\admin\controller; use app\AdminController; use Webman\Http\Request; -use app\common\model\PdmMfgName as PdmMfgNameModel; +use app\admin\model\PdmMfgName as PdmMfgNameModel; use support\Response; /** * pdm_mfg_name @@ -17,7 +17,7 @@ class PdmMfgName extends AdminController { /** * PdmMfgName模型对象 - * @var \app\common\model\PdmMfgName + * @var \app\admin\model\PdmMfgName */ public function __construct() @@ -31,6 +31,43 @@ class PdmMfgName extends AdminController * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码 */ + /** + * 获取资源列表 + * return Response + */ + public function index(): Response + { + $params = request()->all(); + $where = array(); + if (!empty($params['mfgname'])) { + $where[] = ['mfgname','like','%'.$params['mfgname'].'%']; + // $where[] = ['mfgname','like','%'.'ABRACON'.'%']; + } + if (!empty($params['mfgsite'])) { + $where[] = ['mfgsite','like','%'.$params['mfgsite'].'%']; + } + + // $where[] = ['mfgname','like','%'.'ABRACON'.'%']; + $listtemp = $this->model->where($where)->select(); + // $listtemp = $this->model->where($where); + // $listtemp = $this->model->find(1); + // throw new \Exception(json_encode($listtemp)); + // $admin = $this->model->admin()->where($where)->select()->toArray(); + + // $admin = $listtemp->admin; + // throw new \Exception(json_encode($admin)); + + if (request()->isAjax()) { + list($count, $list) = PdmMfgName::dataList(request()->all()); + // $rules = list_to_tree($list,'id','pid','children',0); + $lists = list_to_tree($list,'id','pid','children',0); + + return $this->success('获取成功', '/',$lists, $count); + // return $this->success('获取成功', '/'); + } + + return view('/pdm_mfg_name/index'); + } /** * 获取资源列表 @@ -46,47 +83,51 @@ class PdmMfgName extends AdminController if (!empty($params['mfgname'])) { $where[] = ['mfgname','like','%'.$params['mfgname'].'%']; } - if (!empty($params['status'])) { - $where[] = ['status','like','%'.$params['status'].'%']; + if (!empty($params['mfgsite'])) { + $where[] = ['mfgsite','like','%'.$params['mfgsite'].'%']; } $model = new PdmMfgNameModel(); $count = $model->where($where)->count(); - $list = $model->where($where)->order('sort asc')->select()->toArray(); + // $list = $model->where($where)->order('sort asc')->select()->toArray(); + $list = $model->where($where)->order('sort asc')->select(); + foreach($list as $key => $value){ + // throw new \Exception(json_encode($value)); + // throw new \Exception(json_encode($lists[$key]->admin['nickname'])); + $list[$key]['creator'] =__($list[$key]->admin['nickname']); + } + + + // $pidlist = array(); foreach ($list as $key => $value) { $list[$key]['mfgname'] = __($value['mfgname']); - } + + } // $users = array(); - $users = $model->usernames(); - // throw new \Exception(json_encode($users)); - foreach ($list as $key => $value) { - foreach ($users as $keyuser => $valueuser) { - if ($value['createrid'] == $valueuser['id']) { - // $list[$key]['createrid'] = __($valueuser['name']); - $list[$key]['createrid'] = __($valueuser['nickname']); - break; - }else{ - $list[$key]['createrid'] =$list[$key]['createrid'].'|'. __('未知用户'); - } - } - } - return [$count, $list]; + // $users = $model->usernames(); + + // // throw new \Exception(json_encode($users)); + // foreach ($list as $key => $value) { + // foreach ($users as $keyuser => $valueuser) { + // // if ($users[$keyuser]['id'] == $list[$key]['id']){ + // // // $list[$key]['creatorid'] = __($users[$keyuser]['nickname']); + // // $list[$key]['creatorid'] = __($users[$keyuser]['name']); + // // break; + // // } + // if ($value['creatorid'] == $valueuser['id']) { + // // $list[$key]['creatorid'] = __($valueuser['name']); + // $list[$key]['creatorid'] = __($valueuser['nickname']); + // break; + // }else{ + // $list[$key]['creatorid'] =$list[$key]['creatorid'].'|'. __('未知用户'); + // } + + // } + // } + + return [$count, $list->toArray()]; } - /** - * 获取资源列表 - * return Response - */ - public function index(): Response - { - if (request()->isAjax()) { - list($count, $list) = PdmMfgName::dataList(request()->all()); - $rules = list_to_tree($list,'id','pid','children',0); - return $this->success('获取成功', '/',$rules, $count); - } - return view('/pdm_mfg_name/index'); - } - /** * 添加节点数据 * @return Response @@ -97,19 +138,21 @@ class PdmMfgName extends AdminController $post = \request()->post(); // validate(\app\common\validate\system\AdminRules::class . '.add')->check($post); $userid = get_admin_id(); - $post['createrid'] = $userid ; - + $post['creatorid'] = $userid ; + // if(empty($userid)){ + // $post['creatorid'] = 'empty'; + // }else{ + // $post['creatorid'] = 'noneempty' ; + // } if ($this->model->create($post)) { - return $this->success('添加成功!'); - }else{ - return $this->error('添加失败!'); + return $this->success('添加分类成功!'); } } $data = $this->getTableFields(); $data['pid'] = input('pid', 0); - $data['auth'] = 1; - $data['type'] = 1; + // $data['auth'] = 1; + // $data['type'] = 1; list($count, $list) = PdmMfgName::dataList(request()->all()); return view('/pdm_mfg_name/add', [ @@ -118,54 +161,5 @@ class PdmMfgName extends AdminController ]); } - /** - * 编辑节点数据 - * @return Response - * @throws DbException - * @throws DataNotFoundException - * @throws ModelNotFoundException - */ - public function edit(): Response - { - $id = input('id', 0); - $data = $this->model->find($id); - if (request()->isPost()) { - $post = \request()->post(); - // validate(\app\common\validate\system\AdminRules::class . '.edit')->check($post); - if ($this->model->update($post)) { - return $this->success('更新成功!'); - }else{ - return $this->error('更新失败!'); - } - } - - list($count, $list) = PdmMfgName::dataList(request()->all()); - return view('/pdm_mfg_name/add', [ - 'data' => $data, - 'rules' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE), - ]); - } - - /** - * 删除节点数据 - * @return Response - * @throws DbException - */ - public function del(): Response - { - $id = input('id'); - if (!empty($id)) { - // 查询子节点 - if ($this->model->where('pid',$id)->count()) { - return $this->error('当前菜单存在子菜单!'); - } - - // 删除单个 - if ($this->model::destroy($id)) { - return $this->success('删除菜单成功!'); - } - } - return $this->error('删除失败,请检查您的参数!'); - } } diff --git a/app/admin/controller/PdmPartitemIndex.php b/app/admin/controller/PdmPartitemIndex.php new file mode 100644 index 0000000..aacfca9 --- /dev/null +++ b/app/admin/controller/PdmPartitemIndex.php @@ -0,0 +1,170 @@ + + * Class PdmPartitemIndex + * @package app\admin\controller + */ +class PdmPartitemIndex extends AdminController +{ + /** + * PdmPartitemIndex模型对象 + * @var \app\admin\model\PdmPartitemIndex + */ + + public function __construct() + { + parent::__construct(); + $this->model = new PdmPartitemIndexModel; + } + + /** + * 默认生成的方法为index/add/edit/del/status 五个方法 + * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码 + */ + + /** + * 获取资源列表 + * return Response + */ + public function index(): Response + { + if (request()->isAjax()) { + list($count, $list) = PdmPartitemIndex::dataList(request()->all()); + // $rules = list_to_tree($list,'id','pid','children',0); + $lists = list_to_tree($list,'id','pid','children',0); + + return $this->success('获取成功', '/',$lists, $count); + // return $this->success('获取成功', '/'); + } + + return view('/pdm_partitem_index/index'); + } + + /** + * 获取资源列表 + * @param array $params + * @return array + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public static function dataList(array $params): array + { + $where = array(); + if (!empty($params['partnumber'])) { + $where[] = ['partnumber','like','%'.$params['partnumber'].'%']; + } + if (!empty($params['content'])) { + $where[] = ['content','like','%'.$params['content'].'%']; + } + $model = new PdmPartitemIndexModel(); + // $model = $this->model; + $count = $model->where($where)->count(); + // $list = $model->where($where)->order('sort asc')->select()->toArray(); + $list = $model->where($where)->order('sort asc')->select(); + foreach($list as $key => $value){ + // throw new \Exception(json_encode($value)); + // throw new \Exception(json_encode($list[$key]->admin['nickname'])); + $list[$key]['creator'] =__($list[$key]->admin == null?'': $list[$key]->admin['nickname']); + $list[$key]['parttype'] =__($list[$key]->parttype ==null?'': $list[$key]->parttype['name']); + $list[$key]['mfg_name'] =__($list[$key]->mfgname == null ?'': $list[$key]->mfgname['mfgname']); + // if($list[$key]->mfgname == null){ + // $list[$key]['mfg_name'] =''; + // }else{ + // $list[$key]['mfg_name'] =$list[$key]->mfgname['mfgname']; + // } + + } + + return [$count, $list->toArray()]; + } + + /** + * 添加节点数据 + * @return Response + */ + public function add(): Response + { + if (request()->isPost()) { + $post = \request()->post(); + // validate(\app\common\validate\system\AdminRules::class . '.add')->check($post); + $userid = get_admin_id(); + $post['creatorid'] = $userid ; + + if ($this->model->create($post)) { + return $this->success('添加FootPrint成功!'); + } + } + + $data = $this->getTableFields(); + $data['pid'] = input('pid', 0); + // $data['auth'] = 1; + // $data['type'] = 1; + + list($count, $list) = PdmPartitemIndex::dataList(request()->all()); + return view('/pdm_partitem_index/add', [ + 'data' => $data, + 'rules' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE), + ]); + } + + /** + * 编辑节点数据 + * @return Response + * @throws DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException + */ + public function edit(): Response + { + $id = input('id', 0); + $data = $this->model->find($id); + if (request()->isPost()) { + $post = \request()->post(); + // validate(\app\common\validate\system\AdminRules::class . '.edit')->check($post); + if ($this->model->update($post)) { + return $this->success('更新FootPrint成功!'); + } + } + + list($count, $list) = PdmPartitemIndex::dataList(request()->all()); + return view('/pdm_partitem_index/add', [ + 'data' => $data, + 'rules' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE), + ]); + } + + /** + * 删除节点数据 + * @return Response + * @throws DbException + */ + public function del(): Response + { + $id = input('id'); + if (!empty($id)) { + // 查询子节点 + if ($this->model->where('pid',$id)->count()) { + return $this->error('当前分类存在子项!'); + } + + // 删除单个 + if ($this->model::destroy($id)) { + return $this->success('删除FootPrint成功!'); + } + } + + return $this->error('删除失败,请检查您的参数!'); + } + +} diff --git a/app/admin/controller/PdmPartitem.php b/app/admin/controller/PdmPartitemRelation.php similarity index 53% rename from app/admin/controller/PdmPartitem.php rename to app/admin/controller/PdmPartitemRelation.php index 53ca232..b88a4c2 100644 --- a/app/admin/controller/PdmPartitem.php +++ b/app/admin/controller/PdmPartitemRelation.php @@ -4,26 +4,26 @@ namespace app\admin\controller; use app\AdminController; use Webman\Http\Request; -use app\admin\model\PdmPartitem as PdmPartitemModel; +use app\admin\model\PdmPartitemRelation as PdmPartitemRelationModel; /** - * pdm_partitem - * 部件 - * - * Class PdmPartitem + * pdm_partitem_relation + * PN关系维护 + * + * Class PdmPartitemRelation * @package app\admin\controller */ -class PdmPartitem extends AdminController +class PdmPartitemRelation extends AdminController { /** - * PdmPartitem模型对象 - * @var \app\admin\model\PdmPartitem + * PdmPartitemRelation模型对象 + * @var \app\admin\model\PdmPartitemRelation */ public function __construct() { parent::__construct(); - $this->model = new PdmPartitemModel; + $this->model = new PdmPartitemRelationModel; } /** diff --git a/app/admin/controller/PdmPartitemView.php b/app/admin/controller/PdmPartitemView.php new file mode 100644 index 0000000..644b75f --- /dev/null +++ b/app/admin/controller/PdmPartitemView.php @@ -0,0 +1,83 @@ + + * Class PdmPartitemView + * @package app\admin\controller + */ +class PdmPartitemView extends AdminController +{ + /** + * PdmPartitemView模型对象 + * @var \app\admin\model\PdmPartitemView + */ + + public function __construct() + { + parent::__construct(); + $this->model = new PdmPartitemViewModel; + } + + /** + * 默认生成的方法为index/add/edit/del/status 五个方法 + * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码 + */ + + + public function index(): \support\Response + { + // $post = input(); + // $post = request()->post(); + $post = request()->all(); + // $post['partnumber'] = input('partnumber'); + $pid = input('pid'); + $limit = input('limit') ?? 10; + $page = input('page') ?? 1; + // if ($pid == null) { + // $pid = (string)$this->model->minId(); + // } + + if (request()->isAjax()) { + + // 生成查询数据 + // $pid = !str_contains($pid, ',') ? $pid : explode(',',$pid); + // $where[] = ['pid','in',$pid]; + // $where[] = []; + if (!empty($post['keyword'])) { + $where[] = ['partnumber|purchasecode|parttype|value|description|mpn|mfgname|symbol|footprint|datasheet|usernickname|department','like','%'.$post['keyword'].'%']; + // $where[] = ['reference','like','%'.$post['keyword'].'%']; + // $where[] = ['content','like','%'.$post['keyword'].'%']; + // $where[] = ['item','like','%'.$post['keyword'].'%']; + }else{ + // $where[] = ['pid','in',$pid]; + // $where[] = ['partnumber','like','%'.$post['partnumber'].'%']; + $where[] = ['partnumber|purchasecode|parttype|value|description|mpn|mfgname|symbol|footprint|datasheet|usernickname|department','like','%'.'%']; + } + + $count = $this->model->where($where)->count(); + // $list = $this->model->where($where)->limit((int)$limit)->page((int)$page)->select() + // ->each(function($item,$key) use ($pid){ + // if ($key == 0 && $pid == '0') { + // $item['LAY_CHECKED'] = true; + // } + + // return $item; + // }); + $list = $this->model->where($where)->limit((int)$limit)->page((int)$page)->select(); + + return $this->success('查询成功', null, $list, $count); + } + + return view('/pdm_partitem_view/index',[ ]); + } + + +} diff --git a/app/admin/controller/PdmPartlist.php b/app/admin/controller/PdmPartlist.php new file mode 100644 index 0000000..ec9a342 --- /dev/null +++ b/app/admin/controller/PdmPartlist.php @@ -0,0 +1,92 @@ + + * Class PdmPartlist + * @package app\admin\controller + */ +class PdmPartlist extends AdminController +{ + /** + * PdmPartlist模型对象 + * @var \app\admin\model\PdmPartlist + */ + + public function __construct() + { + parent::__construct(); + $this->model = new PdmPartlistModel; + } + + /** + * 默认生成的方法为index/add/edit/del/status 五个方法 + * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码 + */ + + /** + * 字典首页 + * @return Response + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public function index(): \support\Response + { + // $post = input(); + // $post = request()->post(); + $post = request()->all(); + // $post['partnumber'] = input('partnumber'); + $pid = input('pid'); + $limit = input('limit') ?? 10; + $page = input('page') ?? 1; + if ($pid == null) { + $pid = (string)$this->model->minId(); + } + + if (request()->isAjax()) { + + // 生成查询数据 + $pid = !str_contains($pid, ',') ? $pid : explode(',',$pid); + $where[] = ['pid','in',$pid]; + if (!empty($post['keyword'])) { + $where[] = ['partnumber|reference|content|item','like','%'.$post['keyword'].'%']; + // $where[] = ['reference','like','%'.$post['keyword'].'%']; + // $where[] = ['content','like','%'.$post['keyword'].'%']; + // $where[] = ['item','like','%'.$post['keyword'].'%']; + }else{ + // $where[] = ['pid','in',$pid]; + // $where[] = ['partnumber','like','%'.$post['partnumber'].'%']; + } + + $count = $this->model->where($where)->count(); + $list = $this->model->where($where)->limit((int)$limit)->page((int)$page)->select() + ->each(function($item,$key) use ($pid){ + if ($key == 0 && $pid == '0') { + $item['LAY_CHECKED'] = true; + } + // throw new \Exception(json_encode($item->admin['nickname'])); + $item['creator'] = $item->admin ==null?'': $item->admin['nickname']; + // $item['purchasecode'] = $item->partitemview == null?'': $item->partitemview['purchasecode']; + $item->partitemview ; + return $item; + }); + // throw new \Exception(json_encode($list)); + return $this->success('查询成功', null, $list, $count); + } + + return view('/pdm_partlist/index',[ 'pid' => $pid]); + } + + +} diff --git a/app/admin/controller/PdmParttype.php b/app/admin/controller/PdmParttype.php index 5decd5b..b4a2f0f 100644 --- a/app/admin/controller/PdmParttype.php +++ b/app/admin/controller/PdmParttype.php @@ -3,14 +3,13 @@ declare (strict_types = 1); namespace app\admin\controller; use app\AdminController; -use app\admin\service\AdminRuleService; use Webman\Http\Request; use app\admin\model\PdmParttype as PdmParttypeModel; use support\Response; /** * pdm_parttype * 分类目录 - * + * * Class PdmParttype * @package app\admin\controller */ @@ -41,7 +40,6 @@ class PdmParttype extends AdminController if (request()->isAjax()) { list($count, $list) = PdmParttype::dataList(request()->all()); $rules = list_to_tree($list,'id','pid','children',0); - return $this->success('获取成功', '/',$rules, $count); } @@ -60,41 +58,24 @@ class PdmParttype extends AdminController public static function dataList(array $params): array { $where = array(); - if (!empty($params['parttypetitle'])) { - $where[] = ['parttypetitle','like','%'.$params['parttypetitle'].'%']; + if (!empty($params['name'])) { + $where[] = ['name','like','%'.$params['name'].'%']; } - if (!empty($params['parttypevalue'])) { - $where[] = ['parttypevalue','like','%'.$params['parttypevalue'].'%']; + if (!empty($params['value'])) { + $where[] = ['value','like','%'.$params['value'].'%']; } $model = new PdmParttypeModel(); $count = $model->where($where)->count(); - $list = $model->where($where)->order('sort asc')->select()->toArray(); + // $list = $model->where($where)->order('sort asc')->select()->toArray(); + $list = $model->where($where)->order('sort asc')->select(); + foreach ($list as $key => $value) { - $list[$key]['parttypetitle'] = __($value['parttypetitle']); - } - // $users = array(); - $users = $model->usernames(); + // $list[$key]['name'] = __($value['name']); + $list[$key]['creator'] = __($list[$key]->admin['nickname']); + + } - // throw new \Exception(json_encode($users)); - foreach ($list as $key => $value) { - foreach ($users as $keyuser => $valueuser) { - // if ($users[$keyuser]['id'] == $list[$key]['id']){ - // // $list[$key]['createrid'] = __($users[$keyuser]['nickname']); - // $list[$key]['createrid'] = __($users[$keyuser]['name']); - // break; - // } - if ($value['createrid'] == $valueuser['id']) { - // $list[$key]['createrid'] = __($valueuser['name']); - $list[$key]['createrid'] = __($valueuser['nickname']); - break; - }else{ - $list[$key]['createrid'] =$list[$key]['createrid'].'|'. __('未知用户'); - } - - } - } - - return [$count, $list]; + return [$count, $list->toArray()]; } @@ -109,11 +90,11 @@ class PdmParttype extends AdminController $post = \request()->post(); // validate(\app\common\validate\system\AdminRules::class . '.add')->check($post); $userid = get_admin_id(); - $post['createrid'] = $userid ; + $post['creatorid'] = $userid ; // if(empty($userid)){ - // $post['createrid'] = 'empty'; + // $post['creatorid'] = 'empty'; // }else{ - // $post['createrid'] = 'noneempty' ; + // $post['creatorid'] = 'noneempty' ; // } if ($this->model->create($post)) { return $this->success('添加分类成功!'); @@ -122,8 +103,8 @@ class PdmParttype extends AdminController $data = $this->getTableFields(); $data['pid'] = input('pid', 0); - $data['auth'] = 1; - $data['type'] = 1; + // $data['auth'] = 1; + // $data['type'] = 1; list($count, $list) = PdmParttype::dataList(request()->all()); return view('/pdm_parttype/add', [ @@ -169,12 +150,12 @@ class PdmParttype extends AdminController if (!empty($id)) { // 查询子节点 if ($this->model->where('pid',$id)->count()) { - return $this->error('当前菜单存在子菜单!'); + return $this->error('当前分类存在子分类!'); } // 删除单个 if ($this->model::destroy($id)) { - return $this->success('删除菜单成功!'); + return $this->success('删除分类成功!'); } } diff --git a/app/admin/controller/PdmPurchasecode.php b/app/admin/controller/PdmPurchasecode.php index 9c5198a..1793d12 100644 --- a/app/admin/controller/PdmPurchasecode.php +++ b/app/admin/controller/PdmPurchasecode.php @@ -4,7 +4,7 @@ namespace app\admin\controller; use app\AdminController; use Webman\Http\Request; -use app\common\model\PdmPurchasecode as PdmPurchasecodeModel; +use app\admin\model\PdmPurchasecode as PdmPurchasecodeModel; /** * pdm_purchasecode @@ -17,7 +17,7 @@ class PdmPurchasecode extends AdminController { /** * PdmPurchasecode模型对象 - * @var \app\common\model\PdmPurchasecode + * @var \app\admin\model\PdmPurchasecode */ public function __construct() diff --git a/app/admin/controller/PdmSymbol.php b/app/admin/controller/PdmSymbol.php index c264c48..a1609bd 100644 --- a/app/admin/controller/PdmSymbol.php +++ b/app/admin/controller/PdmSymbol.php @@ -4,12 +4,13 @@ namespace app\admin\controller; use app\AdminController; use Webman\Http\Request; -use app\common\model\PdmSymbol as PdmSymbolModel; +use app\admin\model\PdmSymbol as PdmSymbolModel; +use support\Response; /** * pdm_symbol * 原理符号 - * + * * Class PdmSymbol * @package app\admin\controller */ @@ -17,7 +18,7 @@ class PdmSymbol extends AdminController { /** * PdmSymbol模型对象 - * @var \app\common\model\PdmSymbol + * @var \app\admin\model\PdmSymbol */ public function __construct() @@ -30,7 +31,133 @@ class PdmSymbol extends AdminController * 默认生成的方法为index/add/edit/del/status 五个方法 * 当创建CURD的时候,DIY的函数体和模板为空,请自行编写代码 */ - + + /** + * 获取资源列表 + * return Response + */ + public function index(): Response + { + if (request()->isAjax()) { + list($count, $list) = PdmSymbol::dataList(request()->all()); + // $rules = list_to_tree($list,'id','pid','children',0); + $lists = list_to_tree($list,'id','pid','children',0); + + return $this->success('获取成功', '/',$lists, $count); + // return $this->success('获取成功', '/'); + } + + return view('/pdm_symbol/index'); + } + + /** + * 获取资源列表 + * @param array $params + * @return array + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public static function dataList(array $params): array + { + $where = array(); + if (!empty($params['symbolname'])) { + $where[] = ['symbolname','like','%'.$params['symbolname'].'%']; + } + if (!empty($params['content'])) { + $where[] = ['content','like','%'.$params['content'].'%']; + } + $model = new PdmSymbolModel(); + // $model = $this->model; + $count = $model->where($where)->count(); + // $list = $model->where($where)->order('sort asc')->select()->toArray(); + $list = $model->where($where)->order('sort asc')->select(); + foreach($list as $key => $value){ + // throw new \Exception(json_encode($value)); + // throw new \Exception(json_encode($list[$key]->admin['nickname'])); + $list[$key]['creator'] =__($list[$key]->admin['nickname']); + } + + return [$count, $list->toArray()]; + } + + /** + * 添加节点数据 + * @return Response + */ + public function add(): Response + { + if (request()->isPost()) { + $post = \request()->post(); + // validate(\app\common\validate\system\AdminRules::class . '.add')->check($post); + $userid = get_admin_id(); + $post['creatorid'] = $userid ; + + if ($this->model->create($post)) { + return $this->success('添加FootPrint成功!'); + } + } + + $data = $this->getTableFields(); + $data['pid'] = input('pid', 0); + // $data['auth'] = 1; + // $data['type'] = 1; + + list($count, $list) = PdmSymbol::dataList(request()->all()); + return view('/pdm_symbol/add', [ + 'data' => $data, + 'rules' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE), + ]); + } + + /** + * 编辑节点数据 + * @return Response + * @throws DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException + */ + public function edit(): Response + { + $id = input('id', 0); + $data = $this->model->find($id); + if (request()->isPost()) { + $post = \request()->post(); + // validate(\app\common\validate\system\AdminRules::class . '.edit')->check($post); + if ($this->model->update($post)) { + return $this->success('更新Symbol成功!'); + } + } + + list($count, $list) = PdmSymbol::dataList(request()->all()); + return view('/pdm_symbol/add', [ + 'data' => $data, + 'rules' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE), + ]); + } + + /** + * 删除节点数据 + * @return Response + * @throws DbException + */ + public function del(): Response + { + $id = input('id'); + if (!empty($id)) { + // 查询子节点 + if ($this->model->where('pid',$id)->count()) { + return $this->error('当前分类存在子项!'); + } + + // 删除单个 + if ($this->model::destroy($id)) { + return $this->success('删除Symbol成功!'); + } + } + + return $this->error('删除失败,请检查您的参数!'); + } } diff --git a/app/admin/controller/partlist/Index.php b/app/admin/controller/partlist/Index.php new file mode 100644 index 0000000..2997e63 --- /dev/null +++ b/app/admin/controller/partlist/Index.php @@ -0,0 +1,33 @@ + + */ +class Index extends AdminController { + + // 初始化函数 + public function __construct() + { + parent::__construct(); + /** + * TODO... + */ + } + + /** + * 初始化后台首页 + * @return Response + */ + public function index(): Response + { + echo '后台 BOM管理 控制器
'; + return $this->view(); + } + +} diff --git a/app/admin/controller/partview/Index.php b/app/admin/controller/partview/Index.php new file mode 100644 index 0000000..b7ca995 --- /dev/null +++ b/app/admin/controller/partview/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/controller/system/Dictionary.php b/app/admin/controller/system/Dictionary.php index 8e0f8f3..f555d9e 100644 --- a/app/admin/controller/system/Dictionary.php +++ b/app/admin/controller/system/Dictionary.php @@ -41,7 +41,8 @@ class Dictionary extends AdminController */ public function index(): \support\Response { - $post = input(); + // $post = input(); + $post = request()->all(); $pid = input('pid'); $limit = input('limit') ?? 10; $page = input('page') ?? 1; diff --git a/app/admin/model/PdmFootprint.php b/app/admin/model/PdmFootprint.php new file mode 100644 index 0000000..03aafb7 --- /dev/null +++ b/app/admin/model/PdmFootprint.php @@ -0,0 +1,38 @@ + + * 封装设计 + * Class PdmFootprint + * @package app\admin\model + */ +class PdmFootprint extends Model +{ + + use SoftDelete; + + // 定义时间戳字段名 + protected $createTime = 'create_time'; + protected $updateTime = 'update_time'; + protected $deleteTime = 'delete_time'; + + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind nickname,name + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['nickname','name']); + } + + + +} \ No newline at end of file diff --git a/app/admin/model/PdmMfgName.php b/app/admin/model/PdmMfgName.php new file mode 100644 index 0000000..1b441fe --- /dev/null +++ b/app/admin/model/PdmMfgName.php @@ -0,0 +1,38 @@ + + * 制造商名录 + * Class PdmMfgName + * @package app\admin\model + */ +class PdmMfgName extends Model +{ + + use SoftDelete; + + // 定义时间戳字段名 + protected $createTime = 'create_time'; + protected $updateTime = 'update_time'; + protected $deleteTime = 'delete_time'; + + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind nickname + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['nickname']); + } + + + +} \ No newline at end of file diff --git a/app/admin/model/PdmPartitem.php b/app/admin/model/PdmPartitem.php deleted file mode 100644 index 23df366..0000000 --- a/app/admin/model/PdmPartitem.php +++ /dev/null @@ -1,59 +0,0 @@ - - * 部件 - * Class PdmPartitem - * @package app\admin\model - */ -class PdmPartitem extends Model -{ - - use SoftDelete; - - // 定义时间戳字段名 - protected $createTime = 'create_time'; - protected $updateTime = 'update_time'; - protected $deleteTime = 'delete_time'; - - - /** - * 定义 sa_user 关联模型 - * @localKey createrid - * @bind nickname,name - */ - public function user() - { - return $this->hasOne(\app\common\model\system\User::Class,'id','createrid')->bind(['nickname','name']); - } - - public function setPartattributeAttr($value) - { - if (!empty($value) && is_array($value)) { - $arr = []; - foreach ($value['key'] as $key => $elem) { - $arr[$elem] = $value['value'][$key]; - } - - $value = json_encode($arr,JSON_UNESCAPED_UNICODE); - } - - return $value ?: json_encode([]); - } - - public function getPartattributeAttr($value) - { - if (!empty($value) && is_string($value)) { - $value = json_decode($value, true); - } - - return $value; - } - -} \ No newline at end of file diff --git a/app/admin/model/PdmPartitemIndex.php b/app/admin/model/PdmPartitemIndex.php new file mode 100644 index 0000000..58f4640 --- /dev/null +++ b/app/admin/model/PdmPartitemIndex.php @@ -0,0 +1,80 @@ + + * Partnumber管理 + * Class PdmPartitemIndex + * @package app\admin\model + */ +class PdmPartitemIndex extends Model +{ + + use SoftDelete; + + // 定义时间戳字段名 + protected $createTime = 'create_time'; + protected $updateTime = 'update_time'; + protected $deleteTime = 'delete_time'; + + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind nickname,name + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['nickname','name']); + } + + + /** + * 定义 sa_admin 关联模型 + * @localKey parttypeid + * @bind name + */ + public function parttype() + { + return $this->hasOne(\app\admin\model\PdmParttype::Class,'id','parttypeid')->bind(['name']); + } + + /** + * 定义 sa_admin 关联模型 + * @localKey parttypeid + * @bind name + */ + public function mfgname() + { + return $this->hasOne(\app\admin\model\PdmMfgName::Class,'id','mfg_id')->bind(['mfgname']); + } + + public function setPartattributeAttr($value) + { + if (!empty($value) && is_array($value)) { + $arr = []; + foreach ($value['key'] as $key => $elem) { + $arr[$elem] = $value['value'][$key]; + } + + $value = json_encode($arr,JSON_UNESCAPED_UNICODE); + } + + return $value ?: json_encode([]); + } + + public function getPartattributeAttr($value) + { + if (!empty($value) && is_string($value)) { + $value = json_decode($value, true); + } + + return $value; + } + +} \ No newline at end of file diff --git a/app/admin/model/PdmPartitemRelation.php b/app/admin/model/PdmPartitemRelation.php new file mode 100644 index 0000000..ebe4d91 --- /dev/null +++ b/app/admin/model/PdmPartitemRelation.php @@ -0,0 +1,38 @@ + + * PN关系维护 + * Class PdmPartitemRelation + * @package app\admin\model + */ +class PdmPartitemRelation extends Model +{ + + use SoftDelete; + + // 定义时间戳字段名 + protected $createTime = 'create_time'; + protected $updateTime = 'update_time'; + protected $deleteTime = 'delete_time'; + + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind name,nickname + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['name','nickname']); + } + + + +} \ No newline at end of file diff --git a/app/admin/model/PdmPartitemView.php b/app/admin/model/PdmPartitemView.php new file mode 100644 index 0000000..876095e --- /dev/null +++ b/app/admin/model/PdmPartitemView.php @@ -0,0 +1,29 @@ + + * PN查询 + * Class PdmPartitemView + * @package app\admin\model + */ +class PdmPartitemView extends Model +{ + + + + // 定义时间戳字段名 + protected $createTime = false; + protected $updateTime = false; + protected $deleteTime = false; + + + + + +} \ No newline at end of file diff --git a/app/admin/model/PdmPartlist.php b/app/admin/model/PdmPartlist.php new file mode 100644 index 0000000..ee085a9 --- /dev/null +++ b/app/admin/model/PdmPartlist.php @@ -0,0 +1,87 @@ + + * BOM查询 + * Class PdmPartlist + * @package app\admin\model + */ +class PdmPartlist extends Model +{ + + use SoftDelete; + + // 定义时间戳字段名 + protected $createTime = 'create_time'; + protected $updateTime = 'update_time'; + protected $deleteTime = 'delete_time'; + + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind name,nickname + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['name','nickname']); + } + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind name,nickname + */ + public function partitemview() + { + return $this->hasOne(\app\admin\model\PdmPartitemView::Class,'partnumber','partnumber')->bind(['purchasecode','parttype','value','description','mpn','mfgname','footprint','manufacture']); + } + + // 字段修改器 + public function setSortAttr($value) + { + if (is_empty($value)) { + return self::max('id') + 1; + } + + return $value; + } + + /** + * 获取字典信息 + * @param string $value + * @return array + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public static function getValueList(string $value = ''): array + { + $list = []; + $data = self::where(['pid' => 0,'value' => $value])->find(); + if (!empty($data)) { + $list = self::where('pid', $data['id'])->select()->toArray(); + } + + return $list; + } + + /** + * 返回最小id + * @return int + */ + public static function minId(): int + { + return (int)self::where('pid', '0')->min('id'); + } + + + + +} \ No newline at end of file diff --git a/app/admin/model/PdmParttype.php b/app/admin/model/PdmParttype.php index 59dcedd..2a88923 100644 --- a/app/admin/model/PdmParttype.php +++ b/app/admin/model/PdmParttype.php @@ -7,7 +7,7 @@ use think\model\concern\SoftDelete; /** * pdm_parttype - * + * * 分类目录 * Class PdmParttype * @package app\admin\model @@ -22,46 +22,38 @@ class PdmParttype extends Model protected $updateTime = 'update_time'; protected $deleteTime = 'delete_time'; - - /** - * 定义 sa_user 关联模型 - * @localKey id - * @bind name,nickname - */ - public function user() - { - return $this->hasOne(\app\common\model\system\User::Class,'createrid','id')->bind(['nickname']); - } + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind nickname + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['nickname']); + } - public function usernames() - { - // return \app\common\model\system\User::select()->toArray(); - return \app\common\model\system\Admin::select()->toArray(); - } + public function setAttributeAttr($value) + { + if (!empty($value) && is_array($value)) { + $arr = []; + foreach ($value['key'] as $key => $elem) { + $arr[$elem] = $value['value'][$key]; + } - public function setPartattributeAttr($value) - { - if (!empty($value) && is_array($value)) { - $arr = []; - foreach ($value['key'] as $key => $elem) { - $arr[$elem] = $value['value'][$key]; - } + $value = json_encode($arr,JSON_UNESCAPED_UNICODE); + } - $value = json_encode($arr,JSON_UNESCAPED_UNICODE); - } + return $value ?: json_encode([]); + } - return $value ?: json_encode([]); - } + public function getAttributeAttr($value) + { + if (!empty($value) && is_string($value)) { + $value = json_decode($value, true); + } - public function getPartattributeAttr($value) - { - if (!empty($value) && is_string($value)) { - $value = json_decode($value, true); - } - - return $value; - } - - + return $value; + } } \ No newline at end of file diff --git a/app/common/model/PdmPurchasecode.php b/app/admin/model/PdmPurchasecode.php similarity index 71% rename from app/common/model/PdmPurchasecode.php rename to app/admin/model/PdmPurchasecode.php index 93b987d..a788e14 100644 --- a/app/common/model/PdmPurchasecode.php +++ b/app/admin/model/PdmPurchasecode.php @@ -1,6 +1,6 @@ * 采购编码 * Class PdmPurchasecode - * @package app\common\model + * @package app\admin\model */ class PdmPurchasecode extends Model { @@ -22,18 +22,18 @@ class PdmPurchasecode extends Model protected $updateTime = 'update_time'; protected $deleteTime = 'delete_time'; - - /** - * 定义 sa_user 关联模型 - * @localKey user_id - * @bind nickname,name - */ - public function user() - { - return $this->hasOne(\app\common\model\system\User::Class,'id','user_id')->bind(['nickname','name']); - } + + /** + * 定义 sa_admin 关联模型 + * @localKey creatorid + * @bind nickname + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['nickname']); + } - public function setAttributeAttr($value) + public function setAttributeAttr($value) { if (!empty($value) && is_array($value)) { $arr = []; diff --git a/app/common/model/PdmSymbol.php b/app/admin/model/PdmSymbol.php similarity index 53% rename from app/common/model/PdmSymbol.php rename to app/admin/model/PdmSymbol.php index d6a1f83..aae711c 100644 --- a/app/common/model/PdmSymbol.php +++ b/app/admin/model/PdmSymbol.php @@ -1,16 +1,16 @@ + * * 原理符号 * Class PdmSymbol - * @package app\common\model + * @package app\admin\model */ class PdmSymbol extends Model { @@ -22,16 +22,16 @@ class PdmSymbol extends Model protected $updateTime = 'update_time'; protected $deleteTime = 'delete_time'; - - /** - * 定义 sa_user 关联模型 - * @localKey admin_id - * @bind nickname,name - */ - public function user() - { - return $this->hasOne(\app\common\model\system\User::Class,'id','admin_id')->bind(['nickname','name']); - } + + /** + * 定义 sa_admin 关联模型 + * @localKey createrid + * @bind nickname + */ + public function admin() + { + return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['nickname']); + } diff --git a/app/admin/model/partlist/Partlist.php b/app/admin/model/partlist/Partlist.php new file mode 100644 index 0000000..0e549f7 --- /dev/null +++ b/app/admin/model/partlist/Partlist.php @@ -0,0 +1,35 @@ + + * @mixin Model + */ +class Partlist 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/model/partview/Partview.php b/app/admin/model/partview/Partview.php new file mode 100644 index 0000000..174a5f1 --- /dev/null +++ b/app/admin/model/partview/Partview.php @@ -0,0 +1,35 @@ + + * @mixin Model + */ +class Partview 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/PdmFootprint.php b/app/admin/validate/PdmFootprint.php new file mode 100644 index 0000000..b554209 --- /dev/null +++ b/app/admin/validate/PdmFootprint.php @@ -0,0 +1,36 @@ + + * PdmFootprint 验证器 + * Class PdmFootprint + * @package app\admin\validate + */ +class PdmFootprint extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/app/common/validate/PdmMfgName.php b/app/admin/validate/PdmMfgName.php similarity index 80% rename from app/common/validate/PdmMfgName.php rename to app/admin/validate/PdmMfgName.php index e9b43fb..762e178 100644 --- a/app/common/validate/PdmMfgName.php +++ b/app/admin/validate/PdmMfgName.php @@ -1,13 +1,13 @@ * PdmMfgName 验证器 * Class PdmMfgName - * @package app\common\validate + * @package app\admin\validate */ class PdmMfgName extends Validate { diff --git a/app/admin/validate/PdmPartitemIndex.php b/app/admin/validate/PdmPartitemIndex.php new file mode 100644 index 0000000..8db3abd --- /dev/null +++ b/app/admin/validate/PdmPartitemIndex.php @@ -0,0 +1,36 @@ + + * PdmPartitemIndex 验证器 + * Class PdmPartitemIndex + * @package app\admin\validate + */ +class PdmPartitemIndex extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/app/admin/validate/PdmPartitemRelation.php b/app/admin/validate/PdmPartitemRelation.php new file mode 100644 index 0000000..653addd --- /dev/null +++ b/app/admin/validate/PdmPartitemRelation.php @@ -0,0 +1,36 @@ + + * PdmPartitemRelation 验证器 + * Class PdmPartitemRelation + * @package app\admin\validate + */ +class PdmPartitemRelation extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/app/admin/validate/PdmPartitemView.php b/app/admin/validate/PdmPartitemView.php new file mode 100644 index 0000000..500dc63 --- /dev/null +++ b/app/admin/validate/PdmPartitemView.php @@ -0,0 +1,36 @@ + + * PdmPartitemView 验证器 + * Class PdmPartitemView + * @package app\admin\validate + */ +class PdmPartitemView extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/app/admin/validate/PdmPartitem.php b/app/admin/validate/PdmPartlist.php similarity index 72% rename from app/admin/validate/PdmPartitem.php rename to app/admin/validate/PdmPartlist.php index c33869f..645981b 100644 --- a/app/admin/validate/PdmPartitem.php +++ b/app/admin/validate/PdmPartlist.php @@ -4,12 +4,12 @@ namespace app\admin\validate; use think\Validate; /** - * - * PdmPartitem 验证器 - * Class PdmPartitem + * + * PdmPartlist 验证器 + * Class PdmPartlist * @package app\admin\validate */ -class PdmPartitem extends Validate +class PdmPartlist extends Validate { /** * 验证规则 diff --git a/app/admin/validate/PdmParttype.php b/app/admin/validate/PdmParttype.php index 00902e5..6fcb980 100644 --- a/app/admin/validate/PdmParttype.php +++ b/app/admin/validate/PdmParttype.php @@ -4,7 +4,7 @@ namespace app\admin\validate; use think\Validate; /** - * + * * PdmParttype 验证器 * Class PdmParttype * @package app\admin\validate diff --git a/app/common/validate/PdmPurchasecode.php b/app/admin/validate/PdmPurchasecode.php similarity index 80% rename from app/common/validate/PdmPurchasecode.php rename to app/admin/validate/PdmPurchasecode.php index 7f29fad..f50175f 100644 --- a/app/common/validate/PdmPurchasecode.php +++ b/app/admin/validate/PdmPurchasecode.php @@ -1,13 +1,13 @@ * PdmPurchasecode 验证器 * Class PdmPurchasecode - * @package app\common\validate + * @package app\admin\validate */ class PdmPurchasecode extends Validate { diff --git a/app/common/validate/PdmSymbol.php b/app/admin/validate/PdmSymbol.php similarity index 76% rename from app/common/validate/PdmSymbol.php rename to app/admin/validate/PdmSymbol.php index 466dac9..7f3c918 100644 --- a/app/common/validate/PdmSymbol.php +++ b/app/admin/validate/PdmSymbol.php @@ -1,13 +1,13 @@ + * * PdmSymbol 验证器 * Class PdmSymbol - * @package app\common\validate + * @package app\admin\validate */ class PdmSymbol extends Validate { diff --git a/app/admin/validate/partlist/Partlist.php b/app/admin/validate/partlist/Partlist.php new file mode 100644 index 0000000..d07e186 --- /dev/null +++ b/app/admin/validate/partlist/Partlist.php @@ -0,0 +1,34 @@ + + */ +class Partlist extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/app/admin/validate/partview/Partview.php b/app/admin/validate/partview/Partview.php new file mode 100644 index 0000000..2154f9c --- /dev/null +++ b/app/admin/validate/partview/Partview.php @@ -0,0 +1,34 @@ + + */ +class Partview extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/app/admin/view/partlist/index/index.html b/app/admin/view/partlist/index/index.html new file mode 100644 index 0000000..699e461 --- /dev/null +++ b/app/admin/view/partlist/index/index.html @@ -0,0 +1,13 @@ + + + + + + +我是后台首页控制器模板 + + + + 我是 Partlist 控制器模板 + + \ No newline at end of file diff --git a/app/admin/view/partview/index/index.html b/app/admin/view/partview/index/index.html new file mode 100644 index 0000000..580446f --- /dev/null +++ b/app/admin/view/partview/index/index.html @@ -0,0 +1,13 @@ + + + + + + +我是后台首页控制器模板 + + + + 我是 Partview 控制器模板 + + \ No newline at end of file diff --git a/app/admin/view/pdm_footprint/add.html b/app/admin/view/pdm_footprint/add.html new file mode 100644 index 0000000..0a9aabc --- /dev/null +++ b/app/admin/view/pdm_footprint/add.html @@ -0,0 +1,176 @@ + + + + +
+
+ +
+ + + + + +
+ +
+
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +

点击上传,或将文件拖拽到此处

+
+
上传成功后渲染 + 删除 +
+
+ +
+ +

点击上传,或将文件拖拽到此处

+
+
上传成功后渲染 + 删除 +
+
+
+
+
+ +
+ +
+ + + +
+
+ +
+ +
+
+ + + +
+ + + + + \ No newline at end of file diff --git a/app/admin/view/pdm_footprint/index.html b/app/admin/view/pdm_footprint/index.html new file mode 100644 index 0000000..3e0f24d --- /dev/null +++ b/app/admin/view/pdm_footprint/index.html @@ -0,0 +1,233 @@ + + +
+
+ +
+
+ + +
+
+ +
+ +
+
{:__('封装名称')}
+
+ +
+
+
+ + + + + + + + +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + diff --git a/app/admin/view/pdm_mfg_name/add.html b/app/admin/view/pdm_mfg_name/add.html index 8884f63..36a4eee 100644 --- a/app/admin/view/pdm_mfg_name/add.html +++ b/app/admin/view/pdm_mfg_name/add.html @@ -1,157 +1,65 @@ - - - - -
-
- -
- - - - - -
-
- - -
-
-
- - -
- -
-
-
-
- - * 制造商名称格式:eg.TI(德州仪器) - - -
-
-
-
- -
-
-
-
- - * 网站主页格式:eg.https://www.ti.com - - -
-
-
- -
-
- -
- -
-
- -
-

- -
- - - -
-
- -
- -
-
- - - -
- - - - + + + + +
+
+ +
+ + + + + +
+ +
+
+
+
+
+ * 制造商名称格式:eg.TI(德州仪器) + +
+
+
+
+
+ +
+
+
+
+ + * 网站主页格式:eg.https://www.ti.com + + +
+
+
+ +
+
+ +
+ +
+
+ +
+

+
+ +
+ +
+
+ + + +
+ + \ No newline at end of file diff --git a/app/admin/view/pdm_mfg_name/index.html b/app/admin/view/pdm_mfg_name/index.html index 57108bf..d7cfaef 100644 --- a/app/admin/view/pdm_mfg_name/index.html +++ b/app/admin/view/pdm_mfg_name/index.html @@ -35,6 +35,13 @@
+
+
{:__('排序')}
+
+ +
+
+
{:__('注释')}
@@ -45,7 +52,7 @@
{:__('创建者')}
- +
@@ -85,9 +92,6 @@ - - -
@@ -119,88 +123,37 @@ diff --git a/app/admin/view/pdm_partitem_index/add.html b/app/admin/view/pdm_partitem_index/add.html new file mode 100644 index 0000000..dbf12ab --- /dev/null +++ b/app/admin/view/pdm_partitem_index/add.html @@ -0,0 +1,81 @@ + + + + +
+
+ +
+ + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + +
名称变量值操作
+
+
+ + + +
+ + \ No newline at end of file diff --git a/app/admin/view/pdm_partitem_index/index.html b/app/admin/view/pdm_partitem_index/index.html new file mode 100644 index 0000000..7122945 --- /dev/null +++ b/app/admin/view/pdm_partitem_index/index.html @@ -0,0 +1,217 @@ + + +
+
+ +
+
+ + +
+
+ +
+ +
+
{:__('PartNumber')}
+
+ +
+
+
+ + + + + +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/admin/view/pdm_partitem_relation/add.html b/app/admin/view/pdm_partitem_relation/add.html new file mode 100644 index 0000000..a54fe7e --- /dev/null +++ b/app/admin/view/pdm_partitem_relation/add.html @@ -0,0 +1,51 @@ + + + + +
+
+ +
+ + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ + \ No newline at end of file diff --git a/app/admin/view/pdm_partitem_relation/index.html b/app/admin/view/pdm_partitem_relation/index.html new file mode 100644 index 0000000..d08d97d --- /dev/null +++ b/app/admin/view/pdm_partitem_relation/index.html @@ -0,0 +1,171 @@ + + +
+
+ +
+
+ + +
+
+ +
+ +
+
{:__('PartNumber')}
+
+ +
+
+
+ + + + + +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/admin/view/pdm_partitem_view/add.html b/app/admin/view/pdm_partitem_view/add.html new file mode 100644 index 0000000..c9783af --- /dev/null +++ b/app/admin/view/pdm_partitem_view/add.html @@ -0,0 +1,66 @@ + + + + +
+
+ +
+ + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ + \ No newline at end of file diff --git a/app/admin/view/pdm_partitem_view/index.html b/app/admin/view/pdm_partitem_view/index.html new file mode 100644 index 0000000..23559f3 --- /dev/null +++ b/app/admin/view/pdm_partitem_view/index.html @@ -0,0 +1,171 @@ + + +
+
+ +
+
+ + +
+
+
{:__('Keyword')}
+
+ +
+
+
+ + + + + +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/admin/view/pdm_partlist/add.html b/app/admin/view/pdm_partlist/add.html new file mode 100644 index 0000000..9783091 --- /dev/null +++ b/app/admin/view/pdm_partlist/add.html @@ -0,0 +1,51 @@ + + + + + + +
+
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/app/admin/view/pdm_partlist/index.html b/app/admin/view/pdm_partlist/index.html new file mode 100644 index 0000000..746e27c --- /dev/null +++ b/app/admin/view/pdm_partlist/index.html @@ -0,0 +1,308 @@ + + + + + +
+
+
+
+
+ + + + + + +
+
+
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+ + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+
+
+ + + + + + \ No newline at end of file diff --git a/app/admin/view/pdm_parttype/add.html b/app/admin/view/pdm_parttype/add.html index 7ea009f..ab56d20 100644 --- a/app/admin/view/pdm_parttype/add.html +++ b/app/admin/view/pdm_parttype/add.html @@ -1,80 +1,100 @@ - +
-
+
- - - - - -
- -
-
-
- -
- -
-
+ + + + + +
+ +
+
+
+
+ +
+ +
+
-
- -
-
+
+ +
+
-
- -
-
+
+ +
+
-
- -
- - - - - - - - - - - +
+ +
+
+ +
+ +
+
名称变量值操作
+ - - - + + + - - - -
名称变量值操作
- -
-
+ + + + + + + + + + + + + + +
+
-
- -
-
+
+ +
+
- +
+ \ No newline at end of file diff --git a/app/admin/view/pdm_parttype/index.html b/app/admin/view/pdm_parttype/index.html index 8a61394..e37dd50 100644 --- a/app/admin/view/pdm_parttype/index.html +++ b/app/admin/view/pdm_parttype/index.html @@ -1,91 +1,122 @@ - +
- +
-
{:__('会员ID')}
+
{:__('MOQ')}
- +
-
- +
+ +
+
{:__('MPQ')}
+
+ +
+
+ +
+
{:__('是否NRND')}
+
+ +
+
+ +
+
{:__('是否NCNR')}
+
+ +
+
+ +
+
{:__('交期')}
+
+ +
+
+ +
+
{:__('产地')}
+
+ +
+
+ +
+
{:__('汇天独有')}
+
+ +
+
+ +
+
{:__('小鹏共用')}
+
+ +
+
+ +
+
{:__('创建者')}
+
+ +
+
+
{:__('注释')}
-
- +
+
{:__('更新时间')}
-
- +
+
{:__('创建时间')}
@@ -84,12 +147,12 @@ -
- +
+
-
{:__('物料编码')}
+
{:__('采购编码')}
- +
@@ -147,12 +210,16 @@ ,page: true ,limit: 18 ,cols: [[ - //{type: 'checkbox', width: 50}, - {field: 'id', fixed: 'left', align: 'center',sort: true,width: 50, title: 'ID'}, - {field:'purchasecode',fixed: 'left',sort: true,width: 220,title:'{:__("物料(OA)编码")}'}, - {field:'partitemmfpn',sort: true,title:'{:__("物料描述")}'}, - {field:'content',title:'{:__("注释")}'}, - {field:'status',fixed: 'right',width: 50,templet: '#columnStatus',title:'{:__("状态")}'}, + {type: 'checkbox', width: 50}, + {field: 'id', align: 'center',sort: true,width: 80, title: 'ID'}, + {field:'purchasecode',title:'{:__("采购编码")}'}, +{field:'mpn',title:'{:__("物料描述")}'}, +{field:'preferencelevel',title:'{:__("优选等级")}'}, +{field:'eol',title:'{:__("是否EOL")}'}, +{field:'moq',title:'{:__("MOQ")}'}, +{field:'mpq',title:'{:__("MPQ")}'}, +{field:'ltime',title:'{:__("交期")}'}, +{field:'status',templet: '#columnStatus',title:'{:__("状态")}'}, {align: 'center', toolbar: '#tableBar', width:160, fixed: 'right', title: '{:__("操作")}'}, ]] }) diff --git a/app/admin/view/pdm_symbol/add.html b/app/admin/view/pdm_symbol/add.html index 97381df..ecd761f 100644 --- a/app/admin/view/pdm_symbol/add.html +++ b/app/admin/view/pdm_symbol/add.html @@ -1,83 +1,171 @@ - - - - -
-
- -
- - - - - -
- -
-
+ + + + +
+ -
- -
-
- -
- -
- - - -
-
- -
- -
- -
- -
- -

点击上传,或将文件拖拽到此处

-
-
上传成功后渲染 - 删除 -
-
- -
- -

点击上传,或将文件拖拽到此处

-
-
上传成功后渲染 - 删除 -
+
+ + + + + +
+ +
+
+
+
+ +
+
- -
-
+
-
- -
-
+
+ +
+
-
- -
+
+ +
+ +
+ +
+ +

点击上传,或将文件拖拽到此处

+
+
上传成功后渲染 + 删除 +
+
+ +
+ +

点击上传,或将文件拖拽到此处

+
+
上传成功后渲染 + 删除 +
+
+
+
+
+ +
+ +
+ + + +
+
+ +
+ +
+
+ + +
- - - -
- - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/app/admin/view/pdm_symbol/index.html b/app/admin/view/pdm_symbol/index.html index fd75fcd..4060b6b 100644 --- a/app/admin/view/pdm_symbol/index.html +++ b/app/admin/view/pdm_symbol/index.html @@ -1,5 +1,5 @@ - +
@@ -29,16 +29,9 @@
-
{:__('Symbol预览')}
+
{:__('SymbolView')}
- -
-
- -
-
{:__('器件绑定')}
-
- +
@@ -50,16 +43,9 @@
-
{:__('用户ID')}
+
{:__('创建者')}
- -
-
- -
-
{:__('管理员ID')}
-
- +
@@ -94,9 +80,9 @@
-
{:__('Symbol名称')}
+
{:__('SymbolName')}
- +
@@ -106,6 +92,12 @@ + + + +
@@ -124,6 +116,9 @@ - + + diff --git a/app/common/model/PdmMfgName.php b/app/common/model/PdmMfgName.php deleted file mode 100644 index 04af0d6..0000000 --- a/app/common/model/PdmMfgName.php +++ /dev/null @@ -1,42 +0,0 @@ - - * 制造商名录 - * Class PdmMfgName - * @package app\common\model - */ -class PdmMfgName extends Model -{ - - use SoftDelete; - - // 定义时间戳字段名 - protected $createTime = 'create_time'; - protected $updateTime = 'update_time'; - protected $deleteTime = 'delete_time'; - - - /** - * 定义 sa_user 关联模型 - * @localKey createrid - * @bind name,nickname - */ - public function user() - { - return $this->hasOne(\app\common\model\system\User::Class,'id','createrid')->bind(['name','nickname']); - } - - public function usernames() - { - // return \app\common\model\system\User::select()->toArray(); - return \app\common\model\system\Admin::select()->toArray(); - } - -} \ No newline at end of file diff --git a/app/index/controller/Partlist.php b/app/index/controller/Partlist.php new file mode 100644 index 0000000..c141fba --- /dev/null +++ b/app/index/controller/Partlist.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +namespace app\index\controller; + +use app\HomeController; +use support\Response; + +/** + * 首页控制器 + * + * Class Index + * @package app\index\controller + */ +class Partlist extends HomeController +{ + + /** + * 鉴权控制器 + */ + public $needLogin = false; + + + /** + * 非鉴权方法 + * @var array + */ + public $noNeedAuth = ['index', 'home']; + + // 初始化函数 + public function __construct() + { + parent::__construct(); + } + + /** + * Partlist 首页 + * @return Response + * @throws InvalidArgumentException + */ + public function index(): Response + { + return response('Partlist 前台首页模板'); + } + +} diff --git a/app/index/controller/Partview.php b/app/index/controller/Partview.php new file mode 100644 index 0000000..ba411eb --- /dev/null +++ b/app/index/controller/Partview.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +namespace app\index\controller; + +use app\HomeController; +use support\Response; + +/** + * 首页控制器 + * + * Class Index + * @package app\index\controller + */ +class Partview extends HomeController +{ + + /** + * 鉴权控制器 + */ + public $needLogin = false; + + + /** + * 非鉴权方法 + * @var array + */ + public $noNeedAuth = ['index', 'home']; + + // 初始化函数 + public function __construct() + { + parent::__construct(); + } + + /** + * Partview 首页 + * @return Response + * @throws InvalidArgumentException + */ + public function index(): Response + { + return response('Partview 前台首页模板'); + } + +} diff --git a/app/index/view/index/index.html b/app/index/view/index/index.html index 2d03b07..cea53a9 100644 --- a/app/index/view/index/index.html +++ b/app/index/view/index/index.html @@ -2,7 +2,7 @@ -SwiftAdmin 官方演示站 +产品数据管理(PDM)平台 @@ -16,7 +16,7 @@
-

SWIFTADMIN 极速开发框架

+

基于 SWIFTADMIN 极速开发框架,搭建 PDM系统。

基于高性能WM框架,性能在TP5 10倍以上

SwiftAdmin框架主张简单就是高效的原则,在设计和运维上采用最精简最高效的做法去完成业务系统的需求,并且基于ant Design的设计原则,是一款优秀的前后台极速开发解决方案。相信你第一眼就有立刻想体验SwiftAdmin框架的冲动和热情!

diff --git a/app/index/view/partlist/index.html b/app/index/view/partlist/index.html new file mode 100644 index 0000000..c3ac6a3 --- /dev/null +++ b/app/index/view/partlist/index.html @@ -0,0 +1,22 @@ + + + +
+
+
示例页面 TODO...
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/app/index/view/partview/index.html b/app/index/view/partview/index.html new file mode 100644 index 0000000..2c7aa01 --- /dev/null +++ b/app/index/view/partview/index.html @@ -0,0 +1,22 @@ + + + +
+
+
示例页面 TODO...
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/app/index/view/public/nav.html b/app/index/view/public/nav.html index a889897..365fb97 100644 --- a/app/index/view/public/nav.html +++ b/app/index/view/public/nav.html @@ -17,6 +17,7 @@
  • 注册
  • 登录
  • Ajax登录
  • +
  • 管理后台
  • diff --git a/plugin/partlist/Partlist.php b/plugin/partlist/Partlist.php new file mode 100644 index 0000000..0136be2 --- /dev/null +++ b/plugin/partlist/Partlist.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +* app 文件夹下所有文件将复制到根目录 + +* public 文件夹下所有文件将复制到根目录 + +* Partlist.php 为插件的核心安装文件,请务必按要求书写代码 +> 请注意钩子函数为public类型,如需非钩子函数可使用protected类型 + +* function.php 为当前插件的函数库文件 + +* config.json 为当前插件的配置信息文件 + +* config.html 为当前配置模板,存在才会出现配置按钮 + +* install.sql 插件的数据库安装文件,不需要可删除!! +* +* uninstall.sql 插件的数据库卸载文件,不需要可删除!! + +* library 该目录下为第三方类库文件,如果你的类库文件存在命名空间问题,可手动修改或自行实现install方法将第三方类库复制到extend文件夹下! + diff --git a/plugin/partlist/Upgrade.php b/plugin/partlist/Upgrade.php new file mode 100644 index 0000000..f17744e --- /dev/null +++ b/plugin/partlist/Upgrade.php @@ -0,0 +1,21 @@ + + */ +class Index extends AdminController { + + // 初始化函数 + public function __construct() + { + parent::__construct(); + /** + * TODO... + */ + } + + /** + * 初始化后台首页 + * @return Response + */ + public function index(): Response + { + echo '后台 BOM管理 控制器
    '; + return $this->view(); + } + +} diff --git a/plugin/partlist/app/admin/model/partlist/Partlist.php b/plugin/partlist/app/admin/model/partlist/Partlist.php new file mode 100644 index 0000000..0e549f7 --- /dev/null +++ b/plugin/partlist/app/admin/model/partlist/Partlist.php @@ -0,0 +1,35 @@ + + * @mixin Model + */ +class Partlist 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/partlist/app/admin/validate/partlist/Partlist.php b/plugin/partlist/app/admin/validate/partlist/Partlist.php new file mode 100644 index 0000000..d07e186 --- /dev/null +++ b/plugin/partlist/app/admin/validate/partlist/Partlist.php @@ -0,0 +1,34 @@ + + */ +class Partlist extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/plugin/partlist/app/admin/view/partlist/index/index.html b/plugin/partlist/app/admin/view/partlist/index/index.html new file mode 100644 index 0000000..699e461 --- /dev/null +++ b/plugin/partlist/app/admin/view/partlist/index/index.html @@ -0,0 +1,13 @@ + + + + + + +我是后台首页控制器模板 + + + + 我是 Partlist 控制器模板 + + \ No newline at end of file diff --git a/plugin/partlist/app/index/controller/Partlist.php b/plugin/partlist/app/index/controller/Partlist.php new file mode 100644 index 0000000..c141fba --- /dev/null +++ b/plugin/partlist/app/index/controller/Partlist.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +namespace app\index\controller; + +use app\HomeController; +use support\Response; + +/** + * 首页控制器 + * + * Class Index + * @package app\index\controller + */ +class Partlist extends HomeController +{ + + /** + * 鉴权控制器 + */ + public $needLogin = false; + + + /** + * 非鉴权方法 + * @var array + */ + public $noNeedAuth = ['index', 'home']; + + // 初始化函数 + public function __construct() + { + parent::__construct(); + } + + /** + * Partlist 首页 + * @return Response + * @throws InvalidArgumentException + */ + public function index(): Response + { + return response('Partlist 前台首页模板'); + } + +} diff --git a/plugin/partlist/app/index/view/partlist/index.html b/plugin/partlist/app/index/view/partlist/index.html new file mode 100644 index 0000000..c3ac6a3 --- /dev/null +++ b/plugin/partlist/app/index/view/partlist/index.html @@ -0,0 +1,22 @@ + + + +
    +
    +
    示例页面 TODO...
    + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/plugin/partlist/config.html b/plugin/partlist/config.html new file mode 100644 index 0000000..f0f5e45 --- /dev/null +++ b/plugin/partlist/config.html @@ -0,0 +1,88 @@ + + + + +
    +
    + +
    配置项提示信息 TODO...
    +
    + +
    + +
    +
    + +
    +
    {:__('伪静态规则')}
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    变量名变量值操作
    +
    + +
    + +
    +
    + + + \ No newline at end of file diff --git a/plugin/partlist/config.json b/plugin/partlist/config.json new file mode 100644 index 0000000..772a476 --- /dev/null +++ b/plugin/partlist/config.json @@ -0,0 +1,22 @@ +{ + "name": "partlist", + "title": "BOM管理", + "intro": "BOM管理", + "icon": "fa-home", + "author": "Panjz", + "home": "", + "version": "1.0.0", + "config": 1, + "menu": 1, + "import": 0, + "rewrite": [], + "extends": { + "title": "BOM管理" + }, + "area": [ + "600px", + "650px" + ], + "path": "\/home\/bt_www\/www\/wwwroot\/pdmweb.sa.com_8989\/plugin\/partlist\/", + "status": 1 +} \ No newline at end of file diff --git a/plugin/partlist/function.php b/plugin/partlist/function.php new file mode 100644 index 0000000..c32ff2b --- /dev/null +++ b/plugin/partlist/function.php @@ -0,0 +1,16 @@ + Apache2 +// +---------------------------------------------------------------------- + +* app 文件夹下所有文件将复制到根目录 + +* public 文件夹下所有文件将复制到根目录 + +* Partview.php 为插件的核心安装文件,请务必按要求书写代码 +> 请注意钩子函数为public类型,如需非钩子函数可使用protected类型 + +* function.php 为当前插件的函数库文件 + +* config.json 为当前插件的配置信息文件 + +* config.html 为当前配置模板,存在才会出现配置按钮 + +* install.sql 插件的数据库安装文件,不需要可删除!! +* +* uninstall.sql 插件的数据库卸载文件,不需要可删除!! + +* library 该目录下为第三方类库文件,如果你的类库文件存在命名空间问题,可手动修改或自行实现install方法将第三方类库复制到extend文件夹下! + diff --git a/plugin/partview/Upgrade.php b/plugin/partview/Upgrade.php new file mode 100644 index 0000000..5e8ca05 --- /dev/null +++ b/plugin/partview/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/partview/app/admin/model/partview/Partview.php b/plugin/partview/app/admin/model/partview/Partview.php new file mode 100644 index 0000000..174a5f1 --- /dev/null +++ b/plugin/partview/app/admin/model/partview/Partview.php @@ -0,0 +1,35 @@ + + * @mixin Model + */ +class Partview 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/partview/app/admin/validate/partview/Partview.php b/plugin/partview/app/admin/validate/partview/Partview.php new file mode 100644 index 0000000..2154f9c --- /dev/null +++ b/plugin/partview/app/admin/validate/partview/Partview.php @@ -0,0 +1,34 @@ + + */ +class Partview extends Validate +{ + /** + * 验证规则 + */ + protected $rule = [ + ]; + + + /** + * 提示消息 + */ + protected $message = [ + ]; + + + /** + * 验证场景 + */ + protected $scene = [ + 'add' => [], + 'edit' => [], + ]; + +} diff --git a/plugin/partview/app/admin/view/partview/index/index.html b/plugin/partview/app/admin/view/partview/index/index.html new file mode 100644 index 0000000..580446f --- /dev/null +++ b/plugin/partview/app/admin/view/partview/index/index.html @@ -0,0 +1,13 @@ + + + + + + +我是后台首页控制器模板 + + + + 我是 Partview 控制器模板 + + \ No newline at end of file diff --git a/plugin/partview/app/index/controller/Partview.php b/plugin/partview/app/index/controller/Partview.php new file mode 100644 index 0000000..ba411eb --- /dev/null +++ b/plugin/partview/app/index/controller/Partview.php @@ -0,0 +1,55 @@ + Apache2 +// +---------------------------------------------------------------------- + +namespace app\index\controller; + +use app\HomeController; +use support\Response; + +/** + * 首页控制器 + * + * Class Index + * @package app\index\controller + */ +class Partview extends HomeController +{ + + /** + * 鉴权控制器 + */ + public $needLogin = false; + + + /** + * 非鉴权方法 + * @var array + */ + public $noNeedAuth = ['index', 'home']; + + // 初始化函数 + public function __construct() + { + parent::__construct(); + } + + /** + * Partview 首页 + * @return Response + * @throws InvalidArgumentException + */ + public function index(): Response + { + return response('Partview 前台首页模板'); + } + +} diff --git a/plugin/partview/app/index/view/partview/index.html b/plugin/partview/app/index/view/partview/index.html new file mode 100644 index 0000000..2c7aa01 --- /dev/null +++ b/plugin/partview/app/index/view/partview/index.html @@ -0,0 +1,22 @@ + + + +
    +
    +
    示例页面 TODO...
    + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/plugin/partview/config.html b/plugin/partview/config.html new file mode 100644 index 0000000..aed085e --- /dev/null +++ b/plugin/partview/config.html @@ -0,0 +1,88 @@ + + + + +
    +
    + +
    配置项提示信息 TODO...
    +
    + +
    + +
    +
    + +
    +
    {:__('伪静态规则')}
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    变量名变量值操作
    +
    + +
    + +
    +
    + + + \ No newline at end of file diff --git a/plugin/partview/config.json b/plugin/partview/config.json new file mode 100644 index 0000000..7f3ec56 --- /dev/null +++ b/plugin/partview/config.json @@ -0,0 +1,22 @@ +{ + "name": "partview", + "title": "部件查询", + "intro": "部件查询", + "icon": "fa-search", + "author": "Panjz", + "home": "", + "version": "1.0.0", + "config": 1, + "menu": 1, + "import": 0, + "rewrite": [], + "extends": { + "title": "部件查询" + }, + "area": [ + "600px", + "650px" + ], + "path": "\/home\/bt_www\/www\/wwwroot\/pdmweb.sa.com_8989\/plugin\/partview\/", + "status": 1 +} \ No newline at end of file diff --git a/plugin/partview/function.php b/plugin/partview/function.php new file mode 100644 index 0000000..df45c3c --- /dev/null +++ b/plugin/partview/function.php @@ -0,0 +1,16 @@ +