Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhupu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
zhupu
Commits
64062399
Commit
64062399
authored
Sep 13, 2023
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
名人堂后台管理
parent
5a4d9192
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
393 additions
and
17 deletions
+393
-17
application/admin/controller/family/FamilyPeople.php
application/admin/controller/family/FamilyPeople.php
+113
-1
application/admin/lang/zh-cn/family/family.php
application/admin/lang/zh-cn/family/family.php
+1
-1
application/admin/lang/zh-cn/family/family_people.php
application/admin/lang/zh-cn/family/family_people.php
+1
-0
application/admin/lang/zh-cn/family/family_tree.php
application/admin/lang/zh-cn/family/family_tree.php
+1
-1
application/admin/model/family/Family.php
application/admin/model/family/Family.php
+1
-1
application/admin/model/family/FamilyPeople.php
application/admin/model/family/FamilyPeople.php
+14
-0
application/admin/model/family/FamilyTree.php
application/admin/model/family/FamilyTree.php
+1
-1
application/admin/view/family/family/add.html
application/admin/view/family/family/add.html
+1
-1
application/admin/view/family/family_people/add.html
application/admin/view/family/family_people/add.html
+113
-0
application/admin/view/family/family_people/edit.html
application/admin/view/family/family_people/edit.html
+112
-0
application/admin/view/family/family_people/index.html
application/admin/view/family/family_people/index.html
+3
-0
application/admin/view/family/family_tree/add.html
application/admin/view/family/family_tree/add.html
+1
-1
application/admin/view/family/family_tree/edit.html
application/admin/view/family/family_tree/edit.html
+1
-1
application/api/controller/FamilyTree.php
application/api/controller/FamilyTree.php
+1
-1
public/assets/js/backend/family/family_people.js
public/assets/js/backend/family/family_people.js
+29
-8
No files found.
application/admin/controller/family/FamilyPeople.php
View file @
64062399
...
...
@@ -3,7 +3,11 @@
namespace
app\admin\controller\family
;
use
app\common\controller\Backend
;
use
app\lib\service\FamilyTreeService
;
use
think\Db
;
use
think\Exception
;
use
think\exception\PDOException
;
use
think\exception\ValidateException
;
/**
*
...
...
@@ -27,6 +31,8 @@ class FamilyPeople extends Backend
$this
->
model
=
new
\app\admin\model\family\FamilyPeople
;
$this
->
view
->
assign
(
"sexList"
,
$this
->
model
->
getSexList
());
$this
->
view
->
assign
(
"auditList"
,
$this
->
model
->
getAuditList
());
$this
->
view
->
assign
(
"statusList"
,
$this
->
model
->
getStatusList
());
$this
->
view
->
assign
(
"type"
,
$this
->
request
->
param
(
"type"
,
1
));
}
public
function
import
()
...
...
@@ -64,15 +70,121 @@ class FamilyPeople extends Backend
->
paginate
(
$limit
);
foreach
(
$list
as
$key
=>
$val
)
{
$val
->
visible
([
'id'
,
'number'
,
'user_id'
,
'name'
,
'sex'
,
'identity_card'
,
'photo'
,
'ext0'
,
'ext1'
,
'ext2'
,
'ext3'
,
'ext4'
,
'ext5'
,
'createtime'
,
'address'
,
'audit'
,
'status'
,
'is_pay'
,
'users'
]);
$val
->
visible
([
'id'
,
'number'
,
'user_id'
,
'name'
,
'sex'
,
'identity_card'
,
'photo'
,
'ext0'
,
'ext1'
,
'ext2'
,
'ext3'
,
'ext4'
,
'ext5'
,
'createtime'
,
'address'
,
'audit'
,
'status'
,
'is_pay'
,
'users'
,
'type'
]);
}
$result
=
array
(
"total"
=>
$list
->
total
(),
"rows"
=>
$list
->
items
());
return
json
(
$result
);
}
$this
->
assignconfig
(
"type"
,
$this
->
request
->
param
(
"type"
));
return
$this
->
view
->
fetch
();
}
/**
* 添加
*/
public
function
add
()
{
if
(
$this
->
request
->
isPost
())
{
$params
=
$this
->
request
->
param
(
"row/a"
);
if
(
$params
)
{
$params
=
$this
->
preExcludeFields
(
$params
);
if
(
$this
->
dataLimit
&&
$this
->
dataLimitFieldAutoFill
)
{
$params
[
$this
->
dataLimitField
]
=
$this
->
auth
->
id
;
}
$result
=
false
;
Db
::
startTrans
();
try
{
//是否采用模型验证
if
(
$this
->
modelValidate
)
{
$name
=
str_replace
(
"
\\
model
\\
"
,
"
\\
validate
\\
"
,
get_class
(
$this
->
model
));
$validate
=
is_bool
(
$this
->
modelValidate
)
?
(
$this
->
modelSceneValidate
?
$name
.
'.add'
:
$name
)
:
$this
->
modelValidate
;
$this
->
model
->
validateFailException
(
true
)
->
validate
(
$validate
);
}
$params
[
'type'
]
=
2
;
$params
[
'audit'
]
=
1
;
$params
[
'number'
]
=
getNumbersn
(
"user"
);
$params
[
'name'
]
=
$params
[
'surname'
]
.
$params
[
'firstname'
];
$result
=
$this
->
model
->
allowField
(
true
)
->
save
(
$params
);
Db
::
commit
();
}
catch
(
ValidateException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
PDOException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
if
(
$result
!==
false
)
{
$this
->
success
();
}
else
{
$this
->
error
(
__
(
'No rows were inserted'
));
}
}
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
''
));
}
return
$this
->
view
->
fetch
();
}
/**
* 编辑
*/
public
function
edit
(
$ids
=
null
)
{
$row
=
$this
->
model
->
get
(
$ids
);
if
(
!
$row
)
{
$this
->
error
(
__
(
'No Results were found'
));
}
$adminIds
=
$this
->
getDataLimitAdminIds
();
if
(
is_array
(
$adminIds
))
{
if
(
!
in_array
(
$row
[
$this
->
dataLimitField
],
$adminIds
))
{
$this
->
error
(
__
(
'You have no permission'
));
}
}
if
(
$this
->
request
->
isPost
())
{
$params
=
$this
->
request
->
param
(
"row/a"
);
if
(
$params
)
{
$params
=
$this
->
preExcludeFields
(
$params
);
$result
=
false
;
Db
::
startTrans
();
try
{
//是否采用模型验证
if
(
$this
->
modelValidate
)
{
$name
=
str_replace
(
"
\\
model
\\
"
,
"
\\
validate
\\
"
,
get_class
(
$this
->
model
));
$validate
=
is_bool
(
$this
->
modelValidate
)
?
(
$this
->
modelSceneValidate
?
$name
.
'.edit'
:
$name
)
:
$this
->
modelValidate
;
$row
->
validateFailException
(
true
)
->
validate
(
$validate
);
}
$params
[
'type'
]
=
2
;
$params
[
'audit'
]
=
1
;
$params
[
'name'
]
=
$params
[
'surname'
]
.
$params
[
'firstname'
];
$result
=
$row
->
allowField
(
true
)
->
save
(
$params
);
Db
::
commit
();
}
catch
(
ValidateException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
PDOException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
if
(
$result
!==
false
)
{
$this
->
success
();
}
else
{
$this
->
error
(
__
(
'No rows were updated'
));
}
}
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
''
));
}
$this
->
view
->
assign
(
"row"
,
$row
);
return
$this
->
view
->
fetch
();
}
public
function
getPeople
(){
$data
=
$this
->
model
->
where
([
'id'
=>
$this
->
request
->
param
(
"id"
)])
->
find
();
...
...
application/admin/lang/zh-cn/family/family.php
View file @
64062399
...
...
@@ -16,8 +16,8 @@ return [
'Createtime'
=>
'创建时间'
,
'Rw_user_id'
=>
'管理人员'
,
'Status'
=>
'订单状态'
,
'Status 0'
=>
'隐藏(软删除)'
,
'Status 1'
=>
'显示'
,
'Status 2'
=>
'隐藏(软删除)'
,
'Type'
=>
'类型'
,
'Type 1'
=>
'家谱'
,
'Type 2'
=>
'族谱'
,
...
...
application/admin/lang/zh-cn/family/family_people.php
View file @
64062399
...
...
@@ -35,4 +35,5 @@ return [
'Audit 0'
=>
'待审核'
,
'Audit 1'
=>
'通过'
,
'Audit 2'
=>
'失败'
,
'Sleep_place'
=>
'安息地'
,
];
application/admin/lang/zh-cn/family/family_tree.php
View file @
64062399
...
...
@@ -16,8 +16,8 @@ return [
'Parent_id'
=>
'父亲'
,
'People_id'
=>
'族员'
,
'Status'
=>
'是否显示'
,
'Status 0'
=>
'隐藏(软删除)'
,
'Status 1'
=>
'显示'
,
'Status 2'
=>
'隐藏(软删除)'
,
'Ext0'
=>
'是否离世'
,
'Ext1'
=>
'出生日期'
,
'Ext2'
=>
'离世日期'
,
...
...
application/admin/model/family/Family.php
View file @
64062399
...
...
@@ -27,7 +27,7 @@ class Family extends Model
public
function
getStatusList
()
{
return
[
'
1'
=>
__
(
'Status 1'
),
'2'
=>
__
(
'Status 2
'
)];
return
[
'
0'
=>
__
(
'Status 0'
),
'1'
=>
__
(
'Status 1
'
)];
}
...
...
application/admin/model/family/FamilyPeople.php
View file @
64062399
...
...
@@ -23,6 +23,7 @@ class FamilyPeople extends Model
protected
$append
=
[
'sex_text'
,
'audit_text'
,
'status_text'
];
...
...
@@ -53,6 +54,19 @@ class FamilyPeople extends Model
public
function
getStatusList
()
{
return
[
'0'
=>
__
(
'Status 0'
),
'1'
=>
__
(
'Status 1'
)];
}
public
function
getStatusTextAttr
(
$value
,
$data
)
{
$value
=
$value
?
$value
:
(
isset
(
$data
[
'status'
])
?
$data
[
'status'
]
:
''
);
$list
=
$this
->
getStatusList
();
return
isset
(
$list
[
$value
])
?
$list
[
$value
]
:
''
;
}
public
function
users
(){
return
self
::
hasOne
(
"\app\admin\model\User"
,
'id'
,
"user_id"
);
}
...
...
application/admin/model/family/FamilyTree.php
View file @
64062399
...
...
@@ -46,7 +46,7 @@ class FamilyTree extends Model
public
function
getStatusList
()
{
return
[
'
1'
=>
__
(
'Status 1'
),
'2'
=>
__
(
'Status 2
'
)];
return
[
'
0'
=>
__
(
'Status 0'
),
'1'
=>
__
(
'Status 1
'
)];
}
...
...
application/admin/view/family/family/add.html
View file @
64062399
...
...
@@ -55,7 +55,7 @@
<div
class=
"radio"
>
{foreach name="typeList" item="vo"}
<label
for=
"row[type]-{$key}"
><input
id=
"row[type]-{$key}"
name=
"row[type]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"
1
"
}
checked
{/
in
}
/>
{$vo}
</label>
<label
for=
"row[type]-{$key}"
><input
id=
"row[type]-{$key}"
name=
"row[type]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"
3
"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
...
...
application/admin/view/family/family_people/add.html
0 → 100644
View file @
64062399
<form
id=
"add-form"
class=
"form-horizontal"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('姓')}:
</label>
<div
class=
"col-xs-12 col-sm-2"
>
<input
id=
"c-surname"
data-rule=
"required"
class=
"form-control"
name=
"row[surname]"
type=
"text"
>
</div>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('名')}:
</label>
<div
class=
"col-xs-12 col-sm-3"
>
<input
id=
"c-firstname"
data-rule=
"required"
class=
"form-control"
name=
"row[firstname]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Sex')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"radio"
>
{foreach name="sexList" item="vo"}
<label
for=
"row[sex]-{$key}"
><input
id=
"row[sex]-{$key}"
name=
"row[sex]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"0"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext0')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_radios('row[ext0]', ['0'=>__('否'), '1'=>__('是'), '2'=>__('未知')], 1)}
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Photo')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"c-photo"
class=
"form-control"
size=
"50"
name=
"row[photo]"
type=
"text"
>
<div
class=
"input-group-addon no-border no-padding"
>
<span><button
type=
"button"
id=
"faupload-photo"
class=
"btn btn-danger faupload"
data-input-id=
"c-photo"
data-mimetype=
"image/gif,image/jpeg,image/png,image/jpg,image/bmp"
data-multiple=
"false"
data-preview-id=
"p-photo"
><i
class=
"fa fa-upload"
></i>
{:__('Upload')}
</button></span>
<span><button
type=
"button"
id=
"fachoose-photo"
class=
"btn btn-primary fachoose"
data-input-id=
"c-photo"
data-mimetype=
"image/*"
data-multiple=
"false"
><i
class=
"fa fa-list"
></i>
{:__('Choose')}
</button></span>
</div>
<span
class=
"msg-box n-right"
for=
"c-photo"
></span>
</div>
<ul
class=
"row list-inline faupload-preview"
id=
"p-photo"
></ul>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext1')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-ext1"
class=
"form-control"
name=
"row[ext1]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext2')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-ext2"
class=
"form-control"
name=
"row[ext2]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext3')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<textarea
id=
"c-ext3"
class=
"form-control "
rows=
"5"
name=
"row[ext3]"
cols=
"50"
></textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext4')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<textarea
id=
"c-ext4"
class=
"form-control "
rows=
"5"
name=
"row[ext4]"
cols=
"50"
></textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
籍贯:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"form-inline col-xs-12"
data-toggle=
"cxselect"
data-selects=
"province,city,area,town,village"
>
<select
class=
"province form-control"
data-rule=
""
name=
"row[province_id]"
data-value=
""
data-url=
"ajax/address"
id=
"c-province"
></select>
<select
class=
"city form-control"
data-rule=
""
name=
"row[city_id]"
data-value=
""
data-url=
"ajax/address"
id=
"c-city"
></select>
<select
class=
"area form-control"
data-rule=
""
name=
"row[area_id]"
data-value=
""
data-url=
"ajax/address"
id=
"c-area"
></select>
<select
class=
"town form-control"
data-rule=
""
name=
"row[town_id]"
data-value=
""
data-url=
"ajax/address"
id=
"c-town"
></select>
<select
class=
"village form-control"
data-rule=
""
name=
"row[village_id]"
data-value=
""
data-url=
"ajax/address"
id=
"c-village"
></select>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Address')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-address"
class=
"form-control"
name=
"row[address]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Sleep_place')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-sleep_place"
class=
"form-control"
name=
"row[sleep_place]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Status')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"radio"
>
{foreach name="statusList" item="vo"}
<label
for=
"row[status]-{$key}"
><input
id=
"row[status]-{$key}"
name=
"row[status]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"1"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
</div>
</div>
<div
class=
"form-group layer-footer"
>
<label
class=
"control-label col-xs-12 col-sm-2"
></label>
<div
class=
"col-xs-12 col-sm-8"
>
<button
type=
"submit"
class=
"btn btn-success btn-embossed disabled"
>
{:__('OK')}
</button>
<button
type=
"reset"
class=
"btn btn-default btn-embossed"
>
{:__('Reset')}
</button>
</div>
</div>
</form>
application/admin/view/family/family_people/edit.html
0 → 100644
View file @
64062399
<form
id=
"edit-form"
class=
"form-horizontal"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('姓')}:
</label>
<div
class=
"col-xs-12 col-sm-2"
>
<input
id=
"c-surname"
data-rule=
"required"
class=
"form-control"
name=
"row[surname]"
type=
"text"
value=
"{$row.surname}"
>
</div>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('名')}:
</label>
<div
class=
"col-xs-12 col-sm-3"
>
<input
id=
"c-firstname"
data-rule=
"required"
class=
"form-control"
name=
"row[firstname]"
type=
"text"
value=
"{$row.firstname}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Sex')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"radio"
>
{foreach name="sexList" item="vo"}
<label
for=
"row[sex]-{$key}"
><input
id=
"row[sex]-{$key}"
name=
"row[sex]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"$row.sex"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext0')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_radios('row[ext0]', ['0'=>__('否'), '1'=>__('是'), '2'=>__('未知')], $row.ext0)}
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Photo')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"c-photo"
class=
"form-control"
size=
"50"
name=
"row[photo]"
type=
"text"
value=
"{$row.photo|htmlentities}"
>
<div
class=
"input-group-addon no-border no-padding"
>
<span><button
type=
"button"
id=
"faupload-photo"
class=
"btn btn-danger faupload"
data-input-id=
"c-photo"
data-mimetype=
"image/gif,image/jpeg,image/png,image/jpg,image/bmp"
data-multiple=
"false"
data-preview-id=
"p-photo"
><i
class=
"fa fa-upload"
></i>
{:__('Upload')}
</button></span>
<span><button
type=
"button"
id=
"fachoose-photo"
class=
"btn btn-primary fachoose"
data-input-id=
"c-photo"
data-mimetype=
"image/*"
data-multiple=
"false"
><i
class=
"fa fa-list"
></i>
{:__('Choose')}
</button></span>
</div>
<span
class=
"msg-box n-right"
for=
"c-photo"
></span>
</div>
<ul
class=
"row list-inline faupload-preview"
id=
"p-photo"
></ul>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext1')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-ext1"
class=
"form-control"
name=
"row[ext1]"
type=
"text"
value=
"{$row.ext1|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext2')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-ext2"
class=
"form-control"
name=
"row[ext2]"
type=
"text"
value=
"{$row.ext2|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext3')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<textarea
id=
"c-ext3"
class=
"form-control "
rows=
"5"
name=
"row[ext3]"
cols=
"50"
>
{$row.ext3|htmlentities}
</textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Ext4')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<textarea
id=
"c-ext4"
class=
"form-control "
rows=
"5"
name=
"row[ext4]"
cols=
"50"
>
{$row.ext4|htmlentities}
</textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
所在区域:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"form-inline col-xs-12"
data-toggle=
"cxselect"
data-selects=
"province,city,area,town,village"
>
<select
class=
"province form-control"
data-rule=
""
name=
"row[province_id]"
data-value=
"{$row.province_id}"
data-url=
"ajax/address"
id=
"c-province"
></select>
<select
class=
"city form-control"
data-rule=
""
name=
"row[city_id]"
data-value=
"{$row.city_id}"
data-url=
"ajax/address"
id=
"c-city"
></select>
<select
class=
"area form-control"
data-rule=
""
name=
"row[area_id]"
data-value=
"{$row.area_id}"
data-url=
"ajax/address"
id=
"c-area"
></select>
<select
class=
"town form-control"
data-rule=
""
name=
"row[town_id]"
data-value=
"{$row.town_id}"
data-url=
"ajax/address"
id=
"c-town"
></select>
<select
class=
"village form-control"
data-rule=
""
name=
"row[village_id]"
data-value=
"{$row.village_id}"
data-url=
"ajax/address"
id=
"c-village"
></select>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Address')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-detail_address"
data-rule=
""
class=
"form-control"
name=
"row[address]"
type=
"text"
value=
"{$row.address}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Sleep_place')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-sleep_place"
data-rule=
""
class=
"form-control"
name=
"row[sleep_place]"
type=
"text"
value=
"{$row.sleep_place}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Status')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"radio"
>
{foreach name="statusList" item="vo"}
<label
for=
"row[status]-{$key}"
><input
id=
"row[status]-{$key}"
name=
"row[status]"
type=
"radio"
value=
"{$key}"
{
in
name=
"key"
value=
"$row.status"
}
checked
{/
in
}
/>
{$vo}
</label>
{/foreach}
</div>
</div>
</div>
<div
class=
"form-group layer-footer"
>
<label
class=
"control-label col-xs-12 col-sm-2"
></label>
<div
class=
"col-xs-12 col-sm-8"
>
<button
type=
"submit"
class=
"btn btn-success btn-embossed disabled"
>
{:__('OK')}
</button>
<button
type=
"reset"
class=
"btn btn-default btn-embossed"
>
{:__('Reset')}
</button>
</div>
</div>
</form>
application/admin/view/family/family_people/index.html
View file @
64062399
...
...
@@ -15,6 +15,9 @@
<div
class=
"widget-body no-padding"
>
<div
id=
"toolbar"
class=
"toolbar"
>
<a
href=
"javascript:;"
class=
"btn btn-primary btn-refresh"
title=
"{:__('Refresh')}"
><i
class=
"fa fa-refresh"
></i>
</a>
{if $type==2}
<a
href=
"javascript:;"
class=
"btn btn-success btn-add {:$auth->check('family/family_people/add')?'':'hide'}"
title=
"{:__('Add')}"
><i
class=
"fa fa-plus"
></i>
{:__('Add')}
</a>
{/if}
</div>
<table
id=
"table"
class=
"table table-striped table-bordered table-hover table-nowrap"
width=
"100%"
>
...
...
application/admin/view/family/family_tree/add.html
View file @
64062399
...
...
@@ -13,7 +13,7 @@
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('People_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-people_id"
data-source=
"family/family_people/index"
class=
"form-control selectpage"
data-search-field=
"id,name,identity_card,ext3,ext4,ext5"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {name}"
name=
"row[people_id]"
type=
"text"
data-params=
'{"custom[status]":"1"}'
value=
""
>
<input
id=
"c-people_id"
data-source=
"family/family_people/index"
class=
"form-control selectpage"
data-search-field=
"id,name,identity_card,ext3,ext4,ext5"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {name}"
name=
"row[people_id]"
type=
"text"
data-params=
'{"custom[status]":"1"
,"custom[type]":"1"
}'
value=
""
>
<small
style=
"color: red"
>
注意:如果成员已添加过族谱,则可选择成员,避免同一个人出现多条信息(非必选)
</small>
</div>
</div>
...
...
application/admin/view/family/family_tree/edit.html
View file @
64062399
...
...
@@ -2,7 +2,7 @@
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('People_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-people_id"
data-source=
"family/family_people/index"
class=
"form-control selectpage"
data-search-field=
"id,name,identity_card,ext3,ext4,ext5"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {name}"
name=
"row[people_id]"
type=
"text"
data-params=
'{"custom[status]":"1"}'
value=
"{$row.people_id|htmlentities}"
>
<input
id=
"c-people_id"
data-source=
"family/family_people/index"
class=
"form-control selectpage"
data-search-field=
"id,name,identity_card,ext3,ext4,ext5"
data-primary-key=
"id"
data-field=
"id"
data-format-item=
"{id} - {name}"
name=
"row[people_id]"
type=
"text"
data-params=
'{"custom[status]":"1"
,"custom[type]":"1"
}'
value=
"{$row.people_id|htmlentities}"
>
<small
style=
"color: red"
>
注意:如果成员已添加过族谱,则可选择成员,避免同一个人出现多条信息(非必选)
</small>
</div>
</div>
...
...
application/api/controller/FamilyTree.php
View file @
64062399
...
...
@@ -149,7 +149,7 @@ class FamilyTree extends Api
//模糊查询族员个人信息
public
function
dimFamilyPeople
(){
$where
=
[]
;
$where
[
'type'
]
=
1
;
$province_id
=
$this
->
request
->
param
(
"province_id"
);
if
(
!
empty
(
$province_id
))
$where
[
'province_id'
]
=
$province_id
;
$city_id
=
$this
->
request
->
param
(
"city_id"
);
...
...
public/assets/js/backend/family/family_people.js
View file @
64062399
...
...
@@ -6,9 +6,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Table
.
api
.
init
({
extend
:
{
index_url
:
'
family/family_people/index
'
+
location
.
search
,
/*
add_url: 'family/family_people/add',
add_url
:
'
family/family_people/add
'
,
edit_url
:
'
family/family_people/edit
'
,
del_url: 'family/family_people/del',
/*
del_url: 'family/family_people/del',
multi_url: 'family/family_people/multi',
import_url: 'family/family_people/import',*/
table
:
'
family_people
'
,
...
...
@@ -16,12 +16,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
});
var
table
=
$
(
"
#table
"
);
// 初始化表格
table
.
bootstrapTable
({
url
:
$
.
fn
.
bootstrapTable
.
defaults
.
extend
.
index_url
,
pk
:
'
id
'
,
sortName
:
'
id
'
,
queryParams
:
function
(
params
)
{
//自定义搜索条件
var
filter
=
params
.
filter
?
JSON
.
parse
(
params
.
filter
)
:
{};
//判断当前是否还有其他高级搜索栏的条件
var
op
=
params
.
op
?
JSON
.
parse
(
params
.
op
)
:
{};
//并将搜索过滤器 转为对象方便我们追加条件
filter
.
type
=
Config
.
type
;
//将透传的参数 Config.group_id,追加到搜索条件中
op
.
type
=
"
=
"
;
//group_id的操作方法的为 找到相等的
params
.
filter
=
JSON
.
stringify
(
filter
);
//将搜索过滤器和操作方法 都转为JSON字符串
params
.
op
=
JSON
.
stringify
(
op
);
return
params
;
},
columns
:
[
[
{
checkbox
:
true
},
...
...
@@ -35,23 +43,36 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
return
html
;
}
}},
}
,
visible
:
Config
.
type
==
"
2?addtabs=1
"
?
false
:
true
},
{
field
:
'
name
'
,
title
:
__
(
'
Name
'
),
operate
:
'
LIKE
'
},
{
field
:
'
photo
'
,
title
:
__
(
'
Photo
'
),
operate
:
false
,
events
:
Table
.
api
.
events
.
image
,
formatter
:
Table
.
api
.
formatter
.
image
},
{
field
:
'
sex
'
,
title
:
__
(
'
Sex
'
),
searchList
:
{
"
0
"
:
__
(
'
Sex 0
'
),
"
1
"
:
__
(
'
Sex 1
'
),
"
2
"
:
__
(
'
Sex 2
'
)},
formatter
:
Table
.
api
.
formatter
.
normal
},
{
field
:
'
identity_card
'
,
title
:
__
(
'
Identity_card
'
),
operate
:
'
LIKE
'
},
{
field
:
'
ext0
'
,
title
:
__
(
'
Ext0
'
),
searchList
:
{
"
0
"
:
__
(
'
Ext0 0
'
),
"
1
"
:
__
(
'
Ext0 1
'
),
"
2
"
:
__
(
'
Ext0 2
'
)},
formatter
:
Table
.
api
.
formatter
.
normal
},
{
field
:
'
identity_card
'
,
title
:
__
(
'
Identity_card
'
),
operate
:
'
LIKE
'
,
visible
:
Config
.
type
==
"
2?addtabs=1
"
?
false
:
true
},
{
field
:
'
ext0
'
,
title
:
__
(
'
Ext0
'
),
searchList
:
{
"
0
"
:
__
(
'
Ext0 0
'
),
"
1
"
:
__
(
'
Ext0 1
'
),
"
2
"
:
__
(
'
Ext0 2
'
)},
formatter
:
Table
.
api
.
formatter
.
normal
,
visible
:
Config
.
type
==
"
2?addtabs=1
"
?
false
:
true
},
{
field
:
'
ext1
'
,
title
:
__
(
'
Ext1
'
),
operate
:
'
LIKE
'
},
{
field
:
'
ext2
'
,
title
:
__
(
'
Ext2
'
),
operate
:
'
LIKE
'
},
/*{field: 'ext4', title: __('Ext4')},*/
{
field
:
'
ext5
'
,
title
:
__
(
'
Ext5
'
)},
{
field
:
'
ext5
'
,
title
:
__
(
'
Ext5
'
)
,
visible
:
Config
.
type
==
"
2?addtabs=1
"
?
false
:
true
},
{
field
:
'
createtime
'
,
title
:
__
(
'
Createtime
'
),
operate
:
'
RANGE
'
,
addclass
:
'
datetimerange
'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'
address
'
,
title
:
__
(
'
Address
'
),
operate
:
'
LIKE
'
},
{
field
:
'
audit
'
,
title
:
__
(
'
Audit
'
),
searchList
:
{
"
0
"
:
__
(
'
Audit 0
'
),
"
1
"
:
__
(
'
Audit 1
'
),
"
2
"
:
__
(
'
Audit 2
'
)},
formatter
:
Table
.
api
.
formatter
.
normal
},
{
field
:
'
status
'
,
align
:
'
center
'
,
title
:
__
(
'
Status
'
),
searchList
:
{
"
0
"
:
__
(
'
Status 0
'
),
"
1
"
:
__
(
'
Status 1
'
)},
formatter
:
Table
.
api
.
formatter
.
toggle
},
{
field
:
'
is_pay
'
,
title
:
__
(
'
Is_pay
'
),
searchList
:
{
"
0
"
:
__
(
'
Is_pay 0
'
),
"
1
"
:
__
(
'
Is_pay 1
'
)},
formatter
:
Table
.
api
.
formatter
.
normal
},
{
field
:
'
is_pay
'
,
title
:
__
(
'
Is_pay
'
),
searchList
:
{
"
0
"
:
__
(
'
Is_pay 0
'
),
"
1
"
:
__
(
'
Is_pay 1
'
)},
formatter
:
Table
.
api
.
formatter
.
normal
,
visible
:
Config
.
type
==
"
2?addtabs=1
"
?
false
:
true
},
{
field
:
'
operate
'
,
title
:
__
(
'
Operate
'
),
table
:
table
,
buttons
:
[
{
name
:
'
edit
'
,
text
:
__
(
'
修改
'
),
title
:
__
(
'
修改
'
),
classname
:
'
btn btn-xs btn-success btn-editone
'
,
url
:
function
(
row
)
{
return
'
family/family_people/edit
'
;
},
visible
:
function
(
row
){
//控制按钮隐藏方法 判断表格数据是否满足要求,然后隐藏或显示
console
.
log
(
row
);
return
row
.
type
==
2
?
true
:
false
;
}
},
{
name
:
'
details
'
,
text
:
__
(
'
详情
'
),
...
...
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