12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <div style="margin-top: 10px;" id="permissions-app">
- <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
- 管理 - 权限
- </div>
- <el-form action="{{route('admin.permission.save')}}" method="post" id="form-create">
- {{--<ui-checkbox label="添加权限:" :params="params" tips="勾选增加权限"></ui-checkbox>--}}
- <input type="hidden" name="role_id" value="{{$role_id}}">
- <input type="hidden" name="ids" id="ids" value="{{implode(',',$select_ids)}}">
- <ui-tree @set-keys="getSelectKeys" :list="list" :select_ids="select_ids"></ui-tree>
- <ui-submit></ui-submit>
- </el-form>
- </div>
- <script type="application/javascript">
- $(function () {
- // 注意:Vue组件一定放在jQuery.validator前面验证
- new Vue({
- el: '#permissions-app',
- data :function () {
- return {
- 'list':<?php echo $list?>,
- 'select_ids':<?php echo json_encode($select_ids)?>,
- };
- },
- methods:{
- getSelectKeys:function (select_keys) {
- console.log('开始接收参数');
- console.log(select_keys);
- $('#ids').val(select_keys.join(','));
- }
- }
- });
- jQuery.validator.setDefaults({
- debug: false, // 调试模式true不会提交,false允许提交
- success: "success", // 匹配成功的class样式名称
- errorElement: 'div' // 兼容el标签时使用(兼容el Vue组件label.error标签问题)
- });
- // 前台数据验证 验证需要设置window.form全局变量
- window.form = $('#form-create').validate({
- rules: {
- }
- });
- });
- </script>
- @include('layouts.admin.form_script')
|