diff --git a/.gitignore b/.gitignore
index cf6f1e3..336a53b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,9 @@
public/static/json/2/treeTable/demo-1.json
public/test.html
+app/admin/view/pdm_partlist/add copy.html
+app/admin/view/pdm_partlist/index copy.html
+app/admin/view/pdm_partitem_relation copy/add.html
+app/admin/view/pdm_partitem_relation copy/index.html
+
+public/upload/datasheet/*
+public/upload/datasheet*
\ No newline at end of file
diff --git a/app/admin/controller/PdmPartitemIndex.php b/app/admin/controller/PdmPartitemIndex.php
index fa2b2b5..1df3b0f 100644
--- a/app/admin/controller/PdmPartitemIndex.php
+++ b/app/admin/controller/PdmPartitemIndex.php
@@ -59,7 +59,7 @@ class PdmPartitemIndex extends AdminController
* @throws DbException
* @throws ModelNotFoundException
*/
- public function dataList(array $params): array
+ public static function dataList(array $params): array
{
// $where = array();
// if (!empty($params['partnumber'])) {
@@ -91,14 +91,17 @@ class PdmPartitemIndex extends AdminController
$page = (int)input('page', 1);
$limit = (int)input('limit', 18);
- $where = $this->buildSelectParams();
- $count = $this->model->where($where)->count();
- $fieldList = $this->model->getFields();
+
+ $controller = new PdmPartitemIndex();
+
+ $where = $controller->buildSelectParams();
+ $count = $controller->model->where($where)->count();
+ $fieldList = $controller->model->getFields();
$order = !array_key_exists('sort', $fieldList) ? 'id' : 'sort';
- $subQuery = $this->model->field('id')->where($where)->order($order, 'desc')->limit($limit)->page($page)->buildSql();
+ $subQuery = $controller->model->field('id')->where($where)->order($order, 'desc')->limit($limit)->page($page)->buildSql();
$subQuery = '( SELECT object.id FROM ' . $subQuery . ' AS object )';
// $list = $this->model->with($this->relationModel)->where('id in' . $subQuery)->order($order, 'asc')->select()->toArray(); // 如果是'desc' list_to_tree 函数返回为空!
- $list = $this->model->with($this->relationModel)->where('id in' . $subQuery)->order($order, 'asc')->select(); // 如果是'desc' list_to_tree 函数返回为空!
+ $list = $controller->model->with($controller->relationModel)->where('id in' . $subQuery)->order($order, 'asc')->select(); // 如果是'desc' list_to_tree 函数返回为空!
foreach($list as $key => $value){
// throw new \Exception(json_encode($value));
@@ -127,8 +130,8 @@ class PdmPartitemIndex extends AdminController
foreach($list as $key => $value){
if(!in_array($value['pid'],$nodeid) && $value['pid'] > 0){
$nodeid[] = $value['pid'];
- $nodevalue = $this->model->find($value['pid']);
- $nodevalue = $this->model->find($value['pid'])->toArray();
+ $nodevalue = $controller->model->find($value['pid']);
+ $nodevalue = $controller->model->find($value['pid'])->toArray();
if(!empty($nodevalue)){
$list[] = &$nodevalue;
diff --git a/app/admin/controller/PdmPartitemRelation.php b/app/admin/controller/PdmPartitemRelation.php
index 70740e2..29870da 100644
--- a/app/admin/controller/PdmPartitemRelation.php
+++ b/app/admin/controller/PdmPartitemRelation.php
@@ -7,6 +7,7 @@ use Webman\Http\Request;
use app\admin\model\PdmPartitemRelation as PdmPartitemRelationModel;
use app\admin\model\PdmSymbol as PdmSymbolModel;
use app\admin\model\PdmFootprint as PdmFootprintModel;
+use app\admin\model\PdmPartitemIndex as PdmPartitemIndexModel;
use support\Response;
/**
@@ -154,6 +155,7 @@ class PdmPartitemRelation extends AdminController
{
$symbol = PdmSymbolModel::select()->toArray();
$footprint = PdmFootprintModel::select()->toArray();
+ $partitemIndex = PdmPartitemIndexModel::select()->toArray();
if (request()->isPost()) {
$post = \request()->post();
@@ -179,6 +181,7 @@ class PdmPartitemRelation extends AdminController
'data' => $data,
'symbol' => json_encode( list_to_tree($symbol), JSON_UNESCAPED_UNICODE),
'footprint' => json_encode( list_to_tree($footprint), JSON_UNESCAPED_UNICODE),
+ 'partitemIndex' => json_encode( list_to_tree($partitemIndex), JSON_UNESCAPED_UNICODE),
// 'parttype' => $this->parttype,
'list' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE),
]);
@@ -199,12 +202,18 @@ class PdmPartitemRelation extends AdminController
$symbolid = $data['symbolid'];
$footprintid = $data['footprintid'];
+ $partnumbertemp = $data['partnumber'];
// $parems['id'] = input('parttypeid', 0);
$symbol = PdmSymbolModel::find($symbolid)->toArray();
list($countsymbol, $symbol) = \app\admin\controller\PdmSymbol::dataList($symbol);
$footprint = PdmFootprintModel::find($footprintid)->toArray();
list($countfootprint, $footprint) = \app\admin\controller\PdmFootprint::dataList($footprint);
+ $where = ['partnumber' => $partnumbertemp];
+ // $partnumbertemp1 = PdmPartitemIndexModel::find($partnumbertemp)->toArray();
+ $partnumbertemp1 = PdmPartitemIndexModel::where($where)->select()->toArray();
+ list($countpartnumberIndex, $partitemIndex) = \app\admin\controller\PdmPartitemIndex::dataList($partnumbertemp1);
+
if (request()->isPost()) {
$post = \request()->post();
@@ -221,6 +230,7 @@ class PdmPartitemRelation extends AdminController
'data' => $data,
'symbol' => json_encode( list_to_tree($symbol), JSON_UNESCAPED_UNICODE),
'footprint' => json_encode( list_to_tree($footprint), JSON_UNESCAPED_UNICODE),
+ 'partitemIndex' => json_encode( list_to_tree($partitemIndex), JSON_UNESCAPED_UNICODE),
// 'parttype' => json_encode( $parttype, JSON_UNESCAPED_UNICODE),
'list' => json_encode( list_to_tree($list), JSON_UNESCAPED_UNICODE),
]);
diff --git a/app/admin/view/pdm_footprint/add.html b/app/admin/view/pdm_footprint/add.html
index 69ef3ea..3f43518 100644
--- a/app/admin/view/pdm_footprint/add.html
+++ b/app/admin/view/pdm_footprint/add.html
@@ -152,6 +152,7 @@
theme: {
color: '#1890FF'
}
+ ,filterable: true // 启用筛选功能
})
iconPicker.render({
diff --git a/app/admin/view/pdm_partitem/add.html b/app/admin/view/pdm_partitem/add.html
deleted file mode 100644
index 57f4fae..0000000
--- a/app/admin/view/pdm_partitem/add.html
+++ /dev/null
@@ -1,67 +0,0 @@
-