Commit 3cf30cd2 by 杨树贤

优化和修复bug

parent c766cc51
......@@ -187,6 +187,8 @@ class SupplierAccountApiController extends Controller
$this->response(-1, $validator->errors()->first());
}
$data['user_rule'] = $data['user_rule'] ?: [];
dd($data['user_rule']);
$data['user_rule'] = json_encode($data['user_rule']);
$data['user_message_rule'] = $data['user_message_rule'] ?: [];
$data['user_message_rule'] = json_encode($data['user_message_rule']);
......
......@@ -34,7 +34,6 @@
});
let permTreeData = {!! json_encode($menuPerms) !!};
console.log(permTreeData);
// 渲染树形组件
let permTree = tree.render({
elem: '#permTree',
......@@ -57,6 +56,8 @@
}
});
let isAllSelectPem = false;
let isAllSelectMessagePem = false;
function allSelect(data) {
$.each(data, function (index, item) {
......@@ -69,17 +70,49 @@
})
}
})
});
return data;
}
function excludeAllSelect(data) {
$.each(data, function (index, item) {
if (!item.disabled) {
item.checked = false;
}
if (item.children.length) {
$.each(item.children, function (index2, item2) {
if (item2.checked) {
item2.checked = false;
}
})
}
});
return data;
}
$('#selectAllPerm').click(function () {
allSelect(permTreeData);
tree.reload('permTree');
if (!isAllSelectPem) {
allSelect(permTreeData);
} else {
excludeAllSelect(permTreeData);
}
isAllSelectPem = !isAllSelectPem;
tree.reload('permTree', {
data: permTreeData
});
$('#permTree .layui-checkbox-disbaled').addClass('layui-form-checked');
});
$('#selectAllMessagePerm').click(function () {
allSelect(messagePermTreeData);
tree.reload('messagePermTree');
if (!isAllSelectMessagePem) {
messagePermTreeData = allSelect(messagePermTreeData);
} else {
messagePermTreeData = excludeAllSelect(messagePermTreeData);
}
isAllSelectMessagePem = !isAllSelectMessagePem;
tree.reload('messagePermTree', {data: messagePermTreeData});
});
$(function () {
......
......@@ -21,6 +21,8 @@
return '<span>' + '**********' + '</span><span style="color: dodgerblue;margin-left: 10px" class="viewAccount" type="password_raw" id="' + data.id + '"></span>'
}
},
{field: 'name', title: '联系人', align: 'center', width: 100},
{field: 'status_cn', title: '状态', align: 'center', width: 80},
{field: 'create_type_cn', title: '创建人', align: 'center', width: 150},
{field: 'create_time_cn', title: '创建时间', align: 'center', width: 150},
{field: 'update_time_cn', title: '修改时间', align: 'center', width: 150},
......
......@@ -43,7 +43,7 @@
<div class="layui-col-md3">
<div class="layui-form-item">
<label class="layui-form-label"><span class="require">*</span>名称 : </label>
<label class="layui-form-label"><span class="require">*</span>联系人 : </label>
<div class="layui-input-block">
<input type="text" name="name" id="name"
placeholder="请输入名称" class="layui-input"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment