update Area + Device

This commit is contained in:
2020-10-08 17:12:19 +07:00
parent 2d15fc1c14
commit 0273aa2179
31 changed files with 1475 additions and 557 deletions

22
widgets/Department.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
namespace app\widgets;
use yii\base\Widget;
class Department extends Widget {
public $pid;
public function init() {
parent::init();
}
public function run() {
return $this->render("department", [
"lists" => \app\models\Department::find()->andWhere(['pid' => $this->pid])->all()
]);
}
}

View File

@@ -0,0 +1,9 @@
{foreach from=$lists item=l}
<div style="cursor: pointer;">
<i class="fa fa-minus-square-o" onclick="common.tree(this);" data="{$l->code}" data-stt="true"></i>
<span class="tree-drop">{$l->code}-{$l->name}</span>
<div id="sub-tree-{$l->code}" style="padding-left: 20px;">
{\app\widgets\Department::widget(["pid"=>$l->code])}
</div>
</div>
{/foreach}