Commit 7c22af2a by lixq

1

Signed-off-by: lixq's avatarLixiaoqiang <276402404@qq.com>
parent 48a20e09
##账号表数据##
insert into account_mst(login,password,name,contact,role,authority_level)values('admin123','admin123','系统管理员','123456','9','0')
insert into account_mst(login,password,name,contact,role,modules)values('admin123','admin123','系统管理员','123456','99','1|2|3|4|5|6|7|8|9|10|11|12|13')
##行政规划表##
insert into account_mst(login,password,name,contact,role,authority_level)values('admin123','admin123','系统管理员','123456','9','0')
\ No newline at end of file
insert into account_mst(login,password,name,contact,role)values('admin123','admin123','系统管理员','123456','99')
\ No newline at end of file
......@@ -8,7 +8,10 @@ CREATE TABLE IF NOT EXISTS account_mst(
name varchar(64) NOT NULL,
contact text,
role varchar(128) NOT NULL,
authority_level text NOT NULL,
user_id int8 NOT NULL DEFAULT 0,
school_id int8 NOT NULL DEFAULT 0,
government_id int8 NOT NULL DEFAULT 0,
modules text NOT NULL,
comment text,
delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8;
......
......@@ -13,10 +13,12 @@ class AccountMst extends CompassDynamicData
var $name;
var $contact;
var $role;
var $authority_level;
var $delete_flg;
var $user_id;
var $school_id;
var $government_id;
var $modules;
var $comment;
var $delete_flg;
/**
*
*
......@@ -27,14 +29,17 @@ class AccountMst extends CompassDynamicData
{
parent::constructor($record);
$this->login = $record["login"];
$this->password = $record["password"];
$this->name = $record["name"];
$this->contact = $record["contact"];
$this->role = $record["role"];
$this->authority_level = $record["authority_level"];
$this->delete_flg = $record["delete_flg"];
$this->comment = $record["comment"];
$this->login = $record["login"];
$this->password = $record["password"];
$this->name = $record["name"];
$this->contact = $record["contact"];
$this->role = $record["role"];
$this->user_id = $record["user_id"];
$this->school_id = $record["school_id"];
$this->government_id = $record["government_id"];
$this->modules = $record["modules"];
$this->delete_flg = $record["delete_flg"];
$this->comment = $record["comment"];
}
/**
......@@ -98,12 +103,15 @@ class AccountMst extends CompassDynamicData
ParamUtil::copyObj2Array($v_param, $this, "login");
ParamUtil::copyObj2Array($v_param, $this, "password");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "name");
ParamUtil::copyObj2Array($v_param, $this, "name");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "contact");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "role");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "authority_level");
ParamUtil::copyObj2Array($v_param, $this, "role");
ParamUtil::copyObj2Array($v_param, $this, "user_id");
ParamUtil::copyObj2Array($v_param, $this, "school_id");
ParamUtil::copyObj2Array($v_param, $this, "government_id");
ParamUtil::copyObj2Array($v_param, $this, "modules");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
ParamUtil::copyObj2Array($v_param, $this, "comment");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "comment");
// 保存
parent::_save("account_mst", $v_param);
......
......@@ -58,6 +58,12 @@ class AcountModule
$tmp = array("id"=>11, "module"=>"公益课堂管理");
array_push($data, $tmp);
$tmp = array("id"=>12, "module"=>"用户管理");
array_push($data, $tmp);
$tmp = array("id"=>13, "module"=>"机构用户管理");
array_push($data, $tmp);
$result = array();
foreach ($data as $row) {
$tmp2 = new AcountModule($row);
......
......@@ -37,17 +37,16 @@ function checkAuthority($allow_types = null) {
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit;
}
ErrorLogger::doOutput($allow_types . $_account->modules,0);
// 超级管理员 或 无限制的场合,返回true
if (empty($_account->authority) || empty($allow_types)) {
return true;
if (empty($allow_types)) {
return false;
}
$type_list = explode(",", $allow_types);
$account_authority_type_list = explode(",", $_account->authority);
foreach ($type_list as $type) {
foreach ($account_authority_type_list as $account_authority_type) {
if ($type == $account_authority_type) {
return true;
}
$account_authority_type_list = explode("|", $_account->modules);
foreach ($account_authority_type_list as $account_authority_type) {
if ($allow_types == $account_authority_type) {
return true;
}
}
return false;
......
......@@ -12,7 +12,7 @@ require_once("manager_include.inc");
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("ADMIN")) {
if (!checkAuthority("2")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
......
......@@ -22,6 +22,7 @@ if (!checkAuthority("ADMIN")) {
exit;
}
// ページ
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
......
......@@ -59,7 +59,7 @@
});
return;
}
$('#title').val(this.name)
$('#title').val(this.name);
$('#form').submit();
},
back:function(){
......
......@@ -13,64 +13,46 @@ global $csv_error_msg;
<div id="change">
<p class="edit_title">领导机构新增</p>
<div class="edit_content">
<p>CSV文件</p>
<form id="form" method="post" action="government_new_result.php" enctype="multipart/form-data">
<p>CSV文件</p>
<input type="file" name="csv_file" class="input_200" @change="getFile($event)" accept=".csv"/><br />
<el-button type="danger" class="edit_btn" @click="submitForm()">新增</el-button>
<el-button type="danger" class="edit_btn" @Click="window.location='./government_list.php'" />返回</el-button>
</form>
</div>
</div>
<script type="text/javascript">
new Vue({
el:'#change',
mounted:function(){
var form = document.createElement("form");
document.getElementById('change').appendChild(form);
form.setAttribute('id','form');
form.setAttribute('method','post');
form.setAttribute('action','government_edit_result.php');
form.style.display='none';
var generateHideElement = function (type,name, value) {
var tempInput = document.createElement("input");
tempInput.id=name;
tempInput.type = type;
tempInput.name = name;
tempInput.value = value;
return tempInput;
}
},
methods:{
edit:function(){
if(!this.name){
this.$message({
type: 'error',
message: '请输入教育管局名称!'
});
return;
}
$('#title').val(this.name)
$('#form').submit();
},
back:function(){
window.history.go(-1);
}
}
})
</script>
<div class="page_title">领导机构新增</div>
$(document).ready(function () {
var vm = new Vue({
el: 'form',
data: {
file: ''
},
methods: {
getFile(event) {
this.file = event.target.files[0];
//$('#csv_file').attr("value",this.file);
console.log(this.file);
},
submitForm() {
if(!this.file){
this.$message({
type: 'error',
message: '请选择CSV文件!'
});
return;
}
$('#form').submit();
}
}
})
if(<?=$csv_error_msg?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$csv_error_msg?>'
});
}
})
<br />
<form action="government_new_result.php" method="post" name="government_new_input" enctype="multipart/form-data">
<table>
<tr>
<td>CSV文件
</td>
</tr>
<tr>
<td class="begin_blank">
<input type="file" name="csv_file" accept=".csv"/><br/>
<font color="#ff0000"><?=$csv_error_msg ?></font>
</td>
</tr>
</table><br />
<input type="submit" class="button_width_normal" onclick="doCheck()" value="新增" />
<input type="button" onClick="window.location='./government_list.php'" value="返回" class="button_width_normal" />
</form>
</script>
......@@ -14,4 +14,16 @@
领导机构新增完成
<br />
<br />
<input type="button" onClick="window.location='./government_list.php'" value="返回" class="button_width_normal" />
<div id="result">
<el-button type="danger" @click="back()" class="edit_btn">返回</el-button>
</div>
<script type="text/javascript">
new Vue({
el:'#result',
methods:{
back:function(){
window.location.href='./government_list.php';
}
}
})
</script>
......@@ -90,7 +90,7 @@ a:hover{
<el-menu-item-group>
<el-menu-item index="3-1" @click="fn5()">活动列表</el-menu-item>
<el-menu-item index="3-2" @click="fn6()">活动发布</el-menu-item>
<el-menu-item index="3-3" @click="fn7()">活动审核</el-menu-item>
<el-menu-item index="3-3" v-if="checkAuthority2" @click="fn7()">活动审核</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="4">
......@@ -99,8 +99,8 @@ a:hover{
<span>系统设定</span>
</template>
<el-menu-item-group>
<el-menu-item index="4-1" @click="fn8()">账户管理</el-menu-item>
<el-menu-item index="4-2" @click="fn9()">领导机构</el-menu-item>
<el-menu-item index="4-1" v-if="checkAuthority1" @click="fn8()">账户管理</el-menu-item>
<el-menu-item index="4-2" v-if="checkAuthority2" @click="fn9()">领导机构</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>
......@@ -109,7 +109,20 @@ a:hover{
new Vue({
el:'#leftMenu',
data:{
default_active:'1-1'
default_active:'1-1',
checkAuthority1:<?=checkAuthority("1")?'true':'false'?>,
checkAuthority2:<?=checkAuthority("2")?'true':'false'?>,
checkAuthority3:<?=checkAuthority("3")?'true':'false'?>,
checkAuthority4:<?=checkAuthority("4")?'true':'false'?>,
checkAuthority5:<?=checkAuthority("5")?'true':'false'?>,
checkAuthority6:<?=checkAuthority("6")?'true':'false'?>,
checkAuthority7:<?=checkAuthority("7")?'true':'false'?>,
checkAuthority8:<?=checkAuthority("8")?'true':'false'?>,
checkAuthority9:<?=checkAuthority("9")?'true':'false'?>,
checkAuthority10:<?=checkAuthority("10")?'true':'false'?>,
checkAuthority11:<?=checkAuthority("11")?'true':'false'?>,
checkAuthority12:<?=checkAuthority("12")?'true':'false'?>,
checkAuthority13:<?=checkAuthority("13")?'true':'false'?>
},
methods:{
handleOpen(key, keyPath) {
......
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 to comment