Example #1
0
 public static function fields()
 {
     return ['add' => ['bid' => ['label' => '所属门店', 'type' => 'select', 'inputOptions' => ['class' => 'col-lg-3'], 'options' => Branch::options(), 'default' => 0, 'validator' => ['required' => true]], 'did' => ['label' => '部门名称', 'type' => 'select', 'inputOptions' => ['class' => 'col-lg-3'], 'options' => Department::options(), 'default' => 0, 'validator' => ['required' => true]], 'name' => ['label' => '角色名称', 'type' => 'text', 'inputOptions' => ['class' => 'col-lg-3'], 'validator' => ['required' => true, 'minlength' => 2, 'maxlength' => 10], 'remark' => '名称在2-10个字符之间']], 'edit' => ['rid' => ['type' => 'hidden'], 'bid' => ['label' => '所属门店', 'type' => 'select', 'inputOptions' => ['class' => 'col-lg-3'], 'options' => Branch::options(), 'default' => 0, 'validator' => ['required' => true]], 'did' => ['label' => '部门名称', 'type' => 'select', 'inputOptions' => ['class' => 'col-lg-3'], 'options' => Department::options(), 'default' => 0, 'validator' => ['required' => true]], 'name' => ['label' => '角色名称', 'type' => 'text', 'inputOptions' => ['class' => 'col-lg-3'], 'validator' => ['required' => true, 'minlength' => 2, 'maxlength' => 10], 'remark' => '名称在2-10个字符之间']], 'auth' => ['rid' => ['type' => 'hidden'], 'auth' => ['type' => 'checkbox', 'safe' => true]]];
 }
Example #2
0
 public static function fields()
 {
     return ['add' => ['oid' => null, 'bid' => ['label' => '所属分店', 'type' => 'select', 'inputOptions' => [], 'options' => Branch::options(), 'default' => null, 'validator' => ['required' => true]], 'did' => ['label' => '所属部门', 'type' => 'select', 'inputOptions' => ['class' => 'col-lg-3'], 'options' => Department::options(), 'default' => 0, 'validator' => ['required' => true]], 'rid' => ['label' => '角色名称', 'type' => 'select', 'inputOptions' => ['class' => 'col-lg-3'], 'options' => Role::options(), 'default' => 0, 'validator' => ['required' => true]], 'username' => ['label' => '用户名', 'type' => 'text', 'inputOptions' => ['class' => 'col-lg-3'], 'validator' => ['required' => true, 'minlength' => 3, 'maxlength' => 20, 'regex' => '^[\\\\w_]+$', 'remote' => \Func\url('/operator/exist')], 'remark' => '用户名在3-20个字符之间, 字母数字或下划线组成', 'remarkOptions' => ['class' => 'col-lg-4']], 'password' => ['label' => '密码', 'type' => 'password', 'inputOptions' => ['class' => 'col-lg-3'], 'validator' => ['required' => true, 'minlength' => 6, 'maxlength' => 12]], 'repassword' => ['label' => '确认密码', 'type' => 'password', 'inputOptions' => ['class' => 'col-lg-3'], 'validator' => ['required' => true, 'equalTo' => '[name=password]']]], 'edit' => ['oid' => ['type' => 'hidden'], 'username' => ['label' => '用户名', 'type' => 'plain', 'default' => null], 'bid' => ['label' => '所属分店', 'type' => 'select', 'inputOptions' => [], 'options' => Branch::options(), 'default' => null, 'validator' => ['required' => true]], 'did' => ['label' => '所属部门', 'type' => 'select', 'inputOptions' => ['class' => 'col-lg-3'], 'options' => Department::options(), 'default' => 0, 'validator' => ['required' => true]], 'rid' => ['label' => '角色名称', 'type' => 'select', 'inputOptions' => [], 'options' => Role::options(), 'default' => null, 'validator' => ['required' => true]], 'password' => ['label' => '密码', 'type' => 'password', 'inputOptions' => [], 'validator' => ['minlength' => 6, 'maxlength' => 12]], 'repassword' => ['label' => '确认密码', 'type' => 'password', 'inputOptions' => [], 'validator' => ['equalTo' => '[name=password]']]]];
 }