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 @@ - - - - -
-
- -
- - - - - -
- -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - -
名称变量值操作
- -
-
- -
-
便签信息
-
- -
- -
-
- - - -
- - \ No newline at end of file diff --git a/app/admin/view/pdm_partitem/index.html b/app/admin/view/pdm_partitem/index.html deleted file mode 100644 index 68fbab5..0000000 --- a/app/admin/view/pdm_partitem/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - -
-
- -
-
- - -
-
- -
- -
-
{:__('PartNumber')}
-
- -
-
-
- - - - - -
-
-
-
- -
-
-
- - - - - - - - - - - - - diff --git a/app/admin/view/pdm_partitem_index/add.html b/app/admin/view/pdm_partitem_index/add.html index 1dd83af..f1cc029 100644 --- a/app/admin/view/pdm_partitem_index/add.html +++ b/app/admin/view/pdm_partitem_index/add.html @@ -176,6 +176,7 @@ theme: { color: '#1890FF' } + ,filterable: true // 启用筛选功能 }) // iconPicker.render({ diff --git a/app/admin/view/pdm_partitem_relation/add.html b/app/admin/view/pdm_partitem_relation/add.html index 2076535..07a74b9 100644 --- a/app/admin/view/pdm_partitem_relation/add.html +++ b/app/admin/view/pdm_partitem_relation/add.html @@ -13,10 +13,17 @@ -
+ + +
+ +
+
+
@@ -85,6 +92,7 @@ let data = {$list|raw}; let symboldata= {$symbol|raw}; let footprintdata= {$footprint|raw}; + let partnumberdata= {$partitemIndex|raw}; // 提交参数 form.on("submit(submit)",function(data){ @@ -132,6 +140,7 @@ theme: { color: '#1890FF' } + ,filterable: true // 启用筛选功能 }) @@ -165,6 +174,40 @@ theme: { color: '#1890FF' } + ,filterable: true // 启用筛选功能 + }) + + xmSelect.render({ + el: '#partnumberNode', + tips: '请选择Partnumber', + // name: 'pid', + name: 'partnumber', + height: '260px', + data: partnumberdata, + // data: data, + radio: true, + clickClose: true, + initValue:[$('#partnumberNode').data('pid')], + prop: { + value: 'partnumber', + name:'partnumber' + }, + tree: { + show: true, + strict: false, + showLine: false, + clickExpand: false, + }, + model: { + icon: 'hidden', + label: { + type: 'text' + } + }, + theme: { + color: '#1890FF' + } + ,filterable: true // 启用筛选功能 }) // iconPicker.render({ diff --git a/app/admin/view/pdm_partitem_view/index.html b/app/admin/view/pdm_partitem_view/index.html index 224dae1..4249128 100644 --- a/app/admin/view/pdm_partitem_view/index.html +++ b/app/admin/view/pdm_partitem_view/index.html @@ -195,7 +195,7 @@ { field: 'value', sort: true,width: 160, title: '{:__("Value")}' }, { field: 'description', width: 250, title: '{:__("描述")}' }, { field: 'mpn', sort: true, width: 160, title: '{:__("MPN")}' }, - { field: 'mfgname', sort: true, width: 160, title: '{:__("制造商名称")}' }, + { field: 'mfg', sort: true, width: 160, title: '{:__("制造商名称")}' }, { field: 'symbol', width: 160, title: '{:__("SymbolName")}' }, { field: 'footprint',width: 160, sort: true, title: '{:__("Footprint")}' }, //{ field: 'datasheet', title: '{:__("规格书")}' }, diff --git a/app/admin/view/pdm_parttype/add.html b/app/admin/view/pdm_parttype/add.html index 599f98e..8ba4dab 100644 --- a/app/admin/view/pdm_parttype/add.html +++ b/app/admin/view/pdm_parttype/add.html @@ -147,6 +147,7 @@ theme: { color: '#1890FF' } + ,filterable: true // 启用筛选功能 }) iconPicker.render({ diff --git a/app/admin/view/pdm_symbol/add.html b/app/admin/view/pdm_symbol/add.html index 9092915..ce28aab 100644 --- a/app/admin/view/pdm_symbol/add.html +++ b/app/admin/view/pdm_symbol/add.html @@ -147,6 +147,7 @@ theme: { color: '#1890FF' } + ,filterable: true // 启用筛选功能 }) iconPicker.render({