Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Compass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zong
Compass
Commits
7c22af2a
Commit
7c22af2a
authored
Jan 04, 2020
by
lixq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
Signed-off-by:
Lixiaoqiang
<
276402404@qq.com
>
parent
48a20e09
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
116 additions
and
92 deletions
+116
-92
compass_db_init.sql
doc/DB/compass_db_init.sql
+3
-3
compass_db_schema.sql
doc/DB/compass_db_schema.sql
+4
-1
AccountMst.inc
src/cn/compass/entity/AccountMst.inc
+23
-15
AcountModule.inc
src/cn/compass/entity/definition/AcountModule.inc
+6
-0
check_login.inc
src/manager/check_login.inc
+8
-9
government_edit_result.php
src/manager/government_edit_result.php
+1
-1
government_new.php
src/manager/government_new.php
+1
-0
government_edit_input.inc
src/manager/templates/government_edit_input.inc
+1
-1
government_new.inc
src/manager/templates/government_new.inc
+39
-57
government_new_result.inc
src/manager/templates/government_new_result.inc
+13
-1
menu.inc
src/manager/templates/menu.inc
+17
-4
No files found.
doc/DB/compass_db_init.sql
View file @
7c22af2a
##
账号表数据
##
##
账号表数据
##
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
doc/DB/compass_db_schema.sql
View file @
7c22af2a
...
@@ -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
;
...
...
src/cn/compass/entity/AccountMst.inc
View file @
7c22af2a
...
@@ -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
::
copyObj2Array
NullField
(
$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
::
copyObj2Array
NullField
(
$v_param
,
$this
,
"comment"
);
// 保存
// 保存
parent
::
_save
(
"account_mst"
,
$v_param
);
parent
::
_save
(
"account_mst"
,
$v_param
);
...
...
src/cn/compass/entity/definition/AcountModule.inc
View file @
7c22af2a
...
@@ -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
);
...
...
src/manager/check_login.inc
View file @
7c22af2a
...
@@ -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
tru
e
;
return
fals
e
;
}
}
$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
;
...
...
src/manager/government_edit_result.php
View file @
7c22af2a
...
@@ -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"
;
...
...
src/manager/government_new.php
View file @
7c22af2a
...
@@ -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"
;
...
...
src/manager/templates/government_edit_input.inc
View file @
7c22af2a
...
@@ -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
(){
...
...
src/manager/templates/government_new.inc
View file @
7c22af2a
...
@@ -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>
src/manager/templates/government_new_result.inc
View file @
7c22af2a
...
@@ -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>
src/manager/templates/menu.inc
View file @
7c22af2a
...
@@ -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=
"checkAuthority
2"
@
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment