Initial commit,修正

This commit is contained in:
2025-07-13 19:37:38 +08:00
parent 38ce288e27
commit 65bbd06981
12384 changed files with 3985464 additions and 8 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="menu-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'parent' )->dropDownList($menuArr)?>
<?= $form->field($model, 'route')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'sort')->textInput()->label('排序') ?>
<?= $form->field($model, 'status')->radioList(['1'=>'显示','0'=>'隐藏'])->label('显示')?>
<?= $form->field($model, 'data')->textarea(['rows' => 6]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
+23
View File
@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
$this->title = '创建菜单';
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<?= $this->render('_form', [
'model' => $model,
'menuArr' => $menuArr,
]) ?>
</div>
</div>
+85
View File
@@ -0,0 +1,85 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use yii\widgets\LinkPager;
$this->title = '菜单';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
<div class="ibox float-e-margins">
<div class="ibox-content">
<p>
<?= Html::a('创建菜单', ['create'], ['class' => 'btn btn-sm btn-primary']) ?>
</p>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>父级</th>
<th>路由</th>
<th>状态</th>
<th>排序</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($menu as $vo):?>
<tr>
<td><?=$vo['id']?></td>
<td><?=$vo['name']?></td>
<td><?=$vo['parent']?></td>
<td><?=$vo['route']?></td>
<td><?=$vo['status'] >0 ? '显示 ' : '隐藏'?></td>
<td><?=($vo['sort']==''?'未排序':$vo['sort'])?></td>
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['menu/update','id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a> <a class="btn btn-default btn-xs" href="<?=Url::toRoute(['menu/delete','id'=>$vo['id']])?>"><i class="fa fa-close"></i>删除</a></td>
</tr>
<?php if(!empty($vo['_child'])):?>
<?php foreach($vo['_child'] as $v):?>
<tr>
<td><?=$v['id']?></td>
<td><?=$v['name']?></td>
<td><?=$v['parent']?></td>
<td><?=$v['route']?></td>
<td><?=$v['status'] > 0 ? '显示' : '隐藏'?></td>
<td><?=($v['sort']==''?'未排序':$v['sort'])?></td>
<td><a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['menu/update','id'=>$v['id']])?>"><i class="fa fa-edit"></i>编辑</a> <a class="btn btn-default btn-xs" href="<?=Url::toRoute(['menu/delete','id'=>$v['id']])?>"><i class="fa fa-close"></i>删除</a></td>
</tr>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</tbody>
</table>
<!--分页-->
<!--<div class="f-r">
<?/*= LinkPager::widget([
'pagination'=>$pages,
'firstPageLabel' => '首页',
'nextPageLabel' => '下一页',
'prevPageLabel' => '上一页',
'lastPageLabel' => '末页',
]) */?>
</div>-->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+22
View File
@@ -0,0 +1,22 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
$this->title = '更新菜单: ' . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="wrapper wrapper-content ">
<div class="ibox-content">
<h1><?= Html::encode($this->title) ?></h1>
<hr>
<?= $this->render('_form', [
'model' => $model,
'menuArr' => $menuArr,
]) ?>
</div>
</div>
+40
View File
@@ -0,0 +1,40 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\Menu */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content animated fadeInRight">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('创建', ['create'], ['class' => 'btn btn-primary']) ?>
<?= Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('删除', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'name',
'parent',
'route',
'sort',
'data:ntext',
],
]) ?>
</div>