解决冲突
This commit is contained in:
commit
05e50de53b
|
@ -183,7 +183,7 @@ class CompanyCreateView(CreateView):
|
||||||
menus = list(role.permissions.all().values_list('menuid',flat=True))
|
menus = list(role.permissions.all().values_list('menuid',flat=True))
|
||||||
s_models.Group.objects.create(groupname='超管', grouptype=0, usecomp=obj, menulist=menus)
|
s_models.Group.objects.create(groupname='超管', grouptype=0, usecomp=obj, menulist=menus)
|
||||||
s_models.Group.objects.create(groupname='安全员', grouptype=1, usecomp=obj, menulist=menus)
|
s_models.Group.objects.create(groupname='安全员', grouptype=1, usecomp=obj, menulist=menus)
|
||||||
# s_models.Group.objects.create(groupname='全体用户', grouptype=3, usecomp=obj, menulist=[11])
|
s_models.Group.objects.create(groupname='全体用户', grouptype=3, usecomp=obj, menulist=[11])
|
||||||
z = s_models.Group.objects.create(groupname='主管', grouptype=2,usecomp=obj, menulist=menus)
|
z = s_models.Group.objects.create(groupname='主管', grouptype=2,usecomp=obj, menulist=menus)
|
||||||
z.users.add(adminuser)
|
z.users.add(adminuser)
|
||||||
s_models.Yjsetup.objects.create(monthyhavg=100, safev=50, warnv=75, alertv=100, maxv=200, yhpgqz=4,
|
s_models.Yjsetup.objects.create(monthyhavg=100, safev=50, warnv=75, alertv=100, maxv=200, yhpgqz=4,
|
||||||
|
|
|
@ -178,27 +178,6 @@
|
||||||
$("#tmtable").datagrid('reload');
|
$("#tmtable").datagrid('reload');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#gwfl').datagrid({
|
|
||||||
url: 'grouphandle?a=list',
|
|
||||||
|
|
||||||
rownumbers: true,
|
|
||||||
singleSelect: true,
|
|
||||||
striped: true,
|
|
||||||
method: 'get',
|
|
||||||
border:false,
|
|
||||||
title:'按岗位',
|
|
||||||
columns: [[
|
|
||||||
{ field: 'groupid', title: '用户组ID', hidden: true },
|
|
||||||
{ field: 'groupname', title: '名称', width: 100 },
|
|
||||||
{ field: 'grouptype', title: '类型', hidden:true,width: 100 },
|
|
||||||
]],
|
|
||||||
onClickRow: function (index, row) {
|
|
||||||
|
|
||||||
$("#tmtable").datagrid({
|
|
||||||
url: 'api/question?a=listall&gwlx=' + row.groupid,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#tmtable').datagrid({
|
$('#tmtable').datagrid({
|
||||||
url:'api/question',
|
url:'api/question',
|
||||||
queryParams:{a:'listall'},
|
queryParams:{a:'listall'},
|
||||||
|
|
|
@ -18,20 +18,6 @@
|
||||||
<input id="cate" name="cate" style="width:480px;" class="easyui-combotree" data-options="label:'分类',"
|
<input id="cate" name="cate" style="width:480px;" class="easyui-combotree" data-options="label:'分类',"
|
||||||
editable=false required = true/>
|
editable=false required = true/>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-bottom:5px">
|
|
||||||
<input id="station" name="station" style="width:480px;" class="easyui-combobox"
|
|
||||||
data-options="label:'岗位'," editable=false />
|
|
||||||
<script>
|
|
||||||
$.get('grouphandle?a=list', function (res) {
|
|
||||||
$("#station").combobox({
|
|
||||||
data: res.rows,
|
|
||||||
valueField: 'groupid',
|
|
||||||
textField: 'groupname',
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</div> -->
|
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -41,20 +41,6 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-bottom:5px">
|
|
||||||
<input id="station" name="station" style="width:480px;" class="easyui-combobox"
|
|
||||||
data-options="label:'岗位'," editable=false />
|
|
||||||
<script>
|
|
||||||
$.get('grouphandle?a=list', function (res) {
|
|
||||||
$("#station").combobox({
|
|
||||||
data: res.rows,
|
|
||||||
valueField: 'groupid',
|
|
||||||
textField: 'groupname',
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</div> -->
|
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;"
|
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;"
|
||||||
data-options="prompt:'输入字符回车形成标签'">
|
data-options="prompt:'输入字符回车形成标签'">
|
||||||
|
|
|
@ -42,20 +42,6 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-bottom:5px">
|
|
||||||
<input id="station" name="station" style="width:480px;" class="easyui-combobox"
|
|
||||||
data-options="label:'岗位'," editable=false />
|
|
||||||
<script>
|
|
||||||
$.get('grouphandle?a=list', function (res) {
|
|
||||||
$("#station").combobox({
|
|
||||||
data: res.rows,
|
|
||||||
valueField: 'groupid',
|
|
||||||
textField: 'groupname',
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</div> -->
|
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -106,26 +106,6 @@
|
||||||
$("#tmtable").datagrid('reload');
|
$("#tmtable").datagrid('reload');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// $('#gwfl').datagrid({
|
|
||||||
// url: 'grouphandle?a=list',
|
|
||||||
// rownumbers: true,
|
|
||||||
// singleSelect: true,
|
|
||||||
// striped: true,
|
|
||||||
// method: 'get',
|
|
||||||
// border:false,
|
|
||||||
// title:'按岗位',
|
|
||||||
// columns: [[
|
|
||||||
|
|
||||||
// { field: 'groupid', title: '用户组ID', hidden: true },
|
|
||||||
// { field: 'groupname', title: '名称', width: 100 },
|
|
||||||
// { field: 'grouptype', title: '类型', hidden:true,width: 100 },
|
|
||||||
// ]],
|
|
||||||
// onClickRow: function (index, row) {
|
|
||||||
// $("#tmtable").datagrid({
|
|
||||||
// url: 'api/question?a=listall&gwlx=' + row.groupid,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
$('#tmtable').datagrid({
|
$('#tmtable').datagrid({
|
||||||
url:'api/question?a=listall',
|
url:'api/question?a=listall',
|
||||||
rownumbers: true,
|
rownumbers: true,
|
||||||
|
|
|
@ -18,20 +18,6 @@
|
||||||
<input id="cate" name="cate" style="width:480px;" class="easyui-combotree" data-options="label:'分类',"
|
<input id="cate" name="cate" style="width:480px;" class="easyui-combotree" data-options="label:'分类',"
|
||||||
editable=false required = true/>
|
editable=false required = true/>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-bottom:5px">
|
|
||||||
<input id="station" name="station" style="width:480px;" class="easyui-combobox"
|
|
||||||
data-options="label:'岗位'," editable=false />
|
|
||||||
<script>
|
|
||||||
$.get('grouphandle?a=list', function (res) {
|
|
||||||
$("#station").combobox({
|
|
||||||
data: res.rows,
|
|
||||||
valueField: 'groupid',
|
|
||||||
textField: 'groupname',
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</div> -->
|
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -41,20 +41,6 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-bottom:5px">
|
|
||||||
<input id="station" name="station" style="width:480px;" class="easyui-combobox"
|
|
||||||
data-options="label:'岗位'," editable=false />
|
|
||||||
<script>
|
|
||||||
$.get('grouphandle?a=list', function (res) {
|
|
||||||
$("#station").combobox({
|
|
||||||
data: res.rows,
|
|
||||||
valueField: 'groupid',
|
|
||||||
textField: 'groupname',
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</div> -->
|
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;"
|
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;"
|
||||||
data-options="prompt:'输入字符回车形成标签'">
|
data-options="prompt:'输入字符回车形成标签'">
|
||||||
|
|
|
@ -42,20 +42,6 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-bottom:5px">
|
|
||||||
<input id="station" name="station" style="width:480px;" class="easyui-combobox"
|
|
||||||
data-options="label:'岗位'," editable=false />
|
|
||||||
<script>
|
|
||||||
$.get('grouphandle?a=list', function (res) {
|
|
||||||
$("#station").combobox({
|
|
||||||
data: res.rows,
|
|
||||||
valueField: 'groupid',
|
|
||||||
textField: 'groupname',
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</div> -->
|
|
||||||
<div style="margin-bottom:5px">
|
<div style="margin-bottom:5px">
|
||||||
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
<input class="easyui-tagbox" value="" name="label" label="标签" style="width:480px;" data-options="prompt:'输入字符回车形成标签'">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
toolbar: '#safelisttablebar',
|
toolbar: '#safelisttablebar',
|
||||||
border: false,
|
border: false,
|
||||||
onSelect: function (index, data) {
|
onSelect: function (index, data) {
|
||||||
$('#safeitemtable').datagrid({ url: 'api/safeitem/?a=listall&safelist=' + data.id })
|
$('#safeitemtable').datagrid({ url: 'api/safeitem/?a=listall&safelist=' + data.id, queryParams:{} })
|
||||||
},
|
},
|
||||||
columns: [[
|
columns: [[
|
||||||
{ field: 'id', hidden: true },
|
{ field: 'id', hidden: true },
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
toolbar: '#safeitemtablebar',
|
toolbar: '#safeitemtablebar',
|
||||||
border: false,
|
border: false,
|
||||||
onSelect: function (index, data) {
|
onSelect: function (index, data) {
|
||||||
$('#safefeedbacktable').datagrid({ url: 'api/safefeedback/?a=listall&safeitem=' + data.id })
|
$('#safefeedbacktable').datagrid({ url: 'api/safefeedback/?a=listall&safeitem=' + data.id, queryParams:{} })
|
||||||
},
|
},
|
||||||
columns: [[
|
columns: [[
|
||||||
{ field: 'id', hidden: true },
|
{ field: 'id', hidden: true },
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$('#grouptable').datagrid({
|
$('#grouptable').datagrid({
|
||||||
url: 'grouphandle?a=list2',
|
url: 'grouphandle?a=list',
|
||||||
rownumbers: true,
|
rownumbers: true,
|
||||||
singleSelect: true,
|
singleSelect: true,
|
||||||
striped: true,
|
striped: true,
|
||||||
|
@ -55,9 +55,17 @@
|
||||||
}else{
|
}else{
|
||||||
$('#addguser,#delguser').show()
|
$('#addguser,#delguser').show()
|
||||||
}
|
}
|
||||||
$("#gusertable").datagrid({
|
if(row.grouptype==3){
|
||||||
|
$("#gusertable").datagrid({
|
||||||
|
url:'',
|
||||||
|
data: [],
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
$("#gusertable").datagrid({
|
||||||
url: 'getuser?groupid=' + row.groupid + '&a=datagrid',
|
url: 'getuser?groupid=' + row.groupid + '&a=datagrid',
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#addgroup').linkbutton({
|
$('#addgroup').linkbutton({
|
||||||
|
|
|
@ -3936,6 +3936,8 @@ def apicompany(req):
|
||||||
groupname='超管', grouptype=0, usecomp=part, menulist=menurights)
|
groupname='超管', grouptype=0, usecomp=part, menulist=menurights)
|
||||||
Group.objects.create(
|
Group.objects.create(
|
||||||
groupname='安全员', grouptype=1, usecomp=part, menulist=menurights)
|
groupname='安全员', grouptype=1, usecomp=part, menulist=menurights)
|
||||||
|
Group.objects.create(
|
||||||
|
groupname='全体用户', grouptype=3, usecomp=part, menulist=[11])
|
||||||
z = Group(groupname='主管', grouptype=2,
|
z = Group(groupname='主管', grouptype=2,
|
||||||
usecomp=part, menulist=menurights)
|
usecomp=part, menulist=menurights)
|
||||||
z.save()
|
z.save()
|
||||||
|
@ -4863,6 +4865,12 @@ def apisuggest(req):
|
||||||
# 特别操作
|
# 特别操作
|
||||||
def apitool(req):
|
def apitool(req):
|
||||||
a = req.GET.get('a')
|
a = req.GET.get('a')
|
||||||
|
if a == 'correctgrouptype':
|
||||||
|
for company in Partment.objects.filter(iscompany=1):
|
||||||
|
users = User.objects.filter(usecomp = company)
|
||||||
|
instance, _ = Group.objects.get_or_create(usecomp=company,grouptype=3,defaults={'groupname':'全体用户', 'grouptype':3, 'usecomp':company, 'menulist':[11]})
|
||||||
|
instance.users.add(*users)
|
||||||
|
return JsonResponse({'code': 1})
|
||||||
if a == 'updatecompany':
|
if a == 'updatecompany':
|
||||||
for i in User.objects.all():
|
for i in User.objects.all():
|
||||||
companyid = getcompany(i.userid)
|
companyid = getcompany(i.userid)
|
||||||
|
|
Loading…
Reference in New Issue