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