Commit 56fb6f87 by lixq
parents f3e94fb0 44bb6a12
...@@ -3,3 +3,5 @@ insert into account_mst(login,password,name,contact,role,modules)values('admin12 ...@@ -3,3 +3,5 @@ insert into account_mst(login,password,name,contact,role,modules)values('admin12
##行政规划表## ##行政规划表##
insert into account_mst(login,password,name,contact,role)values('admin123','admin123','系统管理员','123456','99') insert into account_mst(login,password,name,contact,role)values('admin123','admin123','系统管理员','123456','99')
##系统常量表##
\ No newline at end of file
...@@ -16,11 +16,10 @@ require_once("check_login.inc"); ...@@ -16,11 +16,10 @@ require_once("check_login.inc");
if (!checkAuthority("ADMIN")) { if (!checkAuthority("ADMIN")) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["footer"] = "footer.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["top"] = "menu.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。"; $message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
...@@ -30,10 +29,9 @@ $account_mst = AccountMst::getById($id); ...@@ -30,10 +29,9 @@ $account_mst = AccountMst::getById($id);
if ($account_mst == null) { if ($account_mst == null) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["footer"] = "footer.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["top"] = "menu.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["middle"] = "error.inc"; require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit; exit;
} }
$id = $account_mst->id; $id = $account_mst->id;
...@@ -41,18 +39,29 @@ $login = $account_mst->login; ...@@ -41,18 +39,29 @@ $login = $account_mst->login;
$password = $account_mst->password; $password = $account_mst->password;
$name = $account_mst->name; $name = $account_mst->name;
$contact = $account_mst->contact; $contact = $account_mst->contact;
$authority_level_array = explode(",", AuthorityLevel::getById($account_mst->authority_level)); $comment = $account_mst->comment;
$government_id = $account_mst->government_id;
$school_id = $account_mst->school_id;
$role_id = $account_mst->role;
$modules = $account_mst->modules;
if(!empty($modules)){
$modules = implode(",", explode("|", $modules));
}
// 权限一览取得 // 权限一览取得
$authority_level_list = AuthorityLevel::getList(); $modules_list = AcountModule::getList();
$account_role_list = AccountRole::getList();
$school_list = CompassHandler::getSchoolListForAccount();
$government_list = CompassHandler::getGovernmentlListForAccount();
print_r($authority_level_list);
// 页面表示 // 页面表示
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_edit_input.js"); $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_edit_input.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["top"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["menu_clicked"] = "li_system"; $layout_pages["menu_clicked"] = "4-1";
$layout_pages["middle"] = "account_edit_input.inc"; $layout_pages["right"] = "account_edit_input.inc";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -60,7 +60,6 @@ if (count($account_list) > 0) { ...@@ -60,7 +60,6 @@ if (count($account_list) > 0) {
// 页面表示 // 页面表示
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js"); $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js");
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "account_new_input.inc"; $layout_pages["right"] = "account_new_input.inc";
......
...@@ -26,6 +26,16 @@ if (!checkAuthority("2")) { ...@@ -26,6 +26,16 @@ if (!checkAuthority("2")) {
$id = ParamUtil::getRequestString("id"); $id = ParamUtil::getRequestString("id");
$title = ParamUtil::getRequestString("title"); $title = ParamUtil::getRequestString("title");
$government_mst = GovernmentMst::getById($id); $government_mst = GovernmentMst::getById($id);
if ($government_mst == null) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$layout_pages["menu_clicked"] = "4-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
$government_mst->title = $title; $government_mst->title = $title;
$government_mst->save(); $government_mst->save();
......
<?php
/**
* 系统常量定义编辑
* $Id: system_const_edit_input.php,v 1.1 2020/01/012 11:18:46 lixq Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("ADMIN")) {
// エラー表示
$layout_pages = array();
$layout_pages["footer"] = "footer.inc";
$layout_pages["top"] = "menu.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit;
}
// 参数取得
$id = ParamUtil::getRequestString("id");
$action_type = ParamUtil::getRequestString("action_type");
$system_const_dat = new SystemConstDat();
if($action_type =="edit"){
$system_const_dat = SystemConstDat::getById($id);
}
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_edit_input.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
<?php
/**
* 系统常量定义编辑完成
* $Id: system_const_edit_result.php,2020/01/12 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("ADMIN")) {
// エラー表示
$layout_pages = array();
$layout_pages["footer"] = "footer.inc";
$layout_pages["top"] = "menu.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc");
exit;
}
// 参数取得
$action_type = ParamUtil::getRequestString("action_type");//new edit
$id = ParamUtil::getRequestString("id");
$title = ParamUtil::getRequestString("title");
$name = ParamUtil::getRequestString("name");
$constant_value = ParamUtil::getRequestString("constant_value");
//创建的时候
if($action_type=="new") {
$system_const_dat = new SystemConstDat();
}
//编辑
if($action_type=="edit") {
$system_const_dat = SystemConstDat::getById($id);
if ($system_const_dat == null) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
//name唯一check
$param = array();
$param["delete_flg"] = false;
$param["name"] = $name;
$account_list = AccountMst::getList($param);
if (count($account_list) > 1) {
$error_message = "常量定义名已经被存在,请换一个。";
if($action_type =="edit"){
$system_const_dat = SystemConstDat::getById($id);
}
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_edit_input.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
}
}
// 数据库更新
$system_const_dat->name = $name;
$system_const_dat->title = $title;
$system_const_dat->constant_value = $constant_value;
$system_const_dat->save();
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_edit_result.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
<?php
/**
* 系统常量定义
* $Id: system_const_list.php,v 1.1 2020/01/12 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("ADMIN")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
// 一览取得
$param = array();
$param["delete_flg"] = false;
$system_const_list = SystemConstDat::getList($param,"id","asc");
// ページ
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "system_const_list.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
...@@ -11,66 +11,167 @@ global $login; ...@@ -11,66 +11,167 @@ global $login;
global $password; global $password;
global $name; global $name;
global $contact; global $contact;
global $authority_level_array;
global $authority_level_list;
global $comment; global $comment;
global $government_id;
global $school_id;
global $role_id;
global $error_message;
global $role;
global $modules;
?> ?>
<b>管理员编辑</b><br /> <div id="change">
<br /> <p class="edit_title">编辑账号</p>
<form name="account_edit_input" action="account_edit_result.php" method="post"> <div class="edit_content">
<input type="hidden" name="id" value="<?=$id ?>" /> <form id="form" method="post" action="account_edit_result.php" enctype="multipart/form-data">
<table> <input type="hidden" name="account_role"/>
<tr> <input type="hidden" name="organization"/>
<td>登陆帐号</td> <p>登陆帐号</p>
</tr> <el-input v-model="login" name="login" class="input_200"></el-input><br />
<tr> <p>登陆密码</p>
<td class="begin_blank"><?=htmlspecialchars($login) ?></td> <el-input v-model="password" name="password" class="input_200"></el-input><br />
</tr> <p>账户名称</p>
<el-input v-model="name" name="name" class="input_200"></el-input><br />
<p>联系方式</p>
<el-input v-model="contact" name="contact" class="input_200"></el-input><br />
<p>用户角色 </p>
<el-select v-model="selected" size='medium' >
<el-option
v-for="item in account_role"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
<div v-if="isShow">
<p>机构选择 </p>
<el-select v-model="organization" size='medium' >
<div class="el-select-dropdown__item"><input v-model="searchVal" style="border-radius: 4px;background: url(images/search_icon.png) no-repeat 150px;"type="text" autocomplete="off"></div>
<el-option
v-for="item in new_org_list"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</div>
<tr> <p>权限 <span style="color:#FF0000">※全不选即为超级管理员</span></p>
<td>登陆密码</td> <template v-for="(modules, index) in modules_list">
</tr> <input type="checkbox" name="modules[]" :value="modules.id" v-model='checked' :id="modules.id" />
<tr> <label :for="modules.id">{{ modules.module }}</label>
<td class="begin_blank"><input type="text" name="password" value="<?=htmlspecialchars($password) ?>" /></td> <br>
</tr> </template>
<p>备注</p>
<el-input v-model="comment" name="comment" class="input_300"></el-input><br />
<br/><br/>
<el-button type="danger" class="edit_btn" @click="submitForm()">编辑</el-button>
<el-button type="danger" class="edit_btn" @Click="window.location='./account_list.php'" />返回</el-button>
<br/><br/>
</form>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var vm = new Vue({
el: '#form',
data: {
login: '<?=htmlspecialchars($login) ?>',
password:'<?=htmlspecialchars($password) ?>',
contact:'<?=htmlspecialchars($contact) ?>',
name:'<?=htmlspecialchars($name) ?>',
comment:'<?=htmlspecialchars($comment) ?>',
modules_list:<?=json_encode($modules_list)?>,
account_role:<?=json_encode($account_role_list)?>,
school_list:[{id:'1',title:"aa"},{id:'2',title:"bb"}],
government_list:<?=json_encode($government_list)?>,
selected:<?=$role_id?>,
checked:[<?=$modules?>],
isShow:true,
organization:'<?=$government_id?>',
org_list:<?=json_encode($government_list)?>,
searchVal:''
<tr> },
<td>账户名称</td> watch:{
</tr> selected(val,oldval){
<tr> if(val > 8){
<td class="begin_blank"><input type="text" name="name" value="<?=htmlspecialchars($name) ?>" /></td> this.isShow = false;
</tr> }else{
this.isShow = true;
<tr> if(val >= 7){
<td>联系电话</td> this.org_list = this.school_list;
</tr> this.organization = '2';
<tr> }else{
<td class="begin_blank"><input type="text" name="contact" value="<?=htmlspecialchars($contact) ?>" /></td> this.org_list = this.government_list;
</tr> this.organization = '<?=$government_list[0]["id"]?>';
}
<tr> }
<td>备注</td> }
</tr> },
<tr> methods: {
<td class="begin_blank"><input type="text" name="comment" value="<?=htmlspecialchars($comment) ?>" /></td> submitForm() {
</tr> if(!this.login){
this.$message({
<tr> type: 'error',
<td>权限 <span style="color:#FF0000">※全不选即为超级管理员</span></td> message: '请输入登陆帐号。'
</tr> });
<tr> return;
<td class="begin_blank"> }
<? if (!isAlpaNum(this.login)) {
foreach ($authority_level_list as $authority_level) { this.$message({
?> type: 'error',
<label><input type="checkbox" name="authority_level[]" value="<?=$authority_level->name ?>"/><?=$authority_level->model ?></label> message: '登陆帐号只能使用半角英文或数字。'
<? });
return;
}
if (!this.password) {
this.$message({
type: 'error',
message: '请输入登陆密码。'
});
return;
}
if (!isAlpaNum(this.password)) {
this.$message({
type: 'error',
message: '登陆密码只能使用半角英文或数字。'
});
return;
} }
?> if (!this.name) {
</td> this.$message({
</tr> type: 'error',
<tr> message: '请输入账户名称。'
</table> });
<br /> return;
<input type="button" value="编辑" class="button_width_normal" onClick="doCheck();" /> }
</form> $("input[name='account_role']").val(this.selected);
$("input[name='organization']").val(this.organization);
$('#form').submit();
}
},
computed: {
new_org_list() {
var _this = this;
var new_org_list = [];
_this.org_list.map(function(item) {
if (item.title.search(_this.searchVal) != -1) {
new_org_list.push(item);
}
});
if(new_org_list.length == 0){
new_org_list = _this.org_list;
}
return new_org_list;
}
}
})
if(<?=$error_message?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$error_message?>'
});
}
})
</script>
<?php
/**
* 系统常量定义编辑
* $Id: system_const_edit_input.inc,v 1.1 2020/01/12 11:18:53 lixq Exp $
* @author lixq
* @access public
* @package manager.templates
**/
global $id;
global $action_type;
global $system_const_dat;
global $error_message;
?>
<div id="change">
<p class="edit_title">系统常量定义添加</p>
<form id="form" method="post" action="system_const_edit_result.php" enctype="multipart/form-data">
<input type="hidden" name="action_type" value="<?=$action_type ?>"/>
<input type="hidden" name="id" value="<?=$id ?>"/>
<div class="edit_content">
<p>常量定义名</p>
<el-input v-model="name" name="name" class="input_200"></el-input> <span style="color:#FF0000">(大写英文字母、下划线)</span><br />
<p>文字描述</p>
<el-input v-model="title" name="title" class="input_200"></el-input><br />
<p></p>
<el-input v-model="constant_value" name="constant_value" class="input_200"></el-input><br />
<el-button type="danger" @click="edit()" class="edit_btn">编辑</el-button>
<el-button type="danger" class="edit_btn" @Click="window.location='./system_const_list.php'" />返回</el-button>
</div>
</form>
</div>
<script type="text/javascript">
new Vue({
el:'#change',
data:{
name:'<?=htmlspecialchars($system_const_dat->name) ?>',
title:'<?=htmlspecialchars($system_const_dat->title) ?>',
constant_value:'<?=htmlspecialchars($system_const_dat->constant_value) ?>'
},
methods:{
edit:function(){
if(!this.name){
this.$message({
type: 'error',
message: '请输入常量定义名!'
});
return;
}
if(!this.name.match(/^[A-Z_]{1,}$/)){
this.$message({
type: 'error',
message: '常量定义名格式不正确!'
});
return;
}
if(!this.title){
this.$message({
type: 'error',
message: '请输入文字描述!'
});
return;
}
if(!this.name){
this.$message({
type: 'error',
message: '请输入值!'
});
return;
}
$('#form').submit();
}
}
})
$(document).ready(function () {
if(<?=$error_message?1:0 ?>){
vm.$message({
type: 'error',
message: '<?=$error_message?>'
});
}
})
</script>
<?php
/**
* 系统常量定义编辑完成
* $Id: system_const_edit_result.inc,v 1.12020/01/12 11:18:46 Exp $
* @author lixq
* @access public
* @package manager.templates
*/
?>
<br />
系统常量定义编辑完成
<br />
<br />
<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='./system_const_list.php';
}
}
})
</script>
<?php
/**
* 系统常量定义
* $Id: system_const_list.inc,v 1.1 2020/01/12 11:18:46 Exp $
* @author lixq
* @access public
* @package manager.templates
*/
global $system_const_list;
?>
<div id="classSetting">
<div class="list_title">
系统常量定义
<div style="float: right;">
<el-button type="primary" style="margin-right: 10px;" @click="addSysConst()">添加</el-button>
</div>
</div>
<br />
<div class="result_list">
<el-table :data="tableData" border>
<el-table-column prop="id" label="编号" width="50px"></el-table-column>
<el-table-column prop="name" label="常量定义名" width=""></el-table-column>
<el-table-column prop="title" label="文字描述" width=""></el-table-column>
<el-table-column prop="constant_value" label="常量的值" width=""></el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="handleChange(scope.row)" type="text" size="small">编辑</el-button>
<el-button type="text" size="small" @click.native.prevent="deleteRow(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<script type="text/javascript">
var list=[];
<?
foreach ($system_const_list as $system_const_mst) {
?>
var data={
id:<?=$system_const_mst->id ?>,
name:'<?=$system_const_mst->name?>',
title:'<?=$system_const_mst->title?>',
constant_value:'<?=$system_const_mst->constant_value?>'
};
list.push(data);
<?
}
?>
new Vue({
el:'#classSetting',
data:{
tableData: list
},
methods:{
handleChange(row) {
console.log(row);
window.location.href='system_const_edit_input.php?action_type=edit&id='+row.id;
},
deleteRow(rows) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
// rows.splice(index, 1);
window.location.href='system_const_delete_result.php?id='+rows.id;
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
addSysConst(){
window.open('system_const_edit_input.php?action_type=new','_self')
}
}
})
</script>
\ No newline at end of file
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